@dxos/plugin-observability 0.7.4 → 0.7.5-main.937ce75

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.
Files changed (48) hide show
  1. package/dist/lib/browser/chunk-UBDF6N5K.mjs +58 -0
  2. package/dist/lib/browser/chunk-UBDF6N5K.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-X6XUBXZQ.mjs +12 -0
  4. package/dist/lib/browser/chunk-X6XUBXZQ.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +90 -83
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/meta.mjs +1 -3
  9. package/dist/lib/browser/types.mjs +10 -0
  10. package/dist/lib/browser/types.mjs.map +7 -0
  11. package/dist/lib/node/chunk-HZSRCP4I.cjs +78 -0
  12. package/dist/lib/node/chunk-HZSRCP4I.cjs.map +7 -0
  13. package/dist/lib/node/{chunk-RAB7T73W.cjs → chunk-SIUGGDNL.cjs} +4 -13
  14. package/dist/lib/node/chunk-SIUGGDNL.cjs.map +7 -0
  15. package/dist/lib/node/index.cjs +89 -83
  16. package/dist/lib/node/index.cjs.map +3 -3
  17. package/dist/lib/node/meta.cjs +4 -6
  18. package/dist/lib/node/meta.cjs.map +2 -2
  19. package/dist/lib/node/meta.json +1 -1
  20. package/dist/lib/node/types.cjs +32 -0
  21. package/dist/lib/node/types.cjs.map +7 -0
  22. package/dist/lib/node-esm/chunk-52FTHXHB.mjs +59 -0
  23. package/dist/lib/node-esm/chunk-52FTHXHB.mjs.map +7 -0
  24. package/dist/lib/node-esm/chunk-7GGPSKXN.mjs +14 -0
  25. package/dist/lib/node-esm/chunk-7GGPSKXN.mjs.map +7 -0
  26. package/dist/lib/node-esm/index.mjs +90 -83
  27. package/dist/lib/node-esm/index.mjs.map +3 -3
  28. package/dist/lib/node-esm/meta.json +1 -1
  29. package/dist/lib/node-esm/meta.mjs +1 -3
  30. package/dist/lib/node-esm/types.mjs +11 -0
  31. package/dist/lib/node-esm/types.mjs.map +7 -0
  32. package/dist/types/src/ObservabilityPlugin.d.ts.map +1 -1
  33. package/dist/types/src/components/ObservabilitySettings.d.ts.map +1 -1
  34. package/dist/types/src/meta.d.ts +0 -10
  35. package/dist/types/src/meta.d.ts.map +1 -1
  36. package/dist/types/src/types.d.ts +47 -0
  37. package/dist/types/src/types.d.ts.map +1 -0
  38. package/dist/types/tsconfig.tsbuildinfo +1 -0
  39. package/package.json +27 -19
  40. package/src/ObservabilityPlugin.tsx +45 -51
  41. package/src/components/ObservabilitySettings.tsx +17 -24
  42. package/src/meta.ts +0 -13
  43. package/src/types.ts +54 -0
  44. package/dist/lib/browser/chunk-FO5EMZZO.mjs +0 -20
  45. package/dist/lib/browser/chunk-FO5EMZZO.mjs.map +0 -7
  46. package/dist/lib/node/chunk-RAB7T73W.cjs.map +0 -7
  47. package/dist/lib/node-esm/chunk-UVEE3XZO.mjs +0 -22
  48. package/dist/lib/node-esm/chunk-UVEE3XZO.mjs.map +0 -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 types_exports = {};
