feat(collab): launch JZAO-only HoloLake stage one
This commit is contained in:
parent
01e8c2ec5c
commit
1dd4a6a39e
17 changed files with 492 additions and 21 deletions
|
|
@ -4,6 +4,15 @@ from pathlib import Path
|
|||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
def normalize_channel_id(channel, rows):
|
||||
if channel is None:
|
||||
return None, 'NO_CHANNEL_PROVIDED'
|
||||
requested = str(channel).strip()
|
||||
matches = [item['id'] for item in rows if requested == item['id'] or requested in item.get('machine_aliases', [])]
|
||||
if len(matches) != 1:
|
||||
raise ValueError('UNKNOWN_OR_AMBIGUOUS_PRIVATE_CHANNEL')
|
||||
return matches[0], 'EXACT' if requested == matches[0] else 'MACHINE_ALIAS_NORMALIZED'
|
||||
|
||||
def load_channels(channel=None, root=ROOT):
|
||||
data = json.loads((root / 'routing/persona-channel-context-map.json').read_text())
|
||||
if data['map_id'] != 'ZY-PERSONA-CHANNEL-CONTEXT-001':
|
||||
|
|
@ -21,8 +30,8 @@ def load_channels(channel=None, root=ROOT):
|
|||
if profile['world_path'] != registered['world_path']:
|
||||
raise ValueError('CHANNEL_PATH_MISMATCH')
|
||||
item['world_path'] = profile['world_path']
|
||||
if channel is not None and channel not in {c['id'] for c in rows}:
|
||||
raise ValueError('UNKNOWN_PRIVATE_CHANNEL')
|
||||
return {**data, 'selected_channel': next((c for c in rows if c['id'] == channel), None),
|
||||
'selection_state': 'PERSONA_SELECTED' if channel else 'PERSONA_INTERPRETATION_REQUIRED',
|
||||
normalized, normalization_state = normalize_channel_id(channel, rows)
|
||||
return {**data, 'requested_channel': channel, 'normalized_channel': normalized, 'channel_normalization_state': normalization_state,
|
||||
'selected_channel': next((c for c in rows if c['id'] == normalized), None),
|
||||
'selection_state': 'PERSONA_SELECTED' if normalized else 'PERSONA_INTERPRETATION_REQUIRED',
|
||||
'authority_granted': False}
|
||||
|
|
|
|||
Loading…
Reference in a new issue