@awiki/dsh-plugin 0.3.11-rc.1 → 0.3.11-rc.2

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 (80) hide show
  1. package/README.md +12 -4
  2. package/README.zh.md +9 -3
  3. package/lib/client.js +748 -146
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +391 -101
  6. package/lib/provider.js +32 -2
  7. package/lib/{sdk-adapter-CYcJH7sM.mjs → sdk-adapter-DpqT2en9.mjs} +17 -7
  8. package/lib/typert.host.js +181 -117
  9. package/lib/typert.remote-client.d.ts +3 -1
  10. package/lib/typert.remote-client.d.ts.map +1 -1
  11. package/lib/typert.remote-client.js +181 -117
  12. package/lib/types/base64.d.ts +4 -0
  13. package/lib/types/base64.d.ts.map +1 -0
  14. package/lib/types/base64.js +28 -0
  15. package/lib/types/base64.js.map +1 -0
  16. package/lib/types/client/AwikiIdentityAccess.d.ts.map +1 -1
  17. package/lib/types/client/AwikiIdentityAccess.js +55 -34
  18. package/lib/types/client/AwikiIdentityAccess.js.map +1 -1
  19. package/lib/types/client/AwikiMail.d.ts +1 -1
  20. package/lib/types/client/AwikiMail.d.ts.map +1 -1
  21. package/lib/types/client/AwikiMail.js +139 -6
  22. package/lib/types/client/AwikiMail.js.map +1 -1
  23. package/lib/types/client/AwikiOverlay.js +1 -1
  24. package/lib/types/client/AwikiOverlay.js.map +1 -1
  25. package/lib/types/client/controller.d.ts +7 -1
  26. package/lib/types/client/controller.d.ts.map +1 -1
  27. package/lib/types/client/controller.js +29 -1
  28. package/lib/types/client/controller.js.map +1 -1
  29. package/lib/types/client/index.d.ts.map +1 -1
  30. package/lib/types/client/index.js +2 -0
  31. package/lib/types/client/index.js.map +1 -1
  32. package/lib/types/client/mail-attachment.d.ts +40 -0
  33. package/lib/types/client/mail-attachment.d.ts.map +1 -0
  34. package/lib/types/client/mail-attachment.js +187 -0
  35. package/lib/types/client/mail-attachment.js.map +1 -0
  36. package/lib/types/client/slots.d.ts +5 -1
  37. package/lib/types/client/slots.d.ts.map +1 -1
  38. package/lib/types/external-http-auth.d.ts +3 -1
  39. package/lib/types/external-http-auth.d.ts.map +1 -1
  40. package/lib/types/external-http-auth.js +2 -2
  41. package/lib/types/external-http-auth.js.map +1 -1
  42. package/lib/types/identity-handle.d.ts +5 -0
  43. package/lib/types/identity-handle.d.ts.map +1 -0
  44. package/lib/types/identity-handle.js +33 -0
  45. package/lib/types/identity-handle.js.map +1 -0
  46. package/lib/types/index.d.ts +10 -2
  47. package/lib/types/index.d.ts.map +1 -1
  48. package/lib/types/index.js +81 -26
  49. package/lib/types/index.js.map +1 -1
  50. package/lib/types/mail-attachment-client.d.ts +14 -0
  51. package/lib/types/mail-attachment-client.d.ts.map +1 -0
  52. package/lib/types/mail-attachment-client.js +173 -0
  53. package/lib/types/mail-attachment-client.js.map +1 -0
  54. package/lib/types/mail.d.ts +28 -2
  55. package/lib/types/mail.d.ts.map +1 -1
  56. package/lib/types/mail.js +79 -2
  57. package/lib/types/mail.js.map +1 -1
  58. package/lib/types/package-version.generated.d.ts +1 -1
  59. package/lib/types/package-version.generated.js +1 -1
  60. package/lib/types/provider.d.ts +1 -1
  61. package/lib/types/provider.d.ts.map +1 -1
  62. package/lib/types/provider.js +12 -1
  63. package/lib/types/provider.js.map +1 -1
  64. package/lib/types/registration-policy.d.ts +1 -3
  65. package/lib/types/registration-policy.d.ts.map +1 -1
  66. package/lib/types/registration-policy.js +1 -9
  67. package/lib/types/registration-policy.js.map +1 -1
  68. package/lib/types/sdk-adapter.d.ts +2 -1
  69. package/lib/types/sdk-adapter.d.ts.map +1 -1
  70. package/lib/types/sdk-adapter.js +13 -4
  71. package/lib/types/sdk-adapter.js.map +1 -1
  72. package/lib/types/tools.d.ts +1 -1
  73. package/lib/types/tools.d.ts.map +1 -1
  74. package/lib/types/tools.js +20 -4
  75. package/lib/types/tools.js.map +1 -1
  76. package/lib/types/types.d.ts +39 -2
  77. package/lib/types/types.d.ts.map +1 -1
  78. package/lib/types/types.js.map +1 -1
  79. package/lib/types/update-policy.d.ts +1 -1
  80. package/package.json +4 -4
package/lib/client.js CHANGED
@@ -588,7 +588,7 @@ window.__ModuleLoader__.load({
588
588
  const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
589
589
  const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
590
590
  const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
591
- const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
591
+ const base64$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
592
592
  const base64url = /^[A-Za-z0-9_-]*$/;
593
593
  const httpProtocol = /^https?$/;
594
594
  const e164 = /^\+[1-9]\d{6,14}$/;
@@ -1325,7 +1325,7 @@ window.__ModuleLoader__.load({
1325
1325
  }
1326
1326
  }
1327
1327
  const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
1328
- def.pattern ?? (def.pattern = base64);
1328
+ def.pattern ?? (def.pattern = base64$1);
1329
1329
  $ZodStringFormat.init(inst, def);
1330
1330
  inst._zod.bag.contentEncoding = "base64";
1331
1331
  inst._zod.check = (payload) => {
@@ -4114,6 +4114,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4114
4114
  literal("device-rejoin-required"),
4115
4115
  literal("identity-recovery-required"),
4116
4116
  literal("conflict"),
4117
+ literal("state-in-use"),
4117
4118
  literal("rate-limited"),
4118
4119
  literal("group-membership-required"),
4119
4120
  literal("group-identity-stale"),
@@ -4238,6 +4239,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4238
4239
  literal("device-rejoin-required"),
4239
4240
  literal("identity-recovery-required"),
4240
4241
  literal("conflict"),
4242
+ literal("state-in-use"),
4241
4243
  literal("rate-limited"),
4242
4244
  literal("group-membership-required"),
4243
4245
  literal("group-identity-stale"),
@@ -4310,6 +4312,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4310
4312
  literal("device-rejoin-required"),
4311
4313
  literal("identity-recovery-required"),
4312
4314
  literal("conflict"),
4315
+ literal("state-in-use"),
4313
4316
  literal("rate-limited"),
4314
4317
  literal("group-membership-required"),
4315
4318
  literal("group-identity-stale"),
@@ -4387,6 +4390,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4387
4390
  literal("device-rejoin-required"),
4388
4391
  literal("identity-recovery-required"),
4389
4392
  literal("conflict"),
4393
+ literal("state-in-use"),
4390
4394
  literal("rate-limited"),
4391
4395
  literal("group-membership-required"),
4392
4396
  literal("group-identity-stale"),
@@ -4464,6 +4468,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4464
4468
  literal("device-rejoin-required"),
4465
4469
  literal("identity-recovery-required"),
4466
4470
  literal("conflict"),
4471
+ literal("state-in-use"),
4467
4472
  literal("rate-limited"),
4468
4473
  literal("group-membership-required"),
4469
4474
  literal("group-identity-stale"),
@@ -4529,6 +4534,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4529
4534
  literal("device-rejoin-required"),
4530
4535
  literal("identity-recovery-required"),
4531
4536
  literal("conflict"),
4537
+ literal("state-in-use"),
4532
4538
  literal("rate-limited"),
4533
4539
  literal("group-membership-required"),
4534
4540
  literal("group-identity-stale"),
@@ -4656,6 +4662,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4656
4662
  literal("device-rejoin-required"),
4657
4663
  literal("identity-recovery-required"),
4658
4664
  literal("conflict"),
4665
+ literal("state-in-use"),
4659
4666
  literal("rate-limited"),
4660
4667
  literal("group-membership-required"),
4661
4668
  literal("group-identity-stale"),
@@ -4727,6 +4734,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4727
4734
  literal("device-rejoin-required"),
4728
4735
  literal("identity-recovery-required"),
4729
4736
  literal("conflict"),
4737
+ literal("state-in-use"),
4730
4738
  literal("rate-limited"),
4731
4739
  literal("group-membership-required"),
4732
4740
  literal("group-identity-stale"),
@@ -4803,6 +4811,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4803
4811
  literal("device-rejoin-required"),
4804
4812
  literal("identity-recovery-required"),
4805
4813
  literal("conflict"),
4814
+ literal("state-in-use"),
4806
4815
  literal("rate-limited"),
4807
4816
  literal("group-membership-required"),
4808
4817
  literal("group-identity-stale"),
@@ -4934,6 +4943,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4934
4943
  literal("device-rejoin-required"),
4935
4944
  literal("identity-recovery-required"),
4936
4945
  literal("conflict"),
4946
+ literal("state-in-use"),
4937
4947
  literal("rate-limited"),
4938
4948
  literal("group-membership-required"),
4939
4949
  literal("group-identity-stale"),
@@ -5002,6 +5012,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5002
5012
  literal("device-rejoin-required"),
5003
5013
  literal("identity-recovery-required"),
5004
5014
  literal("conflict"),
5015
+ literal("state-in-use"),
5005
5016
  literal("rate-limited"),
5006
5017
  literal("group-membership-required"),
5007
5018
  literal("group-identity-stale"),
@@ -5057,6 +5068,81 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5057
5068
  "bytesBase64": string().readonly()
5058
5069
  }).readonly()
5059
5070
  })]);
5071
+ const _awiki_dsh_plugin_awiki_downloadMailAttachment_parameter_0$schema = object({
5072
+ "localMessageId": intersection(string(), unknown()).readonly(),
5073
+ "attachmentIndex": number().readonly()
5074
+ });
5075
+ const _awiki_dsh_plugin_awiki_downloadMailAttachment_result$schema = union([object({
5076
+ "ok": literal(false).readonly(),
5077
+ "error": object({
5078
+ "code": union([
5079
+ literal("client-version-unsupported"),
5080
+ literal("not-registered"),
5081
+ literal("signed-out"),
5082
+ literal("already-registered"),
5083
+ literal("invalid-request"),
5084
+ literal("invalid-otp"),
5085
+ literal("challenge-expired"),
5086
+ literal("handle-unavailable"),
5087
+ literal("short-handle-invite-required"),
5088
+ literal("not-found"),
5089
+ literal("forbidden"),
5090
+ literal("device-rejoin-required"),
5091
+ literal("identity-recovery-required"),
5092
+ literal("conflict"),
5093
+ literal("state-in-use"),
5094
+ literal("rate-limited"),
5095
+ literal("group-membership-required"),
5096
+ literal("group-identity-stale"),
5097
+ literal("attachment-too-large"),
5098
+ literal("summary-unavailable"),
5099
+ literal("summary-timeout"),
5100
+ literal("summary-cancelled"),
5101
+ literal("summary-invalid-output"),
5102
+ literal("summary-failed"),
5103
+ literal("delivery-unknown"),
5104
+ literal("network"),
5105
+ literal("remote")
5106
+ ]).readonly(),
5107
+ "message": string().readonly(),
5108
+ "mailRecoveryObservability": object({
5109
+ "current_principal_matches_recovery": boolean().readonly(),
5110
+ "request_generation_classification": union([literal("current"), literal("replaced")]).readonly(),
5111
+ "mail_ingress_classification": union([
5112
+ literal("reached"),
5113
+ literal("not_reached"),
5114
+ literal("unknown")
5115
+ ]).readonly(),
5116
+ "auth_status_class": union([
5117
+ literal("unknown"),
5118
+ literal("accepted"),
5119
+ literal("rejected"),
5120
+ literal("dependency_unavailable")
5121
+ ]).readonly(),
5122
+ "auth_stable_machine_code": string().readonly().optional(),
5123
+ "retryable": boolean().readonly(),
5124
+ "mail_closed_classification": union([
5125
+ literal("unknown"),
5126
+ literal("dependency_unavailable"),
5127
+ literal("success"),
5128
+ literal("authentication_rejected"),
5129
+ literal("no_active_handle"),
5130
+ literal("multiple_active_handles"),
5131
+ literal("no_mailbox"),
5132
+ literal("owner_conflict")
5133
+ ]).readonly()
5134
+ }).readonly().optional()
5135
+ }).readonly()
5136
+ }), object({
5137
+ "ok": literal(true).readonly(),
5138
+ "value": object({
5139
+ "fileName": string().readonly(),
5140
+ "contentType": string().readonly(),
5141
+ "sizeBytes": number().readonly(),
5142
+ "sha256": string().readonly(),
5143
+ "bytesBase64": string().readonly()
5144
+ }).readonly()
5145
+ })]);
5060
5146
  const _awiki_dsh_plugin_awiki_enterRecoveredSession_parameter_0$schema = object({ "operationId": string().readonly() });
5061
5147
  const _awiki_dsh_plugin_awiki_enterRecoveredSession_result$schema = union([object({
5062
5148
  "ok": literal(false).readonly(),
@@ -5076,6 +5162,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5076
5162
  literal("device-rejoin-required"),
5077
5163
  literal("identity-recovery-required"),
5078
5164
  literal("conflict"),
5165
+ literal("state-in-use"),
5079
5166
  literal("rate-limited"),
5080
5167
  literal("group-membership-required"),
5081
5168
  literal("group-identity-stale"),
@@ -5195,6 +5282,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5195
5282
  literal("device-rejoin-required"),
5196
5283
  literal("identity-recovery-required"),
5197
5284
  literal("conflict"),
5285
+ literal("state-in-use"),
5198
5286
  literal("rate-limited"),
5199
5287
  literal("group-membership-required"),
5200
5288
  literal("group-identity-stale"),
@@ -5250,7 +5338,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5250
5338
  "services": object({
5251
5339
  "modelProxy": object({ "enabled": boolean().readonly() }).readonly(),
5252
5340
  "guestGateway": object({ "enabled": boolean().readonly() }).readonly()
5253
- }).readonly()
5341
+ }).readonly(),
5342
+ "mailAttachmentDownloadMaxBytes": number().readonly(),
5343
+ "mailAttachmentMaxCount": number().readonly(),
5344
+ "mailAttachmentMaxBytes": number().readonly(),
5345
+ "mailAttachmentTotalMaxBytes": number().readonly()
5254
5346
  }).readonly()
5255
5347
  })]);
