@dxos/plugin-observability 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51

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 (116) hide show
  1. package/dist/lib/browser/{ObservabilitySettings-EM7ABGCA.mjs → ObservabilitySettings-H6UKYDDT.mjs} +9 -13
  2. package/dist/lib/browser/ObservabilitySettings-H6UKYDDT.mjs.map +7 -0
  3. package/dist/lib/browser/{capture-user-feedback-H4KPG7PC.mjs → capture-user-feedback-3BXDUCZM.mjs} +4 -5
  4. package/dist/lib/browser/capture-user-feedback-3BXDUCZM.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-VZR3FNBD.mjs → chunk-DLBA63VM.mjs} +3 -5
  6. package/dist/lib/browser/chunk-DLBA63VM.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-6WX6ST5B.mjs → chunk-VQC6DG6V.mjs} +6 -2
  8. package/dist/lib/browser/chunk-VQC6DG6V.mjs.map +7 -0
  9. package/dist/lib/browser/cli/index.mjs +1 -1
  10. package/dist/lib/browser/cli/index.mjs.map +3 -3
  11. package/dist/lib/browser/index.mjs +21 -10
  12. package/dist/lib/browser/index.mjs.map +3 -3
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/operations/index.mjs +3 -4
  15. package/dist/lib/browser/operations/index.mjs.map +3 -3
  16. package/dist/lib/browser/{send-event-BICCRJ2W.mjs → send-event-F3D32CJX.mjs} +4 -5
  17. package/dist/lib/browser/send-event-F3D32CJX.mjs.map +7 -0
  18. package/dist/lib/browser/{toggle-NV2X62VV.mjs → toggle-PPNDFGWJ.mjs} +4 -5
  19. package/dist/lib/browser/toggle-PPNDFGWJ.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-K33HLC3Z.mjs → translations.mjs} +4 -4
  21. package/dist/lib/browser/translations.mjs.map +7 -0
  22. package/dist/lib/browser/types/index.mjs +1 -1
  23. package/dist/lib/node-esm/{ObservabilitySettings-VP4A362Z.mjs → ObservabilitySettings-HXTWPHHR.mjs} +9 -13
  24. package/dist/lib/node-esm/ObservabilitySettings-HXTWPHHR.mjs.map +7 -0
  25. package/dist/lib/node-esm/{capture-user-feedback-DTL3DUXB.mjs → capture-user-feedback-LUPWJWGK.mjs} +4 -5
  26. package/dist/lib/{browser/capture-user-feedback-H4KPG7PC.mjs.map → node-esm/capture-user-feedback-LUPWJWGK.mjs.map} +1 -1
  27. package/dist/lib/node-esm/{chunk-FZRJBWSE.mjs → chunk-3B7HMSKM.mjs} +3 -5
  28. package/dist/lib/node-esm/chunk-3B7HMSKM.mjs.map +7 -0
  29. package/dist/lib/node-esm/{chunk-QZKJ2TUU.mjs → chunk-NCIKZY6L.mjs} +6 -2
  30. package/dist/lib/node-esm/chunk-NCIKZY6L.mjs.map +7 -0
  31. package/dist/lib/node-esm/cli/index.mjs +1 -1
  32. package/dist/lib/node-esm/cli/index.mjs.map +3 -3
  33. package/dist/lib/node-esm/index.mjs +21 -10
  34. package/dist/lib/node-esm/index.mjs.map +3 -3
  35. package/dist/lib/node-esm/meta.json +1 -1
  36. package/dist/lib/node-esm/operations/index.mjs +3 -4
  37. package/dist/lib/node-esm/operations/index.mjs.map +3 -3
  38. package/dist/lib/node-esm/{send-event-IWZKYZBI.mjs → send-event-OKTEXC7M.mjs} +4 -5
  39. package/dist/lib/{browser/send-event-BICCRJ2W.mjs.map → node-esm/send-event-OKTEXC7M.mjs.map} +1 -1
  40. package/dist/lib/node-esm/{toggle-NJWUAPD4.mjs → toggle-YS2KFMXS.mjs} +4 -5
  41. package/dist/lib/node-esm/toggle-YS2KFMXS.mjs.map +7 -0
  42. package/dist/lib/node-esm/{chunk-JGHMP7UL.mjs → translations.mjs} +3 -4
  43. package/dist/lib/node-esm/translations.mjs.map +7 -0
  44. package/dist/lib/node-esm/types/index.mjs +1 -1
  45. package/dist/types/src/ObservabilityPlugin.d.ts +5 -0
  46. package/dist/types/src/ObservabilityPlugin.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  48. package/dist/types/src/capabilities/client-ready.d.ts.map +1 -1
  49. package/dist/types/src/capabilities/index.d.ts +1 -1
  50. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  52. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  54. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  56. package/dist/types/src/components/FeedbackForm/FeedbackForm.d.ts +5 -2
  57. package/dist/types/src/components/FeedbackForm/FeedbackForm.d.ts.map +1 -1
  58. package/dist/types/src/components/FeedbackForm/FeedbackForm.stories.d.ts +19 -19
  59. package/dist/types/src/components/FeedbackForm/FeedbackForm.stories.d.ts.map +1 -1
  60. package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.d.ts +1 -1
  61. package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.d.ts.map +1 -1
  62. package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.stories.d.ts +17 -18
  63. package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.stories.d.ts.map +1 -1
  64. package/dist/types/src/containers/HelpContainer/HelpContainer.d.ts.map +1 -1
  65. package/dist/types/src/index.d.ts +0 -1
  66. package/dist/types/src/index.d.ts.map +1 -1
  67. package/dist/types/src/operations/capture-user-feedback.d.ts +1 -1
  68. package/dist/types/src/operations/capture-user-feedback.d.ts.map +1 -1
  69. package/dist/types/src/operations/definitions.d.ts +1 -1
  70. package/dist/types/src/operations/definitions.d.ts.map +1 -1
  71. package/dist/types/src/operations/index.d.ts +1 -1
  72. package/dist/types/src/operations/index.d.ts.map +1 -1
  73. package/dist/types/src/operations/send-event.d.ts +1 -1
  74. package/dist/types/src/operations/send-event.d.ts.map +1 -1
  75. package/dist/types/src/operations/toggle.d.ts +1 -1
  76. package/dist/types/src/operations/toggle.d.ts.map +1 -1
  77. package/dist/types/src/translations.d.ts +17 -19
  78. package/dist/types/src/translations.d.ts.map +1 -1
  79. package/dist/types/src/types/Settings.d.ts +1 -1
  80. package/dist/types/src/types/Settings.d.ts.map +1 -1
  81. package/dist/types/src/types/capabilities.d.ts +6 -0
  82. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  83. package/dist/types/src/types/events.d.ts.map +1 -1
  84. package/dist/types/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +32 -25
  86. package/src/ObservabilityPlugin.ts +14 -2
  87. package/src/capabilities/client-ready.ts +23 -1
  88. package/src/capabilities/index.ts +1 -1
  89. package/src/capabilities/operation-handler.ts +1 -1
  90. package/src/cli/plugin.ts +1 -1
  91. package/src/components/FeedbackForm/FeedbackForm.stories.tsx +13 -1
  92. package/src/components/FeedbackForm/FeedbackForm.tsx +19 -3
  93. package/src/components/ObservabilitySettings/ObservabilitySettings.stories.tsx +2 -1
  94. package/src/components/ObservabilitySettings/ObservabilitySettings.tsx +8 -12
  95. package/src/containers/HelpContainer/HelpContainer.tsx +3 -2
  96. package/src/index.ts +0 -1
  97. package/src/operations/capture-user-feedback.ts +1 -1
  98. package/src/operations/definitions.ts +2 -3
  99. package/src/operations/index.ts +1 -1
  100. package/src/operations/send-event.ts +1 -1
  101. package/src/operations/toggle.ts +1 -1
  102. package/src/translations.ts +1 -2
  103. package/src/types/Settings.ts +4 -1
  104. package/src/types/capabilities.ts +7 -0
  105. package/dist/lib/browser/ObservabilitySettings-EM7ABGCA.mjs.map +0 -7
  106. package/dist/lib/browser/chunk-6WX6ST5B.mjs.map +0 -7
  107. package/dist/lib/browser/chunk-K33HLC3Z.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-VZR3FNBD.mjs.map +0 -7
  109. package/dist/lib/browser/toggle-NV2X62VV.mjs.map +0 -7
  110. package/dist/lib/node-esm/ObservabilitySettings-VP4A362Z.mjs.map +0 -7
  111. package/dist/lib/node-esm/capture-user-feedback-DTL3DUXB.mjs.map +0 -7
  112. package/dist/lib/node-esm/chunk-FZRJBWSE.mjs.map +0 -7
  113. package/dist/lib/node-esm/chunk-JGHMP7UL.mjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-QZKJ2TUU.mjs.map +0 -7
  115. package/dist/lib/node-esm/send-event-IWZKYZBI.mjs.map +0 -7
  116. package/dist/lib/node-esm/toggle-NJWUAPD4.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-observability",
