@nac3/runtime 2.5.0-alpha.4 → 2.5.0-alpha.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.5.0-alpha.5 -- 2026-05-25
4
+
5
+ NAC3 v2.5.0-alpha.5 ships the remaining three assistive blocks of
6
+ the v2.5 line: **Block B tree navigation**, **Block C asistive
7
+ labels**, **Block D effect detection**. The full v2.5 surface is
8
+ now GA: every SHIPPED RFC (V24-01/02/04/05 + V25-01/02/03/04) has
9
+ runtime code + Layer 2 demo + Layer 3 Pilot LIVE evidence.
10
+
11
+ ### Added
12
+
13
+ - **`NAC.narrate(plugin, nac_id) -> string | null`** (RFC V25-03 /
14
+ SPEC sec 17). Canonical human-readable label resolution. Priority:
15
+ `aria-label > visible text > data-nac-label > nac_id`. Nested
16
+ addressable children excluded from parent's visible-text. Whitespace
17
+ values at any tier fall through.
18
+ - **`NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }`**
19
+ (RFC V25-02 / SPEC sec 16). Walks up from `document.activeElement`
20
+ through addressable ancestors. Labels via narrate.
21
+ - **`NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]`**
22
+ (RFC V25-02). Enumerates IMMEDIATE addressable children of rootId
23
+ (or the plugin root). Honours `data-nac-opens` and `data-nac-leaf`
24
+ authoring attributes.
25
+ - **`NAC.expect(plugin, statePath, value, opts?) -> Promise<value>`**
26
+ (RFC V25-04 / SPEC sec 18). Polls `NAC.read()` until the comparator
27
+ returns truthy or the deadline fires (default 5000ms timeout,
28
+ 100ms poll). Rejects `NacError('timeout')` on deadline.
29
+ - **`NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>`**
30
+ (RFC V25-04). Snapshots state, awaits actionFn, snapshots again.
31
+ JSON-stringify compare for the `changed` flag.
32
+
33
+ ### Evidence (Layer 2 + Layer 3 LIVE)
34
+
35
+ - V25-02 tree-nav: L2 18 PASS / L3 LIVE 4 PASS.
36
+ - V25-03 narrate: L2 12 PASS / L3 LIVE 6 PASS.
37
+ - V25-04 expect+diff: L2 17 PASS / L3 LIVE 7 PASS.
38
+
39
+ Each demo + Pilot driver under `demos/` and `scripts/`, evidence in
40
+ `evidence/v25-0{2,3,4}*/<date>/`. Total LIVE Claude cost: ~$0.04.
41
+
42
+ ### Status of v2.5 line
43
+
44
+ All 8 RFCs of the v2.5 line are now SHIPPED with full L2 + L3 LIVE
45
+ evidence. Collabora pilot can now consume the full surface end-to-end.
46
+
47
+ ---
48
+
3
49
  ## 2.5.0-alpha.4 -- 2026-05-25
4
50
 
5
51
  NAC3 v2.5.0-alpha.4 closes the V24-04 contract: every mutating
package/SPEC.md CHANGED
@@ -1337,35 +1337,106 @@ is one of:
1337
1337
 
1338
1338
  ---
1339
1339
 
1340
- ## 16. Tree navigation (v2.5 -- PLANNED, see sec 17 & 18 below)
1340
+ ## 16. Tree navigation (v2.5 -- SHIPPED in 2.5.0-alpha.5 / RFC V25-02)
1341
1341
 
1342
- *Drafting pending. Captures `NAC.context(plugin)` (current
1343
- breadcrumb) + `NAC.tree(plugin, rootId?)` (enumerate hijos
1344
- navegables) + the `data-nac-opens` / `data-nac-leaf` attributes
1345
- that let the chrome declare hierarchical relationships explicitly.*
1342
+ Hierarchical command navigation primitives for assistive flows and
1343
+ voice runners that need to describe what they can do from the
1344
+ current focus.
1345
+
1346
+ **API surface:**
1347
+
1348
+ - `NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }`
1349
+ Walks up from `document.activeElement` through ancestor elements
1350
+ carrying `data-nac-id`, stopping at the plugin root. Returns an
1351
+ empty breadcrumb if nothing is focused inside the plugin. Each
1352
+ crumb's `label` comes from `narrate` (sec 17).
1353
+
1354
+ - `NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]`
1355
+ Enumerates the IMMEDIATE addressable children of `rootId` (or the
1356
+ plugin root if omitted). "Immediate" means no other `data-nac-id`
1357
+ element lies between the start and the child. For each entry:
1358
+ - `label` resolved via `narrate`
1359
+ - `opens` mirrors the `data-nac-opens` attribute when present
1360
+ - `leaf` is `true` when `data-nac-leaf` is present
1361
+
1362
+ **Authoring attributes:**
1363
+
1364
+ - `data-nac-opens="<target-nac-id>"`: declares this node opens /
1365
+ drills into the element identified by the target id. Lets agents
1366
+ follow the navigation chain without guessing names.
1367
+ - `data-nac-leaf`: explicit terminal marker; downstream agents know
1368
+ no further drill is possible.
1369
+
1370
+ **Errors:** `tree` returns `[]` for an unknown rootId (silent
1371
+ empty, not an error). `context` always returns
1372
+ `{ breadcrumb: [] }` for unknown plugins.
1346
1373
 
1347
1374
  ---
1348
1375
 
1349
- ## 17. Asistive labels (v2.5 -- PLANNED)
1376
+ ## 17. Asistive labels (v2.5 -- SHIPPED in 2.5.0-alpha.5 / RFC V25-03)
1377
+
1378
+ Canonical human-readable label resolution. One function for screen
1379
+ readers, TTS, voice flows, audit logs, mobile assistive surfaces.
1380
+
1381
+ **API surface:**
1382
+
1383
+ - `NAC.narrate(plugin, nac_id) -> string | null`
1384
+ Returns `null` if the plugin or nac_id cannot be found. Otherwise
1385
+ the label following this strict priority order:
1350
1386
 