20
+ __export(types_exports, {
21
+ ObservabilityAction: () => import_chunk_HZSRCP4I.ObservabilityAction,
22
+ UserFeedback: () => import_chunk_HZSRCP4I.UserFeedback
23
+ });
24
+ module.exports = __toCommonJS(types_exports);
25
+ var import_chunk_HZSRCP4I = require("./chunk-HZSRCP4I.cjs");
26
+ var import_chunk_SIUGGDNL = require("./chunk-SIUGGDNL.cjs");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ ObservabilityAction,
30
+ UserFeedback
31
+ });
32
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["types.cjs"],
4
+ "sourcesContent": ["import {\n ObservabilityAction,\n UserFeedback\n} from \"./chunk-HZSRCP4I.cjs\";\nimport \"./chunk-SIUGGDNL.cjs\";\nexport {\n ObservabilityAction,\n UserFeedback\n};\n//# sourceMappingURL=types.cjs.map\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;AACP,4BAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,59 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ OBSERVABILITY_PLUGIN
4
+ } from "./chunk-7GGPSKXN.mjs";
5
+
6
+ // packages/plugins/plugin-observability/src/types.ts
7
+ import { S } from "@dxos/echo-schema";
8
+ var Email = S.String.pipe(S.nonEmptyString({
9
+ message: () => "Email is required."
10
+ }), S.pattern(/^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i, {
11
+ message: () => "Invalid email address."
12
+ }));
13
+ var nonEmpty = (field) => S.nonEmptyString({
14
+ message: () => `${field} is required.`
15
+ });
16
+ var maxLength = (field, length) => S.maxLength(length, {
17
+ message: () => `${field} is too long.`
18
+ });
19
+ var UserFeedback = S.Struct({
20
+ name: S.String.pipe(nonEmpty("Name"), maxLength("Name", 256)),
21
+ email: Email.pipe(maxLength("Email", 256)),
22
+ message: S.String.pipe(nonEmpty("Feedback"), maxLength("Feedback", 32768))
23
+ });
24
+ var OBSERVABILITY_ACTION = `${OBSERVABILITY_PLUGIN}/action`;
25
+ var ObservabilityAction;
26
+ (function(ObservabilityAction2) {
27
+ class Toggle extends S.TaggedClass()(`${OBSERVABILITY_ACTION}/toggle`, {
28
+ input: S.Struct({
29
+ state: S.optional(S.Boolean)
30
+ }),
31
+ output: S.Boolean
32
+ }) {
33
+ }
34
+ ObservabilityAction2.Toggle = Toggle;
35
+ class SendEvent extends S.TaggedClass()(`${OBSERVABILITY_ACTION}/send-event`, {
36
+ input: S.Struct({
37
+ name: S.String,
38
+ properties: S.optional(S.Object),
39
+ installationId: S.optional(S.String),
40
+ identityId: S.optional(S.String),
41
+ timestamp: S.optional(S.Date)
42
+ }),
43
+ output: S.Void
44
+ }) {
45
+ }
46
+ ObservabilityAction2.SendEvent = SendEvent;
47
+ class CaptureUserFeedback extends S.TaggedClass()(`${OBSERVABILITY_ACTION}/capture-feedback`, {
48
+ input: UserFeedback,
49
+ output: S.Void
50
+ }) {
51
+ }
52
+ ObservabilityAction2.CaptureUserFeedback = CaptureUserFeedback;
53
+ })(ObservabilityAction || (ObservabilityAction = {}));
54
+
55
+ export {
56
+ UserFeedback,
57
+ ObservabilityAction
58
+ };
59
+ //# sourceMappingURL=chunk-52FTHXHB.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { OBSERVABILITY_PLUGIN } from './meta';\n\nconst Email = S.String.pipe(\n S.nonEmptyString({ message: () => 'Email is required.' }),\n S.pattern(/^(?!\\.)(?!.*\\.\\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\\.)+[A-Z]{2,}$/i, {\n message: () => 'Invalid email address.',\n }),\n);\n\nconst nonEmpty = (field: string) => S.nonEmptyString({ message: () => `${field} is required.` });\nconst maxLength = (field: string, length: number) => S.maxLength(length, { message: () => `${field} is too long.` });\n\nexport const UserFeedback = S.Struct({\n name: S.String.pipe(nonEmpty('Name'), maxLength('Name', 256)),\n email: Email.pipe(maxLength('Email', 256)),\n message: S.String.pipe(nonEmpty('Feedback'), maxLength('Feedback', 32_768)),\n});\n\nexport type UserFeedback = S.Schema.Type<typeof UserFeedback>;\n\nconst OBSERVABILITY_ACTION = `${OBSERVABILITY_PLUGIN}/action`;\nexport namespace ObservabilityAction {\n export class Toggle extends S.TaggedClass<Toggle>()(`${OBSERVABILITY_ACTION}/toggle`, {\n input: S.Struct({\n state: S.optional(S.Boolean),\n }),\n output: S.Boolean,\n }) {}\n\n export class SendEvent extends S.TaggedClass<SendEvent>()(`${OBSERVABILITY_ACTION}/send-event`, {\n input: S.Struct({\n name: S.String,\n properties: S.optional(S.Object),\n installationId: S.optional(S.String),\n identityId: S.optional(S.String),\n timestamp: S.optional(S.Date),\n }),\n output: S.Void,\n }) {}\n\n export class CaptureUserFeedback extends S.TaggedClass<CaptureUserFeedback>()(\n `${OBSERVABILITY_ACTION}/capture-feedback`,\n {\n input: UserFeedback,\n output: S.Void,\n },\n ) {}\n}\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,SAAS;AAIlB,IAAMC,QAAQC,EAAEC,OAAOC,KACrBF,EAAEG,eAAe;EAAEC,SAAS,MAAM;AAAqB,CAAA,GACvDJ,EAAEK,QAAQ,kFAAkF;EAC1FD,SAAS,MAAM;AACjB,CAAA,CAAA;AAGF,IAAME,WAAW,CAACC,UAAkBP,EAAEG,eAAe;EAAEC,SAAS,MAAM,GAAGG,KAAAA;AAAqB,CAAA;AAC9F,IAAMC,YAAY,CAACD,OAAeE,WAAmBT,EAAEQ,UAAUC,QAAQ;EAAEL,SAAS,MAAM,GAAGG,KAAAA;AAAqB,CAAA;AAE3G,IAAMG,eAAeV,EAAEW,OAAO;EACnCC,MAAMZ,EAAEC,OAAOC,KAAKI,SAAS,MAAA,GAASE,UAAU,QAAQ,GAAA,CAAA;EACxDK,OAAOd,MAAMG,KAAKM,UAAU,SAAS,GAAA,CAAA;EACrCJ,SAASJ,EAAEC,OAAOC,KAAKI,SAAS,UAAA,GAAaE,UAAU,YAAY,KAAA,CAAA;AACrE,CAAA;AAIA,IAAMM,uBAAuB,GAAGC,oBAAAA;;UACfC,sBAAAA;EACR,MAAMC,eAAejB,EAAEkB,YAAW,EAAW,GAAGJ,oBAAAA,WAA+B;IACpFK,OAAOnB,EAAEW,OAAO;MACdS,OAAOpB,EAAEqB,SAASrB,EAAEsB,OAAO;IAC7B,CAAA;IACAC,QAAQvB,EAAEsB;EACZ,CAAA,EAAA;EAAI;uBALSL,SAAAA;EAON,MAAMO,kBAAkBxB,EAAEkB,YAAW,EAAc,GAAGJ,oBAAAA,eAAmC;IAC9FK,OAAOnB,EAAEW,OAAO;MACdC,MAAMZ,EAAEC;MACRwB,YAAYzB,EAAEqB,SAASrB,EAAE0B,MAAM;MAC/BC,gBAAgB3B,EAAEqB,SAASrB,EAAEC,MAAM;MACnC2B,YAAY5B,EAAEqB,SAASrB,EAAEC,MAAM;MAC/B4B,WAAW7B,EAAEqB,SAASrB,EAAE8B,IAAI;IAC9B,CAAA;IACAP,QAAQvB,EAAE+B;EACZ,CAAA,EAAA;EAAI;uBATSP,YAAAA;EAWN,MAAMQ,4BAA4BhC,EAAEkB,YAAW,EACpD,GAAGJ,oBAAAA,qBACH;IACEK,OAAOT;IACPa,QAAQvB,EAAE+B;EACZ,CAAA,EAAA;EACC;uBANUC,sBAAAA;AAOf,GA1BiBhB,wBAAAA,sBAAAA,CAAAA,EAAAA;",
6
+ "names": ["S", "Email", "S", "String", "pipe", "nonEmptyString", "message", "pattern", "nonEmpty", "field", "maxLength", "length", "UserFeedback", "Struct", "name", "email", "OBSERVABILITY_ACTION", "OBSERVABILITY_PLUGIN", "ObservabilityAction", "Toggle", "TaggedClass", "input", "state", "optional", "Boolean", "output", "SendEvent", "properties", "Object", "installationId", "identityId", "timestamp", "Date", "Void", "CaptureUserFeedback"]
7
+ }
@@ -0,0 +1,14 @@
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
+
10
+ export {
11
+ OBSERVABILITY_PLUGIN,
12
+ meta_default
13
+ };
14
+ //# sourceMappingURL=chunk-7GGPSKXN.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"],
5
+ "mappings": ";;;AAMO,IAAMA,uBAAuB;AAEpC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;",
6
+ "names": ["OBSERVABILITY_PLUGIN", "id", "name"]
7
+ }
@@ -1,41 +1,39 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ ObservabilityAction
4
+ } from "./chunk-52FTHXHB.mjs";
2
5
  import {
3
6
  OBSERVABILITY_PLUGIN,
4
- ObservabilityAction,
5
7
  meta_default
6
- } from "./chunk-UVEE3XZO.mjs";
8
+ } from "./chunk-7GGPSKXN.mjs";
7
9
 
