@dxos/plugin-observability 0.6.11 → 0.6.12-main.2d19bf1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-2ENNFNHI.mjs → chunk-FO5EMZZO.mjs} +1 -1
- package/dist/lib/browser/chunk-FO5EMZZO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/types/src/ObservabilityPlugin.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/ObservabilityPlugin.tsx +2 -7
- package/src/meta.ts +3 -1
- package/dist/lib/browser/chunk-2ENNFNHI.mjs.map +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';\n\nexport default {\n id: OBSERVABILITY_PLUGIN,\n name: 'Telemetry',\n} satisfies PluginMeta;\n\nconst OBSERVABILITY_ACTION = 'dxos.org/plugin/observability';\nexport enum ObservabilityAction {\n TOGGLE = `${OBSERVABILITY_ACTION}/toggle`,\n SEND_EVENT = `${OBSERVABILITY_ACTION}/send-event`,\n CAPTURE_USER_FEEDBACK = `${OBSERVABILITY_ACTION}/capture-feedback`,\n}\n\nexport type UserFeedback = {\n name: string;\n email: string;\n message: string;\n};\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,uBAAuB;AAEpC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,uBAAuB;;UACjBC,sBAAAA;wDACD,GAAGD,oBAAAA,SAA6B,IAAA;4DAC5B,GAAGA,oBAAAA,aAAiC,IAAA;uEACzB,GAAGA,oBAAAA,mBAAuC,IAAA;GAHxDC,wBAAAA,sBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["OBSERVABILITY_PLUGIN", "id", "name", "OBSERVABILITY_ACTION", "ObservabilityAction"]
|
|
7
|
+
}
|
|
@@ -2,10 +2,9 @@ import {
|
|
|
2
2
|
OBSERVABILITY_PLUGIN,
|
|
3
3
|
ObservabilityAction,
|
|
4
4
|
meta_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FO5EMZZO.mjs";
|
|
6
6
|
|
|
7
7
|
// packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx
|
|
8
|
-
import { Info } from "@phosphor-icons/react";
|
|
9
8
|
import { effect } from "@preact/signals-core";
|
|
10
9
|
import React2 from "react";
|
|
11
10
|
import { resolvePlugin, parseIntentPlugin as parseIntentPlugin2, parseNavigationPlugin, LayoutAction, SettingsAction, parsePluginHost } from "@dxos/app-framework";
|
|
@@ -14,7 +13,6 @@ import { create } from "@dxos/echo-schema";
|
|
|
14
13
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
15
14
|
import { getTelemetryIdentifier, setupTelemetryListeners, isObservabilityDisabled, storeObservabilityDisabled, getObservabilityGroup } from "@dxos/observability";
|
|
16
15
|
import { parseClientPlugin } from "@dxos/plugin-client";
|
|
17
|
-
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
18
16
|
|
|
19
17
|
// packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx
|
|
20
18
|
import React from "react";
|
|
@@ -90,7 +88,7 @@ var ObservabilityPlugin = (options) => {
|
|
|
90
88
|
}
|
|
91
89
|
const sendPrivacyNotice = async () => {
|
|
92
90
|
const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
|
|
93
|
-
const notify = environment && environment !== "
|
|
91
|
+
const notify = environment && environment !== "ci" && !environment.endsWith(".local") && !environment.endsWith(".lan");
|
|
94
92
|
if (!state.values.notified && notify) {
|
|
95
93
|
await dispatch({
|
|
96
94
|
action: LayoutAction.SET_LAYOUT,
|
|
@@ -102,12 +100,7 @@ var ObservabilityPlugin = (options) => {
|
|
|
102
100
|
title: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast label"],
|
|
103
101
|
description: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast description"],
|
|
104
102
|
duration: Infinity,
|
|
105
|
-
icon:
|
|
106
|
-
className: mx(getSize(5), props.className),
|
|
107
|
-
weight: "duotone",
|
|
108
|
-
...props
|
|
109
|
-
}),
|
|
110
|
-
iconSymbol: "ph--info--duotone",
|
|
103
|
+
icon: "ph--info--regular",
|
|
111
104
|
actionLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action label"],
|
|
112
105
|
actionAlt: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast action alt"],
|
|
113
106
|
closeLabel: translations_default[0]["en-US"][OBSERVABILITY_PLUGIN]["observability toast close label"],
|
|
@@ -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 { type IconProps, Info } from '@phosphor-icons/react';\nimport { effect } from '@preact/signals-core';\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 parseNavigationPlugin,\n LayoutAction,\n SettingsAction,\n parsePluginHost,\n} from '@dxos/app-framework';\nimport { EventSubscriptions } from '@dxos/async';\nimport { create } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport {\n type Observability,\n getTelemetryIdentifier,\n setupTelemetryListeners,\n isObservabilityDisabled,\n storeObservabilityDisabled,\n getObservabilityGroup,\n} from '@dxos/observability';\nimport type { EventOptions } from '@dxos/observability/segment';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { getSize, mx } from '@dxos/react-ui-theme';\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 &\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\n state.prop({ key: 'notified', type: LocalStorageStore.bool({ allowUndefined: true }) });\n },\n ready: async (plugins) => {\n const pluginHost = resolvePlugin(plugins, parsePluginHost);\n const navigationPlugin = resolvePlugin(plugins, parseNavigationPlugin);\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 !== 'circleci' && !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: (props: IconProps) => (\n <Info className={mx(getSize(5), props.className)} weight='duotone' {...props} />\n ),\n iconSymbol: 'ph--info--duotone',\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 subscriptions.add(\n effect(() => {\n // Read active to subscribe to changes.\n const _ = navigationPlugin?.provides?.location?.active;\n\n observability?.page({\n identityId: getTelemetryIdentifier(client),\n });\n }),\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 { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\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 <SettingsValue\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 </SettingsValue>\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,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\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 parseNavigationPlugin,\n LayoutAction,\n SettingsAction,\n parsePluginHost,\n} from '@dxos/app-framework';\nimport { EventSubscriptions } from '@dxos/async';\nimport { create } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport {\n type Observability,\n getTelemetryIdentifier,\n setupTelemetryListeners,\n isObservabilityDisabled,\n storeObservabilityDisabled,\n getObservabilityGroup,\n} from '@dxos/observability';\nimport type { EventOptions } from '@dxos/observability/segment';\nimport { parseClientPlugin } from '@dxos/plugin-client';\n\nimport { ObservabilitySettings, type ObservabilitySettingsProps } from './components';\nimport meta, { OBSERVABILITY_PLUGIN, ObservabilityAction, type UserFeedback } from './meta';\nimport translations from './translations';\n\nexport type ObservabilityPluginState = {\n group?: string;\n notified?: boolean;\n};\n\nexport type ObservabilityPluginProvides = IntentResolverProvides &\n SurfaceProvides &\n SettingsProvides &\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\n state.prop({ key: 'notified', type: LocalStorageStore.bool({ allowUndefined: true }) });\n },\n ready: async (plugins) => {\n const pluginHost = resolvePlugin(plugins, parsePluginHost);\n const navigationPlugin = resolvePlugin(plugins, parseNavigationPlugin);\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 subscriptions.add(\n effect(() => {\n // Read active to subscribe to changes.\n const _ = navigationPlugin?.provides?.location?.active;\n\n observability?.page({\n identityId: getTelemetryIdentifier(client),\n });\n }),\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 { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, Message, useTranslation } from '@dxos/react-ui';\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 <SettingsValue\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 </SettingsValue>\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,SAASA,cAAc;AACvB,OAAOC,YAAW;AAElB,SAOEC,eACAC,qBAAAA,oBACAC,uBACAC,cACAC,gBACAC,uBACK;AACP,SAASC,0BAA0B;AACnC,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAEEC,wBACAC,yBACAC,yBACAC,4BACAC,6BACK;AAEP,SAASC,yBAAyB;;;AC7BlC,OAAOC,WAAW;AAElB,SAASC,mBAAmBC,wBAAwB;AACpD,SAASC,qBAAqB;AAC9B,SAASC,OAAOC,SAASC,sBAAsB;AAYxC,IAAMC,wBAAwB,CAAC,EAAEC,SAAQ,MAA4C;AAC1F,QAAM,EAAEC,EAAC,IAAKC,eAAeC,oBAAAA;AAC7B,QAAMC,eAAeC,iBAAiBC,iBAAAA;AAEtC,SACE,sBAAA,cAAA,MAAA,UAAA,MACGF,gBACC,sBAAA,cAACG,eAAAA;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,YAChBZ,aAAae,SAASC,OAAOC,SAAS;MACpCC,QAAQnB;MACRoB,QAAQC,oBAAoBC;MAC5BC,MAAM;QAAEC,OAAO,CAAC,CAACX;MAAQ;IAC3B,CAAA;;AAOd;;;AC3CA,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACY,oBAAAA,GAAuB;QACtB,eAAe;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AAQ;YAElC,KAAKkE,oBAAoBC,YAAY;AACnC,oBAAM7B,OAAOf,OAAOe;AACpB,oBAAM0D,QAAQ;gBACZhC,YAAYC,uBAAuBvC,MAAAA;gBACnC0C,MAAM,GAAG9E,QAAQY,SAAS,IAAIoC,KAAK8B,IAAI;gBACvCC,YAAY;kBACV,GAAG/B,KAAK+B;gBACV;cACF;AACAlF,4BAAc6G,MAAMA,KAAAA;AACpB,qBAAO;gBAAE1D,MAAM0D;cAAM;YACvB;YAEA,KAAK9B,oBAAoBiC,uBAAuB;AAC9C,oBAAMC,WAAW7E,OAAOe;AAExBnD,4BAAckH,oBAAoBD,SAASE,OAAOF,SAAShC,MAAMgC,SAASG,OAAO;AACjF,qBAAO;gBAAEjE,MAAM;cAAK;YACtB;UACF;QACF;MACF;MACAnD,eAAeM,MAAMU;MACrBZ;MACAiH,SAAS;QACPC,WAAW,CAAC,EAAEC,MAAMpE,KAAI,MAAE;AACxB,kBAAQoE,MAAAA;YACN,KAAK;AACH,qBAAOpE,KAAKrD,WAAWa,aAAK2C,KAAK,gBAAAkE,OAAA,cAACC,uBAAAA;gBAAsBrH;mBAAyB;UACrF;AAEA,iBAAO;QACT;MACF;MACAoD;IACF;EACF;AACF;;;AGrOA,IAAA,cAAekE;",
|
|
6
|
+
"names": ["effect", "React", "resolvePlugin", "parseIntentPlugin", "parseNavigationPlugin", "LayoutAction", "SettingsAction", "parsePluginHost", "EventSubscriptions", "create", "LocalStorageStore", "getTelemetryIdentifier", "setupTelemetryListeners", "isObservabilityDisabled", "storeObservabilityDisabled", "getObservabilityGroup", "parseClientPlugin", "React", "parseIntentPlugin", "useResolvePlugin", "SettingsValue", "Input", "Message", "useTranslation", "ObservabilitySettings", "settings", "t", "useTranslation", "OBSERVABILITY_PLUGIN", "intentPlugin", "useResolvePlugin", "parseIntentPlugin", "SettingsValue", "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", "navigationPlugin", "parseNavigationPlugin", "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", "add", "effect", "_", "location", "active", "page", "identityId", "getTelemetryIdentifier", "ObservabilityAction", "SEND_EVENT", "name", "properties", "href", "window", "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", "setMode", "storeObservabilityDisabled", "CAPTURE_USER_FEEDBACK", "feedback", "captureUserFeedback", "email", "message", "surface", "component", "role", "React", "ObservabilitySettings", "ObservabilityPlugin"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-observability/src/meta.ts":{"bytes":2301,"imports":[],"format":"esm"},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytes":5012,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","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":30258,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-observability/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-observability/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-observability/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-observability/src/index.ts":{"bytes":869,"imports":[{"path":"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx","kind":"import-statement","original":"./ObservabilityPlugin"},{"path":"packages/plugins/plugin-observability/src/ObservabilityPlugin.tsx","kind":"import-statement","original":"./ObservabilityPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-observability/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19184},"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":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/observability","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","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":7288},"packages/plugins/plugin-observability/src/components/ObservabilitySettings.tsx":{"bytesInOutput":1055},"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":9978},"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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservabilityPlugin.d.ts","sourceRoot":"","sources":["../../../src/ObservabilityPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ObservabilityPlugin.d.ts","sourceRoot":"","sources":["../../../src/ObservabilityPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAO1B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AAQ7B,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,GAChB,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,CAkL/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;;;;;AAEpE,wBAGuB;AAGvB,oBAAY,mBAAmB;IAC7B,MAAM,yCAAmC;IACzC,UAAU,6CAAuC;IACjD,qBAAqB,mDAA6C;CACnE;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-observability",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12-main.2d19bf1",
|
|
4
4
|
"description": "DXOS app framework plugin for hooking up app observability",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -31,33 +31,33 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@preact/signals-core": "^1.6.0",
|
|
33
33
|
"localforage": "^1.10.0",
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/echo-schema": "0.6.
|
|
37
|
-
"@dxos/local-storage": "0.6.
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/util": "0.6.
|
|
34
|
+
"@dxos/async": "0.6.12-main.2d19bf1",
|
|
35
|
+
"@dxos/app-framework": "0.6.12-main.2d19bf1",
|
|
36
|
+
"@dxos/echo-schema": "0.6.12-main.2d19bf1",
|
|
37
|
+
"@dxos/local-storage": "0.6.12-main.2d19bf1",
|
|
38
|
+
"@dxos/context": "0.6.12-main.2d19bf1",
|
|
39
|
+
"@dxos/plugin-client": "0.6.12-main.2d19bf1",
|
|
40
|
+
"@dxos/log": "0.6.12-main.2d19bf1",
|
|
41
|
+
"@dxos/observability": "0.6.12-main.2d19bf1",
|
|
42
|
+
"@dxos/plugin-settings": "0.6.12-main.2d19bf1",
|
|
43
|
+
"@dxos/protocols": "0.6.12-main.2d19bf1",
|
|
44
|
+
"@dxos/react-client": "0.6.12-main.2d19bf1",
|
|
45
|
+
"@dxos/util": "0.6.12-main.2d19bf1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@phosphor-icons/react": "^2.1.5",
|
|
49
49
|
"@types/react": "~18.2.0",
|
|
50
50
|
"react": "~18.2.0",
|
|
51
|
-
"vite": "
|
|
52
|
-
"@dxos/react-ui": "0.6.
|
|
53
|
-
"@dxos/react-ui-theme": "0.6.
|
|
54
|
-
"@dxos/storybook-utils": "0.6.
|
|
51
|
+
"vite": "5.4.7",
|
|
52
|
+
"@dxos/react-ui": "0.6.12-main.2d19bf1",
|
|
53
|
+
"@dxos/react-ui-theme": "0.6.12-main.2d19bf1",
|
|
54
|
+
"@dxos/storybook-utils": "0.6.12-main.2d19bf1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@phosphor-icons/react": "^2.1.5",
|
|
58
|
-
"react": "
|
|
59
|
-
"@dxos/react-ui": "0.6.
|
|
60
|
-
"@dxos/react-ui
|
|
58
|
+
"react": "~18.2.0",
|
|
59
|
+
"@dxos/react-ui-theme": "0.6.12-main.2d19bf1",
|
|
60
|
+
"@dxos/react-ui": "0.6.12-main.2d19bf1"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type IconProps, Info } from '@phosphor-icons/react';
|
|
6
5
|
import { effect } from '@preact/signals-core';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
@@ -33,7 +32,6 @@ import {
|
|
|
33
32
|
} from '@dxos/observability';
|
|
34
33
|
import type { EventOptions } from '@dxos/observability/segment';
|
|
35
34
|
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
36
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
37
35
|
|
|
38
36
|
import { ObservabilitySettings, type ObservabilitySettingsProps } from './components';
|
|
39
37
|
import meta, { OBSERVABILITY_PLUGIN, ObservabilityAction, type UserFeedback } from './meta';
|
|
@@ -85,7 +83,7 @@ export const ObservabilityPlugin = (options: {
|
|
|
85
83
|
const sendPrivacyNotice = async () => {
|
|
86
84
|
const environment = clientPlugin?.provides?.client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
|
|
87
85
|
const notify =
|
|
88
|
-
environment && environment !== '
|
|
86
|
+
environment && environment !== 'ci' && !environment.endsWith('.local') && !environment.endsWith('.lan');
|
|
89
87
|
if (!state.values.notified && notify) {
|
|
90
88
|
await dispatch({
|
|
91
89
|
action: LayoutAction.SET_LAYOUT,
|
|
@@ -97,10 +95,7 @@ export const ObservabilityPlugin = (options: {
|
|
|
97
95
|
title: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast label'],
|
|
98
96
|
description: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast description'],
|
|
99
97
|
duration: Infinity,
|
|
100
|
-
icon:
|
|
101
|
-
<Info className={mx(getSize(5), props.className)} weight='duotone' {...props} />
|
|
102
|
-
),
|
|
103
|
-
iconSymbol: 'ph--info--duotone',
|
|
98
|
+
icon: 'ph--info--regular',
|
|
104
99
|
actionLabel: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast action label'],
|
|
105
100
|
actionAlt: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast action alt'],
|
|
106
101
|
closeLabel: translations[0]['en-US'][OBSERVABILITY_PLUGIN]['observability toast close label'],
|
package/src/meta.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
+
|
|
5
7
|
export const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';
|
|
6
8
|
|
|
7
9
|
export default {
|
|
8
10
|
id: OBSERVABILITY_PLUGIN,
|
|
9
11
|
name: 'Telemetry',
|
|
10
|
-
};
|
|
12
|
+
} satisfies PluginMeta;
|
|
11
13
|
|
|
12
14
|
const OBSERVABILITY_ACTION = 'dxos.org/plugin/observability';
|
|
13
15
|
export enum ObservabilityAction {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport const OBSERVABILITY_PLUGIN = 'dxos.org/plugin/observability';\n\nexport default {\n id: OBSERVABILITY_PLUGIN,\n name: 'Telemetry',\n};\n\nconst OBSERVABILITY_ACTION = 'dxos.org/plugin/observability';\nexport enum ObservabilityAction {\n TOGGLE = `${OBSERVABILITY_ACTION}/toggle`,\n SEND_EVENT = `${OBSERVABILITY_ACTION}/send-event`,\n CAPTURE_USER_FEEDBACK = `${OBSERVABILITY_ACTION}/capture-feedback`,\n}\n\nexport type UserFeedback = {\n name: string;\n email: string;\n message: string;\n};\n"],
|
|
5
|
-
"mappings": ";AAIO,IAAMA,uBAAuB;AAEpC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;AAEA,IAAMC,uBAAuB;;UACjBC,sBAAAA;wDACD,GAAGD,oBAAAA,SAA6B,IAAA;4DAC5B,GAAGA,oBAAAA,aAAiC,IAAA;uEACzB,GAAGA,oBAAAA,mBAAuC,IAAA;GAHxDC,wBAAAA,sBAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["OBSERVABILITY_PLUGIN", "id", "name", "OBSERVABILITY_ACTION", "ObservabilityAction"]
|
|
7
|
-
}
|