@dxos/plugin-observability 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/ObservabilityPlugin.mjs +60 -0
- package/dist/lib/neutral/ObservabilityPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ObservabilityPlugin.node.mjs +22 -0
- package/dist/lib/neutral/ObservabilityPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ObservabilityPlugin.workerd.mjs +22 -0
- package/dist/lib/neutral/ObservabilityPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/ObservabilitySettings-H6UKYDDT.mjs +27 -0
- package/dist/lib/neutral/ObservabilitySettings-H6UKYDDT.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +17 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-6QCY3Z6O.mjs +8 -0
- package/dist/lib/neutral/chunk-6QCY3Z6O.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-W7QWKVS3.mjs → neutral/chunk-RPFT4FVC.mjs} +7 -3
- package/dist/lib/neutral/chunk-RPFT4FVC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZFVQL2JB.mjs +108 -0
- package/dist/lib/neutral/chunk-ZFVQL2JB.mjs.map +7 -0
- package/dist/lib/neutral/client-ready-TM7VE6CH.mjs +116 -0
- package/dist/lib/neutral/client-ready-TM7VE6CH.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +9 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-4WWRXOHR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-4WWRXOHR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-SHB2SLRK.mjs +35 -0
- package/dist/lib/neutral/react-surface-SHB2SLRK.mjs.map +7 -0
- package/dist/lib/neutral/send-event-NUMOCKDO.mjs +20 -0
- package/dist/lib/neutral/send-event-NUMOCKDO.mjs.map +7 -0
- package/dist/lib/neutral/settings-MZYK2WQR.mjs +30 -0
- package/dist/lib/neutral/settings-MZYK2WQR.mjs.map +7 -0
- package/dist/lib/neutral/state-5COCK3KV.mjs +27 -0
- package/dist/lib/neutral/state-5COCK3KV.mjs.map +7 -0
- package/dist/lib/neutral/toggle-RESKOU6L.mjs +45 -0
- package/dist/lib/neutral/toggle-RESKOU6L.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +26 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ObservabilityPlugin.d.ts +9 -2
- package/dist/types/src/ObservabilityPlugin.d.ts.map +1 -1
- package/dist/types/src/ObservabilityPlugin.node.d.ts +4 -0
- package/dist/types/src/ObservabilityPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ObservabilityPlugin.test.d.ts +2 -0
- package/dist/types/src/ObservabilityPlugin.test.d.ts.map +1 -0
- package/dist/types/src/ObservabilityPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ObservabilityPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/client-ready.d.ts +5 -5
- package/dist/types/src/capabilities/client-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +15 -15
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +10 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.d.ts +6 -0
- package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.d.ts.map +1 -0
- package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.stories.d.ts +29 -0
- package/dist/types/src/components/ObservabilitySettings/ObservabilitySettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObservabilitySettings/index.d.ts +2 -0
- package/dist/types/src/components/ObservabilitySettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/send-event.d.ts +5 -0
- package/dist/types/src/operations/send-event.d.ts.map +1 -0
- package/dist/types/src/operations/toggle.d.ts +5 -0
- package/dist/types/src/operations/toggle.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +10 -17
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ObservabilityCapabilities.d.ts +28 -0
- package/dist/types/src/types/ObservabilityCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ObservabilityEvents.d.ts +4 -0
- package/dist/types/src/types/ObservabilityEvents.d.ts.map +1 -0
- package/dist/types/src/types/ObservabilityOperation.d.ts +10 -0
- package/dist/types/src/types/ObservabilityOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +7 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +97 -49
- package/src/ObservabilityPlugin.node.ts +33 -0
- package/src/ObservabilityPlugin.test.ts +25 -0
- package/src/ObservabilityPlugin.ts +64 -56
- package/src/ObservabilityPlugin.workerd.ts +32 -0
- package/src/capabilities/client-ready.ts +87 -79
- package/src/capabilities/index.ts +11 -8
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +27 -19
- package/src/capabilities/settings.ts +26 -14
- package/src/capabilities/state.ts +20 -13
- package/src/components/ObservabilitySettings/ObservabilitySettings.stories.tsx +34 -0
- package/src/components/ObservabilitySettings/ObservabilitySettings.tsx +34 -0
- package/src/components/ObservabilitySettings/index.ts +5 -0
- package/src/components/index.ts +3 -3
- package/src/index.ts +1 -4
- package/src/meta.ts +5 -3
- package/src/operations/index.ts +10 -0
- package/src/operations/send-event.ts +23 -0
- package/src/operations/toggle.ts +46 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +10 -17
- package/src/types/ObservabilityCapabilities.ts +42 -0
- package/src/types/ObservabilityEvents.ts +15 -0
- package/src/types/ObservabilityOperation.ts +43 -0
- package/src/types/Settings.ts +22 -0
- package/src/types/index.ts +4 -1
- package/dist/lib/browser/app-graph-builder-3I6HZ5AR.mjs +0 -44
- package/dist/lib/browser/app-graph-builder-3I6HZ5AR.mjs.map +0 -7
- package/dist/lib/browser/chunk-ABSWYPOR.mjs +0 -181
- package/dist/lib/browser/chunk-ABSWYPOR.mjs.map +0 -7
- package/dist/lib/browser/chunk-EC7HTFA5.mjs +0 -18
- package/dist/lib/browser/chunk-EC7HTFA5.mjs.map +0 -7
- package/dist/lib/browser/chunk-IFPEPNGO.mjs +0 -191
- package/dist/lib/browser/chunk-IFPEPNGO.mjs.map +0 -7
- package/dist/lib/browser/chunk-W7QWKVS3.mjs.map +0 -7
- package/dist/lib/browser/client-ready-4RGNCIGS.mjs +0 -102
- package/dist/lib/browser/client-ready-4RGNCIGS.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -128
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3TZAFHGG.mjs +0 -77
- package/dist/lib/browser/intent-resolver-3TZAFHGG.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-NC5OS6RK.mjs +0 -32
- package/dist/lib/browser/react-surface-NC5OS6RK.mjs.map +0 -7
- package/dist/lib/browser/settings-SVUCKD7J.mjs +0 -25
- package/dist/lib/browser/settings-SVUCKD7J.mjs.map +0 -7
- package/dist/lib/browser/state-FJD6K3ZZ.mjs +0 -26
- package/dist/lib/browser/state-FJD6K3ZZ.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/app-graph-builder-KH2GA6G7.mjs +0 -45
- package/dist/lib/node-esm/app-graph-builder-KH2GA6G7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AVJTLRX5.mjs +0 -18
- package/dist/lib/node-esm/chunk-AVJTLRX5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DUZESLKB.mjs +0 -182
- package/dist/lib/node-esm/chunk-DUZESLKB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HACSZKXD.mjs +0 -19
- package/dist/lib/node-esm/chunk-HACSZKXD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TXFKNLDI.mjs +0 -192
- package/dist/lib/node-esm/chunk-TXFKNLDI.mjs.map +0 -7
- package/dist/lib/node-esm/client-ready-4IKY5KJC.mjs +0 -103
- package/dist/lib/node-esm/client-ready-4IKY5KJC.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -129
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-5D5SXGKQ.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-5D5SXGKQ.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-DZWHHB3R.mjs +0 -33
- package/dist/lib/node-esm/react-surface-DZWHHB3R.mjs.map +0 -7
- package/dist/lib/node-esm/settings-E6TJOR36.mjs +0 -26
- package/dist/lib/node-esm/settings-E6TJOR36.mjs.map +0 -7
- package/dist/lib/node-esm/state-XNBMNLB7.mjs +0 -27
- package/dist/lib/node-esm/state-XNBMNLB7.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -12
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/FeedbackForm.d.ts +0 -6
- package/dist/types/src/components/FeedbackForm.d.ts.map +0 -1
- package/dist/types/src/components/HelpContainer.d.ts +0 -3
- package/dist/types/src/components/HelpContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObservabilitySettings.d.ts +0 -10
- package/dist/types/src/components/ObservabilitySettings.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -5
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -313
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -47
- package/src/capabilities/capabilities.ts +0 -23
- package/src/capabilities/intent-resolver.ts +0 -69
- package/src/components/FeedbackForm.tsx +0 -82
- package/src/components/HelpContainer.tsx +0 -42
- package/src/components/ObservabilitySettings.tsx +0 -49
- package/src/events.ts +0 -14
- package/src/types/schema.ts +0 -216
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { Type } from '@dxos/echo';
|
|
3
|
-
export declare const UserFeedback: Schema.Struct<{
|
|
4
|
-
message: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
5
|
-
}>;
|
|
6
|
-
export type UserFeedback = Schema.Schema.Type<typeof UserFeedback>;
|
|
7
|
-
export declare namespace ObservabilityAction {
|
|
8
|
-
const Toggle_base: Schema.TaggedClass<Toggle, `${string}/action/toggle`, {
|
|
9
|
-
readonly _tag: Schema.tag<`${string}/action/toggle`>;
|
|
10
|
-
} & {
|
|
11
|
-
input: Schema.Struct<{
|
|
12
|
-
state: Schema.optional<typeof Schema.Boolean>;
|
|
13
|
-
}>;
|
|
14
|
-
output: typeof Schema.Boolean;
|
|
15
|
-
}>;
|
|
16
|
-
export class Toggle extends Toggle_base {
|
|
17
|
-
}
|
|
18
|
-
const CaptureUserFeedback_base: Schema.TaggedClass<CaptureUserFeedback, `${string}/action/capture-feedback`, {
|
|
19
|
-
readonly _tag: Schema.tag<`${string}/action/capture-feedback`>;
|
|
20
|
-
} & {
|
|
21
|
-
input: Schema.Struct<{
|
|
22
|
-
message: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
23
|
-
}>;
|
|
24
|
-
output: typeof Schema.Void;
|
|
25
|
-
}>;
|
|
26
|
-
export class CaptureUserFeedback extends CaptureUserFeedback_base {
|
|
27
|
-
}
|
|
28
|
-
const BaseSendEvent_base: Schema.TaggedClass<BaseSendEvent, `${string}/action/send-event`, {
|
|
29
|
-
readonly _tag: Schema.tag<`${string}/action/send-event`>;
|
|
30
|
-
} & {
|
|
31
|
-
input: Schema.Struct<{
|
|
32
|
-
name: typeof Schema.String;
|
|
33
|
-
properties: Schema.optional<typeof Schema.Object>;
|
|
34
|
-
}>;
|
|
35
|
-
output: typeof Schema.Void;
|
|
36
|
-
}>;
|
|
37
|
-
/** Base intent for sending events. */
|
|
38
|
-
export class BaseSendEvent extends BaseSendEvent_base {
|
|
39
|
-
}
|
|
40
|
-
const SendEvent_base: Schema.TaggedClass<SendEvent, `${string}/action/send-event`, {
|
|
41
|
-
readonly _tag: Schema.tag<`${string}/action/send-event`>;
|
|
42
|
-
} & {
|
|
43
|
-
input: Schema.Union<[Schema.Struct<{
|
|
44
|
-
name: Schema.Literal<["identity.create"]>;
|
|
45
|
-
}>, Schema.Struct<{
|
|
46
|
-
name: Schema.Literal<["identity.join"]>;
|
|
47
|
-
}>, Schema.Struct<{
|
|
48
|
-
name: Schema.Literal<["identity.recover"]>;
|
|
49
|
-
}>, Schema.Struct<{
|
|
50
|
-
name: Schema.Literal<["identity.share"]>;
|
|
51
|
-
}>, Schema.Struct<{
|
|
52
|
-
name: Schema.Literal<["navigation.activate"]>;
|
|
53
|
-
properties: Schema.Struct<{
|
|
54
|
-
subjectId: typeof Schema.String;
|
|
55
|
-
typename: Schema.optional<typeof Schema.String>;
|
|
56
|
-
}>;
|
|
57
|
-
}>, Schema.Struct<{
|
|
58
|
-
name: Schema.Literal<["page.load"]>;
|
|
59
|
-
properties: Schema.Struct<{
|
|
60
|
-
loadDuration: typeof Schema.Number;
|
|
61
|
-
}>;
|
|
62
|
-
}>, Schema.Struct<{
|
|
63
|
-
name: Schema.Literal<["plugins.toggle"]>;
|
|
64
|
-
properties: Schema.Struct<{
|
|
65
|
-
plugin: typeof Schema.String;
|
|
66
|
-
enabled: typeof Schema.Boolean;
|
|
67
|
-
}>;
|
|
68
|
-
}>, Schema.Struct<{
|
|
69
|
-
name: Schema.Literal<["space.create"]>;
|
|
70
|
-
properties: Schema.Struct<{
|
|
71
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
72
|
-
byteLength: number;
|
|
73
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
74
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
75
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
76
|
-
make: (value: string) => Type.SpaceId;
|
|
77
|
-
random: () => Type.SpaceId;
|
|
78
|
-
};
|
|
79
|
-
}>;
|
|
80
|
-
}>, Schema.Struct<{
|
|
81
|
-
name: Schema.Literal<["space.join"]>;
|
|
82
|
-
properties: Schema.Struct<{
|
|
83
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
84
|
-
byteLength: number;
|
|
85
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
86
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
87
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
88
|
-
make: (value: string) => Type.SpaceId;
|
|
89
|
-
random: () => Type.SpaceId;
|
|
90
|
-
};
|
|
91
|
-
}>;
|
|
92
|
-
}>, Schema.Struct<{
|
|
93
|
-
name: Schema.Literal<["space.limit"]>;
|
|
94
|
-
properties: Schema.Struct<{
|
|
95
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
96
|
-
byteLength: number;
|
|
97
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
98
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
99
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
100
|
-
make: (value: string) => Type.SpaceId;
|
|
101
|
-
random: () => Type.SpaceId;
|
|
102
|
-
};
|
|
103
|
-
}>;
|
|
104
|
-
}>, Schema.Struct<{
|
|
105
|
-
name: Schema.Literal<["space.lock"]>;
|
|
106
|
-
properties: Schema.Struct<{
|
|
107
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
108
|
-
byteLength: number;
|
|
109
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
110
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
111
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
112
|
-
make: (value: string) => Type.SpaceId;
|
|
113
|
-
random: () => Type.SpaceId;
|
|
114
|
-
};
|
|
115
|
-
}>;
|
|
116
|
-
}>, Schema.Struct<{
|
|
117
|
-
name: Schema.Literal<["space.migrate"]>;
|
|
118
|
-
properties: Schema.Struct<{
|
|
119
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
120
|
-
byteLength: number;
|
|
121
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
122
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
123
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
124
|
-
make: (value: string) => Type.SpaceId;
|
|
125
|
-
random: () => Type.SpaceId;
|
|
126
|
-
};
|
|
127
|
-
targetVersion: Schema.optional<typeof Schema.String>;
|
|
128
|
-
version: Schema.optional<typeof Schema.String>;
|
|
129
|
-
}>;
|
|
130
|
-
}>, Schema.Struct<{
|
|
131
|
-
name: Schema.Literal<["space.schema.use"]>;
|
|
132
|
-
properties: Schema.Struct<{
|
|
133
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
134
|
-
byteLength: number;
|
|
135
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
136
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
137
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
138
|
-
make: (value: string) => Type.SpaceId;
|
|
139
|
-
random: () => Type.SpaceId;
|
|
140
|
-
};
|
|
141
|
-
typename: typeof Schema.String;
|
|
142
|
-
}>;
|
|
143
|
-
}>, Schema.Struct<{
|
|
144
|
-
name: Schema.Literal<["space.schema.add"]>;
|
|
145
|
-
properties: Schema.Struct<{
|
|
146
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
147
|
-
byteLength: number;
|
|
148
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
149
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
150
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
151
|
-
make: (value: string) => Type.SpaceId;
|
|
152
|
-
random: () => Type.SpaceId;
|
|
153
|
-
};
|
|
154
|
-
objectId: typeof Schema.String;
|
|
155
|
-
typename: typeof Schema.String;
|
|
156
|
-
}>;
|
|
157
|
-
}>, Schema.Struct<{
|
|
158
|
-
name: Schema.Literal<["space.object.add"]>;
|
|
159
|
-
properties: Schema.Struct<{
|
|
160
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
161
|
-
byteLength: number;
|
|
162
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
163
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
164
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
165
|
-
make: (value: string) => Type.SpaceId;
|
|
166
|
-
random: () => Type.SpaceId;
|
|
167
|
-
};
|
|
168
|
-
objectId: typeof Schema.String;
|
|
169
|
-
typename: Schema.optional<typeof Schema.String>;
|
|
170
|
-
}>;
|
|
171
|
-
}>, Schema.Struct<{
|
|
172
|
-
name: Schema.Literal<["space.share"]>;
|
|
173
|
-
properties: Schema.Struct<{
|
|
174
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
175
|
-
byteLength: number;
|
|
176
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
177
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
178
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
179
|
-
make: (value: string) => Type.SpaceId;
|
|
180
|
-
random: () => Type.SpaceId;
|
|
181
|
-
};
|
|
182
|
-
}>;
|
|
183
|
-
}>, Schema.Struct<{
|
|
184
|
-
name: Schema.Literal<["space.unlock"]>;
|
|
185
|
-
properties: Schema.Struct<{
|
|
186
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
187
|
-
byteLength: number;
|
|
188
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
189
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
190
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
191
|
-
make: (value: string) => Type.SpaceId;
|
|
192
|
-
random: () => Type.SpaceId;
|
|
193
|
-
};
|
|
194
|
-
}>;
|
|
195
|
-
}>, Schema.Struct<{
|
|
196
|
-
name: Schema.Literal<["threads.create"]>;
|
|
197
|
-
properties: Schema.Struct<{
|
|
198
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
199
|
-
byteLength: number;
|
|
200
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
201
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
202
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
203
|
-
make: (value: string) => Type.SpaceId;
|
|
204
|
-
random: () => Type.SpaceId;
|
|
205
|
-
};
|
|
206
|
-
threadId: typeof Schema.String;
|
|
207
|
-
}>;
|
|
208
|
-
}>, Schema.Struct<{
|
|
209
|
-
name: Schema.Literal<["threads.delete"]>;
|
|
210
|
-
properties: Schema.Struct<{
|
|
211
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
212
|
-
byteLength: number;
|
|
213
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
214
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
215
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
216
|
-
make: (value: string) => Type.SpaceId;
|
|
217
|
-
random: () => Type.SpaceId;
|
|
218
|
-
};
|
|
219
|
-
threadId: typeof Schema.String;
|
|
220
|
-
}>;
|
|
221
|
-
}>, Schema.Struct<{
|
|
222
|
-
name: Schema.Literal<["threads.message.add"]>;
|
|
223
|
-
properties: Schema.Struct<{
|
|
224
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
225
|
-
byteLength: number;
|
|
226
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
227
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
228
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
229
|
-
make: (value: string) => Type.SpaceId;
|
|
230
|
-
random: () => Type.SpaceId;
|
|
231
|
-
};
|
|
232
|
-
threadId: typeof Schema.String;
|
|
233
|
-
threadLength: typeof Schema.Number;
|
|
234
|
-
messageId: typeof Schema.String;
|
|
235
|
-
messageLength: typeof Schema.Number;
|
|
236
|
-
}>;
|
|
237
|
-
}>, Schema.Struct<{
|
|
238
|
-
name: Schema.Literal<["threads.message.delete"]>;
|
|
239
|
-
properties: Schema.Struct<{
|
|
240
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
241
|
-
byteLength: number;
|
|
242
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
243
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
244
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
245
|
-
make: (value: string) => Type.SpaceId;
|
|
246
|
-
random: () => Type.SpaceId;
|
|
247
|
-
};
|
|
248
|
-
threadId: typeof Schema.String;
|
|
249
|
-
messageId: typeof Schema.String;
|
|
250
|
-
}>;
|
|
251
|
-
}>, Schema.Struct<{
|
|
252
|
-
name: Schema.Literal<["threads.message.undo-delete"]>;
|
|
253
|
-
properties: Schema.Struct<{
|
|
254
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
255
|
-
byteLength: number;
|
|
256
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
257
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
258
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
259
|
-
make: (value: string) => Type.SpaceId;
|
|
260
|
-
random: () => Type.SpaceId;
|
|
261
|
-
};
|
|
262
|
-
threadId: typeof Schema.String;
|
|
263
|
-
messageId: typeof Schema.String;
|
|
264
|
-
}>;
|
|
265
|
-
}>, Schema.Struct<{
|
|
266
|
-
name: Schema.Literal<["threads.message.update"]>;
|
|
267
|
-
properties: Schema.Struct<{
|
|
268
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
269
|
-
byteLength: number;
|
|
270
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
271
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
272
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
273
|
-
make: (value: string) => Type.SpaceId;
|
|
274
|
-
random: () => Type.SpaceId;
|
|
275
|
-
};
|
|
276
|
-
messageId: typeof Schema.String;
|
|
277
|
-
messageLength: typeof Schema.Number;
|
|
278
|
-
}>;
|
|
279
|
-
}>, Schema.Struct<{
|
|
280
|
-
name: Schema.Literal<["threads.toggle-resolved"]>;
|
|
281
|
-
properties: Schema.Struct<{
|
|
282
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
283
|
-
byteLength: number;
|
|
284
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
285
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
286
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
287
|
-
make: (value: string) => Type.SpaceId;
|
|
288
|
-
random: () => Type.SpaceId;
|
|
289
|
-
};
|
|
290
|
-
threadId: typeof Schema.String;
|
|
291
|
-
}>;
|
|
292
|
-
}>, Schema.Struct<{
|
|
293
|
-
name: Schema.Literal<["threads.undo-delete"]>;
|
|
294
|
-
properties: Schema.Struct<{
|
|
295
|
-
spaceId: Schema.Schema<Type.SpaceId, string, never> & {
|
|
296
|
-
byteLength: number;
|
|
297
|
-
encode: (value: Uint8Array) => Type.SpaceId;
|
|
298
|
-
decode: (value: Type.SpaceId) => Uint8Array;
|
|
299
|
-
isValid: (value: string) => value is Type.SpaceId;
|
|
300
|
-
make: (value: string) => Type.SpaceId;
|
|
301
|
-
random: () => Type.SpaceId;
|
|
302
|
-
};
|
|
303
|
-
threadId: typeof Schema.String;
|
|
304
|
-
}>;
|
|
305
|
-
}>]>;
|
|
306
|
-
output: typeof Schema.Void;
|
|
307
|
-
}>;
|
|
308
|
-
/** Intent with strict types for first-party events. */
|
|
309
|
-
export class SendEvent extends SendEvent_base {
|
|
310
|
-
}
|
|
311
|
-
export {};
|
|
312
|
-
}
|
|
313
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAUlC,eAAO,MAAM,YAAY;;EAEvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnE,yBAAiB,mBAAmB,CAAC;;;;;;;;;IACnC,MAAM,OAAO,MAAO,SAAQ,WAK1B;KAAG;;;;;;;;;IAEL,MAAM,OAAO,mBAAoB,SAAQ,wBAMxC;KAAG;;;;;;;;;;IAEJ,sCAAsC;IACtC,MAAM,OAAO,aAAc,SAAQ,kBAMjC;KAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEL,uDAAuD;IACvD,MAAM,OAAO,SAAU,SAAQ,cAsK7B;KAAG;;CACN"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
-
import { ROOT_ID, createExtension } from '@dxos/plugin-graph';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
|
|
14
|
-
// NOTE: Copied from @dxos/plugin-deck to break circular dependency.
|
|
15
|
-
const ATTENDABLE_PATH_SEPARATOR = '~';
|
|
16
|
-
|
|
17
|
-
const DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';
|
|
18
|
-
|
|
19
|
-
export default (_context: PluginContext) =>
|
|
20
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
21
|
-
createExtension({
|
|
22
|
-
id: `${meta.id}/help`,
|
|
23
|
-
connector: (node) =>
|
|
24
|
-
Atom.make((get) =>
|
|
25
|
-
Function.pipe(
|
|
26
|
-
get(node),
|
|
27
|
-
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
28
|
-
Option.map((node) => {
|
|
29
|
-
return [
|
|
30
|
-
{
|
|
31
|
-
id: [node.id, 'help'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
32
|
-
type: DECK_COMPANION_TYPE,
|
|
33
|
-
data: null,
|
|
34
|
-
properties: {
|
|
35
|
-
label: ['help label', { ns: meta.id }],
|
|
36
|
-
icon: 'ph--question--regular',
|
|
37
|
-
disposition: 'hidden',
|
|
38
|
-
position: 'hoist',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
}),
|
|
43
|
-
Option.getOrElse(() => []),
|
|
44
|
-
),
|
|
45
|
-
),
|
|
46
|
-
}),
|
|
47
|
-
]);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type Client } from '@dxos/client';
|
|
7
|
-
import { type Observability } from '@dxos/observability';
|
|
8
|
-
|
|
9
|
-
import { meta } from '../meta';
|
|
10
|
-
|
|
11
|
-
export namespace ObservabilityCapabilities {
|
|
12
|
-
export type State = {
|
|
13
|
-
group?: string;
|
|
14
|
-
notified?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export const State = defineCapability<State>(`${meta.id}/capability/state`);
|
|
17
|
-
|
|
18
|
-
export const Observability = defineCapability<Observability>(`${meta.id}/capability/observability`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// NOTE: This is cloned from the client plugin to avoid circular dependencies.
|
|
22
|
-
// TODO(burdon): Figure out how to share defs.
|
|
23
|
-
export const ClientCapability = defineCapability<Client>('dxos.org/plugin/client/capability/client');
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, IntentAction, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
-
import { log } from '@dxos/log';
|
|
7
|
-
import { getTelemetryIdentity, storeObservabilityDisabled } from '@dxos/observability';
|
|
8
|
-
|
|
9
|
-
import { type ObservabilitySettingsProps } from '../components';
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
import { ObservabilityAction } from '../types';
|
|
12
|
-
|
|
13
|
-
import { ClientCapability, ObservabilityCapabilities } from './capabilities';
|
|
14
|
-
|
|
15
|
-
export default ({ context, namespace }: { context: PluginContext; namespace: string }) =>
|
|
16
|
-
contributes(Capabilities.IntentResolver, [
|
|
17
|
-
createResolver({
|
|
18
|
-
intent: IntentAction.Track,
|
|
19
|
-
resolve: (intent) => {
|
|
20
|
-
log.info('intent', { intent });
|
|
21
|
-
},
|
|
22
|
-
}),
|
|
23
|
-
createResolver({
|
|
24
|
-
intent: ObservabilityAction.Toggle,
|
|
25
|
-
resolve: async ({ state }) => {
|
|
26
|
-
const client = context.getCapability(ClientCapability);
|
|
27
|
-
const observability = context.getCapability(ObservabilityCapabilities.Observability);
|
|
28
|
-
const settings = context
|
|
29
|
-
.getCapability(Capabilities.SettingsStore)
|
|
30
|
-
.getStore<ObservabilitySettingsProps>(meta.id)!.value;
|
|
31
|
-
settings.enabled = state ?? !settings.enabled;
|
|
32
|
-
observability.track({
|
|
33
|
-
...getTelemetryIdentity(client),
|
|
34
|
-
action: 'observability.toggle',
|
|
35
|
-
properties: {
|
|
36
|
-
enabled: settings.enabled,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
observability.setMode(settings.enabled ? 'basic' : 'disabled');
|
|
40
|
-
await storeObservabilityDisabled(namespace, !settings.enabled);
|
|
41
|
-
return { data: settings.enabled };
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
createResolver({
|
|
45
|
-
intent: ObservabilityAction.SendEvent,
|
|
46
|
-
resolve: (data) => {
|
|
47
|
-
const client = context.getCapability(ClientCapability);
|
|
48
|
-
const properties = 'properties' in data ? data.properties : {};
|
|
49
|
-
|
|
50
|
-
// NOTE: This is to ensure that events fired before observability is ready are still sent.
|
|
51
|
-
// TODO(wittjosiah): If the intent dispatcher supports concurrent actions in the future,
|
|
52
|
-
// then this could be awaited still rather than voiding.
|
|
53
|
-
void context.waitForCapability(ObservabilityCapabilities.Observability).then((observability) => {
|
|
54
|
-
observability.track({
|
|
55
|
-
...getTelemetryIdentity(client),
|
|
56
|
-
action: data.name,
|
|
57
|
-
properties,
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
createResolver({
|
|
63
|
-
intent: ObservabilityAction.CaptureUserFeedback,
|
|
64
|
-
resolve: async (data) => {
|
|
65
|
-
const observability = context.getCapability(ObservabilityCapabilities.Observability);
|
|
66
|
-
observability.captureUserFeedback(data.message);
|
|
67
|
-
},
|
|
68
|
-
}),
|
|
69
|
-
]);
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { getSnapshot } from '@dxos/echo/internal';
|
|
8
|
-
import { IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { FormProvider, useFormContext, useInputProps } from '@dxos/react-ui-form';
|
|
10
|
-
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
import { UserFeedback } from '../types';
|
|
13
|
-
|
|
14
|
-
const defaultValues: UserFeedback = { message: '' };
|
|
15
|
-
|
|
16
|
-
const FormContent = () => {
|
|
17
|
-
const { t } = useTranslation(meta.id);
|
|
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);
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<FormProvider formRef={formRef} schema={UserFeedback} initialValues={initialValues} onSave={handleSave}>
|
|
77
|
-
<div ref={formRef}>
|
|
78
|
-
<FormContent />
|
|
79
|
-
</div>
|
|
80
|
-
</FormProvider>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Function from 'effect/Function';
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
7
|
-
|
|
8
|
-
import { LayoutAction, chain, createIntent } from '@dxos/app-framework';
|
|
9
|
-
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
10
|
-
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
import { ObservabilityAction, type UserFeedback } from '../types';
|
|
13
|
-
|
|
14
|
-
import { FeedbackForm } from './FeedbackForm';
|
|
15
|
-
|
|
16
|
-
export const HelpContainer = () => {
|
|
17
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
|
-
|
|
19
|
-
const handleSave = useCallback(
|
|
20
|
-
(values: UserFeedback) =>
|
|
21
|
-
dispatch(
|
|
22
|
-
Function.pipe(
|
|
23
|
-
createIntent(ObservabilityAction.CaptureUserFeedback, values),
|
|
24
|
-
chain(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
25
|
-
chain(LayoutAction.AddToast, {
|
|
26
|
-
part: 'toast',
|
|
27
|
-
subject: {
|
|
28
|
-
id: `${meta.id}/feedback-success`,
|
|
29
|
-
icon: 'ph--paper-plane-tilt--regular',
|
|
30
|
-
duration: 3000,
|
|
31
|
-
title: ['feedback toast label', { ns: meta.id }],
|
|
32
|
-
description: ['feedback toast description', { ns: meta.id }],
|
|
33
|
-
closeLabel: ['close label', { ns: 'os' }],
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
36
|
-
),
|
|
37
|
-
),
|
|
38
|
-
[dispatch],
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
return <FeedbackForm onSave={handleSave} />;
|
|
42
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { createIntent } from '@dxos/app-framework';
|
|
9
|
-
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
10
|
-
import { Input, Message, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
12
|
-
|
|
13
|
-
import { meta } from '../meta';
|
|
14
|
-
import { ObservabilityAction } from '../types';
|
|
15
|
-
|
|
16
|
-
export const ObservabilitySettingsSchema = Schema.mutable(
|
|
17
|
-
Schema.Struct({
|
|
18
|
-
enabled: Schema.Boolean,
|
|
19
|
-
// TODO(wittjosiah): Separate settings for each observability feature.
|
|
20
|
-
// metrics?: boolean;
|
|
21
|
-
// telemetry?: boolean;
|
|
22
|
-
// errors?: boolean;
|
|
23
|
-
}),
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export type ObservabilitySettingsProps = Schema.Schema.Type<typeof ObservabilitySettingsSchema>;
|
|
27
|
-
|
|
28
|
-
export const ObservabilitySettings = ({ settings }: { settings: ObservabilitySettingsProps }) => {
|
|
29
|
-
const { t } = useTranslation(meta.id);
|
|
30
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
31
|
-
|
|
32
|
-
return (
|
|
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>
|
|
48
|
-
);
|
|
49
|
-
};
|
package/src/events.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Events, defineEvent } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { meta } from './meta';
|
|
8
|
-
|
|
9
|
-
export namespace ObservabilityEvents {
|
|
10
|
-
export const StateReady = Events.createStateEvent(meta.id);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// NOTE: This is cloned from the client plugin to avoid circular dependencies.
|
|
14
|
-
export const ClientReadyEvent = defineEvent('dxos.org/plugin/client/event/client-ready');
|