8
10
  // packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
9
11
  import React2 from "react";
10
- import { resolvePlugin, parseIntentPlugin as parseIntentPlugin2, LayoutAction, SettingsAction, parsePluginHost } from "@dxos/app-framework";
12
+ import { resolvePlugin, parseIntentPlugin, LayoutAction, SettingsAction, createSurface, findPlugin, createIntent as createIntent2, createResolver } from "@dxos/app-framework";
11
13
  import { EventSubscriptions } from "@dxos/async";
14
+ import { invariant } from "@dxos/invariant";
12
15
  import { create } from "@dxos/live-object";
13
16
  import { LocalStorageStore } from "@dxos/local-storage";
14
17
  import { getTelemetryIdentifier, setupTelemetryListeners, isObservabilityDisabled, storeObservabilityDisabled, getObservabilityGroup } from "@dxos/observability";
15
- import { parseClientPlugin } from "@dxos/plugin-client";
16
18
 
17
19
  // packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx
18
20
  import React from "react";
19
- import { parseIntentPlugin, useResolvePlugin } from "@dxos/app-framework";
21
+ import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
20
22
  import { Input, Message, useTranslation } from "@dxos/react-ui";
21
23
  import { DeprecatedFormInput } from "@dxos/react-ui-form";
22
24
  var ObservabilitySettings = ({ settings }) => {
23
25
  const { t } = useTranslation(OBSERVABILITY_PLUGIN);
24
- const intentPlugin = useResolvePlugin(parseIntentPlugin);
25
- return /* @__PURE__ */ React.createElement(React.Fragment, null, intentPlugin && /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
26
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
27
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
26
28
  label: t("observability enabled label"),
27
29
  secondary: /* @__PURE__ */ React.createElement(Message.Root, {
28
30
  valence: "info"
29
31
  }, /* @__PURE__ */ React.createElement(Message.Body, null, t("observability description")))
30
32
  }, /* @__PURE__ */ React.createElement(Input.Switch, {
31
33
  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
- })
34
+ onCheckedChange: (checked) => dispatch(createIntent(ObservabilityAction.Toggle, {
35
+ state: !!checked
36
+ }))
39
37
  })));
