@dxos/plugin-observability 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d
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-2SLFJVUL.mjs → app-graph-builder-3I6HZ5AR.mjs} +11 -10
- 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-AL5RST75.mjs → chunk-I32JO7N6.mjs} +24 -24
- package/dist/lib/browser/chunk-I32JO7N6.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/{chunk-L3IU52HU.mjs → chunk-ZPNE2QLZ.mjs} +18 -16
- package/dist/lib/browser/chunk-ZPNE2QLZ.mjs.map +7 -0
- package/dist/lib/browser/{client-ready-NBJRF7OJ.mjs → client-ready-SGUJYKFO.mjs} +14 -14
- package/dist/lib/browser/client-ready-SGUJYKFO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +17 -20
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NPEP5KJQ.mjs → intent-resolver-7AS3LQUD.mjs} +8 -8
- package/dist/lib/browser/intent-resolver-7AS3LQUD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-CDYIX5E5.mjs → react-surface-D7OCQATN.mjs} +10 -10
- package/dist/lib/browser/react-surface-D7OCQATN.mjs.map +7 -0
- package/dist/lib/browser/{settings-UMTIHBMJ.mjs → settings-ILBB3GCR.mjs} +6 -6
- package/dist/lib/browser/{settings-UMTIHBMJ.mjs.map → settings-ILBB3GCR.mjs.map} +1 -1
- package/dist/lib/browser/{state-N7RLB477.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-MMH6BVY4.mjs → app-graph-builder-KH2GA6G7.mjs} +11 -10
- 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-MMLZUUAO.mjs → chunk-HDEVP6Z4.mjs} +18 -16
- package/dist/lib/node-esm/chunk-HDEVP6Z4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5W5V4TVX.mjs → chunk-JA6DTCPS.mjs} +24 -24
- package/dist/lib/node-esm/chunk-JA6DTCPS.mjs.map +7 -0
- package/dist/lib/node-esm/{client-ready-XDI3JWUY.mjs → client-ready-AQWXCEF7.mjs} +14 -14
- package/dist/lib/node-esm/client-ready-AQWXCEF7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +17 -20
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-OH4MMH5I.mjs → intent-resolver-JI4234E7.mjs} +8 -8
- package/dist/lib/node-esm/intent-resolver-JI4234E7.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7PZFK6V4.mjs → react-surface-KRRSSVTP.mjs} +10 -10
- package/dist/lib/node-esm/react-surface-KRRSSVTP.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-PIXR2XML.mjs → settings-LRA7DFLS.mjs} +6 -6
- package/dist/lib/node-esm/{settings-PIXR2XML.mjs.map → settings-LRA7DFLS.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-LKANNCJJ.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/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/types/schema.d.ts +110 -110
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -32
- package/src/ObservabilityPlugin.ts +50 -47
- package/src/capabilities/app-graph-builder.ts +10 -8
- package/src/capabilities/capabilities.ts +4 -3
- package/src/capabilities/client-ready.ts +8 -8
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/react-surface.tsx +4 -4
- package/src/capabilities/state.ts +2 -2
- package/src/components/FeedbackForm.tsx +3 -3
- package/src/components/HelpContainer.tsx +8 -7
- package/src/components/ObservabilitySettings.tsx +6 -5
- package/src/events.ts +2 -2
- package/src/meta.ts +6 -3
- package/src/types/schema.ts +20 -20
- package/dist/lib/browser/app-graph-builder-2SLFJVUL.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-L3IU52HU.mjs.map +0 -7
- package/dist/lib/browser/chunk-UUOBAWT2.mjs.map +0 -7
- package/dist/lib/browser/client-ready-NBJRF7OJ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-NPEP5KJQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-CDYIX5E5.mjs.map +0 -7
- package/dist/lib/browser/state-N7RLB477.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-MMH6BVY4.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-MMLZUUAO.mjs.map +0 -7
- package/dist/lib/node-esm/client-ready-XDI3JWUY.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OH4MMH5I.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7PZFK6V4.mjs.map +0 -7
- package/dist/lib/node-esm/state-LKANNCJJ.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.66e292d",
|
|
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",
|
|
@@ -36,44 +36,43 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
39
|
-
"@preact/signals-core": "^1.
|
|
40
|
-
"effect": "3.
|
|
39
|
+
"@preact/signals-core": "^1.12.1",
|
|
40
|
+
"effect": "3.18.3",
|
|
41
41
|
"localforage": "^1.10.0",
|
|
42
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
43
|
-
"@dxos/async": "0.8.4-main.
|
|
44
|
-
"@dxos/context": "0.8.4-main.
|
|
45
|
-
"@dxos/echo
|
|
46
|
-
"@dxos/invariant": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/observability": "0.8.4-main.
|
|
50
|
-
"@dxos/log": "0.8.4-main.
|
|
51
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
56
|
-
"@dxos/util": "0.8.4-main.
|
|
57
|
-
"@dxos/echo": "0.8.4-main.5ea62a8"
|
|
42
|
+
"@dxos/app-framework": "0.8.4-main.66e292d",
|
|
43
|
+
"@dxos/async": "0.8.4-main.66e292d",
|
|
44
|
+
"@dxos/context": "0.8.4-main.66e292d",
|
|
45
|
+
"@dxos/echo": "0.8.4-main.66e292d",
|
|
46
|
+
"@dxos/invariant": "0.8.4-main.66e292d",
|
|
47
|
+
"@dxos/live-object": "0.8.4-main.66e292d",
|
|
48
|
+
"@dxos/local-storage": "0.8.4-main.66e292d",
|
|
49
|
+
"@dxos/observability": "0.8.4-main.66e292d",
|
|
50
|
+
"@dxos/log": "0.8.4-main.66e292d",
|
|
51
|
+
"@dxos/plugin-graph": "0.8.4-main.66e292d",
|
|
52
|
+
"@dxos/protocols": "0.8.4-main.66e292d",
|
|
53
|
+
"@dxos/react-client": "0.8.4-main.66e292d",
|
|
54
|
+
"@dxos/react-ui-form": "0.8.4-main.66e292d",
|
|
55
|
+
"@dxos/react-ui-stack": "0.8.4-main.66e292d",
|
|
56
|
+
"@dxos/util": "0.8.4-main.66e292d"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
|
-
"@effect-
|
|
61
|
-
"@effect/platform": "0.
|
|
62
|
-
"@types/react": "~
|
|
63
|
-
"react": "~
|
|
64
|
-
"vite": "7.1.
|
|
65
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
66
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
67
|
-
"@dxos/react-ui-theme": "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.66e292d",
|
|
65
|
+
"@dxos/storybook-utils": "0.8.4-main.66e292d",
|
|
66
|
+
"@dxos/react-ui-theme": "0.8.4-main.66e292d"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
|
-
"@effect-
|
|
69
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
71
70
|
"@effect/platform": "^0.80.12",
|
|
72
71
|
"effect": "^3.13.3",
|
|
73
|
-
"react": "
|
|
74
|
-
"react-dom": "
|
|
75
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
76
|
-
"@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.66e292d",
|
|
75
|
+
"@dxos/react-ui-theme": "0.8.4-main.66e292d"
|
|
77
76
|
},
|
|
78
77
|
"publishConfig": {
|
|
79
78
|
"access": "public"
|
|
@@ -18,50 +18,53 @@ 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
9
|
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
9
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');
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
13
|
import { type Observability, setupTelemetryListeners } from '@dxos/observability';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { meta } from '../meta';
|
|
16
16
|
import { ObservabilityAction } from '../types';
|
|
17
17
|
|
|
18
18
|
import { ClientCapability, ObservabilityCapabilities } from './capabilities';
|
|
@@ -38,15 +38,15 @@ export default async ({ context, namespace, observability }: ClientReadyOptions)
|
|
|
38
38
|
createIntent(LayoutAction.AddToast, {
|
|
39
39
|
part: 'toast',
|
|
40
40
|
subject: {
|
|
41
|
-
id: `${
|
|
42
|
-
title: ['observability toast label', { ns:
|
|
43
|
-
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 }],
|
|
44
44
|
duration: Infinity,
|
|
45
45
|
icon: 'ph--info--regular',
|
|
46
|
-
actionLabel: ['observability toast action label', { ns:
|
|
47
|
-
actionAlt: ['observability toast action alt', { ns:
|
|
48
|
-
closeLabel: ['observability toast close label', { ns:
|
|
49
|
-
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 })),
|
|
50
50
|
},
|
|
51
51
|
}),
|
|
52
52
|
);
|
|
@@ -7,7 +7,7 @@ import { log } from '@dxos/log';
|
|
|
7
7
|
import { getTelemetryIdentity, storeObservabilityDisabled } from '@dxos/observability';
|
|
8
8
|
|
|
9
9
|
import { type ObservabilitySettingsProps } from '../components';
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
import { ObservabilityAction } from '../types';
|
|
12
12
|
|
|
13
13
|
import { ClientCapability, ObservabilityCapabilities } from './capabilities';
|
|
@@ -27,7 +27,7 @@ export default ({ context, namespace }: { context: PluginContext; namespace: str
|
|
|
27
27
|
const observability = context.getCapability(ObservabilityCapabilities.Observability);
|
|
28
28
|
const settings = context
|
|
29
29
|
.getCapability(Capabilities.SettingsStore)
|
|
30
|
-
.getStore<ObservabilitySettingsProps>(
|
|
30
|
+
.getStore<ObservabilitySettingsProps>(meta.id)!.value;
|
|
31
31
|
settings.enabled = state ?? !settings.enabled;
|
|
32
32
|
observability.track({
|
|
33
33
|
...getTelemetryIdentity(client),
|
|
@@ -8,19 +8,19 @@ 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,12 +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 {
|
|
9
|
+
import { meta } from '../meta';
|
|
10
10
|
|
|
11
11
|
import { ObservabilityCapabilities } from './capabilities';
|
|
12
12
|
|
|
13
13
|
export default async ({ namespace }: { namespace: string }) => {
|
|
14
|
-
const state = new LocalStorageStore<ObservabilityCapabilities.State>(
|
|
14
|
+
const state = new LocalStorageStore<ObservabilityCapabilities.State>(meta.id);
|
|
15
15
|
|
|
16
16
|
state.prop({ key: 'notified', type: LocalStorageStore.bool({ allowUndefined: true }) });
|
|
17
17
|
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { getSnapshot } from '@dxos/echo
|
|
7
|
+
import { getSnapshot } from '@dxos/echo/internal';
|
|
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']);
|
|
@@ -2,12 +2,13 @@
|
|
|
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 { LayoutAction, 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 { meta } from '../meta';
|
|
11
12
|
import { ObservabilityAction, type UserFeedback } from '../types';
|
|
12
13
|
|
|
13
14
|
import { FeedbackForm } from './FeedbackForm';
|
|
@@ -18,17 +19,17 @@ export const HelpContainer = () => {
|
|
|
18
19
|
const handleSave = useCallback(
|
|
19
20
|
(values: UserFeedback) =>
|
|
20
21
|
dispatch(
|
|
21
|
-
pipe(
|
|
22
|
+
Function.pipe(
|
|
22
23
|
createIntent(ObservabilityAction.CaptureUserFeedback, values),
|
|
23
24
|
chain(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
24
25
|
chain(LayoutAction.AddToast, {
|
|
25
26
|
part: 'toast',
|
|
26
27
|
subject: {
|
|
27
|
-
id: `${
|
|
28
|
+
id: `${meta.id}/feedback-success`,
|
|
28
29
|
icon: 'ph--paper-plane-tilt--regular',
|
|
29
30
|
duration: 3000,
|
|
30
|
-
title: ['feedback toast label', { ns:
|
|
31
|
-
description: ['feedback toast description', { ns:
|
|
31
|
+
title: ['feedback toast label', { ns: meta.id }],
|
|
32
|
+
description: ['feedback toast description', { ns: meta.id }],
|
|
32
33
|
closeLabel: ['close label', { ns: 'os' }],
|
|
33
34
|
},
|
|
34
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
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,12 +26,12 @@ 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
|
<ControlPage>
|
|
33
|
-
<ControlSection title={t('settings title', { ns:
|
|
34
|
+
<ControlSection title={t('settings title', { ns: meta.id })}>
|
|
34
35
|
<Message.Root valence='info' classNames='container-max-width mbe-cardSpacingBlock'>
|
|
35
36
|
<Message.Content>{t('observability description')}</Message.Content>
|
|
36
37
|
</Message.Root>
|
package/src/events.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
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
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
8
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
9
|
+
id: 'dxos.org/plugin/observability',
|
|
11
10
|
name: 'Telemetry',
|
|
11
|
+
description: trim`
|
|
12
|
+
Application observability and telemetry collection for monitoring performance and usage patterns.
|
|
13
|
+
Track metrics, logs, and traces for system health and analytics.
|
|
14
|
+
`,
|
|
12
15
|
icon: 'ph--eye--regular',
|
|
13
16
|
};
|
package/src/types/schema.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Key } from '@dxos/echo';
|
|
8
8
|
|
|
9
9
|
import { meta } from '../meta';
|
|
10
10
|
|
|
@@ -84,31 +84,31 @@ export namespace ObservabilityAction {
|
|
|
84
84
|
Schema.Struct({
|
|
85
85
|
name: Schema.Literal('space.create'),
|
|
86
86
|
properties: Schema.Struct({
|
|
87
|
-
spaceId:
|
|
87
|
+
spaceId: Key.SpaceId,
|
|
88
88
|
}),
|
|
89
89
|
}),
|
|
90
90
|
Schema.Struct({
|
|
91
91
|
name: Schema.Literal('space.join'),
|
|
92
92
|
properties: Schema.Struct({
|
|
93
|
-
spaceId:
|
|
93
|
+
spaceId: Key.SpaceId,
|
|
94
94
|
}),
|
|
95
95
|
}),
|
|
96
96
|
Schema.Struct({
|
|
97
97
|
name: Schema.Literal('space.limit'),
|
|
98
98
|
properties: Schema.Struct({
|
|
99
|
-
spaceId:
|
|
99
|
+
spaceId: Key.SpaceId,
|
|
100
100
|
}),
|
|
101
101
|
}),
|
|
102
102
|
Schema.Struct({
|
|
103
103
|
name: Schema.Literal('space.lock'),
|
|
104
104
|
properties: Schema.Struct({
|
|
105
|
-
spaceId:
|
|
105
|
+
spaceId: Key.SpaceId,
|
|
106
106
|
}),
|
|
107
107
|
}),
|
|
108
108
|
Schema.Struct({
|
|
109
109
|
name: Schema.Literal('space.migrate'),
|
|
110
110
|
properties: Schema.Struct({
|
|
111
|
-
spaceId:
|
|
111
|
+
spaceId: Key.SpaceId,
|
|
112
112
|
targetVersion: Schema.optional(Schema.String),
|
|
113
113
|
version: Schema.optional(Schema.String),
|
|
114
114
|
}),
|
|
@@ -116,14 +116,14 @@ export namespace ObservabilityAction {
|
|
|
116
116
|
Schema.Struct({
|
|
117
117
|
name: Schema.Literal('space.schema.use'),
|
|
118
118
|
properties: Schema.Struct({
|
|
119
|
-
spaceId:
|
|
119
|
+
spaceId: Key.SpaceId,
|
|
120
120
|
typename: Schema.String,
|
|
121
121
|
}),
|
|
122
122
|
}),
|
|
123
123
|
Schema.Struct({
|
|
124
124
|
name: Schema.Literal('space.schema.add'),
|
|
125
125
|
properties: Schema.Struct({
|
|
126
|
-
spaceId:
|
|
126
|
+
spaceId: Key.SpaceId,
|
|
127
127
|
objectId: Schema.String,
|
|
128
128
|
typename: Schema.String,
|
|
129
129
|
}),
|
|
@@ -131,7 +131,7 @@ export namespace ObservabilityAction {
|
|
|
131
131
|
Schema.Struct({
|
|
132
132
|
name: Schema.Literal('space.object.add'),
|
|
133
133
|
properties: Schema.Struct({
|
|
134
|
-
spaceId:
|
|
134
|
+
spaceId: Key.SpaceId,
|
|
135
135
|
objectId: Schema.String,
|
|
136
136
|
typename: Schema.optional(Schema.String),
|
|
137
137
|
}),
|
|
@@ -139,33 +139,33 @@ export namespace ObservabilityAction {
|
|
|
139
139
|
Schema.Struct({
|
|
140
140
|
name: Schema.Literal('space.share'),
|
|
141
141
|
properties: Schema.Struct({
|
|
142
|
-
spaceId:
|
|
142
|
+
spaceId: Key.SpaceId,
|
|
143
143
|
}),
|
|
144
144
|
}),
|
|
145
145
|
Schema.Struct({
|
|
146
146
|
name: Schema.Literal('space.unlock'),
|
|
147
147
|
properties: Schema.Struct({
|
|
148
|
-
spaceId:
|
|
148
|
+
spaceId: Key.SpaceId,
|
|
149
149
|
}),
|
|
150
150
|
}),
|
|
151
151
|
Schema.Struct({
|
|
152
152
|
name: Schema.Literal('threads.create'),
|
|
153
153
|
properties: Schema.Struct({
|
|
154
|
-
spaceId:
|
|
154
|
+
spaceId: Key.SpaceId,
|
|
155
155
|
threadId: Schema.String,
|
|
156
156
|
}),
|
|
157
157
|
}),
|
|
158
158
|
Schema.Struct({
|
|
159
159
|
name: Schema.Literal('threads.delete'),
|
|
160
160
|
properties: Schema.Struct({
|
|
161
|
-
spaceId:
|
|
161
|
+
spaceId: Key.SpaceId,
|
|
162
162
|
threadId: Schema.String,
|
|
163
163
|
}),
|
|
164
164
|
}),
|
|
165
165
|
Schema.Struct({
|
|
166
166
|
name: Schema.Literal('threads.message.add'),
|
|
167
167
|
properties: Schema.Struct({
|
|
168
|
-
spaceId:
|
|
168
|
+
spaceId: Key.SpaceId,
|
|
169
169
|
threadId: Schema.String,
|
|
170
170
|
threadLength: Schema.Number,
|
|
171
171
|
messageId: Schema.String,
|
|
@@ -175,7 +175,7 @@ export namespace ObservabilityAction {
|
|
|
175
175
|
Schema.Struct({
|
|
176
176
|
name: Schema.Literal('threads.message.delete'),
|
|
177
177
|
properties: Schema.Struct({
|
|
178
|
-
spaceId:
|
|
178
|
+
spaceId: Key.SpaceId,
|
|
179
179
|
threadId: Schema.String,
|
|
180
180
|
messageId: Schema.String,
|
|
181
181
|
}),
|
|
@@ -183,7 +183,7 @@ export namespace ObservabilityAction {
|
|
|
183
183
|
Schema.Struct({
|
|
184
184
|
name: Schema.Literal('threads.message.undo-delete'),
|
|
185
185
|
properties: Schema.Struct({
|
|
186
|
-
spaceId:
|
|
186
|
+
spaceId: Key.SpaceId,
|
|
187
187
|
threadId: Schema.String,
|
|
188
188
|
messageId: Schema.String,
|
|
189
189
|
}),
|
|
@@ -191,7 +191,7 @@ export namespace ObservabilityAction {
|
|
|
191
191
|
Schema.Struct({
|
|
192
192
|
name: Schema.Literal('threads.message.update'),
|
|
193
193
|
properties: Schema.Struct({
|
|
194
|
-
spaceId:
|
|
194
|
+
spaceId: Key.SpaceId,
|
|
195
195
|
messageId: Schema.String,
|
|
196
196
|
messageLength: Schema.Number,
|
|
197
197
|
}),
|
|
@@ -199,14 +199,14 @@ export namespace ObservabilityAction {
|
|
|
199
199
|
Schema.Struct({
|
|
200
200
|
name: Schema.Literal('threads.toggle-resolved'),
|
|
201
201
|
properties: Schema.Struct({
|
|
202
|
-
spaceId:
|
|
202
|
+
spaceId: Key.SpaceId,
|
|
203
203
|
threadId: Schema.String,
|
|
204
204
|
}),
|
|
205
205
|
}),
|
|
206
206
|
Schema.Struct({
|
|
207
207
|
name: Schema.Literal('threads.undo-delete'),
|
|
208
208
|
properties: Schema.Struct({
|
|
209
|
-
spaceId:
|
|
209
|
+
spaceId: Key.SpaceId,
|
|
210
210
|
threadId: Schema.String,
|
|
211
211
|
}),
|
|
212
212
|
}),
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { ROOT_ID, createExtension } from '@dxos/plugin-graph';\n\nimport { OBSERVABILITY_PLUGIN } from '../meta';\n\n// NOTE: Copied from @dxos/plugin-deck to break circular dependency.\nconst ATTENDABLE_PATH_SEPARATOR = '~';\nconst DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${OBSERVABILITY_PLUGIN}/help`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map((node) => {\n return [\n {\n id: [node.id, 'help'].join(ATTENDABLE_PATH_SEPARATOR),\n type: DECK_COMPANION_TYPE,\n data: null,\n properties: {\n label: ['help label', { ns: OBSERVABILITY_PLUGIN }],\n icon: 'ph--question--regular',\n disposition: 'hidden',\n position: 'hoist',\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAkCC,mBAAmB;AAC9D,SAASC,SAASC,uBAAuB;AAKzC,IAAMC,4BAA4B;AAClC,IAAMC,sBAAsB;AAE5B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,oBAAAA;IACPC,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,CAACV,UAAAA;AACV,aAAO;QACL;UACEH,IAAI;YAACG,MAAKH;YAAI;YAAQc,KAAKrB,yBAAAA;UAC3BsB,MAAMrB;UACNsB,MAAM;UACNC,YAAY;YACVC,OAAO;cAAC;cAAc;gBAAEC,IAAIlB;cAAqB;;YACjDmB,MAAM;YACNC,aAAa;YACbC,UAAU;UACZ;QACF;;IAEJ,CAAA,GACAd,OAAOe,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "ROOT_ID", "createExtension", "ATTENDABLE_PATH_SEPARATOR", "DECK_COMPANION_TYPE", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "OBSERVABILITY_PLUGIN", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "join", "type", "data", "properties", "label", "ns", "icon", "disposition", "position", "getOrElse"]
|
|
7
|
-
}
|