@dxos/plugin-observability 0.8.3 → 0.8.4-main.f9ba587

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 (79) hide show
  1. package/dist/lib/browser/{app-graph-builder-3ROXVPV2.mjs → app-graph-builder-DCOBBL5B.mjs} +3 -3
  2. package/dist/lib/browser/{chunk-RKH5BBR4.mjs → chunk-57RVSKYP.mjs} +2 -2
  3. package/dist/lib/browser/{chunk-P7VVCZOC.mjs → chunk-D7WLH4F5.mjs} +3 -3
  4. package/dist/lib/browser/{chunk-NYBEHHJN.mjs → chunk-N3VKS2LF.mjs} +6 -6
  5. package/dist/lib/browser/{chunk-BJ2ZWVOH.mjs → chunk-UUOBAWT2.mjs} +3 -3
  6. package/dist/lib/browser/{client-ready-LP3YSSAH.mjs → client-ready-KK3EWEBV.mjs} +5 -5
  7. package/dist/lib/browser/index.mjs +18 -18
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/{intent-resolver-JESDDMKB.mjs → intent-resolver-A4EV25OK.mjs} +6 -6
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/{react-surface-LVUG4XN3.mjs → react-surface-FUXMXVYO.mjs} +5 -5
  12. package/dist/lib/browser/{settings-V2DX26J3.mjs → settings-OSMKJOUM.mjs} +5 -5
  13. package/dist/lib/browser/{state-LG4FXJD2.mjs → state-VIOQS2IL.mjs} +4 -4
  14. package/dist/lib/browser/types.mjs +2 -2
  15. package/dist/lib/node-esm/{app-graph-builder-T7J46NSQ.mjs → app-graph-builder-6JT2RPVM.mjs} +3 -3
  16. package/dist/lib/node-esm/{chunk-S2MXYKCI.mjs → chunk-4BFWCQJ5.mjs} +3 -3
  17. package/dist/lib/node-esm/{chunk-KT5SDFBU.mjs → chunk-7XR7KMAA.mjs} +2 -2
  18. package/dist/lib/node-esm/{chunk-X2U2ZHWX.mjs → chunk-JTKEM7PT.mjs} +3 -3
  19. package/dist/lib/node-esm/{chunk-JJGRAKXD.mjs → chunk-RG73SOOD.mjs} +6 -6
  20. package/dist/lib/node-esm/{client-ready-FS62YRSD.mjs → client-ready-EZVAX7D5.mjs} +5 -5
  21. package/dist/lib/node-esm/index.mjs +18 -18
  22. package/dist/lib/node-esm/index.mjs.map +3 -3
  23. package/dist/lib/node-esm/{intent-resolver-MREOBMHB.mjs → intent-resolver-7HLSOM7X.mjs} +6 -6
  24. package/dist/lib/node-esm/meta.json +1 -1
  25. package/dist/lib/node-esm/{react-surface-B3JSZZAO.mjs → react-surface-TYVAHN2E.mjs} +5 -5
  26. package/dist/lib/node-esm/{settings-BFFR4CHU.mjs → settings-S2OXVO3G.mjs} +5 -5
  27. package/dist/lib/node-esm/{state-IZNXQ5RA.mjs → state-J2WS6L64.mjs} +4 -4
  28. package/dist/lib/node-esm/types.mjs +2 -2
  29. package/dist/types/src/translations.d.ts +19 -19
  30. package/dist/types/src/translations.d.ts.map +1 -1
  31. package/dist/types/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +26 -28
  33. package/src/ObservabilityPlugin.ts +1 -1
  34. package/src/translations.ts +6 -4
  35. package/dist/lib/node/app-graph-builder-EXZP366Q.cjs +0 -59
  36. package/dist/lib/node/app-graph-builder-EXZP366Q.cjs.map +0 -7
  37. package/dist/lib/node/chunk-2ERIOZP3.cjs +0 -36
  38. package/dist/lib/node/chunk-2ERIOZP3.cjs.map +0 -7
  39. package/dist/lib/node/chunk-B773OI2Y.cjs +0 -200
  40. package/dist/lib/node/chunk-B773OI2Y.cjs.map +0 -7
  41. package/dist/lib/node/chunk-HAIMXBCH.cjs +0 -38
  42. package/dist/lib/node/chunk-HAIMXBCH.cjs.map +0 -7
  43. package/dist/lib/node/chunk-UMH4JAVS.cjs +0 -199
  44. package/dist/lib/node/chunk-UMH4JAVS.cjs.map +0 -7
  45. package/dist/lib/node/client-ready-CTPKWHMP.cjs +0 -113
  46. package/dist/lib/node/client-ready-CTPKWHMP.cjs.map +0 -7
  47. package/dist/lib/node/index.cjs +0 -152
  48. package/dist/lib/node/index.cjs.map +0 -7
  49. package/dist/lib/node/intent-resolver-7G4GEUOA.cjs +0 -88
  50. package/dist/lib/node/intent-resolver-7G4GEUOA.cjs.map +0 -7
  51. package/dist/lib/node/meta.json +0 -1
  52. package/dist/lib/node/react-surface-CNFUEPBI.cjs +0 -55
  53. package/dist/lib/node/react-surface-CNFUEPBI.cjs.map +0 -7
  54. package/dist/lib/node/settings-RO5MXEQG.cjs +0 -39
  55. package/dist/lib/node/settings-RO5MXEQG.cjs.map +0 -7
  56. package/dist/lib/node/state-NXRP3P5D.cjs +0 -40
  57. package/dist/lib/node/state-NXRP3P5D.cjs.map +0 -7
  58. package/dist/lib/node/types.cjs +0 -32
  59. package/dist/lib/node/types.cjs.map +0 -7
  60. /package/dist/lib/browser/{app-graph-builder-3ROXVPV2.mjs.map → app-graph-builder-DCOBBL5B.mjs.map} +0 -0
  61. /package/dist/lib/browser/{chunk-RKH5BBR4.mjs.map → chunk-57RVSKYP.mjs.map} +0 -0
  62. /package/dist/lib/browser/{chunk-P7VVCZOC.mjs.map → chunk-D7WLH4F5.mjs.map} +0 -0
  63. /package/dist/lib/browser/{chunk-NYBEHHJN.mjs.map → chunk-N3VKS2LF.mjs.map} +0 -0
  64. /package/dist/lib/browser/{chunk-BJ2ZWVOH.mjs.map → chunk-UUOBAWT2.mjs.map} +0 -0
  65. /package/dist/lib/browser/{client-ready-LP3YSSAH.mjs.map → client-ready-KK3EWEBV.mjs.map} +0 -0
  66. /package/dist/lib/browser/{intent-resolver-JESDDMKB.mjs.map → intent-resolver-A4EV25OK.mjs.map} +0 -0
  67. /package/dist/lib/browser/{react-surface-LVUG4XN3.mjs.map → react-surface-FUXMXVYO.mjs.map} +0 -0
  68. /package/dist/lib/browser/{settings-V2DX26J3.mjs.map → settings-OSMKJOUM.mjs.map} +0 -0
  69. /package/dist/lib/browser/{state-LG4FXJD2.mjs.map → state-VIOQS2IL.mjs.map} +0 -0
  70. /package/dist/lib/node-esm/{app-graph-builder-T7J46NSQ.mjs.map → app-graph-builder-6JT2RPVM.mjs.map} +0 -0
  71. /package/dist/lib/node-esm/{chunk-S2MXYKCI.mjs.map → chunk-4BFWCQJ5.mjs.map} +0 -0
  72. /package/dist/lib/node-esm/{chunk-KT5SDFBU.mjs.map → chunk-7XR7KMAA.mjs.map} +0 -0
  73. /package/dist/lib/node-esm/{chunk-X2U2ZHWX.mjs.map → chunk-JTKEM7PT.mjs.map} +0 -0
  74. /package/dist/lib/node-esm/{chunk-JJGRAKXD.mjs.map → chunk-RG73SOOD.mjs.map} +0 -0
  75. /package/dist/lib/node-esm/{client-ready-FS62YRSD.mjs.map → client-ready-EZVAX7D5.mjs.map} +0 -0
  76. /package/dist/lib/node-esm/{intent-resolver-MREOBMHB.mjs.map → intent-resolver-7HLSOM7X.mjs.map} +0 -0
  77. /package/dist/lib/node-esm/{react-surface-B3JSZZAO.mjs.map → react-surface-TYVAHN2E.mjs.map} +0 -0
  78. /package/dist/lib/node-esm/{settings-BFFR4CHU.mjs.map → settings-S2OXVO3G.mjs.map} +0 -0
  79. /package/dist/lib/node-esm/{state-IZNXQ5RA.mjs.map → state-J2WS6L64.mjs.map} +0 -0