3
- "version": "0.8.4-main.422d1c7879",
3
+ "version": "0.8.4-main.51f1e5ca51",
4
4
  "description": "DXOS app framework plugin for hooking up app observability",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -18,6 +18,7 @@
18
18
  "#containers": "./src/containers/index.ts",
19
19
  "#meta": "./src/meta.ts",
20
20
  "#operations": "./src/operations/index.ts",
21
+ "#translations": "./src/translations.ts",
21
22
  "#types": "./src/types/index.ts"
22
23
  },
23
24
  "exports": {
@@ -39,6 +40,12 @@
39
40
  "browser": "./dist/lib/browser/operations/index.mjs",
40
41
  "node": "./dist/lib/node-esm/operations/index.mjs"
41
42
  },
43
+ "./translations": {
44
+ "source": "./src/translations.ts",
45
+ "types": "./dist/types/src/translations.d.ts",
46
+ "browser": "./dist/lib/browser/translations.mjs",
47
+ "node": "./dist/lib/node-esm/translations.mjs"
48
+ },
42
49
  "./types": {
43
50
  "source": "./src/types/index.ts",
44
51
  "types": "./dist/types/src/types/index.d.ts",
@@ -56,34 +63,34 @@
56
63
  "@effect-atom/atom-react": "^0.5.0",
57
64
  "effect": "3.20.0",
58
65
  "localforage": "^1.10.0",
59
- "@dxos/app-framework": "0.8.4-main.422d1c7879",
60
- "@dxos/context": "0.8.4-main.422d1c7879",
61
- "@dxos/app-toolkit": "0.8.4-main.422d1c7879",
62
- "@dxos/async": "0.8.4-main.422d1c7879",
63
- "@dxos/invariant": "0.8.4-main.422d1c7879",
64
- "@dxos/echo": "0.8.4-main.422d1c7879",
65
- "@dxos/effect": "0.8.4-main.422d1c7879",
66
- "@dxos/log": "0.8.4-main.422d1c7879",
67
- "@dxos/observability": "0.8.4-main.422d1c7879",
68
- "@dxos/operation": "0.8.4-main.422d1c7879",
69
- "@dxos/plugin-graph": "0.8.4-main.422d1c7879",
70
- "@dxos/protocols": "0.8.4-main.422d1c7879",
71
- "@dxos/react-client": "0.8.4-main.422d1c7879",
72
- "@dxos/react-hooks": "0.8.4-main.422d1c7879",
73
- "@dxos/react-ui-attention": "0.8.4-main.422d1c7879",
74
- "@dxos/react-ui-form": "0.8.4-main.422d1c7879",
75
- "@dxos/react-ui-stack": "0.8.4-main.422d1c7879",
76
- "@dxos/util": "0.8.4-main.422d1c7879"
66
+ "@dxos/app-framework": "0.8.4-main.51f1e5ca51",
67
+ "@dxos/app-toolkit": "0.8.4-main.51f1e5ca51",
68
+ "@dxos/async": "0.8.4-main.51f1e5ca51",
69
+ "@dxos/context": "0.8.4-main.51f1e5ca51",
70
+ "@dxos/echo": "0.8.4-main.51f1e5ca51",
71
+ "@dxos/compute": "0.8.4-main.51f1e5ca51",
72
+ "@dxos/effect": "0.8.4-main.51f1e5ca51",
73
+ "@dxos/invariant": "0.8.4-main.51f1e5ca51",
74
+ "@dxos/log": "0.8.4-main.51f1e5ca51",
75
+ "@dxos/observability": "0.8.4-main.51f1e5ca51",
76
+ "@dxos/plugin-graph": "0.8.4-main.51f1e5ca51",
77
+ "@dxos/react-client": "0.8.4-main.51f1e5ca51",
78
+ "@dxos/react-hooks": "0.8.4-main.51f1e5ca51",
79
+ "@dxos/protocols": "0.8.4-main.51f1e5ca51",
80
+ "@dxos/react-ui-attention": "0.8.4-main.51f1e5ca51",
81
+ "@dxos/react-ui-form": "0.8.4-main.51f1e5ca51",
82
+ "@dxos/util": "0.8.4-main.51f1e5ca51",
83
+ "@dxos/react-ui-stack": "0.8.4-main.51f1e5ca51"
77
84
  },
78
85
  "devDependencies": {
79
86
  "@effect-atom/atom-react": "^0.5.0",
80
87
  "@effect/platform": "0.94.4",
81
88
  "@types/react": "~19.2.7",
82
89
  "react": "~19.2.3",
83
- "vite": "^7.1.11",
84
- "@dxos/ui-theme": "0.8.4-main.422d1c7879",
85
- "@dxos/storybook-utils": "0.8.4-main.422d1c7879",
86
- "@dxos/react-ui": "0.8.4-main.422d1c7879"
90
+ "vite": "^8.0.10",
91
+ "@dxos/storybook-utils": "0.8.4-main.51f1e5ca51",
92
+ "@dxos/react-ui": "0.8.4-main.51f1e5ca51",
93
+ "@dxos/ui-theme": "0.8.4-main.51f1e5ca51"
87
94
  },