1351
- *Drafting pending. Captures `NAC.narrate(plugin, nodeId)` (return
1352
- the canonical human-readable label for screen reader / TTS),
1353
- validation warnings for ordinal-shaped ids and for nodes that
1354
- have no readable label.*
1387
+ 1. **`aria-label`** -- a11y-first; respected unless whitespace-only.
1388
+ 2. **visible text** -- `textContent` of the element excluding any
1389
+ nested `data-nac-id` subtrees (those have their own narrate
1390
+ resolution; they get excluded so spoken output stays scoped).
1391
+ 3. **`data-nac-label`** -- explicit author override; useful when
1392
+ visible text contains icon glyphs or i18n keys.
1393
+ 4. **`nac_id` fallback** -- worst case; signals "no label authored".
1394
+
1395
+ Whitespace-only values at any tier collapse to the next tier.
1396
+
1397
+ **Validation:** `validate_global()` may emit warnings in the
1398
+ `plugin_instance_violations` bucket for ordinal-shaped nac_ids
1399
+ (`btn-1`, `btn-2`, ...) lacking any of the upper-tier labels.
1355
1400
 
1356
1401
  ---
1357
1402
 
1358
- ## 18. Effect detection (v2.5 -- PLANNED)
1403
+ ## 18. Effect detection (v2.5 -- SHIPPED in 2.5.0-alpha.5 / RFC V25-04)
1404
+
1405
+ Closes the "silent damage" gap: an agent confirms the EFFECT of
1406
+ an action, not just that the command was emitted. Both primitives
1407
+ compose with `NAC.read()` so any V25-01 backend works (postmessage,
1408
+ sdk-call, dom-mirror, ...).
1409
+
1410
+ **API surface:**
1411
+
1412
+ - `NAC.expect(plugin, statePath, value, opts?) -> Promise<value>`
1413
+ Polls `NAC.read(plugin, statePath)` until the comparator returns
1414
+ truthy or the deadline fires. Resolves with the resolved value;
1415
+ rejects with `NacError('timeout', ...)` on deadline.
1416
+
1417
+ Read failures during polling are retried until the deadline
1418
+ (treated as "not yet observable", not as a hard error).
1419
+
1420
+ Options:
1421
+ - `timeout_ms` (default `5000`)
1422
+ - `poll_ms` (default `100`)
1423
+ - `comparator` (default `(cur, want) => cur === want`)
1424
+ Receives `(current, expected)`, returns boolean.
1425
+
1426
+ - `NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>`
1427
+ Reads state, awaits `actionFn()`, reads state again. Returns
1428
+ both snapshots and a `changed` boolean computed via JSON-stringify
1429
+ compare (so `undefined`-vs-value still flags as changed).
1430
+ Read failures collapse to `undefined`.
1359
1431
 
1360
- *Drafting pending. Captures `NAC.expect(plugin, statePath, value,
1361
- opts?)` (Promise that resolves when a state matches an expected
1362
- value within a timeout) and `NAC.diff(plugin, statePath, beforeFn,
1363
- afterFn)` (snapshot a state pre- and post- an action).*
1432
+ **Composition notes:** `diff` only captures the START and END
1433
+ snapshot; it does NOT observe intermediate states inside the
1434
+ action. Use `expect` if your concern is "the state passes through
1435
+ some specific value at some point".
1364
1436
 
1365
1437
  ---
1366
1438
 
1367
- *This document is the canonical NAC3 v2.5-draft specification.
1368
- Sections 0-14 are unchanged from v2.4 stable. Section 15 is GA
1369
- in v2.5; sections 16-18 are in active drafting. Edits to this
1370
- file constitute spec changes and require an RFC; see
1371
- `CONTRIBUTING.md`.*
1439
+ *This document is the canonical NAC3 v2.5 specification.
1440
+ Sections 0-14 are unchanged from v2.4 stable. Sections 15-18 ship
1441
+ in v2.5. Edits to this file constitute spec changes and require an
1442
+ RFC; see `CONTRIBUTING.md`.*
@@ -7590,11 +7590,251 @@
7590
7590
  }
7591
7591
  }
7592
7592
 
