@awiki/dsh-plugin 0.3.11 → 0.3.16

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.
Files changed (97) hide show
  1. package/README.md +24 -2
  2. package/README.zh.md +12 -2
  3. package/cordis.patch.yml +1 -0
  4. package/lib/client.js +1119 -176
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +362 -79
  7. package/lib/provider.js +3 -2
  8. package/lib/{sdk-adapter-DpqT2en9.mjs → sdk-adapter-DGcTiEZz.mjs} +110 -9
  9. package/lib/typert.host.js +359 -68
  10. package/lib/typert.remote-client.d.ts +9 -1
  11. package/lib/typert.remote-client.d.ts.map +1 -1
  12. package/lib/typert.remote-client.js +359 -68
  13. package/lib/types/client/AwikiDeviceJoinReminder.d.ts.map +1 -1
  14. package/lib/types/client/AwikiDeviceJoinReminder.js +1 -1
  15. package/lib/types/client/AwikiDeviceJoinReminder.js.map +1 -1
  16. package/lib/types/client/AwikiDevices.d.ts +5 -1
  17. package/lib/types/client/AwikiDevices.d.ts.map +1 -1
  18. package/lib/types/client/AwikiDevices.js +2 -1
  19. package/lib/types/client/AwikiDevices.js.map +1 -1
  20. package/lib/types/client/AwikiIdentityAccess.d.ts.map +1 -1
  21. package/lib/types/client/AwikiIdentityAccess.js +72 -24
  22. package/lib/types/client/AwikiIdentityAccess.js.map +1 -1
  23. package/lib/types/client/AwikiIdentityServices.d.ts +9 -0
  24. package/lib/types/client/AwikiIdentityServices.d.ts.map +1 -0
  25. package/lib/types/client/AwikiIdentityServices.js +66 -0
  26. package/lib/types/client/AwikiIdentityServices.js.map +1 -0
  27. package/lib/types/client/AwikiOverlay.js +1 -1
  28. package/lib/types/client/AwikiOverlay.js.map +1 -1
  29. package/lib/types/client/AwikiSettingsSection.js +1 -1
  30. package/lib/types/client/AwikiSettingsSection.js.map +1 -1
  31. package/lib/types/client/AwikiUpdates.d.ts.map +1 -1
  32. package/lib/types/client/AwikiUpdates.js +21 -10
  33. package/lib/types/client/AwikiUpdates.js.map +1 -1
  34. package/lib/types/client/controller.d.ts +8 -0
  35. package/lib/types/client/controller.d.ts.map +1 -1
  36. package/lib/types/client/controller.js +21 -3
  37. package/lib/types/client/controller.js.map +1 -1
  38. package/lib/types/client/index.d.ts.map +1 -1
  39. package/lib/types/client/index.js +8 -0
  40. package/lib/types/client/index.js.map +1 -1
  41. package/lib/types/client/settings-controller.d.ts +1 -0
  42. package/lib/types/client/settings-controller.d.ts.map +1 -1
  43. package/lib/types/client/settings-controller.js +24 -10
  44. package/lib/types/client/settings-controller.js.map +1 -1
  45. package/lib/types/client/settings-locales.d.ts +1 -1
  46. package/lib/types/client/settings-locales.d.ts.map +1 -1
  47. package/lib/types/client/settings-locales.js +10 -4
  48. package/lib/types/client/settings-locales.js.map +1 -1
  49. package/lib/types/client/slots.d.ts +3 -1
  50. package/lib/types/client/slots.d.ts.map +1 -1
  51. package/lib/types/desktop-distribution.d.ts +7 -3
  52. package/lib/types/desktop-distribution.d.ts.map +1 -1
  53. package/lib/types/desktop-distribution.js +27 -8
  54. package/lib/types/desktop-distribution.js.map +1 -1
  55. package/lib/types/index.d.ts +8 -2
  56. package/lib/types/index.d.ts.map +1 -1
  57. package/lib/types/index.js +154 -47
  58. package/lib/types/index.js.map +1 -1
  59. package/lib/types/listener.js +1 -1
  60. package/lib/types/listener.js.map +1 -1
  61. package/lib/types/message-target.d.ts +4 -0
  62. package/lib/types/message-target.d.ts.map +1 -0
  63. package/lib/types/message-target.js +14 -0
  64. package/lib/types/message-target.js.map +1 -0
  65. package/lib/types/package-version.generated.d.ts +2 -2
  66. package/lib/types/package-version.generated.d.ts.map +1 -1
  67. package/lib/types/package-version.generated.js +2 -2
  68. package/lib/types/package-version.generated.js.map +1 -1
  69. package/lib/types/provider-api.d.ts +17 -1
  70. package/lib/types/provider-api.d.ts.map +1 -1
  71. package/lib/types/provider.d.ts.map +1 -1
  72. package/lib/types/provider.js +2 -1
  73. package/lib/types/provider.js.map +1 -1
  74. package/lib/types/registration-policy.d.ts +1 -1
  75. package/lib/types/registration-policy.d.ts.map +1 -1
  76. package/lib/types/registration-policy.js +1 -1
  77. package/lib/types/registration-policy.js.map +1 -1
  78. package/lib/types/sdk-adapter.d.ts +17 -1
  79. package/lib/types/sdk-adapter.d.ts.map +1 -1
  80. package/lib/types/sdk-adapter.js +90 -5
  81. package/lib/types/sdk-adapter.js.map +1 -1
  82. package/lib/types/settings-rpc-contract.d.ts +1 -0
  83. package/lib/types/settings-rpc-contract.d.ts.map +1 -1
  84. package/lib/types/settings-rpc-contract.js +2 -0
  85. package/lib/types/settings-rpc-contract.js.map +1 -1
  86. package/lib/types/types.d.ts +68 -2
  87. package/lib/types/types.d.ts.map +1 -1
  88. package/lib/types/types.js.map +1 -1
  89. package/lib/types/update-installation.d.ts +18 -0
  90. package/lib/types/update-installation.d.ts.map +1 -0
  91. package/lib/types/update-installation.js +101 -0
  92. package/lib/types/update-installation.js.map +1 -0
  93. package/lib/types/update-policy.d.ts +5 -2
  94. package/lib/types/update-policy.d.ts.map +1 -1
  95. package/lib/types/update-policy.js +14 -8
  96. package/lib/types/update-policy.js.map +1 -1
  97. package/package.json +7 -6
package/lib/client.js CHANGED
@@ -4165,10 +4165,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4165
4165
  "previousDid": intersection(string(), unknown()).readonly().optional(),
4166
4166
  "currentDid": intersection(string(), unknown()).readonly(),
4167
4167
  "phase": union([
4168
+ literal("remote_committed"),
4168
4169
  literal("awaiting_factor"),
4169
4170
  literal("ready_to_commit"),
4170
4171
  literal("remote_outcome_unknown"),
4171
- literal("remote_committed"),
4172
4172
  literal("identity_transition_pending"),
4173
4173
  literal("applied"),
4174
4174
  literal("quarantined_key_unavailable")
@@ -5213,10 +5213,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5213
5213
  "previousDid": intersection(string(), unknown()).readonly().optional(),
5214
5214
  "currentDid": intersection(string(), unknown()).readonly(),
5215
5215
  "phase": union([
5216
+ literal("remote_committed"),
5216
5217
  literal("awaiting_factor"),
5217
5218
  literal("ready_to_commit"),
5218
5219
  literal("remote_outcome_unknown"),
5219
- literal("remote_committed"),
5220
5220
  literal("identity_transition_pending"),
5221
5221
  literal("applied"),
5222
5222
  literal("quarantined_key_unavailable")
@@ -5892,11 +5892,38 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5892
5892
  }), object({
5893
5893
  "ok": literal(true).readonly(),
5894
5894
  "value": object({
5895
+ "creationMethods": array(union([literal("wba"), literal("web")])).readonly().optional(),
5896
+ "pendingRegistrations": array(object({
5897
+ "did": string().readonly(),
5898
+ "fullHandle": string().readonly(),
5899
+ "method": union([literal("wba"), literal("web")]).readonly(),
5900
+ "displayName": string().readonly(),
5901
+ "verificationKind": string().readonly(),
5902
+ "phase": union([
5903
+ literal("prepared"),
5904
+ literal("remote_committed"),
5905
+ literal("local_committed")
5906
+ ]).readonly()
5907
+ })).readonly().optional(),
5908
+ "methodCapabilities": object({
5909
+ "method": union([literal("wba"), literal("web")]).readonly(),
5910
+ "handleRecovery": boolean().readonly(),
5911
+ "rootImport": boolean().readonly(),
5912
+ "rootTransfer": boolean().readonly(),
5913
+ "servicesUpdate": boolean().readonly()
5914
+ }).readonly().optional(),
5895
5915
  "choice": union([literal(null), object({
5896
5916
  "status": literal("join-required").readonly(),
5897
5917
  "fullHandle": intersection(string(), unknown()).readonly(),
5898
5918
  "mode": union([literal("ordinary"), literal("handle-recovery-rebind")]).readonly(),
5899
- "requiresUserPresence": boolean().readonly()
5919
+ "requiresUserPresence": boolean().readonly(),
5920
+ "methodCapabilities": object({
5921
+ "method": union([literal("wba"), literal("web")]).readonly(),
5922
+ "handleRecovery": boolean().readonly(),
5923
+ "rootImport": boolean().readonly(),
5924
+ "rootTransfer": boolean().readonly(),
5925
+ "servicesUpdate": boolean().readonly()
5926
+ }).readonly().optional()
5900
5927
  })]).readonly(),
5901
5928
  "joining": boolean().readonly(),
5902
5929
  "recoveries": array(object({
@@ -5905,6 +5932,83 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5905
5932
  })).readonly()
5906
5933
  }).readonly()
5907
5934
  })]);
5935
+ const _awiki_dsh_plugin_awiki_getIdentityServices_result$schema = union([object({
5936
+ "ok": literal(false).readonly(),
5937
+ "error": object({
5938
+ "code": union([
5939
+ literal("client-version-unsupported"),
5940
+ literal("not-registered"),
5941
+ literal("signed-out"),
5942
+ literal("already-registered"),
5943
+ literal("invalid-request"),
5944
+ literal("invalid-otp"),
5945
+ literal("challenge-expired"),
5946
+ literal("handle-unavailable"),
5947
+ literal("short-handle-invite-required"),
5948
+ literal("not-found"),
5949
+ literal("forbidden"),
5950
+ literal("device-rejoin-required"),
5951
+ literal("identity-recovery-required"),
5952
+ literal("conflict"),
5953
+ literal("state-in-use"),
5954
+ literal("rate-limited"),
5955
+ literal("group-membership-required"),
5956
+ literal("group-identity-stale"),
5957
+ literal("attachment-too-large"),
5958
+ literal("summary-unavailable"),
5959
+ literal("summary-timeout"),
5960
+ literal("summary-cancelled"),
5961
+ literal("summary-invalid-output"),
5962
+ literal("summary-failed"),
5963
+ literal("delivery-unknown"),
5964
+ literal("network"),
5965
+ literal("remote")
5966
+ ]).readonly(),
5967
+ "message": string().readonly(),
5968
+ "mailRecoveryObservability": object({
5969
+ "current_principal_matches_recovery": boolean().readonly(),
5970
+ "request_generation_classification": union([literal("current"), literal("replaced")]).readonly(),
5971
+ "mail_ingress_classification": union([
5972
+ literal("reached"),
5973
+ literal("not_reached"),
5974
+ literal("unknown")
5975
+ ]).readonly(),
5976
+ "auth_status_class": union([
5977
+ literal("unknown"),
5978
+ literal("accepted"),
5979
+ literal("rejected"),
5980
+ literal("dependency_unavailable")
5981
+ ]).readonly(),
5982
+ "auth_stable_machine_code": string().readonly().optional(),
5983
+ "retryable": boolean().readonly(),
5984
+ "mail_closed_classification": union([
5985
+ literal("unknown"),
5986
+ literal("dependency_unavailable"),
5987
+ literal("success"),
5988
+ literal("authentication_rejected"),
5989
+ literal("no_active_handle"),
5990
+ literal("multiple_active_handles"),
5991
+ literal("no_mailbox"),
5992
+ literal("owner_conflict")
5993
+ ]).readonly()
5994
+ }).readonly().optional()
5995
+ }).readonly()
5996
+ }), object({
5997
+ "ok": literal(true).readonly(),
5998
+ "value": object({
5999
+ "did": string().readonly(),
6000
+ "canManage": boolean().readonly(),
6001
+ "pending": boolean().readonly(),
6002
+ "services": array(object({
6003
+ "id": string().readonly(),
6004
+ "type": string().readonly(),
6005
+ "serviceEndpoint": string().readonly(),
6006
+ "serviceDid": string().readonly().optional(),
6007
+ "profiles": array(string()).readonly().optional(),
6008
+ "securityProfiles": array(string()).readonly().optional()
6009
+ })).readonly()
6010
+ }).readonly()
6011
+ })]);
5908
6012
  const _awiki_dsh_plugin_awiki_getIntegration_result$schema = union([object({
5909
6013
  "ok": literal(false).readonly(),
5910
6014
  "error": object({
@@ -6275,10 +6379,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6275
6379
  "previousDid": intersection(string(), unknown()).readonly().optional(),
6276
6380
  "currentDid": intersection(string(), unknown()).readonly(),
6277
6381
  "phase": union([
6382
+ literal("remote_committed"),
6278
6383
  literal("awaiting_factor"),
6279
6384
  literal("ready_to_commit"),
6280
6385
  literal("remote_outcome_unknown"),
6281
- literal("remote_committed"),
6282
6386
  literal("identity_transition_pending"),
6283
6387
  literal("applied"),
6284
6388
  literal("quarantined_key_unavailable")
@@ -6403,7 +6507,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6403
6507
  })
6404
6508
  ]).readonly()
6405
6509
  })]);
6406
- const _awiki_dsh_plugin_awiki_inspectIdentityAccess_parameter_0$schema = object({ "handle": string().readonly() });
6510
+ const _awiki_dsh_plugin_awiki_inspectIdentityAccess_parameter_0$schema = object({
6511
+ "inviteCode": string().readonly().optional(),
6512
+ "phone": string().readonly().optional(),
6513
+ "handle": string().readonly()
6514
+ });
6407
6515
  const _awiki_dsh_plugin_awiki_inspectIdentityAccess_result$schema = union([object({
6408
6516
  "ok": literal(false).readonly(),
6409
6517
  "error": object({
@@ -6468,7 +6576,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6468
6576
  }), object({
6469
6577
  "ok": literal(true).readonly(),
6470
6578
  "value": object({
6471
- "status": union([literal("available"), literal("existing")]).readonly(),
6579
+ "status": union([
6580
+ literal("unavailable"),
6581
+ literal("available"),
6582
+ literal("existing")
6583
+ ]).readonly(),
6584
+ "inviteRequired": boolean().readonly().optional(),
6585
+ "inviteStatus": union([
6586
+ literal("not_required"),
6587
+ literal("required"),
6588
+ literal("valid"),
6589
+ literal("invalid")
6590
+ ]).readonly().optional(),
6472
6591
  "fullHandle": string().readonly()
6473
6592
  }).readonly()
6474
6593
  })]);
@@ -7243,10 +7362,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7243
7362
  "previousDid": intersection(string(), unknown()).readonly().optional(),
7244
7363
  "currentDid": intersection(string(), unknown()).readonly(),
7245
7364
  "phase": union([
7365
+ literal("remote_committed"),
7246
7366
  literal("awaiting_factor"),
7247
7367
  literal("ready_to_commit"),
7248
7368
  literal("remote_outcome_unknown"),
7249
- literal("remote_committed"),
7250
7369
  literal("identity_transition_pending"),
7251
7370
  literal("applied"),
7252
7371
  literal("quarantined_key_unavailable")
@@ -7520,6 +7639,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7520
7639
  }), object({
7521
7640
  "ok": literal(true).readonly(),
7522
7641
  "value": object({
7642
+ "methodCapabilities": object({
7643
+ "method": union([literal("wba"), literal("web")]).readonly(),
7644
+ "handleRecovery": boolean().readonly(),
7645
+ "rootImport": boolean().readonly(),
7646
+ "rootTransfer": boolean().readonly(),
7647
+ "servicesUpdate": boolean().readonly()
7648
+ }).readonly().optional(),
7523
7649
  "canManage": boolean().readonly(),
7524
7650
  "rootTransferSupported": boolean().readonly(),
7525
7651
  "role": union([literal("member"), literal("admin")]).readonly().optional(),
@@ -7537,6 +7663,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7537
7663
  "status": union([literal("active"), literal("revoked")]).readonly(),
7538
7664
  "role": union([literal("member"), literal("admin")]).readonly(),
7539
7665
  "managementReady": boolean().readonly(),
7666
+ "provisioning": object({
7667
+ "phase": union([
7668
+ literal("pending"),
7669
+ literal("waiting"),
7670
+ literal("failed"),
7671
+ literal("complete")
7672
+ ]).readonly(),
7673
+ "attempts": number().readonly(),
7674
+ "requiresRejoin": boolean().readonly().optional()
7675
+ }).readonly().optional(),
7540
7676
  "isCurrent": boolean().readonly()
7541
7677
  })).readonly(),
7542
7678
  "requests": array(object({
@@ -7559,6 +7695,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7559
7695
  }).readonly()
7560
7696
  })]);