88
95
  "peerDependencies": {
89
96
  "@effect-atom/atom-react": "^0.5.0",
@@ -91,8 +98,8 @@
91
98
  "effect": "3.20.0",
92
99
  "react": "~19.2.3",
93
100
  "react-dom": "~19.2.3",
94
- "@dxos/react-ui": "0.8.4-main.422d1c7879",
95
- "@dxos/ui-theme": "0.8.4-main.422d1c7879"
101
+ "@dxos/react-ui": "0.8.4-main.51f1e5ca51",
102
+ "@dxos/ui-theme": "0.8.4-main.51f1e5ca51"
96
103
  },
97
104
  "publishConfig": {
98
105
  "access": "public"
@@ -17,14 +17,18 @@ import {
17
17
  ReactSurface,
18
18
  } from '#capabilities';
19
19
  import { meta } from '#meta';
20
+ import { translations } from '#translations';
20
21
  import { ClientReadyEvent, ObservabilityEvents } from '#types';
21
22
  import { ObservabilityCapabilities } from '#types';
22
23
 
23
- import { translations } from './translations';
24
-
25
24
  export type ObservabilityPluginOptions = {
26
25
  namespace: string;
27
26
  observability: () => Promise<Observability.Observability>;
27
+ /**
28
+ * Optional callback invoked by the help/feedback UI to download captured logs.
29
+ * When omitted the "Download logs" action is hidden.
30
+ */
31
+ downloadLogs?: () => void | Promise<void>;
28
32
  };
29
33
 
30
34
  export const ObservabilityPlugin = Plugin.define<ObservabilityPluginOptions>(meta).pipe(
@@ -55,6 +59,14 @@ export const ObservabilityPlugin = Plugin.define<ObservabilityPluginOptions>(met
55
59
  activatesOn: ActivationEvents.Startup,
56
60
  activate: () => Effect.succeed(Capability.contributes(ObservabilityCapabilities.Namespace, namespace)),
57
61
  })),
62
+ Plugin.addModule(({ downloadLogs }) => ({
63
+ id: 'log-downloader',
64
+ activatesOn: ActivationEvents.Startup,
65
+ activate: () =>
66
+ Effect.succeed(
67
+ downloadLogs !== undefined ? Capability.contributes(ObservabilityCapabilities.LogDownloader, downloadLogs) : [],
68
+ ),
69
+ })),
58
70
  AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
