@neuroverseos/governance 0.8.0 → 0.9.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.
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  createAnthropicAI,
3
+ discoverWorlds,
3
4
  emergent,
5
+ formatActiveWorlds,
4
6
  parseScope,
5
7
  readExocortex,
6
8
  summarizeExocortex,
7
9
  think
8
- } from "../chunk-MC6O5GV5.js";
10
+ } from "../chunk-3ZWU7C43.js";
9
11
  import {
10
12
  listLenses
11
- } from "../chunk-VGFDMPVB.js";
13
+ } from "../chunk-TCGGED4G.js";
12
14
  import "../chunk-I4RTIMLX.js";
13
15
  import "../chunk-ZAF6JH23.js";
14
16
  import "../chunk-QLPTHTVB.js";
@@ -42,6 +44,18 @@ ${BOLD}Usage:${RESET}
42
44
  neuroverse radiant lenses list
43
45
  neuroverse radiant lenses describe auki-builder
44
46
 
47
+ ${BOLD}Auto-discovery:${RESET}
48
+ You do not need to clone the target repo.
49
+
50
+ radiant emergent NeuroverseOS/ \u2192 probes github.com/NeuroverseOS/worlds
51
+ radiant emergent aukiverse/posemesh \u2192 probes github.com/aukiverse/worlds
52
+
53
+ The scope argument itself is enough. Discovery also picks up
54
+ ~/.neuroverse/worlds/ (personal), the org from your current clone's
55
+ .git/config (if any), and ./worlds/ (this repo).
56
+
57
+ Set NEUROVERSE_NO_ORG=1 to disable org probing for a single run.
58
+
45
59
  ${BOLD}Environment:${RESET}
46
60
  ANTHROPIC_API_KEY Required for AI commands (think, emergent, decision)
47
61
  RADIANT_WORLDS Default worlds directory (overridden by --worlds)
@@ -133,20 +147,48 @@ ${content}`;
133
147
  }
134
148
  throw new Error(`Worlds path is neither a file nor a directory: ${resolved}`);
135
149
  }
136
- async function cmdThink(args) {
137
- const lensId = args.lens ?? process.env.RADIANT_LENS;
138
- if (!lensId) {
150
+ function resolveWorldmodelContent(explicitPath, scopeOwner) {
151
+ if (explicitPath) {
152
+ return loadWorldmodelContent(explicitPath);
153
+ }
154
+ const stack = discoverWorlds({
155
+ repoDir: process.cwd(),
156
+ scopeOwner
157
+ });
158
+ if (stack.worlds.length === 0) {
159
+ const scopeLine = scopeOwner ? ` 3. github:${scopeOwner}/worlds (from scope arg)
160
+ ` : "";
161
+ const ext = scopeOwner ? 4 : 3;
162
+ const repo = scopeOwner ? 5 : 4;
139
163
  process.stderr.write(
140
- `${RED}Error:${RESET} --lens <id> or RADIANT_LENS required.
141
- ${DIM}Available lenses: ${listLenses().join(", ")}${RESET}
164
+ `${RED}Error:${RESET} No worldmodel found.
165
+ ${DIM}Tried (in order):
166
+ 1. ~/.neuroverse/worlds/ (user tier)
167
+ 2. github:<owner>/worlds (org auto-detect from git remote)
168
+ ` + scopeLine + ` ${ext}. .neuroverse/config.json extends (explicit shared worlds)
169
+ ${repo}. ./worlds/ or ./.neuroverse/worlds/ (repo tier)
170
+
171
+ Pass --worlds <dir> or set RADIANT_WORLDS to specify explicitly.
172
+ Or run against a <scope>/ where github.com/<scope>/worlds exists.${RESET}
142
173
  `
143
174
  );
144
175
  process.exit(1);
145
176
  }