7561
7697
  const _awiki_dsh_plugin_awiki_registerIdentity_parameter_0$schema = object({
7698
+ "inviteCode": string().readonly().optional(),
7699
+ "didMethod": union([literal("wba"), literal("web")]).readonly().optional(),
7562
7700
  "handle": string().readonly(),
7563
7701
  "phone": string().readonly(),
7564
7702
  "otp": string().readonly()
@@ -7638,7 +7776,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7638
7776
  "status": literal("join-required").readonly(),
7639
7777
  "fullHandle": intersection(string(), unknown()).readonly(),
7640
7778
  "mode": union([literal("ordinary"), literal("handle-recovery-rebind")]).readonly(),
7641
- "requiresUserPresence": boolean().readonly()
7779
+ "requiresUserPresence": boolean().readonly(),
7780
+ "methodCapabilities": object({
7781
+ "method": union([literal("wba"), literal("web")]).readonly(),
7782
+ "handleRecovery": boolean().readonly(),
7783
+ "rootImport": boolean().readonly(),
7784
+ "rootTransfer": boolean().readonly(),
7785
+ "servicesUpdate": boolean().readonly()
7786
+ }).readonly().optional()
7642
7787
  })]).readonly()
7643
7788
  })]);
7644
7789
  const _awiki_dsh_plugin_awiki_rejectDeviceJoin_parameter_0$schema = object({
@@ -7934,6 +8079,84 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7934
8079
  "conversationId": intersection(string(), unknown()).readonly()
7935
8080
  }).readonly()
7936
8081
  })]);
8082
+ const _awiki_dsh_plugin_awiki_resumeIdentityServicesUpdate_parameter_0$schema = object({ "did": string().readonly() });
8083
+ const _awiki_dsh_plugin_awiki_resumeIdentityServicesUpdate_result$schema = union([object({
8084
+ "ok": literal(false).readonly(),
8085
+ "error": object({
8086
+ "code": union([
8087
+ literal("client-version-unsupported"),
8088
+ literal("not-registered"),
8089
+ literal("signed-out"),
8090
+ literal("already-registered"),
8091
+ literal("invalid-request"),
8092
+ literal("invalid-otp"),
8093
+ literal("challenge-expired"),
8094
+ literal("handle-unavailable"),
8095
+ literal("short-handle-invite-required"),
8096
+ literal("not-found"),
8097
+ literal("forbidden"),
8098
+ literal("device-rejoin-required"),
8099
+ literal("identity-recovery-required"),
8100
+ literal("conflict"),
8101
+ literal("state-in-use"),
8102
+ literal("rate-limited"),
8103
+ literal("group-membership-required"),
8104
+ literal("group-identity-stale"),
8105
+ literal("attachment-too-large"),
8106
+ literal("summary-unavailable"),
8107
+ literal("summary-timeout"),
8108
+ literal("summary-cancelled"),
8109
+ literal("summary-invalid-output"),
8110
+ literal("summary-failed"),
8111
+ literal("delivery-unknown"),
8112
+ literal("network"),
8113
+ literal("remote")
8114
+ ]).readonly(),
8115
+ "message": string().readonly(),
8116
+ "mailRecoveryObservability": object({
8117
+ "current_principal_matches_recovery": boolean().readonly(),
8118
+ "request_generation_classification": union([literal("current"), literal("replaced")]).readonly(),
8119
+ "mail_ingress_classification": union([
8120
+ literal("reached"),
8121
+ literal("not_reached"),
8122
+ literal("unknown")
8123
+ ]).readonly(),
8124
+ "auth_status_class": union([
8125
+ literal("unknown"),
8126
+ literal("accepted"),
8127
+ literal("rejected"),
8128
+ literal("dependency_unavailable")
8129
+ ]).readonly(),
8130
+ "auth_stable_machine_code": string().readonly().optional(),
8131
+ "retryable": boolean().readonly(),
8132
+ "mail_closed_classification": union([
8133
+ literal("unknown"),
8134
+ literal("dependency_unavailable"),
8135
+ literal("success"),
8136
+ literal("authentication_rejected"),
8137
+ literal("no_active_handle"),
8138
+ literal("multiple_active_handles"),
8139
+ literal("no_mailbox"),
8140
+ literal("owner_conflict")
8141
+ ]).readonly()
8142
+ }).readonly().optional()
8143
+ }).readonly()
8144
+ }), object({
8145
+ "ok": literal(true).readonly(),
8146
+ "value": object({
8147
+ "did": string().readonly(),
8148
+ "canManage": boolean().readonly(),
8149
+ "pending": boolean().readonly(),
8150
+ "services": array(object({
8151
+ "id": string().readonly(),
8152
+ "type": string().readonly(),
8153
+ "serviceEndpoint": string().readonly(),
8154
+ "serviceDid": string().readonly().optional(),
8155
+ "profiles": array(string()).readonly().optional(),
8156
+ "securityProfiles": array(string()).readonly().optional()
8157
+ })).readonly()
8158
+ }).readonly()
8159
+ })]);
7937
8160
  const _awiki_dsh_plugin_awiki_resumeRecovery_parameter_0$schema = object({ "operationId": string().readonly() });
7938
8161
  const _awiki_dsh_plugin_awiki_resumeRecovery_result$schema = union([object({
7939
8162
  "ok": literal(false).readonly(),
@@ -8004,10 +8227,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8004
8227
  "previousDid": intersection(string(), unknown()).readonly().optional(),
8005
8228
  "currentDid": intersection(string(), unknown()).readonly(),
8006
8229
  "phase": union([
8230
+ literal("remote_committed"),
8007
8231
  literal("awaiting_factor"),
8008
8232
  literal("ready_to_commit"),
8009
8233
  literal("remote_outcome_unknown"),
8010
- literal("remote_committed"),
8011
8234
  literal("identity_transition_pending"),
8012
8235
  literal("applied"),
8013
8236
  literal("quarantined_key_unavailable")
@@ -8120,6 +8343,72 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8120
8343
  "ok": literal(true).readonly(),
8121
8344
  "value": object({ "completed": literal(true).readonly() }).readonly()
8122
8345
  })]);
8346
+ const _awiki_dsh_plugin_awiki_retryDeviceManagement_parameter_0$schema = object({ "deviceRef": string().readonly() });
8347
+ const _awiki_dsh_plugin_awiki_retryDeviceManagement_result$schema = union([object({
8348
+ "ok": literal(false).readonly(),
8349
+ "error": object({
8350
+ "code": union([
8351
+ literal("client-version-unsupported"),
8352
+ literal("not-registered"),
8353
+ literal("signed-out"),
8354
+ literal("already-registered"),
8355
+ literal("invalid-request"),
8356
+ literal("invalid-otp"),
8357
+ literal("challenge-expired"),
8358
+ literal("handle-unavailable"),
8359
+ literal("short-handle-invite-required"),
8360
+ literal("not-found"),
8361
+ literal("forbidden"),
8362
+ literal("device-rejoin-required"),
8363
+ literal("identity-recovery-required"),
8364
+ literal("conflict"),
8365
+ literal("state-in-use"),
8366
+ literal("rate-limited"),
8367
+ literal("group-membership-required"),
8368
+ literal("group-identity-stale"),
8369
+ literal("attachment-too-large"),
8370
+ literal("summary-unavailable"),
8371
+ literal("summary-timeout"),
8372
+ literal("summary-cancelled"),
8373
+ literal("summary-invalid-output"),
8374
+ literal("summary-failed"),
8375
+ literal("delivery-unknown"),
8376
+ literal("network"),
8377
+ literal("remote")
8378
+ ]).readonly(),
8379
+ "message": string().readonly(),
8380
+ "mailRecoveryObservability": object({
8381
+ "current_principal_matches_recovery": boolean().readonly(),
8382
+ "request_generation_classification": union([literal("current"), literal("replaced")]).readonly(),
8383
+ "mail_ingress_classification": union([
8384
+ literal("reached"),
8385
+ literal("not_reached"),
8386
+ literal("unknown")
8387
+ ]).readonly(),
8388
+ "auth_status_class": union([
8389
+ literal("unknown"),
8390
+ literal("accepted"),
8391
+ literal("rejected"),
8392
+ literal("dependency_unavailable")
8393
+ ]).readonly(),
8394
+ "auth_stable_machine_code": string().readonly().optional(),
8395
+ "retryable": boolean().readonly(),
8396
+ "mail_closed_classification": union([
8397
+ literal("unknown"),
8398
+ literal("dependency_unavailable"),
8399
+ literal("success"),
8400
+ literal("authentication_rejected"),
8401
+ literal("no_active_handle"),
8402
+ literal("multiple_active_handles"),
8403
+ literal("no_mailbox"),
8404
+ literal("owner_conflict")
8405
+ ]).readonly()
8406
+ }).readonly().optional()
8407
+ }).readonly()
8408
+ }), object({
8409
+ "ok": literal(true).readonly(),
8410
+ "value": literal(null).readonly()
8411
+ })]);
8123
8412
  const _awiki_dsh_plugin_awiki_revokeDevice_parameter_0$schema = object({
8124
8413
  "deviceRef": string().readonly(),
8125
8414
  "confirmation": string().readonly()
@@ -8188,6 +8477,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8188
8477
  }), object({
8189
8478
  "ok": literal(true).readonly(),
8190
8479
  "value": object({
8480
+ "methodCapabilities": object({
8481
+ "method": union([literal("wba"), literal("web")]).readonly(),
8482
+ "handleRecovery": boolean().readonly(),
8483
+ "rootImport": boolean().readonly(),
8484
+ "rootTransfer": boolean().readonly(),
8485
+ "servicesUpdate": boolean().readonly()
8486
+ }).readonly().optional(),
8191
8487
  "canManage": boolean().readonly(),
8192
8488
  "rootTransferSupported": boolean().readonly(),
8193
8489
  "role": union([literal("member"), literal("admin")]).readonly().optional(),
@@ -8205,6 +8501,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8205
8501
  "status": union([literal("active"), literal("revoked")]).readonly(),
8206
8502
  "role": union([literal("member"), literal("admin")]).readonly(),
8207
8503
  "managementReady": boolean().readonly(),
8504
+ "provisioning": object({
8505
+ "phase": union([
8506
+ literal("pending"),
8507
+ literal("waiting"),
8508
+ literal("failed"),
8509
+ literal("complete")
8510
+ ]).readonly(),
8511
+ "attempts": number().readonly(),
8512
+ "requiresRejoin": boolean().readonly().optional()
8513
+ }).readonly().optional(),
8208
8514
  "isCurrent": boolean().readonly()
8209
8515
  })).readonly(),
8210
8516
  "requests": array(object({
@@ -8286,13 +8592,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8286
8592
  }).readonly()
8287
8593
  })]);
8288
8594
  const _awiki_dsh_plugin_awiki_sendAttachment_parameter_0$schema = object({
8289
- "target": union([object({
8290
- "kind": literal("direct").readonly(),
8291
- "peer": string().readonly()
8292
- }), object({
8293
- "kind": literal("group").readonly(),
8294
- "group": string().readonly()
8295
- })]).readonly(),
8595
+ "target": union([
8596
+ object({
8597
+ "kind": literal("direct").readonly(),
8598
+ "peer": string().readonly(),
8599
+ "conversationId": never().readonly().optional()
8600
+ }),
8601
+ object({
8602
+ "kind": literal("direct").readonly(),
8603
+ "conversationId": intersection(string(), unknown()).readonly(),
8604
+ "peer": never().readonly().optional()
8605
+ }),
8606
+ object({
8607
+ "kind": literal("group").readonly(),
8608
+ "group": string().readonly()
8609
+ })
8610
+ ]).readonly(),
8296
8611
  "fileName": string().readonly(),
8297
8612
  "mimeType": string().readonly(),
8298
8613
  "bytesBase64": string().readonly(),
@@ -8550,6 +8865,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8550
8865
  }).readonly()
8551
8866
  })]);
8552
8867
  const _awiki_dsh_plugin_awiki_sendRegistrationOtp_parameter_0$schema = object({
8868
+ "inviteCode": string().readonly().optional(),
8869
+ "didMethod": union([literal("wba"), literal("web")]).readonly().optional(),
8553
8870
  "handle": string().readonly(),
8554
8871
  "phone": string().readonly()
8555
8872
  });
@@ -8622,13 +8939,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8622
8939
  }).readonly()
8623
8940
  })]);
8624
8941
  const _awiki_dsh_plugin_awiki_sendText_parameter_0$schema = object({
8625
- "target": union([object({
8626
- "kind": literal("direct").readonly(),
8627
- "peer": string().readonly()
8628
- }), object({
8629
- "kind": literal("group").readonly(),
8630
- "group": string().readonly()
8631
- })]).readonly(),
8942
+ "target": union([
8943
+ object({
8944
+ "kind": literal("direct").readonly(),
8945
+ "peer": string().readonly(),
8946
+ "conversationId": never().readonly().optional()
8947
+ }),
8948
+ object({
8949
+ "kind": literal("direct").readonly(),
8950
+ "conversationId": intersection(string(), unknown()).readonly(),
8951
+ "peer": never().readonly().optional()
8952
+ }),
8953
+ object({
8954
+ "kind": literal("group").readonly(),
8955
+ "group": string().readonly()
8956
+ })
8957
+ ]).readonly(),
8632
8958
  "text": string().readonly(),
8633
8959
  "idempotencyKey": string().readonly(),
8634
8960
  "mentions": array(object({
@@ -9080,6 +9406,94 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9080
9406
  "registeredAt": number().readonly()
9081
9407
  }).readonly()
9082
9408
  })]);
