feat: 建立 HoloLake 编号通信根与人格第零层合同
This commit is contained in:
parent
7a14c06e41
commit
64abf969bf
37 changed files with 3455 additions and 161 deletions
|
|
@ -0,0 +1,562 @@
|
|||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
const ROUTES = {
|
||||
"get_hololake_home_status": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0001",
|
||||
"operationNumber": "HLP-NIPC-OP-0001",
|
||||
"targetNumber": "HLP-NIPC-TGT-0001"
|
||||
},
|
||||
"check_hololake_update": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0002",
|
||||
"operationNumber": "HLP-NIPC-OP-0002",
|
||||
"targetNumber": "HLP-NIPC-TGT-0002"
|
||||
},
|
||||
"confirm_hololake_update_install": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0002",
|
||||
"operationNumber": "HLP-NIPC-OP-0003",
|
||||
"targetNumber": "HLP-NIPC-TGT-0002"
|
||||
},
|
||||
"get_hololake_release_recovery_status": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0002",
|
||||
"operationNumber": "HLP-NIPC-OP-0004",
|
||||
"targetNumber": "HLP-NIPC-TGT-0002"
|
||||
},
|
||||
"confirm_hololake_release_health": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0002",
|
||||
"operationNumber": "HLP-NIPC-OP-0005",
|
||||
"targetNumber": "HLP-NIPC-TGT-0002"
|
||||
},
|
||||
"rollback_hololake_update": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0002",
|
||||
"operationNumber": "HLP-NIPC-OP-0006",
|
||||
"targetNumber": "HLP-NIPC-TGT-0002"
|
||||
},
|
||||
"issue_direct_local_discovery_ticket": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0003",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0003",
|
||||
"operationNumber": "HLP-NIPC-OP-0007",
|
||||
"targetNumber": "HLP-NIPC-TGT-0003"
|
||||
},
|
||||
"open_direct_local_session": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0003",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0003",
|
||||
"operationNumber": "HLP-NIPC-OP-0008",
|
||||
"targetNumber": "HLP-NIPC-TGT-0003"
|
||||
},
|
||||
"resume_direct_local_session": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0003",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0003",
|
||||
"operationNumber": "HLP-NIPC-OP-0009",
|
||||
"targetNumber": "HLP-NIPC-TGT-0003"
|
||||
},
|
||||
"append_direct_local_session_event": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0003",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0003",
|
||||
"operationNumber": "HLP-NIPC-OP-0010",
|
||||
"targetNumber": "HLP-NIPC-TGT-0003"
|
||||
},
|
||||
"heartbeat_direct_local_session": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0003",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0003",
|
||||
"operationNumber": "HLP-NIPC-OP-0011",
|
||||
"targetNumber": "HLP-NIPC-TGT-0003"
|
||||
},
|
||||
"get_nearby_ai_discovery": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0003",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0004",
|
||||
"operationNumber": "HLP-NIPC-OP-0012",
|
||||
"targetNumber": "HLP-NIPC-TGT-0004"
|
||||
},
|
||||
"get_gls_protocol_runtime": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0005",
|
||||
"operationNumber": "HLP-NIPC-OP-0013",
|
||||
"targetNumber": "HLP-NIPC-TGT-0005"
|
||||
},
|
||||
"get_gls_protocol_kernel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0006",
|
||||
"operationNumber": "HLP-NIPC-OP-0014",
|
||||
"targetNumber": "HLP-NIPC-TGT-0006"
|
||||
},
|
||||
"decide_gls_protocol": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0006",
|
||||
"operationNumber": "HLP-NIPC-OP-0015",
|
||||
"targetNumber": "HLP-NIPC-TGT-0006"
|
||||
},
|
||||
"compile_gls_hldp_program": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0006",
|
||||
"operationNumber": "HLP-NIPC-OP-0016",
|
||||
"targetNumber": "HLP-NIPC-TGT-0006"
|
||||
},
|
||||
"acquire_development_write_lane": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0004",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0007",
|
||||
"operationNumber": "HLP-NIPC-OP-0017",
|
||||
"targetNumber": "HLP-NIPC-TGT-0007"
|
||||
},
|
||||
"inspect_development_write_lane": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0004",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0007",
|
||||
"operationNumber": "HLP-NIPC-OP-0018",
|
||||
"targetNumber": "HLP-NIPC-TGT-0007"
|
||||
},
|
||||
"release_development_write_lane": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0004",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0007",
|
||||
"operationNumber": "HLP-NIPC-OP-0019",
|
||||
"targetNumber": "HLP-NIPC-TGT-0007"
|
||||
},
|
||||
"get_personal_channel_snapshot": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0008",
|
||||
"operationNumber": "HLP-NIPC-OP-0020",
|
||||
"targetNumber": "HLP-NIPC-TGT-0008"
|
||||
},
|
||||
"initialize_personal_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0008",
|
||||
"operationNumber": "HLP-NIPC-OP-0021",
|
||||
"targetNumber": "HLP-NIPC-TGT-0008"
|
||||
},
|
||||
"create_personal_channel_task": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0008",
|
||||
"operationNumber": "HLP-NIPC-OP-0022",
|
||||
"targetNumber": "HLP-NIPC-TGT-0008"
|
||||
},
|
||||
"transition_personal_channel_task": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0008",
|
||||
"operationNumber": "HLP-NIPC-OP-0023",
|
||||
"targetNumber": "HLP-NIPC-TGT-0008"
|
||||
},
|
||||
"issue_persona_time_ticket": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0009",
|
||||
"operationNumber": "HLP-NIPC-OP-0024",
|
||||
"targetNumber": "HLP-NIPC-TGT-0009"
|
||||
},
|
||||
"start_persona_time_authority": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0009",
|
||||
"operationNumber": "HLP-NIPC-OP-0025",
|
||||
"targetNumber": "HLP-NIPC-TGT-0009"
|
||||
},
|
||||
"get_beijing_time_coordinate": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0009",
|
||||
"operationNumber": "HLP-NIPC-OP-0026",
|
||||
"targetNumber": "HLP-NIPC-TGT-0009"
|
||||
},
|
||||
"get_guanghu_era_timeline": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0009",
|
||||
"operationNumber": "HLP-NIPC-OP-0027",
|
||||
"targetNumber": "HLP-NIPC-TGT-0009"
|
||||
},
|
||||
"get_knowledge_snapshot": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0028",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"read_knowledge_document": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0029",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"search_knowledge": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0030",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"save_knowledge_document": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0031",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"select_and_import_knowledge_folder": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0032",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"export_knowledge_document": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0033",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"create_knowledge_document": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0034",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"delete_knowledge_document": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0035",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"delete_knowledge_folder": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0036",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"print_knowledge_document": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0010",
|
||||
"operationNumber": "HLP-NIPC-OP-0037",
|
||||
"targetNumber": "HLP-NIPC-TGT-0010"
|
||||
},
|
||||
"get_code_channel_snapshot": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0011",
|
||||
"operationNumber": "HLP-NIPC-OP-0038",
|
||||
"targetNumber": "HLP-NIPC-TGT-0011"
|
||||
},
|
||||
"clone_code_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0011",
|
||||
"operationNumber": "HLP-NIPC-OP-0039",
|
||||
"targetNumber": "HLP-NIPC-TGT-0011"
|
||||
},
|
||||
"select_local_code_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0011",
|
||||
"operationNumber": "HLP-NIPC-OP-0040",
|
||||
"targetNumber": "HLP-NIPC-TGT-0011"
|
||||
},
|
||||
"browse_code_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0011",
|
||||
"operationNumber": "HLP-NIPC-OP-0041",
|
||||
"targetNumber": "HLP-NIPC-TGT-0011"
|
||||
},
|
||||
"read_code_channel_file": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0002",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0011",
|
||||
"operationNumber": "HLP-NIPC-OP-0042",
|
||||
"targetNumber": "HLP-NIPC-TGT-0011"
|
||||
},
|
||||
"inspect_mounted_pncc_repository": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0012",
|
||||
"operationNumber": "HLP-NIPC-OP-0043",
|
||||
"targetNumber": "HLP-NIPC-TGT-0012"
|
||||
},
|
||||
"select_pncc_repository_candidate": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0012",
|
||||
"operationNumber": "HLP-NIPC-OP-0044",
|
||||
"targetNumber": "HLP-NIPC-TGT-0012"
|
||||
},
|
||||
"confirm_pncc_repository_mount": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0012",
|
||||
"operationNumber": "HLP-NIPC-OP-0045",
|
||||
"targetNumber": "HLP-NIPC-TGT-0012"
|
||||
},
|
||||
"query_pncc_receipt_projection": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0013",
|
||||
"operationNumber": "HLP-NIPC-OP-0046",
|
||||
"targetNumber": "HLP-NIPC-TGT-0013"
|
||||
},
|
||||
"query_jd_pncc_server_projection": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0014",
|
||||
"operationNumber": "HLP-NIPC-OP-0047",
|
||||
"targetNumber": "HLP-NIPC-TGT-0014"
|
||||
},
|
||||
"check_code_repo_login": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0048",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"perform_code_repo_login": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0049",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"change_first_login_password": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0050",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"get_enterprise_entry": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0051",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"confirm_enterprise_persona_relationship": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0052",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"submit_enterprise_responsibility_receipt": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0053",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"ensure_enterprise_work_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0007",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0016",
|
||||
"operationNumber": "HLP-NIPC-OP-0054",
|
||||
"targetNumber": "HLP-NIPC-TGT-0016"
|
||||
},
|
||||
"sign_out_code_repo_login": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0015",
|
||||
"operationNumber": "HLP-NIPC-OP-0055",
|
||||
"targetNumber": "HLP-NIPC-TGT-0015"
|
||||
},
|
||||
"get_user_pncc_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0017",
|
||||
"operationNumber": "HLP-NIPC-OP-0056",
|
||||
"targetNumber": "HLP-NIPC-TGT-0017"
|
||||
},
|
||||
"ensure_user_pncc_channel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0005",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0017",
|
||||
"operationNumber": "HLP-NIPC-OP-0057",
|
||||
"targetNumber": "HLP-NIPC-TGT-0017"
|
||||
},
|
||||
"get_zero_core_numbering_kernel": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0001",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0018",
|
||||
"operationNumber": "HLP-NIPC-OP-0058",
|
||||
"targetNumber": "HLP-NIPC-TGT-0018"
|
||||
},
|
||||
"zero_point_bind": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0019",
|
||||
"operationNumber": "HLP-NIPC-OP-0059",
|
||||
"targetNumber": "HLP-NIPC-TGT-0019"
|
||||
},
|
||||
"zero_point_verify": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0019",
|
||||
"operationNumber": "HLP-NIPC-OP-0060",
|
||||
"targetNumber": "HLP-NIPC-TGT-0019"
|
||||
},
|
||||
"zero_point_sync": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0019",
|
||||
"operationNumber": "HLP-NIPC-OP-0061",
|
||||
"targetNumber": "HLP-NIPC-TGT-0019"
|
||||
},
|
||||
"zero_point_status": {
|
||||
"protocolVersion": "HLP-NIPC-v1",
|
||||
"callerNumber": "HLP-NIPC-CALLER-MAIN-WEBVIEW-0001",
|
||||
"channelNumber": "HLP-NIPC-CH-0006",
|
||||
"moduleNumber": "HLP-NIPC-MOD-0019",
|
||||
"operationNumber": "HLP-NIPC-OP-0062",
|
||||
"targetNumber": "HLP-NIPC-TGT-0019"
|
||||
}
|
||||
} as const
|
||||
|
||||
export type NumberedOperation = keyof typeof ROUTES
|
||||
|
||||
interface NumberedGrant {
|
||||
grantId: string
|
||||
expiresAtUnixMs: number
|
||||
payloadSha256: string
|
||||
authorityBindingSha256: string
|
||||
signature: string
|
||||
}
|
||||
|
||||
interface NumberedIpcResponse<T> {
|
||||
schema: 'hololake.numbered-ipc-response/v1'
|
||||
decision: 'ALLOW' | 'DENY'
|
||||
grant?: NumberedGrant | null
|
||||
result?: T | null
|
||||
error?: string | null
|
||||
receipt: {
|
||||
receiptId: string
|
||||
state: string
|
||||
decision: 'ALLOW' | 'DENY'
|
||||
operationNumber: string
|
||||
payloadSha256: string
|
||||
authorityBindingSha256: string
|
||||
observedAtUnixMs: number
|
||||
previousReceiptHash: string
|
||||
receiptHash: string
|
||||
error?: string | null
|
||||
}
|
||||
}
|
||||
|
||||
function requestNonce(): string {
|
||||
return 'HLP-NIPC-REQ-' + crypto.randomUUID().replaceAll('-', '')
|
||||
}
|
||||
|
||||
function denied(response: NumberedIpcResponse<unknown>): Error {
|
||||
return new Error((response.error || 'HOLOLAKE_NUMBERED_IPC_DENIED') + ' [' + response.receipt.receiptId + ']')
|
||||
}
|
||||
|
||||
/**
|
||||
* The only webview-to-native route. Aliases are compile-time ergonomics only; the
|
||||
* native side receives and validates the complete numbered coordinate.
|
||||
*/
|
||||
export async function numberedInvoke<T>(operation: NumberedOperation, payload: Record<string, unknown> = {}): Promise<T> {
|
||||
const route = ROUTES[operation]
|
||||
const envelope = {
|
||||
...route,
|
||||
requestNonce: requestNonce(),
|
||||
requestedTtlMs: 10_000,
|
||||
payload,
|
||||
}
|
||||
const issued = await invoke<NumberedIpcResponse<never>>('numbered_ipc', {
|
||||
input: { action: 'ISSUE_GRANT', envelope },
|
||||
})
|
||||
if (issued.decision !== 'ALLOW' || !issued.grant) throw denied(issued)
|
||||
|
||||
const executed = await invoke<NumberedIpcResponse<T>>('numbered_ipc', {
|
||||
input: { action: 'EXECUTE', envelope, grant: issued.grant },
|
||||
})
|
||||
if (executed.decision !== 'ALLOW') throw denied(executed)
|
||||
return executed.result as T
|
||||
}
|
||||
Loading…
Reference in a new issue