@tappify/extension-sdk 2.0.0

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 (98) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunk-2DBSVKAU.cjs +65 -0
  3. package/dist/chunk-2DBSVKAU.cjs.map +1 -0
  4. package/dist/chunk-3YWVYA42.cjs +142 -0
  5. package/dist/chunk-3YWVYA42.cjs.map +1 -0
  6. package/dist/chunk-4C5Z3CIK.mjs +26 -0
  7. package/dist/chunk-4C5Z3CIK.mjs.map +1 -0
  8. package/dist/chunk-5AAPD5WV.cjs +250 -0
  9. package/dist/chunk-5AAPD5WV.cjs.map +1 -0
  10. package/dist/chunk-7KIKOH5H.cjs +26 -0
  11. package/dist/chunk-7KIKOH5H.cjs.map +1 -0
  12. package/dist/chunk-BDCX6LRQ.mjs +250 -0
  13. package/dist/chunk-BDCX6LRQ.mjs.map +1 -0
  14. package/dist/chunk-CSTYBKZC.mjs +65 -0
  15. package/dist/chunk-CSTYBKZC.mjs.map +1 -0
  16. package/dist/chunk-IGK2AP6J.mjs +142 -0
  17. package/dist/chunk-IGK2AP6J.mjs.map +1 -0
  18. package/dist/chunk-MNDVYPEP.mjs +302 -0
  19. package/dist/chunk-MNDVYPEP.mjs.map +1 -0
  20. package/dist/chunk-OPPYEA7F.cjs +33 -0
  21. package/dist/chunk-OPPYEA7F.cjs.map +1 -0
  22. package/dist/chunk-PYJMJF44.cjs +302 -0
  23. package/dist/chunk-PYJMJF44.cjs.map +1 -0
  24. package/dist/chunk-QHM7XNRK.mjs +33 -0
  25. package/dist/chunk-QHM7XNRK.mjs.map +1 -0
  26. package/dist/chunk-RMUWRESK.cjs +365 -0
  27. package/dist/chunk-RMUWRESK.cjs.map +1 -0
  28. package/dist/chunk-ZT35X7KL.mjs +365 -0
  29. package/dist/chunk-ZT35X7KL.mjs.map +1 -0
  30. package/dist/codegen.cjs +300 -0
  31. package/dist/codegen.cjs.map +1 -0
  32. package/dist/codegen.d.cts +432 -0
  33. package/dist/codegen.d.ts +432 -0
  34. package/dist/codegen.mjs +272 -0
  35. package/dist/codegen.mjs.map +1 -0
  36. package/dist/constants-DJ_KgZpN.d.cts +449 -0
  37. package/dist/constants-DJ_KgZpN.d.ts +449 -0
  38. package/dist/context-Dt6xh_5t.d.cts +30 -0
  39. package/dist/context-Ml7k_V14.d.ts +30 -0
  40. package/dist/errors-COsBh7kd.d.cts +88 -0
  41. package/dist/errors-COsBh7kd.d.ts +88 -0
  42. package/dist/handler-CZIlZ5vu.d.ts +227 -0
  43. package/dist/handler-kU9Jf36K.d.cts +227 -0
  44. package/dist/host.cjs +24 -0
  45. package/dist/host.cjs.map +1 -0
  46. package/dist/host.d.cts +24 -0
  47. package/dist/host.d.ts +24 -0
  48. package/dist/host.mjs +24 -0
  49. package/dist/host.mjs.map +1 -0
  50. package/dist/index.cjs +698 -0
  51. package/dist/index.cjs.map +1 -0
  52. package/dist/index.d.cts +1016 -0
  53. package/dist/index.d.ts +1016 -0
  54. package/dist/index.mjs +698 -0
  55. package/dist/index.mjs.map +1 -0
  56. package/dist/manifest.cjs +872 -0
  57. package/dist/manifest.cjs.map +1 -0
  58. package/dist/manifest.d.cts +432 -0
  59. package/dist/manifest.d.ts +432 -0
  60. package/dist/manifest.mjs +872 -0
  61. package/dist/manifest.mjs.map +1 -0
  62. package/dist/matchers-Cz93AK1n.d.cts +74 -0
  63. package/dist/matchers-Cz93AK1n.d.ts +74 -0
  64. package/dist/server.cjs +210 -0
  65. package/dist/server.cjs.map +1 -0
  66. package/dist/server.d.cts +243 -0
  67. package/dist/server.d.ts +243 -0
  68. package/dist/server.mjs +210 -0
  69. package/dist/server.mjs.map +1 -0
  70. package/dist/styles.css +367 -0
  71. package/dist/testing/index.cjs +887 -0
  72. package/dist/testing/index.cjs.map +1 -0
  73. package/dist/testing/index.d.cts +512 -0
  74. package/dist/testing/index.d.ts +512 -0
  75. package/dist/testing/index.mjs +887 -0
  76. package/dist/testing/index.mjs.map +1 -0
  77. package/dist/testing/jest.cjs +17 -0
  78. package/dist/testing/jest.cjs.map +1 -0
  79. package/dist/testing/jest.d.cts +12 -0
  80. package/dist/testing/jest.d.ts +12 -0
  81. package/dist/testing/jest.mjs +17 -0
  82. package/dist/testing/jest.mjs.map +1 -0
  83. package/dist/testing/vitest.cjs +15 -0
  84. package/dist/testing/vitest.cjs.map +1 -0
  85. package/dist/testing/vitest.d.cts +10 -0
  86. package/dist/testing/vitest.d.ts +10 -0
  87. package/dist/testing/vitest.mjs +15 -0
  88. package/dist/testing/vitest.mjs.map +1 -0
  89. package/dist/types-DDAGLpov.d.ts +715 -0
  90. package/dist/types-DrpQSv_2.d.cts +715 -0
  91. package/dist/vite.cjs +1344 -0
  92. package/dist/vite.cjs.map +1 -0
  93. package/dist/vite.d.cts +434 -0
  94. package/dist/vite.d.ts +434 -0
  95. package/dist/vite.mjs +1314 -0
  96. package/dist/vite.mjs.map +1 -0
  97. package/package.json +268 -0
  98. package/schema/extension-v2.json +1500 -0