9409
+ const _awiki_dsh_plugin_awiki_updateIdentityServices_parameter_0$schema = object({
9410
+ "services": array(object({
9411
+ "id": string().readonly(),
9412
+ "type": string().readonly(),
9413
+ "serviceEndpoint": string().readonly(),
9414
+ "serviceDid": string().readonly().optional(),
9415
+ "profiles": array(string()).readonly().optional(),
9416
+ "securityProfiles": array(string()).readonly().optional()
9417
+ })).readonly(),
9418
+ "did": string().readonly()
9419
+ });
9420
+ const _awiki_dsh_plugin_awiki_updateIdentityServices_result$schema = union([object({
9421
+ "ok": literal(false).readonly(),
9422
+ "error": object({
9423
+ "code": union([
9424
+ literal("client-version-unsupported"),
9425
+ literal("not-registered"),
9426
+ literal("signed-out"),
9427
+ literal("already-registered"),
9428
+ literal("invalid-request"),
9429
+ literal("invalid-otp"),
9430
+ literal("challenge-expired"),
9431
+ literal("handle-unavailable"),
9432
+ literal("short-handle-invite-required"),
9433
+ literal("not-found"),
9434
+ literal("forbidden"),
9435
+ literal("device-rejoin-required"),
9436
+ literal("identity-recovery-required"),
9437
+ literal("conflict"),
9438
+ literal("state-in-use"),
9439
+ literal("rate-limited"),
9440
+ literal("group-membership-required"),
9441
+ literal("group-identity-stale"),
9442
+ literal("attachment-too-large"),
9443
+ literal("summary-unavailable"),
9444
+ literal("summary-timeout"),
9445
+ literal("summary-cancelled"),
9446
+ literal("summary-invalid-output"),
9447
+ literal("summary-failed"),
9448
+ literal("delivery-unknown"),
9449
+ literal("network"),
9450
+ literal("remote")
9451
+ ]).readonly(),
9452
+ "message": string().readonly(),
9453
+ "mailRecoveryObservability": object({
9454
+ "current_principal_matches_recovery": boolean().readonly(),
9455
+ "request_generation_classification": union([literal("current"), literal("replaced")]).readonly(),
9456
+ "mail_ingress_classification": union([
9457
+ literal("reached"),
9458
+ literal("not_reached"),
9459
+ literal("unknown")
9460
+ ]).readonly(),
9461
+ "auth_status_class": union([
9462
+ literal("unknown"),
9463
+ literal("accepted"),
9464
+ literal("rejected"),
9465
+ literal("dependency_unavailable")
9466
+ ]).readonly(),
9467
+ "auth_stable_machine_code": string().readonly().optional(),
9468
+ "retryable": boolean().readonly(),
9469
+ "mail_closed_classification": union([
9470
+ literal("unknown"),
9471
+ literal("dependency_unavailable"),
9472
+ literal("success"),
9473
+ literal("authentication_rejected"),
9474
+ literal("no_active_handle"),
9475
+ literal("multiple_active_handles"),
9476
+ literal("no_mailbox"),
9477
+ literal("owner_conflict")
9478
+ ]).readonly()
9479
+ }).readonly().optional()
9480
+ }).readonly()
9481
+ }), object({
9482
+ "ok": literal(true).readonly(),
9483
+ "value": object({
9484
+ "did": string().readonly(),
9485
+ "canManage": boolean().readonly(),
9486
+ "pending": boolean().readonly(),
9487
+ "services": array(object({
9488
+ "id": string().readonly(),
9489
+ "type": string().readonly(),
9490
+ "serviceEndpoint": string().readonly(),
9491
+ "serviceDid": string().readonly().optional(),
9492
+ "profiles": array(string()).readonly().optional(),
9493
+ "securityProfiles": array(string()).readonly().optional()
9494
+ })).readonly()
9495
+ }).readonly()
9496
+ })]);
9083
9497
  const _awiki_dsh_plugin_awiki_updateIntegration_parameter_0$schema = object({
9084
9498
  "expectedRevision": number().readonly(),
9085
9499
  "idempotencyKey": string().readonly(),
@@ -9251,7 +9665,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9251
9665
  },
9252
9666
  sourceLocation: {
9253
9667
  "file": "packages/dsh-awiki/src/index.ts",
9254
- "line": 206,
9668
+ "line": 222,
9255
9669
  "column": 9
9256
9670
  }
9257
9671
  },
@@ -9278,7 +9692,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9278
9692
  },
9279
9693
  sourceLocation: {
9280
9694
  "file": "packages/dsh-awiki/src/index.ts",
9281
- "line": 242,
9695
+ "line": 258,
9282
9696
  "column": 3
9283
9697
  }
9284
9698
  },
@@ -9305,7 +9719,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9305
9719
  },
9306
9720
  sourceLocation: {
9307
9721
  "file": "packages/dsh-awiki/src/index.ts",
9308
- "line": 166,
9722
+ "line": 179,
9309
9723
  "column": 9
9310
9724
  }
9311
9725
  },
@@ -9323,7 +9737,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9323
9737
  },
9324
9738
  sourceLocation: {
9325
9739
  "file": "packages/dsh-awiki/src/index.ts",
9326
- "line": 146,
9740
+ "line": 150,
9327
9741
  "column": 9
9328
9742
  }
9329
9743
  },
@@ -9341,7 +9755,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9341
9755
  },
9342
9756
  sourceLocation: {
9343
9757
  "file": "packages/dsh-awiki/src/index.ts",
9344
- "line": 155,
9758
+ "line": 159,
9345
9759
  "column": 9
9346
9760
  }
9347
9761
  },
@@ -9368,7 +9782,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9368
9782
  },
9369
9783
  sourceLocation: {
9370
9784
  "file": "packages/dsh-awiki/src/index.ts",
9371
- "line": 302,
9785
+ "line": 318,
9372
9786
  "column": 3
9373
9787
  }
9374
9788
  },
@@ -9395,7 +9809,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9395
9809
  },
9396
9810
  sourceLocation: {
9397
9811
  "file": "packages/dsh-awiki/src/index.ts",
9398
- "line": 114,
9812
+ "line": 118,
9399
9813
  "column": 3
9400
9814
  }
9401
9815
  },
@@ -9422,7 +9836,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9422
9836
  },
9423
9837
  sourceLocation: {
9424
9838
  "file": "packages/dsh-awiki/src/index.ts",
9425
- "line": 186,
9839
+ "line": 202,
9426
9840
  "column": 9
9427
9841
  }
9428
9842
  },
@@ -9449,7 +9863,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9449
9863
  },
9450
9864
  sourceLocation: {
9451
9865
  "file": "packages/dsh-awiki/src/index.ts",
9452
- "line": 224,
9866
+ "line": 240,
9453
9867
  "column": 9
9454
9868
  }
9455
9869
  },
@@ -9476,7 +9890,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9476
9890
  },
9477
9891
  sourceLocation: {
9478
9892
  "file": "packages/dsh-awiki/src/index.ts",
9479
- "line": 105,
9893
+ "line": 109,
9480
9894
  "column": 3
9481
9895
  }
9482
9896
  },
@@ -9503,7 +9917,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9503
9917
  },
9504
9918
  sourceLocation: {
9505
9919
  "file": "packages/dsh-awiki/src/index.ts",
9506
- "line": 218,
9920
+ "line": 234,
9507
9921
  "column": 9
9508
9922
  }
9509
9923
  },
@@ -9530,7 +9944,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9530
9944
  },
9531
9945
  sourceLocation: {
9532
9946
  "file": "packages/dsh-awiki/src/index.ts",
9533
- "line": 279,
9947
+ "line": 295,
9534
9948
  "column": 9
9535
9949
  }
9536
9950
  },
@@ -9557,7 +9971,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9557
9971
  },
9558
9972
  sourceLocation: {
9559
9973
  "file": "packages/dsh-awiki/src/index.ts",
9560
- "line": 297,
9974
+ "line": 313,
9561
9975
  "column": 9
9562
9976
  }
9563
9977
  },
@@ -9584,7 +9998,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9584
9998
  },
9585
9999
  sourceLocation: {
9586
10000
  "file": "packages/dsh-awiki/src/index.ts",
9587
- "line": 215,
10001
+ "line": 231,
9588
10002
  "column": 9
9589
10003
  }
9590
10004
  },
@@ -9602,7 +10016,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9602
10016
  },
9603
10017
  sourceLocation: {
9604
10018
  "file": "packages/dsh-awiki/src/index.ts",
9605
- "line": 99,
10019
+ "line": 103,
9606
10020
  "column": 9
9607
10021
  }
9608
10022
  },
@@ -9620,7 +10034,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9620
10034
  },
9621
10035
  sourceLocation: {
9622
10036
  "file": "packages/dsh-awiki/src/index.ts",
9623
- "line": 248,
10037
+ "line": 264,
9624
10038
  "column": 3
9625
10039
  }
9626
10040
  },
@@ -9638,7 +10052,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9638
10052
  },
9639
10053
  sourceLocation: {
9640
10054
  "file": "packages/dsh-awiki/src/index.ts",
9641
- "line": 152,
10055
+ "line": 156,
9642
10056
  "column": 9
9643
10057
  }
9644
10058
  },
@@ -9665,7 +10079,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9665
10079
  },
9666
10080
  sourceLocation: {
9667
10081
  "file": "packages/dsh-awiki/src/index.ts",
9668
- "line": 236,
10082
+ "line": 252,
9669
10083
  "column": 3
9670
10084
  }
9671
10085
  },
@@ -9692,7 +10106,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9692
10106
  },
9693
10107
  sourceLocation: {
9694
10108
  "file": "packages/dsh-awiki/src/index.ts",
9695
- "line": 227,
10109
+ "line": 243,
9696
10110
  "column": 3
9697
10111
  }
9698
10112
  },
@@ -9719,7 +10133,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9719
10133
  },
9720
10134
  sourceLocation: {
9721
10135
  "file": "packages/dsh-awiki/src/index.ts",
9722
- "line": 259,
10136
+ "line": 275,
9723
10137
  "column": 3
9724
10138
  }
9725
10139
  },
@@ -9737,7 +10151,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9737
10151
  },
9738
10152
  sourceLocation: {
9739
10153
  "file": "packages/dsh-awiki/src/index.ts",
9740
- "line": 120,
10154
+ "line": 124,
9741
10155
  "column": 9
9742
10156
  }
9743
10157
  },
@@ -9755,7 +10169,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9755
10169
  },
9756
10170
  sourceLocation: {
9757
10171
  "file": "packages/dsh-awiki/src/index.ts",
9758
- "line": 149,
10172
+ "line": 153,
10173
+ "column": 3
10174
+ }
10175
+ },
10176
+ {
10177
+ id: "@awiki/dsh-plugin#awiki/getIdentityServices",
10178
+ service: "awiki",
10179
+ namespace: "awiki",
10180
+ method: "getIdentityServices",
10181
+ invocation: { kind: "direct" },
10182
+ parameters: [],
10183
+ result: {
10184
+ mode: "strict",
10185
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiResult",
10186
+ schema: _awiki_dsh_plugin_awiki_getIdentityServices_result$schema
10187
+ },
10188
+ sourceLocation: {
10189
+ "file": "packages/dsh-awiki/src/index.ts",
10190
+ "line": 165,
9759
10191
  "column": 3
9760
10192
  }
9761
10193
  },
@@ -9773,7 +10205,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9773
10205
  },
9774
10206
  sourceLocation: {
9775
10207
  "file": "packages/dsh-awiki/src/index.ts",
9776
- "line": 102,
10208
+ "line": 106,
9777
10209
  "column": 3
9778
10210
  }
9779
10211
  },
@@ -9800,7 +10232,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9800
10232
  },
9801
10233
  sourceLocation: {
9802
10234
  "file": "packages/dsh-awiki/src/index.ts",
9803
- "line": 262,
10235
+ "line": 278,
9804
10236
  "column": 3
9805
10237
  }
9806
10238
  },
@@ -9818,7 +10250,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9818
10250
  },
9819
10251
  sourceLocation: {
9820
10252
  "file": "packages/dsh-awiki/src/index.ts",
9821
- "line": 282,
10253
+ "line": 298,
9822
10254
  "column": 3
9823
10255
  }
9824
10256
  },
@@ -9836,7 +10268,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9836
10268
  },
9837
10269
  sourceLocation: {
9838
10270
  "file": "packages/dsh-awiki/src/index.ts",
9839
- "line": 194,
10271
+ "line": 210,
9840
10272
  "column": 3
9841
10273
  }
9842
10274
  },
@@ -9863,7 +10295,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9863
10295
  },
9864
10296
  sourceLocation: {
9865
10297
  "file": "packages/dsh-awiki/src/index.ts",
9866
- "line": 209,
10298
+ "line": 225,
9867
10299
  "column": 9
9868
10300
  }
9869
10301
  },
@@ -9881,7 +10313,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9881
10313
  },
9882
10314
  sourceLocation: {
9883
10315
  "file": "packages/dsh-awiki/src/index.ts",
9884
- "line": 123,
10316
+ "line": 127,
9885
10317
  "column": 9
9886
10318
  }
9887
10319
  },
@@ -9908,7 +10340,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9908
10340
  },
9909
10341
  sourceLocation: {
9910
10342
  "file": "packages/dsh-awiki/src/index.ts",
9911
- "line": 132,
10343
+ "line": 136,
9912
10344
  "column": 9
9913
10345
  }
9914
10346
  },
@@ -9935,7 +10367,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9935
10367
  },
9936
10368
  sourceLocation: {
9937
10369
  "file": "packages/dsh-awiki/src/index.ts",
9938
- "line": 230,
10370
+ "line": 246,
9939
10371
  "column": 3
9940
10372
  }
9941
10373
  },
@@ -9962,7 +10394,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9962
10394
  },
9963
10395
  sourceLocation: {
9964
10396
  "file": "packages/dsh-awiki/src/index.ts",
9965
- "line": 233,
10397
+ "line": 249,
9966
10398
  "column": 9
9967
10399
  }
9968
10400
  },
@@ -9990,7 +10422,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9990
10422
  },
9991
10423
  sourceLocation: {
9992
10424
  "file": "packages/dsh-awiki/src/index.ts",
9993
- "line": 256,
10425
+ "line": 272,
9994
10426
  "column": 3
9995
10427
  }
9996
10428
  },
@@ -10017,7 +10449,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10017
10449
  },
10018
10450
  sourceLocation: {
10019
10451
  "file": "packages/dsh-awiki/src/index.ts",
10020
- "line": 239,
10452
+ "line": 255,
10021
10453
  "column": 3
10022
10454
  }
10023
10455
  },
@@ -10045,7 +10477,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10045
10477
  },
10046
10478
  sourceLocation: {
10047
10479
  "file": "packages/dsh-awiki/src/index.ts",
10048
- "line": 285,
10480
+ "line": 301,
10049
10481
  "column": 9
10050
10482
  }
10051
10483
  },
@@ -10063,7 +10495,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10063
10495
  },
10064
10496
  sourceLocation: {
10065
10497
  "file": "packages/dsh-awiki/src/index.ts",
10066
- "line": 129,
10498
+ "line": 133,
10067
10499
  "column": 3
10068
10500
  }
10069
10501
  },
@@ -10090,7 +10522,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10090
10522
  },
10091
10523
  sourceLocation: {
10092
10524
  "file": "packages/dsh-awiki/src/index.ts",
10093
- "line": 126,
10525
+ "line": 130,
10094
10526
  "column": 3
10095
10527
  }
10096
10528
  },
@@ -10117,7 +10549,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10117
10549
  },
10118
10550
  sourceLocation: {
10119
10551
  "file": "packages/dsh-awiki/src/index.ts",
10120
- "line": 270,
10552
+ "line": 286,
10121
10553
  "column": 3
10122
10554
  }
10123
10555
  },
@@ -10144,7 +10576,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10144
10576
  },
10145
10577
  sourceLocation: {
10146
10578
  "file": "packages/dsh-awiki/src/index.ts",
10147
- "line": 291,
10579
+ "line": 307,
10148
10580
  "column": 3
10149
10581
  }