5256
5348
  const _awiki_dsh_plugin_awiki_getConversationPreferences_result$schema = union([object({
@@ -5271,6 +5363,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5271
5363
  literal("device-rejoin-required"),
5272
5364
  literal("identity-recovery-required"),
5273
5365
  literal("conflict"),
5366
+ literal("state-in-use"),
5274
5367
  literal("rate-limited"),
5275
5368
  literal("group-membership-required"),
5276
5369
  literal("group-identity-stale"),
@@ -5356,6 +5449,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5356
5449
  literal("device-rejoin-required"),
5357
5450
  literal("identity-recovery-required"),
5358
5451
  literal("conflict"),
5452
+ literal("state-in-use"),
5359
5453
  literal("rate-limited"),
5360
5454
  literal("group-membership-required"),
5361
5455
  literal("group-identity-stale"),
@@ -5434,6 +5528,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5434
5528
  literal("device-rejoin-required"),
5435
5529
  literal("identity-recovery-required"),
5436
5530
  literal("conflict"),
5531
+ literal("state-in-use"),
5437
5532
  literal("rate-limited"),
5438
5533
  literal("group-membership-required"),
5439
5534
  literal("group-identity-stale"),
@@ -5504,6 +5599,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5504
5599
  literal("device-rejoin-required"),
5505
5600
  literal("identity-recovery-required"),
5506
5601
  literal("conflict"),
5602
+ literal("state-in-use"),
5507
5603
  literal("rate-limited"),
5508
5604
  literal("group-membership-required"),
5509
5605
  literal("group-identity-stale"),
@@ -5581,6 +5677,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5581
5677
  literal("device-rejoin-required"),
5582
5678
  literal("identity-recovery-required"),
5583
5679
  literal("conflict"),
5680
+ literal("state-in-use"),
5584
5681
  literal("rate-limited"),
5585
5682
  literal("group-membership-required"),
5586
5683
  literal("group-identity-stale"),
@@ -5679,6 +5776,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5679
5776
  literal("device-rejoin-required"),
5680
5777
  literal("identity-recovery-required"),
5681
5778
  literal("conflict"),
5779
+ literal("state-in-use"),
5682
5780
  literal("rate-limited"),
5683
5781
  literal("group-membership-required"),
5684
5782
  literal("group-identity-stale"),
@@ -5748,6 +5846,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5748
5846
  literal("device-rejoin-required"),
5749
5847
  literal("identity-recovery-required"),
5750
5848
  literal("conflict"),
5849
+ literal("state-in-use"),
5751
5850
  literal("rate-limited"),
5752
5851
  literal("group-membership-required"),
5753
5852
  literal("group-identity-stale"),
@@ -5884,6 +5983,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5884
5983
  literal("device-rejoin-required"),
5885
5984
  literal("identity-recovery-required"),
5886
5985
  literal("conflict"),
5986
+ literal("state-in-use"),
5887
5987
  literal("rate-limited"),
5888
5988
  literal("group-membership-required"),
5889
5989
  literal("group-identity-stale"),
@@ -5982,6 +6082,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5982
6082
  literal("device-rejoin-required"),
5983
6083
  literal("identity-recovery-required"),
5984
6084
  literal("conflict"),
6085
+ literal("state-in-use"),
5985
6086
  literal("rate-limited"),
5986
6087
  literal("group-membership-required"),
5987
6088
  literal("group-identity-stale"),
@@ -6050,6 +6151,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6050
6151
  literal("device-rejoin-required"),
6051
6152
  literal("identity-recovery-required"),
6052
6153
  literal("conflict"),
6154
+ literal("state-in-use"),
6053
6155
  literal("rate-limited"),
6054
6156
  literal("group-membership-required"),
6055
6157
  literal("group-identity-stale"),
@@ -6122,6 +6224,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6122
6224
  literal("device-rejoin-required"),
6123
6225
  literal("identity-recovery-required"),
6124
6226
  literal("conflict"),
6227
+ literal("state-in-use"),
6125
6228
  literal("rate-limited"),
6126
6229
  literal("group-membership-required"),
6127
6230
  literal("group-identity-stale"),
@@ -6241,6 +6344,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6241
6344
  literal("device-rejoin-required"),
6242
6345
  literal("identity-recovery-required"),
6243
6346
  literal("conflict"),
6347
+ literal("state-in-use"),
6244
6348
  literal("rate-limited"),
6245
6349
  literal("group-membership-required"),
6246
6350
  literal("group-identity-stale"),
@@ -6318,6 +6422,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6318
6422
  literal("device-rejoin-required"),
6319
6423
  literal("identity-recovery-required"),
6320
6424
  literal("conflict"),
6425
+ literal("state-in-use"),
6321
6426
  literal("rate-limited"),
6322
6427
  literal("group-membership-required"),
6323
6428
  literal("group-identity-stale"),
@@ -6386,6 +6491,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6386
6491
  literal("device-rejoin-required"),
6387
6492
  literal("identity-recovery-required"),
6388
6493
  literal("conflict"),
6494
+ literal("state-in-use"),
6389
6495
  literal("rate-limited"),
6390
6496
  literal("group-membership-required"),
6391
6497
  literal("group-identity-stale"),
@@ -6459,6 +6565,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6459
6565
  literal("device-rejoin-required"),
6460
6566
  literal("identity-recovery-required"),
6461
6567
  literal("conflict"),
6568
+ literal("state-in-use"),
6462
6569
  literal("rate-limited"),
6463
6570
  literal("group-membership-required"),
6464
6571
  literal("group-identity-stale"),
@@ -6527,6 +6634,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6527
6634
  literal("device-rejoin-required"),
6528
6635
  literal("identity-recovery-required"),
6529
6636
  literal("conflict"),
6637
+ literal("state-in-use"),
6530
6638
  literal("rate-limited"),
6531
6639
  literal("group-membership-required"),
6532
6640
  literal("group-identity-stale"),
@@ -6618,6 +6726,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6618
6726
  literal("device-rejoin-required"),
6619
6727
  literal("identity-recovery-required"),
6620
6728
  literal("conflict"),
6729
+ literal("state-in-use"),
6621
6730
  literal("rate-limited"),
6622
6731
  literal("group-membership-required"),
6623
6732
  literal("group-identity-stale"),
@@ -6707,6 +6816,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6707
6816
  literal("device-rejoin-required"),
6708
6817
  literal("identity-recovery-required"),
6709
6818
  literal("conflict"),
6819
+ literal("state-in-use"),
6710
6820
  literal("rate-limited"),
6711
6821
  literal("group-membership-required"),
6712
6822
  literal("group-identity-stale"),
@@ -6790,6 +6900,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6790
6900
  literal("device-rejoin-required"),
6791
6901
  literal("identity-recovery-required"),
6792
6902
  literal("conflict"),
6903
+ literal("state-in-use"),
6793
6904
  literal("rate-limited"),
6794
6905
  literal("group-membership-required"),
6795
6906
  literal("group-identity-stale"),
@@ -6867,6 +6978,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6867
6978
  literal("device-rejoin-required"),
6868
6979
  literal("identity-recovery-required"),
6869
6980
  literal("conflict"),
6981
+ literal("state-in-use"),
6870
6982
  literal("rate-limited"),
6871
6983
  literal("group-membership-required"),
6872
6984
  literal("group-identity-stale"),
@@ -6944,6 +7056,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6944
7056
  literal("device-rejoin-required"),
6945
7057
  literal("identity-recovery-required"),
6946
7058
  literal("conflict"),
7059
+ literal("state-in-use"),
6947
7060
  literal("rate-limited"),
6948
7061
  literal("group-membership-required"),
6949
7062
  literal("group-identity-stale"),
@@ -7009,6 +7122,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7009
7122
  literal("device-rejoin-required"),
7010
7123
  literal("identity-recovery-required"),
7011
7124
  literal("conflict"),
7125
+ literal("state-in-use"),
7012
7126
  literal("rate-limited"),
7013
7127
  literal("group-membership-required"),
7014
7128
  literal("group-identity-stale"),
@@ -7078,6 +7192,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7078
7192
  literal("device-rejoin-required"),
7079
7193
  literal("identity-recovery-required"),
7080
7194
  literal("conflict"),
7195
+ literal("state-in-use"),
7081
7196
  literal("rate-limited"),
7082
7197
  literal("group-membership-required"),
7083
7198
  literal("group-identity-stale"),
@@ -7198,6 +7313,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7198
7313
  literal("device-rejoin-required"),
7199
7314
  literal("identity-recovery-required"),
7200
7315
  literal("conflict"),
7316
+ literal("state-in-use"),
7201
7317
  literal("rate-limited"),
7202
7318
  literal("group-membership-required"),
7203
7319
  literal("group-identity-stale"),
@@ -7267,6 +7383,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7267
7383
  literal("device-rejoin-required"),
7268
7384
  literal("identity-recovery-required"),
7269
7385
  literal("conflict"),
7386
+ literal("state-in-use"),
7270
7387
  literal("rate-limited"),
7271
7388
  literal("group-membership-required"),
7272
7389
  literal("group-identity-stale"),
@@ -7357,6 +7474,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7357
7474
  literal("device-rejoin-required"),
7358
7475
  literal("identity-recovery-required"),
7359
7476
  literal("conflict"),
7477
+ literal("state-in-use"),
7360
7478
  literal("rate-limited"),
7361
7479
  literal("group-membership-required"),
7362
7480
  literal("group-identity-stale"),
@@ -7463,6 +7581,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7463
7581
  literal("device-rejoin-required"),
7464
7582
  literal("identity-recovery-required"),
7465
7583
  literal("conflict"),
7584
+ literal("state-in-use"),
7466
7585
  literal("rate-limited"),
7467
7586
  literal("group-membership-required"),
7468
7587
  literal("group-identity-stale"),
@@ -7544,6 +7663,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7544
7663
  literal("device-rejoin-required"),
7545
7664
  literal("identity-recovery-required"),
7546
7665
  literal("conflict"),
7666
+ literal("state-in-use"),
7547
7667
  literal("rate-limited"),
7548
7668
  literal("group-membership-required"),
7549
7669
  literal("group-identity-stale"),
@@ -7625,6 +7745,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7625
7745
  literal("device-rejoin-required"),
7626
7746
  literal("identity-recovery-required"),
7627
7747
  literal("conflict"),
7748
+ literal("state-in-use"),
7628
7749
  literal("rate-limited"),
7629
7750
  literal("group-membership-required"),
7630
7751
  literal("group-identity-stale"),
@@ -7761,6 +7882,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7761
7882
  literal("device-rejoin-required"),
7762
7883
  literal("identity-recovery-required"),
7763
7884
  literal("conflict"),
7885
+ literal("state-in-use"),
7764
7886
  literal("rate-limited"),
7765
7887
  literal("group-membership-required"),
7766
7888
  literal("group-identity-stale"),
@@ -7831,6 +7953,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7831
7953
  literal("device-rejoin-required"),
7832
7954
  literal("identity-recovery-required"),
7833
7955
  literal("conflict"),
7956
+ literal("state-in-use"),
7834
7957
  literal("rate-limited"),
7835
7958
  literal("group-membership-required"),
7836
7959
  literal("group-identity-stale"),
@@ -7950,6 +8073,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7950
8073
  literal("device-rejoin-required"),
7951
8074
  literal("identity-recovery-required"),
7952
8075
  literal("conflict"),
8076
+ literal("state-in-use"),
7953
8077
  literal("rate-limited"),
7954
8078
  literal("group-membership-required"),
7955
8079
  literal("group-identity-stale"),
@@ -8018,6 +8142,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8018
8142
  literal("device-rejoin-required"),
8019
8143
  literal("identity-recovery-required"),
8020
8144
  literal("conflict"),
8145
+ literal("state-in-use"),
8021
8146
  literal("rate-limited"),
8022
8147
  literal("group-membership-required"),
8023
8148
  literal("group-identity-stale"),
@@ -8192,6 +8317,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8192
8317
  literal("device-rejoin-required"),
8193
8318
  literal("identity-recovery-required"),
8194
8319
  literal("conflict"),
8320
+ literal("state-in-use"),
8195
8321
  literal("rate-limited"),
8196
8322
  literal("group-membership-required"),
8197
8323
  literal("group-identity-stale"),
@@ -8272,7 +8398,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8272
8398
  "to": array(string()).readonly(),
8273
8399
  "cc": array(string()).readonly().optional(),
8274
8400
  "subject": string().readonly(),
8275
- "bodyText": string().readonly()
8401
+ "bodyText": string().readonly(),
8402
+ "attachments": array(object({
8403
+ "fileName": string().readonly(),
8404
+ "contentType": string().readonly(),
8405
+ "sizeBytes": number().readonly(),
8406
+ "bytesBase64": string().readonly()
8407
+ })).readonly().optional()
8276
8408
  });
8277
8409
  const _awiki_dsh_plugin_awiki_sendMail_result$schema = union([object({
8278
8410
  "ok": literal(false).readonly(),
@@ -8292,6 +8424,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8292
8424
  literal("device-rejoin-required"),
8293
8425
  literal("identity-recovery-required"),
8294
8426
  literal("conflict"),
8427
+ literal("state-in-use"),
8295
8428
  literal("rate-limited"),
8296
8429
  literal("group-membership-required"),
8297
8430
  literal("group-identity-stale"),
@@ -8364,6 +8497,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8364
8497
  literal("device-rejoin-required"),
8365
8498
  literal("identity-recovery-required"),
8366
8499
  literal("conflict"),
8500
+ literal("state-in-use"),
8367
8501
  literal("rate-limited"),
8368
8502
  literal("group-membership-required"),
8369
8503
  literal("group-identity-stale"),
@@ -8437,6 +8571,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8437
8571
  literal("device-rejoin-required"),
8438
8572
  literal("identity-recovery-required"),
8439
8573
  literal("conflict"),
8574
+ literal("state-in-use"),
8440
8575
  literal("rate-limited"),
8441
8576
  literal("group-membership-required"),
8442
8577
  literal("group-identity-stale"),
@@ -8522,6 +8657,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8522
8657
  literal("device-rejoin-required"),
8523
8658
  literal("identity-recovery-required"),
8524
8659
  literal("conflict"),
8660
+ literal("state-in-use"),
8525
8661
  literal("rate-limited"),
8526
8662
  literal("group-membership-required"),
8527
8663
  literal("group-identity-stale"),
@@ -8617,6 +8753,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8617
8753
  literal("device-rejoin-required"),
8618
8754
  literal("identity-recovery-required"),
8619
8755
  literal("conflict"),
8756
+ literal("state-in-use"),
8620
8757
  literal("rate-limited"),
8621
8758
  literal("group-membership-required"),
8622
8759
  literal("group-identity-stale"),
@@ -8698,6 +8835,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8698
8835
  literal("device-rejoin-required"),
8699
8836
  literal("identity-recovery-required"),
8700
8837
  literal("conflict"),
8838
+ literal("state-in-use"),
8701
8839
  literal("rate-limited"),
8702
8840
  literal("group-membership-required"),
8703
8841
  literal("group-identity-stale"),
@@ -8803,6 +8941,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8803
8941
  literal("device-rejoin-required"),
8804
8942
  literal("identity-recovery-required"),
8805
8943
  literal("conflict"),
8944
+ literal("state-in-use"),
8806
8945
  literal("rate-limited"),
8807
8946
  literal("group-membership-required"),
8808
8947
  literal("group-identity-stale"),
@@ -8889,6 +9028,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8889
9028
  literal("device-rejoin-required"),
8890
9029
  literal("identity-recovery-required"),
8891
9030
  literal("conflict"),
9031
+ literal("state-in-use"),
8892
9032
  literal("rate-limited"),
8893
9033
  literal("group-membership-required"),
8894
9034
  literal("group-identity-stale"),
@@ -9031,6 +9171,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9031
9171
  literal("device-rejoin-required"),
9032
9172
  literal("identity-recovery-required"),
9033
9173
  literal("conflict"),
9174
+ literal("state-in-use"),
9034
9175
  literal("rate-limited"),
9035
9176
  literal("group-membership-required"),
9036
9177
  literal("group-identity-stale"),
@@ -9110,7 +9251,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9110
9251
  },
9111
9252
  sourceLocation: {
9112
9253
  "file": "packages/dsh-awiki/src/index.ts",
9113
- "line": 204,
9254
+ "line": 206,
9114
9255
  "column": 9
9115
9256
  }
9116
9257
  },
@@ -9137,7 +9278,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9137
9278
  },
9138
9279
  sourceLocation: {
9139
9280
  "file": "packages/dsh-awiki/src/index.ts",
9140
- "line": 240,
9281
+ "line": 242,
9141
9282
  "column": 3
9142
9283
  }
9143
9284
  },
@@ -9164,7 +9305,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9164
9305
  },
9165
9306
  sourceLocation: {
9166
9307
  "file": "packages/dsh-awiki/src/index.ts",
9167
- "line": 164,
9308
+ "line": 166,
9168
9309
  "column": 9
9169
9310
  }
9170
9311
  },
