@dxos/plugin-observability 0.8.4-main.3a94e84 → 0.8.4-main.3c1ae3b
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-3I6HZ5AR.mjs} +12 -11
- package/dist/lib/browser/app-graph-builder-3I6HZ5AR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UUOBAWT2.mjs → chunk-EC7HTFA5.mjs} +5 -5
- package/dist/lib/browser/chunk-EC7HTFA5.mjs.map +7 -0
- package/dist/lib/browser/chunk-RLY6UZDS.mjs +123 -0
- package/dist/lib/browser/chunk-RLY6UZDS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AL5RST75.mjs → chunk-RRMLEY35.mjs} +56 -29
- package/dist/lib/browser/chunk-RRMLEY35.mjs.map +7 -0
- package/dist/lib/browser/chunk-W7QWKVS3.mjs +16 -0
- package/dist/lib/browser/chunk-W7QWKVS3.mjs.map +7 -0
- package/dist/lib/browser/{client-ready-TAII5PYS.mjs → client-ready-XT27JB7J.mjs} +15 -15
- package/dist/lib/browser/client-ready-XT27JB7J.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +21 -49
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-5SA443WX.mjs → intent-resolver-QRKGLMMT.mjs} +10 -10
- package/dist/lib/browser/intent-resolver-QRKGLMMT.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-GQC3M7XY.mjs → react-surface-F5GY7AAC.mjs} +11 -11
- package/dist/lib/browser/react-surface-F5GY7AAC.mjs.map +7 -0
- package/dist/lib/browser/{settings-BG3S45SS.mjs → settings-SAFMS6TG.mjs} +6 -6
- package/dist/lib/browser/{settings-BG3S45SS.mjs.map → settings-SAFMS6TG.mjs.map} +1 -1
- package/dist/lib/browser/{state-VIOQS2IL.mjs → state-FJD6K3ZZ.mjs} +7 -7
- package/dist/lib/browser/state-FJD6K3ZZ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{app-graph-builder-6JT2RPVM.mjs → app-graph-builder-KH2GA6G7.mjs} +12 -11
- package/dist/lib/node-esm/app-graph-builder-KH2GA6G7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AVJTLRX5.mjs +18 -0
- package/dist/lib/node-esm/chunk-AVJTLRX5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JTKEM7PT.mjs → chunk-HACSZKXD.mjs} +5 -5
- package/dist/lib/node-esm/chunk-HACSZKXD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JJBWCCSZ.mjs +124 -0
- package/dist/lib/node-esm/chunk-JJBWCCSZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5W5V4TVX.mjs → chunk-T5OWY73X.mjs} +56 -29
- package/dist/lib/node-esm/chunk-T5OWY73X.mjs.map +7 -0
- package/dist/lib/node-esm/{client-ready-KER2HNME.mjs → client-ready-AXZXR5EX.mjs} +15 -15
- package/dist/lib/node-esm/client-ready-AXZXR5EX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +21 -49
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-YYBRI4TZ.mjs → intent-resolver-WXZEG7SP.mjs} +10 -10
- package/dist/lib/node-esm/intent-resolver-WXZEG7SP.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-ZYMR7TMY.mjs → react-surface-DNASLRFA.mjs} +11 -11
- package/dist/lib/node-esm/react-surface-DNASLRFA.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-HSLQO3OC.mjs → settings-22NXJMTF.mjs} +6 -6
- package/dist/lib/node-esm/{settings-HSLQO3OC.mjs.map → settings-22NXJMTF.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-J2WS6L64.mjs → state-XNBMNLB7.mjs} +7 -7
- package/dist/lib/node-esm/state-XNBMNLB7.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- 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/FeedbackForm.d.ts +3 -3
- package/dist/types/src/components/FeedbackForm.d.ts.map +1 -1
- package/dist/types/src/components/FeedbackForm.stories.d.ts +34 -0
- package/dist/types/src/components/FeedbackForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/HelpContainer.d.ts.map +1 -1
- package/dist/types/src/components/ObservabilitySettings.d.ts +1 -1
- package/dist/types/src/components/ObservabilitySettings.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 +3 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +112 -112
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -32
- package/src/ObservabilityPlugin.ts +52 -49
- package/src/capabilities/app-graph-builder.ts +12 -10
- 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.stories.tsx +33 -0
- package/src/components/FeedbackForm.tsx +13 -69
- package/src/components/HelpContainer.tsx +10 -8
- package/src/components/ObservabilitySettings.tsx +21 -20
- package/src/events.ts +3 -3
- package/src/meta.ts +6 -3
- package/src/translations.ts +3 -2
- package/src/types/schema.ts +30 -26
- 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-AL5RST75.mjs.map +0 -7
- package/dist/lib/browser/chunk-UUOBAWT2.mjs.map +0 -7
- package/dist/lib/browser/chunk-YVKMVVGP.mjs +0 -175
- package/dist/lib/browser/chunk-YVKMVVGP.mjs.map +0 -7
- package/dist/lib/browser/client-ready-TAII5PYS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5SA443WX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GQC3M7XY.mjs.map +0 -7
- package/dist/lib/browser/state-VIOQS2IL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-6JT2RPVM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5W5V4TVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7XR7KMAA.mjs +0 -15
- 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-TYZLSIA4.mjs +0 -176
- package/dist/lib/node-esm/chunk-TYZLSIA4.mjs.map +0 -7
- package/dist/lib/node-esm/client-ready-KER2HNME.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YYBRI4TZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZYMR7TMY.mjs.map +0 -7
- package/dist/lib/node-esm/state-J2WS6L64.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.
|
|
3
|
+
"version": "0.8.4-main.3c1ae3b",
|
|
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,11 +10,13 @@
|
|
|
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": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
18
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -34,44 +36,43 @@
|
|
|
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/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-client": "0.8.4-main.
|
|
52
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/util": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui-stack": "0.8.4-main.3a94e84"
|
|
42
|
+
"@dxos/app-framework": "0.8.4-main.3c1ae3b",
|
|
43
|
+
"@dxos/async": "0.8.4-main.3c1ae3b",
|
|
44
|
+
"@dxos/context": "0.8.4-main.3c1ae3b",
|
|
45
|
+
"@dxos/invariant": "0.8.4-main.3c1ae3b",
|
|
46
|
+
"@dxos/live-object": "0.8.4-main.3c1ae3b",
|
|
47
|
+
"@dxos/echo": "0.8.4-main.3c1ae3b",
|
|
48
|
+
"@dxos/local-storage": "0.8.4-main.3c1ae3b",
|
|
49
|
+
"@dxos/log": "0.8.4-main.3c1ae3b",
|
|
50
|
+
"@dxos/observability": "0.8.4-main.3c1ae3b",
|
|
51
|
+
"@dxos/plugin-graph": "0.8.4-main.3c1ae3b",
|
|
52
|
+
"@dxos/protocols": "0.8.4-main.3c1ae3b",
|
|
53
|
+
"@dxos/react-client": "0.8.4-main.3c1ae3b",
|
|
54
|
+
"@dxos/react-ui-form": "0.8.4-main.3c1ae3b",
|
|
55
|
+
"@dxos/react-ui-stack": "0.8.4-main.3c1ae3b",
|
|
56
|
+
"@dxos/util": "0.8.4-main.3c1ae3b"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@effect-
|
|
59
|
-
"@effect/platform": "0.
|
|
60
|
-
"@types/react": "~
|
|
61
|
-
"react": "~
|
|
62
|
-
"vite": "
|
|
63
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
64
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
65
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
59
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
60
|
+
"@effect/platform": "0.92.1",
|
|
61
|
+
"@types/react": "~19.2.2",
|
|
62
|
+
"react": "~19.2.0",
|
|
63
|
+
"vite": "7.1.9",
|
|
64
|
+
"@dxos/react-ui": "0.8.4-main.3c1ae3b",
|
|
65
|
+
"@dxos/react-ui-theme": "0.8.4-main.3c1ae3b",
|
|
66
|
+
"@dxos/storybook-utils": "0.8.4-main.3c1ae3b"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
|
-
"@effect-
|
|
69
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
69
70
|
"@effect/platform": "^0.80.12",
|
|
70
71
|
"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.
|
|
72
|
+
"react": "^19.0.0",
|
|
73
|
+
"react-dom": "^19.0.0",
|
|
74
|
+
"@dxos/react-ui": "0.8.4-main.3c1ae3b",
|
|
75
|
+
"@dxos/react-ui-theme": "0.8.4-main.3c1ae3b"
|
|
75
76
|
},
|
|
76
77
|
"publishConfig": {
|
|
77
78
|
"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
|
+
]);
|
|
@@ -2,25 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
-
import {
|
|
9
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
+
import { ROOT_ID, createExtension } from '@dxos/plugin-graph';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
12
13
|
|
|
13
14
|
// NOTE: Copied from @dxos/plugin-deck to break circular dependency.
|
|
14
15
|
const ATTENDABLE_PATH_SEPARATOR = '~';
|
|
16
|
+
|
|
15
17
|
const DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';
|
|
16
18
|
|
|
17
|
-
export default (
|
|
19
|
+
export default (_context: PluginContext) =>
|
|
18
20
|
contributes(Capabilities.AppGraphBuilder, [
|
|
19
21
|
createExtension({
|
|
20
|
-
id: `${
|
|
22
|
+
id: `${meta.id}/help`,
|
|
21
23
|
connector: (node) =>
|
|
22
|
-
|
|
23
|
-
pipe(
|
|
24
|
+
Atom.make((get) =>
|
|
25
|
+
Function.pipe(
|
|
24
26
|
get(node),
|
|
25
27
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
26
28
|
Option.map((node) => {
|
|
@@ -30,7 +32,7 @@ export default (context: PluginContext) =>
|
|
|
30
32
|
type: DECK_COMPANION_TYPE,
|
|
31
33
|
data: null,
|
|
32
34
|
properties: {
|
|
33
|
-
label: ['help label', { ns:
|
|
35
|
+
label: ['help label', { ns: meta.id }],
|
|
34
36
|
icon: 'ph--question--regular',
|
|
35
37
|
disposition: 'hidden',
|
|
36
38
|
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
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
|
|
7
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
|
|
9
|
+
import { translations } from '../translations';
|
|
10
|
+
|
|
11
|
+
import { FeedbackForm } from './FeedbackForm';
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'plugins/plugin-observability/FeedbackForm',
|
|
15
|
+
component: FeedbackForm,
|
|
16
|
+
decorators: [withTheme, withLayout({ container: 'column' })],
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'fullscreen',
|
|
19
|
+
translations,
|
|
20
|
+
},
|
|
21
|
+
} satisfies Meta<typeof FeedbackForm>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
onSave: (values) => {
|
|
30
|
+
console.log(values);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -2,81 +2,25 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { FormProvider, useFormContext, useInputProps } from '@dxos/react-ui-form';
|
|
7
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { Form, type FormRootProps } from '@dxos/react-ui-form';
|
|
10
9
|
|
|
11
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
12
11
|
import { UserFeedback } from '../types';
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
export type FeedbackFormProps = Pick<FormRootProps<UserFeedback>, 'onSave'>;
|
|
15
14
|
|
|
16
|
-
const
|
|
17
|
-
const { t } = useTranslation(
|
|
18
|
-
const { handleSave, canSave } = useFormContext<UserFeedback>();
|
|
19
|
-
|
|
20
|
-
const messageProps = useInputProps(['message']);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div role='form' className='p-3 flex flex-col gap-2'>
|
|
24
|
-
<div role='none' className='space-b-1'>
|
|
25
|
-
<Input.Root validationValence={messageProps.getStatus().status}>
|
|
26
|
-
<Input.Label>{t('feedback text area label')}</Input.Label>
|
|
27
|
-
<Input.TextArea
|
|
28
|
-
classNames={'text-sm'}
|
|
29
|
-
rows={5}
|
|
30
|
-
cols={30}
|
|
31
|
-
placeholder={t('feedback text area placeholder')}
|
|
32
|
-
value={messageProps.getValue() ?? ''}
|
|
33
|
-
onChange={(e) => messageProps.onValueChange('string', e.target.value)}
|
|
34
|
-
// TODO(wittjosiah): This aggressively shows validation errors.
|
|
35
|
-
onBlur={messageProps.onBlur}
|
|
36
|
-
/>
|
|
37
|
-
<Input.DescriptionAndValidation>
|
|
38
|
-
<Input.Validation>{messageProps.getStatus().error}</Input.Validation>
|
|
39
|
-
</Input.DescriptionAndValidation>
|
|
40
|
-
</Input.Root>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div role='none' className='space-b-2'>
|
|
44
|
-
<IconButton
|
|
45
|
-
icon='ph--paper-plane-tilt--regular'
|
|
46
|
-
label={t('send feedback label')}
|
|
47
|
-
variant='primary'
|
|
48
|
-
type='submit'
|
|
49
|
-
classNames='is-full'
|
|
50
|
-
disabled={!canSave}
|
|
51
|
-
onClick={handleSave}
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// TODO(wittjosiah): Use `Form`?
|
|
59
|
-
export const FeedbackForm = ({ onSave }: { onSave: (values: UserFeedback) => void }) => {
|
|
60
|
-
const formRef = useRef<HTMLDivElement>(null);
|
|
61
|
-
const [_, update] = useState({});
|
|
62
|
-
const forceRender = useCallback(() => update({}), [update]);
|
|
63
|
-
|
|
64
|
-
const handleSave = useCallback(
|
|
65
|
-
(values: UserFeedback) => {
|
|
66
|
-
onSave(values);
|
|
67
|
-
// TODO(wittjosiah): Force re-render to clear the form.
|
|
68
|
-
forceRender();
|
|
69
|
-
},
|
|
70
|
-
[forceRender, onSave],
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
const initialValues = getSnapshot(defaultValues);
|
|
15
|
+
export const FeedbackForm = ({ onSave }: FeedbackFormProps) => {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
74
17
|
|
|
75
18
|
return (
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
19
|
+
<Form.Root schema={UserFeedback} onSave={onSave}>
|
|
20
|
+
<Form.Content>
|
|
21
|
+
<Form.FieldSet />
|
|
22
|
+
<Form.Submit icon='ph--paper-plane-tilt--regular' label={t('send feedback label')} />
|
|
23
|
+
</Form.Content>
|
|
24
|
+
</Form.Root>
|
|
81
25
|
);
|
|
82
26
|
};
|
|
@@ -2,32 +2,34 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Function from 'effect/Function';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import { chain, createIntent
|
|
8
|
+
import { LayoutAction, chain, createIntent } from '@dxos/app-framework';
|
|
9
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
-
import { OBSERVABILITY_PLUGIN } from '../meta';
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
import { ObservabilityAction, type UserFeedback } from '../types';
|
|
13
13
|
|
|
14
|
+
import { FeedbackForm } from './FeedbackForm';
|
|
15
|
+
|
|
14
16
|
export const HelpContainer = () => {
|
|
15
17
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
16
18
|
|
|
17
19
|
const handleSave = useCallback(
|
|
18
20
|
(values: UserFeedback) =>
|
|
19
21
|
dispatch(
|
|
20
|
-
pipe(
|
|
22
|
+
Function.pipe(
|
|
21
23
|
createIntent(ObservabilityAction.CaptureUserFeedback, values),
|
|
22
24
|
chain(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
23
25
|
chain(LayoutAction.AddToast, {
|
|
24
26
|
part: 'toast',
|
|
25
27
|
subject: {
|
|
26
|
-
id: `${
|
|
28
|
+
id: `${meta.id}/feedback-success`,
|
|
27
29
|
icon: 'ph--paper-plane-tilt--regular',
|
|
28
30
|
duration: 3000,
|
|
29
|
-
title: ['feedback toast label', { ns:
|
|
30
|
-
description: ['feedback toast description', { ns:
|
|
31
|
+
title: ['feedback toast label', { ns: meta.id }],
|
|
32
|
+
description: ['feedback toast description', { ns: meta.id }],
|
|
31
33
|
closeLabel: ['close label', { ns: 'os' }],
|
|
32
34
|
},
|
|
33
35
|
}),
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { createIntent
|
|
8
|
+
import { createIntent } from '@dxos/app-framework';
|
|
9
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
10
|
import { Input, Message, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
13
14
|
import { ObservabilityAction } from '../types';
|
|
14
15
|
|
|
15
16
|
export const ObservabilitySettingsSchema = Schema.mutable(
|
|
@@ -25,24 +26,24 @@ export const ObservabilitySettingsSchema = Schema.mutable(
|
|
|
25
26
|
export type ObservabilitySettingsProps = Schema.Schema.Type<typeof ObservabilitySettingsSchema>;
|
|
26
27
|
|
|
27
28
|
export const ObservabilitySettings = ({ settings }: { settings: ObservabilitySettingsProps }) => {
|
|
28
|
-
const { t } = useTranslation(
|
|
29
|
+
const { t } = useTranslation(meta.id);
|
|
29
30
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</
|
|
46
|
-
</
|
|
33
|
+
<ControlPage>
|
|
34
|
+
<ControlSection title={t('settings title', { ns: meta.id })}>
|
|
35
|
+
<Message.Root valence='info' classNames='container-max-width mbe-cardSpacingBlock'>
|
|
36
|
+
<Message.Content>{t('observability description')}</Message.Content>
|
|
37
|
+
</Message.Root>
|
|
38
|
+
<ControlGroup>
|
|
39
|
+
<ControlItemInput title={t('observability enabled label')}>
|
|
40
|
+
<Input.Switch
|
|
41
|
+
checked={settings.enabled}
|
|
42
|
+
onCheckedChange={(checked) => dispatch(createIntent(ObservabilityAction.Toggle, { state: !!checked }))}
|
|
43
|
+
/>
|
|
44
|
+
</ControlItemInput>
|
|
45
|
+
</ControlGroup>
|
|
46
|
+
</ControlSection>
|
|
47
|
+
</ControlPage>
|
|
47
48
|
);
|
|
48
49
|
};
|