10150
10582
  },
@@ -10171,7 +10603,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10171
10603
  },
10172
10604
  sourceLocation: {
10173
10605
  "file": "packages/dsh-awiki/src/index.ts",
10174
- "line": 203,
10606
+ "line": 219,
10175
10607
  "column": 3
10176
10608
  }
10177
10609
  },
@@ -10198,7 +10630,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10198
10630
  },
10199
10631
  sourceLocation: {
10200
10632
  "file": "packages/dsh-awiki/src/index.ts",
10201
- "line": 181,
10633
+ "line": 197,
10202
10634
  "column": 9
10203
10635
  }
10204
10636
  },
@@ -10225,7 +10657,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10225
10657
  },
10226
10658
  sourceLocation: {
10227
10659
  "file": "packages/dsh-awiki/src/index.ts",
10228
- "line": 288,
10660
+ "line": 304,
10229
10661
  "column": 9
10230
10662
  }
10231
10663
  },
@@ -10243,7 +10675,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10243
10675
  },
10244
10676
  sourceLocation: {
10245
10677
  "file": "packages/dsh-awiki/src/index.ts",
10246
- "line": 158,
10678
+ "line": 162,
10247
10679
  "column": 3
10248
10680
  }
10249
10681
  },
@@ -10270,7 +10702,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10270
10702
  },
10271
10703
  sourceLocation: {
10272
10704
  "file": "packages/dsh-awiki/src/index.ts",
10273
- "line": 140,
10705
+ "line": 144,
10274
10706
  "column": 9
10275
10707
  }
10276
10708
  },
@@ -10297,7 +10729,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10297
10729
  },
10298
10730
  sourceLocation: {
10299
10731
  "file": "packages/dsh-awiki/src/index.ts",
10300
- "line": 171,
10732
+ "line": 187,
10301
10733
  "column": 9
10302
10734
  }
10303
10735
  },
@@ -10324,15 +10756,42 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10324
10756
  },
10325
10757
  sourceLocation: {
10326
10758
  "file": "packages/dsh-awiki/src/index.ts",
10327
- "line": 245,
10759
+ "line": 261,
10760
+ "column": 3
10761
+ }
10762
+ },
10763
+ {
10764
+ id: "@awiki/dsh-plugin#awiki/reopenIntegration",
10765
+ service: "awiki",
10766
+ namespace: "awiki",
10767
+ method: "reopenIntegration",
10768
+ invocation: { kind: "direct" },
10769
+ parameters: [{
10770
+ name: "request",
10771
+ wire: "request",
10772
+ source: "json",
10773
+ codec: {
10774
+ mode: "strict",
10775
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiReopenIntegrationRequest",
10776
+ schema: _awiki_dsh_plugin_awiki_reopenIntegration_parameter_0$schema
10777
+ }
10778
+ }],
10779
+ result: {
10780
+ mode: "strict",
10781
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiIntegrationResult",
10782
+ schema: _awiki_dsh_plugin_awiki_reopenIntegration_result$schema
10783
+ },
10784
+ sourceLocation: {
10785
+ "file": "packages/dsh-awiki/src/index.ts",
10786
+ "line": 121,
10328
10787
  "column": 3
10329
10788
  }
10330
10789
  },
10331
10790
  {
10332
- id: "@awiki/dsh-plugin#awiki/reopenIntegration",
10791
+ id: "@awiki/dsh-plugin#awiki/resolvePeer",
10333
10792
  service: "awiki",
10334
10793
  namespace: "awiki",
10335
- method: "reopenIntegration",
10794
+ method: "resolvePeer",
10336
10795
  invocation: { kind: "direct" },
10337
10796
  parameters: [{
10338
10797
  name: "request",
@@ -10340,26 +10799,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10340
10799
  source: "json",
10341
10800
  codec: {
10342
10801
  mode: "strict",
10343
- typeSymbol: "@awiki/dsh-plugin/types#AwikiReopenIntegrationRequest",
10344
- schema: _awiki_dsh_plugin_awiki_reopenIntegration_parameter_0$schema
10802
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiResolvePeerRequest",
10803
+ schema: _awiki_dsh_plugin_awiki_resolvePeer_parameter_0$schema
10345
10804
  }
10346
10805
  }],
10347
10806
  result: {
10348
10807
  mode: "strict",
10349
- typeSymbol: "@awiki/dsh-plugin/types#AwikiIntegrationResult",
10350
- schema: _awiki_dsh_plugin_awiki_reopenIntegration_result$schema
10808
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiResult",
10809
+ schema: _awiki_dsh_plugin_awiki_resolvePeer_result$schema
10351
10810
  },
10352
10811
  sourceLocation: {
10353
10812
  "file": "packages/dsh-awiki/src/index.ts",
10354
- "line": 117,
10813
+ "line": 237,
10355
10814
  "column": 3
10356
10815
  }
10357
10816
  },
10358
10817
  {
10359
- id: "@awiki/dsh-plugin#awiki/resolvePeer",
10818
+ id: "@awiki/dsh-plugin#awiki/resumeIdentityServicesUpdate",
10360
10819
  service: "awiki",
10361
10820
  namespace: "awiki",
10362
- method: "resolvePeer",
10821
+ method: "resumeIdentityServicesUpdate",
10363
10822
  invocation: { kind: "direct" },
10364
10823
  parameters: [{
10365
10824
  name: "request",
@@ -10367,18 +10826,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10367
10826
  source: "json",
10368
10827
  codec: {
10369
10828
  mode: "strict",
10370
- typeSymbol: "@awiki/dsh-plugin/types#AwikiResolvePeerRequest",
10371
- schema: _awiki_dsh_plugin_awiki_resolvePeer_parameter_0$schema
10829
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiIdentityServicesRequest",
10830
+ schema: _awiki_dsh_plugin_awiki_resumeIdentityServicesUpdate_parameter_0$schema
10372
10831
  }
10373
10832
  }],
10374
10833
  result: {
10375
10834
  mode: "strict",
10376
10835
  typeSymbol: "@awiki/dsh-plugin/types#AwikiResult",
10377
- schema: _awiki_dsh_plugin_awiki_resolvePeer_result$schema
10836
+ schema: _awiki_dsh_plugin_awiki_resumeIdentityServicesUpdate_result$schema
10378
10837
  },
10379
10838
  sourceLocation: {
10380
10839
  "file": "packages/dsh-awiki/src/index.ts",
10381
- "line": 221,
10840
+ "line": 171,
10382
10841
  "column": 3
10383
10842
  }
10384
10843
  },
@@ -10405,7 +10864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10405
10864
  },
10406
10865
  sourceLocation: {
10407
10866
  "file": "packages/dsh-awiki/src/index.ts",
10408
- "line": 212,
10867
+ "line": 228,
10409
10868
  "column": 9
10410
10869
  }
10411
10870
  },
@@ -10423,10 +10882,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10423
10882
  },
10424
10883
  sourceLocation: {
10425
10884
  "file": "packages/dsh-awiki/src/index.ts",
10426
- "line": 143,
10885
+ "line": 147,
10427
10886
  "column": 3
10428
10887
  }
10429
10888
  },
10889
+ {
10890
+ id: "@awiki/dsh-plugin#awiki/retryDeviceManagement",
10891
+ service: "awiki",
10892
+ namespace: "awiki",
10893
+ method: "retryDeviceManagement",
10894
+ invocation: { kind: "direct" },
10895
+ parameters: [{
10896
+ name: "request",
10897
+ wire: "request",
10898
+ source: "json",
10899
+ codec: {
10900
+ mode: "strict",
10901
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiPrepareRootTransferRequest",
10902
+ schema: _awiki_dsh_plugin_awiki_retryDeviceManagement_parameter_0$schema
10903
+ }
10904
+ }],
10905
+ result: {
10906
+ mode: "strict",
10907
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiResult",
10908
+ schema: _awiki_dsh_plugin_awiki_retryDeviceManagement_result$schema
10909
+ },
10910
+ sourceLocation: {
10911
+ "file": "packages/dsh-awiki/src/index.ts",
10912
+ "line": 184,
10913
+ "column": 9
10914
+ }
10915
+ },
10430
10916
  {
10431
10917
  id: "@awiki/dsh-plugin#awiki/revokeDevice",
10432
10918
  service: "awiki",
@@ -10450,7 +10936,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10450
10936
  },
10451
10937
  sourceLocation: {
10452
10938
  "file": "packages/dsh-awiki/src/index.ts",
10453
- "line": 176,
10939
+ "line": 192,
10454
10940
  "column": 9
10455
10941
  }
10456
10942
  },
@@ -10477,7 +10963,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10477
10963
  },
10478
10964
  sourceLocation: {
10479
10965
  "file": "packages/dsh-awiki/src/index.ts",
10480
- "line": 111,
10966
+ "line": 115,
10481
10967
  "column": 3
10482
10968
  }
10483
10969
  },
@@ -10504,7 +10990,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10504
10990
  },
10505
10991
  sourceLocation: {
10506
10992
  "file": "packages/dsh-awiki/src/index.ts",
10507
- "line": 276,
10993
+ "line": 292,
10508
10994
  "column": 9
10509
10995
  }
10510
10996
  },
@@ -10531,7 +11017,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10531
11017
  },
10532
11018
  sourceLocation: {
10533
11019
  "file": "packages/dsh-awiki/src/index.ts",
10534
- "line": 294,
11020
+ "line": 310,
10535
11021
  "column": 9
10536
11022
  }
10537
11023
  },
@@ -10558,7 +11044,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10558
11044
  },
10559
11045
  sourceLocation: {
10560
11046
  "file": "packages/dsh-awiki/src/index.ts",
10561
- "line": 200,
11047
+ "line": 216,
10562
11048
  "column": 3
10563
11049
  }
10564
11050
  },
@@ -10585,7 +11071,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10585
11071
  },
10586
11072
  sourceLocation: {
10587
11073
  "file": "packages/dsh-awiki/src/index.ts",
10588
- "line": 137,
11074
+ "line": 141,
10589
11075
  "column": 9
10590
11076
  }
10591
11077
  },
@@ -10612,7 +11098,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10612
11098
  },
10613
11099
  sourceLocation: {
10614
11100
  "file": "packages/dsh-awiki/src/index.ts",
10615
- "line": 273,
11101
+ "line": 289,
10616
11102
  "column": 3
10617
11103
  }
10618
11104
  },
@@ -10639,7 +11125,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10639
11125
  },
10640
11126
  sourceLocation: {
10641
11127
  "file": "packages/dsh-awiki/src/index.ts",
10642
- "line": 161,
11128
+ "line": 174,
10643
11129
  "column": 9
10644
11130
  }
10645
11131
  },
@@ -10666,7 +11152,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10666
11152
  },
10667
11153
  sourceLocation: {
10668
11154
  "file": "packages/dsh-awiki/src/index.ts",
10669
- "line": 265,
11155
+ "line": 281,
10670
11156
  "column": 9
10671
11157
  }
10672
11158
  },
@@ -10693,7 +11179,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10693
11179
  },
10694
11180
  sourceLocation: {
10695
11181
  "file": "packages/dsh-awiki/src/index.ts",
10696
- "line": 251,
11182
+ "line": 267,
10697
11183
  "column": 3
10698
11184
  }
10699
11185
  },
@@ -10720,10 +11206,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10720
11206
  },
10721
11207
  sourceLocation: {
10722
11208
  "file": "packages/dsh-awiki/src/index.ts",
10723
- "line": 191,
11209
+ "line": 207,
10724
11210
  "column": 9
10725
11211
  }
10726
11212
  },
11213
+ {
11214
+ id: "@awiki/dsh-plugin#awiki/updateIdentityServices",
11215
+ service: "awiki",
11216
+ namespace: "awiki",
11217
+ method: "updateIdentityServices",
11218
+ invocation: { kind: "direct" },
11219
+ parameters: [{
11220
+ name: "request",
11221
+ wire: "request",
11222
+ source: "json",
11223
+ codec: {
11224
+ mode: "strict",
11225
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiUpdateIdentityServicesRequest",
11226
+ schema: _awiki_dsh_plugin_awiki_updateIdentityServices_parameter_0$schema
11227
+ }
11228
+ }],
11229
+ result: {
11230
+ mode: "strict",
11231
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiResult",
11232
+ schema: _awiki_dsh_plugin_awiki_updateIdentityServices_result$schema
11233
+ },
11234
+ sourceLocation: {
11235
+ "file": "packages/dsh-awiki/src/index.ts",
11236
+ "line": 168,
11237
+ "column": 3
11238
+ }
11239
+ },
10727
11240
  {
10728
11241
  id: "@awiki/dsh-plugin#awiki/updateIntegration",
10729
11242
  service: "awiki",
@@ -10747,7 +11260,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10747
11260
  },
10748
11261
  sourceLocation: {
10749
11262
  "file": "packages/dsh-awiki/src/index.ts",
10750
- "line": 108,
11263
+ "line": 112,
10751
11264
  "column": 3
10752
11265
  }
10753
11266
  },
@@ -10774,7 +11287,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10774
11287
  },
10775
11288
  sourceLocation: {
10776
11289
  "file": "packages/dsh-awiki/src/index.ts",
10777
- "line": 197,
11290
+ "line": 213,
10778
11291
  "column": 3
10779
11292
  }
10780
11293
  }
@@ -10964,7 +11477,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10964
11477
  //#endregion
10965
11478
  //#region lib/types/registration-policy.js
10966
11479
  /** Registration presentation and Handle normalization; admission is owned by the server. */
10967
- const SHORT_HANDLE_INVITE_MESSAGE = "注册少于5位的handle需要使用邀请码,目前暂不支持自主注册。";
11480
+ const SHORT_HANDLE_INVITE_MESSAGE = "此 Handle 注册需要邀请码,请输入后继续。";
10968
11481
  //#endregion
10969
11482
  //#region lib/types/client/otp-cooldown.js
10970
11483
  /** Retain the server cooldown across panel remounts, without persisting OTPs. */
@@ -11678,8 +12191,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11678
12191
  const recoveryCooldown = useRecoveryOtpCooldown();
11679
12192
  const [phone, setPhone] = useDraftState("identity:phone", "");
11680
12193
  const [handle, setHandle] = useDraftState("identity:handle", "");
12194
+ const [inviteCode, setInviteCode] = useDraftState("identity:inviteCode", "");
12195
+ const entryInFlight = (0, react.useRef)(false);
12196
+ const [entryPending, setEntryPending] = (0, react.useState)(false);
11681
12197
  const [otp, setOtp] = useDraftState("identity:otp", "");
11682
12198
  const [registrationOtpSent, setRegistrationOtpSent] = useDraftState("identity:registrationOtpSent", false, false);
12199
+ const [didMethod, setDidMethod] = useDraftState("identity:didMethod", "wba", false);
12200
+ const [pendingRegistration, setPendingRegistration] = useDraftState("identity:pendingRegistration", null, false);
12201
+ const creationMethods = props.access?.creationMethods ?? ["wba"];
12202
+ const canRegister = creationMethods.includes(didMethod) || pendingRegistration?.method === didMethod && pendingRegistration.fullHandle === handle.trim();
11683
12203
  const [recoveryFactorContext, setRecoveryFactorContext] = useDraftState("identity:recoveryFactorContext", null, false);
11684
12204
  const [notice, setNotice] = useDraftState("identity:notice", null, false);
11685
12205
  const [error, setError] = useDraftState("identity:error", null, false);
@@ -11692,12 +12212,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11692
12212
  const [recoveryChoice, setRecoveryChoice] = useDraftState("identity:recoveryChoice", null, false);
