@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,58 @@
1
+ import {
2
+ OBSERVABILITY_PLUGIN
3
+ } from "./chunk-X6XUBXZQ.mjs";
4
+
5
+ // packages/plugins/plugin-observability/src/types.ts
6
+ import { S } from "@dxos/echo-schema";
7
+ var Email = S.String.pipe(S.nonEmptyString({
8
+ message: () => "Email is required."
9
+ }), S.pattern(/^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i, {
10
+ message: () => "Invalid email address."
11
+ }));
12
+ var nonEmpty = (field) => S.nonEmptyString({
13
+ message: () => `${field} is required.`
14
+ });
15
+ var maxLength = (field, length) => S.maxLength(length, {
16
+ message: () => `${field} is too long.`
17
+ });
18
+ var UserFeedback = S.Struct({
19
+ name: S.String.pipe(nonEmpty("Name"), maxLength("Name", 256)),
20
+ email: Email.pipe(maxLength("Email", 256)),
21
+ message: S.String.pipe(nonEmpty("Feedback"), maxLength("Feedback", 32768))
22
+ });
23
+ var OBSERVABILITY_ACTION = `${OBSERVABILITY_PLUGIN}/action`;
24
+ var ObservabilityAction;
25
+ (function(ObservabilityAction2) {
26
+ class Toggle extends S.TaggedClass()(`${OBSERVABILITY_ACTION}/toggle`, {
27
+ input: S.Struct({
28
+ state: S.optional(S.Boolean)
29
+ }),
30
+ output: S.Boolean
31
+ }) {
32
+ }
33
+ ObservabilityAction2.Toggle = Toggle;
34
+ class SendEvent extends S.TaggedClass()(`${OBSERVABILITY_ACTION}/send-event`, {
35
+ input: S.Struct({
36
+ name: S.String,
37
+ properties: S.optional(S.Object),
38
+ installationId: S.optional(S.String),
39
+ identityId: S.optional(S.String),
40
+ timestamp: S.optional(S.Date)
41
+ }),
42
+ output: S.Void
43
+ }) {
44
+ }
45
+ ObservabilityAction2.SendEvent = SendEvent;
46
+ class CaptureUserFeedback extends S.TaggedClass()(`${OBSERVABILITY_ACTION}/capture-feedback`, {
47
+ input: UserFeedback,
48
+ output: S.Void
49
+ }) {
50
+ }
51
+ ObservabilityAction2.CaptureUserFeedback = CaptureUserFeedback;
52
+ })(ObservabilityAction || (ObservabilityAction = {}));
53
+
54
+ export {
55
+ UserFeedback,
56
+ ObservabilityAction
57
+ };
58
+ //# sourceMappingURL=chunk-UBDF6N5K.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,12 @@
1
+ // packages/plugins/plugin-observability/src/meta.ts
2
+ var OBSERVABILITY_PLUGIN = "dxos.org/plugin/observability";
3
+ var meta_default = {
4
+ id: OBSERVABILITY_PLUGIN,
5
+ name: "Telemetry"
6
+ };
7
+
8
+ export {
9
+ OBSERVABILITY_PLUGIN,
10
+ meta_default
11
+ };
12
+ //# sourceMappingURL=chunk-X6XUBXZQ.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,40 +1,38 @@
1
+ import {
2
+ ObservabilityAction
3
+ } from "./chunk-UBDF6N5K.mjs";
1
4
  import {
2
5
  OBSERVABILITY_PLUGIN,
3
- ObservabilityAction,
4
6
  meta_default
5
- } from "./chunk-FO5EMZZO.mjs";
7
+ } from "./chunk-X6XUBXZQ.mjs";
6
8
 
7
9
  // packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
8
10
  import React2 from "react";
9
- import { resolvePlugin, parseIntentPlugin as parseIntentPlugin2, LayoutAction, SettingsAction, parsePluginHost } from "@dxos/app-framework";
11
+ import { resolvePlugin, parseIntentPlugin, LayoutAction, SettingsAction, createSurface, findPlugin, createIntent as createIntent2, createResolver } from "@dxos/app-framework";
10
12
  import { EventSubscriptions } from "@dxos/async";
13
+ import { invariant } from "@dxos/invariant";
11
14
  import { create } from "@dxos/live-object";
