@dxos/plugin-observability 0.7.1 → 0.7.2-main.f1adc9f
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/node/chunk-RAB7T73W.cjs +44 -0
- package/dist/lib/node/chunk-RAB7T73W.cjs.map +7 -0
- package/dist/lib/node/index.cjs +251 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.cjs +32 -0
- package/dist/lib/node/meta.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node-esm/chunk-UVEE3XZO.mjs +22 -0
- package/dist/lib/node-esm/chunk-UVEE3XZO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +231 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +12 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/package.json +22 -20
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chunk_RAB7T73W_exports = {};
|
|
20
|
+
__export(chunk_RAB7T73W_exports, {
|
|
21
|
+
OBSERVABILITY_PLUGIN: () => OBSERVABILITY_PLUGIN,
|
|
22
|
+
ObservabilityAction: () => ObservabilityAction,
|
|
23
|
+
meta_default: () => meta_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(chunk_RAB7T73W_exports);
|
|
26
|
+
var OBSERVABILITY_PLUGIN = "dxos.org/plugin/observability";
|
|
27
|
+
var meta_default = {
|
|
28
|
+
id: OBSERVABILITY_PLUGIN,
|
|
29
|
+
name: "Telemetry"
|
|
30
|
+
};
|
|
31
|
+
var OBSERVABILITY_ACTION = "dxos.org/plugin/observability";
|
|
32
|
+
var ObservabilityAction;
|
|
33
|
+
(function(ObservabilityAction2) {
|
|
34
|
+
ObservabilityAction2[ObservabilityAction2["TOGGLE"] = `${OBSERVABILITY_ACTION}/toggle`] = "TOGGLE";
|
|
35
|
+
ObservabilityAction2[ObservabilityAction2["SEND_EVENT"] = `${OBSERVABILITY_ACTION}/send-event`] = "SEND_EVENT";
|
|
36
|
+
ObservabilityAction2[ObservabilityAction2["CAPTURE_USER_FEEDBACK"] = `${OBSERVABILITY_ACTION}/capture-feedback`] = "CAPTURE_USER_FEEDBACK";
|
|
37
|
+
})(ObservabilityAction || (ObservabilityAction = {}));
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
OBSERVABILITY_PLUGIN,
|
|
41
|
+
ObservabilityAction,
|
|
42
|
+
meta_default
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=chunk-RAB7T73W.cjs.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';\n\nexport const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';\n\nexport default {\n id: OBSERVABILITY_PLUGIN,\n name: 'Telemetry',\n} satisfies PluginMeta;\n\nconst OBSERVABILITY_ACTION = 'dxos.org/plugin/observability';\nexport enum ObservabilityAction {\n TOGGLE = `${OBSERVABILITY_ACTION}/toggle`,\n SEND_EVENT = `${OBSERVABILITY_ACTION}/send-event`,\n CAPTURE_USER_FEEDBACK = `${OBSERVABILITY_ACTION}/capture-feedback`,\n}\n\nexport type UserFeedback = {\n name: string;\n email: string;\n message: string;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,uBAAuB;AAEpC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,uBAAuB;;UACjBC,sBAAAA;wDACD,GAAGD,oBAAAA,SAA6B,IAAA;4DAC5B,GAAGA,oBAAAA,aAAiC,IAAA;uEACzB,GAAGA,oBAAAA,mBAAuC,IAAA;GAHxDC,wBAAAA,sBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["OBSERVABILITY_PLUGIN", "id", "name", "OBSERVABILITY_ACTION", "ObservabilityAction"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var node_exports = {};
|
|
30
|
+
__export(node_exports, {
|
|
31
|
+
ObservabilityPlugin: () => ObservabilityPlugin,
|
|
32
|
+
default: () => src_default,
|
|
33
|
+
parseObservabilityPlugin: () => parseObservabilityPlugin
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(node_exports);
|
|
36
|
+
var import_chunk_RAB7T73W = require("./chunk-RAB7T73W.cjs");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
39
|
+
var import_async = require("@dxos/async");
|
|
40
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
41
|
+
var import_local_storage = require("@dxos/local-storage");
|
|
42
|
+
var import_observability = require("@dxos/observability");
|
|
43
|
+
var import_plugin_client = require("@dxos/plugin-client");
|
|
44
|
+
var import_react2 = __toESM(require("react"));
|
|
45
|
+
var import_app_framework2 = require("@dxos/app-framework");
|
|
46
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
47
|
+
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
48
|
+
var ObservabilitySettings = ({ settings }) => {
|
|
49
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN);
|
|
50
|
+
const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
|
|
51
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, intentPlugin && /* @__PURE__ */ import_react2.default.createElement(import_react_ui_form.DeprecatedFormInput, {
|
|
52
|
+
label: t("observability enabled label"),
|
|
53
|
+
secondary: /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Message.Root, {
|
|
54
|
+
valence: "info"
|
|
55
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Message.Body, null, t("observability description")))
|
|
56
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Input.Switch, {
|
|
57
|
+
checked: settings.enabled,
|
|
58
|
+
onCheckedChange: (checked) => intentPlugin.provides.intent.dispatch({
|
|
59
|
+
plugin: import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN,
|
|
60
|
+
action: import_chunk_RAB7T73W.ObservabilityAction.TOGGLE,
|
|
61
|
+
data: {
|
|
62
|
+
state: !!checked
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
})));
|
|
66
|
+
};
|
|
67
|
+
var translations_default = [
|
|
68
|
+
{
|
|
69
|
+
"en-US": {
|
|
70
|
+
[import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN]: {
|
|
71
|
+
"plugin name": "Telemetry",
|
|
72
|
+
"observability toast label": "Privacy Notice",
|
|
73
|
+
"observability toast description": "Composer collects usage and performance metrics to improve the product. No user data is collected.",
|
|
74
|
+
"observability toast action label": "Settings",
|
|
75
|
+
"observability toast action alt": "Open settings to learn more or to disable.",
|
|
76
|
+
"observability toast close label": "Okay",
|
|
77
|
+
"observability enabled label": "Enable telemetry",
|
|
78
|
+
// TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.
|
|
79
|
+
"observability description": "When enabled, basic usage data will be sent to the DXOS team in order 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."
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
var parseObservabilityPlugin = (plugin) => (plugin?.provides).observability ? plugin : void 0;
|
|
85
|
+
var ObservabilityPlugin = (options) => {
|
|
86
|
+
const settings = (0, import_echo_schema.create)({});
|
|
87
|
+
const state = new import_local_storage.LocalStorageStore(import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN);
|
|
88
|
+
const subscriptions = new import_async.EventSubscriptions();
|
|
89
|
+
let observability;
|
|
90
|
+
return {
|
|
91
|
+
meta: import_chunk_RAB7T73W.meta_default,
|
|
92
|
+
initialize: async () => {
|
|
93
|
+
settings.enabled = !await (0, import_observability.isObservabilityDisabled)(options.namespace);
|
|
94
|
+
state.values.group = await (0, import_observability.getObservabilityGroup)(options.namespace);
|
|
95
|
+
state.prop({
|
|
96
|
+
key: "notified",
|
|
97
|
+
type: import_local_storage.LocalStorageStore.bool({
|
|
98
|
+
allowUndefined: true
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
ready: async (plugins) => {
|
|
103
|
+
const pluginHost = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parsePluginHost);
|
|
104
|
+
const clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
105
|
+
const intentPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin);
|
|
106
|
+
const dispatch = intentPlugin?.provides?.intent?.dispatch;
|
|
107
|
+
if (!dispatch) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const sendPrivacyNotice = async () => {
|
|
111
|
+
const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
|
|
112
|
+
const notify = environment && environment !== "ci" && !environment.endsWith(".local") && !environment.endsWith(".lan");
|
|
113
|
+
if (!state.values.notified && notify) {
|
|
114
|
+
await dispatch({
|
|
115
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
116
|
+
data: {
|
|
117
|
+
element: "toast",
|
|
118
|
+
subject: {
|
|
119
|
+
id: `${import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN}/notice`,
|
|
120
|
+
// TODO(wittjosiah): Non-react translation utils.
|
|
121
|
+
title: translations_default[0]["en-US"][import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN]["observability toast label"],
|
|
122
|
+
description: translations_default[0]["en-US"][import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN]["observability toast description"],
|
|
123
|
+
duration: Infinity,
|
|
124
|
+
icon: "ph--info--regular",
|
|
125
|
+
actionLabel: translations_default[0]["en-US"][import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN]["observability toast action label"],
|
|
126
|
+
actionAlt: translations_default[0]["en-US"][import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN]["observability toast action alt"],
|
|
127
|
+
closeLabel: translations_default[0]["en-US"][import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN]["observability toast close label"],
|
|
128
|
+
onAction: () => dispatch({
|
|
129
|
+
action: import_app_framework.SettingsAction.OPEN,
|
|
130
|
+
data: {
|
|
131
|
+
plugin: import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
state.values.notified = true;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
void options.observability().then(async (obs) => {
|
|
141
|
+
observability = obs;
|
|
142
|
+
pluginHost?.provides?.plugins?.enabled?.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, "true", "errors"));
|
|
143
|
+
const client = clientPlugin?.provides?.client;
|
|
144
|
+
if (!client) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
await dispatch({
|
|
148
|
+
action: import_chunk_RAB7T73W.ObservabilityAction.SEND_EVENT,
|
|
149
|
+
data: {
|
|
150
|
+
name: "page.load",
|
|
151
|
+
properties: {
|
|
152
|
+
href: window.location.href,
|
|
153
|
+
// TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?
|
|
154
|
+
loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
(0, import_observability.setupTelemetryListeners)(options.namespace, client, observability);
|
|
159
|
+
await Promise.all([
|
|
160
|
+
observability.setIdentityTags(client.services.services),
|
|
161
|
+
observability.startRuntimeMetrics(client),
|
|
162
|
+
observability.startNetworkMetrics(client.services.services),
|
|
163
|
+
observability.startSpacesMetrics(client, options.namespace)
|
|
164
|
+
]);
|
|
165
|
+
if (client.halo.identity.get()) {
|
|
166
|
+
await sendPrivacyNotice();
|
|
167
|
+
} else {
|
|
168
|
+
const subscription = client.halo.identity.subscribe(async (identity) => {
|
|
169
|
+
if (identity && observability) {
|
|
170
|
+
await sendPrivacyNotice();
|
|
171
|
+
await observability.setIdentityTags(client.services.services);
|
|
172
|
+
subscription.unsubscribe();
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
unload: async () => {
|
|
179
|
+
subscriptions.clear();
|
|
180
|
+
await observability?.close();
|
|
181
|
+
},
|
|
182
|
+
provides: {
|
|
183
|
+
intent: {
|
|
184
|
+
resolver: async (intent, plugins) => {
|
|
185
|
+
const client = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin)?.provides?.client;
|
|
186
|
+
if (!client || !observability) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
switch (intent.action) {
|
|
190
|
+
case import_chunk_RAB7T73W.ObservabilityAction.TOGGLE:
|
|
191
|
+
settings.enabled = !settings.enabled;
|
|
192
|
+
observability.event({
|
|
193
|
+
identityId: (0, import_observability.getTelemetryIdentifier)(client),
|
|
194
|
+
name: `${options.namespace}.observability.toggle`,
|
|
195
|
+
properties: {
|
|
196
|
+
enabled: settings.enabled
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
observability.setMode(settings.enabled ? "basic" : "disabled");
|
|
200
|
+
await (0, import_observability.storeObservabilityDisabled)(options.namespace, !settings.enabled);
|
|
201
|
+
return {
|
|
202
|
+
data: settings.enabled
|
|
203
|
+
};
|
|
204
|
+
case import_chunk_RAB7T73W.ObservabilityAction.SEND_EVENT: {
|
|
205
|
+
const data = intent.data;
|
|
206
|
+
const event = {
|
|
207
|
+
identityId: (0, import_observability.getTelemetryIdentifier)(client),
|
|
208
|
+
name: `${options.namespace}.${data.name}`,
|
|
209
|
+
properties: {
|
|
210
|
+
...data.properties
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
observability.event(event);
|
|
214
|
+
return {
|
|
215
|
+
data: event
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
case import_chunk_RAB7T73W.ObservabilityAction.CAPTURE_USER_FEEDBACK: {
|
|
219
|
+
const feedback = intent.data;
|
|
220
|
+
observability.captureUserFeedback(feedback.email, feedback.name, feedback.message);
|
|
221
|
+
return {
|
|
222
|
+
data: true
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
observability: state.values,
|
|
229
|
+
settings,
|
|
230
|
+
surface: {
|
|
231
|
+
component: ({ role, data }) => {
|
|
232
|
+
switch (role) {
|
|
233
|
+
case "settings":
|
|
234
|
+
return data.plugin === import_chunk_RAB7T73W.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(ObservabilitySettings, {
|
|
235
|
+
settings
|
|
236
|
+
}) : null;
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
translations: translations_default
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
var src_default = ObservabilityPlugin;
|
|
246
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
247
|
+
0 && (module.exports = {
|
|
248
|
+
ObservabilityPlugin,
|
|
249
|
+
parseObservabilityPlugin
|
|
250
|
+
});
|
|
251
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ObservabilityPlugin.tsx", "../../../src/components/ObservabilitySettings.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n type Plugin,\n type PluginDefinition,\n type IntentResolverProvides,\n type SettingsProvides,\n type SurfaceProvides,\n type TranslationsProvides,\n resolvePlugin,\n parseIntentPlugin,\n LayoutAction,\n SettingsAction,\n parsePluginHost,\n} from '@dxos/app-framework';\nimport { EventSubscriptions } from '@dxos/async';\nimport { create } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport {\n type Observability,\n getTelemetryIdentifier,\n setupTelemetryListeners,\n isObservabilityDisabled,\n storeObservabilityDisabled,\n getObservabilityGroup,\n} from '@dxos/observability';\nimport type { EventOptions } from '@dxos/observability/segment';\nimport { parseClientPlugin } from '@dxos/plugin-client';\n\nimport { ObservabilitySettings, type ObservabilitySettingsProps } from './components';\nimport meta, { OBSERVABILITY_PLUGIN, ObservabilityAction, type UserFeedback } from './meta';\nimport translations from './translations';\n\nexport type ObservabilityPluginState = {\n group?: string;\n notified?: boolean;\n};\n\nexport type ObservabilityPluginProvides = IntentResolverProvides &\n SurfaceProvides &\n SettingsProvides<ObservabilitySettingsProps> &\n TranslationsProvides & {\n observability: ObservabilityPluginState;\n };\n\nexport const parseObservabilityPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).observability ? (plugin as Plugin<ObservabilityPluginProvides>) : undefined;\n\nexport const ObservabilityPlugin = (options: {\n namespace: string;\n observability: () => Promise<Observability>;\n}): PluginDefinition<ObservabilityPluginProvides> => {\n const settings = create<ObservabilitySettingsProps>({});\n const state = new LocalStorageStore<ObservabilityPluginState>(OBSERVABILITY_PLUGIN);\n const subscriptions = new EventSubscriptions();\n let observability: Observability | undefined;\n\n return {\n meta,\n initialize: async () => {\n settings.enabled = !(await isObservabilityDisabled(options.namespace));\n state.values.group = await getObservabilityGroup(options.namespace);\n state.prop({ key: 'notified', type: LocalStorageStore.bool({ allowUndefined: true }) });\n },\n ready: async (plugins) => {\n const pluginHost = resolvePlugin(plugins, parsePluginHost);\n const clientPlugin = resolvePlugin(plugins, parseClientPlugin);\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n const dispatch = intentPlugin?.provides?.intent?.dispatch;\n if (!dispatch) {\n return;\n }\n\n const sendPrivacyNotice = async () => {\n const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;\n const notify =\n environment && environment !== 'ci' && !environment.endsWith('.local') && !environment.endsWith('.lan');\n if (!state.values.notified && notify) {\n await dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'toast',\n subject: {\n id: `${OBSERVABILITY_PLUGIN}/notice`,\n // TODO(wittjosiah): Non-react translation utils.\n title: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast label'],\n description: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast description'],\n duration: Infinity,\n icon: 'ph--info--regular',\n actionLabel: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast action label'],\n actionAlt: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast action alt'],\n closeLabel: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast close label'],\n onAction: () => dispatch({ action: SettingsAction.OPEN, data: { plugin: OBSERVABILITY_PLUGIN } }),\n },\n },\n });\n\n state.values.notified = true;\n }\n };\n\n // Initialize asynchronously in the background, not in plugin initialization.\n // Should not block application startup.\n void options.observability().then(async (obs) => {\n observability = obs;\n\n // Ensure errors are tagged with enabled plugins to help with reproductions.\n pluginHost?.provides?.plugins?.enabled?.map((plugin) =>\n observability?.setTag(`pluginEnabled-${plugin}`, 'true', 'errors'),\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 client = clientPlugin?.provides?.client;\n if (!client) {\n return;\n }\n\n await dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'page.load',\n properties: {\n href: window.location.href,\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 setupTelemetryListeners(options.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, options.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 },\n unload: async () => {\n subscriptions.clear();\n await observability?.close();\n },\n provides: {\n intent: {\n resolver: async (intent, plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides?.client;\n if (!client || !observability) {\n return;\n }\n\n switch (intent.action) {\n case ObservabilityAction.TOGGLE:\n settings.enabled = !settings.enabled;\n observability.event({\n identityId: getTelemetryIdentifier(client),\n name: `${options.namespace}.observability.toggle`,\n properties: {\n enabled: settings.enabled,\n },\n });\n observability.setMode(settings.enabled ? 'basic' : 'disabled');\n await storeObservabilityDisabled(options.namespace, !settings.enabled);\n return { data: settings.enabled };\n\n case ObservabilityAction.SEND_EVENT: {\n const data = intent.data as EventOptions;\n const event = {\n identityId: getTelemetryIdentifier(client),\n name: `${options.namespace}.${data.name}`,\n properties: {\n ...data.properties,\n },\n };\n observability.event(event);\n return { data: event };\n }\n\n case ObservabilityAction.CAPTURE_USER_FEEDBACK: {\n const feedback = intent.data as UserFeedback;\n\n observability.captureUserFeedback(feedback.email, feedback.name, feedback.message);\n return { data: true };\n }\n }\n },\n },\n observability: state.values,\n settings,\n surface: {\n component: ({ role, data }) => {\n switch (role) {\n case 'settings':\n return data.plugin === meta.id ? <ObservabilitySettings settings={settings} /> : null;\n }\n\n return null;\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { parseIntentPlugin, useResolvePlugin } from '@dxos/app-framework';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { OBSERVABILITY_PLUGIN, ObservabilityAction } from '../meta';\n\nexport type ObservabilitySettingsProps = {\n enabled?: boolean;\n // TODO(wittjosiah): Separate settings for each observability feature.\n // metrics?: boolean;\n // telemetry?: boolean;\n // errors?: boolean;\n};\n\nexport const ObservabilitySettings = ({ settings }: { settings: ObservabilitySettingsProps }) => {\n const { t } = useTranslation(OBSERVABILITY_PLUGIN);\n const intentPlugin = useResolvePlugin(parseIntentPlugin);\n\n return (\n <>\n {intentPlugin && (\n <DeprecatedFormInput\n label={t('observability enabled label')}\n secondary={\n <Message.Root valence='info'>\n <Message.Body>{t('observability description')}</Message.Body>\n </Message.Root>\n }\n >\n <Input.Switch\n checked={settings.enabled}\n onCheckedChange={(checked) =>\n intentPlugin.provides.intent.dispatch({\n plugin: OBSERVABILITY_PLUGIN,\n action: ObservabilityAction.TOGGLE,\n data: { state: !!checked },\n })\n }\n />\n </DeprecatedFormInput>\n )}\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { OBSERVABILITY_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [OBSERVABILITY_PLUGIN]: {\n 'plugin name': 'Telemetry',\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 be sent to the DXOS team in order 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 },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ObservabilityPlugin } from './ObservabilityPlugin';\n\nexport default ObservabilityPlugin;\n\nexport * from './ObservabilityPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAYO;AACP,mBAAmC;AACnC,yBAAuB;AACvB,2BAAkC;AAClC,2BAOO;AAEP,2BAAkC;AC3BlC,IAAAA,gBAAkB;AAElB,IAAAC,wBAAoD;AACpD,sBAA+C;AAC/C,2BAAoC;AAY7B,IAAMC,wBAAwB,CAAC,EAAEC,SAAQ,MAA4C;AAC1F,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,0CAAAA;AAC7B,QAAMC,mBAAeC,wCAAiBC,uCAAAA;AAEtC,SACE,8BAAAC,QAAA,cAAA,cAAAA,QAAA,UAAA,MACGH,gBACC,8BAAAG,QAAA,cAACC,0CAAAA;IACCC,OAAOR,EAAE,6BAAA;IACTS,WACE,8BAAAH,QAAA,cAACI,wBAAQC,MAAI;MAACC,SAAQ;OACpB,8BAAAN,QAAA,cAACI,wBAAQG,MAAI,MAAEb,EAAE,2BAAA,CAAA,CAAA;KAIrB,8BAAAM,QAAA,cAACQ,sBAAMC,QAAM;IACXC,SAASjB,SAASkB;IAClBC,iBAAiB,CAACF,YAChBb,aAAagB,SAASC,OAAOC,SAAS;MACpCC,QAAQpB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E,qBAAO;gBAAES,MAAM3B,SAASkB;cAAQ;YAElC,KAAKO,0CAAoBgE,YAAY;AACnC,oBAAM9D,OAAON,OAAOM;AACpB,oBAAM2F,QAAQ;gBACZC,gBAAYC,6CAAuB7D,MAAAA;gBACnC+B,MAAM,GAAGzD,QAAQQ,SAAS,IAAId,KAAK+D,IAAI;gBACvCC,YAAY;kBACV,GAAGhE,KAAKgE;gBACV;cACF;AACA7D,4BAAcwF,MAAMA,KAAAA;AACpB,qBAAO;gBAAE3F,MAAM2F;cAAM;YACvB;YAEA,KAAK7F,0CAAoBkG,uBAAuB;AAC9C,oBAAMC,WAAWvG,OAAOM;AAExBG,4BAAc+F,oBAAoBD,SAASE,OAAOF,SAASlC,MAAMkC,SAASG,OAAO;AACjF,qBAAO;gBAAEpG,MAAM;cAAK;YACtB;UACF;QACF;MACF;MACAG,eAAeF,MAAMc;MACrB1C;MACAgI,SAAS;QACPC,WAAW,CAAC,EAAEC,MAAMvG,KAAI,MAAE;AACxB,kBAAQuG,MAAAA;YACN,KAAK;AACH,qBAAOvG,KAAKJ,WAAWe,mCAAKkC,KAAKjE,6BAAAA,QAAA,cAACR,uBAAAA;gBAAsBC;mBAAyB;UACrF;AAEA,iBAAO;QACT;MACF;MACA0E,cAAAA;IACF;EACF;AACF;AGtNA,IAAA,cAAe1C;",
|
|
6
|
+
"names": ["import_react", "import_app_framework", "ObservabilitySettings", "settings", "t", "useTranslation", "OBSERVABILITY_PLUGIN", "intentPlugin", "useResolvePlugin", "parseIntentPlugin", "React", "DeprecatedFormInput", "label", "secondary", "Message", "Root", "valence", "Body", "Input", "Switch", "checked", "enabled", "onCheckedChange", "provides", "intent", "dispatch", "plugin", "action", "ObservabilityAction", "TOGGLE", "data", "state", "parseObservabilityPlugin", "observability", "undefined", "ObservabilityPlugin", "options", "create", "LocalStorageStore", "subscriptions", "EventSubscriptions", "meta", "initialize", "isObservabilityDisabled", "namespace", "values", "group", "getObservabilityGroup", "prop", "key", "type", "bool", "allowUndefined", "ready", "plugins", "pluginHost", "resolvePlugin", "parsePluginHost", "clientPlugin", "parseClientPlugin", "sendPrivacyNotice", "environment", "client", "config", "runtime", "app", "env", "DX_ENVIRONMENT", "notify", "endsWith", "notified", "LayoutAction", "SET_LAYOUT", "element", "subject", "id", "title", "translations", "description", "duration", "Infinity", "icon", "actionLabel", "actionAlt", "closeLabel", "onAction", "SettingsAction", "OPEN", "then", "obs", "map", "setTag", "SEND_EVENT", "name", "properties", "href", "window", "location", "loadDuration", "performance", "timing", "loadEventEnd", "loadEventStart", "setupTelemetryListeners", "Promise", "all", "setIdentityTags", "services", "startRuntimeMetrics", "startNetworkMetrics", "startSpacesMetrics", "halo", "identity", "get", "subscription", "subscribe", "unsubscribe", "unload", "clear", "close", "resolver", "event", "identityId", "getTelemetryIdentifier", "setMode", "storeObservabilityDisabled", "CAPTURE_USER_FEEDBACK", "feedback", "captureUserFeedback", "email", "message", "surface", "component", "role"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var meta_exports = {};
|
|
20
|
+
__export(meta_exports, {
|
|
21
|
+
OBSERVABILITY_PLUGIN: () => import_chunk_RAB7T73W.OBSERVABILITY_PLUGIN,
|
|
22
|
+
ObservabilityAction: () => import_chunk_RAB7T73W.ObservabilityAction,
|
|
23
|
+
default: () => import_chunk_RAB7T73W.meta_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(meta_exports);
|
|
26
|
+
var import_chunk_RAB7T73W = require("./chunk-RAB7T73W.cjs");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
OBSERVABILITY_PLUGIN,
|
|
30
|
+
ObservabilityAction
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=meta.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["meta.cjs"],
|
|
4
|
+
"sourcesContent": ["import {\n OBSERVABILITY_PLUGIN,\n ObservabilityAction,\n meta_default\n} from \"./chunk-RAB7T73W.cjs\";\nexport {\n OBSERVABILITY_PLUGIN,\n ObservabilityAction,\n meta_default as default\n};\n//# sourceMappingURL=meta.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAIO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytes":2301,"imports":[],"format":"esm"},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytes":5054,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-observability/src/components/index.ts":{"bytes":553,"imports":[{"path":"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx","kind":"import-statement","original":"./ObservabilitySettings"}],"format":"esm"},"packages/plugins/plugin-observability/src/translations.ts":{"bytes":3430,"imports":[{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx":{"bytes":28755,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-observability/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-observability/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-observability/src/index.ts":{"bytes":869,"imports":[{"path":"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx","kind":"import-statement","original":"./ObservabilityPlugin"},{"path":"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx","kind":"import-statement","original":"./ObservabilityPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-observability/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18436},"packages/plugins/plugin-observability/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node/chunk-RAB7T73W.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["ObservabilityPlugin","default","parseObservabilityPlugin"],"entryPoint":"packages/plugins/plugin-observability/src/index.ts","inputs":{"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx":{"bytesInOutput":6919},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytesInOutput":1065},"packages/plugins/plugin-observability/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-observability/src/translations.ts":{"bytesInOutput":1031},"packages/plugins/plugin-observability/src/index.ts":{"bytesInOutput":39}},"bytes":9619},"packages/plugins/plugin-observability/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-observability/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node/chunk-RAB7T73W.cjs","kind":"import-statement"}],"exports":["OBSERVABILITY_PLUGIN","ObservabilityAction","default"],"entryPoint":"packages/plugins/plugin-observability/src/meta.ts","inputs":{},"bytes":221},"packages/plugins/plugin-observability/dist/lib/node/chunk-RAB7T73W.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1049},"packages/plugins/plugin-observability/dist/lib/node/chunk-RAB7T73W.cjs":{"imports":[],"exports":["OBSERVABILITY_PLUGIN","ObservabilityAction","meta_default"],"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytesInOutput":664}},"bytes":836}}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/plugins/plugin-observability/src/meta.ts
|
|
4
|
+
var OBSERVABILITY_PLUGIN = "dxos.org/plugin/observability";
|
|
5
|
+
var meta_default = {
|
|
6
|
+
id: OBSERVABILITY_PLUGIN,
|
|
7
|
+
name: "Telemetry"
|
|
8
|
+
};
|
|
9
|
+
var OBSERVABILITY_ACTION = "dxos.org/plugin/observability";
|
|
10
|
+
var ObservabilityAction;
|
|
11
|
+
(function(ObservabilityAction2) {
|
|
12
|
+
ObservabilityAction2[ObservabilityAction2["TOGGLE"] = `${OBSERVABILITY_ACTION}/toggle`] = "TOGGLE";
|
|
13
|
+
ObservabilityAction2[ObservabilityAction2["SEND_EVENT"] = `${OBSERVABILITY_ACTION}/send-event`] = "SEND_EVENT";
|
|
14
|
+
ObservabilityAction2[ObservabilityAction2["CAPTURE_USER_FEEDBACK"] = `${OBSERVABILITY_ACTION}/capture-feedback`] = "CAPTURE_USER_FEEDBACK";
|
|
15
|
+
})(ObservabilityAction || (ObservabilityAction = {}));
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
OBSERVABILITY_PLUGIN,
|
|
19
|
+
meta_default,
|
|
20
|
+
ObservabilityAction
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-UVEE3XZO.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';\n\nexport const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';\n\nexport default {\n id: OBSERVABILITY_PLUGIN,\n name: 'Telemetry',\n} satisfies PluginMeta;\n\nconst OBSERVABILITY_ACTION = 'dxos.org/plugin/observability';\nexport enum ObservabilityAction {\n TOGGLE = `${OBSERVABILITY_ACTION}/toggle`,\n SEND_EVENT = `${OBSERVABILITY_ACTION}/send-event`,\n CAPTURE_USER_FEEDBACK = `${OBSERVABILITY_ACTION}/capture-feedback`,\n}\n\nexport type UserFeedback = {\n name: string;\n email: string;\n message: string;\n};\n"],
|
|
5
|
+
"mappings": ";;;AAMO,IAAMA,uBAAuB;AAEpC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,uBAAuB;;UACjBC,sBAAAA;wDACD,GAAGD,oBAAAA,SAA6B,IAAA;4DAC5B,GAAGA,oBAAAA,aAAiC,IAAA;uEACzB,GAAGA,oBAAAA,mBAAuC,IAAA;GAHxDC,wBAAAA,sBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["OBSERVABILITY_PLUGIN", "id", "name", "OBSERVABILITY_ACTION", "ObservabilityAction"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
OBSERVABILITY_PLUGIN,
|
|
4
|
+
ObservabilityAction,
|
|
5
|
+
meta_default
|
|
6
|
+
} from "./chunk-UVEE3XZO.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
|
|
9
|
+
import React2 from "react";
|
|
10
|
+
import { resolvePlugin, parseIntentPlugin as parseIntentPlugin2, LayoutAction, SettingsAction, parsePluginHost } from "@dxos/app-framework";
|
|
11
|
+
import { EventSubscriptions } from "@dxos/async";
|
|
12
|
+
import { create } from "@dxos/echo-schema";
|
|
13
|
+
import { LocalStorageStore } from "@dxos/local-storage";
|
|
14
|
+
import { getTelemetryIdentifier, setupTelemetryListeners, isObservabilityDisabled, storeObservabilityDisabled, getObservabilityGroup } from "@dxos/observability";
|
|
15
|
+
import { parseClientPlugin } from "@dxos/plugin-client";
|
|
16
|
+
|
|
17
|
+
// packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { parseIntentPlugin, useResolvePlugin } from "@dxos/app-framework";
|
|
20
|
+
import { Input, Message, useTranslation } from "@dxos/react-ui";
|
|
21
|
+
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
22
|
+
var ObservabilitySettings = ({ settings }) => {
|
|
23
|
+
const { t } = useTranslation(OBSERVABILITY_PLUGIN);
|
|
24
|
+
const intentPlugin = useResolvePlugin(parseIntentPlugin);
|
|
25
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, intentPlugin && /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
|
|
26
|
+
label: t("observability enabled label"),
|
|
27
|
+
secondary: /* @__PURE__ */ React.createElement(Message.Root, {
|
|
28
|
+
valence: "info"
|
|
29
|
+
}, /* @__PURE__ */ React.createElement(Message.Body, null, t("observability description")))
|
|
30
|
+
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
31
|
+
checked: settings.enabled,
|
|
32
|
+
onCheckedChange: (checked) => intentPlugin.provides.intent.dispatch({
|
|
33
|
+
plugin: OBSERVABILITY_PLUGIN,
|
|
34
|
+
action: ObservabilityAction.TOGGLE,
|
|
35
|
+
data: {
|
|
36
|
+
state: !!checked
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
})));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// packages/plugins/plugin-observability/src/translations.ts
|
|
43
|
+
var translations_default = [
|
|
44
|
+
{
|
|
45
|
+
"en-US": {
|
|
46
|
+
[OBSERVABILITY_PLUGIN]: {
|
|
47
|
+
"plugin name": "Telemetry",
|
|
48
|
+
"observability toast label": "Privacy Notice",
|
|
49
|
+
"observability toast description": "Composer collects usage and performance metrics to improve the product. No user data is collected.",
|
|
50
|
+
"observability toast action label": "Settings",
|
|
51
|
+
"observability toast action alt": "Open settings to learn more or to disable.",
|
|
52
|
+
"observability toast close label": "Okay",
|
|
53
|
+
"observability enabled label": "Enable telemetry",
|
|
54
|
+
// TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.
|
|
55
|
+
"observability description": "When enabled, basic usage data will be sent to the DXOS team in order 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."
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
// packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
|
|
62
|
+
var parseObservabilityPlugin = (plugin) => (plugin?.provides).observability ? plugin : void 0;
|
|
63
|
+
var ObservabilityPlugin = (options) => {
|
|
64
|
+
const settings = create({});
|
|
65
|
+
const state = new LocalStorageStore(OBSERVABILITY_PLUGIN);
|
|
66
|
+
const subscriptions = new EventSubscriptions();
|
|
67
|
+
let observability;
|
|
68
|
+
return {
|
|
69
|
+
meta: meta_default,
|
|
70
|
+
initialize: async () => {
|
|
71
|
+
settings.enabled = !await isObservabilityDisabled(options.namespace);
|
|
72
|
+
state.values.group = await getObservabilityGroup(options.namespace);
|
|
73
|
+
state.prop({
|
|
74
|
+
key: "notified",
|
|
75
|
+
type: LocalStorageStore.bool({
|
|
76
|
+
allowUndefined: true
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
ready: async (plugins) => {
|
|
81
|
+
const pluginHost = resolvePlugin(plugins, parsePluginHost);
|
|
82
|
+
const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
|
|
83
|
+
const intentPlugin = resolvePlugin(plugins, parseIntentPlugin2);
|
|
84
|
+
const dispatch = intentPlugin?.provides?.intent?.dispatch;
|
|
85
|
+
if (!dispatch) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const sendPrivacyNotice = async () => {
|
|
89
|
+
const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
|
|
90
|
+
const notify = environment && environment !== "ci" && !environment.endsWith(".local") && !environment.endsWith(".lan");
|
|
91
|
+
if (!state.values.notified && notify) {
|
|
92
|
+
await dispatch({
|
|
93
|
+
action: LayoutAction.SET_LAYOUT,
|
|
94
|
+
data: {
|
|
95
|
+
element: "toast",
|
|
96
|
+
subject: {
|
|
97
|
+
id: `${OBSERVABILITY_PLUGIN}/notice`,
|
|
98
|
+
// TODO(wittjosiah): Non-react translation utils.
|
|
99
|
+
title: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast label"],
|
|
100
|
+
description: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast description"],
|
|
101
|
+
duration: Infinity,
|
|
102
|
+
icon: "ph--info--regular",
|
|
103
|
+
actionLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action label"],
|
|
104
|
+
actionAlt: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action alt"],
|
|
105
|
+
closeLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast close label"],
|
|
106
|
+
onAction: () => dispatch({
|
|
107
|
+
action: SettingsAction.OPEN,
|
|
108
|
+
data: {
|
|
109
|
+
plugin: OBSERVABILITY_PLUGIN
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
state.values.notified = true;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
void options.observability().then(async (obs) => {
|
|
119
|
+
observability = obs;
|
|
120
|
+
pluginHost?.provides?.plugins?.enabled?.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, "true", "errors"));
|
|
121
|
+
const client = clientPlugin?.provides?.client;
|
|
122
|
+
if (!client) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
await dispatch({
|
|
126
|
+
action: ObservabilityAction.SEND_EVENT,
|
|
127
|
+
data: {
|
|
128
|
+
name: "page.load",
|
|
129
|
+
properties: {
|
|
130
|
+
href: window.location.href,
|
|
131
|
+
// TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?
|
|
132
|
+
loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
setupTelemetryListeners(options.namespace, client, observability);
|
|
137
|
+
await Promise.all([
|
|
138
|
+
observability.setIdentityTags(client.services.services),
|
|
139
|
+
observability.startRuntimeMetrics(client),
|
|
140
|
+
observability.startNetworkMetrics(client.services.services),
|
|
141
|
+
observability.startSpacesMetrics(client, options.namespace)
|
|
142
|
+
]);
|
|
143
|
+
if (client.halo.identity.get()) {
|
|
144
|
+
await sendPrivacyNotice();
|
|
145
|
+
} else {
|
|
146
|
+
const subscription = client.halo.identity.subscribe(async (identity) => {
|
|
147
|
+
if (identity && observability) {
|
|
148
|
+
await sendPrivacyNotice();
|
|
149
|
+
await observability.setIdentityTags(client.services.services);
|
|
150
|
+
subscription.unsubscribe();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
unload: async () => {
|
|
157
|
+
subscriptions.clear();
|
|
158
|
+
await observability?.close();
|
|
159
|
+
},
|
|
160
|
+
provides: {
|
|
161
|
+
intent: {
|
|
162
|
+
resolver: async (intent, plugins) => {
|
|
163
|
+
const client = resolvePlugin(plugins, parseClientPlugin)?.provides?.client;
|
|
164
|
+
if (!client || !observability) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
switch (intent.action) {
|
|
168
|
+
case ObservabilityAction.TOGGLE:
|
|
169
|
+
settings.enabled = !settings.enabled;
|
|
170
|
+
observability.event({
|
|
171
|
+
identityId: getTelemetryIdentifier(client),
|
|
172
|
+
name: `${options.namespace}.observability.toggle`,
|
|
173
|
+
properties: {
|
|
174
|
+
enabled: settings.enabled
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
observability.setMode(settings.enabled ? "basic" : "disabled");
|
|
178
|
+
await storeObservabilityDisabled(options.namespace, !settings.enabled);
|
|
179
|
+
return {
|
|
180
|
+
data: settings.enabled
|
|
181
|
+
};
|
|
182
|
+
case ObservabilityAction.SEND_EVENT: {
|
|
183
|
+
const data = intent.data;
|
|
184
|
+
const event = {
|
|
185
|
+
identityId: getTelemetryIdentifier(client),
|
|
186
|
+
name: `${options.namespace}.${data.name}`,
|
|
187
|
+
properties: {
|
|
188
|
+
...data.properties
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
observability.event(event);
|
|
192
|
+
return {
|
|
193
|
+
data: event
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case ObservabilityAction.CAPTURE_USER_FEEDBACK: {
|
|
197
|
+
const feedback = intent.data;
|
|
198
|
+
observability.captureUserFeedback(feedback.email, feedback.name, feedback.message);
|
|
199
|
+
return {
|
|
200
|
+
data: true
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
observability: state.values,
|
|
207
|
+
settings,
|
|
208
|
+
surface: {
|
|
209
|
+
component: ({ role, data }) => {
|
|
210
|
+
switch (role) {
|
|
211
|
+
case "settings":
|
|
212
|
+
return data.plugin === meta_default.id ? /* @__PURE__ */ React2.createElement(ObservabilitySettings, {
|
|
213
|
+
settings
|
|
214
|
+
}) : null;
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
translations: translations_default
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// packages/plugins/plugin-observability/src/index.ts
|
|
225
|
+
var src_default = ObservabilityPlugin;
|
|
226
|
+
export {
|
|
227
|
+
ObservabilityPlugin,
|
|
228
|
+
src_default as default,
|
|
229
|
+
parseObservabilityPlugin
|
|
230
|
+
};
|
|
231
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ObservabilityPlugin.tsx", "../../../src/components/ObservabilitySettings.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n type Plugin,\n type PluginDefinition,\n type IntentResolverProvides,\n type SettingsProvides,\n type SurfaceProvides,\n type TranslationsProvides,\n resolvePlugin,\n parseIntentPlugin,\n LayoutAction,\n SettingsAction,\n parsePluginHost,\n} from '@dxos/app-framework';\nimport { EventSubscriptions } from '@dxos/async';\nimport { create } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport {\n type Observability,\n getTelemetryIdentifier,\n setupTelemetryListeners,\n isObservabilityDisabled,\n storeObservabilityDisabled,\n getObservabilityGroup,\n} from '@dxos/observability';\nimport type { EventOptions } from '@dxos/observability/segment';\nimport { parseClientPlugin } from '@dxos/plugin-client';\n\nimport { ObservabilitySettings, type ObservabilitySettingsProps } from './components';\nimport meta, { OBSERVABILITY_PLUGIN, ObservabilityAction, type UserFeedback } from './meta';\nimport translations from './translations';\n\nexport type ObservabilityPluginState = {\n group?: string;\n notified?: boolean;\n};\n\nexport type ObservabilityPluginProvides = IntentResolverProvides &\n SurfaceProvides &\n SettingsProvides<ObservabilitySettingsProps> &\n TranslationsProvides & {\n observability: ObservabilityPluginState;\n };\n\nexport const parseObservabilityPlugin = (plugin?: Plugin) =>\n (plugin?.provides as any).observability ? (plugin as Plugin<ObservabilityPluginProvides>) : undefined;\n\nexport const ObservabilityPlugin = (options: {\n namespace: string;\n observability: () => Promise<Observability>;\n}): PluginDefinition<ObservabilityPluginProvides> => {\n const settings = create<ObservabilitySettingsProps>({});\n const state = new LocalStorageStore<ObservabilityPluginState>(OBSERVABILITY_PLUGIN);\n const subscriptions = new EventSubscriptions();\n let observability: Observability | undefined;\n\n return {\n meta,\n initialize: async () => {\n settings.enabled = !(await isObservabilityDisabled(options.namespace));\n state.values.group = await getObservabilityGroup(options.namespace);\n state.prop({ key: 'notified', type: LocalStorageStore.bool({ allowUndefined: true }) });\n },\n ready: async (plugins) => {\n const pluginHost = resolvePlugin(plugins, parsePluginHost);\n const clientPlugin = resolvePlugin(plugins, parseClientPlugin);\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n const dispatch = intentPlugin?.provides?.intent?.dispatch;\n if (!dispatch) {\n return;\n }\n\n const sendPrivacyNotice = async () => {\n const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;\n const notify =\n environment && environment !== 'ci' && !environment.endsWith('.local') && !environment.endsWith('.lan');\n if (!state.values.notified && notify) {\n await dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'toast',\n subject: {\n id: `${OBSERVABILITY_PLUGIN}/notice`,\n // TODO(wittjosiah): Non-react translation utils.\n title: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast label'],\n description: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast description'],\n duration: Infinity,\n icon: 'ph--info--regular',\n actionLabel: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast action label'],\n actionAlt: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast action alt'],\n closeLabel: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast close label'],\n onAction: () => dispatch({ action: SettingsAction.OPEN, data: { plugin: OBSERVABILITY_PLUGIN } }),\n },\n },\n });\n\n state.values.notified = true;\n }\n };\n\n // Initialize asynchronously in the background, not in plugin initialization.\n // Should not block application startup.\n void options.observability().then(async (obs) => {\n observability = obs;\n\n // Ensure errors are tagged with enabled plugins to help with reproductions.\n pluginHost?.provides?.plugins?.enabled?.map((plugin) =>\n observability?.setTag(`pluginEnabled-${plugin}`, 'true', 'errors'),\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 client = clientPlugin?.provides?.client;\n if (!client) {\n return;\n }\n\n await dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'page.load',\n properties: {\n href: window.location.href,\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 setupTelemetryListeners(options.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, options.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 },\n unload: async () => {\n subscriptions.clear();\n await observability?.close();\n },\n provides: {\n intent: {\n resolver: async (intent, plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides?.client;\n if (!client || !observability) {\n return;\n }\n\n switch (intent.action) {\n case ObservabilityAction.TOGGLE:\n settings.enabled = !settings.enabled;\n observability.event({\n identityId: getTelemetryIdentifier(client),\n name: `${options.namespace}.observability.toggle`,\n properties: {\n enabled: settings.enabled,\n },\n });\n observability.setMode(settings.enabled ? 'basic' : 'disabled');\n await storeObservabilityDisabled(options.namespace, !settings.enabled);\n return { data: settings.enabled };\n\n case ObservabilityAction.SEND_EVENT: {\n const data = intent.data as EventOptions;\n const event = {\n identityId: getTelemetryIdentifier(client),\n name: `${options.namespace}.${data.name}`,\n properties: {\n ...data.properties,\n },\n };\n observability.event(event);\n return { data: event };\n }\n\n case ObservabilityAction.CAPTURE_USER_FEEDBACK: {\n const feedback = intent.data as UserFeedback;\n\n observability.captureUserFeedback(feedback.email, feedback.name, feedback.message);\n return { data: true };\n }\n }\n },\n },\n observability: state.values,\n settings,\n surface: {\n component: ({ role, data }) => {\n switch (role) {\n case 'settings':\n return data.plugin === meta.id ? <ObservabilitySettings settings={settings} /> : null;\n }\n\n return null;\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { parseIntentPlugin, useResolvePlugin } from '@dxos/app-framework';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { OBSERVABILITY_PLUGIN, ObservabilityAction } from '../meta';\n\nexport type ObservabilitySettingsProps = {\n enabled?: boolean;\n // TODO(wittjosiah): Separate settings for each observability feature.\n // metrics?: boolean;\n // telemetry?: boolean;\n // errors?: boolean;\n};\n\nexport const ObservabilitySettings = ({ settings }: { settings: ObservabilitySettingsProps }) => {\n const { t } = useTranslation(OBSERVABILITY_PLUGIN);\n const intentPlugin = useResolvePlugin(parseIntentPlugin);\n\n return (\n <>\n {intentPlugin && (\n <DeprecatedFormInput\n label={t('observability enabled label')}\n secondary={\n <Message.Root valence='info'>\n <Message.Body>{t('observability description')}</Message.Body>\n </Message.Root>\n }\n >\n <Input.Switch\n checked={settings.enabled}\n onCheckedChange={(checked) =>\n intentPlugin.provides.intent.dispatch({\n plugin: OBSERVABILITY_PLUGIN,\n action: ObservabilityAction.TOGGLE,\n data: { state: !!checked },\n })\n }\n />\n </DeprecatedFormInput>\n )}\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { OBSERVABILITY_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [OBSERVABILITY_PLUGIN]: {\n 'plugin name': 'Telemetry',\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 be sent to the DXOS team in order 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 },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ObservabilityPlugin } from './ObservabilityPlugin';\n\nexport default ObservabilityPlugin;\n\nexport * from './ObservabilityPlugin';\n"],
|
|
5
|
+
"mappings":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;UACF;QACF;MACF;MACAjD,eAAeM,MAAMU;MACrBZ;MACA0G,SAAS;QACPC,WAAW,CAAC,EAAEC,MAAM/D,KAAI,MAAE;AACxB,kBAAQ+D,MAAAA;YACN,KAAK;AACH,qBAAO/D,KAAKnD,WAAWa,aAAKyC,KAAK,gBAAA6D,OAAA,cAACC,uBAAAA;gBAAsB9G;mBAAyB;UACrF;AAEA,iBAAO;QACT;MACF;MACAkD;IACF;EACF;AACF;;;AGtNA,IAAA,cAAe6D;",
|
|
6
|
+
"names": ["React", "resolvePlugin", "parseIntentPlugin", "LayoutAction", "SettingsAction", "parsePluginHost", "EventSubscriptions", "create", "LocalStorageStore", "getTelemetryIdentifier", "setupTelemetryListeners", "isObservabilityDisabled", "storeObservabilityDisabled", "getObservabilityGroup", "parseClientPlugin", "React", "parseIntentPlugin", "useResolvePlugin", "Input", "Message", "useTranslation", "DeprecatedFormInput", "ObservabilitySettings", "settings", "t", "useTranslation", "OBSERVABILITY_PLUGIN", "intentPlugin", "useResolvePlugin", "parseIntentPlugin", "DeprecatedFormInput", "label", "secondary", "Message", "Root", "valence", "Body", "Input", "Switch", "checked", "enabled", "onCheckedChange", "provides", "intent", "dispatch", "plugin", "action", "ObservabilityAction", "TOGGLE", "data", "state", "OBSERVABILITY_PLUGIN", "parseObservabilityPlugin", "plugin", "provides", "observability", "undefined", "ObservabilityPlugin", "options", "settings", "create", "state", "LocalStorageStore", "OBSERVABILITY_PLUGIN", "subscriptions", "EventSubscriptions", "meta", "initialize", "enabled", "isObservabilityDisabled", "namespace", "values", "group", "getObservabilityGroup", "prop", "key", "type", "bool", "allowUndefined", "ready", "plugins", "pluginHost", "resolvePlugin", "parsePluginHost", "clientPlugin", "parseClientPlugin", "intentPlugin", "parseIntentPlugin", "dispatch", "intent", "sendPrivacyNotice", "environment", "client", "config", "runtime", "app", "env", "DX_ENVIRONMENT", "notify", "endsWith", "notified", "action", "LayoutAction", "SET_LAYOUT", "data", "element", "subject", "id", "title", "translations", "description", "duration", "Infinity", "icon", "actionLabel", "actionAlt", "closeLabel", "onAction", "SettingsAction", "OPEN", "then", "obs", "map", "setTag", "ObservabilityAction", "SEND_EVENT", "name", "properties", "href", "window", "location", "loadDuration", "performance", "timing", "loadEventEnd", "loadEventStart", "setupTelemetryListeners", "Promise", "all", "setIdentityTags", "services", "startRuntimeMetrics", "startNetworkMetrics", "startSpacesMetrics", "halo", "identity", "get", "subscription", "subscribe", "unsubscribe", "unload", "clear", "close", "resolver", "TOGGLE", "event", "identityId", "getTelemetryIdentifier", "setMode", "storeObservabilityDisabled", "CAPTURE_USER_FEEDBACK", "feedback", "captureUserFeedback", "email", "message", "surface", "component", "role", "React", "ObservabilitySettings", "ObservabilityPlugin"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytes":2301,"imports":[],"format":"esm"},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytes":5054,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-observability/src/components/index.ts":{"bytes":553,"imports":[{"path":"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx","kind":"import-statement","original":"./ObservabilitySettings"}],"format":"esm"},"packages/plugins/plugin-observability/src/translations.ts":{"bytes":3430,"imports":[{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx":{"bytes":28755,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-observability/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-observability/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-observability/src/index.ts":{"bytes":869,"imports":[{"path":"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx","kind":"import-statement","original":"./ObservabilityPlugin"},{"path":"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx","kind":"import-statement","original":"./ObservabilityPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-observability/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18437},"packages/plugins/plugin-observability/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-UVEE3XZO.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["ObservabilityPlugin","default","parseObservabilityPlugin"],"entryPoint":"packages/plugins/plugin-observability/src/index.ts","inputs":{"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx":{"bytesInOutput":6919},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytesInOutput":1065},"packages/plugins/plugin-observability/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-observability/src/translations.ts":{"bytesInOutput":1031},"packages/plugins/plugin-observability/src/index.ts":{"bytesInOutput":39}},"bytes":9711},"packages/plugins/plugin-observability/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-observability/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-UVEE3XZO.mjs","kind":"import-statement"}],"exports":["OBSERVABILITY_PLUGIN","ObservabilityAction","default"],"entryPoint":"packages/plugins/plugin-observability/src/meta.ts","inputs":{},"bytes":313},"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-UVEE3XZO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1051},"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-UVEE3XZO.mjs":{"imports":[],"exports":["OBSERVABILITY_PLUGIN","ObservabilityAction","meta_default"],"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytesInOutput":664}},"bytes":929}}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
OBSERVABILITY_PLUGIN,
|
|
4
|
+
ObservabilityAction,
|
|
5
|
+
meta_default
|
|
6
|
+
} from "./chunk-UVEE3XZO.mjs";
|
|
7
|
+
export {
|
|
8
|
+
OBSERVABILITY_PLUGIN,
|
|
9
|
+
ObservabilityAction,
|
|
10
|
+
meta_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=meta.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-observability",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2-main.f1adc9f",
|
|
4
4
|
"description": "DXOS app framework plugin for hooking up app observability",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/types/src/index.d.ts",
|
|
13
|
-
"browser": "./dist/lib/browser/index.mjs"
|
|
13
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
14
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
14
15
|
},
|
|
15
16
|
"./meta": {
|
|
16
17
|
"types": "./dist/types/src/meta.d.ts",
|
|
17
|
-
"browser": "./dist/lib/browser/meta.mjs"
|
|
18
|
+
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
|
+
"node": "./dist/lib/node-esm/meta.mjs"
|
|
18
20
|
}
|
|
19
21
|
},
|
|
20
22
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -32,33 +34,33 @@
|
|
|
32
34
|
"dependencies": {
|
|
33
35
|
"@preact/signals-core": "^1.6.0",
|
|
34
36
|
"localforage": "^1.10.0",
|
|
35
|
-
"@dxos/app-framework": "0.7.
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/echo-schema": "0.7.
|
|
39
|
-
"@dxos/local-storage": "0.7.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/plugin-client": "0.7.
|
|
43
|
-
"@dxos/protocols": "0.7.
|
|
44
|
-
"@dxos/react-client": "0.7.
|
|
45
|
-
"@dxos/react-ui-form": "0.7.
|
|
46
|
-
"@dxos/util": "0.7.
|
|
37
|
+
"@dxos/app-framework": "0.7.2-main.f1adc9f",
|
|
38
|
+
"@dxos/async": "0.7.2-main.f1adc9f",
|
|
39
|
+
"@dxos/context": "0.7.2-main.f1adc9f",
|
|
40
|
+
"@dxos/echo-schema": "0.7.2-main.f1adc9f",
|
|
41
|
+
"@dxos/local-storage": "0.7.2-main.f1adc9f",
|
|
42
|
+
"@dxos/log": "0.7.2-main.f1adc9f",
|
|
43
|
+
"@dxos/observability": "0.7.2-main.f1adc9f",
|
|
44
|
+
"@dxos/plugin-client": "0.7.2-main.f1adc9f",
|
|
45
|
+
"@dxos/protocols": "0.7.2-main.f1adc9f",
|
|
46
|
+
"@dxos/react-client": "0.7.2-main.f1adc9f",
|
|
47
|
+
"@dxos/react-ui-form": "0.7.2-main.f1adc9f",
|
|
48
|
+
"@dxos/util": "0.7.2-main.f1adc9f"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
51
|
"@phosphor-icons/react": "^2.1.5",
|
|
50
52
|
"@types/react": "~18.2.0",
|
|
51
53
|
"react": "~18.2.0",
|
|
52
54
|
"vite": "5.4.7",
|
|
53
|
-
"@dxos/react-ui
|
|
54
|
-
"@dxos/react-ui": "0.7.
|
|
55
|
-
"@dxos/storybook-utils": "0.7.
|
|
55
|
+
"@dxos/react-ui": "0.7.2-main.f1adc9f",
|
|
56
|
+
"@dxos/react-ui-theme": "0.7.2-main.f1adc9f",
|
|
57
|
+
"@dxos/storybook-utils": "0.7.2-main.f1adc9f"
|
|
56
58
|
},
|
|
57
59
|
"peerDependencies": {
|
|
58
60
|
"@phosphor-icons/react": "^2.1.5",
|
|
59
61
|
"react": "~18.2.0",
|
|
60
|
-
"@dxos/react-ui": "0.7.
|
|
61
|
-
"@dxos/react-ui-theme": "0.7.
|
|
62
|
+
"@dxos/react-ui": "0.7.2-main.f1adc9f",
|
|
63
|
+
"@dxos/react-ui-theme": "0.7.2-main.f1adc9f"
|
|
62
64
|
},
|
|
63
65
|
"publishConfig": {
|
|
64
66
|
"access": "public"
|