11693
12213
  const [recoveryRiskConfirmed, setRecoveryRiskConfirmed] = useDraftState("identity:recoveryRiskConfirmed", false, false);
11694
12214
  const [recoveryEntryOpen, setRecoveryEntryOpen] = useDraftState("identity:recoveryEntryOpen", false, false);
11695
- const validRecoveryEntryOpen = recoveryEntryOpen && props.sessionStatus === "recovery-required";
12215
+ const validRecoveryEntryOpen = recoveryEntryOpen && props.sessionStatus === "recovery-required" && props.access?.methodCapabilities?.handleRecovery !== false;
11696
12216
  const recoveryConfirmationInFlight = (0, react.useRef)(false);
11697
12217
  const [recoveryConfirming, setRecoveryConfirming] = (0, react.useState)(false);
11698
12218
  const [joinCheck, setJoinCheck] = (0, react.useState)("loading");
11699
12219
  const [joinProgress, setJoinProgress] = (0, react.useState)(null);
11700
12220
  const [deviceRejoinHandle, setDeviceRejoinHandle] = useDraftState("identity:deviceRejoinHandle", null, false);
12221
+ (0, react.useEffect)(() => {
12222
+ if (!registrationOtpSent && pendingRegistration === null && creationMethods.length > 0 && !creationMethods.includes(didMethod)) setDidMethod(creationMethods.includes("wba") ? "wba" : creationMethods[0]);
12223
+ }, [
12224
+ props.access?.creationMethods,
12225
+ registrationOtpSent,
12226
+ pendingRegistration,
12227
+ didMethod
12228
+ ]);
11701
12229
  (0, react.useEffect)(() => {
11702
12230
  if (retryDeadline === null) return;
11703
12231
  const update = () => {
@@ -11722,6 +12250,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11722
12250
  setRegistrationConfirmation(null);
11723
12251
  setShortHandleInviteNotice(false);
11724
12252
  setOtp("");
12253
+ setInviteCode("");
11725
12254
  setRegistrationOtpSent(false);
11726
12255
  setRecoveryFactorContext(null);
11727
12256
  setRecoveryChoice(null);
@@ -11744,35 +12273,63 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11744
12273
  };
11745
12274
  const requestRegistrationOtp = async () => {
11746
12275
  setError(null);
11747
- const result = await props.sendRegistrationOtp({
11748
- handle: handle.trim(),
11749
- phone: phone.trim()
11750
- });
11751
- if (!result.ok) {
11752
- if (result.failureCode === "short-handle-invite-required") {
11753
- setNotice(null);
12276
+ if (entryInFlight.current) return;
12277
+ entryInFlight.current = true;
12278
+ setEntryPending(true);
12279
+ try {
12280
+ const checked = await props.inspectIdentityAccess({
12281
+ handle: handle.trim(),
12282
+ phone: phone.trim(),
12283
+ ...inviteCode.trim() === "" ? {} : { inviteCode: inviteCode.trim() }
12284
+ });
12285
+ if (!checked.ok) return setError(checked.error);
12286
+ if (checked.value.status === "unavailable") return setError("此 Handle 暂不可注册,请更换后重试。");
12287
+ if (checked.value.status !== "existing" && checked.value.inviteRequired && checked.value.inviteStatus !== "valid") {
11754
12288
  setShortHandleInviteNotice(true);
12289
+ setNotice(null);
12290
+ if (checked.value.inviteStatus === "invalid") setError("邀请码无效或不适用于当前账号,请检查后重试。");
11755
12291
  return;
11756
12292
  }
11757
- setError(result.error);
11758
- return;
12293
+ if (checked.value.status !== "existing" && !canRegister) return setError("当前服务暂不接受所选方法的新注册。");
12294
+ const admissionInvite = checked.value.status === "existing" ? "" : inviteCode.trim();
12295
+ if (checked.value.status === "existing") {
12296
+ setInviteCode("");
12297
+ setShortHandleInviteNotice(false);
12298
+ }
12299
+ const result = await props.sendRegistrationOtp({
12300
+ handle: handle.trim(),
12301
+ phone: phone.trim(),
12302
+ ...didMethod === "web" ? { didMethod } : {},
12303
+ ...admissionInvite === "" ? {} : { inviteCode: admissionInvite }
12304
+ });
12305
+ if (!result.ok) {
12306
+ if (result.failureCode === "short-handle-invite-required") {
12307
+ setNotice(null);
12308
+ setShortHandleInviteNotice(true);
12309
+ return;
12310
+ }
12311
+ setError(result.error);
12312
+ return;
12313
+ }
12314
+ const cooldownSeconds = Math.max(0, Math.ceil(result.value.retryAfterSeconds));
12315
+ setRegistrationOtpSent(true);
12316
+ setRetryDeadline(Date.now() + cooldownSeconds * 1e3);
12317
+ setRetrySeconds(cooldownSeconds);
12318
+ setNotice(`注册验证码已发送;${cooldownSeconds} 秒后可重新获取。`);
12319
+ } finally {
12320
+ entryInFlight.current = false;
12321
+ setEntryPending(false);
11759
12322
  }
11760
- const cooldownSeconds = Math.max(0, Math.ceil(result.value.retryAfterSeconds));
11761
- setRegistrationOtpSent(true);
11762
- setRetryDeadline(Date.now() + cooldownSeconds * 1e3);
11763
- setRetrySeconds(cooldownSeconds);
11764
- setNotice(`注册验证码已发送;${cooldownSeconds} 秒后可重新获取。`);
11765
12323
  };
11766
12324
  const requestIdentityOtp = async () => {
11767
12325
  setError(null);
11768
- const result = await props.continueRecoveryForHandle?.(handle.trim());
12326
+ const result = didMethod === "wba" ? await props.continueRecoveryForHandle?.(handle.trim()) : void 0;
11769
12327
  if (result !== void 0 && !result.ok) return setError(result.error);
11770
12328
  if (result?.ok && result.value) return;
11771
- setShortHandleInviteNotice(false);
11772
12329
  await requestRegistrationOtp();
11773
12330
  };
11774
12331
  const completeRegistration = async () => {
11775
- if (!registrationOtpSent || registrationConfirmation === null || registrationInFlight.current || props.pending) return;
12332
+ if (!canRegister || !registrationOtpSent || registrationConfirmation === null || registrationInFlight.current || props.pending) return;
11776
12333
  registrationInFlight.current = true;
11777
12334
  setRegistrationSubmitting(true);
11778
12335
  setError(null);
@@ -11793,13 +12350,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11793
12350
  setOtp("");
11794
12351
  setJoinContext({
11795
12352
  fullHandle: result.value.fullHandle,
11796
- phone: phone.trim()
12353
+ phone: phone.trim(),
12354
+ ...result.value.methodCapabilities === void 0 ? {} : { methodCapabilities: result.value.methodCapabilities }
11797
12355
  });
11798
12356
  return;
11799
12357
  }
11800
12358
  setPhone("");
11801
12359
  setHandle("");
11802
12360
  setDeviceRejoinHandle(null);
12361
+ setPendingRegistration(null);
11803
12362
  resetIdentityEntry();
11804
12363
  } catch {
11805
12364
  setRegistrationConfirmation(null);
@@ -11814,7 +12373,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11814
12373
  const choice = props.access.choice;
11815
12374
  setJoinContext(choice === null ? null : {
11816
12375
  fullHandle: choice.fullHandle,
11817
- phone
12376
+ phone,
12377
+ ...choice.methodCapabilities === void 0 ? {} : { methodCapabilities: choice.methodCapabilities }
11818
12378
  });
11819
12379
  }, [props.access]);
11820
12380
  const beginJoin = async () => {
@@ -11983,7 +12543,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11983
12543
  setDeviceRejoinHandle(currentHandle);
11984
12544
  resetIdentityEntry();
11985
12545
  };
11986
- const signedOutRecoveryOpen = props.sessionStatus === "signed-out" && signedOutAlternative === "recover";
12546
+ const signedOutRecoveryOpen = props.sessionStatus === "signed-out" && signedOutAlternative === "recover" && props.access?.methodCapabilities?.handleRecovery === true;
11987
12547
  const revokedHandle = props.sessionStatus === "recovery-required" ? props.identity?.handle : void 0;
11988
12548
  if (props.recoveryOperationId !== null && !signedOutRecoveryOpen) return (0, react_jsx_runtime.jsx)(Recovery, {
11989
12549
  ...props,
@@ -11996,6 +12556,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11996
12556
  requestDescription: "这个 Handle 已在另一台设备完成了更新恢复,当前设备的旧凭证因此失效。验证绑定手机号后即可继续使用本机数据。"
11997
12557
  }
11998
12558
  });
12559
+ if (props.sessionStatus === "recovery-required" && props.access?.methodCapabilities?.handleRecovery === false) return (0, react_jsx_runtime.jsxs)(AwikiIdentityPage, { children: [(0, react_jsx_runtime.jsx)("p", {
12560
+ role: "status",
12561
+ children: "此身份不支持恢复。Web 首个管理员丢失后无法恢复管理能力;可使用仍有效的设备继续访问。"
12562
+ }), (0, react_jsx_runtime.jsx)("button", {
12563
+ type: "button",
12564
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.secondary,
12565
+ disabled: props.accessLoading,
12566
+ onClick: () => {
12567
+ props.refreshIdentityAccess?.();
12568
+ },
12569
+ children: "重新检查身份状态"
12570
+ })] });
11999
12571
  if (!validRecoveryEntryOpen && (props.access === null && props.accessLoading || props.access === null && props.accessError)) return (0, react_jsx_runtime.jsxs)(AwikiIdentityPage, { children: [(0, react_jsx_runtime.jsx)("p", {
12000
12572
  role: "status",
12001
12573
  children: props.accessError ?? "正在确认本机身份操作…"
@@ -12214,13 +12786,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12214
12786
  },
12215
12787
  children: "加入新设备(推荐)"
12216
12788
  }),
12217
- (0, react_jsx_runtime.jsx)("button", {
12789
+ joinContext.methodCapabilities?.handleRecovery === true && (0, react_jsx_runtime.jsx)("button", {
12218
12790
  type: "button",
12219
12791
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.dangerLink,
12220
12792
  disabled: props.pending,
12221
12793
  onClick: chooseRecovery,
12222
12794
  children: "恢复 Handle(会替换 DID)"
12223
12795
  }),
12796
+ joinContext.methodCapabilities?.method === "web" && (0, react_jsx_runtime.jsx)("p", {
12797
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.notice,
12798
+ children: "Web 身份不支持恢复或管理权转移;首个管理员丢失后无法恢复管理能力。请使用已有管理设备批准加入。"
12799
+ }),
12224
12800
  (0, react_jsx_runtime.jsx)("button", {
12225
12801
  type: "button",
12226
12802
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.secondary,
@@ -12238,7 +12814,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12238
12814
  ]
12239
12815
  }) });
12240
12816
  if (props.sessionStatus === "signed-out") {
12241
- if (signedOutAlternative === "recover") return (0, react_jsx_runtime.jsx)(Recovery, {
12817
+ if (signedOutRecoveryOpen) return (0, react_jsx_runtime.jsx)(Recovery, {
12242
12818
  ...props,
12243
12819
  onExit: exitRecovery,
12244
12820
  onExitLabel: "返回本机身份"
@@ -12330,7 +12906,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12330
12906
  role: "alert",
12331
12907
  children: error
12332
12908
  }),
12333
- loginFailed && (0, react_jsx_runtime.jsxs)("div", {
12909
+ loginFailed && props.access?.methodCapabilities?.handleRecovery === true && (0, react_jsx_runtime.jsxs)("div", {
12334
12910
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.recoveryHelp,
12335
12911
  children: [(0, react_jsx_runtime.jsx)("p", { children: "如果本机身份凭证已经损坏或不可用,可以验证原绑定手机号后恢复这个身份。" }), (0, react_jsx_runtime.jsx)("button", {
12336
12912
  type: "button",
@@ -12360,7 +12936,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12360
12936
  if (registrationOtpSent) setRegistrationConfirmation({
12361
12937
  phone: phone.trim(),
12362
12938
  handle: handle.trim(),
12363
- otp: otp.trim()
12939
+ otp: otp.trim(),
12940
+ ...didMethod === "web" ? { didMethod } : {},
12941
+ ...inviteCode.trim() === "" ? {} : { inviteCode: inviteCode.trim() }
12364
12942
  });
12365
12943
  else requestIdentityOtp();
12366
12944
  },
@@ -12373,15 +12951,59 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12373
12951
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.headingGroup,
12374
12952
  children: [(0, react_jsx_runtime.jsx)("h3", { children: registrationOtpSent ? "验证身份" : deviceRejoinHandle === null ? "进入 AWiki" : "重新加入设备" }), (0, react_jsx_runtime.jsx)("p", { children: registrationOtpSent ? "输入注册验证码。新 Handle 会创建身份,已有 Handle 会进入设备加入选择。" : deviceRejoinHandle === null ? "输入 Handle 和手机号继续。已有恢复进度会直接继续,无需重复获取验证码。" : "验证绑定手机号后,这台设备会以一把新密钥重新申请加入;本机消息数据不会清除。" })]
12375
12953
  }),
12954
+ !registrationOtpSent && (props.access?.pendingRegistrations?.length ?? 0) > 0 && (0, react_jsx_runtime.jsxs)("div", {
12955
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.actionStack,
12956
+ "aria-label": "未完成的注册",
12957
+ children: [(0, react_jsx_runtime.jsx)("p", { children: "选择原注册继续;请重新输入手机号和有效验证码。" }), props.access?.pendingRegistrations?.filter((value) => value.verificationKind === "phone").map((value) => (0, react_jsx_runtime.jsxs)("button", {
12958
+ type: "button",
12959
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.secondary,
12960
+ disabled: entryPending || props.pending,
12961
+ onClick: () => {
12962
+ setPendingRegistration(value);
12963
+ setHandle(value.fullHandle);
12964
+ setDidMethod(value.method);
12965
+ setOtp("");
12966
+ setNotice("将继续原注册,保留同一个 DID。");
12967
+ },
12968
+ children: ["继续注册 ", value.fullHandle]
12969
+ }, value.did))]
12970
+ }),
12971
+ (creationMethods.length > 1 || creationMethods.length === 1 && creationMethods[0] === "web") && (0, react_jsx_runtime.jsxs)("label", {
12972
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.field,
12973
+ children: ["身份方法", (0, react_jsx_runtime.jsx)("select", {
12974
+ "aria-label": "身份方法",
12975
+ value: didMethod,
12976
+ disabled: entryPending || registrationOtpSent || props.pending,
12977
+ onChange: (event) => {
12978
+ setDidMethod(event.target.value);
12979
+ setPendingRegistration(null);
12980
+ },
12981
+ children: creationMethods.map((method) => (0, react_jsx_runtime.jsx)("option", {
12982
+ value: method,
12983
+ children: method === "wba" ? "WBA(默认)" : "Web"
12984
+ }, method))
12985
+ })]
12986
+ }),
12987
+ didMethod === "web" && (0, react_jsx_runtime.jsx)("p", {
12988
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.notice,
12989
+ children: "Web 身份支持独立设备加入和撤销,不支持恢复或管理权转移。首个管理员丢失后无法恢复管理能力。"
12990
+ }),
12991
+ !canRegister && (0, react_jsx_runtime.jsx)("p", {
12992
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.notice,
12993
+ children: "当前服务暂不接受所选方法的新注册。可继续已保存的注册,或重新检查。"
12994
+ }),
12376
12995
  (0, react_jsx_runtime.jsxs)("label", {
12377
12996
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.field,
12378
12997
  children: ["Handle", (0, react_jsx_runtime.jsx)("input", {
12379
12998
  value: handle,
12380
12999
  onChange: (event) => {
12381
13000
  setHandle(event.target.value);
13001
+ setPendingRegistration(null);
12382
13002
  setShortHandleInviteNotice(false);
13003
+ setInviteCode("");
13004
+ setError(null);
12383
13005
  },
12384
- readOnly: registrationOtpSent || deviceRejoinHandle !== null,
13006
+ readOnly: entryPending || props.pending || registrationOtpSent || deviceRejoinHandle !== null,
12385
13007
  autoComplete: "username",
12386
13008
  placeholder: "例如 alice",
12387
13009
  autoFocus: props.autoFocusHandle
@@ -12394,11 +13016,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12394
13016
  onChange: (event) => {
12395
13017
  setPhone(event.target.value);
12396
13018
  },
12397
- readOnly: registrationOtpSent,
13019
+ readOnly: entryPending || props.pending || registrationOtpSent,
12398
13020
  type: "tel",
12399
13021
  autoComplete: "tel"
12400
13022
  })]
12401
13023
  }),
13024
+ shortHandleInviteNotice && (0, react_jsx_runtime.jsxs)("label", {
13025
+ className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.field,
13026
+ children: ["邀请码", (0, react_jsx_runtime.jsx)("input", {
13027
+ value: inviteCode,
13028
+ onChange: (event) => {
13029
+ setInviteCode(event.target.value);
13030
+ setError(null);
13031
+ },
13032
+ readOnly: entryPending || props.pending || registrationOtpSent,
13033
+ autoComplete: "off",
13034
+ maxLength: 512,
13035
+ placeholder: "请输入邀请码"
13036
+ })]
13037
+ }),
12402
13038
  registrationOtpSent && (0, react_jsx_runtime.jsxs)("label", {
12403
13039
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.field,
12404
13040
  children: ["注册验证码", (0, react_jsx_runtime.jsx)("input", {
@@ -12414,13 +13050,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12414
13050
  (0, react_jsx_runtime.jsx)("button", {
12415
13051
  type: "submit",
12416
13052
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.primary,
12417
- disabled: props.pending || props.accessLoading || handle.trim() === "" || phone.trim() === "" || registrationOtpSent && otp.trim() === "",
13053
+ disabled: entryPending || props.pending || props.accessLoading || shortHandleInviteNotice && inviteCode.trim() === "" || handle.trim() === "" || phone.trim() === "" || registrationOtpSent && otp.trim() === "",
12418
13054
  children: registrationOtpSent ? "继续" : "获取验证码"
12419
13055
  }),
12420
13056
  registrationOtpSent && (0, react_jsx_runtime.jsx)("button", {
12421
13057
  type: "button",
12422
13058
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.linkButton,
12423
- disabled: props.pending || retrySeconds > 0,
13059
+ disabled: entryPending || props.pending || retrySeconds > 0,
12424
13060
  onClick: () => {
12425
13061
  requestRegistrationOtp();
12426
13062
  },
@@ -12429,7 +13065,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12429
13065
  shortHandleInviteNotice && (0, react_jsx_runtime.jsx)("div", {
12430
13066
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.inviteNotice,
12431
13067
  role: "alert",
12432
- children: "注册少于5位的handle需要使用邀请码,目前暂不支持自主注册。"
13068
+ children: "此 Handle 注册需要邀请码,请输入后继续。"
12433
13069
  }),
12434
13070
  notice !== null && (0, react_jsx_runtime.jsx)("small", {
12435
13071
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.notice,
@@ -13294,7 +13930,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13294
13930
  function targetOf(conversation) {
13295
13931
  return conversation.kind === "direct" ? {
13296
13932
  kind: "direct",
13297
- peer: conversation.peerDid
13933
+ conversationId: conversation.id
13298
13934
  } : {
13299
13935
  kind: "group",
13300
13936
  group: conversation.groupDid
@@ -13792,14 +14428,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13792
14428
  async beginDeviceJoin() {
13793
14429
  const generation = this.generation;
13794
14430
  const result = await this.withPending("开始加入设备", () => call(() => this.remote.beginDeviceJoin()));
13795
- if (result.ok && this.current(generation)) this.publish({
13796
- ...this.view,
13797
- identityAccess: {
13798
- choice: null,
13799
- joining: true,
13800
- recoveries: []
13801
- }
13802
- });
14431
+ if (result.ok && this.current(generation)) {
14432
+ this.recoveryRevision++;
14433
+ this.accessRequest = void 0;
14434
+ this.publish({
14435
+ ...this.view,
14436
+ identityAccess: {
14437
+ choice: null,
14438
+ joining: true,
14439
+ recoveries: []
14440
+ },
14441
+ accessLoading: false,
14442
+ accessError: null
14443
+ });
14444
+ }
13803
14445
  return result;
13804
14446
  }
13805
14447
  async getDeviceJoinStatus() {
@@ -13920,6 +14562,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13920
14562
  };
13921
14563
  });
13922
14564
  }
14565
+ getIdentityServices() {
14566
+ return call(() => this.remote.getIdentityServices());
14567
+ }
14568
+ updateIdentityServices(request) {
14569
+ return this.withPending("更新身份服务", () => call(() => this.remote.updateIdentityServices(request)));
14570
+ }
14571
+ resumeIdentityServicesUpdate(request) {
14572
+ return this.withPending("继续身份服务更新", () => call(() => this.remote.resumeIdentityServicesUpdate(request)));
14573
+ }
13923
14574
  refreshDeviceManagement() {
13924
14575
  return call(() => this.remote.refreshDeviceManagement());
13925
14576
  }
@@ -13935,6 +14586,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13935
14586
  revokeDevice(request) {
13936
14587
  return this.withPending("撤销设备", () => call(() => this.remote.revokeDevice(request)));
13937
14588
  }
14589
+ retryDeviceManagement(request) {
14590
+ return this.withPending("重试配置管理设备", () => call(() => this.remote.retryDeviceManagement(request)));
14591
+ }
13938
14592
  prepareRootTransfer(request) {
13939
14593
  return this.withPending("准备授予管理权", () => call(() => this.remote.prepareRootTransfer(request)));
13940
14594
  }
@@ -16942,6 +17596,201 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16942
17596
  "verificationIntro": "xQ4iKW_verificationIntro"
16943
17597
  };
16944
17598
  //#endregion
17599
+ //#region lib/types/client/AwikiIdentityServices.js
17600
+ /** Public services editor. Core owns authorization, protected fields and durable writes. */
17601
+ const protectedTypes = /* @__PURE__ */ new Set([
17602
+ "AgentDescription",
17603
+ "ANPHandleService",
17604
+ "ANPMessageService"
17605
+ ]);
17606
+ function AwikiIdentityServices(props) {
17607
+ const [snapshot, setSnapshot] = (0, react.useState)(null);
17608
+ const [error, setError] = (0, react.useState)(null);
17609
+ const [busy, setBusy] = (0, react.useState)(false);
17610
+ const [editing, setEditing] = (0, react.useState)(null);
17611
+ const [existingId, setExistingId] = (0, react.useState)(null);
17612
+ const alive = (0, react.useRef)(false);
17613
+ const writing = (0, react.useRef)(false);
17614
+ const canEdit = snapshot?.canManage === true && !snapshot.pending && !busy;
17615
+ const read = async () => {
17616
+ const result = await props.getIdentityServices();
17617
+ if (!alive.current) return;
17618
+ if (result.ok) setSnapshot(result.value);
17619
+ else {
17620
+ setSnapshot(null);
17621
+ setError(result.error);
17622
+ }
17623
+ };
17624
+ (0, react.useEffect)(() => {
17625
+ alive.current = true;
17626
+ read();
17627
+ return () => {
17628
+ alive.current = false;
17629
+ };
17630
+ }, []);
17631
+ const write = async (services) => {
17632
+ if (writing.current || snapshot?.canManage !== true) return;
17633
+ if (services !== void 0 && snapshot.pending) return;
17634
+ writing.current = true;
17635
+ setBusy(true);
17636
+ setError(null);
17637
+ try {
17638
+ const result = services === void 0 ? await props.resumeIdentityServicesUpdate({ did: snapshot.did }) : await props.updateIdentityServices({
17639
+ did: snapshot.did,
17640
+ services
17641
+ });
17642
+ if (!alive.current) return;
17643
+ if (result.ok) {
17644
+ setSnapshot(result.value);
17645
+ setEditing(null);
17646
+ } else setError(result.error);
17647
+ await read();
17648
+ } finally {
17649
+ writing.current = false;
17650
+ if (alive.current) setBusy(false);
17651
+ }
17652
+ };
17653
+ return (0, react_jsx_runtime.jsxs)("section", {
17654
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.section,
17655
+ "aria-label": "身份服务",
17656
+ children: [
17657
+ (0, react_jsx_runtime.jsxs)("div", {
17658
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.sectionHeading,
17659
+ children: [(0, react_jsx_runtime.jsx)("h4", { children: "身份服务" }), (0, react_jsx_runtime.jsx)("button", {
17660
+ type: "button",
17661
+ disabled: busy,
17662
+ onClick: () => {
17663
+ read();
17664
+ },
17665
+ children: "重新检查服务"
17666
+ })]
17667
+ }),
17668
+ snapshot?.pending && (0, react_jsx_runtime.jsxs)("div", {
17669
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.notice,
17670
+ role: "status",
17671
+ children: [
17672
+ (0, react_jsx_runtime.jsx)("strong", { children: "服务更新尚未确认" }),
17673
+ (0, react_jsx_runtime.jsx)("span", { children: "已保存原更新,关闭或重新打开页面不会重复提交。" }),
17674
+ snapshot.canManage && (0, react_jsx_runtime.jsx)("button", {
17675
+ type: "button",
17676
+ disabled: busy,
17677
+ onClick: () => {
17678
+ write();
17679
+ },
17680
+ children: "继续原服务更新"
17681
+ })
17682
+ ]
17683
+ }),
17684
+ snapshot?.services.map((service) => (0, react_jsx_runtime.jsxs)("article", {
17685
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.card,
17686
+ children: [
17687
+ (0, react_jsx_runtime.jsx)("strong", { children: service.type }),
17688
+ (0, react_jsx_runtime.jsx)("p", { children: service.id }),
17689
+ (0, react_jsx_runtime.jsx)("p", { children: service.serviceEndpoint }),
17690
+ protectedTypes.has(service.type) ? (0, react_jsx_runtime.jsx)("small", { children: "系统服务,只读" }) : canEdit && (0, react_jsx_runtime.jsxs)("div", {
17691
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.actions,
17692
+ children: [(0, react_jsx_runtime.jsx)("button", {
17693
+ type: "button",
17694
+ onClick: () => {
17695
+ setExistingId(service.id);
17696
+ setEditing(service);
17697
+ },
17698
+ children: "编辑服务"
17699
+ }), (0, react_jsx_runtime.jsx)("button", {
17700
+ type: "button",
17701
+ onClick: () => {
17702
+ write(snapshot.services.filter((value) => value.id !== service.id));
17703
+ },
17704
+ children: "删除服务"
17705
+ })]
17706
+ })
17707
+ ]
17708
+ }, service.id)),
17709
+ canEdit && (0, react_jsx_runtime.jsx)("button", {
17710
+ type: "button",
17711
+ onClick: () => {
17712
+ setExistingId(null);
17713
+ setEditing({
17714
+ id: `${snapshot.did}#`,
17715
+ type: "",
17716
+ serviceEndpoint: ""
17717
+ });
17718
+ },
17719
+ children: "添加服务"
17720
+ }),
17721
+ canEdit && editing !== null && (0, react_jsx_runtime.jsxs)("form", {
17722
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.card,
17723
+ onSubmit: (event) => {
17724
+ event.preventDefault();
17725
+ const services = existingId === null ? [...snapshot.services, editing] : snapshot.services.map((value) => value.id === existingId ? editing : value);
17726
+ write(services);
17727
+ },
17728
+ children: [
17729
+ (0, react_jsx_runtime.jsxs)("label", {
17730
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.field,
17731
+ children: ["服务标识", (0, react_jsx_runtime.jsx)("input", {
17732
+ "aria-label": "服务标识",
17733
+ value: editing.id,
17734
+ readOnly: existingId !== null,
17735
+ onChange: (event) => {
17736
+ setEditing({
17737
+ ...editing,
17738
+ id: event.target.value
17739
+ });
17740
+ },
17741
+ required: true
17742
+ })]
17743
+ }),
17744
+ (0, react_jsx_runtime.jsxs)("label", {
17745
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.field,
17746
+ children: ["服务类型", (0, react_jsx_runtime.jsx)("input", {
17747
+ "aria-label": "服务类型",
17748
+ value: editing.type,
17749
+ onChange: (event) => {
17750
+ setEditing({
17751
+ ...editing,
17752
+ type: event.target.value
17753
+ });
17754
+ },
17755
+ required: true
17756
+ })]
17757
+ }),
17758
+ (0, react_jsx_runtime.jsxs)("label", {
17759
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.field,
17760
+ children: ["服务地址", (0, react_jsx_runtime.jsx)("input", {
17761
+ "aria-label": "服务地址",
17762
+ value: editing.serviceEndpoint,
17763
+ onChange: (event) => {
17764
+ setEditing({
17765
+ ...editing,
17766
+ serviceEndpoint: event.target.value
17767
+ });
17768
+ },
17769
+ required: true
17770
+ })]
17771
+ }),
17772
+ (0, react_jsx_runtime.jsx)("button", {
17773
+ type: "submit",
17774
+ children: "保存服务"
17775
+ }),
17776
+ (0, react_jsx_runtime.jsx)("button", {
17777
+ type: "button",
17778
+ onClick: () => {
17779
+ setEditing(null);
17780
+ },
17781
+ children: "取消编辑"
17782
+ })
17783
+ ]
17784
+ }),
17785
+ error !== null && (0, react_jsx_runtime.jsx)("p", {
17786
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.error,
17787
+ role: "alert",
17788
+ children: error
17789
+ })
17790
+ ]
17791
+ });
17792
+ }
17793
+ //#endregion
16945
17794
  //#region lib/types/client/AwikiDevices.js
16946
17795
  /** Foreground-only ready-admin device management. SAS remains component-local. */
16947
17796
  const requestStateLabels = {
@@ -17269,7 +18118,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17269
18118
  onClick: () => {
17270
18119
  approve();
17271
18120
  },
17272
- children: "批准为 member"
18121
+ children: "批准加入并自动配置管理权"
17273
18122
  })
17274
18123
  ]
17275
18124
  }),
@@ -17302,9 +18151,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17302
18151
  role: "status",
17303
18152
  children: ["管理能力已发送;目标设备完成接收后会显示为 admin。接受时间:", readableDate(rootReceipt.acceptedAt)]
17304
18153
  }),
17305
- !snapshot.rootTransferSupported && (0, react_jsx_runtime.jsxs)("div", {
18154
+ !snapshot.rootTransferSupported && (snapshot.methodCapabilities?.method === "web" || snapshot.devices.some((device) => device.role === "member" && device.provisioning === void 0)) && (0, react_jsx_runtime.jsxs)("div", {
17306
18155
  className: _dsh_awiki_css_AwikiDevices_module_css_default.notice,
17307
- children: [(0, react_jsx_runtime.jsx)("strong", { children: "管理权转移暂不可用" }), (0, react_jsx_runtime.jsx)("span", { children: "该功能目前只能在配备 Intel 芯片的 Mac 上通过系统身份验证使用。" })]
18156
+ children: [(0, react_jsx_runtime.jsx)("strong", { children: "管理权转移暂不可用" }), (0, react_jsx_runtime.jsx)("span", { children: snapshot.methodCapabilities?.method === "web" ? "Web 身份不支持恢复或管理权转移;首个管理员丢失后无法恢复管理能力。" : "该功能目前只能在配备 Intel 芯片的 Mac 上通过系统身份验证使用。" })]
18157
+ }),
18158
+ snapshot.methodCapabilities?.servicesUpdate === true && props.getIdentityServices !== void 0 && props.updateIdentityServices !== void 0 && props.resumeIdentityServicesUpdate !== void 0 && (0, react_jsx_runtime.jsx)(AwikiIdentityServices, {
18159
+ getIdentityServices: props.getIdentityServices,
18160
+ updateIdentityServices: props.updateIdentityServices,
18161
+ resumeIdentityServicesUpdate: props.resumeIdentityServicesUpdate
17308
18162
  }),
17309
18163
  (0, react_jsx_runtime.jsxs)("section", {
17310
18164
  className: _dsh_awiki_css_AwikiDevices_module_css_default.section,
@@ -17369,7 +18223,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17369
18223
  })
17370
18224
  ]
17371
18225
  }),
17372
- snapshot.rootTransferSupported && !device.isCurrent && device.status === "active" && device.role === "member" && !device.managementReady && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18226
+ device.provisioning !== void 0 && !device.managementReady && (0, react_jsx_runtime.jsxs)("div", {
18227
+ role: "status",
18228
+ children: [
18229
+ device.provisioning.phase === "failed" ? "自动配置失败" : device.provisioning.phase === "waiting" ? "已发送,等待设备接收" : "正在自动配置管理权",
18230
+ "(已尝试 ",
18231
+ device.provisioning.attempts,
18232
+ " 次)",
18233
+ device.provisioning.requiresRejoin && (0, react_jsx_runtime.jsx)("p", { children: "管理权限配置已失效,请撤销此成员设备,再在该设备上退出本地身份(保留数据)后重新加入。" }),
18234
+ device.provisioning.phase === "failed" && !device.provisioning.requiresRejoin && props.retryDeviceManagement !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18235
+ className: _dsh_awiki_css_AwikiDevices_module_css_default.button,
18236
+ type: "button",
18237
+ disabled: props.pending,
18238
+ onClick: () => {
18239
+ props.retryDeviceManagement?.({ deviceRef: device.deviceRef }).then((result) => result.ok ? refresh() : setError(result.error));
18240
+ },
18241
+ children: "重试自动配置"
18242
+ })
18243
+ ]
18244
+ }),
18245
+ device.provisioning === void 0 && snapshot.rootTransferSupported && !device.isCurrent && device.status === "active" && device.role === "member" && !device.managementReady && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
17373
18246
  className: _dsh_awiki_css_AwikiDevices_module_css_default.button,
17374
18247
  type: "button",
17375
18248
  variant: "outline",
@@ -17571,13 +18444,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17571
18444
  active: managing,
17572
18445
  pending: props.pending,
17573
18446
  refreshDeviceManagement: props.refreshDeviceManagement,
18447
+ ...props.getIdentityServices === void 0 ? {} : { getIdentityServices: props.getIdentityServices },
18448
+ ...props.updateIdentityServices === void 0 ? {} : { updateIdentityServices: props.updateIdentityServices },
18449
+ ...props.resumeIdentityServicesUpdate === void 0 ? {} : { resumeIdentityServicesUpdate: props.resumeIdentityServicesUpdate },
17574
18450
  startDeviceJoinVerification: props.startDeviceJoinVerification,
17575
18451
  approveDeviceJoin: props.approveDeviceJoin,
17576
18452
  rejectDeviceJoin: props.rejectDeviceJoin,
17577
18453
  revokeDevice: props.revokeDevice,
18454
+ retryDeviceManagement: props.retryDeviceManagement,
17578
18455
  prepareRootTransfer: props.prepareRootTransfer,
17579
18456
  confirmRootTransfer: props.confirmRootTransfer
17580
- })
18457
+ }, props.identityKey)
17581
18458
  })] });
