@dxos/plugin-observability 0.9.0 → 0.9.1-staging.ee54ba693a
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/dist/lib/neutral/ObservabilityPlugin.mjs +1 -1
- package/dist/lib/neutral/ObservabilityPlugin.mjs.map +2 -2
- package/dist/lib/neutral/ObservabilitySettings-6CEN3VYH.mjs +31 -0
- package/dist/lib/neutral/ObservabilitySettings-6CEN3VYH.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +4 -4
- package/dist/lib/neutral/{chunk-GLRKOAB7.mjs → chunk-PGTCGVCX.mjs} +2 -2
- package/dist/lib/neutral/chunk-PZDS6BXC.mjs +31 -0
- package/dist/lib/neutral/chunk-PZDS6BXC.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-RY77X57N.mjs → chunk-QR2GBZZK.mjs} +9 -9
- package/dist/lib/neutral/chunk-QR2GBZZK.mjs.map +7 -0
- package/dist/lib/neutral/{components → containers}/index.mjs +2 -2
- package/dist/lib/neutral/{components → containers}/index.mjs.map +1 -1
- package/dist/lib/neutral/index.mjs +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{privacy-notice-G5TVVCIW.mjs → privacy-notice-I5PEPWGW.mjs} +8 -8
- package/dist/lib/neutral/{privacy-notice-G5TVVCIW.mjs.map → privacy-notice-I5PEPWGW.mjs.map} +3 -3
- package/dist/lib/neutral/{react-surface-SHB2SLRK.mjs → react-surface-GX2JB3AY.mjs} +3 -3
- package/dist/lib/neutral/react-surface-GX2JB3AY.mjs.map +7 -0
- package/dist/lib/neutral/{send-event-FKLBHQ2Q.mjs → send-event-B6HNLGKK.mjs} +2 -2
- package/dist/lib/neutral/{settings-MZYK2WQR.mjs → settings-647UAWX4.mjs} +3 -3
- package/dist/lib/neutral/{settings-MZYK2WQR.mjs.map → settings-647UAWX4.mjs.map} +3 -3
- package/dist/lib/neutral/{state-5COCK3KV.mjs → state-WZ55UZ6I.mjs} +2 -2
- package/dist/lib/neutral/state-WZ55UZ6I.mjs.map +7 -0
- package/dist/lib/neutral/{toggle-S3T6KNBA.mjs → toggle-76BUKEAI.mjs} +3 -3
- package/dist/lib/neutral/{toggle-S3T6KNBA.mjs.map → toggle-76BUKEAI.mjs.map} +3 -3
- package/dist/lib/neutral/translations.mjs +1 -2
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/client-ready.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -7
- package/dist/types/src/{components → containers}/ObservabilitySettings/ObservabilitySettings.d.ts +1 -1
- package/dist/types/src/{components → containers}/ObservabilitySettings/ObservabilitySettings.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/ObservabilitySettings/ObservabilitySettings.stories.d.ts +0 -1
- package/dist/types/src/containers/ObservabilitySettings/ObservabilitySettings.stories.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/ObservabilitySettings/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ObservabilityCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/ObservabilityEvents.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +20 -0
- package/package.json +31 -30
- package/src/ObservabilityPlugin.test.ts +1 -1
- package/src/ObservabilityPlugin.ts +1 -1
- package/src/capabilities/privacy-notice.ts +7 -7
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +1 -1
- package/src/{components → containers}/ObservabilitySettings/ObservabilitySettings.stories.tsx +1 -1
- package/src/containers/ObservabilitySettings/ObservabilitySettings.tsx +39 -0
- package/src/meta.ts +3 -13
- package/src/operations/toggle.ts +1 -1
- package/src/translations.ts +1 -2
- package/src/types/ObservabilityCapabilities.ts +9 -5
- package/src/types/ObservabilityEvents.ts +2 -2
- package/src/types/ObservabilityOperation.ts +1 -1
- package/dist/lib/neutral/ObservabilitySettings-H6UKYDDT.mjs +0 -27
- package/dist/lib/neutral/ObservabilitySettings-H6UKYDDT.mjs.map +0 -7
- package/dist/lib/neutral/chunk-5KWS3NZY.mjs +0 -22
- package/dist/lib/neutral/chunk-5KWS3NZY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-RY77X57N.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-SHB2SLRK.mjs.map +0 -7
- package/dist/lib/neutral/state-5COCK3KV.mjs.map +0 -7
- package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.stories.d.ts.map +0 -1
- package/src/components/ObservabilitySettings/ObservabilitySettings.tsx +0 -34
- /package/dist/lib/neutral/{chunk-GLRKOAB7.mjs.map → chunk-PGTCGVCX.mjs.map} +0 -0
- /package/dist/lib/neutral/{send-event-FKLBHQ2Q.mjs.map → send-event-B6HNLGKK.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/ObservabilitySettings/index.d.ts +0 -0
- /package/dist/types/src/{components → containers}/index.d.ts +0 -0
- /package/src/{components → containers}/ObservabilitySettings/index.ts +0 -0
- /package/src/{components → containers}/index.ts +0 -0
package/dx.config.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Config2 } from '@dxos/app-framework/config';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
export default Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: 'org.dxos.plugin.observability',
|
|
11
|
+
name: 'Telemetry',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
14
|
+
Application observability and telemetry collection for monitoring performance and usage patterns.
|
|
15
|
+
Track metrics, logs, and traces for system health and analytics.
|
|
16
|
+
`,
|
|
17
|
+
icon: { key: 'ph--eye--regular' },
|
|
18
|
+
tags: ['system'],
|
|
19
|
+
},
|
|
20
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-observability",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1-staging.ee54ba693a",
|
|
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,10 +18,10 @@
|
|
|
18
18
|
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
19
|
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
20
|
},
|
|
21
|
-
"#
|
|
22
|
-
"source": "./src/
|
|
23
|
-
"types": "./dist/types/src/
|
|
24
|
-
"default": "./dist/lib/neutral/
|
|
21
|
+
"#containers": {
|
|
22
|
+
"source": "./src/containers/index.ts",
|
|
23
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
25
25
|
},
|
|
26
26
|
"#meta": {
|
|
27
27
|
"source": "./src/meta.ts",
|
|
@@ -75,42 +75,43 @@
|
|
|
75
75
|
"types": "dist/types/src/index.d.ts",
|
|
76
76
|
"files": [
|
|
77
77
|
"dist",
|
|
78
|
+
"dx.config.ts",
|
|
78
79
|
"src"
|
|
79
80
|
],
|
|
80
81
|
"dependencies": {
|
|
81
82
|
"@effect-atom/atom-react": "^0.5.0",
|
|
82
|
-
"effect": "3.21.
|
|
83
|
-
"@dxos/app-framework": "0.9.
|
|
84
|
-
"@dxos/client": "0.9.
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
83
|
+
"effect": "3.21.4",
|
|
84
|
+
"@dxos/app-framework": "0.9.1-staging.ee54ba693a",
|
|
85
|
+
"@dxos/client": "0.9.1-staging.ee54ba693a",
|
|
86
|
+
"@dxos/compute": "0.9.1-staging.ee54ba693a",
|
|
87
|
+
"@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
|
|
88
|
+
"@dxos/keys": "0.9.1-staging.ee54ba693a",
|
|
89
|
+
"@dxos/util": "0.9.1-staging.ee54ba693a",
|
|
90
|
+
"@dxos/invariant": "0.9.1-staging.ee54ba693a",
|
|
91
|
+
"@dxos/log": "0.9.1-staging.ee54ba693a",
|
|
92
|
+
"@dxos/react-ui-form": "0.9.1-staging.ee54ba693a",
|
|
93
|
+
"@dxos/effect": "0.9.1-staging.ee54ba693a",
|
|
94
|
+
"@dxos/observability": "0.9.1-staging.ee54ba693a"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
97
|
"@effect-atom/atom-react": "^0.5.0",
|
|
97
|
-
"@effect/platform": "0.96.
|
|
98
|
-
"@types/react": "~19.2.
|
|
99
|
-
"react": "~19.2.
|
|
98
|
+
"@effect/platform": "0.96.2",
|
|
99
|
+
"@types/react": "~19.2.17",
|
|
100
|
+
"react": "~19.2.7",
|
|
100
101
|
"vite": "^8.0.16",
|
|
101
|
-
"@dxos/plugin-testing": "0.9.
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/ui-theme": "0.9.
|
|
102
|
+
"@dxos/plugin-testing": "0.9.1-staging.ee54ba693a",
|
|
103
|
+
"@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
|
|
104
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
105
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
105
106
|
},
|
|
106
107
|
"peerDependencies": {
|
|
107
108
|
"@effect-atom/atom-react": "^0.5.0",
|
|
108
|
-
"@effect/platform": "0.96.
|
|
109
|
-
"effect": "3.21.
|
|
110
|
-
"react": "~19.2.
|
|
111
|
-
"react-dom": "~19.2.
|
|
112
|
-
"@dxos/ui
|
|
113
|
-
"@dxos/
|
|
109
|
+
"@effect/platform": "0.96.2",
|
|
110
|
+
"effect": "3.21.4",
|
|
111
|
+
"react": "~19.2.7",
|
|
112
|
+
"react-dom": "~19.2.7",
|
|
113
|
+
"@dxos/react-ui": "0.9.1-staging.ee54ba693a",
|
|
114
|
+
"@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
|
|
114
115
|
},
|
|
115
116
|
"publishConfig": {
|
|
116
117
|
"access": "public"
|
|
@@ -10,7 +10,7 @@ import { ObservabilityPlugin } from '#plugin';
|
|
|
10
10
|
|
|
11
11
|
import { meta } from './meta';
|
|
12
12
|
|
|
13
|
-
const moduleId = (name: string) => `${meta.
|
|
13
|
+
const moduleId = (name: string) => `${meta.profile.key}.module.${name}`;
|
|
14
14
|
|
|
15
15
|
describe('ObservabilityPlugin', () => {
|
|
16
16
|
test('modules activate on the expected events', async ({ expect }) => {
|
|
@@ -67,7 +67,7 @@ export const ObservabilityPlugin = Plugin.define<ObservabilityPluginOptions>(met
|
|
|
67
67
|
})),
|
|
68
68
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
69
69
|
Plugin.addModule({
|
|
70
|
-
activatesOn: ActivationEvent.make('org.dxos.plugin.client.event.
|
|
70
|
+
activatesOn: ActivationEvent.make('org.dxos.plugin.client.event.identityCreated'),
|
|
71
71
|
activate: PrivacyNotice,
|
|
72
72
|
}),
|
|
73
73
|
Plugin.addModule(({ namespace, observability }) => ({
|
|
@@ -31,15 +31,15 @@ export default Capability.makeModule(
|
|
|
31
31
|
if (!state.notified && notify) {
|
|
32
32
|
yield* Effect.tryPromise(() =>
|
|
33
33
|
invokePromise(LayoutOperation.AddToast, {
|
|
34
|
-
id: `${meta.
|
|
35
|
-
title: ['observability-toast.label', { ns: meta.
|
|
36
|
-
description: ['observability-toast.description', { ns: meta.
|
|
34
|
+
id: `${meta.profile.key}.notice`,
|
|
35
|
+
title: ['observability-toast.label', { ns: meta.profile.key }],
|
|
36
|
+
description: ['observability-toast.description', { ns: meta.profile.key }],
|
|
37
37
|
duration: Infinity,
|
|
38
38
|
icon: 'ph--info--regular',
|
|
39
|
-
actionLabel: ['observability-toast-action.label', { ns: meta.
|
|
40
|
-
actionAlt: ['observability-toast-action.alt', { ns: meta.
|
|
41
|
-
closeLabel: ['observability-toast-close.label', { ns: meta.
|
|
42
|
-
onAction: () => invokePromise(SettingsOperation.Open, { plugin: meta.
|
|
39
|
+
actionLabel: ['observability-toast-action.label', { ns: meta.profile.key }],
|
|
40
|
+
actionAlt: ['observability-toast-action.alt', { ns: meta.profile.key }],
|
|
41
|
+
closeLabel: ['observability-toast-close.label', { ns: meta.profile.key }],
|
|
42
|
+
onAction: () => invokePromise(SettingsOperation.Open, { plugin: meta.profile.key }),
|
|
43
43
|
}),
|
|
44
44
|
);
|
|
45
45
|
registry.set(stateAtom, { ...registry.get(stateAtom), notified: true });
|
|
@@ -9,7 +9,7 @@ import { Capabilities, Capability } from '@dxos/app-framework';
|
|
|
9
9
|
import { Surface, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
11
|
|
|
12
|
-
import { ObservabilitySettings } from '#
|
|
12
|
+
import { ObservabilitySettings } from '#containers';
|
|
13
13
|
import { meta } from '#meta';
|
|
14
14
|
import { ObservabilityOperation } from '#types';
|
|
15
15
|
import { type Settings } from '#types';
|
|
@@ -19,7 +19,7 @@ export default Capability.makeModule(() =>
|
|
|
19
19
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
20
20
|
Surface.create({
|
|
21
21
|
id: 'root',
|
|
22
|
-
filter: AppSurface.settings(AppSurface.Article, meta.
|
|
22
|
+
filter: AppSurface.settings(AppSurface.Article, meta.profile.key),
|
|
23
23
|
component: ({ data: { subject } }) => {
|
|
24
24
|
const { settings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
25
25
|
const { invokePromise } = useOperationInvoker();
|
|
@@ -14,7 +14,7 @@ import { ObservabilityCapabilities, Settings } from '#types';
|
|
|
14
14
|
export default Capability.makeModule(() =>
|
|
15
15
|
Effect.sync(() => {
|
|
16
16
|
const settingsAtom = createKvsStore({
|
|
17
|
-
key: meta.
|
|
17
|
+
key: meta.profile.key,
|
|
18
18
|
schema: Settings.Settings,
|
|
19
19
|
defaultValue: () => ({
|
|
20
20
|
enabled: true,
|
|
@@ -24,7 +24,7 @@ export default Capability.makeModule(() =>
|
|
|
24
24
|
return [
|
|
25
25
|
Capability.contributes(ObservabilityCapabilities.Settings, settingsAtom),
|
|
26
26
|
Capability.contributes(AppCapabilities.Settings, {
|
|
27
|
-
prefix: meta.
|
|
27
|
+
prefix: meta.profile.key,
|
|
28
28
|
schema: Settings.Settings,
|
|
29
29
|
atom: settingsAtom,
|
|
30
30
|
}),
|
|
@@ -14,7 +14,7 @@ import { ObservabilityCapabilities } from '#types';
|
|
|
14
14
|
export default Capability.makeModule(
|
|
15
15
|
Effect.fnUntraced(function* ({ namespace }: { namespace: string }) {
|
|
16
16
|
const stateAtom = createKvsStore({
|
|
17
|
-
key: meta.
|
|
17
|
+
key: meta.profile.key,
|
|
18
18
|
schema: ObservabilityCapabilities.StateSchema,
|
|
19
19
|
defaultValue: () => ({}),
|
|
20
20
|
});
|
package/src/{components → containers}/ObservabilitySettings/ObservabilitySettings.stories.tsx
RENAMED
|
@@ -11,7 +11,7 @@ import { translations } from '#translations';
|
|
|
11
11
|
import { ObservabilitySettings } from './ObservabilitySettings';
|
|
12
12
|
|
|
13
13
|
const meta = {
|
|
14
|
-
title: 'plugins/plugin-observability/
|
|
14
|
+
title: 'plugins/plugin-observability/containers/ObservabilitySettings',
|
|
15
15
|
component: ObservabilitySettings,
|
|
16
16
|
tags: ['settings'],
|
|
17
17
|
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Message, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { Form } from '@dxos/react-ui-form';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { Settings } from '#types';
|
|
13
|
+
|
|
14
|
+
export type ObservabilitySettingsProps = AppSurface.SettingsProps<Settings.Settings>;
|
|
15
|
+
|
|
16
|
+
export const ObservabilitySettings = ({ settings, onSettingsChange }: ObservabilitySettingsProps) => {
|
|
17
|
+
const { t } = useTranslation(meta.profile.key);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Form.Root
|
|
21
|
+
schema={Settings.Settings}
|
|
22
|
+
values={settings}
|
|
23
|
+
variant='settings'
|
|
24
|
+
readonly={!onSettingsChange}
|
|
25
|
+
onValuesChanged={(values) => onSettingsChange?.((current) => ({ ...current, ...values }))}
|
|
26
|
+
>
|
|
27
|
+
<Form.Viewport scroll>
|
|
28
|
+
<Form.Content>
|
|
29
|
+
<Form.Section title={meta.profile.name ?? meta.profile.key}>
|
|
30
|
+
<Message.Root valence='info'>
|
|
31
|
+
<Message.Content>{t('observability.description')}</Message.Content>
|
|
32
|
+
</Message.Root>
|
|
33
|
+
<Form.FieldSet />
|
|
34
|
+
</Form.Section>
|
|
35
|
+
</Form.Content>
|
|
36
|
+
</Form.Viewport>
|
|
37
|
+
</Form.Root>
|
|
38
|
+
);
|
|
39
|
+
};
|
package/src/meta.ts
CHANGED
|
@@ -3,17 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
|
-
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
description: trim`
|
|
14
|
-
Application observability and telemetry collection for monitoring performance and usage patterns.
|
|
15
|
-
Track metrics, logs, and traces for system health and analytics.
|
|
16
|
-
`,
|
|
17
|
-
icon: 'ph--eye--regular',
|
|
18
|
-
tags: ['system'],
|
|
19
|
-
});
|
|
7
|
+
import config from '../dx.config';
|
|
8
|
+
|
|
9
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
package/src/operations/toggle.ts
CHANGED
|
@@ -21,7 +21,7 @@ const handler: Operation.WithHandler<typeof ObservabilityOperation.Toggle> = Obs
|
|
|
21
21
|
const capabilities = yield* Capability.Service;
|
|
22
22
|
const registry = capabilities.get(Capabilities.AtomRegistry);
|
|
23
23
|
const allSettings = capabilities.getAll(AppCapabilities.Settings);
|
|
24
|
-
const settingsObj = allSettings.find((s: AppCapabilities.Settings) => s.prefix === meta.
|
|
24
|
+
const settingsObj = allSettings.find((s: AppCapabilities.Settings) => s.prefix === meta.profile.key);
|
|
25
25
|
if (!settingsObj) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
package/src/translations.ts
CHANGED
|
@@ -9,10 +9,9 @@ import { meta } from '#meta';
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
|
-
[meta.
|
|
12
|
+
[meta.profile.key]: {
|
|
13
13
|
'plugin.name': 'Telemetry',
|
|
14
14
|
'help.label': 'Feedback',
|
|
15
|
-
'settings.title': 'Telemetry settings',
|
|
16
15
|
'observability-toast.label': 'Privacy Notice',
|
|
17
16
|
'observability-toast.description':
|
|
18
17
|
'Composer collects usage and performance metrics to improve the product. No user data is collected.',
|
|
@@ -13,9 +13,11 @@ import { type Observability as ObservabilityNs } from '@dxos/observability';
|
|
|
13
13
|
|
|
14
14
|
import { meta } from '#meta';
|
|
15
15
|
|
|
16
|
-
export const Namespace = Capability.make<string>(`${meta.
|
|
16
|
+
export const Namespace = Capability.make<string>(`${meta.profile.key}.capability.namespace`);
|
|
17
17
|
|
|
18
|
-
export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(
|
|
18
|
+
export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(
|
|
19
|
+
`${meta.profile.key}.capability.settings`,
|
|
20
|
+
);
|
|
19
21
|
|
|
20
22
|
export const StateSchema = Schema.mutable(
|
|
21
23
|
Schema.Struct({
|
|
@@ -26,16 +28,18 @@ export const StateSchema = Schema.mutable(
|
|
|
26
28
|
|
|
27
29
|
export type State = Schema.Schema.Type<typeof StateSchema>;
|
|
28
30
|
|
|
29
|
-
export const State = Capability.make<Atom.Writable<State>>(`${meta.
|
|
31
|
+
export const State = Capability.make<Atom.Writable<State>>(`${meta.profile.key}.capability.state`);
|
|
30
32
|
|
|
31
|
-
export const Observability = Capability.make<ObservabilityNs.Observability>(
|
|
33
|
+
export const Observability = Capability.make<ObservabilityNs.Observability>(
|
|
34
|
+
`${meta.profile.key}.capability.observability`,
|
|
35
|
+
);
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* Optional capability — when contributed, the help/feedback UI exposes a "Download logs" action.
|
|
35
39
|
* The callback is responsible for the entire download (read store, encode, save file).
|
|
36
40
|
*/
|
|
37
41
|
export type LogDownloader = () => void | Promise<void>;
|
|
38
|
-
export const LogDownloader = Capability.make<LogDownloader>(`${meta.
|
|
42
|
+
export const LogDownloader = Capability.make<LogDownloader>(`${meta.profile.key}.capability.log-downloader`);
|
|
39
43
|
|
|
40
44
|
// NOTE: This is cloned from the client plugin to avoid circular dependencies.
|
|
41
45
|
// TODO(burdon): Figure out how to share defs.
|
|
@@ -9,7 +9,7 @@ import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
|
9
9
|
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
|
|
12
|
-
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.
|
|
12
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.profile.key);
|
|
13
13
|
|
|
14
14
|
// NOTE: This is cloned from the client plugin to avoid circular dependencies.
|
|
15
|
-
export const ClientReadyEvent = ActivationEvent.make('org.dxos.plugin.client.event.
|
|
15
|
+
export const ClientReadyEvent = ActivationEvent.make('org.dxos.plugin.client.event.clientReady');
|
|
@@ -12,7 +12,7 @@ import { DXN } from '@dxos/keys';
|
|
|
12
12
|
|
|
13
13
|
import { meta } from '#meta';
|
|
14
14
|
|
|
15
|
-
const makeKey = (name: string) => DXN.make(`${meta.
|
|
15
|
+
const makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
16
16
|
|
|
17
17
|
export const Toggle = Operation.make({
|
|
18
18
|
meta: {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/components/ObservabilitySettings/ObservabilitySettings.tsx
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Message, useTranslation } from "@dxos/react-ui";
|
|
6
|
-
import { Settings as SettingsForm } from "@dxos/react-ui-form";
|
|
7
|
-
import { meta } from "#meta";
|
|
8
|
-
import { Settings } from "#types";
|
|
9
|
-
var ObservabilitySettings = ({ settings, onSettingsChange }) => {
|
|
10
|
-
const { t } = useTranslation(meta.id);
|
|
11
|
-
return /* @__PURE__ */ React.createElement(SettingsForm.Viewport, null, /* @__PURE__ */ React.createElement(SettingsForm.Section, {
|
|
12
|
-
title: t("settings.title", {
|
|
13
|
-
ns: meta.id
|
|
14
|
-
})
|
|
15
|
-
}, /* @__PURE__ */ React.createElement(Message.Root, {
|
|
16
|
-
valence: "info"
|
|
17
|
-
}, /* @__PURE__ */ React.createElement(Message.Content, null, t("observability.description"))), /* @__PURE__ */ React.createElement(SettingsForm.FieldSet, {
|
|
18
|
-
readonly: !onSettingsChange,
|
|
19
|
-
schema: Settings.Settings,
|
|
20
|
-
values: settings,
|
|
21
|
-
onValuesChanged: (values) => onSettingsChange?.(() => values)
|
|
22
|
-
})));
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
ObservabilitySettings as default
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=ObservabilitySettings-H6UKYDDT.mjs.map
|
|
@@ -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 { Message, useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { 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.FieldSet\n readonly={!onSettingsChange}\n schema={Settings.Settings}\n values={settings}\n onValuesChanged={(values) => onSettingsChange?.(() => values)}\n />\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,SAASC,sBAAsB;AACxC,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AACrB,SAASF,gBAAgB;AAIlB,IAAMG,wBAAwB,CAAC,EAAEC,UAAUC,iBAAgB,MAA8B;AAC9F,QAAM,EAAEC,EAAC,IAAKP,eAAeG,KAAKK,EAAE;AAEpC,SACE,sBAAA,cAACN,aAAaO,UAAQ,MACpB,sBAAA,cAACP,aAAaQ,SAAO;IAACC,OAAOJ,EAAE,kBAAkB;MAAEK,IAAIT,KAAKK;IAAG,CAAA;KAC7D,sBAAA,cAACT,QAAQc,MAAI;IAACC,SAAQ;KACpB,sBAAA,cAACf,QAAQgB,SAAO,MAAER,EAAE,2BAAA,CAAA,CAAA,GAEtB,sBAAA,cAACL,aAAac,UAAQ;IACpBC,UAAU,CAACX;IACXY,QAAQjB,SAASA;IACjBkB,QAAQd;IACRe,iBAAiB,CAACD,WAAWb,mBAAmB,MAAMa,MAAAA;;AAKhE;",
|
|
6
|
-
"names": ["React", "Message", "useTranslation", "Settings", "SettingsForm", "meta", "ObservabilitySettings", "settings", "onSettingsChange", "t", "id", "Viewport", "Section", "title", "ns", "Root", "valence", "Content", "FieldSet", "readonly", "schema", "values", "onValuesChanged"]
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { DXN } from "@dxos/keys";
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var meta = Plugin.makeMeta({
|
|
6
|
-
key: DXN.make("org.dxos.plugin.observability"),
|
|
7
|
-
name: "Telemetry",
|
|
8
|
-
author: "DXOS",
|
|
9
|
-
description: trim`
|
|
10
|
-
Application observability and telemetry collection for monitoring performance and usage patterns.
|
|
11
|
-
Track metrics, logs, and traces for system health and analytics.
|
|
12
|
-
`,
|
|
13
|
-
icon: "ph--eye--regular",
|
|
14
|
-
tags: [
|
|
15
|
-
"system"
|
|
16
|
-
]
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
meta
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=chunk-5KWS3NZY.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.observability'),\n name: 'Telemetry',\n author: 'DXOS',\n description: trim`\n Application observability and telemetry collection for monitoring performance and usage patterns.\n Track metrics, logs, and traces for system health and analytics.\n `,\n icon: 'ph--eye--regular',\n tags: ['system'],\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,OAAOH,OAAOI,SAAS;EAClCC,KAAKJ,IAAIK,KAAK,+BAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,aAAaP;;;;EAIbQ,MAAM;EACNC,MAAM;IAAC;;AACT,CAAA;",
|
|
6
|
-
"names": ["Plugin", "DXN", "trim", "meta", "makeMeta", "key", "make", "name", "author", "description", "icon", "tags"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/ObservabilityCapabilities.ts", "../../../src/types/ObservabilityEvents.ts", "../../../src/types/ObservabilityOperation.ts", "../../../src/types/Settings.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\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 as ObservabilityNs } from '@dxos/observability';\n\nimport { meta } from '#meta';\n\nexport const Namespace = Capability.make<string>(`${meta.id}.capability.namespace`);\n\nexport const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(`${meta.id}.capability.settings`);\n\nexport const StateSchema = Schema.mutable(\n Schema.Struct({\n group: Schema.optional(Schema.String),\n notified: Schema.optional(Schema.Boolean),\n }),\n);\n\nexport type State = Schema.Schema.Type<typeof StateSchema>;\n\nexport const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);\n\nexport const Observability = Capability.make<ObservabilityNs.Observability>(`${meta.id}.capability.observability`);\n\n/**\n * Optional capability — when contributed, the help/feedback UI exposes a \"Download logs\" action.\n * The callback is responsible for the entire download (read store, encode, save file).\n */\nexport type LogDownloader = () => void | Promise<void>;\nexport const LogDownloader = Capability.make<LogDownloader>(`${meta.id}.capability.log-downloader`);\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\n// @import-as-namespace\n\nimport { ActivationEvent } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nexport const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.id);\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 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { DXN } from '@dxos/keys';\n\nimport { meta } from '#meta';\n\nconst makeKey = (name: string) => DXN.make(`${meta.id}.operation.${name}`);\n\nexport const Toggle = Operation.make({\n meta: {\n key: makeKey('toggle'),\n name: 'Toggle Observability',\n description: 'Toggle observability on or off.',\n icon: 'ph--eye--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Boolean,\n});\n\nexport const SendEvent = Operation.make({\n meta: {\n key: makeKey('sendEvent'),\n name: 'Send Event',\n description: 'Send an observability event.',\n icon: 'ph--broadcast--regular',\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", "//\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.annotations({\n title: 'Enable telemetry',\n description: 'Send anonymous usage and performance data to help improve the product.',\n }),\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": ";;;;;AAAA;;;;;;;;;;AAOA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAI3B,SAASC,YAAY;AAEd,IAAMC,YAAYF,WAAWG,KAAa,GAAGF,KAAKG,EAAE,uBAAuB;AAE3E,IAAMC,WAAWL,WAAWG,KAAmD,GAAGF,KAAKG,EAAE,sBAAsB;AAE/G,IAAME,cAAqBC,eACzBC,cAAO;EACZC,OAAcC,gBAAgBC,aAAM;EACpCC,UAAiBF,gBAAgBG,cAAO;AAC1C,CAAA,CAAA;AAKK,IAAMC,QAAQd,WAAWG,KAA2B,GAAGF,KAAKG,EAAE,mBAAmB;AAEjF,IAAMW,gBAAgBf,WAAWG,KAAoC,GAAGF,KAAKG,EAAE,2BAA2B;AAO1G,IAAMY,gBAAgBhB,WAAWG,KAAoB,GAAGF,KAAKG,EAAE,4BAA4B;AAI3F,IAAMa,mBAAmBjB,WAAWG,KAAa,0CAAA;;;ACzCxD;;;;;AAMA,SAASe,uBAAuB;AAChC,SAASC,2BAA2B;AAEpC,SAASC,QAAAA,aAAY;AAEd,IAAMC,aAA8CF,oBAAoBG,iBAAiBF,MAAKG,EAAE;AAGhG,IAAMC,mBAAmBN,gBAAgBO,KAAK,2CAAA;;;ACdrD;;;;;AAMA,YAAYC,aAAY;AAExB,SAASC,cAAAA,mBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AAEpB,SAASC,QAAAA,aAAY;AAErB,IAAMC,UAAU,CAACC,SAAiBH,IAAII,KAAK,GAAGH,MAAKI,EAAE,cAAcF,IAAAA,EAAM;AAElE,IAAMG,SAASP,UAAUK,KAAK;EACnCH,MAAM;IACJM,KAAKL,QAAQ,QAAA;IACbC,MAAM;IACNK,aAAa;IACbC,MAAM;EACR;EACAC,UAAU;IAACZ,YAAWa;;EACtBC,OAAcC,eAAO;IACnBC,OAAcC,iBAAgBC,eAAO;EACvC,CAAA;EACAC,QAAeD;AACjB,CAAA;AAEO,IAAME,YAAYnB,UAAUK,KAAK;EACtCH,MAAM;IACJM,KAAKL,QAAQ,WAAA;IACbC,MAAM;IACNK,aAAa;IACbC,MAAM;EACR;EACAC,UAAU;IAACZ,YAAWa;;EACtBC,OAAcC,eAAO;IACnBV,MAAagB,eAAOC,YAAY;MAAEZ,aAAa;IAAyB,CAAA;IACxEa,YAAmBN,iBAAgBO,WAAG,EAAEF,YAAY;MAAEZ,aAAa;IAAoB,CAAA;EACzF,CAAA;EACAS,QAAeM;AACjB,CAAA;;;AC3CA;;kBAAAC;;AAMA,YAAYC,aAAY;AAEjB,IAAMD,YAAkBE,gBACtBC,eAAO;EACZC,SAAgBC,gBAAQC,YAAY;IAClCC,OAAO;IACPC,aAAa;EACf,CAAA;AAKF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Capability", "meta", "Namespace", "make", "id", "Settings", "StateSchema", "mutable", "Struct", "group", "optional", "String", "notified", "Boolean", "State", "Observability", "LogDownloader", "ClientCapability", "ActivationEvent", "AppActivationEvents", "meta", "StateReady", "createStateEvent", "id", "ClientReadyEvent", "make", "Schema", "Capability", "Operation", "DXN", "meta", "makeKey", "name", "make", "id", "Toggle", "key", "description", "icon", "services", "Service", "input", "Struct", "state", "optional", "Boolean", "output", "SendEvent", "String", "annotations", "properties", "Any", "Void", "Settings", "Schema", "mutable", "Struct", "enabled", "Boolean", "annotations", "title", "description"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { ObservabilitySettings } from '#components';\nimport { meta } from '#meta';\nimport { ObservabilityOperation } from '#types';\nimport { type Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'root',\n filter: AppSurface.settings(AppSurface.Article, meta.id),\n component: ({ data: { subject } }) => {\n const { settings } = useSettingsState<Settings.Settings>(subject.atom);\n const { invokePromise } = useOperationInvoker();\n const handleSettingsChange = (cb: (current: Settings.Settings) => Settings.Settings) => {\n const next = cb(settings);\n void invokePromise(ObservabilityOperation.Toggle, { state: next.enabled });\n };\n return <ObservabilitySettings settings={settings} onSettingsChange={handleSettingsChange} />;\n },\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,SAASC,qBAAqBC,wBAAwB;AAC/D,SAASC,kBAAkB;AAE3B,SAASC,6BAA6B;AACtC,SAASC,YAAY;AACrB,SAASC,8BAA8B;AAGvC,IAAA,wBAAeP,WAAWQ,WAAW,MAC5BC,eACLT,WAAWU,YAAYX,aAAaY,cAAc;EAChDV,QAAQW,OAAO;IACbC,IAAI;IACJC,QAAQV,WAAWW,SAASX,WAAWY,SAASV,KAAKO,EAAE;IACvDI,WAAW,CAAC,EAAEC,MAAM,EAAEC,QAAO,EAAE,MAAE;AAC/B,YAAM,EAAEJ,SAAQ,IAAKZ,iBAAoCgB,QAAQC,IAAI;AACrE,YAAM,EAAEC,cAAa,IAAKnB,oBAAAA;AAC1B,YAAMoB,uBAAuB,CAACC,OAAAA;AAC5B,cAAMC,OAAOD,GAAGR,QAAAA;AAChB,aAAKM,cAAcd,uBAAuBkB,QAAQ;UAAEC,OAAOF,KAAKG;QAAQ,CAAA;MAC1E;AACA,aAAO,sBAAA,cAACtB,uBAAAA;QAAsBU;QAAoBa,kBAAkBN;;IACtE;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "useOperationInvoker", "useSettingsState", "AppSurface", "ObservabilitySettings", "meta", "ObservabilityOperation", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "filter", "settings", "Article", "component", "data", "subject", "atom", "invokePromise", "handleSettingsChange", "cb", "next", "Toggle", "state", "enabled", "onSettingsChange"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/state.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 { createKvsStore } from '@dxos/effect';\nimport { Observability } from '@dxos/observability';\n\nimport { meta } from '#meta';\nimport { ObservabilityCapabilities } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ namespace }: { namespace: string }) {\n const stateAtom = createKvsStore({\n key: meta.id,\n schema: ObservabilityCapabilities.StateSchema,\n defaultValue: () => ({}),\n });\n\n // NOTE: Group is set at runtime, not persisted.\n const group = yield* Effect.tryPromise(() => Observability.getObservabilityGroup(namespace));\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n registry.set(stateAtom, { ...registry.get(stateAtom), group });\n\n return Capability.contributes(ObservabilityCapabilities.State, stateAtom);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,sBAAsB;AAC/B,SAASC,qBAAqB;AAE9B,SAASC,YAAY;AACrB,SAASC,iCAAiC;AAE1C,IAAA,gBAAeJ,WAAWK,WACjBC,kBAAW,WAAW,EAAEC,UAAS,GAAyB;AAC/D,QAAMC,YAAYP,eAAe;IAC/BQ,KAAKN,KAAKO;IACVC,QAAQP,0BAA0BQ;IAClCC,cAAc,OAAO,CAAC;EACxB,CAAA;AAGA,QAAMC,QAAQ,OAAcC,kBAAW,MAAMb,cAAcc,sBAAsBT,SAAAA,CAAAA;AACjF,QAAMU,WAAW,OAAOjB,WAAWkB,IAAInB,aAAaoB,YAAY;AAChEF,WAASG,IAAIZ,WAAW;IAAE,GAAGS,SAASC,IAAIV,SAAAA;IAAYM;EAAM,CAAA;AAE5D,SAAOd,WAAWqB,YAAYjB,0BAA0BkB,OAAOd,SAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "createKvsStore", "Observability", "meta", "ObservabilityCapabilities", "makeModule", "fnUntraced", "namespace", "stateAtom", "key", "id", "schema", "StateSchema", "defaultValue", "group", "tryPromise", "getObservabilityGroup", "registry", "get", "AtomRegistry", "set", "contributes", "State"]
|
|
7
|
-
}
|
package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.stories.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservabilitySettings.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObservabilitySettings/ObservabilitySettings.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CASoC,CAAC;eAEhC,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import { Message, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { Settings as SettingsForm } from '@dxos/react-ui-form';
|
|
10
|
-
|
|
11
|
-
import { meta } from '#meta';
|
|
12
|
-
import { Settings } from '#types';
|
|
13
|
-
|
|
14
|
-
export type ObservabilitySettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
|
|
15
|
-
|
|
16
|
-
export const ObservabilitySettings = ({ settings, onSettingsChange }: ObservabilitySettingsProps) => {
|
|
17
|
-
const { t } = useTranslation(meta.id);
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<SettingsForm.Viewport>
|
|
21
|
-
<SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
|
|
22
|
-
<Message.Root valence='info'>
|
|
23
|
-
<Message.Content>{t('observability.description')}</Message.Content>
|
|
24
|
-
</Message.Root>
|
|
25
|
-
<SettingsForm.FieldSet
|
|
26
|
-
readonly={!onSettingsChange}
|
|
27
|
-
schema={Settings.Settings}
|
|
28
|
-
values={settings}
|
|
29
|
-
onValuesChanged={(values) => onSettingsChange?.(() => values)}
|
|
30
|
-
/>
|
|
31
|
-
</SettingsForm.Section>
|
|
32
|
-
</SettingsForm.Viewport>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|