@@ -9182,7 +9323,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9182
9323
  },
9183
9324
  sourceLocation: {
9184
9325
  "file": "packages/dsh-awiki/src/index.ts",
9185
- "line": 144,
9326
+ "line": 146,
9186
9327
  "column": 9
9187
9328
  }
9188
9329
  },
@@ -9200,7 +9341,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9200
9341
  },
9201
9342
  sourceLocation: {
9202
9343
  "file": "packages/dsh-awiki/src/index.ts",
9203
- "line": 153,
9344
+ "line": 155,
9204
9345
  "column": 9
9205
9346
  }
9206
9347
  },
@@ -9227,7 +9368,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9227
9368
  },
9228
9369
  sourceLocation: {
9229
9370
  "file": "packages/dsh-awiki/src/index.ts",
9230
- "line": 295,
9371
+ "line": 302,
9231
9372
  "column": 3
9232
9373
  }
9233
9374
  },
@@ -9254,7 +9395,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9254
9395
  },
9255
9396
  sourceLocation: {
9256
9397
  "file": "packages/dsh-awiki/src/index.ts",
9257
- "line": 112,
9398
+ "line": 114,
9258
9399
  "column": 3
9259
9400
  }
9260
9401
  },
@@ -9281,7 +9422,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9281
9422
  },
9282
9423
  sourceLocation: {
9283
9424
  "file": "packages/dsh-awiki/src/index.ts",
9284
- "line": 184,
9425
+ "line": 186,
9285
9426
  "column": 9
9286
9427
  }
9287
9428
  },
@@ -9308,7 +9449,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9308
9449
  },
9309
9450
  sourceLocation: {
9310
9451
  "file": "packages/dsh-awiki/src/index.ts",
9311
- "line": 222,
9452
+ "line": 224,
9312
9453
  "column": 9
9313
9454
  }
9314
9455
  },
@@ -9335,7 +9476,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9335
9476
  },
9336
9477
  sourceLocation: {
9337
9478
  "file": "packages/dsh-awiki/src/index.ts",
9338
- "line": 103,
9479
+ "line": 105,
9339
9480
  "column": 3
9340
9481
  }
9341
9482
  },
@@ -9362,7 +9503,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9362
9503
  },
9363
9504
  sourceLocation: {
9364
9505
  "file": "packages/dsh-awiki/src/index.ts",
9365
- "line": 216,
9506
+ "line": 218,
9366
9507
  "column": 9
9367
9508
  }
9368
9509
  },
@@ -9389,7 +9530,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9389
9530
  },
9390
9531
  sourceLocation: {
9391
9532
  "file": "packages/dsh-awiki/src/index.ts",
9392
- "line": 277,
9533
+ "line": 279,
9534
+ "column": 9
9535
+ }
9536
+ },
9537
+ {
9538
+ id: "@awiki/dsh-plugin#awiki/downloadMailAttachment",
9539
+ service: "awiki",
9540
+ namespace: "awiki",
9541
+ method: "downloadMailAttachment",
9542
+ invocation: { kind: "direct" },
9543
+ parameters: [{
9544
+ name: "request",
9545
+ wire: "request",
9546
+ source: "json",
9547
+ codec: {
9548
+ mode: "strict",
9549
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiMailAttachmentDownloadRequest",
9550
+ schema: _awiki_dsh_plugin_awiki_downloadMailAttachment_parameter_0$schema
9551
+ }
9552
+ }],
9553
+ result: {
9554
+ mode: "strict",
9555
+ typeSymbol: "@awiki/dsh-plugin/types#AwikiResult",
9556
+ schema: _awiki_dsh_plugin_awiki_downloadMailAttachment_result$schema
9557
+ },
9558
+ sourceLocation: {
9559
+ "file": "packages/dsh-awiki/src/index.ts",
9560
+ "line": 297,
9393
9561
  "column": 9
9394
9562
  }
9395
9563
  },
@@ -9416,7 +9584,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9416
9584
  },
9417
9585
  sourceLocation: {
9418
9586
  "file": "packages/dsh-awiki/src/index.ts",
9419
- "line": 213,
9587
+ "line": 215,
9420
9588
  "column": 9
9421
9589
  }
9422
9590
  },
@@ -9434,7 +9602,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9434
9602
  },
9435
9603
  sourceLocation: {
9436
9604
  "file": "packages/dsh-awiki/src/index.ts",
9437
- "line": 97,
9605
+ "line": 99,
9438
9606
  "column": 9
9439
9607
  }
9440
9608
  },
@@ -9452,7 +9620,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9452
9620
  },
9453
9621
  sourceLocation: {
9454
9622
  "file": "packages/dsh-awiki/src/index.ts",
9455
- "line": 246,
9623
+ "line": 248,
9456
9624
  "column": 3
9457
9625
  }
9458
9626
  },
@@ -9470,7 +9638,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9470
9638
  },
9471
9639
  sourceLocation: {
9472
9640
  "file": "packages/dsh-awiki/src/index.ts",
9473
- "line": 150,
9641
+ "line": 152,
9474
9642
  "column": 9
9475
9643
  }
9476
9644
  },
@@ -9497,7 +9665,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9497
9665
  },
9498
9666
  sourceLocation: {
9499
9667
  "file": "packages/dsh-awiki/src/index.ts",
9500
- "line": 234,
9668
+ "line": 236,
9501
9669
  "column": 3
9502
9670
  }
9503
9671
  },
@@ -9524,7 +9692,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9524
9692
  },
9525
9693
  sourceLocation: {
9526
9694
  "file": "packages/dsh-awiki/src/index.ts",
9527
- "line": 225,
9695
+ "line": 227,
9528
9696
  "column": 3
9529
9697
  }
9530
9698
  },
@@ -9551,7 +9719,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9551
9719
  },
9552
9720
  sourceLocation: {
9553
9721
  "file": "packages/dsh-awiki/src/index.ts",
9554
- "line": 257,
9722
+ "line": 259,
9555
9723
  "column": 3
9556
9724
  }
9557
9725
  },
@@ -9569,7 +9737,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9569
9737
  },
9570
9738
  sourceLocation: {
9571
9739
  "file": "packages/dsh-awiki/src/index.ts",
9572
- "line": 118,
9740
+ "line": 120,
9573
9741
  "column": 9
9574
9742
  }
9575
9743
  },
@@ -9587,7 +9755,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9587
9755
  },
9588
9756
  sourceLocation: {
9589
9757
  "file": "packages/dsh-awiki/src/index.ts",
9590
- "line": 147,
9758
+ "line": 149,
9591
9759
  "column": 3
9592
9760
  }
9593
9761
  },
@@ -9605,7 +9773,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9605
9773
  },
9606
9774
  sourceLocation: {
9607
9775
  "file": "packages/dsh-awiki/src/index.ts",
9608
- "line": 100,
9776
+ "line": 102,
9609
9777
  "column": 3
9610
9778
  }
9611
9779
  },
@@ -9632,7 +9800,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9632
9800
  },
9633
9801
  sourceLocation: {
9634
9802
  "file": "packages/dsh-awiki/src/index.ts",
9635
- "line": 260,
9803
+ "line": 262,
9636
9804
  "column": 3
9637
9805
  }
9638
9806
  },
@@ -9650,7 +9818,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9650
9818
  },
9651
9819
  sourceLocation: {
9652
9820
  "file": "packages/dsh-awiki/src/index.ts",
9653
- "line": 280,
9821
+ "line": 282,
9654
9822
  "column": 3
9655
9823
  }
9656
9824
  },
@@ -9668,7 +9836,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9668
9836
  },
9669
9837
  sourceLocation: {
9670
9838
  "file": "packages/dsh-awiki/src/index.ts",
9671
- "line": 192,
9839
+ "line": 194,
9672
9840
  "column": 3
9673
9841
  }
9674
9842
  },
@@ -9695,7 +9863,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9695
9863
  },
9696
9864
  sourceLocation: {
9697
9865
  "file": "packages/dsh-awiki/src/index.ts",
9698
- "line": 207,
9866
+ "line": 209,
9699
9867
  "column": 9
9700
9868
  }
9701
9869
  },
@@ -9713,7 +9881,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9713
9881
  },
9714
9882
  sourceLocation: {
9715
9883
  "file": "packages/dsh-awiki/src/index.ts",
9716
- "line": 121,
9884
+ "line": 123,
9717
9885
  "column": 9
9718
9886
  }
9719
9887
  },
@@ -9740,7 +9908,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9740
9908
  },
9741
9909
  sourceLocation: {
9742
9910
  "file": "packages/dsh-awiki/src/index.ts",
9743
- "line": 130,
9911
+ "line": 132,
9744
9912
  "column": 9
9745
9913
  }
9746
9914
  },
@@ -9767,7 +9935,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9767
9935
  },
9768
9936
  sourceLocation: {
9769
9937
  "file": "packages/dsh-awiki/src/index.ts",
9770
- "line": 228,
9938
+ "line": 230,
9771
9939
  "column": 3
9772
9940
  }
9773
9941
  },
@@ -9794,7 +9962,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9794
9962
  },
9795
9963
  sourceLocation: {
9796
9964
  "file": "packages/dsh-awiki/src/index.ts",
9797
- "line": 231,
9965
+ "line": 233,
9798
9966
  "column": 9
9799
9967
  }
9800
9968
  },
@@ -9822,7 +9990,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9822
9990
  },
9823
9991
  sourceLocation: {
9824
9992
  "file": "packages/dsh-awiki/src/index.ts",
9825
- "line": 254,
9993
+ "line": 256,
9826
9994
  "column": 3
9827
9995
  }
9828
9996
  },
@@ -9849,7 +10017,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9849
10017
  },
9850
10018
  sourceLocation: {
9851
10019
  "file": "packages/dsh-awiki/src/index.ts",
9852
- "line": 237,
10020
+ "line": 239,
9853
10021
  "column": 3
9854
10022
  }
9855
10023
  },
@@ -9877,7 +10045,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9877
10045
  },
9878
10046
  sourceLocation: {
9879
10047
  "file": "packages/dsh-awiki/src/index.ts",
9880
- "line": 283,
10048
+ "line": 285,
9881
10049
  "column": 9
9882
10050
  }
9883
10051
  },
@@ -9895,7 +10063,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9895
10063
  },
9896
10064
  sourceLocation: {
9897
10065
  "file": "packages/dsh-awiki/src/index.ts",
9898
- "line": 127,
10066
+ "line": 129,
9899
10067
  "column": 3
9900
10068
  }
9901
10069
  },
@@ -9922,7 +10090,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9922
10090
  },
9923
10091
  sourceLocation: {
9924
10092
  "file": "packages/dsh-awiki/src/index.ts",
9925
- "line": 124,
10093
+ "line": 126,
9926
10094
  "column": 3
9927
10095
  }
9928
10096
  },
@@ -9949,7 +10117,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9949
10117
  },
9950
10118
  sourceLocation: {
9951
10119
  "file": "packages/dsh-awiki/src/index.ts",
9952
- "line": 268,
10120
+ "line": 270,
9953
10121
  "column": 3
9954
10122
  }
9955
10123
  },
@@ -9976,7 +10144,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9976
10144
  },
9977
10145
  sourceLocation: {
9978
10146
  "file": "packages/dsh-awiki/src/index.ts",
9979
- "line": 289,
10147
+ "line": 291,
9980
10148
  "column": 3
9981
10149
  }
9982
10150
  },
@@ -10003,7 +10171,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10003
10171
  },
10004
10172
  sourceLocation: {
10005
10173
  "file": "packages/dsh-awiki/src/index.ts",
10006
- "line": 201,
10174
+ "line": 203,
10007
10175
  "column": 3
10008
10176
  }
10009
10177
  },
@@ -10030,7 +10198,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10030
10198
  },
10031
10199
  sourceLocation: {
10032
10200
  "file": "packages/dsh-awiki/src/index.ts",
10033
- "line": 179,
10201
+ "line": 181,
10034
10202
  "column": 9
10035
10203
  }
10036
10204
  },
@@ -10057,7 +10225,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10057
10225
  },
10058
10226
  sourceLocation: {
10059
10227
  "file": "packages/dsh-awiki/src/index.ts",
10060
- "line": 286,
10228
+ "line": 288,
10061
10229
  "column": 9
10062
10230
  }
10063
10231
  },
@@ -10075,7 +10243,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10075
10243
  },
10076
10244
  sourceLocation: {
10077
10245
  "file": "packages/dsh-awiki/src/index.ts",
10078
- "line": 156,
10246
+ "line": 158,
10079
10247
  "column": 3
10080
10248
  }
10081
10249
  },
@@ -10102,7 +10270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10102
10270
  },
10103
10271
  sourceLocation: {
10104
10272
  "file": "packages/dsh-awiki/src/index.ts",
10105
- "line": 138,
10273
+ "line": 140,
10106
10274
  "column": 9
10107
10275
  }
10108
10276
  },
@@ -10129,7 +10297,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10129
10297
  },
10130
10298
  sourceLocation: {
10131
10299
  "file": "packages/dsh-awiki/src/index.ts",
10132
- "line": 169,
10300
+ "line": 171,
10133
10301
  "column": 9
10134
10302
  }
10135
10303
  },
@@ -10156,7 +10324,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10156
10324
  },
10157
10325
  sourceLocation: {
10158
10326
  "file": "packages/dsh-awiki/src/index.ts",
10159
- "line": 243,
10327
+ "line": 245,
10160
10328
  "column": 3
10161
10329
  }
10162
10330
  },
@@ -10183,7 +10351,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10183
10351
  },
10184
10352
  sourceLocation: {
10185
10353
  "file": "packages/dsh-awiki/src/index.ts",
10186
- "line": 115,
10354
+ "line": 117,
10187
10355
  "column": 3
10188
10356
  }
10189
10357
  },
@@ -10210,7 +10378,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10210
10378
  },
10211
10379
  sourceLocation: {
10212
10380
  "file": "packages/dsh-awiki/src/index.ts",
10213
- "line": 219,
10381
+ "line": 221,
10214
10382
  "column": 3
10215
10383
  }
10216
10384
  },
@@ -10237,7 +10405,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10237
10405
  },
10238
10406
  sourceLocation: {
10239
10407
  "file": "packages/dsh-awiki/src/index.ts",
10240
- "line": 210,
10408
+ "line": 212,
10241
10409
  "column": 9
10242
10410
  }
10243
10411
  },
@@ -10255,7 +10423,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10255
10423
  },
10256
10424
  sourceLocation: {
10257
10425
  "file": "packages/dsh-awiki/src/index.ts",
10258
- "line": 141,
10426
+ "line": 143,
10259
10427
  "column": 3
10260
10428
  }
10261
10429
  },
@@ -10282,7 +10450,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10282
10450
  },
10283
10451
  sourceLocation: {
10284
10452
  "file": "packages/dsh-awiki/src/index.ts",
10285
- "line": 174,
10453
+ "line": 176,
10286
10454
  "column": 9
10287
10455
  }
10288
10456
  },
@@ -10309,7 +10477,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10309
10477
  },
10310
10478
  sourceLocation: {
10311
10479
  "file": "packages/dsh-awiki/src/index.ts",
10312
- "line": 109,
10480
+ "line": 111,
10313
10481
  "column": 3
10314
10482
  }
10315
10483
  },
@@ -10336,7 +10504,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10336
10504
  },
10337
10505
  sourceLocation: {
10338
10506
  "file": "packages/dsh-awiki/src/index.ts",
10339
- "line": 274,
10507
+ "line": 276,
10340
10508
  "column": 9
10341
10509
  }