7593
+ /* ================================================================
7594
+ v2.5 Block C -- RFC V25-03: asistive labels (narrate)
7595
+ ================================================================
7596
+
7597
+ NAC.narrate(plugin, nac_id) -> string
7598
+ Canonical human-readable label for any nac_id in the plugin's
7599
+ DOM. Priority order:
7600
+ 1. aria-label (a11y-first)
7601
+ 2. visible text (the human reading the chrome)
7602
+ 3. data-nac-label (author override)
7603
+ 4. nac_id (worst case)
7604
+
7605
+ For elements where the visible text leaks child-interactive
7606
+ content (eg a button containing an icon and a label), narrate
7607
+ prefers the FIRST text node directly under the element so the
7608
+ spoken output stays focused.
7609
+
7610
+ Returns null only if the element cannot be found (unknown
7611
+ nac_id or unknown plugin). Empty/whitespace labels collapse to
7612
+ the next priority tier. */
7613
+
7614
+ function _v25c_visibleText(el) {
7615
+ if (!el) return '';
7616
+ /* Collect text directly under el, excluding nested elements that
7617
+ are themselves nac-addressable (those have their own narrate
7618
+ resolution). */
7619
+ let out = '';
7620
+ for (let n = el.firstChild; n; n = n.nextSibling) {
7621
+ if (n.nodeType === 3 /* TEXT_NODE */) {
7622
+ out += n.nodeValue || '';
7623
+ } else if (n.nodeType === 1 /* ELEMENT_NODE */) {
7624
+ /* Skip nested nac-addressable subtrees -- they have their
7625
+ own label. */
7626
+ if (n.getAttribute && n.getAttribute('data-nac-id')) continue;
7627
+ /* Recurse into non-addressable children (typical: icon
7628
+ <span> + text). */
7629
+ out += _v25c_visibleText(n);
7630
+ }
7631
+ }
7632
+ return out.replace(/\s+/g, ' ').trim();
7633
+ }
7634
+
7635
+ function narrate(plugin, nac_id) {
7636
+ if (typeof nac_id !== 'string' || !nac_id) return null;
7637
+ /* Scope by plugin if provided -- look only inside [data-nac-plugin=plugin]
7638
+ subtree. If plugin is omitted, fall back to global search. */
7639
+ let root = document;
7640
+ if (plugin) {
7641
+ const pluginRoot = document.querySelector('[data-nac-plugin="' + plugin + '"]');
7642
+ if (!pluginRoot) return null;
7643
+ root = pluginRoot;
7644
+ }
7645
+ /* Use attribute selector with CSS-safe escape via JSON.stringify
7646
+ to avoid injection when nac_id contains weird chars. */
7647
+ const safeId = '"' + String(nac_id).replace(/["\\]/g, '\\$&') + '"';
7648
+ const el = root.querySelector('[data-nac-id=' + safeId + ']');
7649
+ if (!el) return null;
7650
+ /* 1. aria-label */
7651
+ const aria = el.getAttribute('aria-label');
7652
+ if (aria && aria.trim()) return aria.trim();
7653
+ /* 2. visible text (direct + nested non-addressable) */
7654
+ const vis = _v25c_visibleText(el);
7655
+ if (vis) return vis;
7656
+ /* 3. data-nac-label */
7657
+ const explicit = el.getAttribute('data-nac-label');
7658
+ if (explicit && explicit.trim()) return explicit.trim();
7659
+ /* 4. nac_id fallback */
7660
+ return nac_id;
7661
+ }
7662
+
7663
+ /* ================================================================
7664
+ v2.5 Block B -- RFC V25-02: tree navigation
7665
+ ================================================================
7666
+
7667
+ NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }
7668
+ Walks up from document.activeElement through ancestor nac-id
7669
+ elements within the plugin subtree. Empty array when nothing
7670
+ focused inside the plugin.
7671
+
7672
+ NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]
7673
+ Enumerates the IMMEDIATE addressable children of rootId (or the
7674
+ plugin root when rootId is omitted). "Immediate" means: there
7675
+ are no other nac-id elements between them and the start. Each
7676
+ entry reports the data-nac-opens target slug (if any) and a
7677
+ boolean leaf flag (data-nac-leaf attribute present).
7678
+
7679
+ Both functions delegate label resolution to narrate(). */
7680
+
7681
+ function _v25b_pluginRoot(plugin) {
7682
+ if (!plugin) return null;
7683
+ return document.querySelector('[data-nac-plugin="' + plugin + '"]');
7684
+ }
7685
+
7686
+ function context(plugin) {
7687
+ const out = { breadcrumb: [] };
7688
+ const root = _v25b_pluginRoot(plugin);
7689
+ if (!root) return out;
7690
+ const active = document.activeElement;
7691
+ if (!active || !root.contains(active)) return out;
7692
+ /* Walk up; collect each ancestor that owns a data-nac-id. Stop
7693
+ at the plugin root inclusive (root itself may not carry a
7694
+ nac-id -- in that case we just stop there). */
7695
+ let cur = active;
7696
+ while (cur && cur !== root.parentElement) {
7697
+ const id = cur.getAttribute && cur.getAttribute('data-nac-id');
7698
+ if (id) {
7699
+ out.breadcrumb.unshift({ nac_id: id, label: narrate(plugin, id) });
7700
+ }
7701
+ if (cur === root) break;
7702
+ cur = cur.parentElement;
7703
+ }
7704
+ return out;
7705
+ }
7706
+
7707
+ function _v25b_isImmediate(start, node) {
7708
+ /* True if `node` has no OTHER nac-id ancestor between itself and
7709
+ `start`. Excludes node === start and ancestors above start. */
7710
+ let p = node.parentElement;
7711
+ while (p && p !== start) {
7712
+ if (p.getAttribute && p.getAttribute('data-nac-id')) return false;
7713
+ p = p.parentElement;
7714
+ }
7715
+ return true;
7716
+ }
7717
+
7718
+ /* ================================================================
7719
+ v2.5 Block D -- RFC V25-04: effect detection (expect + diff)
7720
+ ================================================================
7721
+
7722
+ NAC.expect(plugin, statePath, value, opts?) -> Promise
7723
+ Polls NAC.read(plugin, statePath) until the returned value
7724
+ satisfies the comparator (default ===) or the timeout fires.
7725
+ Resolves with the resolved value on match.
7726
+ Rejects with NacError('timeout', ...) on deadline.
7727
+ Read failures are retried until the deadline (treated as
7728
+ "the state is not yet observable").
7729
+
7730
+ opts:
7731
+ timeout_ms default 5000
7732
+ poll_ms default 100
7733
+ comparator default (cur, want) => cur === want
7734
+ receives (current, expected) and returns boolean
7735
+
7736
+ NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>
7737
+ Reads state, awaits actionFn(), reads state again, returns
7738
+ both snapshots + a `changed` boolean (JSON-stringify compare).
7739
+ Read failures collapse to undefined and changed is computed
7740
+ on the stringified pair (so undefined vs value still flags).
7741
+
7742
+ Both delegate to NAC.read() so they inherit V25-01's full
7743
+ fallback-chain semantics for free. */
7744
+
7745
+ function expect(plugin, statePath, value, opts) {
7746
+ opts = opts || {};
7747
+ const timeout = (typeof opts.timeout_ms === 'number') ? opts.timeout_ms : 5000;
7748
+ const pollMs = (typeof opts.poll_ms === 'number') ? opts.poll_ms : 100;
7749
+ const cmp = (typeof opts.comparator === 'function')
7750
+ ? opts.comparator
7751
+ : function (cur, want) { return cur === want; };
7752
+ const deadline = Date.now() + timeout;
7753
+ return new Promise(function (resolve, reject) {
7754
+ function tick() {
7755
+ read(plugin, statePath).then(function (cur) {
7756
+ let matches = false;
7757
+ try { matches = !!cmp(cur, value); }
7758
+ catch (_) { matches = false; }
7759
+ if (matches) { resolve(cur); return; }
7760
+ if (Date.now() >= deadline) {
7761
+ reject(_v25_buildNacError('timeout',
7762
+ 'NAC.expect: state "' + statePath + '" did not match within ' +
7763
+ timeout + 'ms (last value: ' + JSON.stringify(cur) + ')'));
7764
+ return;
7765
+ }
7766
+ setTimeout(tick, pollMs);
7767
+ }, function (_err) {
7768
+ if (Date.now() >= deadline) {
7769
+ reject(_v25_buildNacError('timeout',
7770
+ 'NAC.expect: state "' + statePath + '" unreadable + timeout'));
7771
+ return;
7772
+ }
7773
+ setTimeout(tick, pollMs);
7774
+ });
7775
+ }
7776
+ tick();
7777
+ });
7778
+ }
7779
+
7780
+ function diff(plugin, statePath, actionFn) {
7781
+ function safeRead() {
7782
+ return read(plugin, statePath).then(
7783
+ function (v) { return v; },
7784
+ function () { return undefined; }
7785
+ );
7786
+ }
7787
+ return safeRead().then(function (before) {
7788
+ const act = (typeof actionFn === 'function')
7789
+ ? Promise.resolve(actionFn())
7790
+ : Promise.resolve();
7791
+ return act.then(function () {
7792
+ return safeRead().then(function (after) {
7793
+ let changed;
7794
+ try {
7795
+ changed = JSON.stringify(before) !== JSON.stringify(after);
7796
+ } catch (_) {
7797
+ changed = before !== after;
7798
+ }
7799
+ return { before: before, after: after, changed: changed };
7800
+ });
7801
+ });
7802
+ });
7803
+ }
7804
+
7805
+ function tree(plugin, rootId) {
7806
+ const pluginRoot = _v25b_pluginRoot(plugin);
7807
+ if (!pluginRoot) return [];
7808
+ let start = pluginRoot;
7809
+ if (rootId) {
7810
+ const safeId = '"' + String(rootId).replace(/["\\]/g, '\\$&') + '"';
7811
+ const found = pluginRoot.querySelector('[data-nac-id=' + safeId + ']');
7812
+ if (!found) return [];
7813
+ start = found;
7814
+ }
7815
+ const candidates = start.querySelectorAll('[data-nac-id]');
7816
+ const out = [];
7817
+ for (let i = 0; i < candidates.length; i++) {
7818
+ const k = candidates[i];
7819
+ if (!_v25b_isImmediate(start, k)) continue;
7820
+ const id = k.getAttribute('data-nac-id');
7821
+ const entry = {
7822
+ nac_id: id,
7823
+ label: narrate(plugin, id),
7824
+ };
7825
+ const opens = k.getAttribute('data-nac-opens');
7826
+ if (opens) entry.opens = opens;
7827
+ if (k.hasAttribute('data-nac-leaf')) entry.leaf = true;
7828
+ out.push(entry);
7829
+ }
7830
+ return out;
7831
+ }
7832
+
7593
7833
  /* ---------- Install -------------------------------------------- */
7594
7834
 
7595
7835
  global.NAC = {
7596
7836
  __nac_v1_installed: true,
7597
- version: '2.5.0-alpha.4',
7837
+ version: '2.5.0-alpha.5',
7598
7838
  spec_version: '2.5',
7599
7839
  /* v2.2.0 (V22-01) -- strict validation toggle. When true,
7600
7840
  NAC.register throws on findings (manifest_role_unknown,
@@ -7845,6 +8085,25 @@
7845
8085
  read: read,
7846
8086
  subscribe: subscribe,
7847
8087
  unsubscribe: unsubscribe,
8088
+ /* v2.5 Block C -- asistive labels (SPEC.md sec 17 / RFC V25-03).
8089
+ Canonical human-readable label resolution for screen readers,
8090
+ TTS, voice flows, audit logs. Priority order: aria-label >
8091
+ visible text > data-nac-label > nac_id fallback. */
8092
+ narrate: narrate,
8093
+ /* v2.5 Block B -- tree navigation (SPEC.md sec 16 / RFC V25-02).
8094
+ context(plugin) returns the focused node's breadcrumb;
8095
+ tree(plugin, rootId?) enumerates navigable children.
8096
+ data-nac-opens declares parent->child relationships; data-nac-leaf
8097
+ marks terminals. Companion to narrate for chrome-driven walks. */
8098
+ context: context,
8099
+ tree: tree,
8100
+ /* v2.5 Block D -- effect detection (SPEC.md sec 18 / RFC V25-04).
8101
+ Closes the "silent damage" gap for assistive callers: the agent
8102
+ confirms the EFFECT of an action, not just that the command was
8103
+ emitted. expect() polls until a state matches; diff() snapshots
8104
+ around an action. Both compose with NAC.read() / V25-01 surface. */
8105
+ expect: expect,
8106
+ diff: diff,
7848
8107
  };
7849
8108
 
7850
8109
  /* v2.2.1: guard browser-only init so this module is importable in
package/dist/nac.cjs CHANGED
@@ -7591,11 +7591,251 @@ const _g = typeof globalThis !== 'undefined' ? globalThis : (typeof window !== '
7591
7591
  }
7592
7592
  }
7593
7593
 
7594
+ /* ================================================================
7595
+ v2.5 Block C -- RFC V25-03: asistive labels (narrate)
7596
+ ================================================================
7597
+
7598
+ NAC.narrate(plugin, nac_id) -> string
7599
+ Canonical human-readable label for any nac_id in the plugin's
7600
+ DOM. Priority order:
7601
+ 1. aria-label (a11y-first)
7602
+ 2. visible text (the human reading the chrome)
7603
+ 3. data-nac-label (author override)
7604
+ 4. nac_id (worst case)
7605
+
7606
+ For elements where the visible text leaks child-interactive
7607
+ content (eg a button containing an icon and a label), narrate
7608
+ prefers the FIRST text node directly under the element so the
7609
+ spoken output stays focused.
7610
+
7611
+ Returns null only if the element cannot be found (unknown
7612
+ nac_id or unknown plugin). Empty/whitespace labels collapse to
7613
+ the next priority tier. */
7614
+
7615
+ function _v25c_visibleText(el) {
7616
+ if (!el) return '';
7617
+ /* Collect text directly under el, excluding nested elements that
7618
+ are themselves nac-addressable (those have their own narrate
7619
+ resolution). */
7620
+ let out = '';
7621
+ for (let n = el.firstChild; n; n = n.nextSibling) {
7622
+ if (n.nodeType === 3 /* TEXT_NODE */) {
7623
+ out += n.nodeValue || '';
7624
+ } else if (n.nodeType === 1 /* ELEMENT_NODE */) {
7625
+ /* Skip nested nac-addressable subtrees -- they have their
7626
+ own label. */
7627
+ if (n.getAttribute && n.getAttribute('data-nac-id')) continue;
7628
+ /* Recurse into non-addressable children (typical: icon
7629
+ <span> + text). */
7630
+ out += _v25c_visibleText(n);
7631
+ }
7632
+ }
7633
+ return out.replace(/\s+/g, ' ').trim();
7634
+ }
7635
+
7636
+ function narrate(plugin, nac_id) {
7637
+ if (typeof nac_id !== 'string' || !nac_id) return null;
7638
+ /* Scope by plugin if provided -- look only inside [data-nac-plugin=plugin]
7639
+ subtree. If plugin is omitted, fall back to global search. */
7640
+ let root = document;
7641
+ if (plugin) {
7642
+ const pluginRoot = document.querySelector('[data-nac-plugin="' + plugin + '"]');
7643
+ if (!pluginRoot) return null;
7644
+ root = pluginRoot;
7645
+ }
7646
+ /* Use attribute selector with CSS-safe escape via JSON.stringify
7647
+ to avoid injection when nac_id contains weird chars. */
7648
+ const safeId = '"' + String(nac_id).replace(/["\\]/g, '\\$&') + '"';
7649
+ const el = root.querySelector('[data-nac-id=' + safeId + ']');
7650
+ if (!el) return null;
7651
+ /* 1. aria-label */
7652
+ const aria = el.getAttribute('aria-label');
7653
+ if (aria && aria.trim()) return aria.trim();
7654
+ /* 2. visible text (direct + nested non-addressable) */
7655
+ const vis = _v25c_visibleText(el);
7656
+ if (vis) return vis;
7657
+ /* 3. data-nac-label */
7658
+ const explicit = el.getAttribute('data-nac-label');
7659
+ if (explicit && explicit.trim()) return explicit.trim();
7660
+ /* 4. nac_id fallback */
7661
+ return nac_id;
7662
+ }
7663
+
7664
+ /* ================================================================
7665
+ v2.5 Block B -- RFC V25-02: tree navigation
7666
+ ================================================================
7667
+
7668
+ NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }
7669
+ Walks up from document.activeElement through ancestor nac-id
7670
+ elements within the plugin subtree. Empty array when nothing
7671
+ focused inside the plugin.
7672
+
7673
+ NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]
7674
+ Enumerates the IMMEDIATE addressable children of rootId (or the
7675
+ plugin root when rootId is omitted). "Immediate" means: there
7676
+ are no other nac-id elements between them and the start. Each
7677
+ entry reports the data-nac-opens target slug (if any) and a
7678
+ boolean leaf flag (data-nac-leaf attribute present).
7679
+
7680
+ Both functions delegate label resolution to narrate(). */
7681
+
7682
+ function _v25b_pluginRoot(plugin) {
7683
+ if (!plugin) return null;
7684
+ return document.querySelector('[data-nac-plugin="' + plugin + '"]');
7685
+ }
7686
+
7687
+ function context(plugin) {
7688
+ const out = { breadcrumb: [] };
7689
+ const root = _v25b_pluginRoot(plugin);
7690
+ if (!root) return out;
7691
+ const active = document.activeElement;
7692
+ if (!active || !root.contains(active)) return out;
7693
+ /* Walk up; collect each ancestor that owns a data-nac-id. Stop
7694
+ at the plugin root inclusive (root itself may not carry a
7695
+ nac-id -- in that case we just stop there). */
7696
+ let cur = active;
7697
+ while (cur && cur !== root.parentElement) {
7698
+ const id = cur.getAttribute && cur.getAttribute('data-nac-id');
7699
+ if (id) {
7700
+ out.breadcrumb.unshift({ nac_id: id, label: narrate(plugin, id) });
7701
+ }
7702
+ if (cur === root) break;
7703
+ cur = cur.parentElement;
7704
+ }
7705
+ return out;
7706
+ }
7707
+
7708
+ function _v25b_isImmediate(start, node) {
7709
+ /* True if `node` has no OTHER nac-id ancestor between itself and
7710
+ `start`. Excludes node === start and ancestors above start. */
7711
+ let p = node.parentElement;
7712
+ while (p && p !== start) {
7713
+ if (p.getAttribute && p.getAttribute('data-nac-id')) return false;
7714
+ p = p.parentElement;
7715
+ }
7716
+ return true;
7717
+ }
7718
+
7719
+ /* ================================================================
7720
+ v2.5 Block D -- RFC V25-04: effect detection (expect + diff)
7721
+ ================================================================
7722
+
7723
+ NAC.expect(plugin, statePath, value, opts?) -> Promise
7724
+ Polls NAC.read(plugin, statePath) until the returned value
7725
+ satisfies the comparator (default ===) or the timeout fires.
7726
+ Resolves with the resolved value on match.
7727
+ Rejects with NacError('timeout', ...) on deadline.
7728
+ Read failures are retried until the deadline (treated as
7729
+ "the state is not yet observable").
7730
+
7731
+ opts:
7732
+ timeout_ms default 5000
7733
+ poll_ms default 100
7734
+ comparator default (cur, want) => cur === want
7735
+ receives (current, expected) and returns boolean
7736
+
7737
+ NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>
7738
+ Reads state, awaits actionFn(), reads state again, returns
7739
+ both snapshots + a `changed` boolean (JSON-stringify compare).
7740
+ Read failures collapse to undefined and changed is computed
7741
+ on the stringified pair (so undefined vs value still flags).
7742
+
7743
+ Both delegate to NAC.read() so they inherit V25-01's full
7744
+ fallback-chain semantics for free. */
7745
+
7746
+ function expect(plugin, statePath, value, opts) {
7747
+ opts = opts || {};
7748
+ const timeout = (typeof opts.timeout_ms === 'number') ? opts.timeout_ms : 5000;
7749
+ const pollMs = (typeof opts.poll_ms === 'number') ? opts.poll_ms : 100;
7750
+ const cmp = (typeof opts.comparator === 'function')
7751
+ ? opts.comparator
7752
+ : function (cur, want) { return cur === want; };
7753
+ const deadline = Date.now() + timeout;
7754
+ return new Promise(function (resolve, reject) {
7755
+ function tick() {
7756
+ read(plugin, statePath).then(function (cur) {
7757
+ let matches = false;
7758
+ try { matches = !!cmp(cur, value); }
7759
+ catch (_) { matches = false; }
7760
+ if (matches) { resolve(cur); return; }
7761
+ if (Date.now() >= deadline) {
7762
+ reject(_v25_buildNacError('timeout',
7763
+ 'NAC.expect: state "' + statePath + '" did not match within ' +
7764
+ timeout + 'ms (last value: ' + JSON.stringify(cur) + ')'));
7765
+ return;
7766
+ }
7767
+ setTimeout(tick, pollMs);
7768
+ }, function (_err) {
7769
+ if (Date.now() >= deadline) {
7770
+ reject(_v25_buildNacError('timeout',
7771
+ 'NAC.expect: state "' + statePath + '" unreadable + timeout'));
7772
+ return;
7773
+ }
7774
+ setTimeout(tick, pollMs);
7775
+ });
7776
+ }
7777
+ tick();
7778
+ });
7779
+ }
7780
+
7781
+ function diff(plugin, statePath, actionFn) {
7782
+ function safeRead() {
7783
+ return read(plugin, statePath).then(
7784
+ function (v) { return v; },
7785
+ function () { return undefined; }
7786
+ );
7787
+ }
7788
+ return safeRead().then(function (before) {
7789
+ const act = (typeof actionFn === 'function')
7790
+ ? Promise.resolve(actionFn())
7791
+ : Promise.resolve();
7792
+ return act.then(function () {
7793
+ return safeRead().then(function (after) {
7794
+ let changed;
7795
+ try {
7796
+ changed = JSON.stringify(before) !== JSON.stringify(after);
7797
+ } catch (_) {
7798
+ changed = before !== after;
7799
+ }
7800
+ return { before: before, after: after, changed: changed };
7801
+ });
7802
+ });
7803
+ });
7804
+ }
7805
+
7806
+ function tree(plugin, rootId) {
7807
+ const pluginRoot = _v25b_pluginRoot(plugin);
7808
+ if (!pluginRoot) return [];
7809
+ let start = pluginRoot;
7810
+ if (rootId) {
7811
+ const safeId = '"' + String(rootId).replace(/["\\]/g, '\\$&') + '"';
7812
+ const found = pluginRoot.querySelector('[data-nac-id=' + safeId + ']');
7813
+ if (!found) return [];
7814
+ start = found;
7815
+ }
7816
+ const candidates = start.querySelectorAll('[data-nac-id]');
7817
+ const out = [];
7818
+ for (let i = 0; i < candidates.length; i++) {
7819
+ const k = candidates[i];
7820
+ if (!_v25b_isImmediate(start, k)) continue;
7821
+ const id = k.getAttribute('data-nac-id');
7822
+ const entry = {
7823
+ nac_id: id,
7824
+ label: narrate(plugin, id),
7825
+ };
7826
+ const opens = k.getAttribute('data-nac-opens');
7827
+ if (opens) entry.opens = opens;
7828
+ if (k.hasAttribute('data-nac-leaf')) entry.leaf = true;
7829
+ out.push(entry);
7830
+ }
7831
+ return out;
7832
+ }
7833
+
7594
7834
  /* ---------- Install -------------------------------------------- */
7595
7835
 
7596
7836
  global.NAC = {
7597
7837
  __nac_v1_installed: true,
7598
- version: '2.5.0-alpha.4',
7838
+ version: '2.5.0-alpha.5',
7599
7839
  spec_version: '2.5',
7600
7840
  /* v2.2.0 (V22-01) -- strict validation toggle. When true,
7601
7841
  NAC.register throws on findings (manifest_role_unknown,
@@ -7846,6 +8086,25 @@ const _g = typeof globalThis !== 'undefined' ? globalThis : (typeof window !== '
7846
8086
  read: read,
7847
8087
  subscribe: subscribe,
7848
8088
  unsubscribe: unsubscribe,
8089
+ /* v2.5 Block C -- asistive labels (SPEC.md sec 17 / RFC V25-03).
8090
+ Canonical human-readable label resolution for screen readers,
8091
+ TTS, voice flows, audit logs. Priority order: aria-label >
8092
+ visible text > data-nac-label > nac_id fallback. */
8093
+ narrate: narrate,
8094
+ /* v2.5 Block B -- tree navigation (SPEC.md sec 16 / RFC V25-02).
8095
+ context(plugin) returns the focused node's breadcrumb;
8096
+ tree(plugin, rootId?) enumerates navigable children.
8097
+ data-nac-opens declares parent->child relationships; data-nac-leaf
8098
+ marks terminals. Companion to narrate for chrome-driven walks. */
8099
+ context: context,
8100
+ tree: tree,
8101
+ /* v2.5 Block D -- effect detection (SPEC.md sec 18 / RFC V25-04).
8102
+ Closes the "silent damage" gap for assistive callers: the agent
8103
+ confirms the EFFECT of an action, not just that the command was
8104
+ emitted. expect() polls until a state matches; diff() snapshots
8105
+ around an action. Both compose with NAC.read() / V25-01 surface. */
8106
+ expect: expect,
8107
+ diff: diff,
7849
8108
  };
7850
8109
 
7851
8110
  /* v2.2.1: guard browser-only init so this module is importable in
package/dist/nac.mjs CHANGED
@@ -7591,11 +7591,251 @@ const _g = typeof globalThis !== 'undefined' ? globalThis : (typeof window !== '
7591
7591
  }
7592
7592
  }
7593
7593
 
7594
+ /* ================================================================
7595
+ v2.5 Block C -- RFC V25-03: asistive labels (narrate)
7596
+ ================================================================
7597
+
7598
+ NAC.narrate(plugin, nac_id) -> string
7599
+ Canonical human-readable label for any nac_id in the plugin's
7600
+ DOM. Priority order:
7601
+ 1. aria-label (a11y-first)
7602
+ 2. visible text (the human reading the chrome)
7603
+ 3. data-nac-label (author override)
7604
+ 4. nac_id (worst case)
7605
+
7606
+ For elements where the visible text leaks child-interactive
7607
+ content (eg a button containing an icon and a label), narrate
7608
+ prefers the FIRST text node directly under the element so the
7609
+ spoken output stays focused.
7610
+
7611
+ Returns null only if the element cannot be found (unknown
7612
+ nac_id or unknown plugin). Empty/whitespace labels collapse to
7613
+ the next priority tier. */
7614
+
7615
+ function _v25c_visibleText(el) {
7616
+ if (!el) return '';
7617
+ /* Collect text directly under el, excluding nested elements that
7618
+ are themselves nac-addressable (those have their own narrate
7619
+ resolution). */
7620
+ let out = '';
7621
+ for (let n = el.firstChild; n; n = n.nextSibling) {
7622
+ if (n.nodeType === 3 /* TEXT_NODE */) {
7623
+ out += n.nodeValue || '';
7624
+ } else if (n.nodeType === 1 /* ELEMENT_NODE */) {
7625
+ /* Skip nested nac-addressable subtrees -- they have their
7626
+ own label. */
7627
+ if (n.getAttribute && n.getAttribute('data-nac-id')) continue;
7628
+ /* Recurse into non-addressable children (typical: icon
7629
+ <span> + text). */
7630
+ out += _v25c_visibleText(n);
7631
+ }
7632
+ }
7633
+ return out.replace(/\s+/g, ' ').trim();
7634
+ }
7635
+
7636
+ function narrate(plugin, nac_id) {
7637
+ if (typeof nac_id !== 'string' || !nac_id) return null;
7638
+ /* Scope by plugin if provided -- look only inside [data-nac-plugin=plugin]
7639
+ subtree. If plugin is omitted, fall back to global search. */
7640
+ let root = document;
7641
+ if (plugin) {
7642
+ const pluginRoot = document.querySelector('[data-nac-plugin="' + plugin + '"]');
7643
+ if (!pluginRoot) return null;
7644
+ root = pluginRoot;
7645
+ }
7646
+ /* Use attribute selector with CSS-safe escape via JSON.stringify
7647
+ to avoid injection when nac_id contains weird chars. */
7648
+ const safeId = '"' + String(nac_id).replace(/["\\]/g, '\\$&') + '"';
7649
+ const el = root.querySelector('[data-nac-id=' + safeId + ']');
7650
+ if (!el) return null;
7651
+ /* 1. aria-label */
7652
+ const aria = el.getAttribute('aria-label');
7653
+ if (aria && aria.trim()) return aria.trim();
7654
+ /* 2. visible text (direct + nested non-addressable) */
7655
+ const vis = _v25c_visibleText(el);
7656
+ if (vis) return vis;
7657
+ /* 3. data-nac-label */
7658
+ const explicit = el.getAttribute('data-nac-label');
7659
+ if (explicit && explicit.trim()) return explicit.trim();
7660
+ /* 4. nac_id fallback */
7661
+ return nac_id;
7662
+ }
7663
+
7664
+ /* ================================================================
7665
+ v2.5 Block B -- RFC V25-02: tree navigation
7666
+ ================================================================
7667
+
7668
+ NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }
7669
+ Walks up from document.activeElement through ancestor nac-id
7670
+ elements within the plugin subtree. Empty array when nothing
7671
+ focused inside the plugin.
7672
+
7673
+ NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]
7674
+ Enumerates the IMMEDIATE addressable children of rootId (or the
7675
+ plugin root when rootId is omitted). "Immediate" means: there
7676
+ are no other nac-id elements between them and the start. Each
7677
+ entry reports the data-nac-opens target slug (if any) and a
7678
+ boolean leaf flag (data-nac-leaf attribute present).
7679
+
7680
+ Both functions delegate label resolution to narrate(). */
7681
+
7682
+ function _v25b_pluginRoot(plugin) {
7683
+ if (!plugin) return null;
7684
+ return document.querySelector('[data-nac-plugin="' + plugin + '"]');
7685
+ }
7686
+
7687
+ function context(plugin) {
7688
+ const out = { breadcrumb: [] };
7689
+ const root = _v25b_pluginRoot(plugin);
7690
+ if (!root) return out;
7691
+ const active = document.activeElement;
7692
+ if (!active || !root.contains(active)) return out;
7693
+ /* Walk up; collect each ancestor that owns a data-nac-id. Stop
7694
+ at the plugin root inclusive (root itself may not carry a
7695
+ nac-id -- in that case we just stop there). */
7696
+ let cur = active;
7697
+ while (cur && cur !== root.parentElement) {
7698
+ const id = cur.getAttribute && cur.getAttribute('data-nac-id');
7699
+ if (id) {
7700
+ out.breadcrumb.unshift({ nac_id: id, label: narrate(plugin, id) });
7701
+ }
7702
+ if (cur === root) break;
7703
+ cur = cur.parentElement;
7704
+ }
7705
+ return out;
7706
+ }
7707
+
7708
+ function _v25b_isImmediate(start, node) {
7709
+ /* True if `node` has no OTHER nac-id ancestor between itself and
7710
+ `start`. Excludes node === start and ancestors above start. */
7711
+ let p = node.parentElement;
7712
+ while (p && p !== start) {
7713
+ if (p.getAttribute && p.getAttribute('data-nac-id')) return false;
7714
+ p = p.parentElement;
7715
+ }
7716
+ return true;
7717
+ }
7718
+
7719
+ /* ================================================================
7720
+ v2.5 Block D -- RFC V25-04: effect detection (expect + diff)
7721
+ ================================================================
7722
+
7723
+ NAC.expect(plugin, statePath, value, opts?) -> Promise
7724
+ Polls NAC.read(plugin, statePath) until the returned value
7725
+ satisfies the comparator (default ===) or the timeout fires.
7726
+ Resolves with the resolved value on match.
7727
+ Rejects with NacError('timeout', ...) on deadline.
7728
+ Read failures are retried until the deadline (treated as
7729
+ "the state is not yet observable").
7730
+
7731
+ opts:
7732
+ timeout_ms default 5000
7733
+ poll_ms default 100
7734
+ comparator default (cur, want) => cur === want
7735
+ receives (current, expected) and returns boolean
7736
+
7737
+ NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>
7738
+ Reads state, awaits actionFn(), reads state again, returns
7739
+ both snapshots + a `changed` boolean (JSON-stringify compare).
7740
+ Read failures collapse to undefined and changed is computed
7741
+ on the stringified pair (so undefined vs value still flags).
7742
+
7743
+ Both delegate to NAC.read() so they inherit V25-01's full
7744
+ fallback-chain semantics for free. */
7745
+
7746
+ function expect(plugin, statePath, value, opts) {
7747
+ opts = opts || {};
7748
+ const timeout = (typeof opts.timeout_ms === 'number') ? opts.timeout_ms : 5000;
7749
+ const pollMs = (typeof opts.poll_ms === 'number') ? opts.poll_ms : 100;
7750
+ const cmp = (typeof opts.comparator === 'function')
7751
+ ? opts.comparator
7752
+ : function (cur, want) { return cur === want; };
7753
+ const deadline = Date.now() + timeout;
7754
+ return new Promise(function (resolve, reject) {
7755
+ function tick() {
7756
+ read(plugin, statePath).then(function (cur) {
7757
+ let matches = false;
7758
+ try { matches = !!cmp(cur, value); }
7759
+ catch (_) { matches = false; }
7760
+ if (matches) { resolve(cur); return; }
7761
+ if (Date.now() >= deadline) {
7762
+ reject(_v25_buildNacError('timeout',
7763
+ 'NAC.expect: state "' + statePath + '" did not match within ' +
7764
+ timeout + 'ms (last value: ' + JSON.stringify(cur) + ')'));
7765
+ return;
7766
+ }
7767
+ setTimeout(tick, pollMs);
7768
+ }, function (_err) {
7769
+ if (Date.now() >= deadline) {
7770
+ reject(_v25_buildNacError('timeout',
7771
+ 'NAC.expect: state "' + statePath + '" unreadable + timeout'));
7772
+ return;
7773
+ }
7774
+ setTimeout(tick, pollMs);
7775
+ });
7776
+ }
7777
+ tick();
7778
+ });
7779
+ }
7780
+
7781
+ function diff(plugin, statePath, actionFn) {
7782
+ function safeRead() {
7783
+ return read(plugin, statePath).then(
7784
+ function (v) { return v; },
7785
+ function () { return undefined; }
7786
+ );
7787
+ }
7788
+ return safeRead().then(function (before) {
7789
+ const act = (typeof actionFn === 'function')
7790
+ ? Promise.resolve(actionFn())
7791
+ : Promise.resolve();
7792
+ return act.then(function () {
7793
+ return safeRead().then(function (after) {
7794
+ let changed;
7795
+ try {
7796
+ changed = JSON.stringify(before) !== JSON.stringify(after);
7797
+ } catch (_) {
7798
+ changed = before !== after;
7799
+ }
7800
+ return { before: before, after: after, changed: changed };
7801
+ });
7802
+ });
7803
+ });
7804
+ }
7805
+
7806
+ function tree(plugin, rootId) {
7807
+ const pluginRoot = _v25b_pluginRoot(plugin);
7808
+ if (!pluginRoot) return [];
7809
+ let start = pluginRoot;
7810
+ if (rootId) {
7811
+ const safeId = '"' + String(rootId).replace(/["\\]/g, '\\$&') + '"';
7812
+ const found = pluginRoot.querySelector('[data-nac-id=' + safeId + ']');
7813
+ if (!found) return [];
7814
+ start = found;
7815
+ }
7816
+ const candidates = start.querySelectorAll('[data-nac-id]');
7817
+ const out = [];
7818
+ for (let i = 0; i < candidates.length; i++) {
7819
+ const k = candidates[i];
7820
+ if (!_v25b_isImmediate(start, k)) continue;
7821
+ const id = k.getAttribute('data-nac-id');
7822
+ const entry = {
7823
+ nac_id: id,
7824
+ label: narrate(plugin, id),
7825
+ };
7826
+ const opens = k.getAttribute('data-nac-opens');
7827
+ if (opens) entry.opens = opens;
7828
+ if (k.hasAttribute('data-nac-leaf')) entry.leaf = true;
7829
+ out.push(entry);
7830
+ }
7831
+ return out;
7832
+ }
7833
+
7594
7834
  /* ---------- Install -------------------------------------------- */
7595
7835
 
7596
7836
  global.NAC = {
7597
7837
  __nac_v1_installed: true,
7598
- version: '2.5.0-alpha.4',
7838
+ version: '2.5.0-alpha.5',
7599
7839
  spec_version: '2.5',
7600
7840
  /* v2.2.0 (V22-01) -- strict validation toggle. When true,
7601
7841
  NAC.register throws on findings (manifest_role_unknown,
@@ -7846,6 +8086,25 @@ const _g = typeof globalThis !== 'undefined' ? globalThis : (typeof window !== '
7846
8086
  read: read,
7847
8087
  subscribe: subscribe,
7848
8088
  unsubscribe: unsubscribe,
8089
+ /* v2.5 Block C -- asistive labels (SPEC.md sec 17 / RFC V25-03).
8090
+ Canonical human-readable label resolution for screen readers,
8091
+ TTS, voice flows, audit logs. Priority order: aria-label >
8092
+ visible text > data-nac-label > nac_id fallback. */
8093
+ narrate: narrate,
8094
+ /* v2.5 Block B -- tree navigation (SPEC.md sec 16 / RFC V25-02).
8095
+ context(plugin) returns the focused node's breadcrumb;
8096
+ tree(plugin, rootId?) enumerates navigable children.
8097
+ data-nac-opens declares parent->child relationships; data-nac-leaf
8098
+ marks terminals. Companion to narrate for chrome-driven walks. */
8099
+ context: context,
8100
+ tree: tree,
8101
+ /* v2.5 Block D -- effect detection (SPEC.md sec 18 / RFC V25-04).
8102
+ Closes the "silent damage" gap for assistive callers: the agent
8103
+ confirms the EFFECT of an action, not just that the command was
8104
+ emitted. expect() polls until a state matches; diff() snapshots
8105
+ around an action. Both compose with NAC.read() / V25-01 surface. */
8106
+ expect: expect,
8107
+ diff: diff,
7849
8108
  };
7850
8109
 
7851
8110
  /* v2.2.1: guard browser-only init so this module is importable in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nac3/runtime",
3
- "version": "2.5.0-alpha.4",
3
+ "version": "2.5.0-alpha.5",
4
4
  "description": "Native Agent Contract -- spec + reference runtime that lets web UIs be driven by AI agents, voice runners, and accessibility tools.",
5
5
  "keywords": [
6
6
  "nac",