12
15
  import { LocalStorageStore } from "@dxos/local-storage";
13
16
  import { getTelemetryIdentifier, setupTelemetryListeners, isObservabilityDisabled, storeObservabilityDisabled, getObservabilityGroup } from "@dxos/observability";
14
- import { parseClientPlugin } from "@dxos/plugin-client";
15
17
 
16
18
  // packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx
17
19
  import React from "react";
18
- import { parseIntentPlugin, useResolvePlugin } from "@dxos/app-framework";
20
+ import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
19
21
  import { Input, Message, useTranslation } from "@dxos/react-ui";
20
22
  import { DeprecatedFormInput } from "@dxos/react-ui-form";
21
23
  var ObservabilitySettings = ({ settings }) => {
22
24
  const { t } = useTranslation(OBSERVABILITY_PLUGIN);
23
- const intentPlugin = useResolvePlugin(parseIntentPlugin);
24
- return /* @__PURE__ */ React.createElement(React.Fragment, null, intentPlugin && /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
25
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
26
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
25
27
  label: t("observability enabled label"),
26
28
  secondary: /* @__PURE__ */ React.createElement(Message.Root, {
27
29
  valence: "info"
28
30
  }, /* @__PURE__ */ React.createElement(Message.Body, null, t("observability description")))
29
31
  }, /* @__PURE__ */ React.createElement(Input.Switch, {
30
32
  checked: settings.enabled,
31
- onCheckedChange: (checked) => intentPlugin.provides.intent.dispatch({
32
- plugin: OBSERVABILITY_PLUGIN,
33
- action: ObservabilityAction.TOGGLE,
34
- data: {
35
- state: !!checked
36
- }
37
- })
33
+ onCheckedChange: (checked) => dispatch(createIntent(ObservabilityAction.Toggle, {
34
+ state: !!checked
35
+ }))
38
36
  })));
39
37
  };
40
38
 
@@ -58,6 +56,7 @@ var translations_default = [
58
56
  ];
59
57
 
60
58
  // packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
59
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx";
61
60
  var parseObservabilityPlugin = (plugin) => (plugin?.provides).observability ? plugin : void 0;
62
61
  var ObservabilityPlugin = (options) => {
63
62
  const settings = create({});
@@ -76,62 +75,51 @@ var ObservabilityPlugin = (options) => {
76
75
  })
77
76
  });
78
77
  },