@@ -1,199 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_UMH4JAVS_exports = {};
20
- __export(chunk_UMH4JAVS_exports, {
21
- ObservabilityAction: () => ObservabilityAction,
22
- UserFeedback: () => UserFeedback
23
- });
24
- module.exports = __toCommonJS(chunk_UMH4JAVS_exports);
25
- var import_chunk_2ERIOZP3 = require("./chunk-2ERIOZP3.cjs");
26
- var import_effect = require("effect");
27
- var import_echo = require("@dxos/echo");
28
- var nonEmpty = (field) => import_effect.Schema.nonEmptyString({
29
- message: () => `Missing field: ${field}`
30
- });
31
- var maxLength = (field, length) => import_effect.Schema.maxLength(length, {
32
- message: () => `Exceeds max length (${length}): ${field}`
33
- });
34
- var UserFeedback = import_effect.Schema.Struct({
35
- message: import_effect.Schema.String.pipe(nonEmpty("Feedback"), maxLength("Feedback", 32768))
36
- });
37
- var OBSERVABILITY_ACTION = `${import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN}/action`;
38
- (function(ObservabilityAction2) {
39
- class Toggle extends import_effect.Schema.TaggedClass()(`${OBSERVABILITY_ACTION}/toggle`, {
40
- input: import_effect.Schema.Struct({
41
- state: import_effect.Schema.optional(import_effect.Schema.Boolean)
42
- }),
43
- output: import_effect.Schema.Boolean
44
- }) {
45
- }
46
- ObservabilityAction2.Toggle = Toggle;
47
- class CaptureUserFeedback extends import_effect.Schema.TaggedClass()(`${OBSERVABILITY_ACTION}/capture-feedback`, {
48
- input: UserFeedback,
49
- output: import_effect.Schema.Void
50
- }) {
51
- }
52
- ObservabilityAction2.CaptureUserFeedback = CaptureUserFeedback;
53
- class BaseSendEvent extends import_effect.Schema.TaggedClass()(`${OBSERVABILITY_ACTION}/send-event`, {
54
- input: import_effect.Schema.Struct({
55
- name: import_effect.Schema.String,
56
- properties: import_effect.Schema.optional(import_effect.Schema.Object)
57
- }),
58
- output: import_effect.Schema.Void
59
- }) {
60
- }
61
- ObservabilityAction2.BaseSendEvent = BaseSendEvent;
62
- class SendEvent extends import_effect.Schema.TaggedClass()(`${OBSERVABILITY_ACTION}/send-event`, {
63
- // NOTE: Sort alphabetically by name.
64
- input: import_effect.Schema.Union(import_effect.Schema.Struct({
65
- name: import_effect.Schema.Literal("identity.create")
66
- }), import_effect.Schema.Struct({
67
- name: import_effect.Schema.Literal("identity.join")
68
- }), import_effect.Schema.Struct({
69
- name: import_effect.Schema.Literal("identity.recover")
70
- }), import_effect.Schema.Struct({
71
- name: import_effect.Schema.Literal("identity.share")
72
- }), import_effect.Schema.Struct({
73
- name: import_effect.Schema.Literal("navigation.activate"),
74
- properties: import_effect.Schema.Struct({
75
- subjectId: import_effect.Schema.String,
76
- typename: import_effect.Schema.optional(import_effect.Schema.String)
77
- })
78
- }), import_effect.Schema.Struct({
79
- name: import_effect.Schema.Literal("page.load"),
80
- properties: import_effect.Schema.Struct({
81
- loadDuration: import_effect.Schema.Number
82
- })
83
- }), import_effect.Schema.Struct({
84
- name: import_effect.Schema.Literal("plugins.toggle"),
85
- properties: import_effect.Schema.Struct({
86
- plugin: import_effect.Schema.String,
87
- enabled: import_effect.Schema.Boolean
88
- })
89
- }), import_effect.Schema.Struct({
90
- name: import_effect.Schema.Literal("space.create"),
91
- properties: import_effect.Schema.Struct({
92
- spaceId: import_echo.Type.SpaceId
93
- })
94
- }), import_effect.Schema.Struct({
95
- name: import_effect.Schema.Literal("space.join"),
96
- properties: import_effect.Schema.Struct({
97
- spaceId: import_echo.Type.SpaceId
98
- })
99
- }), import_effect.Schema.Struct({
100
- name: import_effect.Schema.Literal("space.limit"),
101
- properties: import_effect.Schema.Struct({
102
- spaceId: import_echo.Type.SpaceId
103
- })
104
- }), import_effect.Schema.Struct({
105
- name: import_effect.Schema.Literal("space.lock"),
106
- properties: import_effect.Schema.Struct({
107
- spaceId: import_echo.Type.SpaceId
108
- })
109
- }), import_effect.Schema.Struct({
110
- name: import_effect.Schema.Literal("space.migrate"),
111
- properties: import_effect.Schema.Struct({
112
- spaceId: import_echo.Type.SpaceId,
113
- targetVersion: import_effect.Schema.optional(import_effect.Schema.String),
114
- version: import_effect.Schema.optional(import_effect.Schema.String)
115
- })
116
- }), import_effect.Schema.Struct({
117
- name: import_effect.Schema.Literal("space.object.add"),
118
- properties: import_effect.Schema.Struct({
119
- spaceId: import_echo.Type.SpaceId,
120
- objectId: import_effect.Schema.String,
121
- typename: import_effect.Schema.optional(import_effect.Schema.String)
122
- })
123
- }), import_effect.Schema.Struct({
124
- name: import_effect.Schema.Literal("space.share"),
125
- properties: import_effect.Schema.Struct({
126
- spaceId: import_echo.Type.SpaceId
127
- })
128
- }), import_effect.Schema.Struct({
129
- name: import_effect.Schema.Literal("space.unlock"),
130
- properties: import_effect.Schema.Struct({
131
- spaceId: import_echo.Type.SpaceId
132
- })
133
- }), import_effect.Schema.Struct({
134
- name: import_effect.Schema.Literal("threads.create"),
135
- properties: import_effect.Schema.Struct({
136
- spaceId: import_echo.Type.SpaceId,
137
- threadId: import_effect.Schema.String
138
- })
139
- }), import_effect.Schema.Struct({
140
- name: import_effect.Schema.Literal("threads.delete"),
141
- properties: import_effect.Schema.Struct({
142
- spaceId: import_echo.Type.SpaceId,
143
- threadId: import_effect.Schema.String
144
- })
145
- }), import_effect.Schema.Struct({
146
- name: import_effect.Schema.Literal("threads.message.add"),
147
- properties: import_effect.Schema.Struct({
148
- spaceId: import_echo.Type.SpaceId,
149
- threadId: import_effect.Schema.String,
150
- threadLength: import_effect.Schema.Number,
151
- messageId: import_effect.Schema.String,
152
- messageLength: import_effect.Schema.Number
153
- })
154
- }), import_effect.Schema.Struct({
155
- name: import_effect.Schema.Literal("threads.message.delete"),
156
- properties: import_effect.Schema.Struct({
157
- spaceId: import_echo.Type.SpaceId,
158
- threadId: import_effect.Schema.String,
159
- messageId: import_effect.Schema.String
160
- })
161
- }), import_effect.Schema.Struct({
162
- name: import_effect.Schema.Literal("threads.message.undo-delete"),
163
- properties: import_effect.Schema.Struct({
164
- spaceId: import_echo.Type.SpaceId,
165
- threadId: import_effect.Schema.String,
166
- messageId: import_effect.Schema.String
167
- })
168
- }), import_effect.Schema.Struct({
169
- name: import_effect.Schema.Literal("threads.message.update"),
170
- properties: import_effect.Schema.Struct({
171
- spaceId: import_echo.Type.SpaceId,
172
- messageId: import_effect.Schema.String,
173
- messageLength: import_effect.Schema.Number
174
- })
175
- }), import_effect.Schema.Struct({
176
- name: import_effect.Schema.Literal("threads.toggle-resolved"),
177
- properties: import_effect.Schema.Struct({
178
- spaceId: import_echo.Type.SpaceId,
179
- threadId: import_effect.Schema.String
180
- })
181
- }), import_effect.Schema.Struct({
182
- name: import_effect.Schema.Literal("threads.undo-delete"),
183
- properties: import_effect.Schema.Struct({
184
- spaceId: import_echo.Type.SpaceId,
185
- threadId: import_effect.Schema.String
186
- })
187
- })),
188
- output: import_effect.Schema.Void
189
- }) {
190
- }
191
- ObservabilityAction2.SendEvent = SendEvent;
192
- })(ObservabilityAction || (ObservabilityAction = {}));
193
- var ObservabilityAction;
194
- // Annotate the CommonJS export names for ESM import in node:
195
- 0 && (module.exports = {
196
- ObservabilityAction,
197
- UserFeedback
198
- });
199
- //# sourceMappingURL=chunk-UMH4JAVS.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\n\nimport { OBSERVABILITY_PLUGIN } from './meta';\n\nconst nonEmpty = <S extends Schema.Schema.Any>(field: string) =>\n Schema.nonEmptyString<S>({ message: () => `Missing field: ${field}` });\n\nconst maxLength = <S extends Schema.Schema.Any>(field: string, length: number) =>\n Schema.maxLength<S>(length, { message: () => `Exceeds max length (${length}): ${field}` });\n\nexport const UserFeedback = Schema.Struct({\n message: Schema.String.pipe(nonEmpty('Feedback'), maxLength('Feedback', 32_768)),\n});\n\nexport type UserFeedback = Schema.Schema.Type<typeof UserFeedback>;\n\nconst OBSERVABILITY_ACTION = `${OBSERVABILITY_PLUGIN}/action`;\n\nexport namespace ObservabilityAction {\n export class Toggle extends Schema.TaggedClass<Toggle>()(`${OBSERVABILITY_ACTION}/toggle`, {\n input: Schema.Struct({\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Boolean,\n }) {}\n\n export class CaptureUserFeedback extends Schema.TaggedClass<CaptureUserFeedback>()(\n `${OBSERVABILITY_ACTION}/capture-feedback`,\n {\n input: UserFeedback,\n output: Schema.Void,\n },\n ) {}\n\n /** Base intent for sending events. */\n export class BaseSendEvent extends Schema.TaggedClass<BaseSendEvent>()(`${OBSERVABILITY_ACTION}/send-event`, {\n input: Schema.Struct({\n name: Schema.String,\n properties: Schema.optional(Schema.Object),\n }),\n output: Schema.Void,\n }) {}\n\n /** Intent with strict types for first-party events. */\n export class SendEvent extends Schema.TaggedClass<SendEvent>()(`${OBSERVABILITY_ACTION}/send-event`, {\n // NOTE: Sort alphabetically by name.\n input: Schema.Union(\n Schema.Struct({\n name: Schema.Literal('identity.create'),\n }),\n Schema.Struct({\n name: Schema.Literal('identity.join'),\n }),\n Schema.Struct({\n name: Schema.Literal('identity.recover'),\n }),\n Schema.Struct({\n name: Schema.Literal('identity.share'),\n }),\n Schema.Struct({\n name: Schema.Literal('navigation.activate'),\n properties: Schema.Struct({\n subjectId: Schema.String,\n typename: Schema.optional(Schema.String),\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('page.load'),\n properties: Schema.Struct({\n loadDuration: Schema.Number,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('plugins.toggle'),\n properties: Schema.Struct({\n plugin: Schema.String,\n enabled: Schema.Boolean,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.create'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.join'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.limit'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.lock'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.migrate'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n targetVersion: Schema.optional(Schema.String),\n version: Schema.optional(Schema.String),\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.object.add'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n objectId: Schema.String,\n typename: Schema.optional(Schema.String),\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.share'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('space.unlock'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.create'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.delete'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.add'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n threadLength: Schema.Number,\n messageId: Schema.String,\n messageLength: Schema.Number,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.delete'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n messageId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.undo-delete'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n messageId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.message.update'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n messageId: Schema.String,\n messageLength: Schema.Number,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.toggle-resolved'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n }),\n }),\n Schema.Struct({\n name: Schema.Literal('threads.undo-delete'),\n properties: Schema.Struct({\n spaceId: Type.SpaceId,\n threadId: Schema.String,\n }),\n }),\n ),\n output: Schema.Void,\n }) {}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,kBAAqB;AAIrB,IAAMA,WAAW,CAA8BC,UAC7CC,qBAAOC,eAAkB;EAAEC,SAAS,MAAM,kBAAkBH,KAAAA;AAAQ,CAAA;AAEtE,IAAMI,YAAY,CAA8BJ,OAAeK,WAC7DJ,qBAAOG,UAAaC,QAAQ;EAAEF,SAAS,MAAM,uBAAuBE,MAAAA,MAAYL,KAAAA;AAAQ,CAAA;AAEnF,IAAMM,eAAeL,qBAAOM,OAAO;EACxCJ,SAASF,qBAAOO,OAAOC,KAAKV,SAAS,UAAA,GAAaK,UAAU,YAAY,KAAA,CAAA;AAC1E,CAAA;AAIA,IAAMM,uBAAuB,GAAGC,0CAAAA;UAEfC,sBAAAA;EACR,MAAMC,eAAeZ,qBAAOa,YAAW,EAAW,GAAGJ,oBAAAA,WAA+B;IACzFK,OAAOd,qBAAOM,OAAO;MACnBS,OAAOf,qBAAOgB,SAAShB,qBAAOiB,OAAO;IACvC,CAAA;IACAC,QAAQlB,qBAAOiB;EACjB,CAAA,EAAA;EAAI;uBALSL,SAAAA;EAON,MAAMO,4BAA4BnB,qBAAOa,YAAW,EACzD,GAAGJ,oBAAAA,qBACH;IACEK,OAAOT;IACPa,QAAQlB,qBAAOoB;EACjB,CAAA,EAAA;EACC;uBANUD,sBAAAA;EASN,MAAME,sBAAsBrB,qBAAOa,YAAW,EAAkB,GAAGJ,oBAAAA,eAAmC;IAC3GK,OAAOd,qBAAOM,OAAO;MACnBgB,MAAMtB,qBAAOO;MACbgB,YAAYvB,qBAAOgB,SAAShB,qBAAOwB,MAAM;IAC3C,CAAA;IACAN,QAAQlB,qBAAOoB;EACjB,CAAA,EAAA;EAAI;AAPgCT,uBACvBU,gBAAAA;EASN,MAAMI,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": ["nonEmpty", "field", "Schema", "nonEmptyString", "message", "maxLength", "length", "UserFeedback", "Struct", "String", "pipe", "OBSERVABILITY_ACTION", "OBSERVABILITY_PLUGIN", "ObservabilityAction", "Toggle", "TaggedClass", "input", "state", "optional", "Boolean", "output", "CaptureUserFeedback", "Void", "BaseSendEvent", "name", "properties", "Object", "SendEvent", "Union", "Literal", "subjectId", "typename", "loadDuration", "Number", "plugin", "enabled", "spaceId", "Type", "SpaceId", "targetVersion", "version", "objectId", "threadId", "threadLength", "messageId", "messageLength"]
7
- }
@@ -1,113 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var client_ready_CTPKWHMP_exports = {};
20
- __export(client_ready_CTPKWHMP_exports, {
21
- default: () => client_ready_default
22
- });
23
- module.exports = __toCommonJS(client_ready_CTPKWHMP_exports);
24
- var import_chunk_UMH4JAVS = require("./chunk-UMH4JAVS.cjs");
25
- var import_chunk_HAIMXBCH = require("./chunk-HAIMXBCH.cjs");
26
- var import_chunk_2ERIOZP3 = require("./chunk-2ERIOZP3.cjs");
27
- var import_app_framework = require("@dxos/app-framework");
28
- var import_observability = require("@dxos/observability");
29
- var client_ready_default = async ({ context, namespace, observability }) => {
30
- const manager = context.getCapability(import_app_framework.Capabilities.PluginManager);
31
- const { dispatchPromise: dispatch } = context.getCapability(import_app_framework.Capabilities.IntentDispatcher);
32
- const state = context.getCapability(import_chunk_HAIMXBCH.ObservabilityCapabilities.State);
33
- const client = context.getCapability(import_chunk_HAIMXBCH.ClientCapability);
34
- const sendPrivacyNotice = async () => {
35
- const environment = client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;
36
- const notify = environment && environment !== "ci" && !environment.endsWith(".local") && !environment.endsWith(".lan");
37
- if (!state.notified && notify) {
38
- await dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.AddToast, {
39
- part: "toast",
40
- subject: {
41
- id: `${import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN}/notice`,
42
- title: [
43
- "observability toast label",
44
- {
45
- ns: import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN
46
- }
47
- ],
48
- description: [
49
- "observability toast description",
50
- {
51
- ns: import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN
52
- }
53
- ],
54
- duration: Infinity,
55
- icon: "ph--info--regular",
56
- actionLabel: [
57
- "observability toast action label",
58
- {
59
- ns: import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN
60
- }
61
- ],
62
- actionAlt: [
63
- "observability toast action alt",
64
- {
65
- ns: import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN
66
- }
67
- ],
68
- closeLabel: [
69
- "observability toast close label",
70
- {
71
- ns: import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN
72
- }
73
- ],
74
- onAction: () => dispatch((0, import_app_framework.createIntent)(import_app_framework.SettingsAction.Open, {
75
- plugin: import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN
76
- }))
77
- }
78
- }));
79
- state.notified = true;
80
- }
81
- };
82
- manager.enabled.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, "true", "errors"));
83
- await dispatch((0, import_app_framework.createIntent)(import_chunk_UMH4JAVS.ObservabilityAction.SendEvent, {
84
- name: "page.load",
85
- properties: {
86
- // TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?
87
- loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart
88
- }
89
- }));
90
- const cleanup = (0, import_observability.setupTelemetryListeners)(namespace, client, observability);
91
- await Promise.all([
92
- observability.setIdentityTags(client.services.services),
93
- observability.startRuntimeMetrics(client),
94
- observability.startNetworkMetrics(client.services.services),
95
- observability.startSpacesMetrics(client, namespace)
96
- ]);
97
- if (client.halo.identity.get()) {
98
- await sendPrivacyNotice();
99
- } else {
100
- const subscription = client.halo.identity.subscribe(async (identity) => {
101
- if (identity && observability) {
102
- await sendPrivacyNotice();
103
- await observability.setIdentityTags(client.services.services);
104
- subscription.unsubscribe();
105
- }
106
- });
107
- }
108
- return (0, import_app_framework.contributes)(import_chunk_HAIMXBCH.ObservabilityCapabilities.Observability, observability, async () => {
109
- cleanup();
110
- await observability.close();
111
- });
112
- };
113
- //# sourceMappingURL=client-ready-CTPKWHMP.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/client-ready.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n LayoutAction,\n SettingsAction,\n type PluginContext,\n} from '@dxos/app-framework';\nimport { setupTelemetryListeners, type Observability } from '@dxos/observability';\n\nimport { ClientCapability, ObservabilityCapabilities } from './capabilities';\nimport { OBSERVABILITY_PLUGIN } from '../meta';\nimport { ObservabilityAction } from '../types';\n\ntype ClientReadyOptions = {\n context: PluginContext;\n namespace: string;\n observability: Observability;\n};\n\nexport default async ({ context, namespace, observability }: ClientReadyOptions) => {\n const manager = context.getCapability(Capabilities.PluginManager);\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(ObservabilityCapabilities.State);\n const client = context.getCapability(ClientCapability);\n\n const sendPrivacyNotice = async () => {\n const environment = client?.config?.values.runtime?.app?.env?.DX_ENVIRONMENT;\n const notify =\n environment && environment !== 'ci' && !environment.endsWith('.local') && !environment.endsWith('.lan');\n if (!state.notified && notify) {\n await dispatch(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${OBSERVABILITY_PLUGIN}/notice`,\n title: ['observability toast label', { ns: OBSERVABILITY_PLUGIN }],\n description: ['observability toast description', { ns: OBSERVABILITY_PLUGIN }],\n duration: Infinity,\n icon: 'ph--info--regular',\n actionLabel: ['observability toast action label', { ns: OBSERVABILITY_PLUGIN }],\n actionAlt: ['observability toast action alt', { ns: OBSERVABILITY_PLUGIN }],\n closeLabel: ['observability toast close label', { ns: OBSERVABILITY_PLUGIN }],\n onAction: () => dispatch(createIntent(SettingsAction.Open, { plugin: OBSERVABILITY_PLUGIN })),\n },\n }),\n );\n\n state.notified = true;\n }\n };\n\n // Ensure errors are tagged with enabled plugins to help with reproductions.\n manager.enabled.map((plugin) => observability?.setTag(`pluginEnabled-${plugin}`, 'true', 'errors'));\n\n await dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: 'page.load',\n properties: {\n // TODO(wittjosiah): These apis are deprecated. Is there a better way to find this information?\n loadDuration: window.performance.timing.loadEventEnd - window.performance.timing.loadEventStart,\n },\n }),\n );\n\n // Start client observability (i.e. not running as shared worker)\n // TODO(nf): how to prevent multiple instances for single shared worker?\n const cleanup = setupTelemetryListeners(namespace, client, observability);\n\n await Promise.all([\n observability.setIdentityTags(client.services.services),\n observability.startRuntimeMetrics(client),\n observability.startNetworkMetrics(client.services.services),\n observability.startSpacesMetrics(client, namespace),\n ]);\n\n if (client.halo.identity.get()) {\n await sendPrivacyNotice();\n } else {\n const subscription = client.halo.identity.subscribe(async (identity) => {\n if (identity && observability) {\n await sendPrivacyNotice();\n await observability.setIdentityTags(client.services.services);\n subscription.unsubscribe();\n }\n });\n }\n\n return contributes(ObservabilityCapabilities.Observability, observability, async () => {\n cleanup();\n await observability.close();\n });\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,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cC,OAAOC,YAAYC,OAAOC,eAAeH,OAAOC,YAAYC,OAAOE;IACnF;EACF,CAAA,CAAA;AAKF,QAAMC,cAAUC,8CAAwB3D,WAAWY,QAAQX,aAAAA;AAE3D,QAAM2D,QAAQC,IAAI;IAChB5D,cAAc6D,gBAAgBlD,OAAOmD,SAASA,QAAQ;IACtD9D,cAAc+D,oBAAoBpD,MAAAA;IAClCX,cAAcgE,oBAAoBrD,OAAOmD,SAASA,QAAQ;IAC1D9D,cAAciE,mBAAmBtD,QAAQZ,SAAAA;GAC1C;AAED,MAAIY,OAAOuD,KAAKC,SAASC,IAAG,GAAI;AAC9B,UAAMvD,kBAAAA;EACR,OAAO;AACL,UAAMwD,eAAe1D,OAAOuD,KAAKC,SAASG,UAAU,OAAOH,aAAAA;AACzD,UAAIA,YAAYnE,eAAe;AAC7B,cAAMa,kBAAAA;AACN,cAAMb,cAAc6D,gBAAgBlD,OAAOmD,SAASA,QAAQ;AAC5DO,qBAAaE,YAAW;MAC1B;IACF,CAAA;EACF;AAEA,aAAOC,kCAAY/D,gDAA0BgE,eAAezE,eAAe,YAAA;AACzEyD,YAAAA;AACA,UAAMzD,cAAc0E,MAAK;EAC3B,CAAA;AACF;",
6
- "names": ["context", "namespace", "observability", "manager", "getCapability", "Capabilities", "PluginManager", "dispatchPromise", "dispatch", "IntentDispatcher", "state", "ObservabilityCapabilities", "State", "client", "ClientCapability", "sendPrivacyNotice", "environment", "config", "values", "runtime", "app", "env", "DX_ENVIRONMENT", "notify", "endsWith", "notified", "createIntent", "LayoutAction", "AddToast", "part", "subject", "id", "OBSERVABILITY_PLUGIN", "title", "ns", "description", "duration", "Infinity", "icon", "actionLabel", "actionAlt", "closeLabel", "onAction", "SettingsAction", "Open", "plugin", "enabled", "map", "setTag", "ObservabilityAction", "SendEvent", "name", "properties", "loadDuration", "window", "performance", "timing", "loadEventEnd", "loadEventStart", "cleanup", "setupTelemetryListeners", "Promise", "all", "setIdentityTags", "services", "startRuntimeMetrics", "startNetworkMetrics", "startSpacesMetrics", "halo", "identity", "get", "subscription", "subscribe", "unsubscribe", "contributes", "Observability", "close"]
7
- }
@@ -1,152 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var node_exports = {};
30
- __export(node_exports, {
31
- FeedbackForm: () => import_chunk_B773OI2Y.FeedbackForm,
32
- HelpContainer: () => import_chunk_B773OI2Y.HelpContainer,
33
- OBSERVABILITY_PLUGIN: () => import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN,
34
- ObservabilityCapabilities: () => import_chunk_HAIMXBCH.ObservabilityCapabilities,
35
- ObservabilityEvents: () => ObservabilityEvents,
36
- ObservabilityPlugin: () => ObservabilityPlugin,
37
- ObservabilitySettings: () => import_chunk_B773OI2Y.ObservabilitySettings,
38
- ObservabilitySettingsSchema: () => import_chunk_B773OI2Y.ObservabilitySettingsSchema,
39
- meta: () => import_chunk_2ERIOZP3.meta
40
- });
41
- module.exports = __toCommonJS(node_exports);
42
- var import_chunk_B773OI2Y = require("./chunk-B773OI2Y.cjs");
43
- var import_chunk_UMH4JAVS = require("./chunk-UMH4JAVS.cjs");
44
- var import_chunk_HAIMXBCH = require("./chunk-HAIMXBCH.cjs");
45
- var import_chunk_2ERIOZP3 = require("./chunk-2ERIOZP3.cjs");
46
- var import_app_framework = require("@dxos/app-framework");
47
- var import_app_framework2 = require("@dxos/app-framework");
48
- var import_app_framework3 = require("@dxos/app-framework");
49
- var AppGraphBuilder = (0, import_app_framework.lazy)(() => import("./app-graph-builder-EXZP366Q.cjs"));
50
- var ClientReady = (0, import_app_framework.lazy)(() => import("./client-ready-CTPKWHMP.cjs"));
51
- var IntentResolver = (0, import_app_framework.lazy)(() => import("./intent-resolver-7G4GEUOA.cjs"));
52
- var ReactSurface = (0, import_app_framework.lazy)(() => import("./react-surface-CNFUEPBI.cjs"));
53
- var ObservabilitySettings2 = (0, import_app_framework.lazy)(() => import("./settings-RO5MXEQG.cjs"));
54
- var ObservabilityState = (0, import_app_framework.lazy)(() => import("./state-NXRP3P5D.cjs"));
55
- (function(ObservabilityEvents2) {
56
- ObservabilityEvents2.StateReady = import_app_framework2.Events.createStateEvent(import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN);
57
- })(ObservabilityEvents || (ObservabilityEvents = {}));
58
- var ClientReadyEvent = (0, import_app_framework2.defineEvent)("dxos.org/plugin/client/event/client-ready");
59
- var ObservabilityEvents;
60
- var translations_default = [
61
- {
62
- "en-US": {
63
- [import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN]: {
64
- "plugin name": "Telemetry",
65
- "observability toast label": "Privacy Notice",
66
- "observability toast description": "Composer collects usage and performance metrics to improve the product. No user data is collected.",
67
- "observability toast action label": "Settings",
68
- "observability toast action alt": "Open settings to learn more or to disable.",
69
- "observability toast close label": "Okay",
70
- "observability enabled label": "Enable telemetry",
71
- // TODO: Add link about telemetry privacy. Make it clearer that user data is not collected.
72
- "observability description": "When enabled, basic usage data will used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.",
73
- "help label": "Feedback & Support",
74
- "feedback text area label": "Feedback",
75
- "feedback text area placeholder": "Please enter your feedback, technical issue, or feature request.",
76
- "send feedback label": "Send Feedback",
77
- "feedback toast label": "Thank you for your feedback!",
78
- "feedback toast description": "We will review your feedback and get back to you as soon as possible."
79
- }
80
- }
81
- }
82
- ];
83
- var ObservabilityPlugin = (options) => (0, import_app_framework3.definePlugin)(import_chunk_2ERIOZP3.meta, [
84
- (0, import_app_framework3.defineModule)({
85
- id: `${import_chunk_2ERIOZP3.meta.id}/module/observability`,
86
- activatesOn: import_app_framework3.Events.Startup,
87
- activate: async () => (0, import_app_framework3.contributes)(import_chunk_HAIMXBCH.ObservabilityCapabilities.Observability, await options.observability())
88
- }),
89
- (0, import_app_framework3.defineModule)({
90
- id: `${import_chunk_2ERIOZP3.meta.id}/module/settings`,
91
- activatesOn: import_app_framework3.Events.SetupSettings,
92
- activate: ObservabilitySettings2
93
- }),
94
- (0, import_app_framework3.defineModule)({
95
- id: `${import_chunk_2ERIOZP3.meta.id}/module/state`,
96
- activatesOn: import_app_framework3.Events.Startup,
97
- activatesAfter: [
98
- ObservabilityEvents.StateReady
99
- ],
100
- activate: () => ObservabilityState({
101
- namespace: options.namespace
102
- })
103
- }),
104
- (0, import_app_framework3.defineModule)({
105
- id: `${import_chunk_2ERIOZP3.meta.id}/module/translations`,
106
- activatesOn: import_app_framework3.Events.SetupTranslations,
107
- activate: () => (0, import_app_framework3.contributes)(import_app_framework3.Capabilities.Translations, translations_default)
108
- }),
109
- (0, import_app_framework3.defineModule)({
110
- id: `${import_chunk_2ERIOZP3.meta.id}/module/intent-resolver`,
111
- activatesOn: import_app_framework3.Events.SetupIntentResolver,
112
- activate: (context) => IntentResolver({
113
- context,
114
- namespace: options.namespace
115
- })
116
- }),
117
- (0, import_app_framework3.defineModule)({
118
- id: `${import_chunk_2ERIOZP3.meta.id}/module/react-surface`,
119
- activatesOn: import_app_framework3.Events.SetupReactSurface,
120
- activate: ReactSurface
121
- }),
122
- (0, import_app_framework3.defineModule)({
123
- id: `${import_chunk_2ERIOZP3.meta.id}/module/app-graph-builder`,
124
- activatesOn: import_app_framework3.Events.SetupAppGraph,
125
- activate: AppGraphBuilder
126
- }),
127
- (0, import_app_framework3.defineModule)({
128
- id: `${import_chunk_2ERIOZP3.meta.id}/module/client-ready`,
129
- activatesOn: (0, import_app_framework3.allOf)(import_app_framework3.Events.DispatcherReady, ObservabilityEvents.StateReady, ClientReadyEvent),
130
- activate: async (context) => {
131
- const observability = await options.observability();
132
- return ClientReady({
133
- context,
134
- observability,
135
- namespace: options.namespace
136
- });
137
- }
138
- })
139
- ]);
140
- // Annotate the CommonJS export names for ESM import in node:
141
- 0 && (module.exports = {
142
- FeedbackForm,
143
- HelpContainer,
144
- OBSERVABILITY_PLUGIN,
145
- ObservabilityCapabilities,
146
- ObservabilityEvents,
147
- ObservabilityPlugin,
148
- ObservabilitySettings,
149
- ObservabilitySettingsSchema,
150
- meta
151
- });
152
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/index.ts", "../../../src/events.ts", "../../../src/ObservabilityPlugin.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ClientReady = lazy(() => import('./client-ready'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const ObservabilitySettings = lazy(() => import('./settings'));\nexport const ObservabilityState = lazy(() => import('./state'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent, Events } from '@dxos/app-framework';\n\nimport { OBSERVABILITY_PLUGIN } from './meta';\n\nexport namespace ObservabilityEvents {\n export const StateReady = Events.createStateEvent(OBSERVABILITY_PLUGIN);\n}\n\n// NOTE: This is cloned from the client plugin to avoid circular dependencies.\nexport const ClientReadyEvent = defineEvent('dxos.org/plugin/client/event/client-ready');\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { allOf, Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { type Observability } from '@dxos/observability';\n\nimport {\n AppGraphBuilder,\n ClientReady,\n IntentResolver,\n ObservabilityCapabilities,\n ObservabilitySettings,\n ObservabilityState,\n ReactSurface,\n} from './capabilities';\nimport { ObservabilityEvents, ClientReadyEvent } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const ObservabilityPlugin = (options: { namespace: string; observability: () => Promise<Observability> }) =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/observability`,\n activatesOn: Events.Startup,\n activate: async () => contributes(ObservabilityCapabilities.Observability, await options.observability()),\n }),\n defineModule({\n id: `${meta.id}/module/settings`,\n activatesOn: Events.SetupSettings,\n activate: ObservabilitySettings,\n }),\n defineModule({\n id: `${meta.id}/module/state`,\n activatesOn: Events.Startup,\n activatesAfter: [ObservabilityEvents.StateReady],\n activate: () => ObservabilityState({ namespace: options.namespace }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) => IntentResolver({ context, namespace: options.namespace }),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/client-ready`,\n activatesOn: allOf(Events.DispatcherReady, ObservabilityEvents.StateReady, ClientReadyEvent),\n activate: async (context) => {\n const observability = await options.observability();\n return ClientReady({ context, observability, namespace: options.namespace });\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 used to improve the product. This may include performance metrics, error logs, and usage data. No personally identifiable information, other than your public key, is included with this data and no private data ever leaves your devices.',\n\n 'help label': 'Feedback & Support',\n 'feedback text area label': 'Feedback',\n 'feedback text area placeholder': 'Please enter your feedback, technical issue, or feature request.',\n 'send feedback label': 'Send Feedback',\n 'feedback toast label': 'Thank you for your feedback!',\n 'feedback toast description': 'We will review your feedback and get back to you as soon as possible.',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAqB;ACArB,IAAAA,wBAAoC;ACApC,IAAAA,wBAAqF;AFE9E,IAAMC,sBAAkBC,2BAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,kBAAcD,2BAAK,MAAM,OAAO,6BAAA,CAAA;AACtC,IAAME,qBAAiBF,2BAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMG,mBAAeH,2BAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAMI,6BAAwBJ,2BAAK,MAAM,OAAO,yBAAA,CAAA;AAChD,IAAMK,yBA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Wd,QAAQc;IAAU,CAAA;EAChF,CAAA;MACAX,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaX,sBAAAA,OAAO2B;IACpBd,UAAUlB;EACZ,CAAA;MACAc,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaX,sBAAAA,OAAO4B;IACpBf,UAAUtB;EACZ,CAAA;MACAkB,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,iBAAakB,6BAAM7B,sBAAAA,OAAO8B,iBAAiBhC,oBAAoBC,YAAYI,gBAAAA;IAC3EU,UAAU,OAAOa,YAAAA;AACf,YAAMT,gBAAgB,MAAMX,QAAQW,cAAa;AACjD,aAAOxB,YAAY;QAAEiC;QAAST;QAAeG,WAAWd,QAAQc;MAAU,CAAA;IAC5E;EACF,CAAA;CACD;",
6
- "names": ["import_app_framework", "AppGraphBuilder", "lazy", "ClientReady", "IntentResolver", "ReactSurface", "ObservabilitySettings", "ObservabilityState", "ObservabilityEvents", "StateReady", "Events", "createStateEvent", "OBSERVABILITY_PLUGIN", "ClientReadyEvent", "defineEvent", "ObservabilityPlugin", "options", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Startup", "activate", "contributes", "ObservabilityCapabilities", "Observability", "observability", "SetupSettings", "activatesAfter", "namespace", "SetupTranslations", "Capabilities", "Translations", "translations", "SetupIntentResolver", "context", "SetupReactSurface", "SetupAppGraph", "allOf", "DispatcherReady"]
7
- }
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var intent_resolver_7G4GEUOA_exports = {};
20
- __export(intent_resolver_7G4GEUOA_exports, {
21
- default: () => intent_resolver_default
22
- });
23
- module.exports = __toCommonJS(intent_resolver_7G4GEUOA_exports);
24
- var import_chunk_UMH4JAVS = require("./chunk-UMH4JAVS.cjs");
25
- var import_chunk_HAIMXBCH = require("./chunk-HAIMXBCH.cjs");
26
- var import_chunk_2ERIOZP3 = require("./chunk-2ERIOZP3.cjs");
27
- var import_app_framework = require("@dxos/app-framework");
28
- var import_log = require("@dxos/log");
29
- var import_observability = require("@dxos/observability");
30
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-observability/src/capabilities/intent-resolver.ts";
31
- var intent_resolver_default = ({ context, namespace }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, [
32
- (0, import_app_framework.createResolver)({
33
- intent: import_app_framework.IntentAction.Track,
34
- resolve: (intent) => {
35
- import_log.log.info("intent", {
36
- intent
37
- }, {
38
- F: __dxlog_file,
39
- L: 19,
40
- S: void 0,
41
- C: (f, a) => f(...a)
42
- });
43
- }
44
- }),
45
- (0, import_app_framework.createResolver)({
46
- intent: import_chunk_UMH4JAVS.ObservabilityAction.Toggle,
47
- resolve: async ({ state }) => {
48
- const client = context.getCapability(import_chunk_HAIMXBCH.ClientCapability);
49
- const observability = context.getCapability(import_chunk_HAIMXBCH.ObservabilityCapabilities.Observability);
50
- const settings = context.getCapability(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_2ERIOZP3.OBSERVABILITY_PLUGIN).value;
51
- settings.enabled = state ?? !settings.enabled;
52
- observability.track({
53
- ...(0, import_observability.getTelemetryIdentity)(client),
54
- action: "observability.toggle",
55
- properties: {
56
- enabled: settings.enabled
57
- }
58
- });
59
- observability.setMode(settings.enabled ? "basic" : "disabled");
60
- await (0, import_observability.storeObservabilityDisabled)(namespace, !settings.enabled);
61
- return {
62
- data: settings.enabled
63
- };
64
- }
65
- }),
66
- (0, import_app_framework.createResolver)({
67
- intent: import_chunk_UMH4JAVS.ObservabilityAction.SendEvent,
68
- resolve: (data) => {
69
- const client = context.getCapability(import_chunk_HAIMXBCH.ClientCapability);
70
- const properties = "properties" in data ? data.properties : {};
71
- void context.waitForCapability(import_chunk_HAIMXBCH.ObservabilityCapabilities.Observability).then((observability) => {
72
- observability.track({
73
- ...(0, import_observability.getTelemetryIdentity)(client),
74
- action: data.name,
75
- properties
76
- });
77
- });
78
- }
79
- }),
80
- (0, import_app_framework.createResolver)({
81
- intent: import_chunk_UMH4JAVS.ObservabilityAction.CaptureUserFeedback,
82
- resolve: async (data) => {
83
- const observability = context.getCapability(import_chunk_HAIMXBCH.ObservabilityCapabilities.Observability);
84
- observability.captureUserFeedback(data.message);
85
- }
86
- })
87
- ]);
88
- //# sourceMappingURL=intent-resolver-7G4GEUOA.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver, IntentAction, type PluginContext } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { getTelemetryIdentity, storeObservabilityDisabled } from '@dxos/observability';\n\nimport { ClientCapability, ObservabilityCapabilities } from './capabilities';\nimport { type ObservabilitySettingsProps } from '../components';\nimport { OBSERVABILITY_PLUGIN } from '../meta';\nimport { ObservabilityAction } from '../types';\n\nexport default ({ context, namespace }: { context: PluginContext; namespace: string }) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: IntentAction.Track,\n resolve: (intent) => {\n log.info('intent', { intent });\n },\n }),\n createResolver({\n intent: ObservabilityAction.Toggle,\n resolve: async ({ state }) => {\n const client = context.getCapability(ClientCapability);\n const observability = context.getCapability(ObservabilityCapabilities.Observability);\n const settings = context\n .getCapability(Capabilities.SettingsStore)\n .getStore<ObservabilitySettingsProps>(OBSERVABILITY_PLUGIN)!.value;\n settings.enabled = state ?? !settings.enabled;\n observability.track({\n ...getTelemetryIdentity(client),\n action: 'observability.toggle',\n properties: {\n enabled: settings.enabled,\n },\n });\n observability.setMode(settings.enabled ? 'basic' : 'disabled');\n await storeObservabilityDisabled(namespace, !settings.enabled);\n return { data: settings.enabled };\n },\n }),\n createResolver({\n intent: ObservabilityAction.SendEvent,\n resolve: (data) => {\n const client = context.getCapability(ClientCapability);\n const properties = 'properties' in data ? data.properties : {};\n\n // NOTE: This is to ensure that events fired before observability is ready are still sent.\n // TODO(wittjosiah): If the intent dispatcher supports concurrent actions in the future,\n // then this could be awaited still rather than voiding.\n void context.waitForCapability(ObservabilityCapabilities.Observability).then((observability) => {\n observability.track({\n ...getTelemetryIdentity(client),\n action: data.name,\n properties,\n });\n });\n },\n }),\n createResolver({\n intent: ObservabilityAction.CaptureUserFeedback,\n resolve: async (data) => {\n const observability = context.getCapability(ObservabilityCapabilities.Observability);\n observability.captureUserFeedback(data.message);\n },\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA4F;AAC5F,iBAAoB;AACpB,2BAAiE;;AAOjE,IAAA,0BAAe,CAAC,EAAEA,SAASC,UAAS,UAClCC,kCAAYC,kCAAaC,gBAAgB;MACvCC,qCAAe;IACbC,QAAQC,kCAAaC;IACrBC,SAAS,CAACH,WAAAA;AACRI,qBAAIC,KAAK,UAAU;QAAEL;MAAO,GAAA;;;;;;IAC9B;EACF,CAAA;MACAD,qCAAe;IACbC,QAAQM,0CAAoBC;IAC5BJ,SAAS,OAAO,EAAEK,MAAK,MAAE;AACvB,YAAMC,SAASf,QAAQgB,cAAcC,sCAAAA;AACrC,YAAMC,gBAAgBlB,QAAQgB,cAAcG,gDAA0BC,aAAa;AACnF,YAAMC,WAAWrB,QACdgB,cAAcb,kCAAamB,aAAa,EACxCC,SAAqCC,0CAAAA,EAAuBC;AAC/DJ,eAASK,UAAUZ,SAAS,CAACO,SAASK;AACtCR,oBAAcS,MAAM;QAClB,OAAGC,2CAAqBb,MAAAA;QACxBc,QAAQ;QACRC,YAAY;UACVJ,SAASL,SAASK;QACpB;MACF,CAAA;AACAR,oBAAca,QAAQV,SAASK,UAAU,UAAU,UAAA;AACnD,gBAAMM,iDAA2B/B,WAAW,CAACoB,SAASK,OAAO;AAC7D,aAAO;QAAEO,MAAMZ,SAASK;MAAQ;IAClC;EACF,CAAA;MACArB,qCAAe;IACbC,QAAQM,0CAAoBsB;IAC5BzB,SAAS,CAACwB,SAAAA;AACR,YAAMlB,SAASf,QAAQgB,cAAcC,sCAAAA;AACrC,YAAMa,aAAa,gBAAgBG,OAAOA,KAAKH,aAAa,CAAC;AAK7D,WAAK9B,QAAQmC,kBAAkBhB,gDAA0BC,aAAa,EAAEgB,KAAK,CAAClB,kBAAAA;AAC5EA,sBAAcS,MAAM;UAClB,OAAGC,2CAAqBb,MAAAA;UACxBc,QAAQI,KAAKI;UACbP;QACF,CAAA;MACF,CAAA;IACF;EACF,CAAA;MACAzB,qCAAe;IACbC,QAAQM,0CAAoB0B;IAC5B7B,SAAS,OAAOwB,SAAAA;AACd,YAAMf,gBAAgBlB,QAAQgB,cAAcG,gDAA0BC,aAAa;AACnFF,oBAAcqB,oBAAoBN,KAAKO,OAAO;IAChD;EACF,CAAA;CACD;",
6
- "names": ["context", "namespace", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "IntentAction", "Track", "resolve", "log", "info", "ObservabilityAction", "Toggle", "state", "client", "getCapability", "ClientCapability", "observability", "ObservabilityCapabilities", "Observability", "settings", "SettingsStore", "getStore", "OBSERVABILITY_PLUGIN", "value", "enabled", "track", "getTelemetryIdentity", "action", "properties", "setMode", "storeObservabilityDisabled", "data", "SendEvent", "waitForCapability", "then", "name", "CaptureUserFeedback", "captureUserFeedback", "message"]
7
- }