17582
18459
  }
17583
18460
  //#endregion
@@ -20284,10 +21161,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20284
21161
  identityKey: view.identity?.did ?? null,
20285
21162
  pending: view.pending !== null,
20286
21163
  refreshDeviceManagement: props.refreshDeviceManagement,
21164
+ ...props.getIdentityServices === void 0 ? {} : { getIdentityServices: props.getIdentityServices },
21165
+ ...props.updateIdentityServices === void 0 ? {} : { updateIdentityServices: props.updateIdentityServices },
21166
+ ...props.resumeIdentityServicesUpdate === void 0 ? {} : { resumeIdentityServicesUpdate: props.resumeIdentityServicesUpdate },
20287
21167
  startDeviceJoinVerification: props.startDeviceJoinVerification,
20288
21168
  approveDeviceJoin: props.approveDeviceJoin,
20289
21169
  rejectDeviceJoin: props.rejectDeviceJoin,
20290
21170
  revokeDevice: props.revokeDevice,
21171
+ retryDeviceManagement: props.retryDeviceManagement,
20291
21172
  prepareRootTransfer: props.prepareRootTransfer,
20292
21173
  confirmRootTransfer: props.confirmRootTransfer
20293
21174
  }),
@@ -20853,6 +21734,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20853
21734
  function AwikiUpdates(props) {
20854
21735
  const { snapshot, t } = props;
20855
21736
  const desktop = snapshot.desktop;
21737
+ const scopedDesktop = desktop?.schemaVersion === 2 && !snapshot.value.switching && desktop.tenantId === snapshot.value.activeTenantId && desktop.tenantGeneration === snapshot.value.generation && desktop.policyOrigin === snapshot.value.tenants.find((tenant) => tenant.tenantId === snapshot.value.activeTenantId)?.backendBaseUrl;
20856
21738
  const busy = snapshot.updateStatus === "loading" || snapshot.desktopStatus === "loading";
20857
21739
  return (0, react_jsx_runtime.jsxs)("div", {
20858
21740
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.panel,
@@ -20884,9 +21766,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20884
21766
  (0, react_jsx_runtime.jsx)("p", {
20885
21767
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20886
21768
  role: "status",
20887
- children: t(snapshot.desktopStatus === "unavailable" || desktop.state === "failed" ? "updateFailed" : desktop.state === "checking" || snapshot.desktopStatus === "loading" ? "updateLoading" : desktop.state === "unchecked" ? "updateUnchecked" : desktop.noRelease ? "desktopNoRelease" : desktop.updateAvailable ? "updateAvailable" : "updateLatest", { version: desktop.latestVersion })
21769
+ children: t(desktop.schemaVersion === 1 ? "desktopLegacyUpdate" : snapshot.value.switching ? "tenantSwitching" : desktop.state === "unavailable" ? "updateNoPolicy" : snapshot.desktopStatus === "unavailable" || desktop.state === "failed" ? "updateFailed" : desktop.state === "checking" || snapshot.desktopStatus === "loading" ? "updateLoading" : desktop.state === "unchecked" ? "updateUnchecked" : desktop.noRelease ? "desktopNoRelease" : desktop.updateAvailable ? "updateAvailable" : "updateLatest", { version: desktop.latestVersion })
20888
21770
  }),
20889
- desktop.latestVersion !== void 0 && !desktop.noRelease && (0, react_jsx_runtime.jsx)("p", {
21771
+ scopedDesktop && desktop.updateAvailable && desktop.latestVersion !== void 0 && !desktop.noRelease && (0, react_jsx_runtime.jsx)("p", {
20890
21772
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20891
21773
  children: t("updateRecommended", { version: desktop.latestVersion })
20892
21774
  }),
@@ -20898,16 +21780,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20898
21780
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20899
21781
  children: t("desktopInstallHelp")
20900
21782
  }),
20901
- (0, react_jsx_runtime.jsx)("a", {
21783
+ scopedDesktop && desktop.downloadPageUrl !== void 0 && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)("a", {
20902
21784
  href: desktop.downloadPageUrl,
20903
21785
  target: "_blank",
20904
21786
  rel: "noopener noreferrer",
20905
21787
  children: t("desktopDownloadPage")
20906
- }),
20907
- (0, react_jsx_runtime.jsx)("code", {
21788
+ }), (0, react_jsx_runtime.jsx)("code", {
20908
21789
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.updateCommand,
20909
21790
  children: desktop.downloadPageUrl
20910
- })
21791
+ })] })
20911
21792
  ]