40
38
  };
41
39
 
@@ -59,6 +57,7 @@ var translations_default = [
59
57
  ];
60
58
 
61
59
  // packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
60
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx";
62
61
  var parseObservabilityPlugin = (plugin) => (plugin?.provides).observability ? plugin : void 0;
63
62
  var ObservabilityPlugin = (options) => {
64
63
  const settings = create({});
@@ -77,62 +76,51 @@ var ObservabilityPlugin = (options) => {
77
76
  })
78
77
  });
79
78
  },
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;
79
+ ready: async ({ plugins }) => {
80
+ const client = findPlugin(plugins, "dxos.org/plugin/client")?.provides.client;
81
+ const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);
82
+ const dispatch = intentPlugin?.provides?.intent?.dispatchPromise;
85
83
  if (!dispatch) {
86
84
  return;
87
85
  }
88
86
  const sendPrivacyNotice = async () => {
89
- const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
87
+ const environment = client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
90
88
  const notify = environment && environment !== "ci" && !environment.endsWith(".local") && !environment.endsWith(".lan");
91
89
  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
- }
90
+ await dispatch(createIntent2(LayoutAction.SetLayout, {
91
+ element: "toast",
92
+ subject: {
93
+ id: `${OBSERVABILITY_PLUGIN}/notice`,
94
+ // TODO(wittjosiah): Non-react translation utils.
95
+ title: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast label"],
96
+ description: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast description"],
97
+ duration: Infinity,
98
+ icon: "ph--info--regular",
99
+ actionLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action label"],
100
+ actionAlt: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action alt"],
101
+ closeLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast close label"],
102
+ onAction: () => dispatch(createIntent2(SettingsAction.Open, {
103
+ plugin: OBSERVABILITY_PLUGIN
104
+ }))
113
105
  }
114
- });
106
+ }));
115
107
  state.values.notified = true;
