@codemem/server 0.50.0-beta.4 → 0.50.0-beta.5

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 (38) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1754 -616
  4. package/dist/index.js.map +1 -1
  5. package/dist/request-rate-limit.d.ts +17 -1
  6. package/dist/request-rate-limit.d.ts.map +1 -1
  7. package/dist/response-byte-budget.d.ts +18 -0
  8. package/dist/response-byte-budget.d.ts.map +1 -0
  9. package/dist/routes/config.d.ts.map +1 -1
  10. package/dist/routes/device-removal-local.d.ts.map +1 -1
  11. package/dist/routes/device-removal-lookup.d.ts.map +1 -1
  12. package/dist/routes/sync.d.ts +30 -5
  13. package/dist/routes/sync.d.ts.map +1 -1
  14. package/dist/routes/team-recovery.d.ts +12 -0
  15. package/dist/routes/team-recovery.d.ts.map +1 -0
  16. package/dist/routes/team-setup-view.d.ts +6 -0
  17. package/dist/routes/team-setup-view.d.ts.map +1 -1
  18. package/dist/routes/team-setup.d.ts +18 -3
  19. package/dist/routes/team-setup.d.ts.map +1 -1
  20. package/dist/sync-app.d.ts +3 -1
  21. package/dist/sync-app.d.ts.map +1 -1
  22. package/dist/sync-channel-dispatch.d.ts +9 -0
  23. package/dist/sync-channel-dispatch.d.ts.map +1 -1
  24. package/dist/sync-channel-pass-test-fixtures.d.ts +3 -2
  25. package/dist/sync-channel-pass-test-fixtures.d.ts.map +1 -1
  26. package/dist/sync-listener-guard.d.ts +67 -0
  27. package/dist/sync-listener-guard.d.ts.map +1 -0
  28. package/dist/sync-noise-gate.d.ts +37 -0
  29. package/dist/sync-noise-gate.d.ts.map +1 -0
  30. package/dist/sync-server-mode.d.ts +58 -0
  31. package/dist/sync-server-mode.d.ts.map +1 -0
  32. package/package.json +2 -2
  33. package/static/app.js +50 -50
  34. package/static/app.js.br +0 -0
  35. package/static/app.js.gz +0 -0
  36. package/static/index.html +72 -43
  37. package/dist/routes/device-retire.d.ts +0 -206
  38. package/dist/routes/device-retire.d.ts.map +0 -1
package/static/app.js.br CHANGED
Binary file
package/static/app.js.gz CHANGED
Binary file
package/static/index.html CHANGED
@@ -1631,6 +1631,36 @@
1631
1631
  .removed-devices-action { align-items: flex-start; }
1632
1632
  .removed-devices-failure { text-align: left; }
1633
1633
  }