20912
21793
  }),
20913
21794
  (0, react_jsx_runtime.jsx)(PluginUpdate, { ...props }, `${snapshot.value.activeTenantId}:${snapshot.value.generation}:${snapshot.update?.upgradeCommand ?? ""}:${desktop?.distributionId ?? ""}`)
@@ -20917,15 +21798,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20917
21798
  function PluginUpdate({ snapshot, t }) {
20918
21799
  const [copyState, setCopyState] = (0, react.useState)("idle");
20919
21800
  const tenant = snapshot.value.tenants.find((value) => value.tenantId === snapshot.value.activeTenantId);
20920
- const update = snapshot.update?.tenantId === snapshot.value.activeTenantId ? snapshot.update : void 0;
21801
+ const update = snapshot.update?.tenantId === snapshot.value.activeTenantId && snapshot.update.tenantGeneration === snapshot.value.generation ? snapshot.update : void 0;
20921
21802
  const desktop = snapshot.desktop;
20922
- const command = desktop === void 0 ? update?.upgradeCommand?.replace(/^dsh plugin add /u, "dsh plugin --profile YOUR_PROFILE add ") : update?.upgradeCommand;
21803
+ const isDesktop = desktop !== void 0 || snapshot.desktopPresent === true;
21804
+ const command = !isDesktop && snapshot.desktopStatus === "ready" ? update?.upgradeCommand?.replace(/^dsh plugin add /u, "dsh plugin --profile YOUR_PROFILE add ") : void 0;
20923
21805
  const switching = snapshot.value.switching;
20924
21806
  const state = update?.checkState ?? (update === void 0 ? "unchecked" : update.offline ? "failed" : update.policyUnavailable ? "unavailable" : "ready");
20925
21807
  let desktopResolves = false;
20926
21808
  try {
20927
21809
  const bundled = desktop?.bundledVersions;
20928
- desktopResolves = desktop?.updateAvailable === true && bundled !== void 0 && update?.recommendedPluginVersion !== void 0 && compareVersions(bundled.plugin, update.recommendedPluginVersion) >= 0 && (update.currentModelProxyVersion === void 0 || update.recommendedModelProxyVersion !== void 0 && bundled.modelProxy !== void 0 && compareVersions(bundled.modelProxy, update.recommendedModelProxyVersion) >= 0);
21810
+ desktopResolves = !switching && desktop?.schemaVersion === 2 && desktop.tenantId === snapshot.value.activeTenantId && desktop.tenantGeneration === snapshot.value.generation && desktop.policyOrigin === tenant?.backendBaseUrl && desktop.updateAvailable === true && bundled !== void 0 && update?.recommendedPluginVersion !== void 0 && compareVersions(bundled.plugin, update.recommendedPluginVersion) >= 0 && (update.currentModelProxyVersion === void 0 || update.recommendedModelProxyVersion !== void 0 && bundled.modelProxy !== void 0 && compareVersions(bundled.modelProxy, update.recommendedModelProxyVersion) >= 0);
20929
21811
  } catch {}
20930
21812
  const copy = async () => {
20931
21813
  if (command === void 0 || switching) return;
@@ -20949,7 +21831,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20949
21831
  }),
20950
21832
  (0, react_jsx_runtime.jsx)("p", {
20951
21833
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20952
- children: t("updateCurrent", { version: update?.currentPluginVersion ?? "0.3.11" })
21834
+ children: t("updateCurrent", { version: update?.currentPluginVersion ?? "0.3.16" })
20953
21835
  }),
