@openfairygui/backend 0.6.2 → 0.7.0

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 (48) hide show
  1. package/dist/contracts-Bx8HUr7I.d.cts +756 -0
  2. package/dist/contracts-CMQiPEyz.d.mts +756 -0
  3. package/dist/diagnostics-CIe7S-RW.cjs +670 -0
  4. package/dist/diagnostics-CZ12H1Mx.d.cts +1679 -0
  5. package/dist/diagnostics-CpJ8cAP6.d.mts +1679 -0
  6. package/dist/diagnostics-DTnLXQGs.mjs +641 -0
  7. package/dist/docs.cjs +11506 -5902
  8. package/dist/docs.d.cts +5 -185
  9. package/dist/docs.d.mts +5 -185
  10. package/dist/docs.mjs +11504 -5901
  11. package/dist/index.cjs +16 -2703
  12. package/dist/index.d.cts +5 -2362
  13. package/dist/index.d.mts +5 -2362
  14. package/dist/index.mjs +4 -2691
  15. package/dist/node.cjs +367 -2779
  16. package/dist/node.d.cts +4 -724
  17. package/dist/node.d.mts +4 -724
  18. package/dist/node.mjs +359 -2751
  19. package/dist/rolldown-runtime-BJqNVkSG.cjs +28 -0
  20. package/dist/runtime-DYqG77ak.cjs +2249 -0
  21. package/dist/runtime-gStewf1p.mjs +2189 -0
  22. package/package.json +4 -5
  23. package/src/contracts.ts +0 -58
  24. package/src/diagnostics.ts +0 -188
  25. package/src/docs.ts +0 -109
  26. package/src/generated/contracts.ts +0 -24165
  27. package/src/generated/docs.ts +0 -12
  28. package/src/index.ts +0 -99
  29. package/src/node.ts +0 -317
  30. package/src/path-policy.ts +0 -123
  31. package/src/runtime/capabilities.ts +0 -131
  32. package/src/runtime/contracts.ts +0 -672
  33. package/src/runtime.ts +0 -231
  34. package/src/services/artifact-service.ts +0 -19
  35. package/src/services/authoring-service.ts +0 -229
  36. package/src/services/cache-service.ts +0 -81
  37. package/src/services/capture-project.ts +0 -75
  38. package/src/services/context.ts +0 -150
  39. package/src/services/event-service.ts +0 -86
  40. package/src/services/persistence-service.ts +0 -550
  41. package/src/services/read-service.ts +0 -274
  42. package/src/services/runtime-service.ts +0 -342
  43. package/src/services/session-operation-queue.ts +0 -21
  44. package/src/services/session-project-writer.ts +0 -89
  45. package/src/services/session-registry.ts +0 -70
  46. package/src/services/session-utils.ts +0 -45
  47. package/src/services/transaction-preview.ts +0 -116
  48. package/src/storage.ts +0 -232