146
- const worldsPath = args.worlds ?? process.env.RADIANT_WORLDS;
147
- if (!worldsPath) {
177
+ process.stderr.write(`${DIM}${formatActiveWorlds(stack)}${RESET}
178
+
179
+ `);
180
+ for (const warning of stack.warnings) {
181
+ process.stderr.write(`${YELLOW}\u26A0${RESET} ${warning}
182
+ `);
183
+ }
184
+ return stack.combinedContent;
185
+ }
186
+ async function cmdThink(args) {
187
+ const lensId = args.lens ?? process.env.RADIANT_LENS;
188
+ if (!lensId) {
148
189
  process.stderr.write(
149
- `${RED}Error:${RESET} --worlds <dir> or RADIANT_WORLDS required.
190
+ `${RED}Error:${RESET} --lens <id> or RADIANT_LENS required.
191
+ ${DIM}Available lenses: ${listLenses().join(", ")}${RESET}
150
192
  `
151
193
  );
152
194
  process.exit(1);
@@ -175,12 +217,12 @@ ${DIM}Use --query "...", pass as trailing args, or pipe via stdin.${RESET}
175
217
  );
176
218
  process.exit(1);
177
219
  }
178
- const worldmodelContent = loadWorldmodelContent(worldsPath);
220
+ const explicitWorldsPath = args.worlds ?? process.env.RADIANT_WORLDS;
221
+ const worldmodelContent = resolveWorldmodelContent(explicitWorldsPath);
179
222
  const model = args.model ?? process.env.RADIANT_MODEL;
180
223
  const ai = createAnthropicAI(apiKey, model || void 0);
181
224
  process.stderr.write(
182
- `${DIM}Worlds: ${worldsPath}${RESET}
183
- ${DIM}Lens: ${lensId}${RESET}
225
+ `${DIM}Lens: ${lensId}${RESET}
184
226
  ${DIM}Model: ${model ?? "claude-sonnet-4-20250514 (default)"}${RESET}
185
227
 
186
228
  `
@@ -239,14 +281,6 @@ async function cmdEmergent(args) {
239
281
  process.stderr.write(
240
282
  `${RED}Error:${RESET} --lens <id> or RADIANT_LENS required.
241
283
  ${DIM}Available lenses: ${listLenses().join(", ")}${RESET}
242
- `
243
- );
244
- process.exit(1);
245
- }
246
- const worldsPath = args.worlds ?? process.env.RADIANT_WORLDS;
247
- if (!worldsPath) {
248
- process.stderr.write(
249
- `${RED}Error:${RESET} --worlds <dir> or RADIANT_WORLDS required.
250
284
  `
251
285
  );
252
286
  process.exit(1);
@@ -268,7 +302,11 @@ ${DIM}Set it to a GitHub PAT with repo read access.${RESET}
268
302
  );
269
303
  process.exit(1);
270
304
  }
271
- const worldmodelContent = loadWorldmodelContent(worldsPath);
305
+ const explicitWorldsPath = args.worlds ?? process.env.RADIANT_WORLDS;
306
+ const worldmodelContent = resolveWorldmodelContent(
307
+ explicitWorldsPath,
308
+ scope.owner
309
+ );
272
310
  const model = args.model ?? process.env.RADIANT_MODEL;
273
311
  const ai = createAnthropicAI(anthropicKey, model || void 0);
274
312
  const view = args.view ?? process.env.RADIANT_VIEW ?? "community";
@@ -351,7 +389,7 @@ async function cmdLenses(args) {
351
389
  return;
352
390
  }
353
391
  if (subSub === "describe") {
354
- const { getLens } = await import("../lenses-K5FVSALR.js");
392
+ const { getLens } = await import("../lenses-XDWK6ZKI.js");
355
393
  const id = args.rest[1];
356
394
  if (!id) {
357
395
  process.stderr.write(`${RED}Error:${RESET} Lens id required.
@@ -419,7 +457,7 @@ async function main(argv) {
419
457
  case "emergent":
420
458
  return cmdEmergent(args);
421
459
  case "mcp": {
422
- const { startRadiantMcp } = await import("../server-DFNY5N5A.js");
460
+ const { startRadiantMcp } = await import("../server-JKUBUK5H.js");
423
461
  return startRadiantMcp(argv);
424
462
  }
425
463
  case "decision":