10342
10510
  },
@@ -10363,7 +10531,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10363
10531
  },
10364
10532
  sourceLocation: {
10365
10533
  "file": "packages/dsh-awiki/src/index.ts",
10366
- "line": 292,
10534
+ "line": 294,
10367
10535
  "column": 9
10368
10536
  }
10369
10537
  },
@@ -10390,7 +10558,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10390
10558
  },
10391
10559
  sourceLocation: {
10392
10560
  "file": "packages/dsh-awiki/src/index.ts",
10393
- "line": 198,
10561
+ "line": 200,
10394
10562
  "column": 3
10395
10563
  }
10396
10564
  },
@@ -10417,7 +10585,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10417
10585
  },
10418
10586
  sourceLocation: {
10419
10587
  "file": "packages/dsh-awiki/src/index.ts",
10420
- "line": 135,
10588
+ "line": 137,
10421
10589
  "column": 9
10422
10590
  }
10423
10591
  },
@@ -10444,7 +10612,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10444
10612
  },
10445
10613
  sourceLocation: {
10446
10614
  "file": "packages/dsh-awiki/src/index.ts",
10447
- "line": 271,
10615
+ "line": 273,
10448
10616
  "column": 3
10449
10617
  }
10450
10618
  },
@@ -10471,7 +10639,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10471
10639
  },
10472
10640
  sourceLocation: {
10473
10641
  "file": "packages/dsh-awiki/src/index.ts",
10474
- "line": 159,
10642
+ "line": 161,
10475
10643
  "column": 9
10476
10644
  }
10477
10645
  },
@@ -10498,7 +10666,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10498
10666
  },
10499
10667
  sourceLocation: {
10500
10668
  "file": "packages/dsh-awiki/src/index.ts",
10501
- "line": 263,
10669
+ "line": 265,
10502
10670
  "column": 9
10503
10671
  }
10504
10672
  },
@@ -10525,7 +10693,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10525
10693
  },
10526
10694
  sourceLocation: {
10527
10695
  "file": "packages/dsh-awiki/src/index.ts",
10528
- "line": 249,
10696
+ "line": 251,
10529
10697
  "column": 3
10530
10698
  }
10531
10699
  },
@@ -10552,7 +10720,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10552
10720
  },
10553
10721
  sourceLocation: {
10554
10722
  "file": "packages/dsh-awiki/src/index.ts",
10555
- "line": 189,
10723
+ "line": 191,
10556
10724
  "column": 9
10557
10725
  }
10558
10726
  },
@@ -10579,7 +10747,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10579
10747
  },
10580
10748
  sourceLocation: {
10581
10749
  "file": "packages/dsh-awiki/src/index.ts",
10582
- "line": 106,
10750
+ "line": 108,
10583
10751
  "column": 3
10584
10752
  }
10585
10753
  },
@@ -10606,7 +10774,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10606
10774
  },
10607
10775
  sourceLocation: {
10608
10776
  "file": "packages/dsh-awiki/src/index.ts",
10609
- "line": 195,
10777
+ "line": 197,
10610
10778
  "column": 3
10611
10779
  }
10612
10780
  }
@@ -10795,24 +10963,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10795
10963
  }
10796
10964
  //#endregion
10797
10965
  //#region lib/types/registration-policy.js
10798
- /** Product registration policy for invite-only short Handles. */
10966
+ /** Registration presentation and Handle normalization; admission is owned by the server. */
10799
10967
  const SHORT_HANDLE_INVITE_MESSAGE = "注册少于5位的handle需要使用邀请码,目前暂不支持自主注册。";
10800
- const HANDLE_LOCAL_PART = /^(?!-)(?!.*--)[a-z0-9-]{1,63}(?<!-)$/u;
10801
- /** Return the canonical local part when the input has valid WNS local-part syntax. */
10802
- function registrationHandleLocalPart(value) {
10803
- let normalized = value.trim().toLowerCase();
10804
- if (normalized.startsWith("wba://")) normalized = normalized.slice(6);
10805
- const dot = normalized.indexOf(".");
10806
- const localPart = (dot < 0 ? normalized : normalized.slice(0, dot)).trim();
10807
- return HANDLE_LOCAL_PART.test(localPart) ? localPart : void 0;
10808
- }
10809
- /** One- through four-character Handle registrations require the unavailable invitation flow. */
10810
- function shortHandleInviteRequired(value) {
10811
- const localPart = registrationHandleLocalPart(value);
10812
- if (localPart === void 0) return false;
10813
- const length = Array.from(localPart).length;
10814
- return length >= 1 && length <= 4;
10815
- }
10816
10968
  //#endregion
10817
10969
  //#region lib/types/client/otp-cooldown.js
10818
10970
  /** Retain the server cooldown across panel remounts, without persisting OTPs. */
@@ -11519,6 +11671,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11519
11671
  }
11520
11672
  /** Keep phone and OTP values in private browser memory for the duration of this explicit user flow. */
11521
11673
  function AwikiIdentityAccess(props) {
11674
+ const [registrationConfirmation, setRegistrationConfirmation] = (0, react.useState)(null);
11675
+ const registrationInFlight = (0, react.useRef)(false);
11676
+ const [registrationSubmitting, setRegistrationSubmitting] = (0, react.useState)(false);
11522
11677
  const [shortHandleInviteNotice, setShortHandleInviteNotice] = useDraftState("identity:shortHandleInviteNotice", false, false);
11523
11678
  const recoveryCooldown = useRecoveryOtpCooldown();
11524
11679
  const [phone, setPhone] = useDraftState("identity:phone", "");
@@ -11564,6 +11719,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11564
11719
  setRecoveryEntryOpen
11565
11720
  ]);
11566
11721
  const resetIdentityEntry = () => {
11722
+ setRegistrationConfirmation(null);
11567
11723
  setShortHandleInviteNotice(false);
11568
11724
  setOtp("");
11569
11725
  setRegistrationOtpSent(false);
@@ -11613,41 +11769,45 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11613
11769
  if (result !== void 0 && !result.ok) return setError(result.error);
11614
11770
  if (result?.ok && result.value) return;
11615
11771
  setShortHandleInviteNotice(false);
11616
- if (shortHandleInviteRequired(handle)) {
11617
- const inspection = await props.inspectIdentityAccess({ handle: handle.trim() });
11618
- if (!inspection.ok) return setError(inspection.error);
11619
- if (inspection.value.status === "available") {
11620
- setNotice(null);
11621
- setShortHandleInviteNotice(true);
11622
- return;
11623
- }
11624
- }
11625
11772
  await requestRegistrationOtp();
11626
11773
  };
11627
11774
  const completeRegistration = async () => {
11628
- if (!registrationOtpSent) return;
11775
+ if (!registrationOtpSent || registrationConfirmation === null || registrationInFlight.current || props.pending) return;
11776
+ registrationInFlight.current = true;
11777
+ setRegistrationSubmitting(true);
11629
11778
  setError(null);
11630
- const result = await props.registerIdentity({
11631
- phone: phone.trim(),
11632
- handle: handle.trim(),
11633
- otp: otp.trim()
11634
- });
11635
- if (!result.ok) {
11636
- setError(result.error);
11637
- return;
11638
- }
11639
- if (result.value.status === "join-required") {
11640
- setOtp("");
11641
- setJoinContext({
11642
- fullHandle: result.value.fullHandle,
11643
- phone: phone.trim()
11644
- });
11645
- return;
11779
+ try {
11780
+ const result = await props.registerIdentity(registrationConfirmation);
11781
+ setRegistrationConfirmation(null);
11782
+ if (!result.ok) {
11783
+ if (result.failureCode === "short-handle-invite-required") {
11784
+ resetIdentityEntry();
11785
+ setNotice(null);
11786
+ setShortHandleInviteNotice(true);
11787
+ return;
11788
+ }
11789
+ setError(result.error);
11790
+ return;
11791
+ }
11792
+ if (result.value.status === "join-required") {
11793
+ setOtp("");
11794
+ setJoinContext({
11795
+ fullHandle: result.value.fullHandle,
11796
+ phone: phone.trim()
11797
+ });
11798
+ return;
11799
+ }
11800
+ setPhone("");
11801
+ setHandle("");
11802
+ setDeviceRejoinHandle(null);
11803
+ resetIdentityEntry();
11804
+ } catch {
11805
+ setRegistrationConfirmation(null);
11806
+ setError("暂时无法完成身份注册,请重试。");
11807
+ } finally {
11808
+ registrationInFlight.current = false;
11809
+ setRegistrationSubmitting(false);
11646
11810
  }
11647
- setPhone("");
11648
- setHandle("");
11649
- setDeviceRejoinHandle(null);
11650
- resetIdentityEntry();
11651
11811
  };
11652
11812
  (0, react.useEffect)(() => {
11653
11813
  if (props.access === void 0 || props.access === null) return;
@@ -12186,17 +12346,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12186
12346
  ]
12187
12347
  }) });
12188
12348
  }
12189
- return (0, react_jsx_runtime.jsx)(AwikiIdentityPage, {
12349
+ return (0, react_jsx_runtime.jsxs)(AwikiIdentityPage, {
12190
12350
  ...registrationOtpSent ? {
12191
12351
  onBack: resetIdentityEntry,
12192
12352
  backLabel: "修改身份信息"
12193
12353
  } : {},
12194
12354
  backDisabled: props.pending,
12195
- children: (0, react_jsx_runtime.jsxs)("form", {
12355
+ children: [(0, react_jsx_runtime.jsxs)("form", {
12196
12356
  className: _dsh_awiki_css_AwikiIdentityAccess_module_css_default.accessFlow,
12197
12357
  onSubmit: (event) => {
12198
12358
  event.preventDefault();
12199
- registrationOtpSent ? completeRegistration() : requestIdentityOtp();
12359
+ if (props.pending || registrationInFlight.current) return;
12360
+ if (registrationOtpSent) setRegistrationConfirmation({
12361
+ phone: phone.trim(),
12362
+ handle: handle.trim(),
12363
+ otp: otp.trim()
12364
+ });
12365
+ else requestIdentityOtp();
12200
12366
  },
12201
12367
  children: [
12202
12368
  (0, react_jsx_runtime.jsx)("div", {
@@ -12276,7 +12442,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12276
12442
  children: error
12277
12443
  })
12278
12444
  ]
12279
- })
12445
+ }), (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
12446
+ open: registrationConfirmation !== null,
12447
+ title: "确认创建 AWiki 身份",
12448
+ description: "新 Handle 将通过 ANP Identity 创建身份并注册到 AWiki;如果 Handle 已存在,将继续设备加入流程。",
12449
+ closeLabel: "取消",
12450
+ onClose: () => {
12451
+ if (!registrationInFlight.current) setRegistrationConfirmation(null);
12452
+ },
12453
+ footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
12454
+ type: "button",
12455
+ variant: "outline",
12456
+ disabled: registrationSubmitting || props.pending,
12457
+ onClick: () => {
12458
+ if (!registrationInFlight.current) setRegistrationConfirmation(null);
12459
+ },
12460
+ children: "返回修改"
12461
+ }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
12462
+ type: "button",
12463
+ disabled: registrationSubmitting || props.pending,
12464
+ onClick: () => {
12465
+ completeRegistration();
12466
+ },
12467
+ children: registrationSubmitting ? "正在提交…" : "确认并继续"
12468
+ })] }),
12469
+ children: [(0, react_jsx_runtime.jsxs)("p", { children: ["Handle:", registrationConfirmation?.handle] }), (0, react_jsx_runtime.jsx)("p", { children: "身份密钥由本机 ANP Identity 保管。取消不会提交注册或创建身份。" })]
12470
+ })]
12280
12471
  });
12281
12472
  }
12282
12473
  //#endregion
@@ -13562,9 +13753,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13562
13753
  */
13563
13754
  async registerIdentity(request) {
13564
13755
  const generation = this.generation;
13565
- const result = await this.withPending("注册身份", () => call(() => this.remote.registerIdentity(request), registrationFailureMessage));
13756
+ const classified = await this.withPending("注册身份", () => callWithFailureCode(() => this.remote.registerIdentity(request), registrationFailureMessage));
13757
+ const result = !classified.ok && classified.failureCode !== "short-handle-invite-required" ? {
13758
+ ok: false,
13759
+ error: classified.error
13760
+ } : classified;
13566
13761
  if (!result.ok) {
13567
13762
  if (this.current(generation)) await this.refreshIdentityAccess();
13763
+ if (this.current(generation) && result.failureCode === "short-handle-invite-required") this.publish({
13764
+ ...this.view,
13765
+ error: null
13766
+ });
13568
13767
  return result;
13569
13768
  }
13570
13769
  if (!this.current(generation)) return result;
@@ -13959,6 +14158,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13959
14158
  value: void 0
13960
14159
  };
13961
14160
  }
14161
+ /** Return cached browser-safe runtime policy, or load it once on demand. */
14162
+ async getConfig() {
14163
+ if (this.config !== null) return {
14164
+ ok: true,
14165
+ value: this.config
14166
+ };
14167
+ const generation = this.generation;
14168
+ const result = await call(() => this.remote.getConfig(), mailFailureMessage);
14169
+ if (!this.current(generation)) return {
14170
+ ok: false,
14171
+ error: "AWiki 会话已切换"
14172
+ };
14173
+ if (result.ok) this.config = result.value;
14174
+ return result;
14175
+ }
13962
14176
  /** Read the active deployment identity's public mailbox state. */