116
108
  }
117
109
  };
118
110
  void options.observability().then(async (obs) => {
119
111
  observability = obs;
120
- pluginHost?.provides?.plugins?.enabled?.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, "true", "errors"));
121
- const client = clientPlugin?.provides?.client;
112
+ plugins.map((plugin) => observability?.setTag(`pluginEnabled-${plugin.meta.id}`, "true", "errors"));
122
113
  if (!client) {
123
114
  return;
124
115
  }
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
- }
116
+ await dispatch(createIntent2(ObservabilityAction.SendEvent, {
117
+ name: "page.load",
118
+ properties: {
119
+ href: window.location.href,
120
+ // TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?
121
+ loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart
134
122
  }
135
- });
123
+ }));
136
124
  setupTelemetryListeners(options.namespace, client, observability);
137
125
  await Promise.all([
138
126
  observability.setIdentityTags(client.services.services),
@@ -159,14 +147,23 @@ var ObservabilityPlugin = (options) => {
159
147
  },
160
148
  provides: {
161
149
  intent: {
162
- resolver: async (intent, plugins) => {
163
- const client = resolvePlugin(plugins, parseClientPlugin)?.provides?.client;
150
+ resolvers: ({ plugins }) => {
151
+ const client = findPlugin(plugins, "dxos.org/plugin/client")?.provides.client;
164
152
  if (!client || !observability) {
165
- return;
153
+ return [];
166
154
  }
167
- switch (intent.action) {
168
- case ObservabilityAction.TOGGLE:
169
- settings.enabled = !settings.enabled;
155
+ return [
156
+ createResolver(ObservabilityAction.Toggle, async ({ state: state2 }) => {
157
+ invariant(observability, "Observability instance not available", {
158
+ F: __dxlog_file,
159
+ L: 170,
160
+ S: void 0,
161
+ A: [
162
+ "observability",
163
+ "'Observability instance not available'"
164
+ ]
165
+ });
166
+ settings.enabled = state2 ?? !settings.enabled;
170
167
  observability.event({
171
168
  identityId: getTelemetryIdentifier(client),
172
169
  name: `${options.namespace}.observability.toggle`,
@@ -179,8 +176,17 @@ var ObservabilityPlugin = (options) => {
179
176
  return {
180
177
  data: settings.enabled
181
178
  };
182
- case ObservabilityAction.SEND_EVENT: {
183
- const data = intent.data;
179
+ }),
180
+ createResolver(ObservabilityAction.SendEvent, async (data) => {
181
+ invariant(observability, "Observability instance not available", {
182
+ F: __dxlog_file,
183
+ L: 184,
184
+ S: void 0,
185
+ A: [
186
+ "observability",
187
+ "'Observability instance not available'"
188
+ ]
189
+ });
184
190
  const event = {
185
191
  identityId: getTelemetryIdentifier(client),
186
192
  name: `${options.namespace}.${data.name}`,
@@ -189,32 +195,33 @@ var ObservabilityPlugin = (options) => {
189
195
  }
190
196
  };
191
197
  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
- }
198
+ }),
199
+ createResolver(ObservabilityAction.CaptureUserFeedback, async (data) => {
200
+ invariant(observability, "Observability instance not available", {
201
+ F: __dxlog_file,
202
+ L: 195,
203
+ S: void 0,
204
+ A: [
205
+ "observability",
206
+ "'Observability instance not available'"
207
+ ]
208
+ });
209
+ observability.captureUserFeedback(data.email, data.name, data.message);
210
+ })
211
+ ];
204
212
  }
205
213
  },
206
214
  observability: state.values,
207
215
  settings,
208
216
  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
- }
217
+ definitions: () => createSurface({
218
+ id: OBSERVABILITY_PLUGIN,
219
+ role: "settings",
220
+ filter: (data) => data.subject === OBSERVABILITY_PLUGIN,
221
+ component: () => /* @__PURE__ */ React2.createElement(ObservabilitySettings, {
222
+ settings
223
+ })
224
+ })
218
225
  },
219
226
  translations: translations_default
220
227
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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/live-object';\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,OAAOA,YAAW;AAElB,SAOEC,eACAC,qBAAAA,oBACAC,cACAC,gBACAC,uBACK;AACP,SAASC,0BAA0B;AACnC,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAEEC,w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AKnD,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"]
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 createSurface,\n findPlugin,\n createIntent,\n createResolver,\n} from '@dxos/app-framework';\nimport { EventSubscriptions } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { create } from '@dxos/live-object';\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 Client } from '@dxos/react-client';\n\nimport { ObservabilitySettings, type ObservabilitySettingsProps } from './components';\nimport meta, { OBSERVABILITY_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ObservabilityAction } from './types';\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 client = findPlugin<{ client: Client }>(plugins, 'dxos.org/plugin/client')?.provides.client;\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n const dispatch = intentPlugin?.provides?.intent?.dispatchPromise;\n if (!dispatch) {\n return;\n }\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.values.notified && notify) {\n await dispatch(\n createIntent(LayoutAction.SetLayout, {\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(createIntent(SettingsAction.Open, { 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 plugins.map((plugin) => observability?.setTag(`pluginEnabled-${plugin.meta.id}`, 'true', 'errors'));\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 if (!client) {\n return;\n }\n\n await dispatch(\n createIntent(ObservabilityAction.SendEvent, {\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 resolvers: ({ plugins }) => {\n const client = findPlugin<{ client: Client }>(plugins, 'dxos.org/plugin/client')?.provides.client;\n if (!client || !observability) {\n return [];\n }\n\n return [\n createResolver(ObservabilityAction.Toggle, async ({ state }) => {\n invariant(observability, 'Observability instance not available');\n settings.enabled = state ?? !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 createResolver(ObservabilityAction.SendEvent, async (data) => {\n invariant(observability, 'Observability instance not available');\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 }),\n createResolver(ObservabilityAction.CaptureUserFeedback, async (data) => {\n invariant(observability, 'Observability instance not available');\n observability.captureUserFeedback(data.email, data.name, data.message);\n }),\n ];\n },\n },\n observability: state.values,\n settings,\n surface: {\n definitions: () =>\n createSurface({\n id: OBSERVABILITY_PLUGIN,\n role: 'settings',\n filter: (data): data is any => data.subject === OBSERVABILITY_PLUGIN,\n component: () => <ObservabilitySettings settings={settings} />,\n }),\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { OBSERVABILITY_PLUGIN } from '../meta';\nimport { ObservabilityAction } from '../types';\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 { dispatchPromise: dispatch } = useIntentDispatcher();\n\n return (\n <>\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) => dispatch(createIntent(ObservabilityAction.Toggle, { state: !!checked }))}\n />\n </DeprecatedFormInput>\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,OAAOA,YAAW;AAElB,SAOEC,eACAC,mBACAC,cACAC,gBACAC,eACAC,YACAC,gBAAAA,eACAC,sBACK;AACP,SAASC,0BAA0B;AACnC,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAEEC,wBACAC,yBACAC,yBACAC,4BACAC,6BACK;;;AC7BP,OAAOC,WAAW;AAElB,SAASC,cAAcC,2BAA2B;AAClD,SAASC,OAAOC,SAASC,sBAAsB;AAC/C,SAASC,2BAA2B;AAa7B,IAAMC,wBAAwB,CAAC,EAAEC,SAAQ,MAA4C;AAC1F,QAAM,EAAEC,EAAC,IAAKC,eAAeC,oBAAAA;AAC7B,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAACC,qBAAAA;IACCC,OAAOP,EAAE,6BAAA;IACTQ,WACE,sBAAA,cAACC,QAAQC,MAAI;MAACC,SAAQ;OACpB,sBAAA,cAACF,QAAQG,MAAI,MAAEZ,EAAE,2BAAA,CAAA,CAAA;KAIrB,sBAAA,cAACa,MAAMC,QAAM;IACXC,SAAShB,SAASiB;IAClBC,iBAAiB,CAACF,YAAYX,SAASc,aAAaC,oBAAoBC,QAAQ;MAAEC,OAAO,CAAC,CAACN;IAAQ,CAAA,CAAA;;AAK7G;;;ACpCA,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACO,oBAAAA,GAAuB;QACtB,eAAe;QACf,6BAA6B;QAC7B,m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AAcmG,MAAMA,KAAAA;YACtB,CAAA;YACAH,eAAe9B,oBAAoBuC,qBAAqB,OAAOD,SAAAA;AAC7DN,wBAAUlG,eAAe,wCAAA;;;;;;;;;AACzBA,4BAAc0G,oBAAoBF,KAAKG,OAAOH,KAAKpC,MAAMoC,KAAKI,OAAO;YACvE,CAAA;;QAEJ;MACF;MACA5G,eAAeM,MAAMU;MACrBZ;MACAyG,SAAS;QACPC,aAAa,MACXC,cAAc;UACZ9D,IAAIzC;UACJwG,MAAM;UACNC,QAAQ,CAACT,SAAsBA,KAAKxD,YAAYxC;UAChD0G,WAAW,MAAM,gBAAAC,OAAA,cAACC,uBAAAA;YAAsBhH;;QAC1C,CAAA;MACJ;MACA+C;IACF;EACF;AACF;;;AGhNA,IAAA,cAAekE;",
6
+ "names": ["React", "resolvePlugin", "parseIntentPlugin", "LayoutAction", "SettingsAction", "createSurface", "findPlugin", "createIntent", "createResolver", "EventSubscriptions", "invariant", "create", "LocalStorageStore", "getTelemetryIdentifier", "setupTelemetryListeners", "isObservabilityDisabled", "storeObservabilityDisabled", "getObservabilityGroup", "React", "createIntent", "useIntentDispatcher", "Input", "Message", "useTranslation", "DeprecatedFormInput", "ObservabilitySettings", "settings", "t", "useTranslation", "OBSERVABILITY_PLUGIN", "dispatchPromise", "dispatch", "useIntentDispatcher", "DeprecatedFormInput", "label", "secondary", "Message", "Root", "valence", "Body", "Input", "Switch", "checked", "enabled", "onCheckedChange", "createIntent", "ObservabilityAction", "Toggle", "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", "client", "findPlugin", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "dispatch", "intent", "dispatchPromise", "sendPrivacyNotice", "environment", "config", "runtime", "app", "env", "DX_ENVIRONMENT", "notify", "endsWith", "notified", "createIntent", "LayoutAction", "SetLayout", "element", "subject", "id", "title", "translations", "description", "duration", "Infinity", "icon", "actionLabel", "actionAlt", "closeLabel", "onAction", "SettingsAction", "Open", "then", "obs", "map", "setTag", "ObservabilityAction", "SendEvent", "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", "resolvers", "createResolver", "Toggle", "invariant", "event", "identityId", "getTelemetryIdentifier", "setMode", "storeObservabilityDisabled", "data", "CaptureUserFeedback", "captureUserFeedback", "email", "message", "surface", "definitions", "createSurface", "role", "filter", "component", "React", "ObservabilitySettings", "ObservabilityPlugin"]
7
7
  }
@@ -1 +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/live-object","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/live-object","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}}}
1
+ {"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytes":1009,"imports":[],"format":"esm"},"packages/plugins/plugin-observability/src/types.ts":{"bytes":6985,"imports":[{"path":"@dxos/echo-schema","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/ObservabilitySettings.tsx":{"bytes":4551,"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"},{"path":"packages/plugins/plugin-observability/src/types.ts","kind":"import-statement","original":"../types"}],"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":29319,"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/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","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"},{"path":"packages/plugins/plugin-observability/src/types.ts","kind":"import-statement","original":"./types"}],"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":18208},"packages/plugins/plugin-observability/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-52FTHXHB.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-7GGPSKXN.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/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","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":7557},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytesInOutput":961},"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":10284},"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-7GGPSKXN.mjs","kind":"import-statement"}],"exports":["OBSERVABILITY_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-observability/src/meta.ts","inputs":{},"bytes":267},"packages/plugins/plugin-observability/dist/lib/node-esm/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-observability/dist/lib/node-esm/types.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-52FTHXHB.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-7GGPSKXN.mjs","kind":"import-statement"}],"exports":["ObservabilityAction","UserFeedback"],"entryPoint":"packages/plugins/plugin-observability/src/types.ts","inputs":{},"bytes":286},"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-52FTHXHB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3576},"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-52FTHXHB.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-7GGPSKXN.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["ObservabilityAction","UserFeedback"],"inputs":{"packages/plugins/plugin-observability/src/types.ts":{"bytesInOutput":1658}},"bytes":1963},"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-7GGPSKXN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":480},"packages/plugins/plugin-observability/dist/lib/node-esm/chunk-7GGPSKXN.mjs":{"imports":[],"exports":["OBSERVABILITY_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytesInOutput":132}},"bytes":374}}}
@@ -1,12 +1,10 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  OBSERVABILITY_PLUGIN,
4
- ObservabilityAction,
5
4
  meta_default
6
- } from "./chunk-UVEE3XZO.mjs";
5
+ } from "./chunk-7GGPSKXN.mjs";
7
6
  export {
8
7
  OBSERVABILITY_PLUGIN,
9
- ObservabilityAction,
10
8
  meta_default as default
11
9
  };
12
10
  //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,11 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ ObservabilityAction,
4
+ UserFeedback
5
+ } from "./chunk-52FTHXHB.mjs";
6
+ import "./chunk-7GGPSKXN.mjs";
7
+ export {
8
+ ObservabilityAction,
9
+ UserFeedback
10
+ };
11
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ObservabilityPlugin.d.ts","sourceRoot":"","sources":["../../../src/ObservabilityPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAM1B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAItF,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,GAC9D,eAAe,GACf,gBAAgB,CAAC,0BAA0B,CAAC,GAC5C,oBAAoB,GAAG;IACrB,aAAa,EAAE,wBAAwB,CAAC;CACzC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,YAAa,MAAM,oDAC+C,CAAC;AAExG,eAAO,MAAM,mBAAmB,YAAa;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;CAC7C,KAAG,gBAAgB,CAAC,2BAA2B,CAqK/C,CAAC"}
1
+ {"version":3,"file":"ObservabilityPlugin.d.ts","sourceRoot":"","sources":["../../../src/ObservabilityPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAS1B,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAKtF,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,GAC9D,eAAe,GACf,gBAAgB,CAAC,0BAA0B,CAAC,GAC5C,oBAAoB,GAAG;IACrB,aAAa,EAAE,wBAAwB,CAAC;CACzC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,YAAa,MAAM,oDAC+C,CAAC;AAExG,eAAO,MAAM,mBAAmB,YAAa;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;CAC7C,KAAG,gBAAgB,CAAC,2BAA2B,CA2J/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ObservabilitySettings.d.ts","sourceRoot":"","sources":["../../../../src/components/ObservabilitySettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CAKnB,CAAC;AAEF,eAAO,MAAM,qBAAqB,iBAAkB;IAAE,QAAQ,EAAE,0BAA0B,CAAA;CAAE,sBA6B3F,CAAC"}
1
+ {"version":3,"file":"ObservabilitySettings.d.ts","sourceRoot":"","sources":["../../../../src/components/ObservabilitySettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CAKnB,CAAC;AAEF,eAAO,MAAM,qBAAqB,iBAAkB;IAAE,QAAQ,EAAE,0BAA0B,CAAA;CAAE,sBAqB3F,CAAC"}