@lapis-notes/api 0.2.8 → 0.3.1
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.
- package/CHANGELOG.md +45 -0
- package/README.md +13 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +42 -42
- package/dist/generated/plugin-host-modules.schema.generated.js +42 -42
- package/dist/native-editing-intents.d.ts +8 -0
- package/dist/native-editing-recovery.d.ts +1 -1
- package/dist/native-editing-recovery.js +50 -5
- package/dist/plugin-distribution/schemas.d.ts +24 -24
- package/dist/plugin-manager.d.ts +1 -0
- package/dist/plugin-manager.js +16 -1
- package/dist/registry-schema/catalog-v1.d.ts +306 -306
- package/dist/registry-schema/catalog-v2.d.ts +417 -417
- package/dist/storage/browser.js +2 -1
- package/dist/storage/vault-resource-type.d.ts +1 -0
- package/dist/storage/vault-resource-type.js +37 -0
- package/package.json +5 -5
|
@@ -194,7 +194,7 @@ export const pluginHostModuleRegistry = {
|
|
|
194
194
|
"public": true,
|
|
195
195
|
"source": "package-json-export",
|
|
196
196
|
"specifier": "@lapis-notes/api",
|
|
197
|
-
"version": "0.
|
|
197
|
+
"version": "0.3.1"
|
|
198
198
|
},
|
|
199
199
|
"@lapis-notes/api/agent-skills": {
|
|
200
200
|
"entry": "@lapis-notes/api/agent-skills",
|
|
@@ -207,7 +207,7 @@ export const pluginHostModuleRegistry = {
|
|
|
207
207
|
"public": true,
|
|
208
208
|
"source": "package-json-export",
|
|
209
209
|
"specifier": "@lapis-notes/api/agent-skills",
|
|
210
|
-
"version": "0.
|
|
210
|
+
"version": "0.3.1"
|
|
211
211
|
},
|
|
212
212
|
"@lapis-notes/api/agent-tools": {
|
|
213
213
|
"entry": "@lapis-notes/api/agent-tools",
|
|
@@ -220,7 +220,7 @@ export const pluginHostModuleRegistry = {
|
|
|
220
220
|
"public": true,
|
|
221
221
|
"source": "package-json-export",
|
|
222
222
|
"specifier": "@lapis-notes/api/agent-tools",
|
|
223
|
-
"version": "0.
|
|
223
|
+
"version": "0.3.1"
|
|
224
224
|
},
|
|
225
225
|
"@lapis-notes/api/app-database": {
|
|
226
226
|
"entry": "@lapis-notes/api/app-database",
|
|
@@ -233,7 +233,7 @@ export const pluginHostModuleRegistry = {
|
|
|
233
233
|
"public": true,
|
|
234
234
|
"source": "package-json-export",
|
|
235
235
|
"specifier": "@lapis-notes/api/app-database",
|
|
236
|
-
"version": "0.
|
|
236
|
+
"version": "0.3.1"
|
|
237
237
|
},
|
|
238
238
|
"@lapis-notes/api/build/vite": {
|
|
239
239
|
"entry": "@lapis-notes/api/build/vite",
|
|
@@ -243,7 +243,7 @@ export const pluginHostModuleRegistry = {
|
|
|
243
243
|
"public": true,
|
|
244
244
|
"source": "package-json-export",
|
|
245
245
|
"specifier": "@lapis-notes/api/build/vite",
|
|
246
|
-
"version": "0.
|
|
246
|
+
"version": "0.3.1"
|
|
247
247
|
},
|
|
248
248
|
"@lapis-notes/api/cache": {
|
|
249
249
|
"entry": "@lapis-notes/api/cache",
|
|
@@ -256,7 +256,7 @@ export const pluginHostModuleRegistry = {
|
|
|
256
256
|
"public": true,
|
|
257
257
|
"source": "package-json-export",
|
|
258
258
|
"specifier": "@lapis-notes/api/cache",
|
|
259
|
-
"version": "0.
|
|
259
|
+
"version": "0.3.1"
|
|
260
260
|
},
|
|
261
261
|
"@lapis-notes/api/copy-button": {
|
|
262
262
|
"entry": "@lapis-notes/api/copy-button",
|
|
@@ -269,7 +269,7 @@ export const pluginHostModuleRegistry = {
|
|
|
269
269
|
"public": true,
|
|
270
270
|
"source": "package-json-export",
|
|
271
271
|
"specifier": "@lapis-notes/api/copy-button",
|
|
272
|
-
"version": "0.
|
|
272
|
+
"version": "0.3.1"
|
|
273
273
|
},
|
|
274
274
|
"@lapis-notes/api/desktop-native": {
|
|
275
275
|
"entry": "@lapis-notes/api/desktop-native",
|
|
@@ -282,7 +282,7 @@ export const pluginHostModuleRegistry = {
|
|
|
282
282
|
"public": true,
|
|
283
283
|
"source": "package-json-export",
|
|
284
284
|
"specifier": "@lapis-notes/api/desktop-native",
|
|
285
|
-
"version": "0.
|
|
285
|
+
"version": "0.3.1"
|
|
286
286
|
},
|
|
287
287
|
"@lapis-notes/api/editor": {
|
|
288
288
|
"defaultExport": true,
|
|
@@ -296,7 +296,7 @@ export const pluginHostModuleRegistry = {
|
|
|
296
296
|
"public": true,
|
|
297
297
|
"source": "package-json-export",
|
|
298
298
|
"specifier": "@lapis-notes/api/editor",
|
|
299
|
-
"version": "0.
|
|
299
|
+
"version": "0.3.1"
|
|
300
300
|
},
|
|
301
301
|
"@lapis-notes/api/editor/core": {
|
|
302
302
|
"entry": "@lapis-notes/api/editor/core",
|
|
@@ -309,7 +309,7 @@ export const pluginHostModuleRegistry = {
|
|
|
309
309
|
"public": true,
|
|
310
310
|
"source": "package-json-export",
|
|
311
311
|
"specifier": "@lapis-notes/api/editor/core",
|
|
312
|
-
"version": "0.
|
|
312
|
+
"version": "0.3.1"
|
|
313
313
|
},
|
|
314
314
|
"@lapis-notes/api/editor/extensions/autocomplete": {
|
|
315
315
|
"entry": "@lapis-notes/api/editor/extensions/autocomplete",
|
|
@@ -322,7 +322,7 @@ export const pluginHostModuleRegistry = {
|
|
|
322
322
|
"public": true,
|
|
323
323
|
"source": "package-json-export",
|
|
324
324
|
"specifier": "@lapis-notes/api/editor/extensions/autocomplete",
|
|
325
|
-
"version": "0.
|
|
325
|
+
"version": "0.3.1"
|
|
326
326
|
},
|
|
327
327
|
"@lapis-notes/api/editor/extensions/class-highlighter": {
|
|
328
328
|
"entry": "@lapis-notes/api/editor/extensions/class-highlighter",
|
|
@@ -335,7 +335,7 @@ export const pluginHostModuleRegistry = {
|
|
|
335
335
|
"public": true,
|
|
336
336
|
"source": "package-json-export",
|
|
337
337
|
"specifier": "@lapis-notes/api/editor/extensions/class-highlighter",
|
|
338
|
-
"version": "0.
|
|
338
|
+
"version": "0.3.1"
|
|
339
339
|
},
|
|
340
340
|
"@lapis-notes/api/editor/extensions/fold-gutter": {
|
|
341
341
|
"entry": "@lapis-notes/api/editor/extensions/fold-gutter",
|
|
@@ -348,7 +348,7 @@ export const pluginHostModuleRegistry = {
|
|
|
348
348
|
"public": true,
|
|
349
349
|
"source": "package-json-export",
|
|
350
350
|
"specifier": "@lapis-notes/api/editor/extensions/fold-gutter",
|
|
351
|
-
"version": "0.
|
|
351
|
+
"version": "0.3.1"
|
|
352
352
|
},
|
|
353
353
|
"@lapis-notes/api/editor/extensions/gutter-line-style-sync": {
|
|
354
354
|
"entry": "@lapis-notes/api/editor/extensions/gutter-line-style-sync",
|
|
@@ -361,7 +361,7 @@ export const pluginHostModuleRegistry = {
|
|
|
361
361
|
"public": true,
|
|
362
362
|
"source": "package-json-export",
|
|
363
363
|
"specifier": "@lapis-notes/api/editor/extensions/gutter-line-style-sync",
|
|
364
|
-
"version": "0.
|
|
364
|
+
"version": "0.3.1"
|
|
365
365
|
},
|
|
366
366
|
"@lapis-notes/api/editor/extensions/lint": {
|
|
367
367
|
"entry": "@lapis-notes/api/editor/extensions/lint",
|
|
@@ -374,7 +374,7 @@ export const pluginHostModuleRegistry = {
|
|
|
374
374
|
"public": true,
|
|
375
375
|
"source": "package-json-export",
|
|
376
376
|
"specifier": "@lapis-notes/api/editor/extensions/lint",
|
|
377
|
-
"version": "0.
|
|
377
|
+
"version": "0.3.1"
|
|
378
378
|
},
|
|
379
379
|
"@lapis-notes/api/editor/extensions/search": {
|
|
380
380
|
"entry": "@lapis-notes/api/editor/extensions/search",
|
|
@@ -387,7 +387,7 @@ export const pluginHostModuleRegistry = {
|
|
|
387
387
|
"public": true,
|
|
388
388
|
"source": "package-json-export",
|
|
389
389
|
"specifier": "@lapis-notes/api/editor/extensions/search",
|
|
390
|
-
"version": "0.
|
|
390
|
+
"version": "0.3.1"
|
|
391
391
|
},
|
|
392
392
|
"@lapis-notes/api/editor/language-service": {
|
|
393
393
|
"entry": "@lapis-notes/api/editor/language-service",
|
|
@@ -400,7 +400,7 @@ export const pluginHostModuleRegistry = {
|
|
|
400
400
|
"public": true,
|
|
401
401
|
"source": "package-json-export",
|
|
402
402
|
"specifier": "@lapis-notes/api/editor/language-service",
|
|
403
|
-
"version": "0.
|
|
403
|
+
"version": "0.3.1"
|
|
404
404
|
},
|
|
405
405
|
"@lapis-notes/api/empty-view": {
|
|
406
406
|
"entry": "@lapis-notes/api/empty-view",
|
|
@@ -413,7 +413,7 @@ export const pluginHostModuleRegistry = {
|
|
|
413
413
|
"public": true,
|
|
414
414
|
"source": "package-json-export",
|
|
415
415
|
"specifier": "@lapis-notes/api/empty-view",
|
|
416
|
-
"version": "0.
|
|
416
|
+
"version": "0.3.1"
|
|
417
417
|
},
|
|
418
418
|
"@lapis-notes/api/icon": {
|
|
419
419
|
"entry": "@lapis-notes/api/icon",
|
|
@@ -426,7 +426,7 @@ export const pluginHostModuleRegistry = {
|
|
|
426
426
|
"public": true,
|
|
427
427
|
"source": "package-json-export",
|
|
428
428
|
"specifier": "@lapis-notes/api/icon",
|
|
429
|
-
"version": "0.
|
|
429
|
+
"version": "0.3.1"
|
|
430
430
|
},
|
|
431
431
|
"@lapis-notes/api/language-service": {
|
|
432
432
|
"entry": "@lapis-notes/api/language-service",
|
|
@@ -439,7 +439,7 @@ export const pluginHostModuleRegistry = {
|
|
|
439
439
|
"public": true,
|
|
440
440
|
"source": "package-json-export",
|
|
441
441
|
"specifier": "@lapis-notes/api/language-service",
|
|
442
|
-
"version": "0.
|
|
442
|
+
"version": "0.3.1"
|
|
443
443
|
},
|
|
444
444
|
"@lapis-notes/api/language-service/worker": {
|
|
445
445
|
"entry": "@lapis-notes/api/language-service/worker",
|
|
@@ -452,7 +452,7 @@ export const pluginHostModuleRegistry = {
|
|
|
452
452
|
"public": true,
|
|
453
453
|
"source": "package-json-export",
|
|
454
454
|
"specifier": "@lapis-notes/api/language-service/worker",
|
|
455
|
-
"version": "0.
|
|
455
|
+
"version": "0.3.1"
|
|
456
456
|
},
|
|
457
457
|
"@lapis-notes/api/menu": {
|
|
458
458
|
"defaultExport": true,
|
|
@@ -466,7 +466,7 @@ export const pluginHostModuleRegistry = {
|
|
|
466
466
|
"public": true,
|
|
467
467
|
"source": "package-json-export",
|
|
468
468
|
"specifier": "@lapis-notes/api/menu",
|
|
469
|
-
"version": "0.
|
|
469
|
+
"version": "0.3.1"
|
|
470
470
|
},
|
|
471
471
|
"@lapis-notes/api/metadata-store": {
|
|
472
472
|
"entry": "@lapis-notes/api/metadata-store",
|
|
@@ -476,7 +476,7 @@ export const pluginHostModuleRegistry = {
|
|
|
476
476
|
"public": true,
|
|
477
477
|
"source": "package-json-export",
|
|
478
478
|
"specifier": "@lapis-notes/api/metadata-store",
|
|
479
|
-
"version": "0.
|
|
479
|
+
"version": "0.3.1"
|
|
480
480
|
},
|
|
481
481
|
"@lapis-notes/api/metadata-value": {
|
|
482
482
|
"entry": "@lapis-notes/api/metadata-value",
|
|
@@ -489,7 +489,7 @@ export const pluginHostModuleRegistry = {
|
|
|
489
489
|
"public": true,
|
|
490
490
|
"source": "package-json-export",
|
|
491
491
|
"specifier": "@lapis-notes/api/metadata-value",
|
|
492
|
-
"version": "0.
|
|
492
|
+
"version": "0.3.1"
|
|
493
493
|
},
|
|
494
494
|
"@lapis-notes/api/native-editing-intents": {
|
|
495
495
|
"entry": "@lapis-notes/api/native-editing-intents",
|
|
@@ -502,7 +502,7 @@ export const pluginHostModuleRegistry = {
|
|
|
502
502
|
"public": true,
|
|
503
503
|
"source": "package-json-export",
|
|
504
504
|
"specifier": "@lapis-notes/api/native-editing-intents",
|
|
505
|
-
"version": "0.
|
|
505
|
+
"version": "0.3.1"
|
|
506
506
|
},
|
|
507
507
|
"@lapis-notes/api/native-history-index": {
|
|
508
508
|
"entry": "@lapis-notes/api/native-history-index",
|
|
@@ -515,7 +515,7 @@ export const pluginHostModuleRegistry = {
|
|
|
515
515
|
"public": true,
|
|
516
516
|
"source": "package-json-export",
|
|
517
517
|
"specifier": "@lapis-notes/api/native-history-index",
|
|
518
|
-
"version": "0.
|
|
518
|
+
"version": "0.3.1"
|
|
519
519
|
},
|
|
520
520
|
"@lapis-notes/api/native-tasks": {
|
|
521
521
|
"entry": "@lapis-notes/api/native-tasks",
|
|
@@ -528,7 +528,7 @@ export const pluginHostModuleRegistry = {
|
|
|
528
528
|
"public": true,
|
|
529
529
|
"source": "package-json-export",
|
|
530
530
|
"specifier": "@lapis-notes/api/native-tasks",
|
|
531
|
-
"version": "0.
|
|
531
|
+
"version": "0.3.1"
|
|
532
532
|
},
|
|
533
533
|
"@lapis-notes/api/native-turns": {
|
|
534
534
|
"entry": "@lapis-notes/api/native-turns",
|
|
@@ -541,7 +541,7 @@ export const pluginHostModuleRegistry = {
|
|
|
541
541
|
"public": true,
|
|
542
542
|
"source": "package-json-export",
|
|
543
543
|
"specifier": "@lapis-notes/api/native-turns",
|
|
544
|
-
"version": "0.
|
|
544
|
+
"version": "0.3.1"
|
|
545
545
|
},
|
|
546
546
|
"@lapis-notes/api/path": {
|
|
547
547
|
"entry": "@lapis-notes/api/path",
|
|
@@ -554,7 +554,7 @@ export const pluginHostModuleRegistry = {
|
|
|
554
554
|
"public": true,
|
|
555
555
|
"source": "package-json-export",
|
|
556
556
|
"specifier": "@lapis-notes/api/path",
|
|
557
|
-
"version": "0.
|
|
557
|
+
"version": "0.3.1"
|
|
558
558
|
},
|
|
559
559
|
"@lapis-notes/api/plugin-assets": {
|
|
560
560
|
"entry": "@lapis-notes/api/plugin-assets",
|
|
@@ -567,7 +567,7 @@ export const pluginHostModuleRegistry = {
|
|
|
567
567
|
"public": true,
|
|
568
568
|
"source": "package-json-export",
|
|
569
569
|
"specifier": "@lapis-notes/api/plugin-assets",
|
|
570
|
-
"version": "0.
|
|
570
|
+
"version": "0.3.1"
|
|
571
571
|
},
|
|
572
572
|
"@lapis-notes/api/plugin-distribution-host": {
|
|
573
573
|
"entry": "@lapis-notes/api/plugin-distribution-host",
|
|
@@ -580,7 +580,7 @@ export const pluginHostModuleRegistry = {
|
|
|
580
580
|
"public": true,
|
|
581
581
|
"source": "package-json-export",
|
|
582
582
|
"specifier": "@lapis-notes/api/plugin-distribution-host",
|
|
583
|
-
"version": "0.
|
|
583
|
+
"version": "0.3.1"
|
|
584
584
|
},
|
|
585
585
|
"@lapis-notes/api/plugin-host-modules": {
|
|
586
586
|
"entry": "@lapis-notes/api/plugin-host-modules",
|
|
@@ -593,7 +593,7 @@ export const pluginHostModuleRegistry = {
|
|
|
593
593
|
"public": true,
|
|
594
594
|
"source": "package-json-export",
|
|
595
595
|
"specifier": "@lapis-notes/api/plugin-host-modules",
|
|
596
|
-
"version": "0.
|
|
596
|
+
"version": "0.3.1"
|
|
597
597
|
},
|
|
598
598
|
"@lapis-notes/api/registry/schema": {
|
|
599
599
|
"entry": "@lapis-notes/api/registry/schema",
|
|
@@ -606,7 +606,7 @@ export const pluginHostModuleRegistry = {
|
|
|
606
606
|
"public": true,
|
|
607
607
|
"source": "package-json-export",
|
|
608
608
|
"specifier": "@lapis-notes/api/registry/schema",
|
|
609
|
-
"version": "0.
|
|
609
|
+
"version": "0.3.1"
|
|
610
610
|
},
|
|
611
611
|
"@lapis-notes/api/runtime": {
|
|
612
612
|
"entry": "@lapis-notes/api/runtime",
|
|
@@ -619,7 +619,7 @@ export const pluginHostModuleRegistry = {
|
|
|
619
619
|
"public": true,
|
|
620
620
|
"source": "package-json-export",
|
|
621
621
|
"specifier": "@lapis-notes/api/runtime",
|
|
622
|
-
"version": "0.
|
|
622
|
+
"version": "0.3.1"
|
|
623
623
|
},
|
|
624
624
|
"@lapis-notes/api/search-embedding-worker": {
|
|
625
625
|
"entry": "@lapis-notes/api/search-embedding-worker",
|
|
@@ -632,7 +632,7 @@ export const pluginHostModuleRegistry = {
|
|
|
632
632
|
"public": true,
|
|
633
633
|
"source": "package-json-export",
|
|
634
634
|
"specifier": "@lapis-notes/api/search-embedding-worker",
|
|
635
|
-
"version": "0.
|
|
635
|
+
"version": "0.3.1"
|
|
636
636
|
},
|
|
637
637
|
"@lapis-notes/api/select": {
|
|
638
638
|
"entry": "@lapis-notes/api/select",
|
|
@@ -645,7 +645,7 @@ export const pluginHostModuleRegistry = {
|
|
|
645
645
|
"public": true,
|
|
646
646
|
"source": "package-json-export",
|
|
647
647
|
"specifier": "@lapis-notes/api/select",
|
|
648
|
-
"version": "0.
|
|
648
|
+
"version": "0.3.1"
|
|
649
649
|
},
|
|
650
650
|
"@lapis-notes/api/server-host": {
|
|
651
651
|
"entry": "@lapis-notes/api/server-host",
|
|
@@ -658,7 +658,7 @@ export const pluginHostModuleRegistry = {
|
|
|
658
658
|
"public": true,
|
|
659
659
|
"source": "package-json-export",
|
|
660
660
|
"specifier": "@lapis-notes/api/server-host",
|
|
661
|
-
"version": "0.
|
|
661
|
+
"version": "0.3.1"
|
|
662
662
|
},
|
|
663
663
|
"@lapis-notes/api/sync-repository": {
|
|
664
664
|
"entry": "@lapis-notes/api/sync-repository",
|
|
@@ -671,7 +671,7 @@ export const pluginHostModuleRegistry = {
|
|
|
671
671
|
"public": true,
|
|
672
672
|
"source": "package-json-export",
|
|
673
673
|
"specifier": "@lapis-notes/api/sync-repository",
|
|
674
|
-
"version": "0.
|
|
674
|
+
"version": "0.3.1"
|
|
675
675
|
},
|
|
676
676
|
"@lapis-notes/api/sync-security-host": {
|
|
677
677
|
"entry": "@lapis-notes/api/sync-security-host",
|
|
@@ -681,7 +681,7 @@ export const pluginHostModuleRegistry = {
|
|
|
681
681
|
"public": true,
|
|
682
682
|
"source": "package-json-export",
|
|
683
683
|
"specifier": "@lapis-notes/api/sync-security-host",
|
|
684
|
-
"version": "0.
|
|
684
|
+
"version": "0.3.1"
|
|
685
685
|
},
|
|
686
686
|
"@lapis-notes/api/telemetry": {
|
|
687
687
|
"entry": "@lapis-notes/api/telemetry",
|
|
@@ -694,7 +694,7 @@ export const pluginHostModuleRegistry = {
|
|
|
694
694
|
"public": true,
|
|
695
695
|
"source": "package-json-export",
|
|
696
696
|
"specifier": "@lapis-notes/api/telemetry",
|
|
697
|
-
"version": "0.
|
|
697
|
+
"version": "0.3.1"
|
|
698
698
|
},
|
|
699
699
|
"@lapis-notes/api/vault": {
|
|
700
700
|
"entry": "@lapis-notes/api/vault",
|
|
@@ -707,7 +707,7 @@ export const pluginHostModuleRegistry = {
|
|
|
707
707
|
"public": true,
|
|
708
708
|
"source": "package-json-export",
|
|
709
709
|
"specifier": "@lapis-notes/api/vault",
|
|
710
|
-
"version": "0.
|
|
710
|
+
"version": "0.3.1"
|
|
711
711
|
},
|
|
712
712
|
"@lapis-notes/api/workspace-host": {
|
|
713
713
|
"entry": "@lapis-notes/api/workspace-host",
|
|
@@ -720,7 +720,7 @@ export const pluginHostModuleRegistry = {
|
|
|
720
720
|
"public": true,
|
|
721
721
|
"source": "package-json-export",
|
|
722
722
|
"specifier": "@lapis-notes/api/workspace-host",
|
|
723
|
-
"version": "0.
|
|
723
|
+
"version": "0.3.1"
|
|
724
724
|
},
|
|
725
725
|
"@lapis-notes/markdown": {
|
|
726
726
|
"entry": "@lapis-notes/markdown",
|
|
@@ -5,4 +5,12 @@ export interface NativeEditingIntents {
|
|
|
5
5
|
call(command: EditingIntentCommand): Promise<EditingIntentValue>;
|
|
6
6
|
/** Expected absence is null; unavailable or unreadable files reject. */
|
|
7
7
|
read(path: string): Promise<TextSnapshot | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Subscribe to metadata invalidation, returning an idempotent disposer.
|
|
10
|
+
* Notify after registration and every reconnect or missed notification so the
|
|
11
|
+
* caller can list authoritative claims. Report observation failures without
|
|
12
|
+
* mutating or recovering claims. Disposing must stop delivery and reconnects.
|
|
13
|
+
* Older hosts may omit this port and retain compatible recovery polling.
|
|
14
|
+
*/
|
|
15
|
+
observe?(invalidate: () => void, error: (error: unknown) => void): () => void;
|
|
8
16
|
}
|
|
@@ -13,7 +13,7 @@ export declare class NativeEditingRecovery {
|
|
|
13
13
|
constructor(port: NativeEditingIntents, track: Track);
|
|
14
14
|
snapshot(): NativeEditingRecoverySnapshot;
|
|
15
15
|
subscribe(listener: Listener): () => void;
|
|
16
|
-
/** Shell-owned
|
|
16
|
+
/** Shell-owned passive observation; old hosts retain one shared poll. */
|
|
17
17
|
observe(): () => void;
|
|
18
18
|
refresh(): Promise<void>;
|
|
19
19
|
/** Hosts call this before destructive App/registry teardown. */
|
|
@@ -20,6 +20,10 @@ export class NativeEditingRecovery {
|
|
|
20
20
|
#mutation = 0;
|
|
21
21
|
#timer;
|
|
22
22
|
#pending;
|
|
23
|
+
#stopObservation;
|
|
24
|
+
#observationError;
|
|
25
|
+
#invalidation = 0;
|
|
26
|
+
#loaded;
|
|
23
27
|
constructor(port, track) {
|
|
24
28
|
this.port = port;
|
|
25
29
|
this.track = track;
|
|
@@ -34,10 +38,36 @@ export class NativeEditingRecovery {
|
|
|
34
38
|
this.#listeners.delete(listener);
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
|
-
/** Shell-owned
|
|
41
|
+
/** Shell-owned passive observation; old hosts retain one shared poll. */
|
|
38
42
|
observe() {
|
|
39
|
-
if (this.#observers++ === 0)
|
|
40
|
-
|
|
43
|
+
if (this.#observers++ === 0) {
|
|
44
|
+
const epoch = ++this.#epoch;
|
|
45
|
+
this.#observationError = undefined;
|
|
46
|
+
if (this.port.observe) {
|
|
47
|
+
const current = () => this.#observers > 0 && epoch === this.#epoch;
|
|
48
|
+
const failed = (error) => {
|
|
49
|
+
if (!current())
|
|
50
|
+
return;
|
|
51
|
+
this.#observationError = error;
|
|
52
|
+
this.#publish(this.#snapshot.claims, error);
|
|
53
|
+
};
|
|
54
|
+
try {
|
|
55
|
+
this.#stopObservation = this.port.observe(() => {
|
|
56
|
+
if (!current())
|
|
57
|
+
return;
|
|
58
|
+
this.#invalidation++;
|
|
59
|
+
this.#observationError = undefined;
|
|
60
|
+
void this.#load(epoch).catch(() => { });
|
|
61
|
+
}, failed);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
failed(error);
|
|
65
|
+
}
|
|
66
|
+
void this.#load(epoch).catch(() => { });
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
void this.#poll(epoch);
|
|
70
|
+
}
|
|
41
71
|
let held = true;
|
|
42
72
|
return () => {
|
|
43
73
|
if (!held)
|
|
@@ -47,6 +77,9 @@ export class NativeEditingRecovery {
|
|
|
47
77
|
this.#epoch++;
|
|
48
78
|
clearTimeout(this.#timer);
|
|
49
79
|
this.#timer = undefined;
|
|
80
|
+
const stop = this.#stopObservation;
|
|
81
|
+
this.#stopObservation = undefined;
|
|
82
|
+
stop?.();
|
|
50
83
|
}
|
|
51
84
|
};
|
|
52
85
|
}
|
|
@@ -67,6 +100,7 @@ export class NativeEditingRecovery {
|
|
|
67
100
|
if (this.#pending?.epoch === epoch)
|
|
68
101
|
return this.#pending.promise;
|
|
69
102
|
const mutation = this.#mutation;
|
|
103
|
+
const invalidation = this.#invalidation;
|
|
70
104
|
const promise = (async () => {
|
|
71
105
|
try {
|
|
72
106
|
const value = await this.port.call({ kind: "list" });
|
|
@@ -78,7 +112,8 @@ export class NativeEditingRecovery {
|
|
|
78
112
|
for (const id of this.#adopted)
|
|
79
113
|
if (!retained.has(id))
|
|
80
114
|
this.#adopted.delete(id);
|
|
81
|
-
this.#publish(value.states.filter((state) => state.detached || this.#adopted.has(state.editor_id)));
|
|
115
|
+
this.#publish(value.states.filter((state) => state.detached || this.#adopted.has(state.editor_id)), this.#observationError);
|
|
116
|
+
this.#loaded = { epoch, mutation, invalidation };
|
|
82
117
|
}
|
|
83
118
|
catch (error) {
|
|
84
119
|
if (epoch === this.#epoch && mutation === this.#mutation)
|
|
@@ -92,6 +127,11 @@ export class NativeEditingRecovery {
|
|
|
92
127
|
.finally(() => {
|
|
93
128
|
if (this.#pending === pending)
|
|
94
129
|
this.#pending = undefined;
|
|
130
|
+
if (this.port.observe &&
|
|
131
|
+
this.#observers &&
|
|
132
|
+
epoch === this.#epoch &&
|
|
133
|
+
(invalidation !== this.#invalidation || mutation !== this.#mutation))
|
|
134
|
+
void this.#load(epoch).catch(() => { });
|
|
95
135
|
})
|
|
96
136
|
.catch(() => { });
|
|
97
137
|
return promise;
|
|
@@ -99,6 +139,10 @@ export class NativeEditingRecovery {
|
|
|
99
139
|
/** Hosts call this before destructive App/registry teardown. */
|
|
100
140
|
async assertClear() {
|
|
101
141
|
await this.refresh();
|
|
142
|
+
if (this.#loaded?.epoch !== this.#epoch ||
|
|
143
|
+
this.#loaded.mutation !== this.#mutation ||
|
|
144
|
+
this.#loaded.invalidation !== this.#invalidation)
|
|
145
|
+
throw new Error("Editing claims changed; refresh Problems");
|
|
102
146
|
if (this.#snapshot.claims.length)
|
|
103
147
|
throw new Error("Unresolved editing claims require review in Problems");
|
|
104
148
|
}
|
|
@@ -168,11 +212,12 @@ export class NativeEditingRecovery {
|
|
|
168
212
|
throw error;
|
|
169
213
|
}
|
|
170
214
|
finally {
|
|
215
|
+
this.#mutation++;
|
|
171
216
|
this.#acting.delete(current.editor_id);
|
|
172
217
|
}
|
|
173
218
|
});
|
|
174
219
|
}
|
|
175
|
-
#publish(claims, error) {
|
|
220
|
+
#publish(claims, error = this.#observationError) {
|
|
176
221
|
const message = error
|
|
177
222
|
? error instanceof Error
|
|
178
223
|
? error.message
|