13963
14177
  getMailAccount() {
13964
14178
  return call(() => this.remote.getMailAccount(), mailFailureMessage);
@@ -13979,6 +14193,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13979
14193
  sendMail(request) {
13980
14194
  return call(() => this.remote.sendMail(request), mailFailureMessage);
13981
14195
  }
14196
+ /** Download one explicitly selected mail attachment without retaining its bytes. */
14197
+ async downloadMailAttachment(request) {
14198
+ if (this.disposed) return {
14199
+ ok: false,
14200
+ error: "AWiki 插件已卸载"
14201
+ };
14202
+ const generation = this.generation;
14203
+ const result = await call(() => this.remote.downloadMailAttachment(request), mailFailureMessage);
14204
+ if (!this.current(generation)) return {
14205
+ ok: false,
14206
+ error: "AWiki 已关闭"
14207
+ };
14208
+ return result;
14209
+ }
13982
14210
  /**
13983
14211
  * Load another page of the conversation roster.
13984
14212
  * @returns successful pagination or one display-safe failure.
@@ -15419,8 +15647,157 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15419
15647
  URL.revokeObjectURL(url);
15420
15648
  }
15421
15649
  //#endregion
15650
+ //#region lib/types/base64.js
15651
+ /** Linear-time standard Base64 syntax validation for bounded binary payloads. */
15652
+ function base64Character(code) {
15653
+ return code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 47;
15654
+ }
15655
+ /** Reject misplaced padding and non-Base64 bytes without recursive regexp matching. */
15656
+ function standardBase64Syntax(value) {
15657
+ if (value.length % 4 !== 0) return false;
15658
+ let dataEnd = value.length;
15659
+ if (dataEnd > 0 && value.charCodeAt(dataEnd - 1) === 61) dataEnd -= 1;
15660
+ if (dataEnd > 0 && value.charCodeAt(dataEnd - 1) === 61) dataEnd -= 1;
15661
+ for (let index = 0; index < dataEnd; index += 1) if (!base64Character(value.charCodeAt(index))) return false;
15662
+ for (let index = dataEnd; index < value.length; index += 1) if (value.charCodeAt(index) !== 61) return false;
15663
+ return true;
15664
+ }
15665
+ //#endregion
15666
+ //#region lib/types/client/mail-attachment.js
15667
+ /** Browser-only mail attachment selection, encoding, integrity, and download helpers. */
15668
+ function invalid(message) {
15669
+ throw new TypeError(message);
15670
+ }
15671
+ function fileName(value) {
15672
+ if (value.length === 0 || value.trim() !== value || value.replace(/[. ]+$/u, "") !== value || value === "." || value === ".." || new TextEncoder().encode(value).byteLength > 255 || /[\\/\p{C}]/u.test(value)) invalid("附件文件名无效。");
15673
+ return value;
15674
+ }
15675
+ function contentType(value) {
15676
+ if (value === "") return "application/octet-stream";
15677
+ if (!/^[A-Za-z0-9!#$&^_.+-]+\/[A-Za-z0-9!#$&^_.+-]+$/u.test(value)) invalid("附件 MIME 类型无效。");
15678
+ return value;
15679
+ }
15680
+ function assertLimits(limits) {
15681
+ if (!Number.isSafeInteger(limits.maxCount) || limits.maxCount < 0 || !Number.isSafeInteger(limits.maxBytes) || limits.maxBytes < 1 || !Number.isSafeInteger(limits.totalMaxBytes) || limits.totalMaxBytes < limits.maxBytes) invalid("邮件附件限制暂不可用。");
15682
+ }
15683
+ function base64(bytes) {
15684
+ let binary = "";
15685
+ const chunkSize = 32768;
15686
+ for (let offset = 0; offset < bytes.length; offset += chunkSize) binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));
15687
+ return btoa(binary);
15688
+ }
15689
+ /** Append browser File references after enforcing the exact Host-owned limits. */
15690
+ function selectMailAttachments(current, selected, limits, createId) {
15691
+ assertLimits(limits);
15692
+ const additions = Array.from(selected, (file) => ({
15693
+ id: createId(),
15694
+ file,
15695
+ fileName: fileName(file.name),
15696
+ contentType: contentType(file.type),
15697
+ sizeBytes: file.size,
15698
+ lastModified: file.lastModified
15699
+ }));
15700
+ const combined = [...current, ...additions];
15701
+ if (combined.length > limits.maxCount) invalid(`邮件最多选择 ${limits.maxCount} 个附件。`);
15702
+ for (const attachment of combined) {
15703
+ if (!Number.isSafeInteger(attachment.sizeBytes) || attachment.sizeBytes < 0) invalid("附件大小无效。");
15704
+ if (attachment.sizeBytes > limits.maxBytes) invalid(`单个附件不能超过 ${limits.maxBytes} bytes。`);
15705
+ }
15706
+ const total = combined.reduce((sum, attachment) => sum + attachment.sizeBytes, 0);
15707
+ if (!Number.isSafeInteger(total) || total > limits.totalMaxBytes) invalid(`附件总大小不能超过 ${limits.totalMaxBytes} bytes。`);
15708
+ return combined;
15709
+ }
15710
+ /** Re-read the same approved File objects and return JSON-safe Remote attachments. */
15711
+ async function encodeMailAttachments(attachments, limits) {
15712
+ selectMailAttachments([], attachments.map((value) => value.file), limits, () => "validation-only");
15713
+ const encoded = [];
15714
+ for (const attachment of attachments) {
15715
+ if (attachment.file.name !== attachment.fileName || contentType(attachment.file.type) !== attachment.contentType || attachment.file.size !== attachment.sizeBytes || attachment.file.lastModified !== attachment.lastModified) invalid(`附件 ${attachment.fileName} 已发生变化,请重新选择。`);
15716
+ let buffer;
15717
+ try {
15718
+ buffer = await attachment.file.arrayBuffer();
15719
+ } catch {
15720
+ invalid(`无法读取附件 ${attachment.fileName},请重新选择。`);
15721
+ }
15722
+ const bytes = new Uint8Array(buffer);
15723
+ if (bytes.byteLength !== attachment.sizeBytes) invalid(`附件 ${attachment.fileName} 的大小已发生变化,请重新选择。`);
15724
+ encoded.push({
15725
+ fileName: attachment.fileName,
15726
+ contentType: attachment.contentType,
15727
+ sizeBytes: bytes.byteLength,
15728
+ bytesBase64: base64(bytes)
15729
+ });
15730
+ }
15731
+ return encoded;
15732
+ }
15733
+ /** Return canonical download metadata only when the service supplied every required field. */
15734
+ function downloadableMailAttachment(value, maxBytes) {
15735
+ if (!Number.isSafeInteger(value.index) || value.index < 0 || value.index > 4294967295) return void 0;
15736
+ if (value.fileName === void 0 || value.contentType === void 0 || value.sizeBytes === void 0) return void 0;
15737
+ if (!/^(?:0|[1-9][0-9]*)$/u.test(value.sizeBytes)) return void 0;
15738
+ const sizeBytes = Number(value.sizeBytes);
15739
+ if (!Number.isSafeInteger(sizeBytes) || sizeBytes < 0 || sizeBytes > maxBytes) return void 0;
15740
+ try {
15741
+ return {
15742
+ index: value.index,
15743
+ fileName: fileName(value.fileName),
15744
+ contentType: contentType(value.contentType),
15745
+ sizeBytes
15746
+ };
15747
+ } catch {
15748
+ return;
15749
+ }
15750
+ }
15751
+ /** Validate exact metadata, canonical Base64, byte length, and SHA-256 before download. */
15752
+ async function prepareMailAttachmentDownload(value, expected, maxBytes) {
15753
+ if (fileName(value.fileName) !== expected.fileName || contentType(value.contentType) !== expected.contentType || value.sizeBytes !== expected.sizeBytes || value.sizeBytes > maxBytes) invalid("下载附件与邮件元数据不一致。");
15754
+ if (!/^[a-f0-9]{64}$/u.test(value.sha256)) invalid("下载附件完整性信息无效。");
15755
+ const expectedEncodedLength = Math.ceil(value.sizeBytes / 3) * 4;
15756
+ if (value.bytesBase64.length !== expectedEncodedLength || value.bytesBase64.length % 4 !== 0 || !standardBase64Syntax(value.bytesBase64)) invalid("下载附件编码无效。");
15757
+ let binary;
15758
+ try {
15759
+ binary = atob(value.bytesBase64);
15760
+ } catch {
15761
+ invalid("下载附件编码无效。");
15762
+ }
15763
+ const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
15764
+ if (bytes.byteLength !== value.sizeBytes || base64(bytes) !== value.bytesBase64) invalid("下载附件大小或编码不一致。");
15765
+ const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes));
15766
+ if (Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("") !== value.sha256) invalid("下载附件完整性校验失败。");
15767
+ return {
15768
+ fileName: expected.fileName,
15769
+ contentType: expected.contentType,
15770
+ bytes
15771
+ };
15772
+ }
15773
+ /** Trigger one download and always revoke the temporary object URL immediately. */
15774
+ function savePreparedMailAttachment(value) {
15775
+ const url = URL.createObjectURL(new Blob([value.bytes], { type: value.contentType }));
15776
+ const anchor = document.createElement("a");
15777
+ try {
15778
+ anchor.href = url;
15779
+ anchor.download = value.fileName;
15780
+ anchor.hidden = true;
15781
+ document.body.append(anchor);
15782
+ anchor.click();
15783
+ } finally {
15784
+ anchor.remove();
15785
+ URL.revokeObjectURL(url);
15786
+ }
15787
+ }
15788
+ /** Execute the exact Browser UI download path: Remote, integrity check, Blob, and save click. */
15789
+ async function downloadAndSaveMailAttachment(download, request, expected, maxBytes, active = () => true) {
15790
+ const result = await download(request);
15791
+ if (!active()) return false;
15792
+ if (!result.ok) invalid(result.error);
15793
+ const prepared = await prepareMailAttachmentDownload(result.value, expected, maxBytes);
15794
+ if (!active()) return false;
15795
+ savePreparedMailAttachment(prepared);
15796
+ return true;
15797
+ }
15798
+ //#endregion
15422
15799
  //#region \0dsh-awiki-css:AwikiMail.module.css.mjs
15423
- const css$3 = ".eMUW5a_mail{background:var(--dsw-alias-bg-layer-1);flex:1;grid-template-columns:240px 320px minmax(420px,1fr);min-height:0;display:grid;position:relative}.eMUW5a_sidebar,.eMUW5a_mailList,.eMUW5a_mailDetail{min-width:0;min-height:0}.eMUW5a_sidebar{border-right:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);flex-direction:column;display:flex}.eMUW5a_accountCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;gap:3px;margin:0 14px 12px;padding:10px 12px;display:grid}.eMUW5a_accountCard small,.eMUW5a_accountCard span{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.eMUW5a_accountCard strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.eMUW5a_accountCard .eMUW5a_accountStatus{color:var(--dsw-alias-state-success-primary)}.eMUW5a_folderNav{gap:4px;padding:0 10px;display:grid}.eMUW5a_folderNav button{min-height:38px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:9px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;padding:0 10px;display:grid}.eMUW5a_folderNav button:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_folderNav button[data-active]{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary)}.eMUW5a_folderNav small{min-width:20px;color:var(--dsw-alias-brand-primary);text-align:right}.eMUW5a_folderRow{color:var(--dsw-alias-label-secondary);border-radius:9px;grid-template-columns:minmax(0,1fr) 38px;display:grid}.eMUW5a_folderRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_folderRow[data-active]{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary)}.eMUW5a_folderRow>button{color:inherit;background:0 0;border-radius:0}.eMUW5a_folderRow>button:hover{background:0 0}.eMUW5a_folderRow>.eMUW5a_composeIconButton{border-radius:8px;grid-template-columns:1fr;place-items:center;gap:0;width:38px;padding:0}.eMUW5a_folderRow>.eMUW5a_composeIconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_mailList{border-right:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);flex-direction:column;display:flex;position:relative}.eMUW5a_listHeader,.eMUW5a_detailHeader{border-bottom:1px solid var(--dsw-alias-border-l1);flex:none;align-items:center;gap:9px;min-height:56px;padding:0 12px;display:flex}.eMUW5a_listHeader>div,.eMUW5a_detailHeader>div{flex-direction:column;flex:1;min-width:0;display:flex}.eMUW5a_listHeader strong,.eMUW5a_detailHeader strong,.eMUW5a_listHeader small,.eMUW5a_detailHeader small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.eMUW5a_listHeader strong,.eMUW5a_detailHeader strong{font-size:13px;line-height:20px}.eMUW5a_listHeader small,.eMUW5a_detailHeader small{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.eMUW5a_listHeader>button,.eMUW5a_detailBack{width:30px;height:30px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;place-items:center;padding:0;display:grid}.eMUW5a_listHeader>button:hover,.eMUW5a_detailBack:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.eMUW5a_listHeader>button:disabled{opacity:.5;cursor:default}.eMUW5a_detailBack{display:none}.eMUW5a_listHeader svg,.eMUW5a_loadingState svg{animation:none}.eMUW5a_listHeader button:disabled svg,.eMUW5a_loadingState svg{animation:1s linear infinite eMUW5a_mail-spin}@keyframes eMUW5a_mail-spin{to{transform:rotate(360deg)}}.eMUW5a_rows{flex:1;min-height:0;padding:6px;overflow:auto}.eMUW5a_mailRow{width:100%;min-height:82px;color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:10px;grid-template-columns:7px minmax(0,1fr) auto;gap:7px;padding:10px 9px;display:grid;position:relative}.eMUW5a_mailRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_mailRow[data-active]{background:var(--dsw-alias-interactive-bg-active)}.eMUW5a_unreadDot{background:0 0;border-radius:50%;align-self:start;width:6px;height:6px;margin-top:7px}.eMUW5a_mailRow[data-unread] .eMUW5a_unreadDot{background:var(--dsw-alias-brand-primary)}.eMUW5a_rowContent{flex-direction:column;gap:2px;min-width:0;display:flex}.eMUW5a_rowTop{align-items:center;gap:8px;display:flex}.eMUW5a_rowTop strong{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;line-height:18px;overflow:hidden}.eMUW5a_mailRow[data-unread] .eMUW5a_rowTop strong,.eMUW5a_mailRow[data-unread] .eMUW5a_rowSubject{font-weight:600}.eMUW5a_rowTop time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:10px;line-height:15px}.eMUW5a_rowSubject,.eMUW5a_rowPreview{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.eMUW5a_rowSubject{color:var(--dsw-alias-label-primary);font-size:12px;line-height:18px}.eMUW5a_rowPreview{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.eMUW5a_rowAttachment{color:var(--dsw-alias-label-tertiary);align-self:end;align-items:center;gap:2px;display:flex}.eMUW5a_rowAttachment small{font-size:10px}.eMUW5a_inlineError,.eMUW5a_detailError{background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;font-size:11px;line-height:16px;display:flex}.eMUW5a_inlineError button{color:inherit;cursor:pointer;background:0 0;border:0;flex:none;text-decoration:underline}.eMUW5a_loadingState,.eMUW5a_emptyState,.eMUW5a_detailEmpty{color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;gap:8px;font-size:12px;display:flex}.eMUW5a_loadingState{pointer-events:none;position:absolute;inset:56px 0 0}.eMUW5a_emptyState{flex-direction:column;min-height:180px}.eMUW5a_emptyState p,.eMUW5a_detailEmpty p{margin:0}.eMUW5a_loadMore{background:var(--dsw-alias-button-elevated-fill);min-height:34px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;border:0;border-radius:9px;margin:7px}.eMUW5a_loadMore:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_mailDetail{background:var(--dsw-alias-bg-layer-1);flex-direction:column;display:flex;position:relative}.eMUW5a_detailEmpty{flex-direction:column;flex:1}.eMUW5a_detailEmpty button{background:var(--dsw-alias-button-primary-fill);min-height:34px;color:var(--dsw-alias-label-primary-inverted);cursor:pointer;border:0;border-radius:9px;padding:0 14px}.eMUW5a_markReadButton{border:1px solid var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;background:0 0;border-radius:8px;flex:none;padding:0 9px;font-size:11px}.eMUW5a_markReadButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_markReadButton:disabled{opacity:.5;cursor:default}.eMUW5a_messageBody{flex:1;min-height:0;padding:22px 24px;overflow:auto}.eMUW5a_messageMeta{border-bottom:1px solid var(--dsw-alias-border-l1);padding-bottom:18px}.eMUW5a_messageMeta h3{overflow-wrap:anywhere;margin:0 0 5px;font-size:18px;line-height:27px}.eMUW5a_messageMeta>time{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.eMUW5a_messageMeta dl{gap:3px;margin:14px 0 0;display:grid}.eMUW5a_messageMeta dl>div{grid-template-columns:48px minmax(0,1fr);gap:8px;font-size:11px;line-height:17px;display:grid}.eMUW5a_messageMeta dt{color:var(--dsw-alias-label-tertiary)}.eMUW5a_messageMeta dd{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:0}.eMUW5a_untrustedNotice{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);border-radius:8px;align-items:center;gap:7px;margin:16px 0;padding:8px 10px;font-size:11px;line-height:16px;display:flex}.eMUW5a_plainBody{min-height:120px;color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:22px}.eMUW5a_truncatedNotice{color:var(--dsw-alias-state-warn-label);margin:14px 0 0;font-size:11px}.eMUW5a_attachments{border-top:1px solid var(--dsw-alias-border-l1);gap:8px;margin-top:22px;padding-top:16px;display:grid}.eMUW5a_attachments h4{margin:0;font-size:12px;line-height:18px}.eMUW5a_attachments>div{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:9px;align-items:center;gap:9px;padding:9px 10px;display:flex}.eMUW5a_attachments>div>span{flex-direction:column;min-width:0;display:flex}.eMUW5a_attachments strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.eMUW5a_attachments small{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:15px}.eMUW5a_notice{z-index:6;box-sizing:border-box;background:var(--dsw-alias-button-primary-fill);max-width:min(360px,100% - 32px);color:var(--dsw-alias-label-primary-inverted);box-shadow:var(--dsw-shadow-lv2);overflow-wrap:anywhere;pointer-events:none;text-align:center;border-radius:9px;padding:10px 14px;font-size:12px;line-height:18px;animation:2.4s both eMUW5a_mail-notice;position:absolute;top:16px;left:50%;transform:translate(-50%)}@keyframes eMUW5a_mail-notice{0%{opacity:0;transform:translate(-50%,-6px)}8%,88%{opacity:1;transform:translate(-50%)}to{opacity:0;transform:translate(-50%,-4px)}}.eMUW5a_composer{flex-direction:column;flex:1;min-height:0;display:flex}.eMUW5a_composeFields{flex-direction:column;flex:1;gap:11px;min-height:0;padding:18px 20px;display:flex;overflow:auto}.eMUW5a_composeFields label{color:var(--dsw-alias-label-secondary);grid-template-rows:max-content max-content;gap:5px;font-size:11px;line-height:16px;display:grid}.eMUW5a_composeFields input,.eMUW5a_composeFields textarea{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;color:var(--dsw-alias-label-primary);font:inherit;resize:vertical;border-radius:9px;padding:8px 10px}.eMUW5a_composeFields input{height:38px}.eMUW5a_composeFields .eMUW5a_bodyField{flex:1;grid-template-rows:max-content minmax(160px,1fr);min-height:160px}.eMUW5a_bodyField textarea{resize:none;min-height:160px}.eMUW5a_composeError{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11px;line-height:16px}.eMUW5a_composeFooter{border-top:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:flex-end;gap:8px;padding:10px 14px;display:flex}.eMUW5a_cancelButton,.eMUW5a_sendButton{cursor:pointer;min-height:34px;font:inherit;border-radius:9px;justify-content:center;align-items:center;gap:6px;padding:0 13px;display:flex}.eMUW5a_cancelButton{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:0 0}.eMUW5a_sendButton{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);border:0}.eMUW5a_cancelButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_sendButton:hover{background:var(--dsw-alias-button-primary-hover)}.eMUW5a_confirmSummary{color:var(--dsw-alias-label-secondary);gap:6px;display:grid}.eMUW5a_confirmSummary p,.eMUW5a_discardText{overflow-wrap:anywhere;margin:0}@media (width<=1119px){.eMUW5a_mail{grid-template-columns:220px minmax(0,1fr)}.eMUW5a_mailList,.eMUW5a_mailDetail{grid-area:1/2}.eMUW5a_mailDetail,.eMUW5a_mail[data-detail-active] .eMUW5a_mailList{display:none}.eMUW5a_mail[data-detail-active] .eMUW5a_mailDetail{display:flex}.eMUW5a_detailBack{display:grid}}@media (width<=719px){.eMUW5a_mail{grid-template-columns:1fr}.eMUW5a_sidebar,.eMUW5a_mailList,.eMUW5a_mailDetail{grid-area:1/1}.eMUW5a_mailList,.eMUW5a_mailDetail,.eMUW5a_mail[data-pane=list] .eMUW5a_sidebar,.eMUW5a_mail[data-pane=detail] .eMUW5a_sidebar{display:none}.eMUW5a_mail[data-pane=list] .eMUW5a_mailList,.eMUW5a_mail[data-pane=detail] .eMUW5a_mailDetail{display:flex}.eMUW5a_messageBody{padding:18px}}@media (prefers-reduced-motion:reduce){.eMUW5a_listHeader button:disabled svg,.eMUW5a_loadingState svg,.eMUW5a_notice{animation:none}}";
15800
+ const css$3 = ".eMUW5a_mail{background:var(--dsw-alias-bg-layer-1);flex:1;grid-template-columns:240px 320px minmax(420px,1fr);min-height:0;display:grid;position:relative}.eMUW5a_sidebar,.eMUW5a_mailList,.eMUW5a_mailDetail{min-width:0;min-height:0}.eMUW5a_sidebar{border-right:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);flex-direction:column;display:flex}.eMUW5a_accountCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;gap:3px;margin:0 14px 12px;padding:10px 12px;display:grid}.eMUW5a_accountCard small,.eMUW5a_accountCard span{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.eMUW5a_accountCard strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.eMUW5a_accountCard .eMUW5a_accountStatus{color:var(--dsw-alias-state-success-primary)}.eMUW5a_folderNav{gap:4px;padding:0 10px;display:grid}.eMUW5a_folderNav button{min-height:38px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:9px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;padding:0 10px;display:grid}.eMUW5a_folderNav button:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_folderNav button[data-active]{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary)}.eMUW5a_folderNav small{min-width:20px;color:var(--dsw-alias-brand-primary);text-align:right}.eMUW5a_folderRow{color:var(--dsw-alias-label-secondary);border-radius:9px;grid-template-columns:minmax(0,1fr) 38px;display:grid}.eMUW5a_folderRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_folderRow[data-active]{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary)}.eMUW5a_folderRow>button{color:inherit;background:0 0;border-radius:0}.eMUW5a_folderRow>button:hover{background:0 0}.eMUW5a_folderRow>.eMUW5a_composeIconButton{border-radius:8px;grid-template-columns:1fr;place-items:center;gap:0;width:38px;padding:0}.eMUW5a_folderRow>.eMUW5a_composeIconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_mailList{border-right:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);flex-direction:column;display:flex;position:relative}.eMUW5a_listHeader,.eMUW5a_detailHeader{border-bottom:1px solid var(--dsw-alias-border-l1);flex:none;align-items:center;gap:9px;min-height:56px;padding:0 12px;display:flex}.eMUW5a_listHeader>div,.eMUW5a_detailHeader>div{flex-direction:column;flex:1;min-width:0;display:flex}.eMUW5a_listHeader strong,.eMUW5a_detailHeader strong,.eMUW5a_listHeader small,.eMUW5a_detailHeader small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.eMUW5a_listHeader strong,.eMUW5a_detailHeader strong{font-size:13px;line-height:20px}.eMUW5a_listHeader small,.eMUW5a_detailHeader small{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.eMUW5a_listHeader>button,.eMUW5a_detailBack{width:30px;height:30px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;place-items:center;padding:0;display:grid}.eMUW5a_listHeader>button:hover,.eMUW5a_detailBack:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.eMUW5a_listHeader>button:disabled{opacity:.5;cursor:default}.eMUW5a_detailBack{display:none}.eMUW5a_listHeader svg,.eMUW5a_loadingState svg{animation:none}.eMUW5a_listHeader button:disabled svg,.eMUW5a_loadingState svg{animation:1s linear infinite eMUW5a_mail-spin}.eMUW5a_listHeader>.eMUW5a_listBack{display:none}@keyframes eMUW5a_mail-spin{to{transform:rotate(360deg)}}.eMUW5a_rows{flex:1;min-height:0;padding:6px;overflow:auto}.eMUW5a_mailRow{width:100%;min-height:82px;color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:10px;grid-template-columns:7px minmax(0,1fr) auto;gap:7px;padding:10px 9px;display:grid;position:relative}.eMUW5a_mailRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_mailRow[data-active]{background:var(--dsw-alias-interactive-bg-active)}.eMUW5a_unreadDot{background:0 0;border-radius:50%;align-self:start;width:6px;height:6px;margin-top:7px}.eMUW5a_mailRow[data-unread] .eMUW5a_unreadDot{background:var(--dsw-alias-brand-primary)}.eMUW5a_rowContent{flex-direction:column;gap:2px;min-width:0;display:flex}.eMUW5a_rowTop{align-items:center;gap:8px;display:flex}.eMUW5a_rowTop strong{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;line-height:18px;overflow:hidden}.eMUW5a_mailRow[data-unread] .eMUW5a_rowTop strong,.eMUW5a_mailRow[data-unread] .eMUW5a_rowSubject{font-weight:600}.eMUW5a_rowTop time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:10px;line-height:15px}.eMUW5a_rowSubject,.eMUW5a_rowPreview{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.eMUW5a_rowSubject{color:var(--dsw-alias-label-primary);font-size:12px;line-height:18px}.eMUW5a_rowPreview{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.eMUW5a_rowAttachment{color:var(--dsw-alias-label-tertiary);align-self:end;align-items:center;gap:2px;display:flex}.eMUW5a_rowAttachment small{font-size:10px}.eMUW5a_inlineError,.eMUW5a_detailError{background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;font-size:11px;line-height:16px;display:flex}.eMUW5a_inlineError button{color:inherit;cursor:pointer;background:0 0;border:0;flex:none;text-decoration:underline}.eMUW5a_loadingState,.eMUW5a_emptyState,.eMUW5a_detailEmpty{color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;gap:8px;font-size:12px;display:flex}.eMUW5a_loadingState{pointer-events:none;position:absolute;inset:56px 0 0}.eMUW5a_emptyState{flex-direction:column;min-height:180px}.eMUW5a_emptyState p,.eMUW5a_detailEmpty p{margin:0}.eMUW5a_loadMore{background:var(--dsw-alias-button-elevated-fill);min-height:34px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;border:0;border-radius:9px;margin:7px}.eMUW5a_loadMore:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_mailDetail{background:var(--dsw-alias-bg-layer-1);flex-direction:column;display:flex;position:relative}.eMUW5a_detailEmpty{flex-direction:column;flex:1}.eMUW5a_detailEmpty button{background:var(--dsw-alias-button-primary-fill);min-height:34px;color:var(--dsw-alias-label-primary-inverted);cursor:pointer;border:0;border-radius:9px;padding:0 14px}.eMUW5a_markReadButton{border:1px solid var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;background:0 0;border-radius:8px;flex:none;padding:0 9px;font-size:11px}.eMUW5a_markReadButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_markReadButton:disabled{opacity:.5;cursor:default}.eMUW5a_messageBody{flex:1;min-height:0;padding:22px 24px;overflow:auto}.eMUW5a_messageMeta{border-bottom:1px solid var(--dsw-alias-border-l1);padding-bottom:18px}.eMUW5a_messageMeta h3{overflow-wrap:anywhere;margin:0 0 5px;font-size:18px;line-height:27px}.eMUW5a_messageMeta>time{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.eMUW5a_messageMeta dl{gap:3px;margin:14px 0 0;display:grid}.eMUW5a_messageMeta dl>div{grid-template-columns:48px minmax(0,1fr);gap:8px;font-size:11px;line-height:17px;display:grid}.eMUW5a_messageMeta dt{color:var(--dsw-alias-label-tertiary)}.eMUW5a_messageMeta dd{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:0}.eMUW5a_untrustedNotice{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);border-radius:8px;align-items:center;gap:7px;margin:16px 0;padding:8px 10px;font-size:11px;line-height:16px;display:flex}.eMUW5a_plainBody{min-height:120px;color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:22px}.eMUW5a_truncatedNotice{color:var(--dsw-alias-state-warn-label);margin:14px 0 0;font-size:11px}.eMUW5a_attachments{border-top:1px solid var(--dsw-alias-border-l1);gap:8px;min-width:0;margin-top:22px;padding-top:16px;display:grid}.eMUW5a_attachments h4{margin:0;font-size:12px;line-height:18px}.eMUW5a_attachments>div{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:9px;align-items:center;gap:9px;min-width:0;max-width:100%;padding:9px 10px;display:flex}.eMUW5a_attachments>div>span{flex-direction:column;flex:1;min-width:0;display:flex}.eMUW5a_attachments strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.eMUW5a_attachments small{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:15px}.eMUW5a_attachments button,.eMUW5a_selectedAttachments button{border:1px solid var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;background:0 0;border-radius:8px;flex:none;padding:0 10px;font-size:11px}.eMUW5a_attachments button:hover,.eMUW5a_selectedAttachments button:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_attachments button:disabled,.eMUW5a_selectedAttachments button:disabled{opacity:.5;cursor:default}.eMUW5a_attachments .eMUW5a_attachmentDownloadError{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere}.eMUW5a_notice{z-index:6;box-sizing:border-box;background:var(--dsw-alias-button-primary-fill);max-width:min(360px,100% - 32px);color:var(--dsw-alias-label-primary-inverted);box-shadow:var(--dsw-shadow-lv2);overflow-wrap:anywhere;pointer-events:none;text-align:center;border-radius:9px;padding:10px 14px;font-size:12px;line-height:18px;animation:2.4s both eMUW5a_mail-notice;position:absolute;top:16px;left:50%;transform:translate(-50%)}@keyframes eMUW5a_mail-notice{0%{opacity:0;transform:translate(-50%,-6px)}8%,88%{opacity:1;transform:translate(-50%)}to{opacity:0;transform:translate(-50%,-4px)}}.eMUW5a_composer{flex-direction:column;flex:1;min-height:0;display:flex}.eMUW5a_composeFields{flex-direction:column;flex:1;gap:11px;min-height:0;padding:18px 20px;display:flex;overflow:auto}.eMUW5a_composeFields label{color:var(--dsw-alias-label-secondary);grid-template-rows:max-content max-content;gap:5px;font-size:11px;line-height:16px;display:grid}.eMUW5a_composeFields input,.eMUW5a_composeFields textarea{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;color:var(--dsw-alias-label-primary);font:inherit;resize:vertical;border-radius:9px;padding:8px 10px}.eMUW5a_composeFields input{height:38px}.eMUW5a_composeFields .eMUW5a_bodyField{flex:1;grid-template-rows:max-content minmax(160px,1fr);min-height:160px}.eMUW5a_bodyField textarea{resize:none;min-height:160px}.eMUW5a_composeAttachments{gap:9px;display:grid}.eMUW5a_attachmentPickerRow{align-items:center;gap:10px;display:flex}.eMUW5a_attachmentPickerRow>small{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:15px}.eMUW5a_attachmentPicker{border:1px solid var(--dsw-alias-border-l2);min-height:32px;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0 11px;display:inline-flex;position:relative;overflow:hidden}.eMUW5a_attachmentPicker:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_attachmentPicker:focus-within{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.eMUW5a_attachmentPicker input{opacity:0;width:1px;height:1px;padding:0;position:absolute}.eMUW5a_attachmentPicker:has(input:disabled){opacity:.5;cursor:default}.eMUW5a_selectedAttachments{gap:7px;display:grid}.eMUW5a_selectedAttachments>div{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:9px;align-items:center;gap:9px;padding:8px 9px;display:flex}.eMUW5a_selectedAttachments>div>span{flex-direction:column;flex:1;min-width:0;display:flex}.eMUW5a_selectedAttachments strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.eMUW5a_selectedAttachments small{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:15px}.eMUW5a_selectedAttachments>p{color:var(--dsw-alias-label-tertiary);margin:0;font-size:10px;line-height:15px}.eMUW5a_composeError{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11px;line-height:16px}.eMUW5a_composeFooter{border-top:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:flex-end;gap:8px;padding:10px 14px;display:flex}.eMUW5a_cancelButton,.eMUW5a_sendButton{cursor:pointer;min-height:34px;font:inherit;border-radius:9px;justify-content:center;align-items:center;gap:6px;padding:0 13px;display:flex}.eMUW5a_cancelButton{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:0 0}.eMUW5a_sendButton{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);border:0}.eMUW5a_cancelButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.eMUW5a_sendButton:hover{background:var(--dsw-alias-button-primary-hover)}.eMUW5a_confirmSummary{color:var(--dsw-alias-label-secondary);gap:6px;display:grid}.eMUW5a_confirmSummary p,.eMUW5a_discardText{overflow-wrap:anywhere;margin:0}@media (width<=1119px){.eMUW5a_mail{grid-template-columns:220px minmax(0,1fr)}.eMUW5a_mailList,.eMUW5a_mailDetail{grid-area:1/2}.eMUW5a_mailDetail,.eMUW5a_mail[data-detail-active] .eMUW5a_mailList{display:none}.eMUW5a_mail[data-detail-active] .eMUW5a_mailDetail{display:flex}.eMUW5a_detailBack{display:grid}}@media (width<=719px){.eMUW5a_mail{grid-template-columns:1fr}.eMUW5a_sidebar,.eMUW5a_mailList,.eMUW5a_mailDetail{grid-area:1/1}.eMUW5a_mailList,.eMUW5a_mailDetail,.eMUW5a_mail[data-pane=list] .eMUW5a_sidebar,.eMUW5a_mail[data-pane=detail] .eMUW5a_sidebar{display:none}.eMUW5a_mail[data-pane=list] .eMUW5a_mailList,.eMUW5a_mail[data-pane=detail] .eMUW5a_mailDetail{display:flex}.eMUW5a_listHeader>.eMUW5a_listBack{display:grid}.eMUW5a_messageBody{padding:18px}}@media (prefers-reduced-motion:reduce){.eMUW5a_listHeader button:disabled svg,.eMUW5a_loadingState svg,.eMUW5a_notice{animation:none}}";
15424
15801
  const tagId$3 = "@awiki/dsh-plugin/AwikiMail.module.css";