@@ -0,0 +1,670 @@
1
+ //#region src/diagnostics.ts
2
+ const selector = {
3
+ kind: "revise-selector",
4
+ message: "Read the current outline and query the relevant entity. Use its exact identifiers, inspect the reported selector path, then rebuild and preflight the transaction. Do not guess identifiers or retry the unchanged transaction."
5
+ };
6
+ const source = {
7
+ kind: "host-action",
8
+ message: "Ask the host to inspect the reported source and hydrate its bytes through project I/O or import. Preserve unsaved work; reopening disk state can discard it. No session hydration/repair API is exposed. Revalidate and replan after the host has supplied a complete project."
9
+ };
10
+ const path = {
11
+ kind: "host-action",
12
+ message: "Ask the host to review the attempted path and authorized project root. saveSession only writes the original project; it is not Save As. Do not widen allowed roots or bypass path checks. A separately authorized export may use materializeSession."
13
+ };
14
+ const unsupported = {
15
+ kind: "revise-operation",
16
+ message: "Read the operation schema, capabilities and reported target kind/field. Stop unsupported work or replan using supported operations with equivalent intended semantics. Never silently drop fields or objects to make a transaction pass."
17
+ };
18
+ const payload = {
19
+ kind: "revise-operation",
20
+ message: "Inspect the diagnostic path and current operation schema or UAM issues. Correct values, required fields and indices against exact queried entities, then preflight. Do not invent defaults or coerce away invalid data."
21
+ };
22
+ const unchanged = {
23
+ kind: "refresh-and-replan",
24
+ message: "Query current settings/entity and compare with the request. If already satisfied, report no change; otherwise replan from the current revision. Do not manufacture a mutation or resubmit the same no-op."
25
+ };
26
+ const duplicate = {
27
+ kind: "revise-operation",
28
+ message: "Query current entities and resolve the conflicting ID, name or page explicitly. Choose an unused value only when authorized by the intended edit, then preflight. Never overwrite or delete an existing entity to clear the conflict."
29
+ };
30
+ const references = {
31
+ kind: "revise-operation",
32
+ message: "Query affected entities and references before editing, moving or removing anything. Replan intended dependent changes together and preflight. Do not delete dependent objects or strip references without authorization."
33
+ };
34
+ const project = {
35
+ kind: "host-action",
36
+ message: "Inspect the project path and validation diagnostics with the host. Correct source XML/settings or unsupported geometry using authoritative project data; preserve originals and unsaved work before reopening or validating. Do not guess missing structure or discard rejected content."
37
+ };
38
+ const capability = {
39
+ kind: "host-action",
40
+ message: "Read capability/error details. Ask the host to provide the required filesystem, decoder or complete UAM adapter. Preserve the session and unsaved work; do not substitute a lossy path or bypass checks."
41
+ };
42
+ const write = {
43
+ kind: "host-action",
44
+ message: "Preserve the dirty session and inspect the error, actual target files and permissions with the host. Partial writes may have changed files: verify or recover them before a newly authorized save. Do not clear dirty state, discard memory or blindly retry."
45
+ };
46
+ /** Exhaustiveness and exact ownership are checked against the canonical unions. */
47
+ const BACKEND_DIAGNOSTIC_GUIDES = [
48
+ {
49
+ code: "stale_read",
50
+ owners: ["backend"],
51
+ remediation: {
52
+ kind: "refresh-and-replan",
53
+ message: "Discard the incomplete model/bytes read and restart with readSessionState. Use its revision for every readResourceBytes call. No historical state is retained or reserved; do not combine resources from different edit revisions."
54
+ }
55
+ },
56
+ {
57
+ code: "session_read_failed",
58
+ owners: ["backend"],
59
+ remediation: {
60
+ kind: "host-action",
61
+ message: "Inspect error.reason: invalid_query requires valid inputs; not_found/ambiguous requires exact current resource identifiers; unsupported_resource/bytes_unavailable means primary bytes cannot be read from this session. Budget or non-JSON failures require host inspection. Preserve unsaved work; do not save, reopen, repair or mutate the model merely to obtain a read."
62
+ }
63
+ },
64
+ {
65
+ code: "transaction_preview_failed",
66
+ owners: ["backend"],
67
+ remediation: {
68
+ kind: "host-action",
69
+ message: "No complete preview is available. Inspect error.reason with the host: response_budget_exceeded requires a smaller independently meaningful authorized batch; projection_failed requires inspecting the project serialization failure. Preserve the session and never treat a missing or truncated impact as approval to apply or save."
70
+ }
71
+ },
72
+ {
73
+ code: "stale_write",
74
+ owners: ["backend"],
75
+ remediation: {
76
+ kind: "refresh-and-replan",
77
+ message: "Refresh the outline and affected entities, then replan from their current revision and preflight again. A preview reserves no revision. Never replace expectedRevision and blindly retry the original transaction or save."
78
+ }
79
+ },
80
+ {
81
+ code: "entity_query_failed",
82
+ owners: ["backend"],
83
+ remediation: {
84
+ kind: "host-action",
85
+ message: "Inspect error.reason: invalid_query requires correcting the target; not_found/ambiguous requires current exact identifiers; response_budget_exceeded/non_json_value requires host inspection of the entity. Do not broaden queries or mutate data to evade the response limits."
86
+ }
87
+ },
88
+ {
89
+ code: "session_not_found",
90
+ owners: ["backend"],
91
+ remediation: {
92
+ kind: "host-action",
93
+ message: "Ask the host to confirm the runtime and project, recover any unsaved state, then explicitly open a new session if appropriate. Session IDs are runtime-local. Read its new revision and replan; never reuse an expired session or assume disk contains unsaved changes."
94
+ }
95
+ },
96
+ {
97
+ code: "session_close_failed",
98
+ owners: ["backend"],
99
+ remediation: {
100
+ kind: "host-action",
101
+ message: "The session and lock ownership remain registered. Inspect the reported lock release failure, correct the storage problem, then retry closeSession with the same session ID. Do not remove the lock file or open a replacement session to bypass the owner."
102
+ }
103
+ },
104
+ {
105
+ code: "path_policy_violation",
106
+ owners: ["backend"],
107
+ remediation: path
108
+ },
109
+ {
110
+ code: "project_root_not_allowed",
111
+ owners: ["backend"],
112
+ remediation: path
113
+ },
114
+ {
115
+ code: "invalid_package_selector",
116
+ owners: ["core.transaction"],
117
+ remediation: selector
118
+ },
119
+ {
120
+ code: "invalid_component_selector",
121
+ owners: ["core.transaction"],
122
+ remediation: selector
123
+ },
124
+ {
125
+ code: "invalid_resource_selector",
126
+ owners: ["core.transaction"],
127
+ remediation: selector
128
+ },
129
+ {
130
+ code: "invalid_display_node_selector",
131
+ owners: ["core.transaction"],
132
+ remediation: selector
133
+ },
134
+ {
135
+ code: "invalid_resource_folder_selector",
136
+ owners: ["core.transaction"],
137
+ remediation: selector
138
+ },
139
+ {
140
+ code: "invalid_branch_selector",
141
+ owners: ["core.transaction"],
142
+ remediation: selector
143
+ },
144
+ {
145
+ code: "invalid_gear_selector",
146
+ owners: ["core.transaction"],
147
+ remediation: selector
148
+ },
149
+ {
150
+ code: "invalid_look_gear_selector",
151
+ owners: ["core.transaction"],
152
+ remediation: selector
153
+ },
154
+ {
155
+ code: "selector_ambiguity",
156
+ owners: ["core.transaction"],
157
+ remediation: selector
158
+ },
159
+ {
160
+ code: "unavailable_resource_source_bytes",
161
+ owners: ["core.transaction"],
162
+ remediation: source
163
+ },
164
+ {
165
+ code: "missing_source",
166
+ owners: ["core.validation"],
167
+ remediation: source
168
+ },
169
+ {
170
+ code: "unreadable_source",
171
+ owners: ["core.validation"],
172
+ remediation: source
173
+ },
174
+ {
175
+ code: "decode_capability_unavailable",
176
+ owners: ["core.validation"],
177
+ remediation: {
178
+ kind: "host-action",
179
+ message: "Validation is incomplete, not passed. Inspect whether source bytes are unloaded or a decoder is unavailable. Ask the host to hydrate sources or provide the required decoder (Node image validation uses optional Sharp), then validate again. Do not install dependencies or change the project automatically."
180
+ }
181
+ },
182
+ {
183
+ code: "session_limit_exceeded",
184
+ owners: ["backend"],
185
+ remediation: {
186
+ kind: "host-action",
187
+ message: "Close sessions you opened and no longer need with closeSession, then retry. Do not close sessions owned by another task or host; ask the host to raise maxSessions if more concurrent projects are required."
188
+ }
189
+ },
190
+ {
191
+ code: "session_id_conflict",
192
+ owners: ["backend"],
193
+ remediation: {
194
+ kind: "host-action",
195
+ message: "Use getSession to inspect the existing session. Reuse it only for the intended project, or choose a new session ID; do not close another owner\\u0027s session to make room."
196
+ }
197
+ },
198
+ {
199
+ code: "lock_conflict",
200
+ owners: ["backend"],
201
+ remediation: {
202
+ kind: "host-action",
203
+ message: "Another owner holds the project lock. Preserve unsaved work and ask that owner to close its session, then explicitly reopen. Never remove a live lock, force-close a peer, or bypass locking."
204
+ }
205
+ },
206
+ {
207
+ code: "event_cursor_invalid",
208
+ owners: ["backend"],
209
+ remediation: {
210
+ kind: "refresh-and-replan",
211
+ message: "Read the error and getEvents cursor bounds. Request a fresh bounded event page without the invalid cursor and refresh the current outline before replanning; missing retained history is not evidence that nothing changed."
212
+ }
213
+ },
214
+ {
215
+ code: "corrupt_source",
216
+ owners: ["core.validation"],
217
+ remediation: source
218
+ },
219
+ {
220
+ code: "unsupported_operation",
221
+ owners: ["core.transaction"],
222
+ remediation: unsupported
223
+ },
224
+ {
225
+ code: "invalid_operation_payload",
226
+ owners: ["core.transaction"],
227
+ remediation: payload
228
+ },
229
+ {
230
+ code: "transaction_unsupported",
231
+ owners: ["core.transaction"],
232
+ remediation: unsupported
233
+ },
234
+ {
235
+ code: "unsupported_display_node_kind",
236
+ owners: ["core.transaction"],
237
+ remediation: unsupported
238
+ },
239
+ {
240
+ code: "unsupported_cross_package_image_ref",
241
+ owners: ["core.transaction"],
242
+ remediation: unsupported
243
+ },
244
+ {
245
+ code: "unsupported_gear_kind",
246
+ owners: ["core.transaction"],
247
+ remediation: unsupported
248
+ },
249
+ {
250
+ code: "unsupported_resource_mutation",
251
+ owners: ["core.transaction"],
252
+ remediation: unsupported
253
+ },
254
+ {
255
+ code: "unsupported_display_node_mutation",
256
+ owners: ["core.transaction"],
257
+ remediation: unsupported
258
+ },
259
+ {
260
+ code: "unsupported_text_field_target",
261
+ owners: ["core.transaction"],
262
+ remediation: unsupported
263
+ },
264
+ {
265
+ code: "unsupported_display_node_field",
266
+ owners: ["core.transaction"],
267
+ remediation: unsupported
268
+ },
269
+ {
270
+ code: "unsupported_operation_batch",
271
+ owners: ["core.transaction"],
272
+ remediation: unsupported
273
+ },
274
+ {
275
+ code: "unsupported_resource_kind",
276
+ owners: ["core.transaction", "core.validation"],
277
+ remediation: unsupported
278
+ },
279
+ {
280
+ code: "invalid_project_settings",
281
+ owners: ["core.transaction"],
282
+ remediation: payload
283
+ },
284
+ {
285
+ code: "invalid_package_settings",
286
+ owners: ["core.transaction"],
287
+ remediation: payload
288
+ },
289
+ {
290
+ code: "invalid_display_node_payload",
291
+ owners: ["core.transaction"],
292
+ remediation: payload
293
+ },
294
+ {
295
+ code: "invalid_resource_name",
296
+ owners: ["core.transaction"],
297
+ remediation: payload
298
+ },
299
+ {
300
+ code: "invalid_resource_path",
301
+ owners: ["core.transaction"],
302
+ remediation: payload
303
+ },
304
+ {
305
+ code: "invalid_resource_folder_path",
306
+ owners: ["core.transaction"],
307
+ remediation: payload
308
+ },
309
+ {
310
+ code: "invalid_resource_folder_atlas",
311
+ owners: ["core.transaction"],
312
+ remediation: payload
313
+ },
314
+ {
315
+ code: "invalid_attach_index",
316
+ owners: ["core.transaction"],
317
+ remediation: payload
318
+ },
319
+ {
320
+ code: "invalid_controller_payload",
321
+ owners: ["core.transaction"],
322
+ remediation: payload
323
+ },
324
+ {
325
+ code: "invalid_transition_payload",
326
+ owners: ["core.transaction"],
327
+ remediation: payload
328
+ },
329
+ {
330
+ code: "invalid_look_gear_payload",
331
+ owners: ["core.transaction"],
332
+ remediation: payload
333
+ },
334
+ {
335
+ code: "invalid_gear_payload",
336
+ owners: ["core.transaction"],
337
+ remediation: payload
338
+ },
339
+ {
340
+ code: "invalid_resource_payload",
341
+ owners: ["core.transaction"],
342
+ remediation: payload
343
+ },
344
+ {
345
+ code: "projection_failed",
346
+ owners: ["core.transaction"],
347
+ remediation: {
348
+ kind: "host-action",
349
+ message: "Transaction projection failed. Inspect the project and operation batch; no successful support decision is available and no change has been applied."
350
+ }
351
+ },
352
+ {
353
+ code: "invalid_resource_bytes",
354
+ owners: ["core.transaction"],
355
+ remediation: payload
356
+ },
357
+ {
358
+ code: "invalid_movie_clip_jta",
359
+ owners: ["core.transaction"],
360
+ remediation: payload
361
+ },
362
+ {
363
+ code: "invalid_resource_index",
364
+ owners: ["core.transaction"],
365
+ remediation: payload
366
+ },
367
+ {
368
+ code: "invalid_branch_name",
369
+ owners: ["core.transaction"],
370
+ remediation: payload
371
+ },
372
+ {
373
+ code: "invalid_package_payload",
374
+ owners: ["core.transaction"],
375
+ remediation: payload
376
+ },
377
+ {
378
+ code: "invalid_package_index",
379
+ owners: ["core.transaction"],
380
+ remediation: payload
381
+ },
382
+ {
383
+ code: "invalid_component_payload",
384
+ owners: ["core.transaction"],
385
+ remediation: payload
386
+ },
387
+ {
388
+ code: "invalid_component_index",
389
+ owners: ["core.transaction"],
390
+ remediation: payload
391
+ },
392
+ {
393
+ code: "invalid_component_move",
394
+ owners: ["core.transaction"],
395
+ remediation: payload
396
+ },
397
+ {
398
+ code: "invalid_uam",
399
+ owners: ["core.transaction", "core.validation"],
400
+ remediation: payload
401
+ },
402
+ {
403
+ code: "project_settings_unchanged",
404
+ owners: ["core.transaction"],
405
+ remediation: unchanged
406
+ },
407
+ {
408
+ code: "package_settings_unchanged",
409
+ owners: ["core.transaction"],
410
+ remediation: unchanged
411
+ },
412
+ {
413
+ code: "display_node_props_unchanged",
414
+ owners: ["core.transaction"],
415
+ remediation: unchanged
416
+ },
417
+ {
418
+ code: "resource_folder_atlas_unchanged",
419
+ owners: ["core.transaction"],
420
+ remediation: unchanged
421
+ },
422
+ {
423
+ code: "duplicate_look_gear_controller",
424
+ owners: ["core.transaction"],
425
+ remediation: duplicate
426
+ },
427
+ {
428
+ code: "duplicate_transition_name",
429
+ owners: ["core.transaction"],
430
+ remediation: duplicate
431
+ },
432
+ {
433
+ code: "duplicate_look_gear_state_page",
434
+ owners: ["core.transaction"],
435
+ remediation: duplicate
436
+ },
437
+ {
438
+ code: "duplicate_gear_controller",
439
+ owners: ["core.transaction"],
440
+ remediation: duplicate
441
+ },
442
+ {
443
+ code: "duplicate_gear_state_page",
444
+ owners: ["core.transaction"],
445
+ remediation: duplicate
446
+ },
447
+ {
448
+ code: "duplicate_branch_name",
449
+ owners: ["core.transaction"],
450
+ remediation: duplicate
451
+ },
452
+ {
453
+ code: "duplicate_component_id",
454
+ owners: ["core.transaction"],
455
+ remediation: duplicate
456
+ },
457
+ {
458
+ code: "resource_folder_conflict",
459
+ owners: ["core.transaction"],
460
+ remediation: duplicate
461
+ },
462
+ {
463
+ code: "duplicate_resource_id",
464
+ owners: ["core.transaction", "core.validation"],
465
+ remediation: duplicate
466
+ },
467
+ {
468
+ code: "duplicate_package_id",
469
+ owners: ["core.transaction", "core.validation"],
470
+ remediation: duplicate
471
+ },
472
+ {
473
+ code: "duplicate_package_name",
474
+ owners: ["core.transaction", "core.validation"],
475
+ remediation: duplicate
476
+ },
477
+ {
478
+ code: "resource_folder_not_empty",
479
+ owners: ["core.transaction"],
480
+ remediation: references
481
+ },
482
+ {
483
+ code: "branch_not_empty",
484
+ owners: ["core.transaction"],
485
+ remediation: references
486
+ },
487
+ {
488
+ code: "branch_referenced",
489
+ owners: ["core.transaction"],
490
+ remediation: references
491
+ },
492
+ {
493
+ code: "invalid_resource_reference",
494
+ owners: ["core.transaction"],
495
+ remediation: references
496
+ },
497
+ {
498
+ code: "invalid_component_reference",
499
+ owners: ["core.transaction"],
500
+ remediation: references
501
+ },
502
+ {
503
+ code: "invalid_group_reference",
504
+ owners: ["core.transaction"],
505
+ remediation: references
506
+ },
507
+ {
508
+ code: "package_referenced",
509
+ owners: ["core.transaction"],
510
+ remediation: references
511
+ },
512
+ {
513
+ code: "component_referenced",
514
+ owners: ["core.transaction"],
515
+ remediation: references
516
+ },
517
+ {
518
+ code: "component_has_package_dependencies",
519
+ owners: ["core.transaction"],
520
+ remediation: references
521
+ },
522
+ {
523
+ code: "dangling_resource_reference",
524
+ owners: ["core.validation"],
525
+ remediation: references
526
+ },
527
+ {
528
+ code: "invalid_project_xml",
529
+ owners: ["core.validation"],
530
+ remediation: project
531
+ },
532
+ {
533
+ code: "invalid_package_xml",
534
+ owners: ["core.validation"],
535
+ remediation: project
536
+ },
537
+ {
538
+ code: "invalid_branch_package_xml",
539
+ owners: ["core.validation"],
540
+ remediation: project
541
+ },
542
+ {
543
+ code: "invalid_component_xml",
544
+ owners: ["core.validation"],
545
+ remediation: project
546
+ },
547
+ {
548
+ code: "invalid_project_value",
549
+ owners: ["core.validation"],
550
+ remediation: project
551
+ },
552
+ {
553
+ code: "desktop_incompatible_geometry",
554
+ owners: ["core.validation"],
555
+ remediation: project
556
+ },
557
+ {
558
+ code: "invalid_settings_json",
559
+ owners: ["core.validation"],
560
+ remediation: project
561
+ },
562
+ {
563
+ code: "path_collision",
564
+ owners: ["core.validation"],
565
+ remediation: path
566
+ },
567
+ {
568
+ code: "unsafe_path",
569
+ owners: ["core.validation"],
570
+ remediation: path
571
+ },
572
+ {
573
+ code: "capability_unavailable",
574
+ owners: ["backend"],
575
+ remediation: capability
576
+ },
577
+ {
578
+ code: "uam_fidelity_unsupported",
579
+ owners: ["backend"],
580
+ remediation: capability
581
+ },
582
+ {
583
+ code: "save_partial_failure",
584
+ owners: ["backend"],
585
+ remediation: write
586
+ },
587
+ {
588
+ code: "write_failed",
589
+ owners: ["backend"],
590
+ remediation: write
591
+ },
592
+ {
593
+ code: "project_open_failed",
594
+ owners: ["backend"],
595
+ remediation: project
596
+ },
597
+ {
598
+ code: "materialize_validation_failed",
599
+ owners: ["backend"],
600
+ remediation: project
601
+ },
602
+ {
603
+ code: "execution_failure",
604
+ owners: ["core.transaction"],
605
+ remediation: {
606
+ kind: "host-action",
607
+ message: "Inspect the execution/cache failure and current session/revision. Preserve sources and unsaved work and report the cause to the host. Replan after resolution; failed execution or cache work is not a completed edit."
608
+ }
609
+ }
610
+ ];
611
+ const BACKEND_DIAGNOSTICS_URI = "openfairygui://docs/diagnostics";
612
+ const BACKEND_DIAGNOSTIC_TEMPLATE = `${BACKEND_DIAGNOSTICS_URI}/{code}`;
613
+ function getBackendDiagnosticCatalog() {
614
+ return BACKEND_DIAGNOSTIC_GUIDES.map((guide) => ({
615
+ ...structuredClone(guide),
616
+ docsUri: `${BACKEND_DIAGNOSTICS_URI}/${guide.code}`
617
+ }));
618
+ }
619
+ function getBackendDiagnosticGuide(code) {
620
+ const guide = getBackendDiagnosticCatalog().find((entry) => entry.code === code);
621
+ if (!guide) throw new RangeError(`No recovery guide for diagnostic: ${code}`);
622
+ return guide;
623
+ }
624
+ function enrichBackendDiagnostic(diagnostic, sessionId) {
625
+ const guide = BACKEND_DIAGNOSTIC_GUIDES.find((entry) => entry.code === diagnostic.code);
626
+ if (!guide) return { ...diagnostic };
627
+ return {
628
+ ...diagnostic,
629
+ owner: diagnostic.owner ?? guide.owners[0],
630
+ docsUri: `${BACKEND_DIAGNOSTICS_URI}/${guide.code}`,
631
+ remediation: {
632
+ ...guide.remediation,
633
+ ...sessionId && guide.remediation.kind !== "host-action" ? { read: {
634
+ method: "getProjectOutline",
635
+ input: { sessionId }
636
+ } } : {}
637
+ }
638
+ };
639
+ }
640
+ //#endregion
641
+ Object.defineProperty(exports, "BACKEND_DIAGNOSTICS_URI", {
642
+ enumerable: true,
643
+ get: function() {
644
+ return BACKEND_DIAGNOSTICS_URI;
645
+ }
646
+ });
647
+ Object.defineProperty(exports, "BACKEND_DIAGNOSTIC_TEMPLATE", {
648
+ enumerable: true,
649
+ get: function() {
650
+ return BACKEND_DIAGNOSTIC_TEMPLATE;
651
+ }
652
+ });
653
+ Object.defineProperty(exports, "enrichBackendDiagnostic", {
654
+ enumerable: true,
655
+ get: function() {
656
+ return enrichBackendDiagnostic;
657
+ }
658
+ });
659
+ Object.defineProperty(exports, "getBackendDiagnosticCatalog", {
660
+ enumerable: true,
661
+ get: function() {
662
+ return getBackendDiagnosticCatalog;
663
+ }
664
+ });
665
+ Object.defineProperty(exports, "getBackendDiagnosticGuide", {
666
+ enumerable: true,
667
+ get: function() {
668
+ return getBackendDiagnosticGuide;
669
+ }
670
+ });