@neuroverseos/governance 0.4.0 → 0.5.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/adapters/index.cjs +66 -1
- package/dist/adapters/index.d.cts +40 -2
- package/dist/adapters/index.d.ts +40 -2
- package/dist/adapters/index.js +1 -1
- package/dist/{build-THUEYMVT.js → build-SCAWPA7E.js} +2 -2
- package/dist/{chunk-APU4OZIP.js → chunk-U6FRAEQJ.js} +66 -1
- package/dist/cli/neuroverse.cjs +66 -1
- package/dist/cli/neuroverse.js +4 -4
- package/dist/{derive-5LOMN7GO.js → derive-AUQE3L3P.js} +2 -2
- package/dist/{doctor-WIO4FLA3.js → doctor-EY7LKSYY.js} +1 -1
- package/dist/index.js +29 -29
- package/dist/{mentraos-YFS7FMJH.js → mentraos-LLH7KEV4.js} +1 -1
- package/dist/spatial/index.cjs +682 -0
- package/dist/spatial/index.d.cts +517 -0
- package/dist/spatial/index.d.ts +517 -0
- package/dist/spatial/index.js +633 -0
- package/dist/worlds/mentraos-spatial.nv-world.md +68 -0
- package/package.json +16 -3
- package/dist/{chunk-QZ666FCV.js → chunk-4G6WHPLI.js} +3 -3
- package/dist/{configure-ai-5MP5DWTT.js → configure-ai-LL3VAPQW.js} +3 -3
package/dist/adapters/index.cjs
CHANGED
|
@@ -2779,6 +2779,7 @@ var MentraGovernedExecutor = class {
|
|
|
2779
2779
|
_userRules;
|
|
2780
2780
|
_emergencyOverride = false;
|
|
2781
2781
|
_emergencyActivatedAt = null;
|
|
2782
|
+
_spatialSession = null;
|
|
2782
2783
|
constructor(world, options = {}, userRules = DEFAULT_USER_RULES) {
|
|
2783
2784
|
this.world = world;
|
|
2784
2785
|
this.options = options;
|
|
@@ -2835,13 +2836,36 @@ var MentraGovernedExecutor = class {
|
|
|
2835
2836
|
get emergencyActivatedAt() {
|
|
2836
2837
|
return this._emergencyActivatedAt;
|
|
2837
2838
|
}
|
|
2839
|
+
// ── Spatial Governance (optional) ────────────────────────────────────────
|
|
2840
|
+
/**
|
|
2841
|
+
* Attach a spatial session to this executor.
|
|
2842
|
+
*
|
|
2843
|
+
* When attached, intents are evaluated against the spatial context
|
|
2844
|
+
* (zone rules + handshake rules) AFTER user rules but BEFORE
|
|
2845
|
+
* hardware and platform checks. This is Layer 1.5.
|
|
2846
|
+
*
|
|
2847
|
+
* Pass null to detach (e.g., when leaving a zone).
|
|
2848
|
+
*/
|
|
2849
|
+
setSpatialSession(session) {
|
|
2850
|
+
this._spatialSession = session;
|
|
2851
|
+
}
|
|
2852
|
+
/** Whether a spatial session is currently active */
|
|
2853
|
+
get hasSpatialSession() {
|
|
2854
|
+
return this._spatialSession !== null;
|
|
2855
|
+
}
|
|
2856
|
+
/** Get the current spatial session description */
|
|
2857
|
+
get spatialDescription() {
|
|
2858
|
+
return this._spatialSession?.description ?? null;
|
|
2859
|
+
}
|
|
2838
2860
|
/**
|
|
2839
2861
|
* Evaluate an intent against user rules + platform world.
|
|
2840
2862
|
*
|
|
2841
2863
|
* Three-layer evaluation:
|
|
2842
|
-
* 0. Emergency override — if active, skip governance (layers 1 + 3),
|
|
2864
|
+
* 0. Emergency override — if active, skip governance (layers 1 + 1.5 + 3),
|
|
2843
2865
|
* but STILL enforce platform constraints (layer 2)
|
|
2844
2866
|
* 1. User rules check — personal governance override, can BLOCK or PAUSE
|
|
2867
|
+
* 1.5. Spatial governance — zone + handshake rules (optional, temporary)
|
|
2868
|
+
* ↑ ONLY ACTIVE when a spatial session is attached
|
|
2845
2869
|
* 2. Hardware capability check — validates glasses support
|
|
2846
2870
|
* ↑ THIS IS A PLATFORM CONSTRAINT — never overridden
|
|
2847
2871
|
* 3. Platform guard engine — full world rule evaluation
|
|
@@ -2872,6 +2896,47 @@ var MentraGovernedExecutor = class {
|
|
|
2872
2896
|
return result2;
|
|
2873
2897
|
}
|
|
2874
2898
|
}
|
|
2899
|
+
if (!this._emergencyOverride && this._spatialSession) {
|
|
2900
|
+
const spatialResult = this._spatialSession.evaluate(intent);
|
|
2901
|
+
if (!spatialResult.allowed && !spatialResult.requiresConfirmation) {
|
|
2902
|
+
const verdict2 = {
|
|
2903
|
+
status: "BLOCK",
|
|
2904
|
+
ruleId: "spatial-zone-rule",
|
|
2905
|
+
reason: spatialResult.reason,
|
|
2906
|
+
evidence: makeEvidence("spatial-zone-rule")
|
|
2907
|
+
};
|
|
2908
|
+
const result2 = {
|
|
2909
|
+
allowed: false,
|
|
2910
|
+
requiresConfirmation: false,
|
|
2911
|
+
verdict: verdict2,
|
|
2912
|
+
intentDef,
|
|
2913
|
+
appContext,
|
|
2914
|
+
decidingLayer: "spatial"
|
|
2915
|
+
};
|
|
2916
|
+
this.options.onBlock?.(result2);
|
|
2917
|
+
this.options.onEvaluate?.(result2);
|
|
2918
|
+
return result2;
|
|
2919
|
+
}
|
|
2920
|
+
if (spatialResult.requiresConfirmation) {
|
|
2921
|
+
const verdict2 = {
|
|
2922
|
+
status: "PAUSE",
|
|
2923
|
+
ruleId: "spatial-zone-rule",
|
|
2924
|
+
reason: spatialResult.reason,
|
|
2925
|
+
evidence: makeEvidence("spatial-zone-rule")
|
|
2926
|
+
};
|
|
2927
|
+
const result2 = {
|
|
2928
|
+
allowed: false,
|
|
2929
|
+
requiresConfirmation: true,
|
|
2930
|
+
verdict: verdict2,
|
|
2931
|
+
intentDef,
|
|
2932
|
+
appContext,
|
|
2933
|
+
decidingLayer: "spatial"
|
|
2934
|
+
};
|
|
2935
|
+
this.options.onPause?.(result2);
|
|
2936
|
+
this.options.onEvaluate?.(result2);
|
|
2937
|
+
return result2;
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2875
2940
|
if (intentDef && glassesModel && !intentDef.supported_glasses.includes(glassesModel)) {
|
|
2876
2941
|
const verdict2 = {
|
|
2877
2942
|
status: "BLOCK",
|
|
@@ -112,6 +112,27 @@ declare function isAIIntent(intent: string): boolean;
|
|
|
112
112
|
* const result = executor.evaluate('ai_send_transcription', appContext);
|
|
113
113
|
*/
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Reference to a spatial governance session.
|
|
117
|
+
*
|
|
118
|
+
* When spatial governance is active, intents are evaluated against
|
|
119
|
+
* zone rules and handshake rules BEFORE the platform world.
|
|
120
|
+
* This is an optional layer — if no spatial session is attached,
|
|
121
|
+
* the executor works exactly as before.
|
|
122
|
+
*
|
|
123
|
+
* Import the full spatial module from '@neuroverseos/governance/spatial'
|
|
124
|
+
* for zone management, handshake negotiation, and session lifecycle.
|
|
125
|
+
*/
|
|
126
|
+
interface SpatialSessionRef {
|
|
127
|
+
/** Evaluate an intent against the spatial context */
|
|
128
|
+
evaluate: (intent: string) => {
|
|
129
|
+
allowed: boolean;
|
|
130
|
+
requiresConfirmation: boolean;
|
|
131
|
+
reason: string;
|
|
132
|
+
};
|
|
133
|
+
/** Human-readable description of the active spatial context */
|
|
134
|
+
description: string;
|
|
135
|
+
}
|
|
115
136
|
/**
|
|
116
137
|
* Context for the current app session.
|
|
117
138
|
* This replaces the old SpatialContext — grounded in real app data,
|
|
@@ -205,7 +226,7 @@ interface MentraGuardResult {
|
|
|
205
226
|
/** The app context used for evaluation */
|
|
206
227
|
appContext: AppContext;
|
|
207
228
|
/** Which governance layer produced this verdict */
|
|
208
|
-
decidingLayer: 'user_rules' | 'hardware' | 'platform' | 'emergency_override';
|
|
229
|
+
decidingLayer: 'user_rules' | 'spatial' | 'hardware' | 'platform' | 'emergency_override';
|
|
209
230
|
}
|
|
210
231
|
interface MentraExecutorOptions {
|
|
211
232
|
/** Include full evaluation trace in verdicts. Default: false. */
|
|
@@ -233,6 +254,7 @@ declare class MentraGovernedExecutor {
|
|
|
233
254
|
private _userRules;
|
|
234
255
|
private _emergencyOverride;
|
|
235
256
|
private _emergencyActivatedAt;
|
|
257
|
+
private _spatialSession;
|
|
236
258
|
constructor(world: WorldDefinition, options?: MentraExecutorOptions, userRules?: UserRules);
|
|
237
259
|
/** Get the current user rules */
|
|
238
260
|
get userRules(): UserRules;
|
|
@@ -257,13 +279,29 @@ declare class MentraGovernedExecutor {
|
|
|
257
279
|
get isEmergencyOverrideActive(): boolean;
|
|
258
280
|
/** Timestamp when emergency override was activated, or null */
|
|
259
281
|
get emergencyActivatedAt(): number | null;
|
|
282
|
+
/**
|
|
283
|
+
* Attach a spatial session to this executor.
|
|
284
|
+
*
|
|
285
|
+
* When attached, intents are evaluated against the spatial context
|
|
286
|
+
* (zone rules + handshake rules) AFTER user rules but BEFORE
|
|
287
|
+
* hardware and platform checks. This is Layer 1.5.
|
|
288
|
+
*
|
|
289
|
+
* Pass null to detach (e.g., when leaving a zone).
|
|
290
|
+
*/
|
|
291
|
+
setSpatialSession(session: SpatialSessionRef | null): void;
|
|
292
|
+
/** Whether a spatial session is currently active */
|
|
293
|
+
get hasSpatialSession(): boolean;
|
|
294
|
+
/** Get the current spatial session description */
|
|
295
|
+
get spatialDescription(): string | null;
|
|
260
296
|
/**
|
|
261
297
|
* Evaluate an intent against user rules + platform world.
|
|
262
298
|
*
|
|
263
299
|
* Three-layer evaluation:
|
|
264
|
-
* 0. Emergency override — if active, skip governance (layers 1 + 3),
|
|
300
|
+
* 0. Emergency override — if active, skip governance (layers 1 + 1.5 + 3),
|
|
265
301
|
* but STILL enforce platform constraints (layer 2)
|
|
266
302
|
* 1. User rules check — personal governance override, can BLOCK or PAUSE
|
|
303
|
+
* 1.5. Spatial governance — zone + handshake rules (optional, temporary)
|
|
304
|
+
* ↑ ONLY ACTIVE when a spatial session is attached
|
|
267
305
|
* 2. Hardware capability check — validates glasses support
|
|
268
306
|
* ↑ THIS IS A PLATFORM CONSTRAINT — never overridden
|
|
269
307
|
* 3. Platform guard engine — full world rule evaluation
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -112,6 +112,27 @@ declare function isAIIntent(intent: string): boolean;
|
|
|
112
112
|
* const result = executor.evaluate('ai_send_transcription', appContext);
|
|
113
113
|
*/
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Reference to a spatial governance session.
|
|
117
|
+
*
|
|
118
|
+
* When spatial governance is active, intents are evaluated against
|
|
119
|
+
* zone rules and handshake rules BEFORE the platform world.
|
|
120
|
+
* This is an optional layer — if no spatial session is attached,
|
|
121
|
+
* the executor works exactly as before.
|
|
122
|
+
*
|
|
123
|
+
* Import the full spatial module from '@neuroverseos/governance/spatial'
|
|
124
|
+
* for zone management, handshake negotiation, and session lifecycle.
|
|
125
|
+
*/
|
|
126
|
+
interface SpatialSessionRef {
|
|
127
|
+
/** Evaluate an intent against the spatial context */
|
|
128
|
+
evaluate: (intent: string) => {
|
|
129
|
+
allowed: boolean;
|
|
130
|
+
requiresConfirmation: boolean;
|
|
131
|
+
reason: string;
|
|
132
|
+
};
|
|
133
|
+
/** Human-readable description of the active spatial context */
|
|
134
|
+
description: string;
|
|
135
|
+
}
|
|
115
136
|
/**
|
|
116
137
|
* Context for the current app session.
|
|
117
138
|
* This replaces the old SpatialContext — grounded in real app data,
|
|
@@ -205,7 +226,7 @@ interface MentraGuardResult {
|
|
|
205
226
|
/** The app context used for evaluation */
|
|
206
227
|
appContext: AppContext;
|
|
207
228
|
/** Which governance layer produced this verdict */
|
|
208
|
-
decidingLayer: 'user_rules' | 'hardware' | 'platform' | 'emergency_override';
|
|
229
|
+
decidingLayer: 'user_rules' | 'spatial' | 'hardware' | 'platform' | 'emergency_override';
|
|
209
230
|
}
|
|
210
231
|
interface MentraExecutorOptions {
|
|
211
232
|
/** Include full evaluation trace in verdicts. Default: false. */
|
|
@@ -233,6 +254,7 @@ declare class MentraGovernedExecutor {
|
|
|
233
254
|
private _userRules;
|
|
234
255
|
private _emergencyOverride;
|
|
235
256
|
private _emergencyActivatedAt;
|
|
257
|
+
private _spatialSession;
|
|
236
258
|
constructor(world: WorldDefinition, options?: MentraExecutorOptions, userRules?: UserRules);
|
|
237
259
|
/** Get the current user rules */
|
|
238
260
|
get userRules(): UserRules;
|
|
@@ -257,13 +279,29 @@ declare class MentraGovernedExecutor {
|
|
|
257
279
|
get isEmergencyOverrideActive(): boolean;
|
|
258
280
|
/** Timestamp when emergency override was activated, or null */
|
|
259
281
|
get emergencyActivatedAt(): number | null;
|
|
282
|
+
/**
|
|
283
|
+
* Attach a spatial session to this executor.
|
|
284
|
+
*
|
|
285
|
+
* When attached, intents are evaluated against the spatial context
|
|
286
|
+
* (zone rules + handshake rules) AFTER user rules but BEFORE
|
|
287
|
+
* hardware and platform checks. This is Layer 1.5.
|
|
288
|
+
*
|
|
289
|
+
* Pass null to detach (e.g., when leaving a zone).
|
|
290
|
+
*/
|
|
291
|
+
setSpatialSession(session: SpatialSessionRef | null): void;
|
|
292
|
+
/** Whether a spatial session is currently active */
|
|
293
|
+
get hasSpatialSession(): boolean;
|
|
294
|
+
/** Get the current spatial session description */
|
|
295
|
+
get spatialDescription(): string | null;
|
|
260
296
|
/**
|
|
261
297
|
* Evaluate an intent against user rules + platform world.
|
|
262
298
|
*
|
|
263
299
|
* Three-layer evaluation:
|
|
264
|
-
* 0. Emergency override — if active, skip governance (layers 1 + 3),
|
|
300
|
+
* 0. Emergency override — if active, skip governance (layers 1 + 1.5 + 3),
|
|
265
301
|
* but STILL enforce platform constraints (layer 2)
|
|
266
302
|
* 1. User rules check — personal governance override, can BLOCK or PAUSE
|
|
303
|
+
* 1.5. Spatial governance — zone + handshake rules (optional, temporary)
|
|
304
|
+
* ↑ ONLY ACTIVE when a spatial session is attached
|
|
267
305
|
* 2. Hardware capability check — validates glasses support
|
|
268
306
|
* ↑ THIS IS A PLATFORM CONSTRAINT — never overridden
|
|
269
307
|
* 3. Platform guard engine — full world rule evaluation
|
package/dist/adapters/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
DeriveInputError,
|
|
3
3
|
DeriveProviderError,
|
|
4
4
|
deriveWorld
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4G6WHPLI.js";
|
|
6
6
|
import {
|
|
7
7
|
DERIVE_EXIT_CODES
|
|
8
8
|
} from "./chunk-FMSTRBBS.js";
|
|
9
|
-
import "./chunk-OT6PXH54.js";
|
|
10
9
|
import "./chunk-INWQHLPS.js";
|
|
10
|
+
import "./chunk-OT6PXH54.js";
|
|
11
11
|
import "./chunk-7P3S7MAY.js";
|
|
12
12
|
import {
|
|
13
13
|
parseWorldMarkdown
|
|
@@ -632,6 +632,7 @@ var MentraGovernedExecutor = class {
|
|
|
632
632
|
_userRules;
|
|
633
633
|
_emergencyOverride = false;
|
|
634
634
|
_emergencyActivatedAt = null;
|
|
635
|
+
_spatialSession = null;
|
|
635
636
|
constructor(world, options = {}, userRules = DEFAULT_USER_RULES) {
|
|
636
637
|
this.world = world;
|
|
637
638
|
this.options = options;
|
|
@@ -688,13 +689,36 @@ var MentraGovernedExecutor = class {
|
|
|
688
689
|
get emergencyActivatedAt() {
|
|
689
690
|
return this._emergencyActivatedAt;
|
|
690
691
|
}
|
|
692
|
+
// ── Spatial Governance (optional) ────────────────────────────────────────
|
|
693
|
+
/**
|
|
694
|
+
* Attach a spatial session to this executor.
|
|
695
|
+
*
|
|
696
|
+
* When attached, intents are evaluated against the spatial context
|
|
697
|
+
* (zone rules + handshake rules) AFTER user rules but BEFORE
|
|
698
|
+
* hardware and platform checks. This is Layer 1.5.
|
|
699
|
+
*
|
|
700
|
+
* Pass null to detach (e.g., when leaving a zone).
|
|
701
|
+
*/
|
|
702
|
+
setSpatialSession(session) {
|
|
703
|
+
this._spatialSession = session;
|
|
704
|
+
}
|
|
705
|
+
/** Whether a spatial session is currently active */
|
|
706
|
+
get hasSpatialSession() {
|
|
707
|
+
return this._spatialSession !== null;
|
|
708
|
+
}
|
|
709
|
+
/** Get the current spatial session description */
|
|
710
|
+
get spatialDescription() {
|
|
711
|
+
return this._spatialSession?.description ?? null;
|
|
712
|
+
}
|
|
691
713
|
/**
|
|
692
714
|
* Evaluate an intent against user rules + platform world.
|
|
693
715
|
*
|
|
694
716
|
* Three-layer evaluation:
|
|
695
|
-
* 0. Emergency override — if active, skip governance (layers 1 + 3),
|
|
717
|
+
* 0. Emergency override — if active, skip governance (layers 1 + 1.5 + 3),
|
|
696
718
|
* but STILL enforce platform constraints (layer 2)
|
|
697
719
|
* 1. User rules check — personal governance override, can BLOCK or PAUSE
|
|
720
|
+
* 1.5. Spatial governance — zone + handshake rules (optional, temporary)
|
|
721
|
+
* ↑ ONLY ACTIVE when a spatial session is attached
|
|
698
722
|
* 2. Hardware capability check — validates glasses support
|
|
699
723
|
* ↑ THIS IS A PLATFORM CONSTRAINT — never overridden
|
|
700
724
|
* 3. Platform guard engine — full world rule evaluation
|
|
@@ -725,6 +749,47 @@ var MentraGovernedExecutor = class {
|
|
|
725
749
|
return result2;
|
|
726
750
|
}
|
|
727
751
|
}
|
|
752
|
+
if (!this._emergencyOverride && this._spatialSession) {
|
|
753
|
+
const spatialResult = this._spatialSession.evaluate(intent);
|
|
754
|
+
if (!spatialResult.allowed && !spatialResult.requiresConfirmation) {
|
|
755
|
+
const verdict2 = {
|
|
756
|
+
status: "BLOCK",
|
|
757
|
+
ruleId: "spatial-zone-rule",
|
|
758
|
+
reason: spatialResult.reason,
|
|
759
|
+
evidence: makeEvidence("spatial-zone-rule")
|
|
760
|
+
};
|
|
761
|
+
const result2 = {
|
|
762
|
+
allowed: false,
|
|
763
|
+
requiresConfirmation: false,
|
|
764
|
+
verdict: verdict2,
|
|
765
|
+
intentDef,
|
|
766
|
+
appContext,
|
|
767
|
+
decidingLayer: "spatial"
|
|
768
|
+
};
|
|
769
|
+
this.options.onBlock?.(result2);
|
|
770
|
+
this.options.onEvaluate?.(result2);
|
|
771
|
+
return result2;
|
|
772
|
+
}
|
|
773
|
+
if (spatialResult.requiresConfirmation) {
|
|
774
|
+
const verdict2 = {
|
|
775
|
+
status: "PAUSE",
|
|
776
|
+
ruleId: "spatial-zone-rule",
|
|
777
|
+
reason: spatialResult.reason,
|
|
778
|
+
evidence: makeEvidence("spatial-zone-rule")
|
|
779
|
+
};
|
|
780
|
+
const result2 = {
|
|
781
|
+
allowed: false,
|
|
782
|
+
requiresConfirmation: true,
|
|
783
|
+
verdict: verdict2,
|
|
784
|
+
intentDef,
|
|
785
|
+
appContext,
|
|
786
|
+
decidingLayer: "spatial"
|
|
787
|
+
};
|
|
788
|
+
this.options.onPause?.(result2);
|
|
789
|
+
this.options.onEvaluate?.(result2);
|
|
790
|
+
return result2;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
728
793
|
if (intentDef && glassesModel && !intentDef.supported_glasses.includes(glassesModel)) {
|
|
729
794
|
const verdict2 = {
|
|
730
795
|
status: "BLOCK",
|
package/dist/cli/neuroverse.cjs
CHANGED
|
@@ -10525,6 +10525,7 @@ var init_mentraos = __esm({
|
|
|
10525
10525
|
_userRules;
|
|
10526
10526
|
_emergencyOverride = false;
|
|
10527
10527
|
_emergencyActivatedAt = null;
|
|
10528
|
+
_spatialSession = null;
|
|
10528
10529
|
constructor(world, options = {}, userRules = DEFAULT_USER_RULES) {
|
|
10529
10530
|
this.world = world;
|
|
10530
10531
|
this.options = options;
|
|
@@ -10581,13 +10582,36 @@ var init_mentraos = __esm({
|
|
|
10581
10582
|
get emergencyActivatedAt() {
|
|
10582
10583
|
return this._emergencyActivatedAt;
|
|
10583
10584
|
}
|
|
10585
|
+
// ── Spatial Governance (optional) ────────────────────────────────────────
|
|
10586
|
+
/**
|
|
10587
|
+
* Attach a spatial session to this executor.
|
|
10588
|
+
*
|
|
10589
|
+
* When attached, intents are evaluated against the spatial context
|
|
10590
|
+
* (zone rules + handshake rules) AFTER user rules but BEFORE
|
|
10591
|
+
* hardware and platform checks. This is Layer 1.5.
|
|
10592
|
+
*
|
|
10593
|
+
* Pass null to detach (e.g., when leaving a zone).
|
|
10594
|
+
*/
|
|
10595
|
+
setSpatialSession(session) {
|
|
10596
|
+
this._spatialSession = session;
|
|
10597
|
+
}
|
|
10598
|
+
/** Whether a spatial session is currently active */
|
|
10599
|
+
get hasSpatialSession() {
|
|
10600
|
+
return this._spatialSession !== null;
|
|
10601
|
+
}
|
|
10602
|
+
/** Get the current spatial session description */
|
|
10603
|
+
get spatialDescription() {
|
|
10604
|
+
return this._spatialSession?.description ?? null;
|
|
10605
|
+
}
|
|
10584
10606
|
/**
|
|
10585
10607
|
* Evaluate an intent against user rules + platform world.
|
|
10586
10608
|
*
|
|
10587
10609
|
* Three-layer evaluation:
|
|
10588
|
-
* 0. Emergency override — if active, skip governance (layers 1 + 3),
|
|
10610
|
+
* 0. Emergency override — if active, skip governance (layers 1 + 1.5 + 3),
|
|
10589
10611
|
* but STILL enforce platform constraints (layer 2)
|
|
10590
10612
|
* 1. User rules check — personal governance override, can BLOCK or PAUSE
|
|
10613
|
+
* 1.5. Spatial governance — zone + handshake rules (optional, temporary)
|
|
10614
|
+
* ↑ ONLY ACTIVE when a spatial session is attached
|
|
10591
10615
|
* 2. Hardware capability check — validates glasses support
|
|
10592
10616
|
* ↑ THIS IS A PLATFORM CONSTRAINT — never overridden
|
|
10593
10617
|
* 3. Platform guard engine — full world rule evaluation
|
|
@@ -10618,6 +10642,47 @@ var init_mentraos = __esm({
|
|
|
10618
10642
|
return result2;
|
|
10619
10643
|
}
|
|
10620
10644
|
}
|
|
10645
|
+
if (!this._emergencyOverride && this._spatialSession) {
|
|
10646
|
+
const spatialResult = this._spatialSession.evaluate(intent);
|
|
10647
|
+
if (!spatialResult.allowed && !spatialResult.requiresConfirmation) {
|
|
10648
|
+
const verdict2 = {
|
|
10649
|
+
status: "BLOCK",
|
|
10650
|
+
ruleId: "spatial-zone-rule",
|
|
10651
|
+
reason: spatialResult.reason,
|
|
10652
|
+
evidence: makeEvidence("spatial-zone-rule")
|
|
10653
|
+
};
|
|
10654
|
+
const result2 = {
|
|
10655
|
+
allowed: false,
|
|
10656
|
+
requiresConfirmation: false,
|
|
10657
|
+
verdict: verdict2,
|
|
10658
|
+
intentDef,
|
|
10659
|
+
appContext,
|
|
10660
|
+
decidingLayer: "spatial"
|
|
10661
|
+
};
|
|
10662
|
+
this.options.onBlock?.(result2);
|
|
10663
|
+
this.options.onEvaluate?.(result2);
|
|
10664
|
+
return result2;
|
|
10665
|
+
}
|
|
10666
|
+
if (spatialResult.requiresConfirmation) {
|
|
10667
|
+
const verdict2 = {
|
|
10668
|
+
status: "PAUSE",
|
|
10669
|
+
ruleId: "spatial-zone-rule",
|
|
10670
|
+
reason: spatialResult.reason,
|
|
10671
|
+
evidence: makeEvidence("spatial-zone-rule")
|
|
10672
|
+
};
|
|
10673
|
+
const result2 = {
|
|
10674
|
+
allowed: false,
|
|
10675
|
+
requiresConfirmation: true,
|
|
10676
|
+
verdict: verdict2,
|
|
10677
|
+
intentDef,
|
|
10678
|
+
appContext,
|
|
10679
|
+
decidingLayer: "spatial"
|
|
10680
|
+
};
|
|
10681
|
+
this.options.onPause?.(result2);
|
|
10682
|
+
this.options.onEvaluate?.(result2);
|
|
10683
|
+
return result2;
|
|
10684
|
+
}
|
|
10685
|
+
}
|
|
10621
10686
|
if (intentDef && glassesModel && !intentDef.supported_glasses.includes(glassesModel)) {
|
|
10622
10687
|
const verdict2 = {
|
|
10623
10688
|
status: "BLOCK",
|
package/dist/cli/neuroverse.js
CHANGED
|
@@ -104,7 +104,7 @@ async function main() {
|
|
|
104
104
|
return addMain(subArgs);
|
|
105
105
|
}
|
|
106
106
|
case "build": {
|
|
107
|
-
const { main: buildMain } = await import("../build-
|
|
107
|
+
const { main: buildMain } = await import("../build-SCAWPA7E.js");
|
|
108
108
|
return buildMain(subArgs);
|
|
109
109
|
}
|
|
110
110
|
case "explain": {
|
|
@@ -156,7 +156,7 @@ async function main() {
|
|
|
156
156
|
return demoMain(subArgs);
|
|
157
157
|
}
|
|
158
158
|
case "doctor": {
|
|
159
|
-
const { main: doctorMain } = await import("../doctor-
|
|
159
|
+
const { main: doctorMain } = await import("../doctor-EY7LKSYY.js");
|
|
160
160
|
return doctorMain(subArgs);
|
|
161
161
|
}
|
|
162
162
|
case "playground": {
|
|
@@ -196,7 +196,7 @@ async function main() {
|
|
|
196
196
|
return worldMain(subArgs);
|
|
197
197
|
}
|
|
198
198
|
case "derive": {
|
|
199
|
-
const { main: deriveMain } = await import("../derive-
|
|
199
|
+
const { main: deriveMain } = await import("../derive-AUQE3L3P.js");
|
|
200
200
|
return deriveMain(subArgs);
|
|
201
201
|
}
|
|
202
202
|
case "decision-flow": {
|
|
@@ -208,7 +208,7 @@ async function main() {
|
|
|
208
208
|
return equityPenaltiesMain(subArgs);
|
|
209
209
|
}
|
|
210
210
|
case "configure-ai": {
|
|
211
|
-
const { main: configureAiMain } = await import("../configure-ai-
|
|
211
|
+
const { main: configureAiMain } = await import("../configure-ai-LL3VAPQW.js");
|
|
212
212
|
return configureAiMain(subArgs);
|
|
213
213
|
}
|
|
214
214
|
case "configure-world": {
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
DeriveInputError,
|
|
3
3
|
DeriveProviderError,
|
|
4
4
|
deriveWorld
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4G6WHPLI.js";
|
|
6
6
|
import {
|
|
7
7
|
DERIVE_EXIT_CODES
|
|
8
8
|
} from "./chunk-FMSTRBBS.js";
|
|
9
|
-
import "./chunk-OT6PXH54.js";
|
|
10
9
|
import "./chunk-INWQHLPS.js";
|
|
10
|
+
import "./chunk-OT6PXH54.js";
|
|
11
11
|
import "./chunk-7P3S7MAY.js";
|
|
12
12
|
import "./chunk-3NZMMSOW.js";
|
|
13
13
|
import "./chunk-YPCVY4GS.js";
|
|
@@ -12,7 +12,7 @@ var globImport_adapters = __glob({
|
|
|
12
12
|
"../adapters/express.ts": () => import("./adapters/express.js"),
|
|
13
13
|
"../adapters/index.ts": () => import("./adapters/index.js"),
|
|
14
14
|
"../adapters/langchain.ts": () => import("./adapters/langchain.js"),
|
|
15
|
-
"../adapters/mentraos.ts": () => import("./mentraos-
|
|
15
|
+
"../adapters/mentraos.ts": () => import("./mentraos-LLH7KEV4.js"),
|
|
16
16
|
"../adapters/openai.ts": () => import("./adapters/openai.js"),
|
|
17
17
|
"../adapters/openclaw.ts": () => import("./adapters/openclaw.js"),
|
|
18
18
|
"../adapters/shared.ts": () => import("./shared-7RLUHNMU.js")
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
generateImpactReport,
|
|
3
|
+
generateImpactReportFromFile,
|
|
4
|
+
renderImpactReport
|
|
5
|
+
} from "./chunk-OQU65525.js";
|
|
6
|
+
import {
|
|
7
|
+
GUARD_EXIT_CODES,
|
|
8
|
+
classifyIntentWithAI,
|
|
9
|
+
evaluateGuardWithAI,
|
|
10
|
+
extractContentFields
|
|
11
|
+
} from "./chunk-6CV4XG3J.js";
|
|
1
12
|
import {
|
|
2
13
|
actionToGuardEvent,
|
|
3
14
|
createGovernor,
|
|
@@ -14,11 +25,6 @@ import {
|
|
|
14
25
|
detectBehavioralPatterns,
|
|
15
26
|
generateAdaptationNarrative
|
|
16
27
|
} from "./chunk-CNSO6XW5.js";
|
|
17
|
-
import {
|
|
18
|
-
generateImpactReport,
|
|
19
|
-
generateImpactReportFromFile,
|
|
20
|
-
renderImpactReport
|
|
21
|
-
} from "./chunk-OQU65525.js";
|
|
22
28
|
import {
|
|
23
29
|
CompositeAuditLogger,
|
|
24
30
|
ConsoleAuditLogger,
|
|
@@ -28,6 +34,10 @@ import {
|
|
|
28
34
|
summarizeAuditEvents,
|
|
29
35
|
verdictToAuditEvent
|
|
30
36
|
} from "./chunk-2VAWP6FI.js";
|
|
37
|
+
import {
|
|
38
|
+
explainWorld,
|
|
39
|
+
renderExplainText
|
|
40
|
+
} from "./chunk-ZJTDUCC2.js";
|
|
31
41
|
import {
|
|
32
42
|
improveWorld,
|
|
33
43
|
renderImproveText
|
|
@@ -43,11 +53,18 @@ import {
|
|
|
43
53
|
VALIDATE_EXIT_CODES
|
|
44
54
|
} from "./chunk-I3RRAYK2.js";
|
|
45
55
|
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
SessionManager,
|
|
57
|
+
runInteractiveMode,
|
|
58
|
+
runPipeMode
|
|
59
|
+
} from "./chunk-UTH7OXTM.js";
|
|
60
|
+
import {
|
|
61
|
+
applyConsequence,
|
|
62
|
+
applyReward,
|
|
63
|
+
createAgentState,
|
|
64
|
+
generateDecisionFlow,
|
|
65
|
+
renderDecisionFlow,
|
|
66
|
+
tickAgentStates
|
|
67
|
+
} from "./chunk-D2UCV5AK.js";
|
|
51
68
|
import {
|
|
52
69
|
ModelAdapter,
|
|
53
70
|
PROVIDERS,
|
|
@@ -67,20 +84,16 @@ import {
|
|
|
67
84
|
deriveWorld,
|
|
68
85
|
extractWorldMarkdown,
|
|
69
86
|
normalizeWorldMarkdown
|
|
70
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-4G6WHPLI.js";
|
|
71
88
|
import {
|
|
72
89
|
CONFIGURE_AI_EXIT_CODES,
|
|
73
90
|
DERIVE_EXIT_CODES
|
|
74
91
|
} from "./chunk-FMSTRBBS.js";
|
|
75
|
-
import "./chunk-OT6PXH54.js";
|
|
76
92
|
import "./chunk-INWQHLPS.js";
|
|
93
|
+
import "./chunk-OT6PXH54.js";
|
|
77
94
|
import {
|
|
78
95
|
validateWorld
|
|
79
96
|
} from "./chunk-7P3S7MAY.js";
|
|
80
|
-
import {
|
|
81
|
-
explainWorld,
|
|
82
|
-
renderExplainText
|
|
83
|
-
} from "./chunk-ZJTDUCC2.js";
|
|
84
97
|
import {
|
|
85
98
|
PLAN_EXIT_CODES,
|
|
86
99
|
parsePlanMarkdown
|
|
@@ -98,19 +111,6 @@ import {
|
|
|
98
111
|
import {
|
|
99
112
|
emitWorldDefinition
|
|
100
113
|
} from "./chunk-YPCVY4GS.js";
|
|
101
|
-
import {
|
|
102
|
-
SessionManager,
|
|
103
|
-
runInteractiveMode,
|
|
104
|
-
runPipeMode
|
|
105
|
-
} from "./chunk-UTH7OXTM.js";
|
|
106
|
-
import {
|
|
107
|
-
applyConsequence,
|
|
108
|
-
applyReward,
|
|
109
|
-
createAgentState,
|
|
110
|
-
generateDecisionFlow,
|
|
111
|
-
renderDecisionFlow,
|
|
112
|
-
tickAgentStates
|
|
113
|
-
} from "./chunk-D2UCV5AK.js";
|
|
114
114
|
import {
|
|
115
115
|
evaluateGuard,
|
|
116
116
|
eventToAllowlistKey,
|