20954
21836
  update !== void 0 && (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: update.currentModelProxyVersion !== void 0 && (0, react_jsx_runtime.jsx)("p", {
20955
21837
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
@@ -20986,13 +21868,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20986
21868
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20987
21869
  children: t("updateCached")
20988
21870
  }),
20989
- desktop !== void 0 && (0, react_jsx_runtime.jsx)("p", {
21871
+ isDesktop && (0, react_jsx_runtime.jsx)("p", {
20990
21872
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20991
21873
  children: t(desktopResolves ? "desktopResolvesPlugin" : "desktopPluginHelp")
20992
21874
  }),
20993
- state === "ready" && update?.updateAvailable && command === void 0 && (0, react_jsx_runtime.jsx)("p", {
21875
+ !isDesktop && state === "ready" && update?.updateAvailable && command === void 0 && (0, react_jsx_runtime.jsx)("p", {
20994
21876
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20995
- children: t("updateNoCommand")
21877
+ children: t(update.upgradeBlockedReason === "host-incompatible" ? "updateHostRequired" : update.upgradeBlockedReason === "identity-incompatible" ? "updateIdentityIncompatible" : "updateNoCommand")
20996
21878
  }),
20997
21879
  command !== void 0 && !switching && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
20998
21880
  (0, react_jsx_runtime.jsx)("code", {
@@ -21472,13 +22354,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
21472
22354
  active: true,
21473
22355
  pending: awiki.pending !== null,
21474
22356
  refreshDeviceManagement: props.refreshDeviceManagement,
22357
+ ...props.getIdentityServices === void 0 ? {} : { getIdentityServices: props.getIdentityServices },
22358
+ ...props.updateIdentityServices === void 0 ? {} : { updateIdentityServices: props.updateIdentityServices },
22359
+ ...props.resumeIdentityServicesUpdate === void 0 ? {} : { resumeIdentityServicesUpdate: props.resumeIdentityServicesUpdate },
21475
22360
  startDeviceJoinVerification: props.startDeviceJoinVerification,
21476
22361
  approveDeviceJoin: props.approveDeviceJoin,
21477
22362
  rejectDeviceJoin: props.rejectDeviceJoin,
21478
22363
  revokeDevice: props.revokeDevice,
22364
+ retryDeviceManagement: props.retryDeviceManagement,
21479
22365
  prepareRootTransfer: props.prepareRootTransfer,
21480
22366
  confirmRootTransfer: props.confirmRootTransfer
21481
- }) : (0, react_jsx_runtime.jsx)("p", {
22367
+ }, `${tenantSnapshot.status === "ready" ? `${tenantSnapshot.value.activeTenantId}:${tenantSnapshot.value.generation}` : "unavailable"}:${awiki.identity?.did ?? "none"}`) : (0, react_jsx_runtime.jsx)("p", {
21482
22368
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.notice,
21483
22369
  children: props.t("devicesUnavailable")
21484
22370
  })),
@@ -22726,7 +23612,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22726
23612
  desktopNoRelease: "暂未发布适用于当前发行通道的更新。",
22727
23613
  updateAvailable: "有可用更新。",
22728
23614
  updateRequired: "当前组件版本不满足服务要求,请升级或切换服务。",
22729
- updateNoCommand: "该服务暂未提供可用的独立插件升级命令。",
23615
+ updateNoCommand: "当前租户未提供完整的安装兼容信息,请查看安装说明。",
23616
+ updateHostRequired: "当前 DSH 宿主与推荐插件不兼容,请先按安装说明升级 DSH。",
23617
+ updateIdentityIncompatible: "当前 Identity 插件与推荐组合不兼容,请查看安装说明;不会自动降级。",
23618
+ desktopLegacyUpdate: "当前桌面版不支持按租户检查更新,请从当前租户的网站获取新版安装包。",
22730
23619
  updateCopied: "已复制升级命令。",
22731
23620
  updateCopyFailed: "复制失败,请选中上方命令手动复制。",
22732
23621
  updateGuide: "查看发布与安装说明",
@@ -22735,7 +23624,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22735
23624
  desktopUpdateTitle: "DSH Desktop · AWiki",
22736
23625
  desktopDownloadPage: "前往桌面版下载页面",
22737
23626
  desktopInstallHelp: "选择适合电脑的完整安装包,完成安装后重新打开应用。",
22738
- desktopPluginHelp: "桌面用户可前往上方下载页面查看完整桌面版;插件兼容要求由当前服务决定。",
23627
+ desktopPluginHelp: "桌面版通过完整安装包升级内置组件。当前租户未提供能够满足推荐组件要求的整包更新时,请等待兼容版本。",
22739
23628
  desktopResolvesPlugin: "此桌面更新包含满足当前服务推荐版本要求的插件组件。",
22740
23629
  updateModelRestricted: "当前模型组件低于最低支持版本 {minimum},AWiki 模型服务暂不可用。",
22741
23630
  updateTitle: "插件更新",
@@ -22847,7 +23736,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22847
23736
  desktopNoRelease: "No release is currently available for this channel.",
22848
23737
  updateAvailable: "An update is available.",
22849
23738
  updateRequired: "Your component version is unsupported. Update or switch services.",
22850
- updateNoCommand: "This service has not provided an independent plugin upgrade command.",
23739
+ updateNoCommand: "This tenant has not provided complete installation compatibility information. Read the installation guide.",
23740
+ updateHostRequired: "The recommended plugin requires a different DSH host. Upgrade DSH using the installation guide first.",
23741
+ updateIdentityIncompatible: "The installed Identity plugin is incompatible with the recommended combination. Read the installation guide; no downgrade is performed.",
23742
+ desktopLegacyUpdate: "This Desktop version does not support tenant-scoped updates. Get a newer installer from your current tenant’s website.",
22851
23743
  updateCopied: "Upgrade command copied.",
22852
23744
  updateCopyFailed: "Copy failed. Select the command above and copy it manually.",
22853
23745
  updateGuide: "Release and installation guide",
@@ -22856,7 +23748,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22856
23748
  desktopUpdateTitle: "DSH Desktop · AWiki",
22857
23749
  desktopDownloadPage: "Visit Desktop Download Page",
22858
23750
  desktopInstallHelp: "Choose the full installer for your computer, install it, then reopen the app.",
22859
- desktopPluginHelp: "Desktop users can visit the download page above. Plugin requirements belong to the current service.",
23751
+ desktopPluginHelp: "Upgrade bundled components using a complete Desktop installer. If this tenant has no suitable installer, wait for a compatible release.",
22860
23752
  desktopResolvesPlugin: "This Desktop update includes components meeting the current service’s recommended versions.",
22861
23753
  updateModelRestricted: "The model component is below the minimum version {minimum}; the AWiki model service is unavailable.",
22862
23754
  updateTitle: "Plugin updates",
@@ -22902,18 +23794,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22902
23794
  function decodeDesktopDistribution(value) {
22903
23795
  if (typeof value !== "object" || value === null) return void 0;
22904
23796
  const view = value;
22905
- if (view.schemaVersion !== 1 || view.distributionId !== "awiki-dsh-desktop" || typeof view.currentVersion !== "string" || view.channel !== "stable" && view.channel !== "prerelease" || typeof view.downloadPageUrl !== "string" || ![
23797
+ if (view.schemaVersion !== 1 && view.schemaVersion !== 2 || view.distributionId !== "awiki-dsh-desktop" || typeof view.currentVersion !== "string" || view.channel !== "stable" && view.channel !== "prerelease" || view.downloadPageUrl !== void 0 && typeof view.downloadPageUrl !== "string" || ![
22906
23798
  "unchecked",
22907
23799
  "checking",
22908
23800
  "ready",
22909
- "failed"
23801
+ "failed",
23802
+ "unavailable"
22910
23803
  ].includes(String(view.state)) || typeof view.updateAvailable !== "boolean" || typeof view.usedCache !== "boolean" || view.latestVersion !== void 0 && typeof view.latestVersion !== "string" || view.checkedAt !== void 0 && typeof view.checkedAt !== "string" || view.noRelease !== void 0 && typeof view.noRelease !== "boolean") return void 0;
22911
23804
  try {
22912
23805
  assertVersion(view.currentVersion);
23806
+ if (view.schemaVersion === 1) return {
23807
+ schemaVersion: 1,
23808
+ distributionId: "awiki-dsh-desktop",
23809
+ currentVersion: view.currentVersion,
23810
+ channel: view.channel,
23811
+ state: "unavailable",
23812
+ updateAvailable: false,
23813
+ usedCache: false
23814
+ };
23815
+ const hasTenant = view.tenantId !== void 0 || view.policyOrigin !== void 0 || view.tenantGeneration !== void 0;
23816
+ if (hasTenant && (typeof view.tenantId !== "string" || view.tenantId.length === 0 || typeof view.policyOrigin !== "string" || new URL(view.policyOrigin).origin !== view.policyOrigin || new URL(view.policyOrigin).protocol !== "https:" || !Number.isSafeInteger(view.tenantGeneration) || view.tenantGeneration < 0)) return void 0;
23817
+ if (!hasTenant && view.state !== "unavailable") return void 0;
23818
+ if (view.policyRevision !== void 0 && (!Number.isSafeInteger(view.policyRevision) || view.policyRevision < 1)) return void 0;
22913
23819
  if (view.latestVersion !== void 0) assertVersion(view.latestVersion);
22914
23820
  if (view.checkedAt !== void 0 && !Number.isFinite(Date.parse(view.checkedAt))) return void 0;
22915
- const url = new URL(view.downloadPageUrl);
22916
- if (url.protocol !== "https:" || url.username !== "" || url.password !== "") return void 0;
23821
+ if (typeof view.downloadPageUrl === "string") {
23822
+ const url = new URL(view.downloadPageUrl);
23823
+ if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.origin !== view.policyOrigin) return void 0;
23824
+ }
22917
23825
  } catch {
22918
23826
  return;
22919
23827
  }
@@ -22934,11 +23842,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22934
23842
  };
22935
23843
  }
22936
23844
  return {
22937
- schemaVersion: 1,
23845
+ schemaVersion: 2,
22938
23846
  distributionId: "awiki-dsh-desktop",
22939
23847
  currentVersion: view.currentVersion,
22940
23848
  channel: view.channel,
22941
- downloadPageUrl: view.downloadPageUrl,
23849
+ ...typeof view.downloadPageUrl === "string" ? { downloadPageUrl: view.downloadPageUrl } : {},
23850
+ ...typeof view.tenantId === "string" ? {
23851
+ tenantId: view.tenantId,
23852
+ policyOrigin: view.policyOrigin,
23853
+ tenantGeneration: view.tenantGeneration
23854
+ } : {},
23855
+ ...typeof view.policyRevision === "number" ? { policyRevision: view.policyRevision } : {},
22942
23856
  state: view.state,
22943
23857
  updateAvailable: view.updateAvailable,
22944
23858
  usedCache: view.usedCache,
@@ -23060,6 +23974,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23060
23974
  "failed"
23061
23975
  ].includes(String(value.checkState))) return void 0;
23062
23976
  if (value.updateAvailable !== void 0 && typeof value.updateAvailable !== "boolean") return void 0;
23977
+ if (value.upgradeBlockedReason !== void 0 && ![
23978
+ "installation-unverified",
23979
+ "host-incompatible",
23980
+ "identity-incompatible"
23981
+ ].includes(String(value.upgradeBlockedReason))) return void 0;
23063
23982
  return value;
23064
23983
  }
23065
23984
  //#endregion
@@ -23108,7 +24027,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23108
24027
  this.tenantSnapshot = {
23109
24028
  status: connection.isLoopback ? "loading" : "unavailable",
23110
24029
  value: INITIAL_TENANTS,
23111
- updateStatus: connection.isLoopback ? "loading" : "unavailable"
24030
+ updateStatus: connection.isLoopback ? "loading" : "unavailable",
24031
+ desktopStatus: connection.isLoopback ? "loading" : "unavailable"
23112
24032
  };
23113
24033
  this.disposeGeneration = connection.isLoopback ? connection.generation.subscribe(() => {
23114
24034
  this.load();
@@ -23190,14 +24110,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23190
24110
  const value = result.ok ? decodeAwikiTenantRpcView(result.value) : void 0;
23191
24111
  if (value === void 0) throw new Error("AWiki tenant catalog is unavailable");
23192
24112
  const changed = value.activeTenantId !== this.tenantSnapshot.value.activeTenantId || value.generation !== this.tenantSnapshot.value.generation;
23193
- if (changed) this.updateRequestVersion++;
24113
+ if (changed) {
24114
+ this.updateRequestVersion++;
24115
+ this.desktopRequestVersion++;
24116
+ }
23194
24117
  this.publishTenants({
23195
24118
  ...this.tenantSnapshot,
23196
24119
  status: "ready",
23197
24120
  value,
23198
24121
  ...changed ? {
23199
24122
  update: void 0,
23200
- updateStatus: "loading"
24123
+ updateStatus: "loading",
24124
+ desktop: void 0,
24125
+ desktopStatus: "loading"
23201
24126
  } : {}
23202
24127
  });
23203
24128
  } catch {
@@ -23235,7 +24160,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23235
24160
  }
23236
24161
  }
23237
24162
  async loadDesktopUpdate(refresh = false) {
23238
- if (!this.connection.isLoopback || this.disposed) return;
24163
+ if (!this.connection.isLoopback || this.disposed || this.tenantSnapshot.value.switching) return;
24164
+ const tenantId = this.tenantSnapshot.value.activeTenantId;
24165
+ const generation = this.tenantSnapshot.value.generation;
23239
24166
  const request = ++this.desktopRequestVersion;
23240
24167
  if (refresh) this.publishTenants({
23241
24168
  ...this.tenantSnapshot,
@@ -23243,14 +24170,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23243
24170
  });
23244
24171
  try {
23245
24172
  const result = await this.connection.rpc.call(AWIKI_SETTINGS_RPC_CHANNEL, refresh ? AWIKI_SETTINGS_RPC_ENDPOINTS.refreshDesktopUpdate : AWIKI_SETTINGS_RPC_ENDPOINTS.describeDesktopUpdate, {}, this.abort.signal);
23246
- if (this.disposed || request !== this.desktopRequestVersion) return;
24173
+ if (this.disposed || request !== this.desktopRequestVersion || tenantId !== this.tenantSnapshot.value.activeTenantId || generation !== this.tenantSnapshot.value.generation) return;
23247
24174
  if (!result.ok) throw new Error("Desktop update service unavailable");
23248
24175
  const desktop = result.value === null ? void 0 : decodeDesktopDistribution(result.value);
23249
24176
  if (result.value !== null && desktop === void 0) throw new Error("Invalid Desktop update response");
24177
+ if (desktop?.schemaVersion === 2 && desktop.tenantId !== void 0) {
24178
+ const tenant = this.tenantSnapshot.value.tenants.find((value) => value.tenantId === tenantId);
24179
+ if (desktop.tenantId !== tenantId || desktop.tenantGeneration !== generation || desktop.policyOrigin !== tenant?.backendBaseUrl) throw new Error("Desktop update scope mismatch");
24180
+ }
23250
24181
  this.publishTenants({
23251
24182
  ...this.tenantSnapshot,
23252
24183
  desktopStatus: "ready",
23253
- desktop
24184
+ desktop,
24185
+ desktopPresent: desktop !== void 0
23254
24186
  });
23255
24187
  } catch {
23256
24188
  if (!this.disposed && request === this.desktopRequestVersion) this.publishTenants({
@@ -23351,12 +24283,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23351
24283
  if (switching) {
23352
24284
  this.updateRequestVersion++;
23353
24285
  this.tenantRequestVersion++;
24286
+ this.desktopRequestVersion++;
23354
24287
  }
23355
24288
  this.publishTenants({
23356
24289
  ...this.tenantSnapshot,
23357
24290
  ...switching ? {
23358
24291
  update: void 0,
23359
- updateStatus: "loading"
24292
+ updateStatus: "loading",
24293
+ desktop: void 0,
24294
+ desktopStatus: "loading"
23360
24295
  } : {},
23361
24296
  value: {
23362
24297
  ...this.tenantSnapshot.value,
@@ -23376,15 +24311,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23376
24311
  value
23377
24312
  });
23378
24313
  if (switching) {
23379
- await this.loadUpdatePolicy();
23380
- await this.loadUpdatePolicy(true);
24314
+ await Promise.all([this.loadUpdatePolicy(), this.loadDesktopUpdate()]);
24315
+ await Promise.all([this.loadUpdatePolicy(true), this.loadDesktopUpdate(true)]);
23381
24316
  }
23382
24317
  } catch (error) {
23383
24318
  if (!this.disposed) {
23384
24319
  await this.loadTenants();
23385
24320
  if (switching) {
23386
- await this.loadUpdatePolicy();
23387
- this.loadUpdatePolicy(true);
24321
+ await Promise.all([this.loadUpdatePolicy(), this.loadDesktopUpdate()]);
24322
+ this.refreshUpdatePolicy();
23388
24323
  }
23389
24324
  }
23390
24325
  throw error;
@@ -23467,10 +24402,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23467
24402
  beginRecoveryFromDeviceJoin: (request) => awiki.beginRecoveryFromDeviceJoin(request),
23468
24403
  retireDeviceIdentityForRejoin: () => awiki.retireDeviceIdentityForRejoin(),
23469
24404
  refreshDeviceManagement: () => awiki.refreshDeviceManagement(),
24405
+ getIdentityServices: () => awiki.getIdentityServices(),
24406
+ updateIdentityServices: (request) => awiki.updateIdentityServices(request),
24407
+ resumeIdentityServicesUpdate: (request) => awiki.resumeIdentityServicesUpdate(request),
23470
24408
  startDeviceJoinVerification: (request) => awiki.startDeviceJoinVerification(request),
23471
24409
  approveDeviceJoin: (request) => awiki.approveDeviceJoin(request),
23472
24410
  rejectDeviceJoin: (request) => awiki.rejectDeviceJoin(request),
23473
24411
  revokeDevice: (request) => awiki.revokeDevice(request),
24412
+ retryDeviceManagement: (request) => awiki.retryDeviceManagement(request),
23474
24413
  prepareRootTransfer: (request) => awiki.prepareRootTransfer(request),
23475
24414
  confirmRootTransfer: (request) => awiki.confirmRootTransfer(request),
23476
24415
  updateDisplayName: (displayName) => awiki.updateDisplayName(displayName),
@@ -23544,10 +24483,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23544
24483
  drafts: awiki.drafts,
23545
24484
  loadAwiki: () => awiki.open(),
23546
24485
  refreshDeviceManagement: () => awiki.refreshDeviceManagement(),
24486
+ getIdentityServices: () => awiki.getIdentityServices(),
24487
+ updateIdentityServices: (request) => awiki.updateIdentityServices(request),
24488
+ resumeIdentityServicesUpdate: (request) => awiki.resumeIdentityServicesUpdate(request),
23547
24489
  startDeviceJoinVerification: (request) => awiki.startDeviceJoinVerification(request),
23548
24490
  approveDeviceJoin: (request) => awiki.approveDeviceJoin(request),
23549
24491
  rejectDeviceJoin: (request) => awiki.rejectDeviceJoin(request),
23550
24492
  revokeDevice: (request) => awiki.revokeDevice(request),
24493
+ retryDeviceManagement: (request) => awiki.retryDeviceManagement(request),
23551
24494
  prepareRootTransfer: (request) => awiki.prepareRootTransfer(request),
23552
24495
  confirmRootTransfer: (request) => awiki.confirmRootTransfer(request),
23553
24496
  loadIntegration: async () => {