@neuroverseos/governance 0.5.1 → 0.6.1
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/README.md +55 -0
- package/dist/adapters/autoresearch.js +2 -2
- package/dist/adapters/deep-agents.js +2 -2
- package/dist/adapters/express.js +2 -2
- package/dist/adapters/github.js +2 -2
- package/dist/adapters/index.js +8 -8
- package/dist/adapters/langchain.js +2 -2
- package/dist/adapters/mentraos.js +2 -2
- package/dist/adapters/openai.js +2 -2
- package/dist/adapters/openclaw.js +2 -2
- package/dist/{add-JP7TC2K3.js → add-XSANI3FK.js} +1 -1
- package/dist/{build-THUEYMVT.js → build-EGBGZFIJ.js} +5 -5
- package/dist/{chunk-TZBERHFM.js → chunk-7FL3U7Z5.js} +1 -1
- package/dist/{chunk-FGOSKQDE.js → chunk-A2UZTLRV.js} +1 -1
- package/dist/chunk-AEVT7DSZ.js +1208 -0
- package/dist/{chunk-R23T5SZG.js → chunk-B3IIPTY3.js} +1 -1
- package/dist/chunk-EQR7BGFN.js +337 -0
- package/dist/{chunk-LAKUB76X.js → chunk-FDPPZLSQ.js} +1 -1
- package/dist/{chunk-UZBW44KD.js → chunk-FKQCPRKI.js} +1 -1
- package/dist/{chunk-XPMZB46F.js → chunk-FS2UUJJO.js} +3 -3
- package/dist/{chunk-6UPEUMJ2.js → chunk-HDNDL6D5.js} +1 -1
- package/dist/{chunk-7UU7V3AD.js → chunk-IOVXB6QN.js} +1 -1
- package/dist/{chunk-EK77AJAH.js → chunk-OTZU76DH.js} +1 -1
- package/dist/{chunk-5RAQ5DZW.js → chunk-T6GMRZWC.js} +1 -1
- package/dist/{chunk-RF2L5SYG.js → chunk-TIXVEPS2.js} +1 -1
- package/dist/{chunk-TL4DLMMW.js → chunk-TJ5L2UTE.js} +1 -1
- package/dist/chunk-UGTNKTHS.js +542 -0
- package/dist/chunk-VGFDMPVB.js +436 -0
- package/dist/cli/neuroverse.cjs +4089 -328
- package/dist/cli/neuroverse.js +62 -103
- package/dist/cli/plan.js +1 -1
- package/dist/cli/radiant.cjs +2058 -0
- package/dist/cli/radiant.d.cts +25 -0
- package/dist/cli/radiant.d.ts +25 -0
- package/dist/cli/radiant.js +422 -0
- package/dist/cli/run.js +2 -2
- package/dist/cli/worldmodel.cjs +1624 -0
- package/dist/cli/worldmodel.d.cts +24 -0
- package/dist/cli/worldmodel.d.ts +24 -0
- package/dist/cli/worldmodel.js +742 -0
- package/dist/{demo-N5K4VXJW.js → demo-6W3YXLAX.js} +2 -2
- package/dist/{derive-5LOMN7GO.js → derive-7Y7YWVLU.js} +4 -4
- package/dist/engine/worldmodel-compiler.cjs +366 -0
- package/dist/engine/worldmodel-compiler.d.cts +46 -0
- package/dist/engine/worldmodel-compiler.d.ts +46 -0
- package/dist/engine/worldmodel-compiler.js +17 -0
- package/dist/engine/worldmodel-parser.cjs +566 -0
- package/dist/engine/worldmodel-parser.d.cts +22 -0
- package/dist/engine/worldmodel-parser.d.ts +22 -0
- package/dist/engine/worldmodel-parser.js +7 -0
- package/dist/{equity-penalties-PYCJ3Q4U.js → equity-penalties-CCO3GVHS.js} +1 -1
- package/dist/{explain-42TVC3QD.js → explain-HDFN4ION.js} +1 -1
- package/dist/{guard-TPYDFG6V.js → guard-IHJEKHL2.js} +1 -1
- package/dist/{improve-HLZGJ54Z.js → improve-LRORRYEX.js} +1 -1
- package/dist/index.js +29 -29
- package/dist/{lens-NFGZHD76.js → lens-TLDZQXBI.js} +61 -2
- package/dist/lenses-K5FVSALR.js +13 -0
- package/dist/{mcp-server-5XXNG6VC.js → mcp-server-CKYBHXWK.js} +2 -2
- package/dist/{playground-2EU5CFIH.js → playground-3TTBN7XD.js} +1 -1
- package/dist/radiant/index.cjs +1700 -0
- package/dist/radiant/index.d.cts +1163 -0
- package/dist/radiant/index.d.ts +1163 -0
- package/dist/radiant/index.js +75 -0
- package/dist/{redteam-VK6OVHAE.js → redteam-W644UMWN.js} +1 -1
- package/dist/{session-NGA4DUPL.js → session-FMAROEIE.js} +2 -2
- package/dist/{simulate-4YNOBMES.js → simulate-VT437EEL.js} +1 -1
- package/dist/{test-HDBPMQTG.js → test-XDB2DH3L.js} +1 -1
- package/dist/{validate-6MFQZ2EG.js → validate-M52DX22Y.js} +1 -1
- package/dist/{world-H5WVURKU.js → world-O4HTQPDP.js} +1 -1
- package/dist/{world-loader-J47PCPDZ.js → world-loader-YTYFOP7D.js} +1 -1
- package/dist/worldmodel-contract-BPGhiuW5.d.cts +221 -0
- package/dist/worldmodel-contract-BPGhiuW5.d.ts +221 -0
- package/dist/worlds/auki-vanguard.worldmodel.md +116 -0
- package/dist/worlds/behavioral-demo.nv-world.md +177 -0
- package/dist/worlds/neuroverse-governance.worldmodel.md +115 -0
- package/package.json +7 -2
- package/dist/{bootstrap-IP5QMC3Q.js → bootstrap-2OW5ZLBL.js} +3 -3
- package/dist/{chunk-QZ666FCV.js → chunk-FHXXD2TI.js} +6 -6
- package/dist/{chunk-EQUAWNXW.js → chunk-I4RTIMLX.js} +0 -0
- package/dist/{configure-ai-5MP5DWTT.js → configure-ai-LL3VAPQW.js} +3 -3
- /package/dist/{doctor-Q5APJOTS.js → doctor-XEMLO6UA.js} +0 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
// src/engine/worldmodel-compiler.ts
|
|
2
|
+
function toSnakeCase(text) {
|
|
3
|
+
return text.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
|
|
4
|
+
}
|
|
5
|
+
function toKebabCase(text) {
|
|
6
|
+
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
7
|
+
}
|
|
8
|
+
function titleCase(text) {
|
|
9
|
+
return text.split(/[\s_-]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
|
|
10
|
+
}
|
|
11
|
+
function matchSignal(behaviorText, signals) {
|
|
12
|
+
const lowerText = behaviorText.toLowerCase();
|
|
13
|
+
for (const signal of signals) {
|
|
14
|
+
const signalWords = signal.toLowerCase().split("_");
|
|
15
|
+
if (signalWords.some((w) => w.length > 3 && lowerText.includes(w))) {
|
|
16
|
+
return signal;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return "alignment_score";
|
|
20
|
+
}
|
|
21
|
+
function emitWorldMarkdown(model) {
|
|
22
|
+
const lines = [];
|
|
23
|
+
const worldId = model.frontmatter.model_id;
|
|
24
|
+
const worldName = model.frontmatter.name;
|
|
25
|
+
const version = model.frontmatter.version;
|
|
26
|
+
lines.push("---");
|
|
27
|
+
lines.push(`world_id: ${worldId}`);
|
|
28
|
+
lines.push(`name: ${worldName}`);
|
|
29
|
+
lines.push(`version: ${version}`);
|
|
30
|
+
lines.push("runtime_mode: COMPLIANCE");
|
|
31
|
+
lines.push("default_profile: aligned");
|
|
32
|
+
lines.push("alternative_profile: drifting");
|
|
33
|
+
lines.push("---");
|
|
34
|
+
lines.push("");
|
|
35
|
+
lines.push("# Thesis");
|
|
36
|
+
lines.push("");
|
|
37
|
+
lines.push(model.geometry.mission);
|
|
38
|
+
if (model.geometry.centerIdentity) {
|
|
39
|
+
lines.push(
|
|
40
|
+
`When all domains are aligned, the system operates as: ${model.geometry.centerIdentity}.`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
lines.push("");
|
|
44
|
+
lines.push("# Invariants");
|
|
45
|
+
lines.push("");
|
|
46
|
+
let invariantIdx = 0;
|
|
47
|
+
for (const domain of model.geometry.domains) {
|
|
48
|
+
for (const value of domain.values) {
|
|
49
|
+
invariantIdx++;
|
|
50
|
+
const invId = `${toSnakeCase(domain.name)}_value_${String(invariantIdx).padStart(2, "0")}`;
|
|
51
|
+
lines.push(
|
|
52
|
+
`- \`${invId}\` \u2014 ${value} [${domain.name}] (structural, immutable)`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
lines.push("");
|
|
57
|
+
lines.push("# State");
|
|
58
|
+
lines.push("");
|
|
59
|
+
lines.push("## alignment_score");
|
|
60
|
+
lines.push("- type: number");
|
|
61
|
+
lines.push("- min: 0");
|
|
62
|
+
lines.push("- max: 100");
|
|
63
|
+
lines.push("- step: 5");
|
|
64
|
+
lines.push("- default: 70");
|
|
65
|
+
lines.push("- label: Alignment Score");
|
|
66
|
+
lines.push(
|
|
67
|
+
"- description: Composite behavioral alignment metric derived from all signals"
|
|
68
|
+
);
|
|
69
|
+
lines.push("");
|
|
70
|
+
for (const signal of model.evolution.signals) {
|
|
71
|
+
const signalId = toSnakeCase(signal);
|
|
72
|
+
const signalLabel = titleCase(signal);
|
|
73
|
+
lines.push(`## ${signalId}`);
|
|
74
|
+
lines.push("- type: number");
|
|
75
|
+
lines.push("- min: 0");
|
|
76
|
+
lines.push("- max: 100");
|
|
77
|
+
lines.push("- step: 5");
|
|
78
|
+
lines.push("- default: 70");
|
|
79
|
+
lines.push(`- label: ${signalLabel}`);
|
|
80
|
+
lines.push(`- description: Behavioral signal measuring ${signal.replace(/_/g, " ")}`);
|
|
81
|
+
lines.push("");
|
|
82
|
+
}
|
|
83
|
+
lines.push("# Assumptions");
|
|
84
|
+
lines.push("");
|
|
85
|
+
lines.push("## aligned");
|
|
86
|
+
lines.push("- name: Aligned");
|
|
87
|
+
lines.push("- description: All behavioral signals at healthy levels");
|
|
88
|
+
lines.push("- pressure_level: low");
|
|
89
|
+
lines.push("");
|
|
90
|
+
lines.push("## drifting");
|
|
91
|
+
lines.push("- name: Drifting");
|
|
92
|
+
lines.push("- description: Behavioral signals under pressure with drift risk");
|
|
93
|
+
lines.push("- pressure_level: high");
|
|
94
|
+
lines.push("");
|
|
95
|
+
lines.push("# Rules");
|
|
96
|
+
lines.push("");
|
|
97
|
+
let ruleIdx = 0;
|
|
98
|
+
for (const drift of model.evolution.driftBehaviors) {
|
|
99
|
+
ruleIdx++;
|
|
100
|
+
const ruleId = `rule-${String(ruleIdx).padStart(3, "0")}`;
|
|
101
|
+
const matchedSignal = matchSignal(drift, model.evolution.signals);
|
|
102
|
+
const signalId = toSnakeCase(matchedSignal);
|
|
103
|
+
lines.push(`## ${ruleId}: ${drift} (degradation)`);
|
|
104
|
+
lines.push(`Drift behavior detected: ${drift}`);
|
|
105
|
+
lines.push("");
|
|
106
|
+
lines.push(`When ${signalId} < 50 [state]`);
|
|
107
|
+
lines.push("Then alignment_score *= 0.80");
|
|
108
|
+
lines.push("");
|
|
109
|
+
lines.push(`> trigger: ${signalId} drops below threshold`);
|
|
110
|
+
lines.push(`> rule: Drift behavior weakens alignment`);
|
|
111
|
+
lines.push(`> shift: Behavioral alignment decreases`);
|
|
112
|
+
lines.push(`> effect: Alignment score reduced by 20%`);
|
|
113
|
+
lines.push("");
|
|
114
|
+
}
|
|
115
|
+
for (const aligned of model.evolution.alignedBehaviors) {
|
|
116
|
+
ruleIdx++;
|
|
117
|
+
const ruleId = `rule-${String(ruleIdx).padStart(3, "0")}`;
|
|
118
|
+
const matchedSignal = matchSignal(aligned, model.evolution.signals);
|
|
119
|
+
const signalId = toSnakeCase(matchedSignal);
|
|
120
|
+
lines.push(`## ${ruleId}: ${aligned} (advantage)`);
|
|
121
|
+
lines.push(`Aligned behavior reinforced: ${aligned}`);
|
|
122
|
+
lines.push("");
|
|
123
|
+
lines.push(`When ${signalId} >= 70 [state]`);
|
|
124
|
+
lines.push("Then alignment_score *= 1.10");
|
|
125
|
+
lines.push("");
|
|
126
|
+
lines.push(`> trigger: ${signalId} above healthy threshold`);
|
|
127
|
+
lines.push(`> rule: Aligned behavior strengthens system`);
|
|
128
|
+
lines.push(`> shift: Behavioral alignment increases`);
|
|
129
|
+
lines.push(`> effect: Alignment score boosted by 10%`);
|
|
130
|
+
lines.push("");
|
|
131
|
+
}
|
|
132
|
+
for (let i = 0; i < model.evolution.decisionPriorities.length; i++) {
|
|
133
|
+
ruleIdx++;
|
|
134
|
+
const priority = model.evolution.decisionPriorities[i];
|
|
135
|
+
const ruleId = `rule-${String(ruleIdx).padStart(3, "0")}`;
|
|
136
|
+
lines.push(
|
|
137
|
+
`## ${ruleId}: ${priority.preferred} over ${priority.over} (structural)`
|
|
138
|
+
);
|
|
139
|
+
lines.push(
|
|
140
|
+
`Priority: ${priority.preferred} takes precedence over ${priority.over} in tradeoff situations.`
|
|
141
|
+
);
|
|
142
|
+
lines.push("");
|
|
143
|
+
lines.push("When alignment_score < 40 [state]");
|
|
144
|
+
lines.push("Then alignment_score *= 0.70");
|
|
145
|
+
lines.push("Collapse: alignment_score < 10");
|
|
146
|
+
lines.push("");
|
|
147
|
+
lines.push(`> trigger: Alignment score critically low`);
|
|
148
|
+
lines.push(
|
|
149
|
+
`> rule: Priority violation \u2014 ${priority.preferred} must outweigh ${priority.over}`
|
|
150
|
+
);
|
|
151
|
+
lines.push(`> shift: System enters structural enforcement`);
|
|
152
|
+
lines.push(`> effect: Alignment sharply reduced; collapse if critical`);
|
|
153
|
+
lines.push("");
|
|
154
|
+
}
|
|
155
|
+
lines.push("# Gates");
|
|
156
|
+
lines.push("");
|
|
157
|
+
lines.push("- STRONG: alignment_score >= 85");
|
|
158
|
+
lines.push("- STABLE: alignment_score >= 65");
|
|
159
|
+
lines.push("- WATCHING: alignment_score >= 45");
|
|
160
|
+
lines.push("- FRAGILE: alignment_score > 30");
|
|
161
|
+
lines.push("- MISALIGNED: alignment_score <= 30");
|
|
162
|
+
lines.push("");
|
|
163
|
+
lines.push("# Outcomes");
|
|
164
|
+
lines.push("");
|
|
165
|
+
lines.push("## alignment_score");
|
|
166
|
+
lines.push("- type: number");
|
|
167
|
+
lines.push("- range: 0-100");
|
|
168
|
+
lines.push("- display: percentage");
|
|
169
|
+
lines.push("- label: Alignment Score");
|
|
170
|
+
lines.push("- primary: true");
|
|
171
|
+
lines.push("");
|
|
172
|
+
for (const signal of model.evolution.signals) {
|
|
173
|
+
const signalId = toSnakeCase(signal);
|
|
174
|
+
const signalLabel = titleCase(signal);
|
|
175
|
+
lines.push(`## ${signalId}`);
|
|
176
|
+
lines.push("- type: number");
|
|
177
|
+
lines.push("- range: 0-100");
|
|
178
|
+
lines.push("- display: percentage");
|
|
179
|
+
lines.push(`- label: ${signalLabel}`);
|
|
180
|
+
lines.push("");
|
|
181
|
+
}
|
|
182
|
+
const lensSuggestions = buildLensSuggestions(model);
|
|
183
|
+
if (lensSuggestions.length > 0) {
|
|
184
|
+
lines.push("# Lenses");
|
|
185
|
+
lines.push("- policy: role_default");
|
|
186
|
+
lines.push("");
|
|
187
|
+
for (const lens of lensSuggestions) {
|
|
188
|
+
lines.push(`## ${lens.id}`);
|
|
189
|
+
lines.push(`- tagline: ${lens.tagline}`);
|
|
190
|
+
lines.push(
|
|
191
|
+
`- description: Lens derived from ${lens.derived_from.domainA} and ${lens.derived_from.domainB} interaction, producing ${lens.derived_from.effect}.`
|
|
192
|
+
);
|
|
193
|
+
lines.push(`- formality: ${lens.tone.formality}`);
|
|
194
|
+
lines.push(`- verbosity: ${lens.tone.verbosity}`);
|
|
195
|
+
lines.push(`- emotion: ${lens.tone.emotion}`);
|
|
196
|
+
lines.push(`- confidence: ${lens.tone.confidence}`);
|
|
197
|
+
lines.push("- tags: behavioral, worldmodel, overlap");
|
|
198
|
+
lines.push("- default_for_roles: all");
|
|
199
|
+
lines.push("- priority: 50");
|
|
200
|
+
lines.push("- stackable: true");
|
|
201
|
+
lines.push("");
|
|
202
|
+
for (const directive of lens.directives) {
|
|
203
|
+
lines.push(`> ${directive.scope}: ${directive.instruction}`);
|
|
204
|
+
}
|
|
205
|
+
lines.push("");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return lines.join("\n");
|
|
209
|
+
}
|
|
210
|
+
function emitSignalSchema(model) {
|
|
211
|
+
const signals = model.evolution.signals.map((signal) => ({
|
|
212
|
+
id: toSnakeCase(signal),
|
|
213
|
+
name: titleCase(signal),
|
|
214
|
+
type: "number",
|
|
215
|
+
default: 70
|
|
216
|
+
}));
|
|
217
|
+
return {
|
|
218
|
+
model_id: model.frontmatter.model_id,
|
|
219
|
+
signals
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function emitOverlapMap(model) {
|
|
223
|
+
const pairings = model.geometry.overlapEffects.map((o) => ({
|
|
224
|
+
domainA: o.domainA,
|
|
225
|
+
domainB: o.domainB,
|
|
226
|
+
effect: o.effect
|
|
227
|
+
}));
|
|
228
|
+
const matrix = {};
|
|
229
|
+
for (const overlap of model.geometry.overlapEffects) {
|
|
230
|
+
const keyA = toKebabCase(overlap.domainA);
|
|
231
|
+
const keyB = toKebabCase(overlap.domainB);
|
|
232
|
+
if (!matrix[keyA]) matrix[keyA] = {};
|
|
233
|
+
matrix[keyA][keyB] = overlap.effect;
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
model_id: model.frontmatter.model_id,
|
|
237
|
+
pairings,
|
|
238
|
+
matrix
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function emitContextsConfig(model) {
|
|
242
|
+
return {
|
|
243
|
+
model_id: model.frontmatter.model_id,
|
|
244
|
+
authority_layers: model.modifiers.authorityLayers,
|
|
245
|
+
spatial_contexts: model.modifiers.spatialContexts,
|
|
246
|
+
interpretation_rules: model.modifiers.interpretationRules
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function deriveTone(domainA, domainB) {
|
|
250
|
+
const combined = `${domainA} ${domainB}`.toLowerCase();
|
|
251
|
+
let formality = "neutral";
|
|
252
|
+
if (/strateg|technic|analytic|research|engineer/.test(combined)) {
|
|
253
|
+
formality = "professional";
|
|
254
|
+
} else if (/narrat|story|communi|creative/.test(combined)) {
|
|
255
|
+
formality = "casual";
|
|
256
|
+
}
|
|
257
|
+
let verbosity = "balanced";
|
|
258
|
+
if (/foresight|scenario|plan|design/.test(combined)) {
|
|
259
|
+
verbosity = "detailed";
|
|
260
|
+
} else if (/prosper|negotiat|stakeholder/.test(combined)) {
|
|
261
|
+
verbosity = "concise";
|
|
262
|
+
}
|
|
263
|
+
let emotion = "neutral";
|
|
264
|
+
if (/empath|emoti|care|safe|trust/.test(combined)) {
|
|
265
|
+
emotion = "warm";
|
|
266
|
+
} else if (/analytic|system|data/.test(combined)) {
|
|
267
|
+
emotion = "clinical";
|
|
268
|
+
}
|
|
269
|
+
let confidence = "balanced";
|
|
270
|
+
if (/lead|command|decis|strateg/.test(combined)) {
|
|
271
|
+
confidence = "authoritative";
|
|
272
|
+
} else if (/explor|experiment|creat/.test(combined)) {
|
|
273
|
+
confidence = "exploratory";
|
|
274
|
+
}
|
|
275
|
+
return { formality, verbosity, emotion, confidence };
|
|
276
|
+
}
|
|
277
|
+
function buildLensSuggestions(model) {
|
|
278
|
+
const lenses = [];
|
|
279
|
+
const domainMap = new Map(model.geometry.domains.map((d) => [d.name.toLowerCase(), d]));
|
|
280
|
+
for (const overlap of model.geometry.overlapEffects) {
|
|
281
|
+
const lensId = toKebabCase(overlap.effect);
|
|
282
|
+
const tone = deriveTone(overlap.domainA, overlap.domainB);
|
|
283
|
+
const domainAData = domainMap.get(overlap.domainA.toLowerCase());
|
|
284
|
+
const domainBData = domainMap.get(overlap.domainB.toLowerCase());
|
|
285
|
+
const directives = [];
|
|
286
|
+
if (domainAData && domainAData.skills.length > 0) {
|
|
287
|
+
directives.push({
|
|
288
|
+
scope: "response_framing",
|
|
289
|
+
instruction: `Approach through the lens of ${domainAData.skills.join(", ").toLowerCase()}.`
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
if (domainBData && domainBData.values.length > 0) {
|
|
293
|
+
directives.push({
|
|
294
|
+
scope: "behavior_shaping",
|
|
295
|
+
instruction: `Maintain ${domainBData.values.join(", ").toLowerCase()} in all responses.`
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
directives.push({
|
|
299
|
+
scope: "value_emphasis",
|
|
300
|
+
instruction: `Emphasize ${overlap.effect.toLowerCase()} as the emergent state of aligned behavior.`
|
|
301
|
+
});
|
|
302
|
+
lenses.push({
|
|
303
|
+
id: lensId,
|
|
304
|
+
name: titleCase(overlap.effect),
|
|
305
|
+
tagline: `${overlap.effect} through ${overlap.domainA} and ${overlap.domainB}.`,
|
|
306
|
+
derived_from: {
|
|
307
|
+
domainA: overlap.domainA,
|
|
308
|
+
domainB: overlap.domainB,
|
|
309
|
+
effect: overlap.effect
|
|
310
|
+
},
|
|
311
|
+
tone,
|
|
312
|
+
directives
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
return lenses;
|
|
316
|
+
}
|
|
317
|
+
function emitLensSuggestions(model) {
|
|
318
|
+
return buildLensSuggestions(model);
|
|
319
|
+
}
|
|
320
|
+
function compileWorldModel(model) {
|
|
321
|
+
return {
|
|
322
|
+
worldMarkdown: emitWorldMarkdown(model),
|
|
323
|
+
signalSchema: emitSignalSchema(model),
|
|
324
|
+
overlapMap: emitOverlapMap(model),
|
|
325
|
+
contextsConfig: emitContextsConfig(model),
|
|
326
|
+
lensSuggestions: emitLensSuggestions(model)
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export {
|
|
331
|
+
emitWorldMarkdown,
|
|
332
|
+
emitSignalSchema,
|
|
333
|
+
emitOverlapMap,
|
|
334
|
+
emitContextsConfig,
|
|
335
|
+
emitLensSuggestions,
|
|
336
|
+
compileWorldModel
|
|
337
|
+
};
|
|
@@ -35,7 +35,7 @@ async function addGuard(worldDir, input) {
|
|
|
35
35
|
};
|
|
36
36
|
config.guards.push(guard);
|
|
37
37
|
await writeFile(guardsPath, JSON.stringify(config, null, 2) + "\n");
|
|
38
|
-
const { loadWorldFromDirectory } = await import("./world-loader-
|
|
38
|
+
const { loadWorldFromDirectory } = await import("./world-loader-YTYFOP7D.js");
|
|
39
39
|
const world = await loadWorldFromDirectory(worldDir);
|
|
40
40
|
const report = validateWorld(world);
|
|
41
41
|
return {
|
|
@@ -83,7 +83,7 @@ async function addRule(worldDir, input) {
|
|
|
83
83
|
};
|
|
84
84
|
const rulePath = join(rulesDir, `rule-${ruleNum}.json`);
|
|
85
85
|
await writeFile(rulePath, JSON.stringify(rule, null, 2) + "\n");
|
|
86
|
-
const { loadWorldFromDirectory } = await import("./world-loader-
|
|
86
|
+
const { loadWorldFromDirectory } = await import("./world-loader-YTYFOP7D.js");
|
|
87
87
|
const world = await loadWorldFromDirectory(worldDir);
|
|
88
88
|
const report = validateWorld(world);
|
|
89
89
|
return {
|
|
@@ -118,7 +118,7 @@ async function addInvariant(worldDir, input) {
|
|
|
118
118
|
};
|
|
119
119
|
config.invariants.push(invariant);
|
|
120
120
|
await writeFile(invariantsPath, JSON.stringify(config, null, 2) + "\n");
|
|
121
|
-
const { loadWorldFromDirectory } = await import("./world-loader-
|
|
121
|
+
const { loadWorldFromDirectory } = await import("./world-loader-YTYFOP7D.js");
|
|
122
122
|
const world = await loadWorldFromDirectory(worldDir);
|
|
123
123
|
const report = validateWorld(world);
|
|
124
124
|
return {
|