@neuroverseos/governance 0.4.0 → 0.4.2
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/autoresearch.d.cts +2 -1
- package/dist/adapters/autoresearch.d.ts +2 -1
- package/dist/adapters/autoresearch.js +2 -2
- package/dist/adapters/deep-agents.d.cts +3 -2
- package/dist/adapters/deep-agents.d.ts +3 -2
- package/dist/adapters/deep-agents.js +2 -2
- package/dist/adapters/express.d.cts +2 -1
- package/dist/adapters/express.d.ts +2 -1
- package/dist/adapters/express.js +2 -2
- package/dist/adapters/github.cjs +1697 -0
- package/dist/adapters/github.d.cts +225 -0
- package/dist/adapters/github.d.ts +225 -0
- package/dist/adapters/github.js +27 -0
- package/dist/adapters/index.cjs +66 -1
- package/dist/adapters/index.d.cts +4 -278
- package/dist/adapters/index.d.ts +4 -278
- package/dist/adapters/index.js +18 -18
- package/dist/adapters/langchain.d.cts +3 -2
- package/dist/adapters/langchain.d.ts +3 -2
- package/dist/adapters/langchain.js +2 -2
- package/dist/adapters/mentraos.cjs +2181 -0
- package/dist/adapters/mentraos.d.cts +319 -0
- package/dist/adapters/mentraos.d.ts +319 -0
- package/dist/{mentraos-YFS7FMJH.js → adapters/mentraos.js} +6 -6
- package/dist/adapters/openai.d.cts +3 -2
- package/dist/adapters/openai.d.ts +3 -2
- package/dist/adapters/openai.js +2 -2
- package/dist/adapters/openclaw.d.cts +3 -2
- package/dist/adapters/openclaw.d.ts +3 -2
- package/dist/adapters/openclaw.js +2 -2
- package/dist/{add-LYHDZ5RL.js → add-XSANI3FK.js} +1 -1
- package/dist/bootstrap-contract-DcV6t-8M.d.cts +216 -0
- package/dist/bootstrap-contract-DcV6t-8M.d.ts +216 -0
- package/dist/{build-THUEYMVT.js → build-EGBGZFIJ.js} +5 -5
- package/dist/{chunk-MFKHTE5R.js → chunk-3AYKQHYI.js} +1 -1
- package/dist/chunk-3S5AD4AB.js +421 -0
- package/dist/{chunk-V4FZHJQX.js → chunk-A7SHG75T.js} +1 -1
- package/dist/{chunk-JKGPSFGH.js → chunk-AV7XJJWK.js} +1 -1
- package/dist/{chunk-Y6WXAPKY.js → chunk-DA5MHFRR.js} +1 -1
- package/dist/{chunk-7D7PZLB7.js → chunk-FS2UUJJO.js} +3 -3
- package/dist/{chunk-TD5GKIHP.js → chunk-FVOGUCB6.js} +1 -1
- package/dist/{chunk-APU4OZIP.js → chunk-GTPV2XGO.js} +67 -2
- package/dist/{chunk-BXLTEUS4.js → chunk-I4RTIMLX.js} +2 -2
- package/dist/{chunk-5JUZ4HL7.js → chunk-J2IZBHXJ.js} +3 -3
- package/dist/{chunk-YNYCQECH.js → chunk-QMVQ6KPL.js} +1 -1
- package/dist/{chunk-25XHSTPT.js → chunk-RDA7ISWC.js} +1 -1
- package/dist/{chunk-DWHUZUEY.js → chunk-YJ34R5NB.js} +1 -1
- package/dist/{chunk-UTH7OXTM.js → chunk-ZEIT2QLM.js} +3 -3
- package/dist/cli/neuroverse.cjs +580 -28
- package/dist/cli/neuroverse.js +21 -21
- package/dist/cli/plan.js +2 -2
- package/dist/cli/run.js +2 -2
- package/dist/{demo-66MMJTEH.js → demo-6OQYWRR6.js} +3 -3
- package/dist/{derive-5LOMN7GO.js → derive-7Y7YWVLU.js} +4 -4
- package/dist/{doctor-WIO4FLA3.js → doctor-EC5OYTI3.js} +3 -2
- package/dist/engine/bootstrap-emitter.cjs +241 -0
- package/dist/engine/bootstrap-emitter.d.cts +27 -0
- package/dist/engine/bootstrap-emitter.d.ts +27 -0
- package/dist/{bootstrap-emitter-GIMOJFOC.js → engine/bootstrap-emitter.js} +2 -2
- package/dist/engine/bootstrap-parser.cjs +560 -0
- package/dist/engine/bootstrap-parser.d.cts +96 -0
- package/dist/engine/bootstrap-parser.d.ts +96 -0
- package/dist/{bootstrap-parser-LBLGVEMU.js → engine/bootstrap-parser.js} +2 -2
- package/dist/engine/guard-engine.cjs +1116 -0
- package/dist/engine/guard-engine.d.cts +60 -0
- package/dist/engine/guard-engine.d.ts +60 -0
- package/dist/{guard-engine-N7TUIUU7.js → engine/guard-engine.js} +3 -3
- package/dist/engine/simulate-engine.cjs +390 -0
- package/dist/engine/simulate-engine.d.cts +105 -0
- package/dist/engine/simulate-engine.d.ts +105 -0
- package/dist/engine/simulate-engine.js +9 -0
- package/dist/{equity-penalties-WWC7UDQD.js → equity-penalties-NVBAB5WL.js} +2 -2
- package/dist/{explain-MUSGDT67.js → explain-HDFN4ION.js} +1 -1
- package/dist/{guard-W3BMQPBJ.js → guard-6KSCWT2W.js} +2 -2
- package/dist/{guard-contract-CLBbTGK_.d.ts → guard-contract-ddiIPlOg.d.cts} +2 -369
- package/dist/{guard-contract-CLBbTGK_.d.cts → guard-contract-q6HJAq3Q.d.ts} +2 -369
- package/dist/{improve-PJDAWW4Q.js → improve-2PWGGO5B.js} +3 -3
- package/dist/index.cjs +452 -0
- package/dist/index.d.cts +12 -492
- package/dist/index.d.ts +12 -492
- package/dist/index.js +75 -54
- package/dist/{lens-IP6GIZ2Q.js → lens-MHMUDCMQ.js} +92 -25
- package/dist/{mcp-server-OG3PPVD2.js → mcp-server-TNIWZ7B5.js} +2 -2
- package/dist/{playground-4BK2XQ47.js → playground-3FLDGBET.js} +2 -2
- package/dist/{redteam-BRZALBPP.js → redteam-HV6LMKEH.js} +2 -2
- package/dist/{session-SGRUT2UH.js → session-XZP2754M.js} +2 -2
- package/dist/{shared-CwGpPheR.d.ts → shared-DAzdfWtU.d.ts} +1 -1
- package/dist/{shared-BGzmYP5g.d.cts → shared-PpalGKxc.d.cts} +1 -1
- package/dist/{simulate-FGXKIH7V.js → simulate-VT437EEL.js} +2 -2
- 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/{test-PT44BSYG.js → test-4WTX6RKQ.js} +2 -2
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +370 -0
- package/dist/types.d.ts +370 -0
- package/dist/types.js +0 -0
- package/dist/{validate-Q5O5TGLT.js → validate-M52DX22Y.js} +1 -1
- package/dist/{world-V52ZMH26.js → world-O4HTQPDP.js} +1 -1
- package/dist/{world-loader-C4D3VPP3.js → world-loader-YTYFOP7D.js} +1 -1
- package/dist/worlds/mentraos-spatial.nv-world.md +68 -0
- package/package.json +52 -3
- package/dist/{behavioral-SPWPGYXL.js → behavioral-SLW7ALEK.js} +3 -3
- package/dist/{bootstrap-IP5QMC3Q.js → bootstrap-2OW5ZLBL.js} +3 -3
- package/dist/{chunk-7QIAF377.js → chunk-CYDMUJVZ.js} +0 -0
- package/dist/{chunk-QZ666FCV.js → chunk-FHXXD2TI.js} +6 -6
- package/dist/{configure-ai-5MP5DWTT.js → configure-ai-LL3VAPQW.js} +3 -3
package/dist/adapters/openai.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
GovernedToolExecutor,
|
|
4
4
|
createGovernedToolExecutor,
|
|
5
5
|
createGovernedToolExecutorFromWorld
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-FVOGUCB6.js";
|
|
7
7
|
import "../chunk-5U2MQO5P.js";
|
|
8
8
|
import "../chunk-ZAF6JH23.js";
|
|
9
|
+
import "../chunk-I4RTIMLX.js";
|
|
9
10
|
import "../chunk-QLPTHTVB.js";
|
|
10
|
-
import "../chunk-BXLTEUS4.js";
|
|
11
11
|
import "../chunk-QWGCMQQD.js";
|
|
12
12
|
export {
|
|
13
13
|
GovernanceBlockedError,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { G as GuardVerdict, b as GuardEngineOptions, P as PlanDefinition, a as GuardEvent, c as PlanProgress } from '../guard-contract-ddiIPlOg.cjs';
|
|
2
|
+
import { WorldDefinition } from '../types.cjs';
|
|
3
|
+
import { G as GovernanceBlockedError$1 } from '../shared-PpalGKxc.cjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* NeuroVerse Adapter — OpenClaw
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { G as GuardVerdict, b as GuardEngineOptions, P as PlanDefinition, a as GuardEvent, c as PlanProgress } from '../guard-contract-q6HJAq3Q.js';
|
|
2
|
+
import { WorldDefinition } from '../types.js';
|
|
3
|
+
import { G as GovernanceBlockedError$1 } from '../shared-DAzdfWtU.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* NeuroVerse Adapter — OpenClaw
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
NeuroVersePlugin,
|
|
4
4
|
createNeuroVersePlugin,
|
|
5
5
|
createNeuroVersePluginFromWorld
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-A7SHG75T.js";
|
|
7
7
|
import "../chunk-5U2MQO5P.js";
|
|
8
8
|
import "../chunk-ZAF6JH23.js";
|
|
9
|
+
import "../chunk-I4RTIMLX.js";
|
|
9
10
|
import "../chunk-QLPTHTVB.js";
|
|
10
|
-
import "../chunk-BXLTEUS4.js";
|
|
11
11
|
import "../chunk-QWGCMQQD.js";
|
|
12
12
|
export {
|
|
13
13
|
GovernanceBlockedError,
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootstrap Contract — Markdown → WorldDefinition Compilation Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the input/output contract for `neuroverse bootstrap`.
|
|
5
|
+
*
|
|
6
|
+
* Input: .nv-world.md file (structured markdown)
|
|
7
|
+
* Output: WorldDefinition (passed to validate, guard, or compileWorldToZip)
|
|
8
|
+
*
|
|
9
|
+
* The markdown format is:
|
|
10
|
+
* - YAML frontmatter for world identity and metadata
|
|
11
|
+
* - H1 sections for each block (Thesis, Invariants, State, etc.)
|
|
12
|
+
* - Structured sub-sections within each block
|
|
13
|
+
* - Deterministically parseable — no LLM, no heuristics
|
|
14
|
+
*
|
|
15
|
+
* Exit codes:
|
|
16
|
+
* 0 = SUCCESS (compiled cleanly)
|
|
17
|
+
* 1 = FAIL (parse errors, missing required sections)
|
|
18
|
+
* 3 = ERROR (file not found, invalid input)
|
|
19
|
+
*/
|
|
20
|
+
type ParseSeverity = 'error' | 'warning' | 'info';
|
|
21
|
+
/**
|
|
22
|
+
* A single parse issue found during markdown compilation.
|
|
23
|
+
*/
|
|
24
|
+
interface ParseIssue {
|
|
25
|
+
/** Line number in the source markdown (1-based) */
|
|
26
|
+
line: number;
|
|
27
|
+
/** Which section the issue was found in */
|
|
28
|
+
section: string;
|
|
29
|
+
/** Human-readable message */
|
|
30
|
+
message: string;
|
|
31
|
+
/** Severity */
|
|
32
|
+
severity: ParseSeverity;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The result of parsing a .nv-world.md file.
|
|
36
|
+
*/
|
|
37
|
+
interface BootstrapResult {
|
|
38
|
+
/** Whether compilation succeeded (no errors) */
|
|
39
|
+
success: boolean;
|
|
40
|
+
/** Source file path */
|
|
41
|
+
sourcePath: string;
|
|
42
|
+
/** All parse issues */
|
|
43
|
+
issues: ParseIssue[];
|
|
44
|
+
/** Parsed sections (for debugging) */
|
|
45
|
+
parsedSections: string[];
|
|
46
|
+
/** Duration */
|
|
47
|
+
durationMs: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* YAML frontmatter parsed from the markdown header.
|
|
51
|
+
*/
|
|
52
|
+
interface ParsedFrontmatter {
|
|
53
|
+
world_id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
version?: string;
|
|
56
|
+
runtime_mode?: string;
|
|
57
|
+
default_profile?: string;
|
|
58
|
+
alternative_profile?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A parsed invariant from the Invariants section.
|
|
62
|
+
*/
|
|
63
|
+
interface ParsedInvariant {
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
enforcement: string;
|
|
67
|
+
mutable: boolean;
|
|
68
|
+
line: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A parsed state variable from the State section.
|
|
72
|
+
*/
|
|
73
|
+
interface ParsedStateVariable {
|
|
74
|
+
id: string;
|
|
75
|
+
type: 'number' | 'enum' | 'boolean';
|
|
76
|
+
default: string | number | boolean;
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
min?: number;
|
|
80
|
+
max?: number;
|
|
81
|
+
step?: number;
|
|
82
|
+
options?: string[];
|
|
83
|
+
line: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A parsed assumption profile from the Assumptions section.
|
|
87
|
+
*/
|
|
88
|
+
interface ParsedAssumptionProfile {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
parameters: Record<string, string | number | boolean>;
|
|
93
|
+
line: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A parsed trigger from a rule.
|
|
97
|
+
*/
|
|
98
|
+
interface ParsedTrigger {
|
|
99
|
+
field: string;
|
|
100
|
+
operator: string;
|
|
101
|
+
value: string | number | boolean;
|
|
102
|
+
source: 'state' | 'assumption';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A parsed effect from a rule.
|
|
106
|
+
*/
|
|
107
|
+
interface ParsedEffect {
|
|
108
|
+
target: string;
|
|
109
|
+
operation: string;
|
|
110
|
+
value: number | boolean | string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A parsed rule from the Rules section.
|
|
114
|
+
*/
|
|
115
|
+
interface ParsedRule {
|
|
116
|
+
id: string;
|
|
117
|
+
label: string;
|
|
118
|
+
severity: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
order: number;
|
|
121
|
+
triggers: ParsedTrigger[];
|
|
122
|
+
effects: ParsedEffect[];
|
|
123
|
+
collapse_check?: {
|
|
124
|
+
field: string;
|
|
125
|
+
operator: string;
|
|
126
|
+
value: number;
|
|
127
|
+
};
|
|
128
|
+
causal_translation?: {
|
|
129
|
+
trigger_text: string;
|
|
130
|
+
rule_text: string;
|
|
131
|
+
shift_text: string;
|
|
132
|
+
effect_text: string;
|
|
133
|
+
};
|
|
134
|
+
line: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A parsed gate from the Gates section.
|
|
138
|
+
*/
|
|
139
|
+
interface ParsedGate {
|
|
140
|
+
status: string;
|
|
141
|
+
field: string;
|
|
142
|
+
operator: string;
|
|
143
|
+
value: number;
|
|
144
|
+
line: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A parsed outcome from the Outcomes section.
|
|
148
|
+
*/
|
|
149
|
+
interface ParsedOutcome {
|
|
150
|
+
id: string;
|
|
151
|
+
type: string;
|
|
152
|
+
range?: [number, number];
|
|
153
|
+
display?: string;
|
|
154
|
+
label: string;
|
|
155
|
+
primary?: boolean;
|
|
156
|
+
assignment?: string;
|
|
157
|
+
line: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A parsed lens directive from the Lenses section.
|
|
161
|
+
*/
|
|
162
|
+
interface ParsedLensDirective {
|
|
163
|
+
id: string;
|
|
164
|
+
scope: string;
|
|
165
|
+
instruction: string;
|
|
166
|
+
line: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* A parsed lens from the Lenses section.
|
|
170
|
+
* Each lens is an H2 subsection with key-value properties and directives.
|
|
171
|
+
*/
|
|
172
|
+
interface ParsedLens {
|
|
173
|
+
id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
tagline: string;
|
|
176
|
+
description: string;
|
|
177
|
+
tags: string[];
|
|
178
|
+
/** Tone: formality, verbosity, emotion, confidence */
|
|
179
|
+
formality: string;
|
|
180
|
+
verbosity: string;
|
|
181
|
+
emotion: string;
|
|
182
|
+
confidence: string;
|
|
183
|
+
/** Which roles this lens is the default for */
|
|
184
|
+
defaultForRoles: string[];
|
|
185
|
+
/** Behavioral directives */
|
|
186
|
+
directives: ParsedLensDirective[];
|
|
187
|
+
/** Priority when stacking (higher = applied later) */
|
|
188
|
+
priority: number;
|
|
189
|
+
/** Whether it can be stacked with other lenses */
|
|
190
|
+
stackable: boolean;
|
|
191
|
+
line: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The full parsed intermediate representation.
|
|
195
|
+
*/
|
|
196
|
+
interface ParsedWorld {
|
|
197
|
+
frontmatter: ParsedFrontmatter;
|
|
198
|
+
thesis: string;
|
|
199
|
+
invariants: ParsedInvariant[];
|
|
200
|
+
stateVariables: ParsedStateVariable[];
|
|
201
|
+
assumptions: ParsedAssumptionProfile[];
|
|
202
|
+
rules: ParsedRule[];
|
|
203
|
+
gates: ParsedGate[];
|
|
204
|
+
outcomes: ParsedOutcome[];
|
|
205
|
+
lenses: ParsedLens[];
|
|
206
|
+
lensPolicy?: 'locked' | 'role_default' | 'user_choice';
|
|
207
|
+
lensLockPin?: string;
|
|
208
|
+
}
|
|
209
|
+
declare const BOOTSTRAP_EXIT_CODES: {
|
|
210
|
+
readonly SUCCESS: 0;
|
|
211
|
+
readonly FAIL: 1;
|
|
212
|
+
readonly ERROR: 3;
|
|
213
|
+
};
|
|
214
|
+
type BootstrapExitCode = (typeof BOOTSTRAP_EXIT_CODES)[keyof typeof BOOTSTRAP_EXIT_CODES];
|
|
215
|
+
|
|
216
|
+
export { BOOTSTRAP_EXIT_CODES as B, type ParsedWorld as P, type ParseIssue as a, type BootstrapExitCode as b, type BootstrapResult as c, type ParsedAssumptionProfile as d, type ParsedEffect as e, type ParsedFrontmatter as f, type ParsedGate as g, type ParsedInvariant as h, type ParsedOutcome as i, type ParsedRule as j, type ParsedStateVariable as k, type ParsedTrigger as l };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootstrap Contract — Markdown → WorldDefinition Compilation Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the input/output contract for `neuroverse bootstrap`.
|
|
5
|
+
*
|
|
6
|
+
* Input: .nv-world.md file (structured markdown)
|
|
7
|
+
* Output: WorldDefinition (passed to validate, guard, or compileWorldToZip)
|
|
8
|
+
*
|
|
9
|
+
* The markdown format is:
|
|
10
|
+
* - YAML frontmatter for world identity and metadata
|
|
11
|
+
* - H1 sections for each block (Thesis, Invariants, State, etc.)
|
|
12
|
+
* - Structured sub-sections within each block
|
|
13
|
+
* - Deterministically parseable — no LLM, no heuristics
|
|
14
|
+
*
|
|
15
|
+
* Exit codes:
|
|
16
|
+
* 0 = SUCCESS (compiled cleanly)
|
|
17
|
+
* 1 = FAIL (parse errors, missing required sections)
|
|
18
|
+
* 3 = ERROR (file not found, invalid input)
|
|
19
|
+
*/
|
|
20
|
+
type ParseSeverity = 'error' | 'warning' | 'info';
|
|
21
|
+
/**
|
|
22
|
+
* A single parse issue found during markdown compilation.
|
|
23
|
+
*/
|
|
24
|
+
interface ParseIssue {
|
|
25
|
+
/** Line number in the source markdown (1-based) */
|
|
26
|
+
line: number;
|
|
27
|
+
/** Which section the issue was found in */
|
|
28
|
+
section: string;
|
|
29
|
+
/** Human-readable message */
|
|
30
|
+
message: string;
|
|
31
|
+
/** Severity */
|
|
32
|
+
severity: ParseSeverity;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The result of parsing a .nv-world.md file.
|
|
36
|
+
*/
|
|
37
|
+
interface BootstrapResult {
|
|
38
|
+
/** Whether compilation succeeded (no errors) */
|
|
39
|
+
success: boolean;
|
|
40
|
+
/** Source file path */
|
|
41
|
+
sourcePath: string;
|
|
42
|
+
/** All parse issues */
|
|
43
|
+
issues: ParseIssue[];
|
|
44
|
+
/** Parsed sections (for debugging) */
|
|
45
|
+
parsedSections: string[];
|
|
46
|
+
/** Duration */
|
|
47
|
+
durationMs: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* YAML frontmatter parsed from the markdown header.
|
|
51
|
+
*/
|
|
52
|
+
interface ParsedFrontmatter {
|
|
53
|
+
world_id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
version?: string;
|
|
56
|
+
runtime_mode?: string;
|
|
57
|
+
default_profile?: string;
|
|
58
|
+
alternative_profile?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A parsed invariant from the Invariants section.
|
|
62
|
+
*/
|
|
63
|
+
interface ParsedInvariant {
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
enforcement: string;
|
|
67
|
+
mutable: boolean;
|
|
68
|
+
line: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A parsed state variable from the State section.
|
|
72
|
+
*/
|
|
73
|
+
interface ParsedStateVariable {
|
|
74
|
+
id: string;
|
|
75
|
+
type: 'number' | 'enum' | 'boolean';
|
|
76
|
+
default: string | number | boolean;
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
min?: number;
|
|
80
|
+
max?: number;
|
|
81
|
+
step?: number;
|
|
82
|
+
options?: string[];
|
|
83
|
+
line: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A parsed assumption profile from the Assumptions section.
|
|
87
|
+
*/
|
|
88
|
+
interface ParsedAssumptionProfile {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
parameters: Record<string, string | number | boolean>;
|
|
93
|
+
line: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A parsed trigger from a rule.
|
|
97
|
+
*/
|
|
98
|
+
interface ParsedTrigger {
|
|
99
|
+
field: string;
|
|
100
|
+
operator: string;
|
|
101
|
+
value: string | number | boolean;
|
|
102
|
+
source: 'state' | 'assumption';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A parsed effect from a rule.
|
|
106
|
+
*/
|
|
107
|
+
interface ParsedEffect {
|
|
108
|
+
target: string;
|
|
109
|
+
operation: string;
|
|
110
|
+
value: number | boolean | string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A parsed rule from the Rules section.
|
|
114
|
+
*/
|
|
115
|
+
interface ParsedRule {
|
|
116
|
+
id: string;
|
|
117
|
+
label: string;
|
|
118
|
+
severity: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
order: number;
|
|
121
|
+
triggers: ParsedTrigger[];
|
|
122
|
+
effects: ParsedEffect[];
|
|
123
|
+
collapse_check?: {
|
|
124
|
+
field: string;
|
|
125
|
+
operator: string;
|
|
126
|
+
value: number;
|
|
127
|
+
};
|
|
128
|
+
causal_translation?: {
|
|
129
|
+
trigger_text: string;
|
|
130
|
+
rule_text: string;
|
|
131
|
+
shift_text: string;
|
|
132
|
+
effect_text: string;
|
|
133
|
+
};
|
|
134
|
+
line: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A parsed gate from the Gates section.
|
|
138
|
+
*/
|
|
139
|
+
interface ParsedGate {
|
|
140
|
+
status: string;
|
|
141
|
+
field: string;
|
|
142
|
+
operator: string;
|
|
143
|
+
value: number;
|
|
144
|
+
line: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A parsed outcome from the Outcomes section.
|
|
148
|
+
*/
|
|
149
|
+
interface ParsedOutcome {
|
|
150
|
+
id: string;
|
|
151
|
+
type: string;
|
|
152
|
+
range?: [number, number];
|
|
153
|
+
display?: string;
|
|
154
|
+
label: string;
|
|
155
|
+
primary?: boolean;
|
|
156
|
+
assignment?: string;
|
|
157
|
+
line: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A parsed lens directive from the Lenses section.
|
|
161
|
+
*/
|
|
162
|
+
interface ParsedLensDirective {
|
|
163
|
+
id: string;
|
|
164
|
+
scope: string;
|
|
165
|
+
instruction: string;
|
|
166
|
+
line: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* A parsed lens from the Lenses section.
|
|
170
|
+
* Each lens is an H2 subsection with key-value properties and directives.
|
|
171
|
+
*/
|
|
172
|
+
interface ParsedLens {
|
|
173
|
+
id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
tagline: string;
|
|
176
|
+
description: string;
|
|
177
|
+
tags: string[];
|
|
178
|
+
/** Tone: formality, verbosity, emotion, confidence */
|
|
179
|
+
formality: string;
|
|
180
|
+
verbosity: string;
|
|
181
|
+
emotion: string;
|
|
182
|
+
confidence: string;
|
|
183
|
+
/** Which roles this lens is the default for */
|
|
184
|
+
defaultForRoles: string[];
|
|
185
|
+
/** Behavioral directives */
|
|
186
|
+
directives: ParsedLensDirective[];
|
|
187
|
+
/** Priority when stacking (higher = applied later) */
|
|
188
|
+
priority: number;
|
|
189
|
+
/** Whether it can be stacked with other lenses */
|
|
190
|
+
stackable: boolean;
|
|
191
|
+
line: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The full parsed intermediate representation.
|
|
195
|
+
*/
|
|
196
|
+
interface ParsedWorld {
|
|
197
|
+
frontmatter: ParsedFrontmatter;
|
|
198
|
+
thesis: string;
|
|
199
|
+
invariants: ParsedInvariant[];
|
|
200
|
+
stateVariables: ParsedStateVariable[];
|
|
201
|
+
assumptions: ParsedAssumptionProfile[];
|
|
202
|
+
rules: ParsedRule[];
|
|
203
|
+
gates: ParsedGate[];
|
|
204
|
+
outcomes: ParsedOutcome[];
|
|
205
|
+
lenses: ParsedLens[];
|
|
206
|
+
lensPolicy?: 'locked' | 'role_default' | 'user_choice';
|
|
207
|
+
lensLockPin?: string;
|
|
208
|
+
}
|
|
209
|
+
declare const BOOTSTRAP_EXIT_CODES: {
|
|
210
|
+
readonly SUCCESS: 0;
|
|
211
|
+
readonly FAIL: 1;
|
|
212
|
+
readonly ERROR: 3;
|
|
213
|
+
};
|
|
214
|
+
type BootstrapExitCode = (typeof BOOTSTRAP_EXIT_CODES)[keyof typeof BOOTSTRAP_EXIT_CODES];
|
|
215
|
+
|
|
216
|
+
export { BOOTSTRAP_EXIT_CODES as B, type ParsedWorld as P, type ParseIssue as a, type BootstrapExitCode as b, type BootstrapResult as c, type ParsedAssumptionProfile as d, type ParsedEffect as e, type ParsedFrontmatter as f, type ParsedGate as g, type ParsedInvariant as h, type ParsedOutcome as i, type ParsedRule as j, type ParsedStateVariable as k, type ParsedTrigger as l };
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
DeriveInputError,
|
|
3
3
|
DeriveProviderError,
|
|
4
4
|
deriveWorld
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FHXXD2TI.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
|
-
import {
|
|
13
|
-
parseWorldMarkdown
|
|
14
|
-
} from "./chunk-3NZMMSOW.js";
|
|
15
12
|
import {
|
|
16
13
|
emitWorldDefinition
|
|
17
14
|
} from "./chunk-YPCVY4GS.js";
|
|
15
|
+
import {
|
|
16
|
+
parseWorldMarkdown
|
|
17
|
+
} from "./chunk-3NZMMSOW.js";
|
|
18
18
|
import "./chunk-QWGCMQQD.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/build.ts
|