@@ -0,0 +1,434 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ declare const SCOPES: readonly [{
4
+ readonly key: "ui:render";
5
+ readonly label: "Render UI";
6
+ readonly description: "Render the declared pages, tabs, widgets, row actions and settings panel, and open chat with a visible prompt";
7
+ readonly requiresSecurityReview: false;
8
+ readonly requiresJustification: false;
9
+ }, {
10
+ readonly key: "projects:read";
11
+ readonly label: "Read the project";
12
+ readonly description: "Project name, platforms and store identity";
13
+ readonly requiresSecurityReview: false;
14
+ readonly requiresJustification: false;
15
+ }, {
16
+ readonly key: "analytics:read";
17
+ readonly label: "Read analytics";
18
+ readonly description: "Downloads, impressions, page views and conversion series";
19
+ readonly requiresSecurityReview: false;
20
+ readonly requiresJustification: false;
21
+ }, {
22
+ readonly key: "store.metadata:read";
23
+ readonly label: "Read store metadata";
24
+ readonly description: "Listing metadata, keyword set and keyword positions";
25
+ readonly requiresSecurityReview: false;
26
+ readonly requiresJustification: false;
27
+ }, {
28
+ readonly key: "reviews:read";
29
+ readonly label: "Read store reviews";
30
+ readonly description: "Review text, ratings and replies";
31
+ readonly requiresSecurityReview: false;
32
+ readonly requiresJustification: false;
33
+ }, {
34
+ readonly key: "crashes:read";
35
+ readonly label: "Read crash data";
36
+ readonly description: "Crash-free rate and issue counts";
37
+ readonly requiresSecurityReview: false;
38
+ readonly requiresJustification: false;
39
+ }, {
40
+ readonly key: "revenue:read";
41
+ readonly label: "Read revenue";
42
+ readonly description: "MRR, revenue series and refund counts";
43
+ readonly requiresSecurityReview: false;
44
+ readonly requiresJustification: true;
45
+ }, {
46
+ readonly key: "metrics:write";
47
+ readonly label: "Write connector metrics";
48
+ readonly description: "Write the metrics this extension declares into the metrics store";
49
+ readonly requiresSecurityReview: false;
50
+ readonly requiresJustification: false;
51
+ }, {
52
+ readonly key: "alerts:write";
53
+ readonly label: "Raise alerts and banners";
54
+ readonly description: "Turn declared webhooks into alerts and banners, at most three a day per project";
55
+ readonly requiresSecurityReview: false;
56
+ readonly requiresJustification: true;
57
+ }, {
58
+ readonly key: "insights:write";
59
+ readonly label: "Post insights";
60
+ readonly description: "Post insights to Home and to chat";
61
+ readonly requiresSecurityReview: false;
62
+ readonly requiresJustification: true;
63
+ }, {
64
+ readonly key: "ai:tools";
65
+ readonly label: "Add assistant tools";
66
+ readonly description: "Offer tools and mentions to the assistant";
67
+ readonly requiresSecurityReview: false;
68
+ readonly requiresJustification: false;
69
+ }, {
70
+ readonly key: "ai:actions";
71
+ readonly label: "Run assistant actions";
72
+ readonly description: "Run declared actions, each behind the approval card";
73
+ readonly requiresSecurityReview: true;
74
+ readonly requiresJustification: true;
75
+ }, {
76
+ readonly key: "store.metadata:write";
77
+ readonly label: "Propose store metadata changes";
78
+ readonly description: "Propose listing changes through a Tappify approval";
79
+ readonly requiresSecurityReview: true;
80
+ readonly requiresJustification: true;
81
+ }, {
82
+ readonly key: "autopilot:trigger";
83
+ readonly label: "Trigger automated store actions";
84
+ readonly description: "Start automated store actions on the owner’s behalf";
85
+ readonly requiresSecurityReview: true;
86
+ readonly requiresJustification: true;
87
+ }, {
88
+ readonly key: "work:create";
89
+ readonly label: "Create work items";
90
+ readonly description: "Create issues, pages or messages in the vendor’s system";
91
+ readonly requiresSecurityReview: false;
92
+ readonly requiresJustification: true;
93
+ }, {
94
+ readonly key: "work:sync";
95
+ readonly label: "Sync work items";
96
+ readonly description: "Two-way comments and status on created work items";
97
+ readonly requiresSecurityReview: false;
98
+ readonly requiresJustification: true;
99
+ }, {
100
+ readonly key: "storage:write";
101
+ readonly label: "Use hosted storage";
102
+ readonly description: "Read and write this extension’s own hosted storage collections";
103
+ readonly requiresSecurityReview: false;
104
+ readonly requiresJustification: false;
105
+ }, {
106
+ readonly key: "messaging:send";
107
+ readonly label: "Send messages to end users";
108
+ readonly description: "Send messages or push notifications to the owner’s end users through owner-supplied credentials";
109
+ readonly requiresSecurityReview: true;
110
+ readonly requiresJustification: true;
111
+ }, {
112
+ readonly key: "ai:skills";
113
+ readonly label: "Shape the assistant";
114
+ readonly description: "Add skills, prompt templates and context providers that shape the assistant’s behaviour";
115
+ readonly requiresSecurityReview: false;
116
+ readonly requiresJustification: true;
117
+ }];
118
+ type ScopeDefinition = (typeof SCOPES)[number];
119
+ /** Every scope an extension can ask for under `scopes` in its manifest. */
120
+ type ScopeKey = ScopeDefinition['key'];
121
+ declare const SLOTS: readonly ["kpi-row", "insights", "sidebar", "below-chart", "below-list"];
122
+ /** The anchors on a host page a widget can be declared at. */
123
+ type SlotId = (typeof SLOTS)[number];
124
+ declare const CHARTS: readonly ["installs-activity", "conversion", "release-cadence"];
125
+ type HostChart = (typeof CHARTS)[number];
126
+ declare const PAGES: readonly [{
127
+ readonly key: "overview";
128
+ readonly label: "Home";
129
+ readonly route: "/projects/:id/overview";
130
+ readonly slots: readonly ["kpi-row", "insights", "sidebar"];
131
+ readonly charts: readonly ["installs-activity"];
132
+ readonly tabs: true;
133
+ readonly banners: true;
134
+ }, {
135
+ readonly key: "analytics";
136
+ readonly label: "Analytics";
137
+ readonly route: "/projects/:id/analytics";
138
+ readonly slots: readonly ["kpi-row", "below-chart", "sidebar"];
139
+ readonly charts: readonly ["installs-activity", "conversion"];
140
+ readonly tabs: true;
141
+ readonly banners: true;
142
+ }, {
143
+ readonly key: "deployments";
144
+ readonly label: "Deployments";
145
+ readonly route: "/projects/:id/deployments";
146
+ readonly slots: readonly ["sidebar", "below-list"];
147
+ readonly charts: readonly ["release-cadence"];
148
+ readonly tabs: true;
149
+ readonly banners: false;
150
+ }, {
151
+ readonly key: "ai_chat";
152
+ readonly label: "Assistant";
153
+ readonly route: "chat";
154
+ readonly slots: readonly [];
155
+ readonly charts: readonly [];
156
+ readonly tabs: false;
157
+ readonly banners: false;
158
+ }];
159
+ type PageDefinition = (typeof PAGES)[number];
160
+ /** The host pages a contribution can attach a tab, widget or banner to. */
161
+ type HostPage = PageDefinition['key'];
162
+ declare const TABLES: readonly [{
163
+ readonly key: "analytics.keywords";
164
+ readonly label: "Keywords";
165
+ }, {
166
+ readonly key: "analytics.reviews";
167
+ readonly label: "Reviews";
168
+ }, {
169
+ readonly key: "deployments.releases";
170
+ readonly label: "Releases";
171
+ }, {
172
+ readonly key: "deployments.builds";
173
+ readonly label: "Builds";
174
+ }];
175
+ type TableDefinition = (typeof TABLES)[number];
176
+ type HostTable = TableDefinition['key'];
177
+ declare const CATEGORIES: readonly ["market_data", "subscriptions", "product_analytics", "crashes", "attribution", "experiments", "messaging", "session_replay", "localization", "design", "ci_cd", "trackers", "support", "chat", "ad_monetization", "warehouse", "compliance", "additional_stores"];
178
+ type ExtensionCategory = (typeof CATEGORIES)[number];
179
+ declare const EVENTS: readonly ["release.shipped", "metadata.changed", "keyword.set_changed", "screenshots.updated", "price.changed", "featuring.started", "score.changed", "incident.opened", "incident.resolved", "playbook.step_approved", "review.thread_opened", "review.thread_resolved", "approval.requested", "digest.sent", "install.created", "install.paused", "install.resumed", "install.revoked", "install.token_rotated", "scopes.changed", "settings.changed"];
180
+ /** Every event Tappify emits, which a mount or a server can subscribe to. */
181
+ type HostEventName = (typeof EVENTS)[number];
182
+
183
+ type JsonSchema = Record<string, unknown>;
184
+ type ExtensionVisibility = 'public' | 'unlisted' | 'private';
185
+ type ExtensionInstallScope = 'project' | 'organization';
186
+ interface ScopeEntry {
187
+ key: ScopeKey;
188
+ justification?: string;
189
+ }
190
+ interface ProcedureDeclaration {
191
+ input: JsonSchema;
192
+ output: JsonSchema;
193
+ cache?: '1m' | '5m' | '1h';
194
+ kind?: 'read' | 'write';
195
+ }
196
+ interface StorageCollection {
197
+ scope: 'user' | 'install' | 'organization';
198
+ singleton?: boolean;
199
+ schema: JsonSchema;
200
+ }
201
+ interface PageContribution {
202
+ id: string;
203
+ title: string;
204
+ entry: string;
205
+ nav?: boolean;
206
+ mobile?: boolean;
207
+ }
208
+ interface TabContribution {
209
+ id: string;
210
+ title: string;
211
+ entry: string;
212
+ page: HostPage;
213
+ mobile?: boolean;
214
+ }
215
+ interface WidgetContribution {
216
+ id: string;
217
+ title: string;
218
+ entry: string;
219
+ page: HostPage;
220
+ slot: SlotId;
221
+ size: '1x1' | '2x1' | '2x2';
222
+ expandable?: boolean;
223
+ }
224
+ interface SeriesContribution {
225
+ id: string;
226
+ label: string;
227
+ chart: HostChart;
228
+ metric: string;
229
+ }
230
+ interface BannerContribution {
231
+ id: string;
232
+ page: HostPage;
233
+ event: string;
234
+ }
235
+ interface RowActionContribution {
236
+ id: string;
237
+ title: string;
238
+ table: HostTable;
239
+ entry: string;
240
+ }
241
+ interface MarkerContribution {
242
+ id: string;
243
+ label: string;
244
+ chart: HostChart | '*';
245
+ event: string;
246
+ glyph: string;
247
+ }
248
+ interface SettingsContribution {
249
+ entry: string;
250
+ schema: JsonSchema;
251
+ }
252
+ interface CredentialField {
253
+ name: string;
254
+ label: string;
255
+ type: 'text' | 'password' | 'textarea' | 'file' | 'select';
256
+ required: boolean;
257
+ options?: string[];
258
+ help?: string;
259
+ }
260
+ interface ConnectorAuth {
261
+ method: 'none' | 'api_key' | 'oauth';
262
+ fields?: CredentialField[];
263
+ oauth?: {
264
+ authorizationUrl: string;
265
+ tokenUrl: string;
266
+ scopes: string[];
267
+ };
268
+ }
269
+ interface DimensionDeclaration {
270
+ key: string;
271
+ label: string;
272
+ }
273
+ interface MetricDeclaration {
274
+ key: string;
275
+ label: string;
276
+ unit: 'count' | 'ratio' | 'currency' | 'seconds' | 'bytes';
277
+ kind: 'gauge' | 'counter';
278
+ dimensions?: DimensionDeclaration[];
279
+ backfillDays?: number;
280
+ }
281
+ interface ConnectorContribution {
282
+ auth?: ConnectorAuth;
283
+ sync?: '5m' | '15m' | '1h' | '6h' | '24h';
284
+ metrics?: MetricDeclaration[];
285
+ }
286
+ interface WebhookContribution {
287
+ event: string;
288
+ as: 'alert' | 'banner' | 'event';
289
+ payload: JsonSchema;
290
+ }
291
+ interface ToolDeclaration {
292
+ id: string;
293
+ description: string;
294
+ input: JsonSchema;
295
+ returns: 'comparison' | 'table' | 'series' | 'list' | 'value';
296
+ cost: 'low' | 'medium' | 'high';
297
+ cache?: '1m' | '5m' | '1h';
298
+ }
299
+ interface MentionDeclaration {
300
+ id: string;
301
+ label: string;
302
+ list: string;
303
+ }
304
+ interface ActionDeclaration {
305
+ id: string;
306
+ description: string;
307
+ input: JsonSchema;
308
+ approval: true;
309
+ reversible: boolean;
310
+ scope: ScopeKey;
311
+ estimatesCost?: boolean;
312
+ }
313
+ interface KnowledgeDeclaration {
314
+ id: string;
315
+ category: 'metric_definitions' | 'gotchas' | 'setup';
316
+ file: string;
317
+ }
318
+ interface SkillDeclaration {
319
+ id: string;
320
+ name: string;
321
+ description: string;
322
+ file: string;
323
+ tools?: string[];
324
+ }
325
+ interface PromptDeclaration {
326
+ id: string;
327
+ title: string;
328
+ template: string;
329
+ surfaces: ('chat_suggestion' | 'widget' | 'page' | 'result_card')[];
330
+ after?: string[];
331
+ input?: JsonSchema;
332
+ }
333
+ interface ContextDeclaration {
334
+ id: string;
335
+ description: string;
336
+ when: ('turn_start' | 'mention')[];
337
+ cache?: '1m' | '5m' | '1h';
338
+ }
339
+ interface AiContribution {
340
+ tools?: ToolDeclaration[];
341
+ mentions?: MentionDeclaration[];
342
+ actions?: ActionDeclaration[];
343
+ knowledge?: KnowledgeDeclaration[];
344
+ skills?: SkillDeclaration[];
345
+ prompts?: PromptDeclaration[];
346
+ context?: ContextDeclaration[];
347
+ }
348
+ interface WorkContribution {
349
+ kind: 'tracker' | 'docs' | 'chat';
350
+ container: {
351
+ label: string;
352
+ list: string;
353
+ };
354
+ creates: ('issue' | 'page' | 'message')[];
355
+ fields: {
356
+ priority?: string[];
357
+ labels?: boolean;
358
+ assignee?: boolean;
359
+ required: string[];
360
+ };
361
+ attachments: ('image' | 'link')[];
362
+ comments: 'two-way' | 'none';
363
+ status?: {
364
+ webhook: string;
365
+ map: Record<'open' | 'in_progress' | 'done', string[]>;
366
+ };
367
+ identity: 'user' | 'install';
368
+ }
369
+ interface ExtensionListing {
370
+ longDescription?: string;
371
+ screenshots?: string[];
372
+ website?: string;
373
+ supportUrl?: string;
374
+ privacyUrl?: string;
375
+ }
376
+ interface ExtensionManifest {
377
+ $schema?: string;
378
+ id: string;
379
+ name: string;
380
+ description: string;
381
+ icon: string;
382
+ category: ExtensionCategory;
383
+ sdk: string;
384
+ visibility: ExtensionVisibility;
385
+ installScope: ExtensionInstallScope;
386
+ scopes: ScopeEntry[];
387
+ contributes: {
388
+ pages?: PageContribution[];
389
+ tabs?: TabContribution[];
390
+ widgets?: WidgetContribution[];
391
+ series?: SeriesContribution[];
392
+ banners?: BannerContribution[];
393
+ rowActions?: RowActionContribution[];
394
+ markers?: MarkerContribution[];
395
+ settings?: SettingsContribution;
396
+ storage?: Record<string, StorageCollection>;
397
+ connector?: ConnectorContribution;
398
+ webhooks?: WebhookContribution[];
399
+ ai?: AiContribution;
400
+ work?: WorkContribution;
401
+ };
402
+ server?: {
403
+ baseUrl: string;
404
+ sandboxBaseUrl?: string;
405
+ procedures?: Record<string, ProcedureDeclaration>;
406
+ events?: HostEventName[];
407
+ };
408
+ telemetry?: string[];
409
+ listing?: ExtensionListing;
410
+ pricing?: never;
411
+ score?: never;
412
+ }
413
+
414
+ declare function collectEntryStyles(entryAbsolutePath: string, root: string): string[];
415
+ declare function inlineCssImports(code: string): string | null;
416
+
417
+ declare const VIRTUAL_PREFIX = "virtual:tappify-expose/";
418
+ interface TappifyExtensionOptions {
419
+ manifest?: ExtensionManifest;
420
+ manifestPath?: string;
421
+ root?: string;
422
+ port?: number;
423
+ onManifestChange?(manifest: ExtensionManifest): void | Promise<void>;
424
+ }
425
+ /**
426
+ * The Vite plugins that build an extension for the Tappify host.
427
+ *
428
+ * `tappifyExtension()` imports `@module-federation/vite`, an optional peer
429
+ * dependency (~1.16), so a vendor using this entry must install it alongside
430
+ * the SDK; `tappify extension init` installs it in the scaffolded extension.
431
+ */
432
+ declare function tappifyExtension(options?: TappifyExtensionOptions): Plugin[];
433
+
434
+ export { type TappifyExtensionOptions, VIRTUAL_PREFIX, collectEntryStyles, inlineCssImports, tappifyExtension };