1634
+ .devices-join-requests { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
1635
+ .devices-join-requests h3,
1636
+ .devices-join-requests p { margin: 0; }
1637
+ .devices-join-requests p { color: var(--text-secondary); font-size: var(--font-size-sm); }
1638
+ .devices-join-requests-status:empty { display: none; }
1639
+ .devices-join-requests-list {
1640
+ margin: 0;
1641
+ padding: 0;
1642
+ overflow: hidden;
1643
+ border: 1px solid var(--border);
1644
+ border-radius: var(--radius-md);
1645
+ list-style: none;
1646
+ }
1647
+ .devices-join-request {
1648
+ display: flex;
1649
+ align-items: center;
1650
+ justify-content: space-between;
1651
+ gap: var(--sp-4);
1652
+ padding: var(--sp-3) var(--sp-4);
1653
+ background: var(--surface-1);
1654
+ }
1655
+ .devices-join-request + .devices-join-request { border-top: 1px solid var(--border); }
1656
+ .devices-join-request-identity { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
1657
+ .devices-join-request-actions { display: flex; flex: 0 0 auto; align-items: center; gap: var(--sp-2); }
1658
+ @media (max-width: 720px) {
1659
+ .devices-join-request { align-items: stretch; flex-direction: column; gap: var(--sp-2); }
1660
+ .devices-join-request-actions { flex-wrap: wrap; }
1661
+ .devices-join-request-actions .settings-button,
1662
+ .devices-join-request-actions .settings-save { flex: 1 1 8rem; min-height: 44px; }
1663
+ }
1634
1664
  .recipient-policy-management-dialog .modal-card { width: min(720px, calc(100vw - 32px)); }
1635
1665
  .recipient-policy-team-settings-dialog .modal-card { width: min(440px, calc(100vw - 32px)); }
1636
1666
  .recipient-policy-team-settings-dialog .form-field { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
@@ -1690,6 +1720,29 @@
1690
1720
  background: var(--accent-warm-subtle);
1691
1721
  }
1692
1722
  .legacy-team-setup-recovery p { margin: 0; }
1723
+ .team-recovery-panel {
1724
+ display: grid;
1725
+ gap: var(--sp-2);
1726
+ justify-items: start;
1727
+ max-width: 44rem;
1728
+ margin-block: var(--sp-4);
1729
+ padding: var(--sp-4);
1730
+ border: 1px solid var(--accent-warm);
1731
+ border-radius: var(--radius-sm);
1732
+ background: var(--accent-warm-subtle);
1733
+ }
1734
+ .team-recovery-panel p { margin: 0; }
1735
+ .legacy-team-setup-recovery .team-recovery-panel {
1736
+ margin-block: var(--sp-2) 0;
1737
+ padding: var(--sp-3) 0 0;
1738
+ border: 0;
1739
+ border-top: 1px solid var(--accent-warm);
1740
+ border-radius: 0;
1741
+ background: none;
1742
+ }
1743
+ .team-recovery-review { display: grid; gap: var(--sp-2); }
1744
+ .team-recovery-list { margin: 0; padding-left: var(--sp-5); }
1745
+ .team-recovery-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
1693
1746
  .legacy-team-setup-actions { justify-content: flex-end; }
1694
1747
  .legacy-team-setup-target { min-width: 24px; min-height: 24px; }
1695
1748
  .legacy-team-device-list { display: grid; gap: var(--sp-4); margin-top: var(--sp-4); }
@@ -2184,6 +2237,14 @@
2184
2237
  .device-identity-review-panel ul { margin: var(--sp-3) 0; padding-left: var(--sp-5); }
2185
2238
  .device-identity-review-panel .peer-actions { margin-top: var(--sp-4); }
2186
2239
 
2240
+ .devices-header-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
2241
+ .devices-history,
2242
+ .devices-history p,
2243
+ .devices-history h3 { margin: 0; }
2244
+ .devices-history { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
2245
+ .devices-history-list { display: grid; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
2246
+ .devices-history-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
2247
+ .devices-history-identity { display: grid; min-width: 0; overflow-wrap: anywhere; }
2187
2248
  #devicesMount .recipient-policy-sharing-header {
2188
2249
  display: flex;
2189
2250
  align-items: flex-start;
@@ -2251,6 +2312,13 @@
2251
2312
  background: var(--surface-2);
2252
2313
  }
2253
2314
  .devices-pairing-panel p { margin: 0; color: var(--text-secondary); }
2315
+ .devices-pairing-form { display: grid; gap: var(--sp-2); }
2316
+ .devices-pairing-form textarea { width: 100%; }
2317
+ .devices-pairing-review h4 { margin: 0; }
2318
+ .devices-pairing-review dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-1) var(--sp-3); margin: var(--sp-2) 0 0; }
2319
+ .devices-pairing-review dd { margin: 0; overflow-wrap: anywhere; }
2320
+ .devices-pairing-addresses { white-space: pre-wrap; }
2321
+ .devices-pairing-form-status:empty { display: none; }
2254
2322
  .devices-pairing-header,
2255
2323
  .devices-pairing-command { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
2256
2324
  .devices-pairing-header h3 { margin: 0; }
@@ -4163,6 +4231,8 @@
4163
4231
  /* Radix sets pointer-events inline on modal content; keep backdrop clicks on the overlay. */
4164
4232
  .legacy-upgrade-modal { pointer-events: none !important; }
4165
4233
  .legacy-upgrade-modal .modal-card { width: min(620px, 100%); pointer-events: auto; }
4234
+ .legacy-upgrade-modal--review .modal-card { width: min(960px, 100%); }
4235
+ #legacyUpgradeReview:focus { outline: none; }
4166
4236
  .legacy-upgrade-summary {
4167
4237
  padding: var(--sp-3);
4168
4238
  border: 1px solid color-mix(in srgb, var(--accent-warm) 28%, var(--border));
@@ -5392,7 +5462,6 @@
5392
5462
  <section class="card advanced-sync-status">
5393
5463
  <div id="syncAdvancedStatusMount"></div>
5394
5464
  <div class="section-actions">
5395
- <button class="settings-button" id="syncNowButton" disabled>Sync now</button>
5396
5465
  <a class="sync-subview-link" href="#advanced/sync/diagnostics">View diagnostics &rarr;</a>
5397
5466
  <button class="settings-save" id="syncTurnOnButton" type="button" hidden>Turn on sync</button>
5398
5467
  </div>
@@ -5402,7 +5471,7 @@
5402
5471
  <div class="card" id="syncTeamCard">
5403
5472
  <div class="section-header">
5404
5473
  <div class="section-header-title">
5405
- <h2>Join a team</h2>
5474
+ <h2>Team setup</h2>
5406
5475
  <span class="sync-online-badge" id="syncOnlineBadge" hidden role="status" aria-live="polite"></span>
5407
5476
  </div>
5408
5477
  </div>
@@ -5414,41 +5483,10 @@
5414
5483
  </div>
5415
5484
  <div class="sync-actions" id="syncTeamActions" hidden></div>
5416
5485
  <div id="syncSetupPanel">
5417
- <div id="syncJoinSection">
5418
- <h3 class="settings-group-title">Join a team</h3>
5419
- <div class="actor-create-row" id="syncJoinPanel" hidden>
5420
- <label for="syncJoinInvite" class="sr-only">Invite or pairing code</label>
5421
- <textarea class="feed-search" id="syncJoinInvite" placeholder="Invite or pairing code" rows="2"></textarea>
5422
- <div id="syncProjectInviteReview" role="region" aria-labelledby="syncProjectInviteReviewHeading" hidden>
5423
- <h4 id="syncProjectInviteReviewHeading" tabindex="-1">Review project invitation</h4>
5424
- <div class="section-meta" id="syncProjectInviteContext"></div>
5425
- <label for="syncRecipientName">Your name</label>
5426
- <input class="feed-search" id="syncRecipientName" maxlength="120" autocomplete="name" />
5427
- <label for="syncRecipientDeviceName">This device</label>
5428
- <input class="feed-search" id="syncRecipientDeviceName" maxlength="120" />
5429
- </div>
5430
- <div id="syncPairingReview" role="region" aria-labelledby="syncPairingReviewHeading" hidden>
5431
- <h4 id="syncPairingReviewHeading" tabindex="-1">Review device pairing</h4>
5432
- <p>Check these details with the other device. Accept only a device you trust.</p>
5433
- <dl>
5434
- <dt>Device ID</dt><dd id="syncPairingDeviceId" style="overflow-wrap: anywhere"></dd>
5435
- <dt>Fingerprint</dt><dd id="syncPairingFingerprint" style="overflow-wrap: anywhere"></dd>
5436
- <dt>Addresses</dt><dd id="syncPairingAddresses" style="white-space: pre-wrap; overflow-wrap: anywhere"></dd>
5437
- </dl>
5438
- </div>
5439
- <button class="settings-button" id="syncJoinButton">Review invite</button>
5440
- </div>
5441
- </div>
5442
5486
  <div id="syncAdminSection">
5443
5487
  <div id="syncAdminDisclosureMount" style="display: contents"></div>
5444
5488
  </div>
5445
5489
  </div>
5446
- <div class="actor-list" id="syncJoinRequests"></div>
5447
- <div id="syncCoordinatorDiscovered" hidden>
5448
- <h3 class="settings-group-title" style="margin-top: 20px">Team devices to pair</h3>
5449
- <div class="section-meta" id="syncCoordinatorDiscoveredMeta"></div>
5450
- <div class="peer-list" id="syncCoordinatorDiscoveredList"></div>
5451
- </div>
5452
5490
  </div>
5453
5491
 
5454
5492
  <!-- 2. People and devices -->
@@ -5489,15 +5527,6 @@
5489
5527
  <div class="device-row-skeleton"><span class="skel-pip"></span><span class="skel-name"></span><span class="skel-chip"></span></div>
5490
5528
  <div class="device-row-skeleton"><span class="skel-pip"></span><span class="skel-name"></span><span class="skel-chip"></span></div>
5491
5529
  </div>
5492
- <div id="syncLegacyClaims" hidden>
5493
- <h3 class="settings-group-title" style="margin-top: 20px">Legacy device history</h3>
5494
- <div class="peer-meta" id="syncLegacyClaimsMeta"></div>
5495
- <div class="peer-actions sync-legacy-claim-row">
5496
- <label for="syncLegacyDeviceSelect" class="sr-only">Legacy device</label>
5497
- <div class="sync-radix-select-host sync-legacy-select-host" id="syncLegacyDeviceSelectMount"></div>
5498
- <button class="sync-legacy-button" id="syncLegacyClaimButton">Attach device history</button>
5499
- </div>
5500
- </div>
5501
5530
  </details>
5502
5531
  </div>
5503
5532
 
@@ -5551,6 +5580,6 @@
5551
5580
  </div>
5552
5581
  </div>
5553
5582
 
5554
- <script src="/assets/app.js?v=84bb2f521ad6"></script>
5583
+ <script src="/assets/app.js?v=8733c15b0f93"></script>
5555
5584
  </body>
5556
5585
  </html>
@@ -1,206 +0,0 @@
1
- import { type MemoryStore } from "@codemem/core";
2
- /**
3
- * Retires another device: revokes its enrollment's device ID and its key across the
4
- * coordinator, after a preview the caller confirms by digest, then unpairs every
5
- * local ID that carries the key.
6
- */
7
- export declare function deviceRetireRoutes(getStore: () => MemoryStore): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
8
- "/api/sync/devices/:device_id/retire/preview": {
9
- $post: {
10
- output: {
11
- error: string;
12
- };
13
- outputFormat: "json";
14
- status: 400 | 404 | 409 | 502 | 503;
15
- input: {
16
- param: {
17
- device_id: string;
18
- };
19
- };
20
- } | {
21
- output: {
22
- device_id: string;
23
- display_name: string;
24
- enrollment_device_id: string;
25
- alias_device_ids: string[];
26
- group_id: string;
27
- coordinator_id: string;
28
- key_id: string;
29
- expected_digest: string;
30
- };
31
- outputFormat: "json";
32
- status: import("hono/utils/http-status").ContentfulStatusCode;
33
- input: {
34
- param: {
35
- device_id: string;
36
- };
37
- };
38
- };
39
- };
40
- } & {
41
- "/api/sync/devices/:device_id/retire": {
42
- $post: {
43
- output: {
44
- error: string;
45
- };
46
- outputFormat: "json";
47
- status: 400 | 404 | 409 | 502 | 503;
48
- input: {
49
- param: {
50
- device_id: string;
51
- };
52
- };
53
- } | {
54
- output: {
55
- state: string;
56
- device_id: string;
57
- unpaired_here: boolean;
58
- };
59
- outputFormat: "json";
60
- status: import("hono/utils/http-status").ContentfulStatusCode;
61
- input: {
62
- param: {
63
- device_id: string;
64
- };
65
- };
66
- };
67
- };
68
- }, "/", "/api/sync/devices/:device_id/retire">;
69
- /** Rename and retirement routes for one device, mounted together by the sync app. */
70
- export declare function deviceRoutes(getStore: () => MemoryStore): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
71
- "/api/sync/recipient-policy/v1/devices/:device_id/rename": {
72
- $post: {
73
- output: {
74
- error: string;
75
- };
76
- outputFormat: "json";
77
- status: 404;
78
- input: {
79
- param: {
80
- device_id: string;
81
- };
82
- };
83
- } | {
84
- output: {
85
- error: string;
86
- };
87
- outputFormat: "json";
88
- status: 400;
89
- input: {
90
- param: {
91
- device_id: string;
92
- };
93
- };
94
- } | {
95
- output: {
96
- error: string;
97
- };
98
- outputFormat: "json";
99
- status: 409;
100
- input: {
101
- param: {
102
- device_id: string;
103
- };
104
- };
105
- } | {
106
- output: {
107
- ok: false;
108
- error: string;
109
- status: 409 | 503;
110
- renamedGroupCount?: number;
111
- };
112
- outputFormat: "json";
113
- status: 409 | 503;
114
- input: {
115
- param: {
116
- device_id: string;
117
- };
118
- };
119
- } | {
120
- output: {
121
- ok: true;
122
- display_name: string;
123
- };
124
- outputFormat: "json";
125
- status: import("hono/utils/http-status").ContentfulStatusCode;
126
- input: {
127
- param: {
128
- device_id: string;
129
- };
130
- };
131
- } | {
132
- output: {
133
- error: string;
134
- };
135
- outputFormat: "json";
136
- status: 503;
137
- input: {
138
- param: {
139
- device_id: string;
140
- };
141
- };
142
- };
143
- };
144
- }, "/"> | import("hono/types").MergeSchemaPath<{
145
- "/api/sync/devices/:device_id/retire/preview": {
146
- $post: {
147
- output: {
148
- error: string;
149
- };
150
- outputFormat: "json";
151
- status: 400 | 404 | 409 | 502 | 503;
152
- input: {
153
- param: {
154
- device_id: string;
155
- };
156
- };
157
- } | {
158
- output: {
159
- device_id: string;
160
- display_name: string;
161
- enrollment_device_id: string;
162
- alias_device_ids: string[];
163
- group_id: string;
164
- coordinator_id: string;
165
- key_id: string;
166
- expected_digest: string;
167
- };
168
- outputFormat: "json";
169
- status: import("hono/utils/http-status").ContentfulStatusCode;
170
- input: {
171
- param: {
172
- device_id: string;
173
- };
174
- };
175
- };
176
- };
177
- } & {
178
- "/api/sync/devices/:device_id/retire": {
179
- $post: {
180
- output: {
181
- error: string;
182
- };
183
- outputFormat: "json";
184
- status: 400 | 404 | 409 | 502 | 503;
185
- input: {
186
- param: {
187
- device_id: string;
188
- };
189
- };
190
- } | {
191
- output: {
192
- state: string;
193
- device_id: string;
194
- unpaired_here: boolean;
195
- };
196
- outputFormat: "json";
197
- status: import("hono/utils/http-status").ContentfulStatusCode;
198
- input: {
199
- param: {
200
- device_id: string;
201
- };
202
- };
203
- };
204
- };
205
- }, "/">, "/", "/">;
206
- //# sourceMappingURL=device-retire.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"device-retire.d.ts","sourceRoot":"","sources":["../../src/routes/device-retire.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,WAAW,EAOhB,MAAM,eAAe,CAAC;AAwJvB;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAI7D;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAIvD"}