@dxos/plugin-observability 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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/browser/{app-graph-builder-DCOBBL5B.mjs → app-graph-builder-URADSG7H.mjs} +8 -8
- package/dist/lib/browser/app-graph-builder-URADSG7H.mjs.map +7 -0
- package/dist/lib/browser/{chunk-D7WLH4F5.mjs → chunk-DS6CC4U2.mjs} +21 -9
- package/dist/lib/browser/chunk-DS6CC4U2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UUOBAWT2.mjs → chunk-G754T676.mjs} +5 -5
- package/dist/lib/browser/chunk-G754T676.mjs.map +7 -0
- package/dist/lib/browser/{chunk-N3VKS2LF.mjs → chunk-GIXCFOTS.mjs} +21 -17
- package/dist/lib/browser/chunk-GIXCFOTS.mjs.map +7 -0
- package/dist/lib/browser/chunk-SCJ3DALL.mjs +11 -0
- package/dist/lib/browser/chunk-SCJ3DALL.mjs.map +7 -0
- package/dist/lib/browser/{client-ready-KK3EWEBV.mjs → client-ready-R6AHJ7S2.mjs} +15 -15
- package/dist/lib/browser/client-ready-R6AHJ7S2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -22
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-A4EV25OK.mjs → intent-resolver-FPED2K7L.mjs} +10 -10
- package/dist/lib/browser/intent-resolver-FPED2K7L.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-FUXMXVYO.mjs → react-surface-PI4EO5L6.mjs} +11 -11
- package/dist/lib/browser/react-surface-PI4EO5L6.mjs.map +7 -0
- package/dist/lib/browser/{settings-OSMKJOUM.mjs → settings-YPFHGPX2.mjs} +6 -6
- package/dist/lib/browser/{settings-OSMKJOUM.mjs.map → settings-YPFHGPX2.mjs.map} +1 -1
- package/dist/lib/browser/{state-VIOQS2IL.mjs → state-OVWHPB7K.mjs} +7 -7
- package/dist/lib/browser/state-OVWHPB7K.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -0
- package/dist/lib/node-esm/{app-graph-builder-6JT2RPVM.mjs → app-graph-builder-HIU5PUNC.mjs} +8 -8
- package/dist/lib/node-esm/app-graph-builder-HIU5PUNC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7XR7KMAA.mjs → chunk-4SMSG2RN.mjs} +2 -4
- package/dist/lib/node-esm/chunk-4SMSG2RN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-RG73SOOD.mjs → chunk-HUZC43ID.mjs} +21 -17
- package/dist/lib/node-esm/chunk-HUZC43ID.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4BFWCQJ5.mjs → chunk-VGDRT4ZD.mjs} +21 -9
- package/dist/lib/node-esm/chunk-VGDRT4ZD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JTKEM7PT.mjs → chunk-ZS4YMD63.mjs} +5 -5
- package/dist/lib/node-esm/chunk-ZS4YMD63.mjs.map +7 -0
- package/dist/lib/node-esm/{client-ready-EZVAX7D5.mjs → client-ready-OYW7KJYM.mjs} +15 -15
- package/dist/lib/node-esm/client-ready-OYW7KJYM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +20 -22
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-7HLSOM7X.mjs → intent-resolver-OZBOPHXD.mjs} +10 -10
- package/dist/lib/node-esm/intent-resolver-OZBOPHXD.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-TYVAHN2E.mjs → react-surface-N34XWDMU.mjs} +11 -11
- package/dist/lib/node-esm/react-surface-N34XWDMU.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-S2OXVO3G.mjs → settings-EOJWJNAZ.mjs} +6 -6
- package/dist/lib/node-esm/{settings-S2OXVO3G.mjs.map → settings-EOJWJNAZ.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-J2WS6L64.mjs → state-5UHYHOJV.mjs} +7 -7
- package/dist/lib/node-esm/state-5UHYHOJV.mjs.map +7 -0
- package/dist/lib/node-esm/{types.mjs → types/index.mjs} +3 -3
- package/dist/types/src/ObservabilityPlugin.d.ts +3 -2
- package/dist/types/src/ObservabilityPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/client-ready.d.ts +1 -1
- package/dist/types/src/capabilities/client-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/HelpContainer.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/{types.d.ts → types/schema.d.ts} +36 -9
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -35
- package/src/ObservabilityPlugin.ts +52 -49
- package/src/capabilities/app-graph-builder.ts +7 -6
- package/src/capabilities/capabilities.ts +4 -3
- package/src/capabilities/client-ready.ts +14 -13
- package/src/capabilities/intent-resolver.ts +5 -4
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/capabilities/state.ts +3 -2
- package/src/components/FeedbackForm.tsx +2 -2
- package/src/components/HelpContainer.tsx +7 -6
- package/src/components/ObservabilitySettings.tsx +18 -18
- package/src/events.ts +3 -3
- package/src/meta.ts +1 -3
- package/src/translations.ts +1 -0
- package/src/types/index.ts +5 -0
- package/src/{types.ts → types/schema.ts} +20 -7
- package/dist/lib/browser/app-graph-builder-DCOBBL5B.mjs.map +0 -7
- package/dist/lib/browser/chunk-57RVSKYP.mjs +0 -13
- package/dist/lib/browser/chunk-57RVSKYP.mjs.map +0 -7
- package/dist/lib/browser/chunk-D7WLH4F5.mjs.map +0 -7
- package/dist/lib/browser/chunk-N3VKS2LF.mjs.map +0 -7
- package/dist/lib/browser/chunk-UUOBAWT2.mjs.map +0 -7
- package/dist/lib/browser/client-ready-KK3EWEBV.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-A4EV25OK.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FUXMXVYO.mjs.map +0 -7
- package/dist/lib/browser/state-VIOQS2IL.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -10
- package/dist/lib/node-esm/app-graph-builder-6JT2RPVM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4BFWCQJ5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7XR7KMAA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JTKEM7PT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RG73SOOD.mjs.map +0 -7
- package/dist/lib/node-esm/client-ready-EZVAX7D5.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-7HLSOM7X.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-TYVAHN2E.mjs.map +0 -7
- package/dist/lib/node-esm/state-J2WS6L64.mjs.map +0 -7
- package/dist/types/src/types.d.ts.map +0 -1
- /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{types.mjs.map → types/index.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-observability",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.a4bbb77",
|
|
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",
|
|
@@ -10,21 +10,23 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./types": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
20
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
21
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
22
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
"types": "dist/types/src/index.d.ts",
|
|
24
26
|
"typesVersions": {
|
|
25
27
|
"*": {
|
|
26
28
|
"types": [
|
|
27
|
-
"dist/types/src/types.d.ts"
|
|
29
|
+
"dist/types/src/types/index.d.ts"
|
|
28
30
|
]
|
|
29
31
|
}
|
|
30
32
|
},
|
|
@@ -34,44 +36,44 @@
|
|
|
34
36
|
],
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
37
|
-
"@preact/signals-core": "^1.
|
|
38
|
-
"effect": "3.
|
|
39
|
+
"@preact/signals-core": "^1.12.1",
|
|
40
|
+
"effect": "3.18.3",
|
|
39
41
|
"localforage": "^1.10.0",
|
|
40
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
41
|
-
"@dxos/async": "0.8.4-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/invariant": "0.8.4-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/react-
|
|
54
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
55
|
-
"@dxos/util": "0.8.4-main.
|
|
42
|
+
"@dxos/app-framework": "0.8.4-main.a4bbb77",
|
|
43
|
+
"@dxos/async": "0.8.4-main.a4bbb77",
|
|
44
|
+
"@dxos/context": "0.8.4-main.a4bbb77",
|
|
45
|
+
"@dxos/echo-schema": "0.8.4-main.a4bbb77",
|
|
46
|
+
"@dxos/invariant": "0.8.4-main.a4bbb77",
|
|
47
|
+
"@dxos/live-object": "0.8.4-main.a4bbb77",
|
|
48
|
+
"@dxos/log": "0.8.4-main.a4bbb77",
|
|
49
|
+
"@dxos/observability": "0.8.4-main.a4bbb77",
|
|
50
|
+
"@dxos/local-storage": "0.8.4-main.a4bbb77",
|
|
51
|
+
"@dxos/plugin-graph": "0.8.4-main.a4bbb77",
|
|
52
|
+
"@dxos/protocols": "0.8.4-main.a4bbb77",
|
|
53
|
+
"@dxos/echo": "0.8.4-main.a4bbb77",
|
|
54
|
+
"@dxos/react-ui-form": "0.8.4-main.a4bbb77",
|
|
55
|
+
"@dxos/react-client": "0.8.4-main.a4bbb77",
|
|
56
|
+
"@dxos/react-ui-stack": "0.8.4-main.a4bbb77",
|
|
57
|
+
"@dxos/util": "0.8.4-main.a4bbb77"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
|
-
"@effect-rx/rx-react": "0.
|
|
59
|
-
"@effect/platform": "0.
|
|
60
|
-
"@types/react": "~
|
|
61
|
-
"react": "~
|
|
62
|
-
"vite": "
|
|
63
|
-
"@dxos/react-ui
|
|
64
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
65
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
60
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
61
|
+
"@effect/platform": "0.92.1",
|
|
62
|
+
"@types/react": "~19.2.0",
|
|
63
|
+
"react": "~19.2.0",
|
|
64
|
+
"vite": "7.1.9",
|
|
65
|
+
"@dxos/react-ui": "0.8.4-main.a4bbb77",
|
|
66
|
+
"@dxos/react-ui-theme": "0.8.4-main.a4bbb77",
|
|
67
|
+
"@dxos/storybook-utils": "0.8.4-main.a4bbb77"
|
|
66
68
|
},
|
|
67
69
|
"peerDependencies": {
|
|
68
70
|
"@effect-rx/rx-react": "^0.34.1",
|
|
69
71
|
"@effect/platform": "^0.80.12",
|
|
70
72
|
"effect": "^3.13.3",
|
|
71
|
-
"react": "
|
|
72
|
-
"react-dom": "
|
|
73
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
74
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
73
|
+
"react": "^19.0.0",
|
|
74
|
+
"react-dom": "^19.0.0",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.a4bbb77",
|
|
76
|
+
"@dxos/react-ui-theme": "0.8.4-main.a4bbb77"
|
|
75
77
|
},
|
|
76
78
|
"publishConfig": {
|
|
77
79
|
"access": "public"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, Events, allOf, contributes, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { type Observability } from '@dxos/observability';
|
|
7
7
|
|
|
8
8
|
import {
|
|
@@ -14,54 +14,57 @@ import {
|
|
|
14
14
|
ObservabilityState,
|
|
15
15
|
ReactSurface,
|
|
16
16
|
} from './capabilities';
|
|
17
|
-
import {
|
|
17
|
+
import { ClientReadyEvent, ObservabilityEvents } from './events';
|
|
18
18
|
import { meta } from './meta';
|
|
19
19
|
import { translations } from './translations';
|
|
20
20
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
21
|
+
export type ObservabilityPluginOptions = {
|
|
22
|
+
namespace: string;
|
|
23
|
+
observability: () => Promise<Observability>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const ObservabilityPlugin = definePlugin<ObservabilityPluginOptions>(meta, ({ namespace, observability }) => [
|
|
27
|
+
defineModule({
|
|
28
|
+
id: `${meta.id}/module/observability`,
|
|
29
|
+
activatesOn: Events.Startup,
|
|
30
|
+
activate: async () => contributes(ObservabilityCapabilities.Observability, await observability()),
|
|
31
|
+
}),
|
|
32
|
+
defineModule({
|
|
33
|
+
id: `${meta.id}/module/settings`,
|
|
34
|
+
activatesOn: Events.SetupSettings,
|
|
35
|
+
activate: ObservabilitySettings,
|
|
36
|
+
}),
|
|
37
|
+
defineModule({
|
|
38
|
+
id: `${meta.id}/module/state`,
|
|
39
|
+
activatesOn: Events.Startup,
|
|
40
|
+
activatesAfter: [ObservabilityEvents.StateReady],
|
|
41
|
+
activate: () => ObservabilityState({ namespace }),
|
|
42
|
+
}),
|
|
43
|
+
defineModule({
|
|
44
|
+
id: `${meta.id}/module/translations`,
|
|
45
|
+
activatesOn: Events.SetupTranslations,
|
|
46
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
47
|
+
}),
|
|
48
|
+
defineModule({
|
|
49
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
50
|
+
activatesOn: Events.SetupIntentResolver,
|
|
51
|
+
activate: (context) => IntentResolver({ context, namespace }),
|
|
52
|
+
}),
|
|
53
|
+
defineModule({
|
|
54
|
+
id: `${meta.id}/module/react-surface`,
|
|
55
|
+
activatesOn: Events.SetupReactSurface,
|
|
56
|
+
activate: ReactSurface,
|
|
57
|
+
}),
|
|
58
|
+
defineModule({
|
|
59
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
60
|
+
activatesOn: Events.SetupAppGraph,
|
|
61
|
+
activate: AppGraphBuilder,
|
|
62
|
+
}),
|
|
63
|
+
defineModule({
|
|
64
|
+
id: `${meta.id}/module/client-ready`,
|
|
65
|
+
activatesOn: allOf(Events.DispatcherReady, ObservabilityEvents.StateReady, ClientReadyEvent),
|
|
66
|
+
activate: async (context) => {
|
|
67
|
+
return ClientReady({ context, observability: await observability(), namespace });
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
]);
|
|
@@ -5,19 +5,20 @@
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
6
|
import { Option, pipe } from 'effect';
|
|
7
7
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
-
import {
|
|
8
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
9
|
+
import { ROOT_ID, createExtension } from '@dxos/plugin-graph';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
// NOTE: Copied from @dxos/plugin-deck to break circular dependency.
|
|
14
14
|
const ATTENDABLE_PATH_SEPARATOR = '~';
|
|
15
|
+
|
|
15
16
|
const DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';
|
|
16
17
|
|
|
17
|
-
export default (
|
|
18
|
+
export default (_context: PluginContext) =>
|
|
18
19
|
contributes(Capabilities.AppGraphBuilder, [
|
|
19
20
|
createExtension({
|
|
20
|
-
id: `${
|
|
21
|
+
id: `${meta.id}/help`,
|
|
21
22
|
connector: (node) =>
|
|
22
23
|
Rx.make((get) =>
|
|
23
24
|
pipe(
|
|
@@ -30,7 +31,7 @@ export default (context: PluginContext) =>
|
|
|
30
31
|
type: DECK_COMPANION_TYPE,
|
|
31
32
|
data: null,
|
|
32
33
|
properties: {
|
|
33
|
-
label: ['help label', { ns:
|
|
34
|
+
label: ['help label', { ns: meta.id }],
|
|
34
35
|
icon: 'ph--question--regular',
|
|
35
36
|
disposition: 'hidden',
|
|
36
37
|
position: 'hoist',
|
|
@@ -6,17 +6,18 @@ import { defineCapability } from '@dxos/app-framework';
|
|
|
6
6
|
import { type Client } from '@dxos/client';
|
|
7
7
|
import { type Observability } from '@dxos/observability';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { meta } from '../meta';
|
|
10
10
|
|
|
11
11
|
export namespace ObservabilityCapabilities {
|
|
12
12
|
export type State = {
|
|
13
13
|
group?: string;
|
|
14
14
|
notified?: boolean;
|
|
15
15
|
};
|
|
16
|
-
export const State = defineCapability<State>(`${
|
|
16
|
+
export const State = defineCapability<State>(`${meta.id}/capability/state`);
|
|
17
17
|
|
|
18
|
-
export const Observability = defineCapability<Observability>(`${
|
|
18
|
+
export const Observability = defineCapability<Observability>(`${meta.id}/capability/observability`);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// NOTE: This is cloned from the client plugin to avoid circular dependencies.
|
|
22
|
+
// TODO(burdon): Figure out how to share defs.
|
|
22
23
|
export const ClientCapability = defineCapability<Client>('dxos.org/plugin/client/capability/client');
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
Capabilities,
|
|
7
|
-
contributes,
|
|
8
|
-
createIntent,
|
|
9
7
|
LayoutAction,
|
|
10
|
-
SettingsAction,
|
|
11
8
|
type PluginContext,
|
|
9
|
+
SettingsAction,
|
|
10
|
+
contributes,
|
|
11
|
+
createIntent,
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
|
-
import {
|
|
13
|
+
import { type Observability, setupTelemetryListeners } from '@dxos/observability';
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import { OBSERVABILITY_PLUGIN } from '../meta';
|
|
15
|
+
import { meta } from '../meta';
|
|
17
16
|
import { ObservabilityAction } from '../types';
|
|
18
17
|
|
|
18
|
+
import { ClientCapability, ObservabilityCapabilities } from './capabilities';
|
|
19
|
+
|
|
19
20
|
type ClientReadyOptions = {
|
|
20
21
|
context: PluginContext;
|
|
21
22
|
namespace: string;
|
|
@@ -37,15 +38,15 @@ export default async ({ context, namespace, observability }: ClientReadyOptions)
|
|
|
37
38
|
createIntent(LayoutAction.AddToast, {
|
|
38
39
|
part: 'toast',
|
|
39
40
|
subject: {
|
|
40
|
-
id: `${
|
|
41
|
-
title: ['observability toast label', { ns:
|
|
42
|
-
description: ['observability toast description', { ns:
|
|
41
|
+
id: `${meta.id}/notice`,
|
|
42
|
+
title: ['observability toast label', { ns: meta.id }],
|
|
43
|
+
description: ['observability toast description', { ns: meta.id }],
|
|
43
44
|
duration: Infinity,
|
|
44
45
|
icon: 'ph--info--regular',
|
|
45
|
-
actionLabel: ['observability toast action label', { ns:
|
|
46
|
-
actionAlt: ['observability toast action alt', { ns:
|
|
47
|
-
closeLabel: ['observability toast close label', { ns:
|
|
48
|
-
onAction: () => dispatch(createIntent(SettingsAction.Open, { plugin:
|
|
46
|
+
actionLabel: ['observability toast action label', { ns: meta.id }],
|
|
47
|
+
actionAlt: ['observability toast action alt', { ns: meta.id }],
|
|
48
|
+
closeLabel: ['observability toast close label', { ns: meta.id }],
|
|
49
|
+
onAction: () => dispatch(createIntent(SettingsAction.Open, { plugin: meta.id })),
|
|
49
50
|
},
|
|
50
51
|
}),
|
|
51
52
|
);
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, IntentAction, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
|
|
6
6
|
import { log } from '@dxos/log';
|
|
7
7
|
import { getTelemetryIdentity, storeObservabilityDisabled } from '@dxos/observability';
|
|
8
8
|
|
|
9
|
-
import { ClientCapability, ObservabilityCapabilities } from './capabilities';
|
|
10
9
|
import { type ObservabilitySettingsProps } from '../components';
|
|
11
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
12
11
|
import { ObservabilityAction } from '../types';
|
|
13
12
|
|
|
13
|
+
import { ClientCapability, ObservabilityCapabilities } from './capabilities';
|
|
14
|
+
|
|
14
15
|
export default ({ context, namespace }: { context: PluginContext; namespace: string }) =>
|
|
15
16
|
contributes(Capabilities.IntentResolver, [
|
|
16
17
|
createResolver({
|
|
@@ -26,7 +27,7 @@ export default ({ context, namespace }: { context: PluginContext; namespace: str
|
|
|
26
27
|
const observability = context.getCapability(ObservabilityCapabilities.Observability);
|
|
27
28
|
const settings = context
|
|
28
29
|
.getCapability(Capabilities.SettingsStore)
|
|
29
|
-
.getStore<ObservabilitySettingsProps>(
|
|
30
|
+
.getStore<ObservabilitySettingsProps>(meta.id)!.value;
|
|
30
31
|
settings.enabled = state ?? !settings.enabled;
|
|
31
32
|
observability.track({
|
|
32
33
|
...getTelemetryIdentity(client),
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { SettingsStore } from '@dxos/local-storage';
|
|
9
9
|
|
|
10
10
|
import { HelpContainer, ObservabilitySettings, type ObservabilitySettingsProps } from '../components';
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export default () =>
|
|
14
14
|
contributes(Capabilities.ReactSurface, [
|
|
15
15
|
createSurface({
|
|
16
|
-
id:
|
|
16
|
+
id: meta.id,
|
|
17
17
|
role: 'article',
|
|
18
18
|
filter: (data): data is { subject: SettingsStore<ObservabilitySettingsProps> } =>
|
|
19
|
-
data.subject instanceof SettingsStore && data.subject.prefix ===
|
|
19
|
+
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
20
20
|
component: ({ data: { subject } }) => <ObservabilitySettings settings={subject.value} />,
|
|
21
21
|
}),
|
|
22
22
|
createSurface({
|
|
23
|
-
id: `${
|
|
23
|
+
id: `${meta.id}/help`,
|
|
24
24
|
role: 'deck-companion--help',
|
|
25
25
|
component: () => <HelpContainer />,
|
|
26
26
|
}),
|
|
@@ -6,11 +6,12 @@ import { contributes } from '@dxos/app-framework';
|
|
|
6
6
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
7
|
import { getObservabilityGroup } from '@dxos/observability';
|
|
8
8
|
|
|
9
|
+
import { meta } from '../meta';
|
|
10
|
+
|
|
9
11
|
import { ObservabilityCapabilities } from './capabilities';
|
|
10
|
-
import { OBSERVABILITY_PLUGIN } from '../meta';
|
|
11
12
|
|
|
12
13
|
export default async ({ namespace }: { namespace: string }) => {
|
|
13
|
-
const state = new LocalStorageStore<ObservabilityCapabilities.State>(
|
|
14
|
+
const state = new LocalStorageStore<ObservabilityCapabilities.State>(meta.id);
|
|
14
15
|
|
|
15
16
|
state.prop({ key: 'notified', type: LocalStorageStore.bool({ allowUndefined: true }) });
|
|
16
17
|
|
|
@@ -8,13 +8,13 @@ import { getSnapshot } from '@dxos/echo-schema';
|
|
|
8
8
|
import { IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { FormProvider, useFormContext, useInputProps } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
import { UserFeedback } from '../types';
|
|
13
13
|
|
|
14
14
|
const defaultValues: UserFeedback = { message: '' };
|
|
15
15
|
|
|
16
16
|
const FormContent = () => {
|
|
17
|
-
const { t } = useTranslation(
|
|
17
|
+
const { t } = useTranslation(meta.id);
|
|
18
18
|
const { handleSave, canSave } = useFormContext<UserFeedback>();
|
|
19
19
|
|
|
20
20
|
const messageProps = useInputProps(['message']);
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import { pipe } from 'effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import { chain, createIntent,
|
|
8
|
+
import { LayoutAction, chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import { OBSERVABILITY_PLUGIN } from '../meta';
|
|
10
|
+
import { meta } from '../meta';
|
|
12
11
|
import { ObservabilityAction, type UserFeedback } from '../types';
|
|
13
12
|
|
|
13
|
+
import { FeedbackForm } from './FeedbackForm';
|
|
14
|
+
|
|
14
15
|
export const HelpContainer = () => {
|
|
15
16
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
16
17
|
|
|
@@ -23,11 +24,11 @@ export const HelpContainer = () => {
|
|
|
23
24
|
chain(LayoutAction.AddToast, {
|
|
24
25
|
part: 'toast',
|
|
25
26
|
subject: {
|
|
26
|
-
id: `${
|
|
27
|
+
id: `${meta.id}/feedback-success`,
|
|
27
28
|
icon: 'ph--paper-plane-tilt--regular',
|
|
28
29
|
duration: 3000,
|
|
29
|
-
title: ['feedback toast label', { ns:
|
|
30
|
-
description: ['feedback toast description', { ns:
|
|
30
|
+
title: ['feedback toast label', { ns: meta.id }],
|
|
31
|
+
description: ['feedback toast description', { ns: meta.id }],
|
|
31
32
|
closeLabel: ['close label', { ns: 'os' }],
|
|
32
33
|
},
|
|
33
34
|
}),
|
|
@@ -7,9 +7,9 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { Input, Message, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { ObservabilityAction } from '../types';
|
|
14
14
|
|
|
15
15
|
export const ObservabilitySettingsSchema = Schema.mutable(
|
|
@@ -25,24 +25,24 @@ export const ObservabilitySettingsSchema = Schema.mutable(
|
|
|
25
25
|
export type ObservabilitySettingsProps = Schema.Schema.Type<typeof ObservabilitySettingsSchema>;
|
|
26
26
|
|
|
27
27
|
export const ObservabilitySettings = ({ settings }: { settings: ObservabilitySettingsProps }) => {
|
|
28
|
-
const { t } = useTranslation(
|
|
28
|
+
const { t } = useTranslation(meta.id);
|
|
29
29
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</
|
|
46
|
-
</
|
|
32
|
+
<ControlPage>
|
|
33
|
+
<ControlSection title={t('settings title', { ns: meta.id })}>
|
|
34
|
+
<Message.Root valence='info' classNames='container-max-width mbe-cardSpacingBlock'>
|
|
35
|
+
<Message.Content>{t('observability description')}</Message.Content>
|
|
36
|
+
</Message.Root>
|
|
37
|
+
<ControlGroup>
|
|
38
|
+
<ControlItemInput title={t('observability enabled label')}>
|
|
39
|
+
<Input.Switch
|
|
40
|
+
checked={settings.enabled}
|
|
41
|
+
onCheckedChange={(checked) => dispatch(createIntent(ObservabilityAction.Toggle, { state: !!checked }))}
|
|
42
|
+
/>
|
|
43
|
+
</ControlItemInput>
|
|
44
|
+
</ControlGroup>
|
|
45
|
+
</ControlSection>
|
|
46
|
+
</ControlPage>
|
|
47
47
|
);
|
|
48
48
|
};
|
package/src/events.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Events, defineEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from './meta';
|
|
8
8
|
|
|
9
9
|
export namespace ObservabilityEvents {
|
|
10
|
-
export const StateReady = Events.createStateEvent(
|
|
10
|
+
export const StateReady = Events.createStateEvent(meta.id);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// NOTE: This is cloned from the client plugin to avoid circular dependencies.
|
package/src/meta.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';
|
|
8
|
-
|
|
9
7
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
8
|
+
id: 'dxos.org/plugin/observability',
|
|
11
9
|
name: 'Telemetry',
|
|
12
10
|
icon: 'ph--eye--regular',
|
|
13
11
|
};
|
package/src/translations.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const translations = [
|
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
13
|
'plugin name': 'Telemetry',
|
|
14
|
+
'settings title': 'Telemetry settings',
|
|
14
15
|
'observability toast label': 'Privacy Notice',
|
|
15
16
|
'observability toast description':
|
|
16
17
|
'Composer collects usage and performance metrics to improve the product. No user data is collected.',
|
|
@@ -6,7 +6,7 @@ import { Schema } from 'effect';
|
|
|
6
6
|
|
|
7
7
|
import { Type } from '@dxos/echo';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { meta } from '../meta';
|
|
10
10
|
|
|
11
11
|
const nonEmpty = <S extends Schema.Schema.Any>(field: string) =>
|
|
12
12
|
Schema.nonEmptyString<S>({ message: () => `Missing field: ${field}` });
|
|
@@ -20,10 +20,8 @@ export const UserFeedback = Schema.Struct({
|
|
|
20
20
|
|
|
21
21
|
export type UserFeedback = Schema.Schema.Type<typeof UserFeedback>;
|
|
22
22
|
|
|
23
|
-
const OBSERVABILITY_ACTION = `${OBSERVABILITY_PLUGIN}/action`;
|
|
24
|
-
|
|
25
23
|
export namespace ObservabilityAction {
|
|
26
|
-
export class Toggle extends Schema.TaggedClass<Toggle>()(`${
|
|
24
|
+
export class Toggle extends Schema.TaggedClass<Toggle>()(`${meta.id}/action/toggle`, {
|
|
27
25
|
input: Schema.Struct({
|
|
28
26
|
state: Schema.optional(Schema.Boolean),
|
|
29
27
|
}),
|
|
@@ -31,7 +29,7 @@ export namespace ObservabilityAction {
|
|
|
31
29
|
}) {}
|
|
32
30
|
|
|
33
31
|
export class CaptureUserFeedback extends Schema.TaggedClass<CaptureUserFeedback>()(
|
|
34
|
-
`${
|
|
32
|
+
`${meta.id}/action/capture-feedback`,
|
|
35
33
|
{
|
|
36
34
|
input: UserFeedback,
|
|
37
35
|
output: Schema.Void,
|
|
@@ -39,7 +37,7 @@ export namespace ObservabilityAction {
|
|
|
39
37
|
) {}
|
|
40
38
|
|
|
41
39
|
/** Base intent for sending events. */
|
|
42
|
-
export class BaseSendEvent extends Schema.TaggedClass<BaseSendEvent>()(`${
|
|
40
|
+
export class BaseSendEvent extends Schema.TaggedClass<BaseSendEvent>()(`${meta.id}/action/send-event`, {
|
|
43
41
|
input: Schema.Struct({
|
|
44
42
|
name: Schema.String,
|
|
45
43
|
properties: Schema.optional(Schema.Object),
|
|
@@ -48,7 +46,7 @@ export namespace ObservabilityAction {
|
|
|
48
46
|
}) {}
|
|
49
47
|
|
|
50
48
|
/** Intent with strict types for first-party events. */
|
|
51
|
-
export class SendEvent extends Schema.TaggedClass<SendEvent>()(`${
|
|
49
|
+
export class SendEvent extends Schema.TaggedClass<SendEvent>()(`${meta.id}/action/send-event`, {
|
|
52
50
|
// NOTE: Sort alphabetically by name.
|
|
53
51
|
input: Schema.Union(
|
|
54
52
|
Schema.Struct({
|
|
@@ -115,6 +113,21 @@ export namespace ObservabilityAction {
|
|
|
115
113
|
version: Schema.optional(Schema.String),
|
|
116
114
|
}),
|
|
117
115
|
}),
|
|
116
|
+
Schema.Struct({
|
|
117
|
+
name: Schema.Literal('space.schema.use'),
|
|
118
|
+
properties: Schema.Struct({
|
|
119
|
+
spaceId: Type.SpaceId,
|
|
120
|
+
typename: Schema.String,
|
|
121
|
+
}),
|
|
122
|
+
}),
|
|
123
|
+
Schema.Struct({
|
|
124
|
+
name: Schema.Literal('space.schema.add'),
|
|
125
|
+
properties: Schema.Struct({
|
|
126
|
+
spaceId: Type.SpaceId,
|
|
127
|
+
objectId: Schema.String,
|
|
128
|
+
typename: Schema.String,
|
|
129
|
+
}),
|
|
130
|
+
}),
|
|
118
131
|
Schema.Struct({
|
|
119
132
|
name: Schema.Literal('space.object.add'),
|
|
120
133
|
properties: Schema.Struct({
|