15425
15802
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
15426
15803
  const tag = document.createElement("style");
@@ -15432,9 +15809,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15432
15809
  var _dsh_awiki_css_AwikiMail_module_css_default = {
15433
15810
  "accountCard": "eMUW5a_accountCard",
15434
15811
  "accountStatus": "eMUW5a_accountStatus",
15812
+ "attachmentDownloadError": "eMUW5a_attachmentDownloadError",
15813
+ "attachmentPicker": "eMUW5a_attachmentPicker",
15814
+ "attachmentPickerRow": "eMUW5a_attachmentPickerRow",
15435
15815
  "attachments": "eMUW5a_attachments",
15436
15816
  "bodyField": "eMUW5a_bodyField",
15437
15817
  "cancelButton": "eMUW5a_cancelButton",
15818
+ "composeAttachments": "eMUW5a_composeAttachments",
15438
15819
  "composeError": "eMUW5a_composeError",
15439
15820
  "composeFields": "eMUW5a_composeFields",
15440
15821
  "composeFooter": "eMUW5a_composeFooter",
@@ -15450,6 +15831,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15450
15831
  "folderNav": "eMUW5a_folderNav",
15451
15832
  "folderRow": "eMUW5a_folderRow",
15452
15833
  "inlineError": "eMUW5a_inlineError",
15834
+ "listBack": "eMUW5a_listBack",
15453
15835
  "listHeader": "eMUW5a_listHeader",
15454
15836
  "loadingState": "eMUW5a_loadingState",
15455
15837
  "loadMore": "eMUW5a_loadMore",
@@ -15470,6 +15852,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15470
15852
  "rows": "eMUW5a_rows",
15471
15853
  "rowSubject": "eMUW5a_rowSubject",
15472
15854
  "rowTop": "eMUW5a_rowTop",
15855
+ "selectedAttachments": "eMUW5a_selectedAttachments",
15473
15856
  "sendButton": "eMUW5a_sendButton",
15474
15857
  "sidebar": "eMUW5a_sidebar",
15475
15858
  "truncatedNotice": "eMUW5a_truncatedNotice",
@@ -15480,6 +15863,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15480
15863
  //#region lib/types/client/AwikiMail.js
15481
15864
  /** On-demand AWiki mailbox UI. Mail content is always rendered as untrusted text. */
15482
15865
  const MAIL_NOTICE_AUTO_DISMISS_MS = 2400;
15866
+ const EMPTY_MAIL_ATTACHMENTS = Object.freeze([]);
15483
15867
  const MAIL_FOLDER_COPY = {
15484
15868
  inbox: {
15485
15869
  title: "收件箱",
@@ -15515,6 +15899,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15515
15899
  function utf8Bytes(value) {
15516
15900
  return new TextEncoder().encode(value).byteLength;
15517
15901
  }
15902
+ function displayBytes(value) {
15903
+ if (value < 1024) return `${value} bytes`;
15904
+ if (value < 1048576) return `${(value / 1024).toFixed(value < 10240 ? 1 : 0)} KiB`;
15905
+ return `${(value / 1048576).toFixed(value < 10485760 ? 1 : 0)} MiB`;
15906
+ }
15518
15907
  function browserLocalStorage() {
15519
15908
  try {
15520
15909
  return window.localStorage;
@@ -15652,6 +16041,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15652
16041
  const [subject, setSubject] = useDraftState("mail:subject", "");
15653
16042
  const [bodyText, setBodyText] = useDraftState("mail:bodyText", "");
15654
16043
  const [composeError, setComposeError] = useDraftState("mail:composeError", null, false);
16044
+ const [downloadMaxBytes, setDownloadMaxBytes] = (0, react.useState)(0);
16045
+ const [attachmentLimits, setAttachmentLimits] = (0, react.useState)(null);
16046
+ const [attachments, setAttachments] = useDraftState("mail:attachments", EMPTY_MAIL_ATTACHMENTS);
16047
+ const [attachmentError, setAttachmentError] = (0, react.useState)(null);
16048
+ const [downloadStates, setDownloadStates] = (0, react.useState)({});
15655
16049
  const [confirmOpen, setConfirmOpen] = (0, react.useState)(false);
15656
16050
  const [discardOpen, setDiscardOpen] = (0, react.useState)(false);
15657
16051
  const [sending, setSending] = useDraftState("mail:sending", false, false);
@@ -15661,6 +16055,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15661
16055
  const loadGeneration = (0, react.useRef)(0);
15662
16056
  const detailGeneration = (0, react.useRef)(0);
15663
16057
  const noticeRevision = (0, react.useRef)(0);
16058
+ const fileInput = (0, react.useRef)(null);
15664
16059
  (0, react.useEffect)(() => () => {
15665
16060
  loadGeneration.current += 1;
15666
16061
  detailGeneration.current += 1;
@@ -15713,6 +16108,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15713
16108
  setListError(null);
15714
16109
  setNotice(null);
15715
16110
  const cacheVisible = hydrateListCache(requestedFolder);
16111
+ const configRequest = props.getConfig();
15716
16112
  const accountRequest = props.getMailAccount();
15717
16113
  const inboxRequest = props.listMailInbox({
15718
16114
  folder: requestedFolder,
@@ -15720,6 +16116,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15720
16116
  limit: 20,
15721
16117
  offset: 0
15722
16118
  });
16119
+ const configResult = await configRequest;
16120
+ if (generation !== loadGeneration.current) return;
16121
+ setDownloadMaxBytes(configResult.ok ? configResult.value.mailAttachmentDownloadMaxBytes : 0);
16122
+ setAttachmentLimits(configResult.ok ? {
16123
+ maxCount: configResult.value.mailAttachmentMaxCount,
16124
+ maxBytes: configResult.value.mailAttachmentMaxBytes,
16125
+ totalMaxBytes: configResult.value.mailAttachmentTotalMaxBytes
16126
+ } : null);
15723
16127
  const accountResult = await accountRequest;
15724
16128
  if (generation !== loadGeneration.current) return;
15725
16129
  if (accountResult.ok) setAccount(accountResult.value);
@@ -15764,6 +16168,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15764
16168
  setSelectedId(null);
15765
16169
  setMessage(null);
15766
16170
  setDetailError(null);
16171
+ setDownloadStates({});
15767
16172
  if (!hydrateListCache(nextFolder)) applyListPage(nextFolder, {
15768
16173
  items: [],
15769
16174
  hasMore: false
@@ -15776,6 +16181,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15776
16181
  setCompose(false);
15777
16182
  setSelectedId(summary.id);
15778
16183
  setMessage(null);
16184
+ setDownloadStates({});
15779
16185
  setDetailLoading(true);
15780
16186
  setDetailError(null);
15781
16187
  setNotice(null);
@@ -15855,6 +16261,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15855
16261
  showNotice(result.value.updated > 0 ? "已标为已读。" : "该邮件已经是已读状态。");
15856
16262
  };
15857
16263
  const requestSend = () => {
16264
+ if (attachmentError !== null) {
16265
+ setComposeError(attachmentError);
16266
+ return;
16267
+ }
16268
+ if (attachments.length > 0 && attachmentLimits === null) {
16269
+ setComposeError("邮件附件限制暂不可用,请稍后刷新邮箱再试。");
16270
+ return;
16271
+ }
15858
16272
  const validated = validateDraft$1(to, cc, subject, bodyText);
15859
16273
  if (!validated.ok) {
15860
16274
  setComposeError(validated.error);
@@ -15868,6 +16282,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15868
16282
  setCc("");
15869
16283
  setSubject("");
15870
16284
  setBodyText("");
16285
+ setAttachments(EMPTY_MAIL_ATTACHMENTS);
16286
+ setAttachmentError(null);
16287
+ if (fileInput.current !== null) fileInput.current.value = "";
16288
+ setComposeError(null);
16289
+ };
16290
+ const chooseAttachments = (files) => {
16291
+ if (files === null || files.length === 0) return;
16292
+ if (attachmentLimits === null) {
16293
+ setAttachmentError("邮件附件限制暂不可用,请稍后刷新邮箱再试。");
16294
+ return;
16295
+ }
16296
+ try {
16297
+ const next = selectMailAttachments(attachments, files, attachmentLimits, () => crypto.randomUUID());
16298
+ setAttachments(next);
16299
+ setAttachmentError(null);
16300
+ setComposeError(null);
16301
+ } catch (error) {
16302
+ setAttachmentError(error instanceof TypeError ? error.message : "无法选择这些附件。");
16303
+ }
16304
+ };
16305
+ const removeAttachment = (id) => {
16306
+ setAttachments((current) => {
16307
+ const next = current.filter((attachment) => attachment.id !== id);
16308
+ return next.length === 0 ? EMPTY_MAIL_ATTACHMENTS : next;
16309
+ });
16310
+ setAttachmentError(null);
15871
16311
  setComposeError(null);
15872
16312
  };
15873
16313
  const confirmSend = async () => {
@@ -15877,15 +16317,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15877
16317
  setComposeError(validated.error);
15878
16318
  return;
15879
16319
  }
16320
+ if (attachmentError !== null || attachments.length > 0 && attachmentLimits === null) {
16321
+ setConfirmOpen(false);
16322
+ setComposeError(attachmentError ?? "邮件附件限制暂不可用,请稍后刷新邮箱再试。");
16323
+ return;
16324
+ }
16325
+ const generation = detailGeneration.current;
15880
16326
  setSending(true);
16327
+ let encodedAttachments = [];
16328
+ try {
16329
+ if (attachments.length > 0) encodedAttachments = await encodeMailAttachments(attachments, attachmentLimits);
16330
+ } catch (error) {
16331
+ setSending(false);
16332
+ setConfirmOpen(false);
16333
+ setComposeError(error instanceof TypeError ? error.message : "无法读取附件,请重新选择后再试。");
16334
+ return;
16335
+ }
16336
+ if (generation !== detailGeneration.current) {
16337
+ setSending(false);
16338
+ return;
16339
+ }
15881
16340
  const request = {
15882
16341
  to: validated.value.to,
15883
16342
  cc: validated.value.cc,
15884
16343
  subject: validated.value.subject,
15885
- bodyText: validated.value.bodyText
16344
+ bodyText: validated.value.bodyText,
16345
+ ...encodedAttachments.length === 0 ? {} : { attachments: encodedAttachments }
15886
16346
  };
15887
16347
  const result = await props.sendMail(request);
15888
16348
  setSending(false);
16349
+ if (generation !== detailGeneration.current) return;
15889
16350
  setConfirmOpen(false);
15890
16351
  if (!result.ok) {
15891
16352
  setComposeError(result.error);
@@ -15895,7 +16356,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15895
16356
  setComposeError("邮件服务没有接受本次发送,请检查内容后重试。");
15896
16357
  return;
15897
16358
  }
15898
- const warningText = result.value.warnings.length === 0 ? "" : `,服务返回 ${result.value.warnings.length} 条提示`;
16359
+ const acceptedWithWarning = result.value.warnings.length > 0;
15899
16360
  clearDraft();
15900
16361
  setFolder("sent");
15901
16362
  const storage = browserLocalStorage();
@@ -15908,9 +16369,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15908
16369
  setCompose(false);
15909
16370
  setPane("list");
15910
16371
  refresh("sent");
15911
- showNotice(`邮件已发送${warningText}。`);
16372
+ showNotice(acceptedWithWarning ? `邮件已被服务接受,但返回 ${result.value.warnings.length} 条本地记录提示,请勿立即重复发送。` : "邮件已发送。");
15912
16373
  };
15913
- const dirty = to.trim() !== "" || cc.trim() !== "" || subject.trim() !== "" || bodyText.trim() !== "";
16374
+ const dirty = to.trim() !== "" || cc.trim() !== "" || subject.trim() !== "" || bodyText.trim() !== "" || attachments.length > 0;
15914
16375
  const cancelCompose = () => {
15915
16376
  if (dirty) {
15916
16377
  setDiscardOpen(true);
@@ -15920,6 +16381,39 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15920
16381
  setPane("list");
15921
16382
  };
15922
16383
  const selectedSummary = items.find((item) => item.id === selectedId);
16384
+ const attachmentTotalBytes = attachments.reduce((sum, attachment) => sum + attachment.sizeBytes, 0);
16385
+ const downloadAttachment = async (attachment) => {
16386
+ if (message === null || attachmentLimits === null) return;
16387
+ const expected = downloadableMailAttachment(attachment, downloadMaxBytes);
16388
+ if (expected === void 0 || downloadStates[attachment.index]?.status === "loading") return;
16389
+ const generation = detailGeneration.current;
16390
+ const localMessageId = message.summary.id;
16391
+ setDownloadStates((current) => ({
16392
+ ...current,
16393
+ [attachment.index]: { status: "loading" }
16394
+ }));
16395
+ try {
16396
+ if (!await downloadAndSaveMailAttachment(props.downloadMailAttachment, {
16397
+ localMessageId,
16398
+ attachmentIndex: attachment.index
16399
+ }, expected, downloadMaxBytes, () => generation === detailGeneration.current && message.summary.id === localMessageId)) return;
16400
+ setDownloadStates((current) => {
16401
+ const next = { ...current };
16402
+ delete next[attachment.index];
16403
+ return next;
16404
+ });
16405
+ showNotice(`已开始下载 ${expected.fileName}。`);
16406
+ } catch (error) {
16407
+ if (generation !== detailGeneration.current || message.summary.id !== localMessageId) return;
16408
+ setDownloadStates((current) => ({
16409
+ ...current,
16410
+ [attachment.index]: {
16411
+ status: "error",
16412
+ error: error instanceof TypeError ? error.message : "无法保存附件,请重试。"
16413
+ }
16414
+ }));
16415
+ }
16416
+ };
15923
16417
  return (0, react_jsx_runtime.jsxs)("div", {
15924
16418
  className: _dsh_awiki_css_AwikiMail_module_css_default.mail,
15925
16419
  "data-pane": pane,
@@ -15985,19 +16479,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15985
16479
  children: [
15986
16480
  (0, react_jsx_runtime.jsxs)("header", {
15987
16481
  className: _dsh_awiki_css_AwikiMail_module_css_default.listHeader,
15988
- children: [(0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("strong", { children: MAIL_FOLDER_COPY[folder].title }), (0, react_jsx_runtime.jsxs)("small", { children: [
15989
- items.length,
15990
- " 封邮件",
15991
- folder === "inbox" && visibleUnreadCount > 0 ? ` · ${visibleUnreadCount} 封未读` : ""
15992
- ] })] }), (0, react_jsx_runtime.jsx)("button", {
15993
- type: "button",
15994
- "aria-label": `刷新${MAIL_FOLDER_COPY[folder].title}`,
15995
- disabled: listLoading,
15996
- onClick: () => {
15997
- refresh();
15998
- },
15999
- children: listLoading ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconLoadingOutline16, { size: 15 }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, { size: 15 })
16000
- })]
16482
+ children: [
16483
+ (0, react_jsx_runtime.jsx)("button", {
16484
+ type: "button",
16485
+ className: _dsh_awiki_css_AwikiMail_module_css_default.listBack,
16486
+ "aria-label": "返回邮箱导航",
16487
+ onClick: () => {
16488
+ setPane("folders");
16489
+ },
16490
+ children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutline14, { size: 14 })
16491
+ }),
16492
+ (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("strong", { children: MAIL_FOLDER_COPY[folder].title }), (0, react_jsx_runtime.jsxs)("small", { children: [
16493
+ items.length,
16494
+ " 封邮件",
16495
+ folder === "inbox" && visibleUnreadCount > 0 ? ` · ${visibleUnreadCount} 封未读` : ""
16496
+ ] })] }),
16497
+ (0, react_jsx_runtime.jsx)("button", {
16498
+ type: "button",
16499
+ "aria-label": `刷新${MAIL_FOLDER_COPY[folder].title}`,
16500
+ disabled: listLoading,
16501
+ onClick: () => {
16502
+ refresh();
16503
+ },
16504
+ children: listLoading ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconLoadingOutline16, { size: 15 }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, { size: 15 })
16505
+ })
16506
+ ]
16001
16507
  }),
16002
16508
  listError !== null && (0, react_jsx_runtime.jsxs)("div", {
16003
16509
  className: _dsh_awiki_css_AwikiMail_module_css_default.inlineError,
@@ -16058,7 +16564,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16058
16564
  "aria-label": `返回${MAIL_FOLDER_COPY[folder].title}`,
16059
16565
  onClick: cancelCompose,
16060
16566
  children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutline14, { size: 14 })
16061
- }), (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("strong", { children: "写邮件" }), (0, react_jsx_runtime.jsx)("small", { children: "发送纯文本邮件" })] })]
16567
+ }), (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("strong", { children: "写邮件" }), (0, react_jsx_runtime.jsx)("small", { children: "发送纯文本邮件,可添加附件" })] })]
16062
16568
  }),
