fix: restore current channel and host admission organs
This commit is contained in:
parent
88ffb1c97a
commit
f46eb1b7c1
54 changed files with 4499 additions and 8 deletions
21
server-tools/persona-host-alignment/channel-cli.mjs
Normal file
21
server-tools/persona-host-alignment/channel-cli.mjs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env node
|
||||
// Private on-demand channel catalogue. No semantic guessing or execution authority.
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');
|
||||
const read = p => JSON.parse(fs.readFileSync(path.join(root, p), 'utf8'));
|
||||
const context = read('routing/persona-channel-context-map.json');
|
||||
const registrations = read('routing/fifth-domain-number-registry.json').registrations;
|
||||
const channels = context.channels.map(c => {
|
||||
const profile = read(c.profile), registered = registrations.find(r => r.id === c.id);
|
||||
if (!registered || profile.channel_id !== c.id || profile.world_path !== registered.world_path) throw Error('CHANNEL_REGISTRATION_MISMATCH');
|
||||
return { ...c, world_path: registered.world_path };
|
||||
});
|
||||
const [action = 'list', id] = process.argv.slice(2);
|
||||
if (!['list', 'show'].includes(action)) throw Error('USAGE: list | show <channel-id>');
|
||||
const selected = action === 'show' ? channels.find(c => c.id === id) : null;
|
||||
if (action === 'show' && !selected) throw Error('UNKNOWN_CHANNEL');
|
||||
console.log(JSON.stringify({ schema: context.schema, map_id: context.map_id,
|
||||
interpretation_owner: context.interpretation_owner, authority_granted: false,
|
||||
channels: selected ? [selected] : channels }, null, 2));
|
||||
Loading…
Reference in a new issue