59
71
  Plugin.addModule(({ namespace, observability }) => ({
60
72
  id: Capability.getModuleTag(ClientReady),
@@ -6,6 +6,7 @@ import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
8
  import { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
9
+ import { log } from '@dxos/log';
9
10
  import { type Observability, ObservabilityProvider } from '@dxos/observability';
10
11
 
11
12
  import { meta } from '#meta';
@@ -49,10 +50,12 @@ export default Capability.makeModule(
49
50
 
50
51
  // Ensure errors are tagged with enabled plugins to help with reproductions.
51
52
  const enabledPlugins = manager.getEnabled();
53
+ log('client-ready: tagging enabled plugins', { count: enabledPlugins.length });
52
54
  for (const plugin of enabledPlugins) {
53
55
  observability.setTags({ [`pluginEnabled-${plugin}`]: 'true' }, 'errors');
54
56
  }
55
57
 
58
+ log('client-ready: sending page.load event');
56
59
  yield* Effect.tryPromise(() =>
57
60
  invokePromise(ObservabilityOperation.SendEvent, {
58
61
  name: 'page.load',
@@ -62,16 +65,34 @@ export default Capability.makeModule(
62
65
  },
63
66
  }),
64
67
  );
68
+ log('client-ready: page.load event sent');
65
69
 
66
- // Add client data providers.
70
+ // Each provider is logged individually because some provider setups perform
71
+ // RPC calls (e.g. runtimeMetricsProvider awaits SystemService.getPlatform());
72
+ // a hung worker pipe surfaces as a missing "added" log, so the last
73
+ // "adding ..." line points to the stall.
74
+ log('client-ready: adding identity data provider');
67
75
  yield* observability.addDataProvider(ObservabilityProvider.Client.identityProvider(client.services.services));
76
+ log('client-ready: identity data provider added');
77
+
78
+ log('client-ready: adding network metrics data provider');
68
79
  yield* observability.addDataProvider(ObservabilityProvider.Client.networkMetricsProvider(client.services.services));
80
+ log('client-ready: network metrics data provider added');
81
+
82
+ log('client-ready: adding runtime metrics data provider');
69
83
  yield* observability.addDataProvider(ObservabilityProvider.Client.runtimeMetricsProvider(client.services.services));
84
+ log('client-ready: runtime metrics data provider added');
85
+
86
+ log('client-ready: adding space metrics data provider');
70
87
  yield* observability.addDataProvider(ObservabilityProvider.Client.spacesMetricsProvider(client));
88
+ log('client-ready: space metrics data provider added');
71
89
 
72
90
  if (client.halo.identity.get()) {
91
+ log('client-ready: identity present, sending privacy notice');
73
92
  yield* Effect.tryPromise(() => sendPrivacyNotice());
93
+ log('client-ready: privacy notice sent');
74
94
  } else {
95
+ log('client-ready: no identity, deferring privacy notice');
75
96
  const subscription = client.halo.identity.subscribe(async (identity) => {
76
97
  if (identity && observability) {
77
98
  await sendPrivacyNotice();
@@ -80,6 +101,7 @@ export default Capability.makeModule(
80
101
  });
81
102
  }
82
103
 
104
+ log('client-ready: contributing observability capability');
83
105
  return Capability.contributes(ObservabilityCapabilities.Observability, observability, () => observability.close());
84
106
  }),
85
107
  );
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { Capability } from '@dxos/app-framework';
6
- import { OperationHandlerSet } from '@dxos/operation';
6
+ import { OperationHandlerSet } from '@dxos/compute';
7
7
 
8
8
  import type { ClientReadyOptions } from './client-ready';
9
9
 
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
- import type { OperationHandlerSet } from '@dxos/operation';
8
+ import type { OperationHandlerSet } from '@dxos/compute';
9
9
 
10
10
  import { ObservabilityOperationHandlerSet } from '#operations';
11
11
 
package/src/cli/plugin.ts CHANGED
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
8
8
  import { AppPlugin } from '@dxos/app-toolkit';
9
- import { Operation, OperationHandlerSet } from '@dxos/operation';
9
+ import { Operation, OperationHandlerSet } from '@dxos/compute';
10
10
 
11
11
  import { meta } from '#meta';
12
12
  import { ObservabilityOperation } from '#operations';
@@ -6,7 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
 
7
7
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
8
8
 
9
- import { translations } from '../../translations';
9
+ import { translations } from '#translations';
10
+
10
11
  import { FeedbackForm } from './FeedbackForm';
11
12
 
12
13
  const meta = {
@@ -30,3 +31,14 @@ export const Default: Story = {
30
31
  },
31
32
  },
32
33
  };
34
+
35
+ export const WithDownloadLogs: Story = {
36
+ args: {
37
+ onSave: (values) => {
38
+ console.log(values);
39
+ },
40
+ onDownloadLogs: () => {
41
+ console.log('download logs clicked');
42
+ },
43
+ },
44
+ };
@@ -4,20 +4,24 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { useTranslation } from '@dxos/react-ui';
7
+ import { IconButton, useTranslation } from '@dxos/react-ui';
8
8
  import { Form, type FormRootProps, type FormSubmitProps } from '@dxos/react-ui-form';
9
9
 
10
10
  import { meta } from '#meta';
11
11
  import { UserFeedback } from '#operations';
12
12
 
13
- export type FeedbackFormProps = Pick<FormRootProps<UserFeedback>, 'onSave'> & Pick<FormSubmitProps, 'disabled'>;
13
+ export type FeedbackFormProps = Pick<FormRootProps<UserFeedback>, 'onSave'> &
14
+ Pick<FormSubmitProps, 'disabled'> & {
15
+ /** Optional handler — when supplied a "Download logs" button is rendered below the submit action. */
16
+ onDownloadLogs?: () => void | Promise<void>;
17
+ };
14
18
 
15
19
  const defaultValues: UserFeedback = {
16
20
  message: '',
17
21
  includeLogs: true,
18
22
  };
19
23
 
20
- export const FeedbackForm = ({ onSave, disabled }: FeedbackFormProps) => {
24
+ export const FeedbackForm = ({ onSave, disabled, onDownloadLogs }: FeedbackFormProps) => {
21
25
  const { t } = useTranslation(meta.id);
22
26
 
23
27
  return (
@@ -26,6 +30,18 @@ export const FeedbackForm = ({ onSave, disabled }: FeedbackFormProps) => {
26
30
  <Form.Content>
27
31
  <Form.FieldSet />
28
32
  <Form.Submit icon='ph--paper-plane-tilt--regular' label={t('send-feedback.label')} disabled={disabled} />
33
+ {onDownloadLogs && (
34
+ <div role='none' className='flex w-full pt-form-padding'>
35
+ <IconButton
36
+ classNames='w-full'
37
+ type='button'
38
+ icon='ph--download-simple--regular'
39
+ label={t('download-logs.label')}
40
+ onClick={() => void onDownloadLogs()}
41
+ data-testid='download-logs-button'
42
+ />
43
+ </div>
44
+ )}
29
45
  </Form.Content>
30
46
  </Form.Viewport>
31
47
  </Form.Root>
@@ -6,7 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
 
7
7
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
8
8
 
9
- import { translations } from '../../translations';
9
+ import { translations } from '#translations';
10
+
10
11
  import { ObservabilitySettings } from './ObservabilitySettings';
11
12
 
12
13
  const meta = {
@@ -5,11 +5,11 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { type AppSurface } from '@dxos/app-toolkit/ui';
8
- import { Input, Message, useTranslation } from '@dxos/react-ui';
8
+ import { Message, useTranslation } from '@dxos/react-ui';
9
9
  import { Settings as SettingsForm } from '@dxos/react-ui-form';
10
10
 
11
11
  import { meta } from '#meta';
12
- import { type Settings } from '#types';
12
+ import { Settings } from '#types';
13
13
 
14
14
  export type ObservabilitySettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
15
15
 
@@ -22,16 +22,12 @@ export const ObservabilitySettings = ({ settings, onSettingsChange }: Observabil
22
22
  <Message.Root valence='info'>
23
23
  <Message.Content>{t('observability.description')}</Message.Content>
24
24
  </Message.Root>
25
- <SettingsForm.Item
26
- title={t('observability-enabled.label')}
27
- description={t('observability-enabled.description')}
28
- >
29
- <Input.Switch
30
- disabled={!onSettingsChange}
31
- checked={settings.enabled}
32
- onCheckedChange={(checked) => onSettingsChange?.((s) => ({ ...s, enabled: !!checked }))}
33
- />
34
- </SettingsForm.Item>
25
+ <SettingsForm.FieldSet
26
+ readonly={!onSettingsChange}
27
+ schema={Settings.Settings}
28
+ values={settings}
29
+ onValuesChanged={(values) => onSettingsChange?.(() => values)}
30
+ />
35
31
  </SettingsForm.Section>
36
32
  </SettingsForm.Viewport>
37
33
  );
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import React, { useCallback, useState } from 'react';
7
7
 
8
- import { useCapability, useOperationInvoker } from '@dxos/app-framework/ui';
8
+ import { useCapabilities, useCapability, useOperationInvoker } from '@dxos/app-framework/ui';
9
9
  import { LayoutOperation } from '@dxos/app-toolkit';
10
10
  import { runAndForwardErrors } from '@dxos/effect';
11
11
  import { useAsyncEffect } from '@dxos/react-hooks';
@@ -20,6 +20,7 @@ import { ObservabilityCapabilities } from '#types';
20
20
  export const HelpContainer = () => {
21
21
  const { invokePromise } = useOperationInvoker();
22
22
  const observability = useCapability(ObservabilityCapabilities.Observability);
23
+ const [downloadLogs] = useCapabilities(ObservabilityCapabilities.LogDownloader);
23
24
  const [feedbackAvailable, setFeedbackAvailable] = useState(false);
24
25
 
25
26
  useAsyncEffect(
@@ -52,5 +53,5 @@ export const HelpContainer = () => {
52
53
  [invokePromise],
53
54
  );
54
55
 
55
- return <FeedbackForm onSave={handleSave} disabled={!feedbackAvailable} />;
56
+ return <FeedbackForm onSave={handleSave} disabled={!feedbackAvailable} onDownloadLogs={downloadLogs} />;
56
57
  };
package/src/index.ts CHANGED
@@ -6,4 +6,3 @@ export { ObservabilityCapabilities, ObservabilityEvents } from './types';
6
6
  export * from './components';
7
7
  export * from './meta';
8
8
  export * from './ObservabilityPlugin';
9
- export { translations as observabilityTranslations } from './translations';
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capability } from '@dxos/app-framework';
8
- import { Operation } from '@dxos/operation';
8
+ import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { ObservabilityCapabilities } from '../types';
11
11
  import { CaptureUserFeedback } from './definitions';
@@ -5,12 +5,11 @@
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { Capability } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
8
9
  import { Format } from '@dxos/echo';
9
- import { Operation } from '@dxos/operation';
10
10
 
11
11
  import { meta } from '#meta';
12
-
13
- import { translations } from '../translations';
12
+ import { translations } from '#translations';
14
13
 
15
14
  const t = translations[0]['en-US'][meta.id];
16
15
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { OperationHandlerSet } from '@dxos/operation';
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
6
 
7
7
  export * as ObservabilityOperation from './definitions';
8
8
  export { UserFeedback } from './definitions';
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capability } from '@dxos/app-framework';
8
- import { Operation } from '@dxos/operation';
8
+ import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { ObservabilityCapabilities } from '../types';
11
11
  import { SendEvent } from './definitions';
@@ -6,8 +6,8 @@ import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
8
  import { AppCapabilities } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/compute';
9
10
  import { Observability } from '@dxos/observability';
10
- import { Operation } from '@dxos/operation';
11
11
 
12
12
  import { meta } from '#meta';
13
13
 
@@ -18,8 +18,6 @@ export const translations = [
18
18
  'observability-toast-action.label': 'Settings',
19
19
  'observability-toast-action.alt': 'Open settings to learn more or to disable.',
20
20
  'observability-toast-close.label': 'Okay',
21
- 'observability-enabled.label': 'Enable telemetry',
22
- 'observability-enabled.description': 'Send anonymous usage and performance data to help improve the product.',
23
21
  // TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.
24
22
  'observability.description':
25
23
  'When enabled, basic usage data will used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.',
@@ -28,6 +26,7 @@ export const translations = [
28
26
  'feedback-textarea.placeholder': 'Please enter your feedback, technical issue, or feature request.',
29
27
  'include-debug-logs.label': 'Include debug logs',
30
28
  'send-feedback.label': 'Send Feedback',
29
+ 'download-logs.label': 'Download logs',
31
30
  'feedback-toast.label': 'Thank you for your feedback!',
32
31
  'feedback-toast.description': 'We will review your feedback and get back to you as soon as possible.',
33
32
  },
@@ -8,7 +8,10 @@ import * as Schema from 'effect/Schema';
8
8
 
9
9
  export const Settings = Schema.mutable(
10
10
  Schema.Struct({
11
- enabled: Schema.Boolean,
11
+ enabled: Schema.Boolean.annotations({
12
+ title: 'Enable telemetry',
13
+ description: 'Send anonymous usage and performance data to help improve the product.',
14
+ }),
12
15
  // TODO(wittjosiah): Separate settings for each observability feature.
13
16
  // metrics?: boolean;
14
17
  // telemetry?: boolean;
@@ -30,6 +30,13 @@ export namespace ObservabilityCapabilities {
30
30
  export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);
31
31
 
32
32
  export const Observability = Capability.make<Observability.Observability>(`${meta.id}.capability.observability`);
33
+
34
+ /**
35
+ * Optional capability — when contributed, the help/feedback UI exposes a "Download logs" action.
36
+ * The callback is responsible for the entire download (read store, encode, save file).
37
+ */
38
+ export type LogDownloader = () => void | Promise<void>;
39
+ export const LogDownloader = Capability.make<LogDownloader>(`${meta.id}.capability.log-downloader`);
33
40
  }
34
41
 
35
42
  // NOTE: This is cloned from the client plugin to avoid circular dependencies.
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ObservabilitySettings/ObservabilitySettings.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport type ObservabilitySettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const ObservabilitySettings = ({ settings, onSettingsChange }: ObservabilitySettingsProps) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>\n <Message.Root valence='info'>\n <Message.Content>{t('observability.description')}</Message.Content>\n </Message.Root>\n <SettingsForm.Item\n title={t('observability-enabled.label')}\n description={t('observability-enabled.description')}\n >\n <Input.Switch\n disabled={!onSettingsChange}\n checked={settings.enabled}\n onCheckedChange={(checked) => onSettingsChange?.((s) => ({ ...s, enabled: !!checked }))}\n />\n </SettingsForm.Item>\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
5
- "mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,OAAOC,SAASC,sBAAsB;AAC/C,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AAKd,IAAMC,wBAAwB,CAAC,EAAEC,UAAUC,iBAAgB,MAA8B;AAC9F,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,SACE,sBAAA,cAACC,aAAaC,UAAQ,MACpB,sBAAA,cAACD,aAAaE,SAAO;IAACC,OAAOP,EAAE,kBAAkB;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAC7D,sBAAA,cAACM,QAAQC,MAAI;IAACC,SAAQ;KACpB,sBAAA,cAACF,QAAQG,SAAO,MAAEZ,EAAE,2BAAA,CAAA,CAAA,GAEtB,sBAAA,cAACI,aAAaS,MAAI;IAChBN,OAAOP,EAAE,6BAAA;IACTc,aAAad,EAAE,mCAAA;KAEf,sBAAA,cAACe,MAAMC,QAAM;IACXC,UAAU,CAAClB;IACXmB,SAASpB,SAASqB;IAClBC,iBAAiB,CAACF,YAAYnB,mBAAmB,CAACsB,OAAO;MAAE,GAAGA;MAAGF,SAAS,CAAC,CAACD;IAAQ,EAAA;;AAMhG;",
6
- "names": ["React", "Input", "Message", "useTranslation", "Settings", "SettingsForm", "meta", "ObservabilitySettings", "settings", "onSettingsChange", "t", "useTranslation", "meta", "id", "SettingsForm", "Viewport", "Section", "title", "ns", "Message", "Root", "valence", "Content", "Item", "description", "Input", "Switch", "disabled", "checked", "enabled", "onCheckedChange", "s"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/types/Settings.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type Client } from '@dxos/client';\nimport { type Observability } from '@dxos/observability';\n\nimport { meta } from '#meta';\n\nimport * as Settings from './Settings';\n\nexport namespace ObservabilityCapabilities {\n export const Namespace = Capability.make<string>(`${meta.id}.capability.namespace`);\n\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n\n export const StateSchema = Schema.mutable(\n Schema.Struct({\n group: Schema.optional(Schema.String),\n notified: Schema.optional(Schema.Boolean),\n }),\n );\n\n export type State = Schema.Schema.Type<typeof StateSchema>;\n\n export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);\n\n export const Observability = Capability.make<Observability.Observability>(`${meta.id}.capability.observability`);\n}\n\n// NOTE: This is cloned from the client plugin to avoid circular dependencies.\n// TODO(burdon): Figure out how to share defs.\nexport const ClientCapability = Capability.make<Client>('org.dxos.plugin.client.capability.client');\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nexport namespace ObservabilityEvents {\n export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.id);\n}\n\n// NOTE: This is cloned from the client plugin to avoid circular dependencies.\nexport const ClientReadyEvent = ActivationEvent.make('org.dxos.plugin.client.event.client-ready');\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(\n Schema.Struct({\n enabled: Schema.Boolean,\n // TODO(wittjosiah): Separate settings for each observability feature.\n // metrics?: boolean;\n // telemetry?: boolean;\n // errors?: boolean;\n }),\n);\n\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],
5
- "mappings": ";;;;;AAKA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAI3B,SAASC,YAAY;UAIJC,4BAAAA;6BACFC,YAAYC,WAAWC,KAAa,GAAGC,KAAKC,EAAE,uBAAuB;6BAErEC,WAAWJ,WAAWC,KAAuC,GAAGC,KAAKC,EAAE,sBAAsB;6BAE7FE,cAAqBC,eACzBC,cAAO;IACZC,OAAcC,gBAAgBC,aAAM;IACpCC,UAAiBF,gBAAgBG,cAAO;EAC1C,CAAA,CAAA;6BAKWC,QAAQb,WAAWC,KAA2B,GAAGC,KAAKC,EAAE,mBAAmB;6BAE3EW,gBAAgBd,WAAWC,KAAkC,GAAGC,KAAKC,EAAE,2BAA2B;AACjH,GAjBiBL,8BAAAA,4BAAAA,CAAAA,EAAAA;AAqBV,IAAMiB,mBAAmBf,WAAWC,KAAa,0CAAA;;;;AChCxD,SAASe,uBAAuB;AAChC,SAASC,2BAA2B;AAEpC,SAASC,QAAAA,aAAY;UAEJC,sBAAAA;uBACFC,aAA8CC,oBAAoBC,iBAAiBC,MAAKC,EAAE;AACzG,GAFiBL,wBAAAA,sBAAAA,CAAAA,EAAAA;AAKV,IAAMM,mBAAmBC,gBAAgBC,KAAK,2CAAA;;;;ACdrD;;;;AAMA,YAAYC,aAAY;AAEjB,IAAMC,WAAkBC,gBACtBC,eAAO;EACZC,SAAgBC;AAKlB,CAAA,CAAA;",
6
- "names": ["Schema", "Capability", "meta", "ObservabilityCapabilities", "Namespace", "Capability", "make", "meta", "id", "Settings", "StateSchema", "mutable", "Struct", "group", "optional", "String", "notified", "Boolean", "State", "Observability", "ClientCapability", "ActivationEvent", "AppActivationEvents", "meta", "ObservabilityEvents", "StateReady", "AppActivationEvents", "createStateEvent", "meta", "id", "ClientReadyEvent", "ActivationEvent", "make", "Schema", "Settings", "mutable", "Struct", "enabled", "Boolean"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'Telemetry',\n 'settings.title': 'Telemetry settings',\n 'observability-toast.label': 'Privacy Notice',\n 'observability-toast.description':\n 'Composer collects usage and performance metrics to improve the product. No user data is collected.',\n 'observability-toast-action.label': 'Settings',\n 'observability-toast-action.alt': 'Open settings to learn more or to disable.',\n 'observability-toast-close.label': 'Okay',\n 'observability-enabled.label': 'Enable telemetry',\n 'observability-enabled.description': 'Send anonymous usage and performance data to help improve the product.',\n // TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.\n 'observability.description':\n 'When enabled, basic usage data will used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.',\n 'help.label': 'Feedback & Support',\n 'feedback-textarea.label': 'Feedback',\n 'feedback-textarea.placeholder': 'Please enter your feedback, technical issue, or feature request.',\n 'include-debug-logs.label': 'Include debug logs',\n 'send-feedback.label': 'Send Feedback',\n 'feedback-toast.label': 'Thank you for your feedback!',\n 'feedback-toast.description': 'We will review your feedback and get back to you as soon as possible.',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,6BAA6B;QAC7B,mCACE;QACF,oCAAoC;QACpC,kCAAkC;QAClC,mCAAmC;QACnC,+BAA+B;QAC/B,qCAAqC;;QAErC,6BACE;QACF,cAAc;QACd,2BAA2B;QAC3B,iCAAiC;QACjC,4BAA4B;QAC5B,uBAAuB;QACvB,wBAAwB;QACxB,8BAA8B;MAChC;IACF;EACF;;",
6
- "names": ["meta", "translations", "meta", "id"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Format } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nimport { translations } from '../translations';\n\nconst t = translations[0]['en-US'][meta.id];\n\nexport const UserFeedback = Schema.Struct({\n message: Format.Text.pipe(\n Schema.nonEmptyString(),\n Schema.maxLength(4_096),\n Schema.annotations({\n title: t['feedback-textarea.label'],\n description: t['feedback-textarea.placeholder'],\n }),\n ),\n includeLogs: Schema.Boolean.pipe(\n Schema.annotations({\n title: t['include-debug-logs.label'],\n }),\n Schema.optional,\n ),\n});\n\nexport type UserFeedback = Schema.Schema.Type<typeof UserFeedback>;\n\nconst OBSERVABILITY_OPERATION = `${meta.id}.operation`;\n\n/**\n * Operations for the Observability plugin.\n */\nexport const Toggle = Operation.make({\n meta: {\n key: `${OBSERVABILITY_OPERATION}.toggle`,\n name: 'Toggle Observability',\n description: 'Toggle observability on or off.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Boolean,\n});\n\nexport const CaptureUserFeedback = Operation.make({\n meta: {\n key: `${OBSERVABILITY_OPERATION}.capture-feedback`,\n name: 'Capture User Feedback',\n description: 'Capture user feedback.',\n },\n services: [Capability.Service],\n input: UserFeedback,\n output: Schema.Void,\n});\n\nexport const SendEvent = Operation.make({\n meta: {\n key: `${OBSERVABILITY_OPERATION}.send-event`,\n name: 'Send Event',\n description: 'Send an observability event.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n name: Schema.String.annotations({ description: 'The name of the event.' }),\n properties: Schema.optional(Schema.Any).annotations({ description: 'Event properties.' }),\n }),\n output: Schema.Void,\n});\n"],
5
- "mappings": ";;;;;;;;AAAA;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAIrB,IAAMC,IAAIC,aAAa,CAAA,EAAG,OAAA,EAASC,KAAKC,EAAE;AAEnC,IAAMC,eAAsBC,cAAO;EACxCC,SAASC,OAAOC,KAAKC,KACZC,sBAAc,GACdC,iBAAU,IAAA,GACVC,mBAAY;IACjBC,OAAOb,EAAE,yBAAA;IACTc,aAAad,EAAE,+BAAA;EACjB,CAAA,CAAA;EAEFe,aAAoBC,eAAQP,KACnBG,mBAAY;IACjBC,OAAOb,EAAE,0BAAA;EACX,CAAA,GACOiB,eAAQ;AAEnB,CAAA;AAIA,IAAMC,0BAA0B,GAAGhB,KAAKC,EAAE;AAKnC,IAAMgB,SAASC,UAAUC,KAAK;EACnCnB,MAAM;IACJoB,KAAK,GAAGJ,uBAAAA;IACRK,MAAM;IACNT,aAAa;EACf;EACAU,UAAU;IAACC,WAAWC;;EACtBC,OAActB,cAAO;IACnBuB,OAAcX,gBAAgBD,cAAO;EACvC,CAAA;EACAa,QAAeb;AACjB,CAAA;AAEO,IAAMc,sBAAsBV,UAAUC,KAAK;EAChDnB,MAAM;IACJoB,KAAK,GAAGJ,uBAAAA;IACRK,MAAM;IACNT,aAAa;EACf;EACAU,UAAU;IAACC,WAAWC;;EACtBC,OAAOvB;EACPyB,QAAeE;AACjB,CAAA;AAEO,IAAMC,YAAYZ,UAAUC,KAAK;EACtCnB,MAAM;IACJoB,KAAK,GAAGJ,uBAAAA;IACRK,MAAM;IACNT,aAAa;EACf;EACAU,UAAU;IAACC,WAAWC;;EACtBC,OAActB,cAAO;IACnBkB,MAAaU,cAAOrB,YAAY;MAAEE,aAAa;IAAyB,CAAA;IACxEoB,YAAmBjB,gBAAgBkB,UAAG,EAAEvB,YAAY;MAAEE,aAAa;IAAoB,CAAA;EACzF,CAAA;EACAe,QAAeE;AACjB,CAAA;",
6
- "names": ["Schema", "Capability", "Format", "Operation", "meta", "t", "translations", "meta", "id", "UserFeedback", "Struct", "message", "Format", "Text", "pipe", "nonEmptyString", "maxLength", "annotations", "title", "description", "includeLogs", "Boolean", "optional", "OBSERVABILITY_OPERATION", "Toggle", "Operation", "make", "key", "name", "services", "Capability", "Service", "input", "state", "output", "CaptureUserFeedback", "Void", "SendEvent", "String", "properties", "Any"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/toggle.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Observability } from '@dxos/observability';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nimport { ObservabilityCapabilities, type Settings } from '../types';\nimport { Toggle } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Toggle> = Toggle.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const namespace = yield* Capability.get(ObservabilityCapabilities.Namespace);\n const observability = yield* Capability.get(ObservabilityCapabilities.Observability);\n const capabilities = yield* Capability.Service;\n const registry = capabilities.get(Capabilities.AtomRegistry);\n const allSettings = capabilities.getAll(AppCapabilities.Settings);\n const settingsObj = allSettings.find((s: AppCapabilities.Settings) => s.prefix === meta.id);\n if (!settingsObj) {\n return false;\n }\n const settings = registry.get(settingsObj.atom) as Settings.Settings;\n const newEnabled = input.state ?? !settings.enabled;\n registry.set(settingsObj.atom, { ...settings, enabled: newEnabled });\n observability.events.captureEvent('observability.toggle', {\n enabled: newEnabled,\n });\n\n if (newEnabled) {\n yield* observability.enable();\n } else {\n yield* observability.disable();\n }\n yield* Effect.promise(() => Observability.storeObservabilityDisabled(namespace, !newEnabled));\n return newEnabled;\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAKrB,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,YAAY,OAAOC,WAAWC,IAAIC,0BAA0BC,SAAS;AAC3E,QAAMC,gBAAgB,OAAOJ,WAAWC,IAAIC,0BAA0BG,aAAa;AACnF,QAAMC,eAAe,OAAON,WAAWO;AACvC,QAAMC,WAAWF,aAAaL,IAAIQ,aAAaC,YAAY;AAC3D,QAAMC,cAAcL,aAAaM,OAAOC,gBAAgBC,QAAQ;AAChE,QAAMC,cAAcJ,YAAYK,KAAK,CAACC,MAAgCA,EAAEC,WAAWC,KAAKC,EAAE;AAC1F,MAAI,CAACL,aAAa;AAChB,WAAO;EACT;AACA,QAAMM,WAAWb,SAASP,IAAIc,YAAYO,IAAI;AAC9C,QAAMC,aAAazB,MAAM0B,SAAS,CAACH,SAASI;AAC5CjB,WAASkB,IAAIX,YAAYO,MAAM;IAAE,GAAGD;IAAUI,SAASF;EAAW,CAAA;AAClEnB,gBAAcuB,OAAOC,aAAa,wBAAwB;IACxDH,SAASF;EACX,CAAA;AAEA,MAAIA,YAAY;AACd,WAAOnB,cAAcyB,OAAM;EAC7B,OAAO;AACL,WAAOzB,cAAc0B,QAAO;EAC9B;AACA,SAAcC,eAAQ,MAAM1B,cAAc2B,2BAA2BjC,WAAW,CAACwB,UAAAA,CAAAA;AACjF,SAAOA;AACT,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAe/B;",
6
- "names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "Observability", "Operation", "meta", "handler", "Toggle", "pipe", "Operation", "withHandler", "fnUntraced", "input", "namespace", "Capability", "get", "ObservabilityCapabilities", "Namespace", "observability", "Observability", "capabilities", "Service", "registry", "Capabilities", "AtomRegistry", "allSettings", "getAll", "AppCapabilities", "Settings", "settingsObj", "find", "s", "prefix", "meta", "id", "settings", "atom", "newEnabled", "state", "enabled", "set", "events", "captureEvent", "enable", "disable", "promise", "storeObservabilityDisabled"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ObservabilitySettings/ObservabilitySettings.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport type ObservabilitySettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const ObservabilitySettings = ({ settings, onSettingsChange }: ObservabilitySettingsProps) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>\n <Message.Root valence='info'>\n <Message.Content>{t('observability.description')}</Message.Content>\n </Message.Root>\n <SettingsForm.Item\n title={t('observability-enabled.label')}\n description={t('observability-enabled.description')}\n >\n <Input.Switch\n disabled={!onSettingsChange}\n checked={settings.enabled}\n onCheckedChange={(checked) => onSettingsChange?.((s) => ({ ...s, enabled: !!checked }))}\n />\n </SettingsForm.Item>\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
5
- "mappings": ";;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,OAAOC,SAASC,sBAAsB;AAC/C,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AAKd,IAAMC,wBAAwB,CAAC,EAAEC,UAAUC,iBAAgB,MAA8B;AAC9F,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,SACE,sBAAA,cAACC,aAAaC,UAAQ,MACpB,sBAAA,cAACD,aAAaE,SAAO;IAACC,OAAOP,EAAE,kBAAkB;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAC7D,sBAAA,cAACM,QAAQC,MAAI;IAACC,SAAQ;KACpB,sBAAA,cAACF,QAAQG,SAAO,MAAEZ,EAAE,2BAAA,CAAA,CAAA,GAEtB,sBAAA,cAACI,aAAaS,MAAI;IAChBN,OAAOP,EAAE,6BAAA;IACTc,aAAad,EAAE,mCAAA;KAEf,sBAAA,cAACe,MAAMC,QAAM;IACXC,UAAU,CAAClB;IACXmB,SAASpB,SAASqB;IAClBC,iBAAiB,CAACF,YAAYnB,mBAAmB,CAACsB,OAAO;MAAE,GAAGA;MAAGF,SAAS,CAAC,CAACD;IAAQ,EAAA;;AAMhG;",
6
- "names": ["React", "Input", "Message", "useTranslation", "Settings", "SettingsForm", "meta", "ObservabilitySettings", "settings", "onSettingsChange", "t", "useTranslation", "meta", "id", "SettingsForm", "Viewport", "Section", "title", "ns", "Message", "Root", "valence", "Content", "Item", "description", "Input", "Switch", "disabled", "checked", "enabled", "onCheckedChange", "s"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/capture-user-feedback.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\n\nimport { ObservabilityCapabilities } from '../types';\nimport { CaptureUserFeedback } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CaptureUserFeedback> = CaptureUserFeedback.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* (input) {\n const observability = yield* Capability.get(ObservabilityCapabilities.Observability);\n observability.feedback.captureUserFeedback({ message: input.message, includeLogs: input.includeLogs });\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAK1B,IAAMC,UAA6DC,oBAAoBC,KACrFC,UAAUC,YACDC,kBAAW,WAAWC,OAAK;AAChC,QAAMC,gBAAgB,OAAOC,WAAWC,IAAIC,0BAA0BC,aAAa;AACnFJ,gBAAcK,SAASC,oBAAoB;IAAEC,SAASR,MAAMQ;IAASC,aAAaT,MAAMS;EAAY,CAAA;AACtG,CAAA,CAAA,CAAA;AAIJ,IAAA,gCAAef;",
6
- "names": ["Effect", "Capability", "Operation", "handler", "CaptureUserFeedback", "pipe", "Operation", "withHandler", "fnUntraced", "input", "observability", "Capability", "get", "ObservabilityCapabilities", "Observability", "feedback", "captureUserFeedback", "message", "includeLogs"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Format } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nimport { translations } from '../translations';\n\nconst t = translations[0]['en-US'][meta.id];\n\nexport const UserFeedback = Schema.Struct({\n message: Format.Text.pipe(\n Schema.nonEmptyString(),\n Schema.maxLength(4_096),\n Schema.annotations({\n title: t['feedback-textarea.label'],\n description: t['feedback-textarea.placeholder'],\n }),\n ),\n includeLogs: Schema.Boolean.pipe(\n Schema.annotations({\n title: t['include-debug-logs.label'],\n }),\n Schema.optional,\n ),\n});\n\nexport type UserFeedback = Schema.Schema.Type<typeof UserFeedback>;\n\nconst OBSERVABILITY_OPERATION = `${meta.id}.operation`;\n\n/**\n * Operations for the Observability plugin.\n */\nexport const Toggle = Operation.make({\n meta: {\n key: `${OBSERVABILITY_OPERATION}.toggle`,\n name: 'Toggle Observability',\n description: 'Toggle observability on or off.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Boolean,\n});\n\nexport const CaptureUserFeedback = Operation.make({\n meta: {\n key: `${OBSERVABILITY_OPERATION}.capture-feedback`,\n name: 'Capture User Feedback',\n description: 'Capture user feedback.',\n },\n services: [Capability.Service],\n input: UserFeedback,\n output: Schema.Void,\n});\n\nexport const SendEvent = Operation.make({\n meta: {\n key: `${OBSERVABILITY_OPERATION}.send-event`,\n name: 'Send Event',\n description: 'Send an observability event.',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n name: Schema.String.annotations({ description: 'The name of the event.' }),\n properties: Schema.optional(Schema.Any).annotations({ description: 'Event properties.' }),\n }),\n output: Schema.Void,\n});\n"],
5
- "mappings": ";;;;;;;;;AAAA;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAIrB,IAAMC,IAAIC,aAAa,CAAA,EAAG,OAAA,EAASC,KAAKC,EAAE;AAEnC,IAAMC,eAAsBC,cAAO;EACxCC,SAASC,OAAOC,KAAKC,KACZC,sBAAc,GACdC,iBAAU,IAAA,GACVC,mBAAY;IACjBC,OAAOb,EAAE,yBAAA;IACTc,aAAad,EAAE,+BAAA;EACjB,CAAA,CAAA;EAEFe,aAAoBC,eAAQP,KACnBG,mBAAY;IACjBC,OAAOb,EAAE,0BAAA;EACX,CAAA,GACOiB,eAAQ;AAEnB,CAAA;AAIA,IAAMC,0BAA0B,GAAGhB,KAAKC,EAAE;AAKnC,IAAMgB,SAASC,UAAUC,KAAK;EACnCnB,MAAM;IACJoB,KAAK,GAAGJ,uBAAAA;IACRK,MAAM;IACNT,aAAa;EACf;EACAU,UAAU;IAACC,WAAWC;;EACtBC,OAActB,cAAO;IACnBuB,OAAcX,gBAAgBD,cAAO;EACvC,CAAA;EACAa,QAAeb;AACjB,CAAA;AAEO,IAAMc,sBAAsBV,UAAUC,KAAK;EAChDnB,MAAM;IACJoB,KAAK,GAAGJ,uBAAAA;IACRK,MAAM;IACNT,aAAa;EACf;EACAU,UAAU;IAACC,WAAWC;;EACtBC,OAAOvB;EACPyB,QAAeE;AACjB,CAAA;AAEO,IAAMC,YAAYZ,UAAUC,KAAK;EACtCnB,MAAM;IACJoB,KAAK,GAAGJ,uBAAAA;IACRK,MAAM;IACNT,aAAa;EACf;EACAU,UAAU;IAACC,WAAWC;;EACtBC,OAActB,cAAO;IACnBkB,MAAaU,cAAOrB,YAAY;MAAEE,aAAa;IAAyB,CAAA;IACxEoB,YAAmBjB,gBAAgBkB,UAAG,EAAEvB,YAAY;MAAEE,aAAa;IAAoB,CAAA;EACzF,CAAA;EACAe,QAAeE;AACjB,CAAA;",
6
- "names": ["Schema", "Capability", "Format", "Operation", "meta", "t", "translations", "meta", "id", "UserFeedback", "Struct", "message", "Format", "Text", "pipe", "nonEmptyString", "maxLength", "annotations", "title", "description", "includeLogs", "Boolean", "optional", "OBSERVABILITY_OPERATION", "Toggle", "Operation", "make", "key", "name", "services", "Capability", "Service", "input", "state", "output", "CaptureUserFeedback", "Void", "SendEvent", "String", "properties", "Any"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'Telemetry',\n 'settings.title': 'Telemetry settings',\n 'observability-toast.label': 'Privacy Notice',\n 'observability-toast.description':\n 'Composer collects usage and performance metrics to improve the product. No user data is collected.',\n 'observability-toast-action.label': 'Settings',\n 'observability-toast-action.alt': 'Open settings to learn more or to disable.',\n 'observability-toast-close.label': 'Okay',\n 'observability-enabled.label': 'Enable telemetry',\n 'observability-enabled.description': 'Send anonymous usage and performance data to help improve the product.',\n // TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.\n 'observability.description':\n 'When enabled, basic usage data will used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.',\n 'help.label': 'Feedback & Support',\n 'feedback-textarea.label': 'Feedback',\n 'feedback-textarea.placeholder': 'Please enter your feedback, technical issue, or feature request.',\n 'include-debug-logs.label': 'Include debug logs',\n 'send-feedback.label': 'Send Feedback',\n 'feedback-toast.label': 'Thank you for your feedback!',\n 'feedback-toast.description': 'We will review your feedback and get back to you as soon as possible.',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;;AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,6BAA6B;QAC7B,mCACE;QACF,oCAAoC;QACpC,kCAAkC;QAClC,mCAAmC;QACnC,+BAA+B;QAC/B,qCAAqC;;QAErC,6BACE;QACF,cAAc;QACd,2BAA2B;QAC3B,iCAAiC;QACjC,4BAA4B;QAC5B,uBAAuB;QACvB,wBAAwB;QACxB,8BAA8B;MAChC;IACF;EACF;;",
6
- "names": ["meta", "translations", "meta", "id"]
7
- }