16063
16569
  (0, react_jsx_runtime.jsxs)("div", {
16064
16570
  className: _dsh_awiki_css_AwikiMail_module_css_default.composeFields,
@@ -16066,6 +16572,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16066
16572
  (0, react_jsx_runtime.jsxs)("label", { children: ["收件人", (0, react_jsx_runtime.jsx)("textarea", {
16067
16573
  value: to,
16068
16574
  rows: 1,
16575
+ disabled: sending,
16069
16576
  autoFocus: true,
16070
16577
  placeholder: "alice@example.com,可用逗号或换行分隔",
16071
16578
  onChange: (event) => {
@@ -16076,6 +16583,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16076
16583
  (0, react_jsx_runtime.jsxs)("label", { children: ["抄送", (0, react_jsx_runtime.jsx)("textarea", {
16077
16584
  value: cc,
16078
16585
  rows: 1,
16586
+ disabled: sending,
16079
16587
  placeholder: "选填",
16080
16588
  onChange: (event) => {
16081
16589
  setCc(event.target.value);
@@ -16084,6 +16592,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16084
16592
  })] }),
16085
16593
  (0, react_jsx_runtime.jsxs)("label", { children: ["主题", (0, react_jsx_runtime.jsx)("input", {
16086
16594
  value: subject,
16595
+ disabled: sending,
16087
16596
  placeholder: "邮件主题",
16088
16597
  onChange: (event) => {
16089
16598
  setSubject(event.target.value);
@@ -16094,6 +16603,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16094
16603
  className: _dsh_awiki_css_AwikiMail_module_css_default.bodyField,
16095
16604
  children: ["正文", (0, react_jsx_runtime.jsx)("textarea", {
16096
16605
  value: bodyText,
16606
+ disabled: sending,
16097
16607
  placeholder: "输入纯文本邮件正文",
16098
16608
  onChange: (event) => {
16099
16609
  setBodyText(event.target.value);
@@ -16101,6 +16611,54 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16101
16611
  }
16102
16612
  })]
16103
16613
  }),
16614
+ (0, react_jsx_runtime.jsxs)("section", {
16615
+ className: _dsh_awiki_css_AwikiMail_module_css_default.composeAttachments,
16616
+ "aria-label": "邮件附件",
16617
+ children: [(0, react_jsx_runtime.jsxs)("div", {
16618
+ className: _dsh_awiki_css_AwikiMail_module_css_default.attachmentPickerRow,
16619
+ children: [(0, react_jsx_runtime.jsxs)("label", {
16620
+ className: _dsh_awiki_css_AwikiMail_module_css_default.attachmentPicker,
16621
+ children: ["添加附件", (0, react_jsx_runtime.jsx)("input", {
16622
+ ref: fileInput,
16623
+ type: "file",
16624
+ multiple: true,
16625
+ disabled: sending || attachmentLimits === null || attachmentLimits.maxCount === 0,
16626
+ onChange: (event) => {
16627
+ chooseAttachments(event.currentTarget.files);
16628
+ event.currentTarget.value = "";
16629
+ }
16630
+ })]
16631
+ }), (0, react_jsx_runtime.jsx)("small", { children: attachmentLimits === null ? "附件限制暂不可用" : `最多 ${attachmentLimits.maxCount} 个 · 单个 ${displayBytes(attachmentLimits.maxBytes)} · 总计 ${displayBytes(attachmentLimits.totalMaxBytes)}` })]
16632
+ }), attachments.length > 0 && (0, react_jsx_runtime.jsxs)("div", {
16633
+ className: _dsh_awiki_css_AwikiMail_module_css_default.selectedAttachments,
16634
+ children: [attachments.map((attachment) => (0, react_jsx_runtime.jsxs)("div", { children: [
16635
+ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutline16, { size: 15 }),
16636
+ (0, react_jsx_runtime.jsxs)("span", { children: [(0, react_jsx_runtime.jsx)("strong", { children: attachment.fileName }), (0, react_jsx_runtime.jsxs)("small", { children: [
16637
+ attachment.contentType,
16638
+ " · ",
16639
+ displayBytes(attachment.sizeBytes)
16640
+ ] })] }),
16641
+ (0, react_jsx_runtime.jsx)("button", {
16642
+ type: "button",
16643
+ disabled: sending,
16644
+ "aria-label": `移除附件 ${attachment.fileName}`,
16645
+ onClick: () => {
16646
+ removeAttachment(attachment.id);
16647
+ },
16648
+ children: "移除"
16649
+ })
16650
+ ] }, attachment.id)), (0, react_jsx_runtime.jsxs)("p", { children: [
16651
+ attachments.length,
16652
+ " 个附件 · 共 ",
16653
+ displayBytes(attachmentTotalBytes)
16654
+ ] })]
16655
+ })]
16656
+ }),
16657
+ attachmentError !== null && (0, react_jsx_runtime.jsx)("p", {
16658
+ className: _dsh_awiki_css_AwikiMail_module_css_default.composeError,
16659
+ role: "alert",
16660
+ children: attachmentError
16661
+ }),
16104
16662
  composeError !== null && (0, react_jsx_runtime.jsx)("p", {
16105
16663
  className: _dsh_awiki_css_AwikiMail_module_css_default.composeError,
16106
16664
  role: "alert",
@@ -16119,7 +16677,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16119
16677
  }), (0, react_jsx_runtime.jsxs)("button", {
16120
16678
  type: "submit",
16121
16679
  className: _dsh_awiki_css_AwikiMail_module_css_default.sendButton,
16122
- disabled: sending,
16680
+ disabled: sending || attachmentError !== null,
16123
16681
  children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSendOutline16, { size: 15 }), "发送"]
16124
16682
  })]
16125
16683
  })
@@ -16144,8 +16702,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16144
16702
  className: _dsh_awiki_css_AwikiMail_module_css_default.detailBack,
16145
16703
  "aria-label": `返回${MAIL_FOLDER_COPY[folder].title}`,
16146
16704
  onClick: () => {
16705
+ detailGeneration.current += 1;
16147
16706
  setSelectedId(null);
16148
16707
  setMessage(null);
16708
+ setDownloadStates({});
16149
16709
  setPane("list");
16150
16710
  },
16151
16711
  children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutline14, { size: 14 })
@@ -16201,8 +16761,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16201
16761
  }),
16202
16762
  message.attachments.length > 0 && (0, react_jsx_runtime.jsxs)("section", {
16203
16763
  className: _dsh_awiki_css_AwikiMail_module_css_default.attachments,
16204
- "aria-label": "附件元数据",
16205
- children: [(0, react_jsx_runtime.jsx)("h4", { children: "附件(仅元数据)" }), message.attachments.map((attachment) => (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutline16, { size: 15 }), (0, react_jsx_runtime.jsxs)("span", { children: [(0, react_jsx_runtime.jsx)("strong", { children: attachment.fileName ?? `附件 ${attachment.index + 1}` }), (0, react_jsx_runtime.jsx)("small", { children: [attachment.contentType, attachment.sizeBytes === void 0 ? void 0 : `${attachment.sizeBytes} bytes`].filter(Boolean).join(" · ") || "暂无更多信息" })] })] }, attachment.index))]
16764
+ "aria-label": "邮件附件",
16765
+ children: [(0, react_jsx_runtime.jsx)("h4", { children: "附件" }), message.attachments.map((attachment) => {
16766
+ const downloadable = attachmentLimits === null ? void 0 : downloadableMailAttachment(attachment, downloadMaxBytes);
16767
+ const state = downloadStates[attachment.index];
16768
+ return (0, react_jsx_runtime.jsxs)("div", { children: [
16769
+ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutline16, { size: 15 }),
16770
+ (0, react_jsx_runtime.jsxs)("span", { children: [
16771
+ (0, react_jsx_runtime.jsx)("strong", { children: attachment.fileName ?? `附件 ${attachment.index + 1}` }),
16772
+ (0, react_jsx_runtime.jsx)("small", { children: [attachment.contentType, attachment.sizeBytes === void 0 ? void 0 : `${attachment.sizeBytes} bytes`].filter(Boolean).join(" · ") || "暂无更多信息" }),
16773
+ downloadable === void 0 && (0, react_jsx_runtime.jsx)("small", { children: "当前记录缺少完整、可验证的下载元数据。" }),
16774
+ state?.status === "error" && (0, react_jsx_runtime.jsx)("small", {
16775
+ className: _dsh_awiki_css_AwikiMail_module_css_default.attachmentDownloadError,
16776
+ role: "alert",
16777
+ children: state.error
16778
+ })
16779
+ ] }),
16780
+ downloadable !== void 0 && (0, react_jsx_runtime.jsx)("button", {
16781
+ type: "button",
16782
+ disabled: state?.status === "loading",
16783
+ "aria-label": `${state?.status === "error" ? "重试下载" : "下载附件"} ${downloadable.fileName}`,
16784
+ onClick: () => {
16785
+ downloadAttachment(attachment);
16786
+ },
16787
+ children: state?.status === "loading" ? "下载中…" : state?.status === "error" ? "重试" : "下载"
16788
+ })
16789
+ ] }, attachment.index);
16790
+ })]
16206
16791
  })
16207
16792
  ]
16208
16793
  })
@@ -16255,7 +16840,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16255
16840
  splitAddresses(cc).length,
16256
16841
  " 人"
16257
16842
  ] }),
16258
- (0, react_jsx_runtime.jsxs)("p", { children: ["主题:", subject.trim()] })
16843
+ (0, react_jsx_runtime.jsxs)("p", { children: ["主题:", subject.trim()] }),
16844
+ (0, react_jsx_runtime.jsxs)("p", { children: [
16845
+ "附件:",
16846
+ attachments.length,
16847
+ " 个 · 共 ",
16848
+ displayBytes(attachmentTotalBytes)
16849
+ ] }),
16850
+ attachments.map((attachment) => (0, react_jsx_runtime.jsxs)("p", { children: [
16851
+ attachment.fileName,
16852
+ " · ",
16853
+ attachment.contentType,
16854
+ " · ",
16855
+ displayBytes(attachment.sizeBytes)
16856
+ ] }, attachment.id))
16259
16857
  ]
16260
16858
  })
16261
16859
  }),
@@ -16266,7 +16864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16266
16864
  },
16267
16865
  title: "放弃这封邮件?",
16268
16866
  closeLabel: "继续编辑",
16269
- description: "放弃后当前内容将被清空。关闭面板会暂存内容,退出应用不会保存。",
16867
+ description: "放弃后当前文字和附件选择将被清空。关闭面板会暂存内容,退出应用不会保存。",
16270
16868
  footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
16271
16869
  type: "button",
16272
16870
  variant: "outline",
@@ -16287,7 +16885,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16287
16885
  })] }),
16288
16886
  children: (0, react_jsx_runtime.jsx)("p", {
16289
16887
  className: _dsh_awiki_css_AwikiMail_module_css_default.discardText,
16290
- children: "收件人、主题和正文中的未发送内容都会丢失。"
16888
+ children: "收件人、主题、正文和已选择的附件都会丢失。"
16291
16889
  })
16292
16890
  })
16293
16891
  ]
@@ -19903,12 +20501,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19903
20501
  onChange: setMode
19904
20502
  }),
19905
20503
  onUnreadCountChange: setMailUnreadCount,
20504
+ getConfig: props.getConfig,
19906
20505
  getMailAccount: props.getMailAccount,
19907
20506
  listMailInbox: props.listMailInbox,
19908
20507
  readMail: props.readMail,
19909
20508
  markMailRead: props.markMailRead,
19910
- sendMail: props.sendMail
19911
- }, view.identity.did)
20509
+ sendMail: props.sendMail,
20510
+ downloadMailAttachment: props.downloadMailAttachment
20511
+ }, `${props.drafts?.getScope("mail:attachments") ?? ""}:${view.identity.did}`)
19912
20512
  })] }),
19913
20513
  composeDirect && (0, react_jsx_runtime.jsx)("div", {
19914
20514
  className: _dsh_awiki_css_AwikiOverlay_module_css_default.composeBackdrop,
@@ -20349,7 +20949,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20349
20949
  }),
20350
20950
  (0, react_jsx_runtime.jsx)("p", {
20351
20951
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
20352
- children: t("updateCurrent", { version: update?.currentPluginVersion ?? "0.3.11-rc.1" })
20952
+ children: t("updateCurrent", { version: update?.currentPluginVersion ?? "0.3.11-rc.2" })
20353
20953
  }),
20354
20954
  update !== void 0 && (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: update.currentModelProxyVersion !== void 0 && (0, react_jsx_runtime.jsx)("p", {
20355
20955
  className: _dsh_awiki_css_AwikiSettingsSection_module_css_default.description,
@@ -22911,11 +23511,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
22911
23511
  value: void 0
22912
23512
  } : result;
22913
23513
  },
23514
+ getConfig: () => awiki.getConfig(),
22914
23515
  getMailAccount: () => awiki.getMailAccount(),
22915
23516
  listMailInbox: (request) => awiki.listMailInbox(request),
22916
23517
  readMail: (request) => awiki.readMail(request),
22917
23518
  markMailRead: (request) => awiki.markMailRead(request),
22918
- sendMail: (request) => awiki.sendMail(request)
23519
+ sendMail: (request) => awiki.sendMail(request),
23520
+ downloadMailAttachment: (request) => awiki.downloadMailAttachment(request)
22919
23521
  })
22920
23522
  }, AwikiOverlay);
22921
23523
  });