@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/meta.ts
|
|
4
|
+
import { trim } from "@dxos/util";
|
|
5
|
+
var meta = {
|
|
6
|
+
id: "dxos.org/plugin/observability",
|
|
7
|
+
name: "Telemetry",
|
|
8
|
+
description: trim`
|
|
9
|
+
Application observability and telemetry collection for monitoring performance and usage patterns.
|
|
10
|
+
Track metrics, logs, and traces for system health and analytics.
|
|
11
|
+
`,
|
|
12
|
+
icon: "ph--eye--regular"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
meta
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-AVJTLRX5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/observability',\n name: 'Telemetry',\n description: trim`\n Application observability and telemetry collection for monitoring performance and usage patterns.\n Track metrics, logs, and traces for system health and analytics.\n `,\n icon: 'ph--eye--regular',\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;AACR;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "description", "trim", "icon"]
|
|
7
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
meta
|
|
4
|
+
} from "./chunk-AVJTLRX5.mjs";
|
|
5
5
|
|
|
6
6
|
// src/capabilities/capabilities.ts
|
|
7
7
|
import { defineCapability } from "@dxos/app-framework";
|
|
8
8
|
(function(ObservabilityCapabilities2) {
|
|
9
|
-
ObservabilityCapabilities2.State = defineCapability(`${
|
|
10
|
-
ObservabilityCapabilities2.Observability = defineCapability(`${
|
|
9
|
+
ObservabilityCapabilities2.State = defineCapability(`${meta.id}/capability/state`);
|
|
10
|
+
ObservabilityCapabilities2.Observability = defineCapability(`${meta.id}/capability/observability`);
|
|
11
11
|
})(ObservabilityCapabilities || (ObservabilityCapabilities = {}));
|
|
12
12
|
var ClientCapability = defineCapability("dxos.org/plugin/client/capability/client");
|
|
13
13
|
var ObservabilityCapabilities;
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
ClientCapability,
|
|
17
17
|
ObservabilityCapabilities
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-HACSZKXD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type Client } from '@dxos/client';\nimport { type Observability } from '@dxos/observability';\n\nimport { meta } from '../meta';\n\nexport namespace ObservabilityCapabilities {\n export type State = {\n group?: string;\n notified?: boolean;\n };\n export const State = defineCapability<State>(`${meta.id}/capability/state`);\n\n export const Observability = defineCapability<Observability>(`${meta.id}/capability/observability`);\n}\n\n// NOTE: This is cloned from the client plugin to avoid circular dependencies.\n// TODO(burdon): Figure out how to share defs.\nexport const ClientCapability = defineCapability<Client>('dxos.org/plugin/client/capability/client');\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,wBAAwB;UAMhBC,4BAAAA;6BAKFC,QAAQC,iBAAwB,GAAGC,KAAKC,EAAE,mBAAmB;6BAE7DC,gBAAgBH,iBAAgC,GAAGC,KAAKC,EAAE,2BAA2B;AACpG,GARiBJ,8BAAAA,4BAAAA,CAAAA,EAAAA;AAYV,IAAMM,mBAAmBJ,iBAAyB,0CAAA;;",
|
|
6
|
+
"names": ["defineCapability", "ObservabilityCapabilities", "State", "defineCapability", "meta", "id", "Observability", "ClientCapability"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ObservabilityAction,
|
|
4
|
+
UserFeedback
|
|
5
|
+
} from "./chunk-T5OWY73X.mjs";
|
|
6
|
+
import {
|
|
7
|
+
meta
|
|
8
|
+
} from "./chunk-AVJTLRX5.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/FeedbackForm.tsx
|
|
11
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
14
|
+
import { Form } from "@dxos/react-ui-form";
|
|
15
|
+
var FeedbackForm = ({ onSave }) => {
|
|
16
|
+
var _effect = _useSignals();
|
|
17
|
+
try {
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
19
|
+
return /* @__PURE__ */ React.createElement(Form.Root, {
|
|
20
|
+
schema: UserFeedback,
|
|
21
|
+
onSave
|
|
22
|
+
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.FieldSet, null), /* @__PURE__ */ React.createElement(Form.Submit, {
|
|
23
|
+
icon: "ph--paper-plane-tilt--regular",
|
|
24
|
+
label: t("send feedback label")
|
|
25
|
+
})));
|
|
26
|
+
} finally {
|
|
27
|
+
_effect.f();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/components/HelpContainer.tsx
|
|
32
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
33
|
+
import * as Function from "effect/Function";
|
|
34
|
+
import React2, { useCallback } from "react";
|
|
35
|
+
import { LayoutAction, chain, createIntent } from "@dxos/app-framework";
|
|
36
|
+
import { useIntentDispatcher } from "@dxos/app-framework/react";
|
|
37
|
+
var HelpContainer = () => {
|
|
38
|
+
var _effect = _useSignals2();
|
|
39
|
+
try {
|
|
40
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
41
|
+
const handleSave = useCallback((values) => dispatch(Function.pipe(createIntent(ObservabilityAction.CaptureUserFeedback, values), chain(LayoutAction.UpdateComplementary, {
|
|
42
|
+
part: "complementary",
|
|
43
|
+
options: {
|
|
44
|
+
state: "collapsed"
|
|
45
|
+
}
|
|
46
|
+
}), chain(LayoutAction.AddToast, {
|
|
47
|
+
part: "toast",
|
|
48
|
+
subject: {
|
|
49
|
+
id: `${meta.id}/feedback-success`,
|
|
50
|
+
icon: "ph--paper-plane-tilt--regular",
|
|
51
|
+
duration: 3e3,
|
|
52
|
+
title: [
|
|
53
|
+
"feedback toast label",
|
|
54
|
+
{
|
|
55
|
+
ns: meta.id
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
description: [
|
|
59
|
+
"feedback toast description",
|
|
60
|
+
{
|
|
61
|
+
ns: meta.id
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
closeLabel: [
|
|
65
|
+
"close label",
|
|
66
|
+
{
|
|
67
|
+
ns: "os"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}))), [
|
|
72
|
+
dispatch
|
|
73
|
+
]);
|
|
74
|
+
return /* @__PURE__ */ React2.createElement(FeedbackForm, {
|
|
75
|
+
onSave: handleSave
|
|
76
|
+
});
|
|
77
|
+
} finally {
|
|
78
|
+
_effect.f();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// src/components/ObservabilitySettings.tsx
|
|
83
|
+
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
84
|
+
import * as Schema from "effect/Schema";
|
|
85
|
+
import React3 from "react";
|
|
86
|
+
import { createIntent as createIntent2 } from "@dxos/app-framework";
|
|
87
|
+
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework/react";
|
|
88
|
+
import { Input, Message, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
89
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
90
|
+
var ObservabilitySettingsSchema = Schema.mutable(Schema.Struct({
|
|
91
|
+
enabled: Schema.Boolean
|
|
92
|
+
}));
|
|
93
|
+
var ObservabilitySettings = ({ settings }) => {
|
|
94
|
+
var _effect = _useSignals3();
|
|
95
|
+
try {
|
|
96
|
+
const { t } = useTranslation2(meta.id);
|
|
97
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
98
|
+
return /* @__PURE__ */ React3.createElement(ControlPage, null, /* @__PURE__ */ React3.createElement(ControlSection, {
|
|
99
|
+
title: t("settings title", {
|
|
100
|
+
ns: meta.id
|
|
101
|
+
})
|
|
102
|
+
}, /* @__PURE__ */ React3.createElement(Message.Root, {
|
|
103
|
+
valence: "info",
|
|
104
|
+
classNames: "container-max-width mbe-cardSpacingBlock"
|
|
105
|
+
}, /* @__PURE__ */ React3.createElement(Message.Content, null, t("observability description"))), /* @__PURE__ */ React3.createElement(ControlGroup, null, /* @__PURE__ */ React3.createElement(ControlItemInput, {
|
|
106
|
+
title: t("observability enabled label")
|
|
107
|
+
}, /* @__PURE__ */ React3.createElement(Input.Switch, {
|
|
108
|
+
checked: settings.enabled,
|
|
109
|
+
onCheckedChange: (checked) => dispatch(createIntent2(ObservabilityAction.Toggle, {
|
|
110
|
+
state: !!checked
|
|
111
|
+
}))
|
|
112
|
+
})))));
|
|
113
|
+
} finally {
|
|
114
|
+
_effect.f();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
FeedbackForm,
|
|
120
|
+
HelpContainer,
|
|
121
|
+
ObservabilitySettingsSchema,
|
|
122
|
+
ObservabilitySettings
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=chunk-JJBWCCSZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/FeedbackForm.tsx", "../../../src/components/HelpContainer.tsx", "../../../src/components/ObservabilitySettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { Form, type FormRootProps } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\nimport { UserFeedback } from '../types';\n\nexport type FeedbackFormProps = Pick<FormRootProps<UserFeedback>, 'onSave'>;\n\nexport const FeedbackForm = ({ onSave }: FeedbackFormProps) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <Form.Root schema={UserFeedback} onSave={onSave}>\n <Form.Content>\n <Form.FieldSet />\n <Form.Submit icon='ph--paper-plane-tilt--regular' label={t('send feedback label')} />\n </Form.Content>\n </Form.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Function from 'effect/Function';\nimport React, { useCallback } from 'react';\n\nimport { LayoutAction, chain, createIntent } from '@dxos/app-framework';\nimport { useIntentDispatcher } from '@dxos/app-framework/react';\n\nimport { meta } from '../meta';\nimport { ObservabilityAction, type UserFeedback } from '../types';\n\nimport { FeedbackForm } from './FeedbackForm';\n\nexport const HelpContainer = () => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const handleSave = useCallback(\n (values: UserFeedback) =>\n dispatch(\n Function.pipe(\n createIntent(ObservabilityAction.CaptureUserFeedback, values),\n chain(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),\n chain(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${meta.id}/feedback-success`,\n icon: 'ph--paper-plane-tilt--regular',\n duration: 3000,\n title: ['feedback toast label', { ns: meta.id }],\n description: ['feedback toast description', { ns: meta.id }],\n closeLabel: ['close label', { ns: 'os' }],\n },\n }),\n ),\n ),\n [dispatch],\n );\n\n return <FeedbackForm onSave={handleSave} />;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React from 'react';\n\nimport { createIntent } from '@dxos/app-framework';\nimport { useIntentDispatcher } from '@dxos/app-framework/react';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\nimport { ObservabilityAction } from '../types';\n\nexport const ObservabilitySettingsSchema = Schema.mutable(\n Schema.Struct({\n enabled: Schema.Boolean,\n // TODO(wittjosiah): Separate settings for each observability feature.\n // metrics?: boolean;\n // telemetry?: boolean;\n // errors?: boolean;\n }),\n);\n\nexport type ObservabilitySettingsProps = Schema.Schema.Type<typeof ObservabilitySettingsSchema>;\n\nexport const ObservabilitySettings = ({ settings }: { settings: ObservabilitySettingsProps }) => {\n const { t } = useTranslation(meta.id);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n return (\n <ControlPage>\n <ControlSection title={t('settings title', { ns: meta.id })}>\n <Message.Root valence='info' classNames='container-max-width mbe-cardSpacingBlock'>\n <Message.Content>{t('observability description')}</Message.Content>\n </Message.Root>\n <ControlGroup>\n <ControlItemInput title={t('observability enabled label')}>\n <Input.Switch\n checked={settings.enabled}\n onCheckedChange={(checked) => dispatch(createIntent(ObservabilityAction.Toggle, { state: !!checked }))}\n />\n </ControlItemInput>\n </ControlGroup>\n </ControlSection>\n </ControlPage>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,sBAAsB;AAC/B,SAAS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AAC/C,SAASC,cAAcC,kBAAkBC,aAAaC,sBAAsB;AAKrE,IAAMC,8BAAqCC,eACzCC,cAAO;EACZC,SAAgBC;AAKlB,CAAA,CAAA;AAKK,IAAMC,wBAAwB,CAAC,EAAEC,SAAQ,MAA4C;;;AAC1F,UAAM,EAAEC,EAAC,IAAKC,gBAAeC,KAAKC,EAAE;AACpC,UAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,qBAAAA;AAEtC,WACE,gBAAAC,OAAA,cAACC,aAAAA,MACC,gBAAAD,OAAA,cAACE,gBAAAA;MAAeC,OAAOV,EAAE,kBAAkB;QAAEW,IAAIT,KAAKC;MAAG,CAAA;OACvD,gBAAAI,OAAA,cAACK,QAAQC,MAAI;MAACC,SAAQ;MAAOC,YAAW;OACtC,gBAAAR,OAAA,cAACK,QAAQI,SAAO,MAAEhB,EAAE,2BAAA,CAAA,CAAA,GAEtB,gBAAAO,OAAA,cAACU,cAAAA,MACC,gBAAAV,OAAA,cAACW,kBAAAA;MAAiBR,OAAOV,EAAE,6BAAA;OACzB,gBAAAO,OAAA,cAACY,MAAMC,QAAM;MACXC,SAAStB,SAASH;MAClB0B,iBAAiB,CAACD,YAAYhB,SAASkB,cAAaC,oBAAoBC,QAAQ;QAAEC,OAAO,CAAC,CAACL;MAAQ,CAAA,CAAA;;;;;AAOjH;",
|
|
6
|
+
"names": ["React", "useTranslation", "Form", "FeedbackForm", "onSave", "t", "useTranslation", "meta", "id", "Form", "Root", "schema", "UserFeedback", "Content", "FieldSet", "Submit", "icon", "label", "Function", "React", "useCallback", "LayoutAction", "chain", "createIntent", "useIntentDispatcher", "HelpContainer", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleSave", "useCallback", "values", "pipe", "createIntent", "ObservabilityAction", "CaptureUserFeedback", "chain", "LayoutAction", "UpdateComplementary", "part", "options", "state", "AddToast", "subject", "id", "meta", "icon", "duration", "title", "ns", "description", "closeLabel", "React", "FeedbackForm", "onSave", "Schema", "React", "createIntent", "useIntentDispatcher", "Input", "Message", "useTranslation", "ControlGroup", "ControlItemInput", "ControlPage", "ControlSection", "ObservabilitySettingsSchema", "mutable", "Struct", "enabled", "Boolean", "ObservabilitySettings", "settings", "t", "useTranslation", "meta", "id", "dispatchPromise", "dispatch", "useIntentDispatcher", "React", "ControlPage", "ControlSection", "title", "ns", "Message", "Root", "valence", "classNames", "Content", "ControlGroup", "ControlItemInput", "Input", "Switch", "checked", "onCheckedChange", "createIntent", "ObservabilityAction", "Toggle", "state"]
|
|
7
|
+
}
|
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
meta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AVJTLRX5.mjs";
|
|
5
5
|
|
|
6
6
|
// src/types/schema.ts
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import { Format, Key } from "@dxos/echo";
|
|
9
|
+
|
|
10
|
+
// src/translations.ts
|
|
11
|
+
var translations = [
|
|
12
|
+
{
|
|
13
|
+
"en-US": {
|
|
14
|
+
[meta.id]: {
|
|
15
|
+
"plugin name": "Telemetry",
|
|
16
|
+
"settings title": "Telemetry settings",
|
|
17
|
+
"observability toast label": "Privacy Notice",
|
|
18
|
+
"observability toast description": "Composer collects usage and performance metrics to improve the product. No user data is collected.",
|
|
19
|
+
"observability toast action label": "Settings",
|
|
20
|
+
"observability toast action alt": "Open settings to learn more or to disable.",
|
|
21
|
+
"observability toast close label": "Okay",
|
|
22
|
+
"observability enabled label": "Enable telemetry",
|
|
23
|
+
// TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.
|
|
24
|
+
"observability description": "When enabled, basic usage data will used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.",
|
|
25
|
+
"help label": "Feedback & Support",
|
|
26
|
+
"feedback textarea label": "Feedback",
|
|
27
|
+
"feedback textarea placeholder": "Please enter your feedback, technical issue, or feature request.",
|
|
28
|
+
"send feedback label": "Send Feedback",
|
|
29
|
+
"feedback toast label": "Thank you for your feedback!",
|
|
30
|
+
"feedback toast description": "We will review your feedback and get back to you as soon as possible."
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
// src/types/schema.ts
|
|
37
|
+
var t = translations[0]["en-US"][meta.id];
|
|
15
38
|
var UserFeedback = Schema.Struct({
|
|
16
|
-
message:
|
|
39
|
+
message: Format.Text.pipe(Schema.nonEmptyString(), Schema.maxLength(4096), Schema.annotations({
|
|
40
|
+
title: t["feedback textarea label"],
|
|
41
|
+
description: t["feedback textarea placeholder"]
|
|
42
|
+
}))
|
|
17
43
|
});
|
|
18
44
|
(function(ObservabilityAction2) {
|
|
19
45
|
class Toggle extends Schema.TaggedClass()(`${meta.id}/action/toggle`, {
|
|
@@ -69,76 +95,76 @@ var UserFeedback = Schema.Struct({
|
|
|
69
95
|
}), Schema.Struct({
|
|
70
96
|
name: Schema.Literal("space.create"),
|
|
71
97
|
properties: Schema.Struct({
|
|
72
|
-
spaceId:
|
|
98
|
+
spaceId: Key.SpaceId
|
|
73
99
|
})
|
|
74
100
|
}), Schema.Struct({
|
|
75
101
|
name: Schema.Literal("space.join"),
|
|
76
102
|
properties: Schema.Struct({
|
|
77
|
-
spaceId:
|
|
103
|
+
spaceId: Key.SpaceId
|
|
78
104
|
})
|
|
79
105
|
}), Schema.Struct({
|
|
80
106
|
name: Schema.Literal("space.limit"),
|
|
81
107
|
properties: Schema.Struct({
|
|
82
|
-
spaceId:
|
|
108
|
+
spaceId: Key.SpaceId
|
|
83
109
|
})
|
|
84
110
|
}), Schema.Struct({
|
|
85
111
|
name: Schema.Literal("space.lock"),
|
|
86
112
|
properties: Schema.Struct({
|
|
87
|
-
spaceId:
|
|
113
|
+
spaceId: Key.SpaceId
|
|
88
114
|
})
|
|
89
115
|
}), Schema.Struct({
|
|
90
116
|
name: Schema.Literal("space.migrate"),
|
|
91
117
|
properties: Schema.Struct({
|
|
92
|
-
spaceId:
|
|
118
|
+
spaceId: Key.SpaceId,
|
|
93
119
|
targetVersion: Schema.optional(Schema.String),
|
|
94
120
|
version: Schema.optional(Schema.String)
|
|
95
121
|
})
|
|
96
122
|
}), Schema.Struct({
|
|
97
123
|
name: Schema.Literal("space.schema.use"),
|
|
98
124
|
properties: Schema.Struct({
|
|
99
|
-
spaceId:
|
|
125
|
+
spaceId: Key.SpaceId,
|
|
100
126
|
typename: Schema.String
|
|
101
127
|
})
|
|
102
128
|
}), Schema.Struct({
|
|
103
129
|
name: Schema.Literal("space.schema.add"),
|
|
104
130
|
properties: Schema.Struct({
|
|
105
|
-
spaceId:
|
|
131
|
+
spaceId: Key.SpaceId,
|
|
106
132
|
objectId: Schema.String,
|
|
107
133
|
typename: Schema.String
|
|
108
134
|
})
|
|
109
135
|
}), Schema.Struct({
|
|
110
136
|
name: Schema.Literal("space.object.add"),
|
|
111
137
|
properties: Schema.Struct({
|
|
112
|
-
spaceId:
|
|
138
|
+
spaceId: Key.SpaceId,
|
|
113
139
|
objectId: Schema.String,
|
|
114
140
|
typename: Schema.optional(Schema.String)
|
|
115
141
|
})
|
|
116
142
|
}), Schema.Struct({
|
|
117
143
|
name: Schema.Literal("space.share"),
|
|
118
144
|
properties: Schema.Struct({
|
|
119
|
-
spaceId:
|
|
145
|
+
spaceId: Key.SpaceId
|
|
120
146
|
})
|
|
121
147
|
}), Schema.Struct({
|
|
122
148
|
name: Schema.Literal("space.unlock"),
|
|
123
149
|
properties: Schema.Struct({
|
|
124
|
-
spaceId:
|
|
150
|
+
spaceId: Key.SpaceId
|
|
125
151
|
})
|
|
126
152
|
}), Schema.Struct({
|
|
127
153
|
name: Schema.Literal("threads.create"),
|
|
128
154
|
properties: Schema.Struct({
|
|
129
|
-
spaceId:
|
|
155
|
+
spaceId: Key.SpaceId,
|
|
130
156
|
threadId: Schema.String
|
|
131
157
|
})
|
|
132
158
|
}), Schema.Struct({
|
|
133
159
|
name: Schema.Literal("threads.delete"),
|
|
134
160
|
properties: Schema.Struct({
|
|
135
|
-
spaceId:
|
|
161
|
+
spaceId: Key.SpaceId,
|
|
136
162
|
threadId: Schema.String
|
|
137
163
|
})
|
|
138
164
|
}), Schema.Struct({
|
|
139
165
|
name: Schema.Literal("threads.message.add"),
|
|
140
166
|
properties: Schema.Struct({
|
|
141
|
-
spaceId:
|
|
167
|
+
spaceId: Key.SpaceId,
|
|
142
168
|
threadId: Schema.String,
|
|
143
169
|
threadLength: Schema.Number,
|
|
144
170
|
messageId: Schema.String,
|
|
@@ -147,34 +173,34 @@ var UserFeedback = Schema.Struct({
|
|
|
147
173
|
}), Schema.Struct({
|
|
148
174
|
name: Schema.Literal("threads.message.delete"),
|
|
149
175
|
properties: Schema.Struct({
|
|
150
|
-
spaceId:
|
|
176
|
+
spaceId: Key.SpaceId,
|
|
151
177
|
threadId: Schema.String,
|
|
152
178
|
messageId: Schema.String
|
|
153
179
|
})
|
|
154
180
|
}), Schema.Struct({
|
|
155
181
|
name: Schema.Literal("threads.message.undo-delete"),
|
|
156
182
|
properties: Schema.Struct({
|
|
157
|
-
spaceId:
|
|
183
|
+
spaceId: Key.SpaceId,
|
|
158
184
|
threadId: Schema.String,
|
|
159
185
|
messageId: Schema.String
|
|
160
186
|
})
|
|
161
187
|
}), Schema.Struct({
|
|
162
188
|
name: Schema.Literal("threads.message.update"),
|
|
163
189
|
properties: Schema.Struct({
|
|
164
|
-
spaceId:
|
|
190
|
+
spaceId: Key.SpaceId,
|
|
165
191
|
messageId: Schema.String,
|
|
166
192
|
messageLength: Schema.Number
|
|
167
193
|
})
|
|
168
194
|
}), Schema.Struct({
|
|
169
195
|
name: Schema.Literal("threads.toggle-resolved"),
|
|
170
196
|
properties: Schema.Struct({
|
|
171
|
-
spaceId:
|
|
197
|
+
spaceId: Key.SpaceId,
|
|
172
198
|
threadId: Schema.String
|
|
173
199
|
})
|
|
174
200
|
}), Schema.Struct({
|
|
175
201
|
name: Schema.Literal("threads.undo-delete"),
|
|
176
202
|
properties: Schema.Struct({
|
|
177
|
-
spaceId:
|
|
203
|
+
spaceId: Key.SpaceId,
|
|
178
204
|
threadId: Schema.String
|
|
179
205
|
})
|
|
180
206
|
})),
|
|
@@ -186,7 +212,8 @@ var UserFeedback = Schema.Struct({
|
|
|
186
212
|
var ObservabilityAction;
|
|
187
213
|
|
|
188
214
|
export {
|
|
215
|
+
translations,
|
|
189
216
|
UserFeedback,
|
|
190
217
|
ObservabilityAction
|
|
191
218
|
};
|
|
192
|
-
//# sourceMappingURL=chunk-
|
|
219
|
+
//# sourceMappingURL=chunk-T5OWY73X.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/schema.ts", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Format, Key } from '@dxos/echo';\n\nimport { meta } from '../meta';\nimport { translations } from '../translations';\n\nconst t = translations[0]['en-US'][meta.id];\n\nexport const UserFeedback = Schema.Struct({\n message: Format.Text.pipe(\n Schema.nonEmptyString(),\n Schema.maxLength(4_096),\n Schema.annotations({\n title: t['feedback textarea label'],\n description: t['feedback textarea placeholder'],\n }),\n ),\n});\n\nexport type UserFeedback = Schema.Schema.Type<typeof UserFeedback>;\n\nexport namespace ObservabilityAction {\n export class Toggle extends Schema.TaggedClass<Toggle>()(`${meta.id}/action/toggle`, {\n input: Schema.Struct({\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Boolean,\n }) {}\n\n export class CaptureUserFeedback extends Schema.TaggedClass<CaptureUserFeedback>()(\n `${meta.id}/action/capture-feedback`,\n {\n input: UserFeedback,\n output: Schema.Void,\n },\n ) {}\n\n /** Base intent for sending events. */\n export class BaseSendEvent extends Schema.TaggedClass<BaseSendEvent>()(`${meta.id}/action/send-event`, {\n input: Schema.Struct({\n name: Schema.String,\n properties: Schema.optional(Schema.Object),\n }),\n output: Schema.Void,\n }) {}\n\n /** Intent with strict types for first-party events. */\n export class SendEvent extends Schema.TaggedClass<SendEvent>()(`${meta.id}/action/send-event`, {\n // NOTE: Sort alphabetically by name.\n input: Schema.Union(\n Schema.Struct({\n name: Schema.Literal('identity.create'),\n }),\n Schema.Struct({\n name: Schema.Literal('identity.join'),\n }),\n Schema.Struct({\n name: Schema.Literal('identity.recover'),\n }),\n Schema.Struct({\n name: Schema.Literal('identity.share'),\n }),\n Schema.Struct({\n name: Schema.Literal('navigation.activate'),\n properties: Schema.Struct({\n subjectId: Schema.String,\n typename: Schema.optional(Schema.String),\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('page.load'),\n properties: Schema.Struct({\n loadDuration: Schema.Number,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('plugins.toggle'),\n properties: Schema.Struct({\n plugin: Schema.String,\n enabled: Schema.Boolean,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.create'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.join'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.limit'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.lock'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.migrate'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n targetVersion: Schema.optional(Schema.String),\n version: Schema.optional(Schema.String),\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.schema.use'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n typename: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.schema.add'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n objectId: Schema.String,\n typename: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.object.add'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n objectId: Schema.String,\n typename: Schema.optional(Schema.String),\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.share'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.unlock'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.create'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.delete'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.add'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n threadLength: Schema.Number,\n messageId: Schema.String,\n messageLength: Schema.Number,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.delete'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n messageId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.undo-delete'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n messageId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.update'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n messageId: Schema.String,\n messageLength: Schema.Number,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.toggle-resolved'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.undo-delete'),\n properties: Schema.Struct({\n spaceId: Key.SpaceId,\n threadId: Schema.String,\n }),\n }),\n ),\n output: Schema.Void,\n }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Telemetry',\n 'settings title': 'Telemetry settings',\n 'observability toast label': 'Privacy Notice',\n 'observability toast description':\n 'Composer collects usage and performance metrics to improve the product. No user data is collected.',\n 'observability toast action label': 'Settings',\n 'observability toast action alt': 'Open settings to learn more or to disable.',\n 'observability toast close label': 'Okay',\n 'observability enabled label': 'Enable telemetry',\n // TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.\n 'observability description':\n 'When enabled, basic usage data will used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.',\n\n 'help label': 'Feedback & Support',\n 'feedback textarea label': 'Feedback',\n 'feedback textarea placeholder': 'Please enter your feedback, technical issue, or feature request.',\n 'send feedback label': 'Send Feedback',\n 'feedback toast label': 'Thank you for your feedback!',\n 'feedback toast description': 'We will review your feedback and get back to you as soon as possible.',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,QAAQC,WAAW;;;ACErB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,6BAA6B;QAC7B,mCACE;QACF,oCAAoC;QACpC,kCAAkC;QAClC,mCAAmC;QACnC,+BAA+B;;QAE/B,6BACE;QAEF,cAAc;QACd,2BAA2B;QAC3B,iCAAiC;QACjC,uBAAuB;QACvB,wBAAwB;QACxB,8BAA8B;MAChC;IACF;EACF;;;;ADtBF,IAAMC,IAAIC,aAAa,CAAA,EAAG,OAAA,EAASC,KAAKC,EAAE;AAEnC,IAAMC,eAAsBC,cAAO;EACxCC,SAASC,OAAOC,KAAKC,KAC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L,QAAeE;EACjB,CAAA,EAAA;EAAI;AAvKiD,EAAAT,qBACxCe,YAAAA;AAuKf,GAjMiBf,wBAAAA,sBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["Schema", "Format", "Key", "translations", "meta", "id", "t", "translations", "meta", "id", "UserFeedback", "Struct", "message", "Format", "Text", "pipe", "nonEmptyString", "maxLength", "annotations", "title", "description", "ObservabilityAction", "Toggle", "TaggedClass", "input", "state", "optional", "Boolean", "output", "CaptureUserFeedback", "Void", "BaseSendEvent", "name", "String", "properties", "Object", "SendEvent", "Union", "Literal", "subjectId", "typename", "loadDuration", "Number", "plugin", "enabled", "spaceId", "Key", "SpaceId", "targetVersion", "version", "objectId", "threadId", "threadLength", "messageId", "messageLength"]
|
|
7
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ObservabilityAction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-T5OWY73X.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ClientCapability,
|
|
7
7
|
ObservabilityCapabilities
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HACSZKXD.mjs";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
meta
|
|
11
|
+
} from "./chunk-AVJTLRX5.mjs";
|
|
12
12
|
|
|
13
13
|
// src/capabilities/client-ready.ts
|
|
14
|
-
import { Capabilities,
|
|
14
|
+
import { Capabilities, LayoutAction, SettingsAction, contributes, createIntent } from "@dxos/app-framework";
|
|
15
15
|
import { setupTelemetryListeners } from "@dxos/observability";
|
|
16
|
-
var client_ready_default = async ({ context, namespace, observability }) => {
|
|
16
|
+
var client_ready_default = (async ({ context, namespace, observability }) => {
|
|
17
17
|
const manager = context.getCapability(Capabilities.PluginManager);
|
|
18
18
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
19
19
|
const state = context.getCapability(ObservabilityCapabilities.State);
|
|
@@ -25,17 +25,17 @@ var client_ready_default = async ({ context, namespace, observability }) => {
|
|
|
25
25
|
await dispatch(createIntent(LayoutAction.AddToast, {
|
|
26
26
|
part: "toast",
|
|
27
27
|
subject: {
|
|
28
|
-
id: `${
|
|
28
|
+
id: `${meta.id}/notice`,
|
|
29
29
|
title: [
|
|
30
30
|
"observability toast label",
|
|
31
31
|
{
|
|
32
|
-
ns:
|
|
32
|
+
ns: meta.id
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
description: [
|
|
36
36
|
"observability toast description",
|
|
37
37
|
{
|
|
38
|
-
ns:
|
|
38
|
+
ns: meta.id
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
duration: Infinity,
|
|
@@ -43,23 +43,23 @@ var client_ready_default = async ({ context, namespace, observability }) => {
|
|
|
43
43
|
actionLabel: [
|
|
44
44
|
"observability toast action label",
|
|
45
45
|
{
|
|
46
|
-
ns:
|
|
46
|
+
ns: meta.id
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
49
|
actionAlt: [
|
|
50
50
|
"observability toast action alt",
|
|
51
51
|
{
|
|
52
|
-
ns:
|
|
52
|
+
ns: meta.id
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
closeLabel: [
|
|
56
56
|
"observability toast close label",
|
|
57
57
|
{
|
|
58
|
-
ns:
|
|
58
|
+
ns: meta.id
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
onAction: () => dispatch(createIntent(SettingsAction.Open, {
|
|
62
|
-
plugin:
|
|
62
|
+
plugin: meta.id
|
|
63
63
|
}))
|
|
64
64
|
}
|
|
65
65
|
}));
|
|
@@ -96,8 +96,8 @@ var client_ready_default = async ({ context, namespace, observability }) => {
|
|
|
96
96
|
cleanup();
|
|
97
97
|
await observability.close();
|
|
98
98
|
});
|
|
99
|
-
};
|
|
99
|
+
});
|
|
100
100
|
export {
|
|
101
101
|
client_ready_default as default
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=client-ready-
|
|
103
|
+
//# sourceMappingURL=client-ready-AXZXR5EX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/client-ready.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n LayoutAction,\n type PluginContext,\n SettingsAction,\n contributes,\n createIntent,\n} from '@dxos/app-framework';\nimport { type Observability, setupTelemetryListeners } from '@dxos/observability';\n\nimport { meta } from '../meta';\nimport { ObservabilityAction } from '../types';\n\nimport { ClientCapability, ObservabilityCapabilities } from './capabilities';\n\ntype ClientReadyOptions = {\n context: PluginContext;\n namespace: string;\n observability: Observability;\n};\n\nexport default async ({ context, namespace, observability }: ClientReadyOptions) => {\n const manager = context.getCapability(Capabilities.PluginManager);\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(ObservabilityCapabilities.State);\n const client = context.getCapability(ClientCapability);\n\n const sendPrivacyNotice = async () => {\n const environment = client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;\n const notify =\n environment && environment !== 'ci' && !environment.endsWith('.local') && !environment.endsWith('.lan');\n if (!state.notified && notify) {\n await dispatch(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${meta.id}/notice`,\n title: ['observability toast label', { ns: meta.id }],\n description: ['observability toast description', { ns: meta.id }],\n duration: Infinity,\n icon: 'ph--info--regular',\n actionLabel: ['observability toast action label', { ns: meta.id }],\n actionAlt: ['observability toast action alt', { ns: meta.id }],\n closeLabel: ['observability toast close label', { ns: meta.id }],\n onAction: () => dispatch(createIntent(SettingsAction.Open, { plugin: meta.id })),\n },\n }),\n );\n\n state.notified = true;\n }\n };\n\n // Ensure errors are tagged with enabled plugins to help with reproductions.\n manager.enabled.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, 'true', 'errors'));\n\n await dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: 'page.load',\n properties: {\n // TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?\n loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart,\n },\n }),\n );\n\n // Start client observability (i.e. not running as shared worker)\n // TODO(nf): how to prevent multiple instances for single shared worker?\n const cleanup = setupTelemetryListeners(namespace, client, observability);\n\n await Promise.all([\n observability.setIdentityTags(client.services.services),\n observability.startRuntimeMetrics(client),\n observability.startNetworkMetrics(client.services.services),\n observability.startSpacesMetrics(client, namespace),\n ]);\n\n if (client.halo.identity.get()) {\n await sendPrivacyNotice();\n } else {\n const subscription = client.halo.identity.subscribe(async (identity) => {\n if (identity && observability) {\n await sendPrivacyNotice();\n await observability.setIdentityTags(client.services.services);\n subscription.unsubscribe();\n }\n });\n }\n\n return contributes(ObservabilityCapabilities.Observability, observability, async () => {\n cleanup();\n await observability.close();\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,SACEA,cACAC,cAEAC,gBACAC,aACAC,oBACK;AACP,SAA6BC,+BAA+B;AAa5D,IAAA,wBAAe,OAAO,EAAEC,SAASC,WAAWC,cAAa,MAAsB;AAC7E,QAAMC,UAAUH,QAAQI,cAAcC,aAAaC,aAAa;AAChE,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKR,QAAQI,cAAcC,aAAaI,gBAAgB;AACzF,QAAMC,QAAQV,QAAQI,cAAcO,0BAA0BC,KAAK;AACnE,QAAMC,SAASb,QAAQI,cAAcU,gBAAAA;AAErC,QAAMC,oBAAoB,YAAA;AACxB,UAAMC,cAAcH,QAAQI,QAAQC,OAAOC,SAASC,KAAKC,KAAKC;AAC9D,UAAMC,SACJP,eAAeA,gBAAgB,QAAQ,CAACA,YAAYQ,SAAS,QAAA,KAAa,CAACR,YAAYQ,SAAS,MAAA;AAClG,QAAI,CAACd,MAAMe,YAAY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ACzD,UAAIA,YAAYnE,eAAe;AAC7B,cAAMa,kBAAAA;AACN,cAAMb,cAAc6D,gBAAgBlD,OAAOmD,SAASA,QAAQ;AAC5DO,qBAAaE,YAAW;MAC1B;IACF,CAAA;EACF;AAEA,SAAOC,YAAY/D,0BAA0BgE,eAAezE,eAAe,YAAA;AACzEyD,YAAAA;AACA,UAAMzD,cAAc0E,MAAK;EAC3B,CAAA;AACF;",
|
|
6
|
+
"names": ["Capabilities", "LayoutAction", "SettingsAction", "contributes", "createIntent", "setupTelemetryListeners", "context", "namespace", "observability", "manager", "getCapability", "Capabilities", "PluginManager", "dispatchPromise", "dispatch", "IntentDispatcher", "state", "ObservabilityCapabilities", "State", "client", "ClientCapability", "sendPrivacyNotice", "environment", "config", "values", "runtime", "app", "env", "DX_ENVIRONMENT", "notify", "endsWith", "notified", "createIntent", "LayoutAction", "AddToast", "part", "subject", "id", "meta", "title", "ns", "description", "duration", "Infinity", "icon", "actionLabel", "actionAlt", "closeLabel", "onAction", "SettingsAction", "Open", "plugin", "enabled", "map", "setTag", "ObservabilityAction", "SendEvent", "name", "properties", "loadDuration", "window", "performance", "timing", "loadEventEnd", "loadEventStart", "cleanup", "setupTelemetryListeners", "Promise", "all", "setIdentityTags", "services", "startRuntimeMetrics", "startNetworkMetrics", "startSpacesMetrics", "halo", "identity", "get", "subscription", "subscribe", "unsubscribe", "contributes", "Observability", "close"]
|
|
7
|
+
}
|