79
- ready: async (plugins) => {
80
- const pluginHost = resolvePlugin(plugins, parsePluginHost);
81
- const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
82
- const intentPlugin = resolvePlugin(plugins, parseIntentPlugin2);
83
- const dispatch = intentPlugin?.provides?.intent?.dispatch;
78
+ ready: async ({ plugins }) => {
79
+ const client = findPlugin(plugins, "dxos.org/plugin/client")?.provides.client;
80
+ const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);
81
+ const dispatch = intentPlugin?.provides?.intent?.dispatchPromise;
84
82
  if (!dispatch) {
85
83
  return;
86
84
  }
87
85
  const sendPrivacyNotice = async () => {
88
- const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
86
+ const environment = client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
89
87
  const notify = environment && environment !== "ci" && !environment.endsWith(".local") && !environment.endsWith(".lan");
90
88
  if (!state.values.notified && notify) {
91
- await dispatch({
92
- action: LayoutAction.SET_LAYOUT,
93
- data: {
94
- element: "toast",
95
- subject: {
96
- id: `${OBSERVABILITY_PLUGIN}/notice`,
97
- // TODO(wittjosiah): Non-react translation utils.
98
- title: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast label"],
99
- description: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast description"],
100
- duration: Infinity,
101
- icon: "ph--info--regular",
102
- actionLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action label"],
103
- actionAlt: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action alt"],
104
- closeLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast close label"],
105
- onAction: () => dispatch({
106
- action: SettingsAction.OPEN,
107
- data: {
108
- plugin: OBSERVABILITY_PLUGIN
109
- }
110
- })
111
- }
89
+ await dispatch(createIntent2(LayoutAction.SetLayout, {
90
+ element: "toast",
91
+ subject: {
92
+ id: `${OBSERVABILITY_PLUGIN}/notice`,
93
+ // TODO(wittjosiah): Non-react translation utils.
94
+ title: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast label"],
95
+ description: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast description"],
96
+ duration: Infinity,
97
+ icon: "ph--info--regular",
98
+ actionLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action label"],
99
+ actionAlt: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action alt"],
100
+ closeLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast close label"],
101
+ onAction: () => dispatch(createIntent2(SettingsAction.Open, {
102
+ plugin: OBSERVABILITY_PLUGIN
103
+ }))
112
104
  }
113
- });
105
+ }));
114
106
  state.values.notified = true;
115
107
  }
116
108
  };
117
109
  void options.observability().then(async (obs) => {
118
110
  observability = obs;
119
- pluginHost?.provides?.plugins?.enabled?.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, "true", "errors"));
120
- const client = clientPlugin?.provides?.client;
111
+ plugins.map((plugin) => observability?.setTag(`pluginEnabled-${plugin.meta.id}`, "true", "errors"));
121
112
  if (!client) {
122
113
  return;
123
114
  }
124
- await dispatch({
125
- action: ObservabilityAction.SEND_EVENT,
126
- data: {
127
- name: "page.load",
128
- properties: {
129
- href: window.location.href,
130
- // TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?
131
- loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart
132
- }
115
+ await dispatch(createIntent2(ObservabilityAction.SendEvent, {
116
+ name: "page.load",
117
+ properties: {
118
+ href: window.location.href,
119
+ // TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?
120
+ loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart
133
121
  }
134
- });
122
+ }));
135
123
  setupTelemetryListeners(options.namespace, client, observability);
136
124
  await Promise.all([
137
125
  observability.setIdentityTags(client.services.services),
@@ -158,14 +146,23 @@ var ObservabilityPlugin = (options) => {
158
146
  },
159
147
  provides: {
160
148
  intent: {
161
- resolver: async (intent, plugins) => {
162
- const client = resolvePlugin(plugins, parseClientPlugin)?.provides?.client;
149
+ resolvers: ({ plugins }) => {
150
+ const client = findPlugin(plugins, "dxos.org/plugin/client")?.provides.client;
163
151
  if (!client || !observability) {
164
- return;
152
+ return [];
165
153
  }
166
- switch (intent.action) {
167
- case ObservabilityAction.TOGGLE:
168
- settings.enabled = !settings.enabled;
154
+ return [
155
+ createResolver(ObservabilityAction.Toggle, async ({ state: state2 }) => {
156
+ invariant(observability, "Observability instance not available", {
157
+ F: __dxlog_file,
158
+ L: 170,
159
+ S: void 0,
160
+ A: [
161
+ "observability",
162
+ "'Observability instance not available'"
163
+ ]
164
+ });
165
+ settings.enabled = state2 ?? !settings.enabled;
169
166
  observability.event({
170
167
  identityId: getTelemetryIdentifier(client),
171
168
  name: `${options.namespace}.observability.toggle`,
@@ -178,8 +175,17 @@ var ObservabilityPlugin = (options) => {
178
175
  return {
179
176
  data: settings.enabled
180
177
  };
181
- case ObservabilityAction.SEND_EVENT: {
182
- const data = intent.data;
178
+ }),
179
+ createResolver(ObservabilityAction.SendEvent, async (data) => {
180
+ invariant(observability, "Observability instance not available", {
181
+ F: __dxlog_file,
182
+ L: 184,
183
+ S: void 0,
184
+ A: [
185
+ "observability",
186
+ "'Observability instance not available'"
187
+ ]
188
+ });
183
189
  const event = {
184
190
  identityId: getTelemetryIdentifier(client),
185
191
  name: `${options.namespace}.${data.name}`,
@@ -188,32 +194,33 @@ var ObservabilityPlugin = (options) => {
188
194
  }
189
195
  };
190
196
  observability.event(event);
191
- return {
192
- data: event
193
- };
194
- }
195
- case ObservabilityAction.CAPTURE_USER_FEEDBACK: {
196
- const feedback = intent.data;
197
- observability.captureUserFeedback(feedback.email, feedback.name, feedback.message);
198
- return {
199
- data: true
200
- };
201
- }
202
- }
197
+ }),
198
+ createResolver(ObservabilityAction.CaptureUserFeedback, async (data) => {
199
+ invariant(observability, "Observability instance not available", {
200
+ F: __dxlog_file,
201
+ L: 195,
202
+ S: void 0,
203
+ A: [
204
+ "observability",
205
+ "'Observability instance not available'"
206
+ ]
207
+ });
208
+ observability.captureUserFeedback(data.email, data.name, data.message);
209
+ })
210
+ ];
203
211
  }
204
212
  },
205
213
  observability: state.values,
206
214
  settings,
207
215
  surface: {
208
- component: ({ role, data }) => {
209
- switch (role) {
210
- case "settings":
211
- return data.plugin === meta_default.id ? /* @__PURE__ */ React2.createElement(ObservabilitySettings, {
212
- settings
213
- }) : null;
214
- }
215
- return null;
216
- }
216
+ definitions: () => createSurface({
217
+ id: OBSERVABILITY_PLUGIN,
218
+ role: "settings",
219
+ filter: (data) => data.subject === OBSERVABILITY_PLUGIN,
220
+ component: () => /* @__PURE__ */ React2.createElement(ObservabilitySettings, {
221
+ settings
222
+ })
223
+ })
217
224
  },
218
225
  translations: translations_default
219
226
  }
@@ -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,wBACAC,yBACAC,yBACAC,4BACAC,6BACK;AAEP,SAASC,yBAAyB;;;AC3BlC,OAAOC,WAAW;AAElB,SAASC,mBAAmBC,wBAAwB;AACpD,SAASC,OAAOC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;;;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,mCACE;QACF,oCAAoC;QACpC,kCAAkC;QAClC,mCAAmC;QACnC,+BAA+B;;QAE/B,6BACE;MACJ;IACF;EACF;;;;;AF8BK,IAAMC,2BAA2B,CAACC,YAC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A,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/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18436},"packages/plugins/plugin-observability/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-FO5EMZZO.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":9619},"packages/plugins/plugin-observability/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-observability/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-FO5EMZZO.mjs","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/browser/chunk-FO5EMZZO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1049},"packages/plugins/plugin-observability/dist/lib/browser/chunk-FO5EMZZO.mjs":{"imports":[],"exports":["OBSERVABILITY_PLUGIN","ObservabilityAction","meta_default"],"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytesInOutput":664}},"bytes":836}}}
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/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18207},"packages/plugins/plugin-observability/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-UBDF6N5K.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-X6XUBXZQ.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":10192},"packages/plugins/plugin-observability/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-observability/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-X6XUBXZQ.mjs","kind":"import-statement"}],"exports":["OBSERVABILITY_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-observability/src/meta.ts","inputs":{},"bytes":175},"packages/plugins/plugin-observability/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-observability/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-UBDF6N5K.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-X6XUBXZQ.mjs","kind":"import-statement"}],"exports":["ObservabilityAction","UserFeedback"],"entryPoint":"packages/plugins/plugin-observability/src/types.ts","inputs":{},"bytes":194},"packages/plugins/plugin-observability/dist/lib/browser/chunk-UBDF6N5K.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3575},"packages/plugins/plugin-observability/dist/lib/browser/chunk-UBDF6N5K.mjs":{"imports":[{"path":"packages/plugins/plugin-observability/dist/lib/browser/chunk-X6XUBXZQ.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":1871},"packages/plugins/plugin-observability/dist/lib/browser/chunk-X6XUBXZQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":478},"packages/plugins/plugin-observability/dist/lib/browser/chunk-X6XUBXZQ.mjs":{"imports":[],"exports":["OBSERVABILITY_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytesInOutput":132}},"bytes":281}}}
@@ -1,11 +1,9 @@
1
1
  import {
2
2
  OBSERVABILITY_PLUGIN,
3
- ObservabilityAction,
4
3
  meta_default
5
- } from "./chunk-FO5EMZZO.mjs";
4
+ } from "./chunk-X6XUBXZQ.mjs";
6
5
  export {
7
6
  OBSERVABILITY_PLUGIN,
8
- ObservabilityAction,
9
7
  meta_default as default
10
8
  };
11
9
  //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ ObservabilityAction,
3
+ UserFeedback
4
+ } from "./chunk-UBDF6N5K.mjs";
5
+ import "./chunk-X6XUBXZQ.mjs";
6
+ export {
7
+ ObservabilityAction,
8
+ UserFeedback
9
+ };
10
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }