@tappify/extension-sdk 2.0.0 → 2.1.0-beta.2

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 (148) hide show
  1. package/README.md +208 -0
  2. package/dist/chunk-2CY5HVY7.mjs +59 -0
  3. package/dist/chunk-2CY5HVY7.mjs.map +1 -0
  4. package/dist/{chunk-2DBSVKAU.cjs → chunk-6HETNZJY.cjs} +1 -1
  5. package/dist/chunk-6HETNZJY.cjs.map +1 -0
  6. package/dist/{chunk-PYJMJF44.cjs → chunk-7YKH4LZN.cjs} +9 -2
  7. package/dist/chunk-7YKH4LZN.cjs.map +1 -0
  8. package/dist/{chunk-RMUWRESK.cjs → chunk-A74HCO6T.cjs} +31 -18
  9. package/dist/chunk-A74HCO6T.cjs.map +1 -0
  10. package/dist/chunk-BPCGXXMD.cjs +781 -0
  11. package/dist/chunk-BPCGXXMD.cjs.map +1 -0
  12. package/dist/chunk-EB5XWQAU.cjs +132 -0
  13. package/dist/chunk-EB5XWQAU.cjs.map +1 -0
  14. package/dist/{chunk-5AAPD5WV.cjs → chunk-GAUZYBXE.cjs} +11 -11
  15. package/dist/chunk-GAUZYBXE.cjs.map +1 -0
  16. package/dist/chunk-J5LGTIGS.mjs +10 -0
  17. package/dist/chunk-J5LGTIGS.mjs.map +1 -0
  18. package/dist/{chunk-ZT35X7KL.mjs → chunk-KZ5NGFUP.mjs} +22 -9
  19. package/dist/chunk-KZ5NGFUP.mjs.map +1 -0
  20. package/dist/chunk-NN263PGQ.cjs +70 -0
  21. package/dist/chunk-NN263PGQ.cjs.map +1 -0
  22. package/dist/{chunk-3YWVYA42.cjs → chunk-O357OJXL.cjs} +14 -18
  23. package/dist/chunk-O357OJXL.cjs.map +1 -0
  24. package/dist/chunk-ONJMPO3P.cjs +59 -0
  25. package/dist/chunk-ONJMPO3P.cjs.map +1 -0
  26. package/dist/{chunk-OPPYEA7F.cjs → chunk-PRCZMOLD.cjs} +3 -3
  27. package/dist/chunk-PRCZMOLD.cjs.map +1 -0
  28. package/dist/chunk-Q7SFCCGT.cjs +10 -0
  29. package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
  30. package/dist/{chunk-QHM7XNRK.mjs → chunk-QA5AL3VZ.mjs} +2 -2
  31. package/dist/{chunk-QHM7XNRK.mjs.map → chunk-QA5AL3VZ.mjs.map} +1 -1
  32. package/dist/chunk-QJMZRV7A.mjs +132 -0
  33. package/dist/chunk-QJMZRV7A.mjs.map +1 -0
  34. package/dist/{chunk-CSTYBKZC.mjs → chunk-QXD7WVKK.mjs} +1 -1
  35. package/dist/chunk-QXD7WVKK.mjs.map +1 -0
  36. package/dist/{chunk-4C5Z3CIK.mjs → chunk-RBIQT75L.mjs} +2 -2
  37. package/dist/chunk-RBIQT75L.mjs.map +1 -0
  38. package/dist/{chunk-MNDVYPEP.mjs → chunk-SGCYEEXD.mjs} +9 -2
  39. package/dist/chunk-SGCYEEXD.mjs.map +1 -0
  40. package/dist/{chunk-BDCX6LRQ.mjs → chunk-SGEYDV3K.mjs} +3 -3
  41. package/dist/chunk-SGEYDV3K.mjs.map +1 -0
  42. package/dist/{chunk-IGK2AP6J.mjs → chunk-SLGOHIBL.mjs} +13 -17
  43. package/dist/chunk-SLGOHIBL.mjs.map +1 -0
  44. package/dist/chunk-SWG7CNTZ.mjs +781 -0
  45. package/dist/chunk-SWG7CNTZ.mjs.map +1 -0
  46. package/dist/{chunk-7KIKOH5H.cjs → chunk-VV7ELNRW.cjs} +3 -3
  47. package/dist/chunk-VV7ELNRW.cjs.map +1 -0
  48. package/dist/chunk-Z43DPNZ6.mjs +70 -0
  49. package/dist/chunk-Z43DPNZ6.mjs.map +1 -0
  50. package/dist/client-BO3kavn0.d.ts +25 -0
  51. package/dist/client-DE-vMgdO.d.cts +25 -0
  52. package/dist/codegen.cjs.map +1 -1
  53. package/dist/codegen.d.cts +43 -7
  54. package/dist/codegen.d.ts +43 -7
  55. package/dist/codegen.mjs.map +1 -1
  56. package/dist/{constants-DJ_KgZpN.d.cts → constants-Bh759FUI.d.cts} +44 -8
  57. package/dist/{constants-DJ_KgZpN.d.ts → constants-Bh759FUI.d.ts} +44 -8
  58. package/dist/{context-Dt6xh_5t.d.cts → context-DI0EJCRD.d.cts} +5 -4
  59. package/dist/{context-Ml7k_V14.d.ts → context-mr8R5CNt.d.ts} +5 -4
  60. package/dist/{errors-COsBh7kd.d.cts → errors-Cqh0wrqt.d.cts} +3 -2
  61. package/dist/{errors-COsBh7kd.d.ts → errors-Cqh0wrqt.d.ts} +3 -2
  62. package/dist/host.cjs +5 -4
  63. package/dist/host.cjs.map +1 -1
  64. package/dist/host.d.cts +5 -5
  65. package/dist/host.d.ts +5 -5
  66. package/dist/host.mjs +4 -3
  67. package/dist/host.mjs.map +1 -1
  68. package/dist/index.cjs +9 -656
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.d.cts +69 -627
  71. package/dist/index.d.ts +69 -627
  72. package/dist/index.mjs +5 -652
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/manifest.cjs +142 -86
  75. package/dist/manifest.cjs.map +1 -1
  76. package/dist/manifest.d.cts +97 -12
  77. package/dist/manifest.d.ts +97 -12
  78. package/dist/manifest.mjs +129 -73
  79. package/dist/manifest.mjs.map +1 -1
  80. package/dist/server.cjs +15 -66
  81. package/dist/server.cjs.map +1 -1
  82. package/dist/server.d.cts +6 -6
  83. package/dist/server.d.ts +6 -6
  84. package/dist/server.mjs +10 -61
  85. package/dist/server.mjs.map +1 -1
  86. package/dist/testing/index.cjs +73 -750
  87. package/dist/testing/index.cjs.map +1 -1
  88. package/dist/testing/index.d.cts +30 -11
  89. package/dist/testing/index.d.ts +30 -11
  90. package/dist/testing/index.mjs +89 -766
  91. package/dist/testing/index.mjs.map +1 -1
  92. package/dist/testing/jest.cjs +6 -5
  93. package/dist/testing/jest.cjs.map +1 -1
  94. package/dist/testing/jest.mjs +3 -2
  95. package/dist/testing/jest.mjs.map +1 -1
  96. package/dist/testing/vitest.cjs +6 -5
  97. package/dist/testing/vitest.cjs.map +1 -1
  98. package/dist/testing/vitest.d.cts +10 -0
  99. package/dist/testing/vitest.d.ts +10 -0
  100. package/dist/testing/vitest.mjs +3 -2
  101. package/dist/testing/vitest.mjs.map +1 -1
  102. package/dist/{types-DDAGLpov.d.ts → types-BdDaLnqs.d.cts} +4 -3
  103. package/dist/{types-DrpQSv_2.d.cts → types-uGHrRaOj.d.ts} +4 -3
  104. package/dist/ui/styles.css +740 -0
  105. package/dist/ui.cjs +1018 -0
  106. package/dist/ui.cjs.map +1 -0
  107. package/dist/ui.d.cts +231 -0
  108. package/dist/ui.d.ts +231 -0
  109. package/dist/ui.mjs +1018 -0
  110. package/dist/ui.mjs.map +1 -0
  111. package/dist/vite-preview-bootstrap.cjs +66 -0
  112. package/dist/vite-preview-bootstrap.cjs.map +1 -0
  113. package/dist/vite-preview-bootstrap.d.cts +15 -0
  114. package/dist/vite-preview-bootstrap.d.ts +15 -0
  115. package/dist/vite-preview-bootstrap.mjs +66 -0
  116. package/dist/vite-preview-bootstrap.mjs.map +1 -0
  117. package/dist/vite-preview.cjs +876 -0
  118. package/dist/vite-preview.cjs.map +1 -0
  119. package/dist/vite-preview.d.cts +9 -0
  120. package/dist/vite-preview.d.ts +9 -0
  121. package/dist/vite-preview.mjs +876 -0
  122. package/dist/vite-preview.mjs.map +1 -0
  123. package/dist/vite.cjs +320 -60
  124. package/dist/vite.cjs.map +1 -1
  125. package/dist/vite.d.cts +54 -8
  126. package/dist/vite.d.ts +54 -8
  127. package/dist/vite.mjs +312 -54
  128. package/dist/vite.mjs.map +1 -1
  129. package/dist/work-events-BlOVpK0k.d.ts +547 -0
  130. package/dist/work-events-D97EoqvS.d.cts +547 -0
  131. package/package.json +19 -2
  132. package/schema/extension-v2.json +440 -121
  133. package/dist/chunk-2DBSVKAU.cjs.map +0 -1
  134. package/dist/chunk-3YWVYA42.cjs.map +0 -1
  135. package/dist/chunk-4C5Z3CIK.mjs.map +0 -1
  136. package/dist/chunk-5AAPD5WV.cjs.map +0 -1
  137. package/dist/chunk-7KIKOH5H.cjs.map +0 -1
  138. package/dist/chunk-BDCX6LRQ.mjs.map +0 -1
  139. package/dist/chunk-CSTYBKZC.mjs.map +0 -1
  140. package/dist/chunk-IGK2AP6J.mjs.map +0 -1
  141. package/dist/chunk-MNDVYPEP.mjs.map +0 -1
  142. package/dist/chunk-OPPYEA7F.cjs.map +0 -1
  143. package/dist/chunk-PYJMJF44.cjs.map +0 -1
  144. package/dist/chunk-RMUWRESK.cjs.map +0 -1
  145. package/dist/chunk-ZT35X7KL.mjs.map +0 -1
  146. package/dist/handler-CZIlZ5vu.d.ts +0 -227
  147. package/dist/handler-kU9Jf36K.d.cts +0 -227
  148. package/dist/styles.css +0 -367
@@ -1,5 +1,5 @@
1
- import { E as ExtensionManifest, c as ExposableKind, U as UiContributionRef, M as ManifestValidation } from './constants-DJ_KgZpN.js';
2
- export { A as ActionDeclaration, d as AiContribution, B as BannerContribution, C as CARD_KEYS, e as CATEGORIES, f as CHARTS, g as ConnectorAuth, h as ConnectorContribution, i as ContextDeclaration, j as ContributionKind, k as CredentialField, D as DataQueryKind, l as DimensionDeclaration, m as EVENTS, n as ExtensionCategory, o as ExtensionInstallScope, p as ExtensionListing, q as ExtensionVisibility, r as HostChart, H as HostEventName, a as HostPage, s as HostTable, J as JsonSchema, K as KINDS, t as KnowledgeDeclaration, u as ManifestIssue, v as MarkerContribution, w as MentionDeclaration, x as MetricDeclaration, P as PAGES, y as PAGE_KEYS, z as PageContribution, F as PageDefinition, G as ProcedureDeclaration, I as PromptDeclaration, Q as QUERY_SCOPES, R as RowActionContribution, L as SCOPES, N as SCOPE_KEYS, O as SERVED_SDK_MAJORS, T as SLOTS, V as ScopeDefinition, W as ScopeEntry, S as ScopeKey, X as SeriesContribution, Y as SettingsContribution, Z as SkillDeclaration, b as SlotId, _ as StorageCollection, $ as TABLES, a0 as TABLE_KEYS, a1 as TabContribution, a2 as TableDefinition, a3 as ToolDeclaration, a4 as WebhookContribution, a5 as WidgetContribution, a6 as WorkContribution, a7 as findPage, a8 as findScope, a9 as findTable, aa as slotsForPage } from './constants-DJ_KgZpN.js';
1
+ import { E as ExtensionManifest, c as ExposableKind, U as UiContributionRef, M as ManifestValidation, d as ManifestIssue } from './constants-Bh759FUI.js';
2
+ export { A as ActionDeclaration, e as AiContribution, B as BannerContribution, C as CARD_KEYS, f as CATEGORIES, g as CHARTS, h as ConnectorAuth, i as ConnectorContribution, j as ContextDeclaration, k as ContributionKind, l as CredentialField, D as DataQueryKind, m as DimensionDeclaration, n as EVENTS, o as ExtensionCategory, p as ExtensionInstallScope, q as ExtensionListing, r as ExtensionVisibility, s as HostChart, H as HostEventName, a as HostPage, t as HostTable, J as JsonSchema, K as KINDS, u as KnowledgeDeclaration, L as LegacyWorkContribution, v as MarkerContribution, w as MentionDeclaration, x as MetricDeclaration, O as OAuthTokenRequestEncoding, P as PAGES, y as PAGE_KEYS, z as PageContribution, F as PageDefinition, G as ProcedureDeclaration, I as PromptDeclaration, Q as QUERY_SCOPES, R as RowActionContribution, N as SCOPES, T as SCOPE_KEYS, V as SERVED_SDK_MAJORS, W as SLOTS, X as ScopeDefinition, Y as ScopeEntry, S as ScopeKey, Z as SeriesContribution, _ as SettingsContribution, $ as SkillDeclaration, b as SlotId, a0 as StorageCollection, a1 as TABLES, a2 as TABLE_KEYS, a3 as TabContribution, a4 as TableDefinition, a5 as ToolDeclaration, a6 as WebhookContribution, a7 as WidgetContribution, a8 as WorkAuth, a9 as WorkContribution, aa as WorkDirection, ab as findPage, ac as findScope, ad as findTable, ae as slotsForPage } from './constants-Bh759FUI.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare function defineManifest(manifest: ExtensionManifest): ExtensionManifest;
@@ -52,6 +52,7 @@ declare const manifestSchema: z.ZodObject<{
52
52
  "analytics:read": "analytics:read";
53
53
  "store.metadata:read": "store.metadata:read";
54
54
  "reviews:read": "reviews:read";
55
+ "review.threads:read": "review.threads:read";
55
56
  "crashes:read": "crashes:read";
56
57
  "revenue:read": "revenue:read";
57
58
  "metrics:write": "metrics:write";
@@ -180,10 +181,10 @@ declare const manifestSchema: z.ZodObject<{
180
181
  label: z.ZodString;
181
182
  type: z.ZodEnum<{
182
183
  text: "text";
183
- password: "password";
184
+ select: "select";
184
185
  textarea: "textarea";
186
+ password: "password";
185
187
  file: "file";
186
- select: "select";
187
188
  }>;
188
189
  required: z.ZodBoolean;
189
190
  options: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -193,6 +194,10 @@ declare const manifestSchema: z.ZodObject<{
193
194
  authorizationUrl: z.ZodURL;
194
195
  tokenUrl: z.ZodURL;
195
196
  scopes: z.ZodArray<z.ZodString>;
197
+ tokenRequestEncoding: z.ZodOptional<z.ZodEnum<{
198
+ form: "form";
199
+ json: "json";
200
+ }>>;
196
201
  }, z.core.$strict>>;
197
202
  }, z.core.$strict>>;
198
203
  sync: z.ZodOptional<z.ZodEnum<{
@@ -238,11 +243,11 @@ declare const manifestSchema: z.ZodObject<{
238
243
  description: z.ZodString;
239
244
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
240
245
  returns: z.ZodEnum<{
241
- comparison: "comparison";
246
+ value: "value";
247
+ list: "list";
242
248
  table: "table";
249
+ comparison: "comparison";
243
250
  series: "series";
244
- list: "list";
245
- value: "value";
246
251
  }>;
247
252
  cost: z.ZodEnum<{
248
253
  low: "low";
@@ -272,6 +277,7 @@ declare const manifestSchema: z.ZodObject<{
272
277
  "analytics:read": "analytics:read";
273
278
  "store.metadata:read": "store.metadata:read";
274
279
  "reviews:read": "reviews:read";
280
+ "review.threads:read": "review.threads:read";
275
281
  "crashes:read": "crashes:read";
276
282
  "revenue:read": "revenue:read";
277
283
  "metrics:write": "metrics:write";
@@ -310,9 +316,9 @@ declare const manifestSchema: z.ZodObject<{
310
316
  title: z.ZodString;
311
317
  template: z.ZodString;
312
318
  surfaces: z.ZodArray<z.ZodEnum<{
319
+ page: "page";
313
320
  chat_suggestion: "chat_suggestion";
314
321
  widget: "widget";
315
- page: "page";
316
322
  result_card: "result_card";
317
323
  }>>;
318
324
  after: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -332,7 +338,84 @@ declare const manifestSchema: z.ZodObject<{
332
338
  }>>;
333
339
  }, z.core.$strict>>>;
334
340
  }, z.core.$strict>>;
335
- work: z.ZodOptional<z.ZodObject<{
341
+ work: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
342
+ kind: z.ZodEnum<{
343
+ chat: "chat";
344
+ tracker: "tracker";
345
+ docs: "docs";
346
+ }>;
347
+ creates: z.ZodArray<z.ZodEnum<{
348
+ page: "page";
349
+ issue: "issue";
350
+ message: "message";
351
+ }>>;
352
+ attachments: z.ZodArray<z.ZodEnum<{
353
+ link: "link";
354
+ image: "image";
355
+ }>>;
356
+ identity: z.ZodEnum<{
357
+ user: "user";
358
+ install: "install";
359
+ }>;
360
+ container: z.ZodOptional<z.ZodObject<{
361
+ label: z.ZodString;
362
+ list: z.ZodString;
363
+ }, z.core.$strict>>;
364
+ fields: z.ZodOptional<z.ZodObject<{
365
+ priority: z.ZodOptional<z.ZodArray<z.ZodString>>;
366
+ labels: z.ZodOptional<z.ZodBoolean>;
367
+ assignee: z.ZodOptional<z.ZodBoolean>;
368
+ required: z.ZodArray<z.ZodString>;
369
+ }, z.core.$strict>>;
370
+ comments: z.ZodUnion<readonly [z.ZodEnum<{
371
+ none: "none";
372
+ "two-way": "two-way";
373
+ }>, z.ZodObject<{
374
+ direction: z.ZodEnum<{
375
+ none: "none";
376
+ to_provider: "to_provider";
377
+ from_provider: "from_provider";
378
+ "two-way": "two-way";
379
+ }>;
380
+ supportsEdits: z.ZodLiteral<false>;
381
+ supportsDeletes: z.ZodLiteral<false>;
382
+ }, z.core.$strict>]>;
383
+ status: z.ZodOptional<z.ZodObject<{
384
+ direction: z.ZodEnum<{
385
+ none: "none";
386
+ to_provider: "to_provider";
387
+ from_provider: "from_provider";
388
+ "two-way": "two-way";
389
+ }>;
390
+ webhook: z.ZodOptional<z.ZodString>;
391
+ map: z.ZodOptional<z.ZodObject<{
392
+ open: z.ZodArray<z.ZodString>;
393
+ in_progress: z.ZodArray<z.ZodString>;
394
+ done: z.ZodArray<z.ZodString>;
395
+ }, z.core.$strict>>;
396
+ }, z.core.$strict>>;
397
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
398
+ method: z.ZodLiteral<"oauth">;
399
+ provider: z.ZodString;
400
+ scopes: z.ZodArray<z.ZodString>;
401
+ }, z.core.$strict>, z.ZodObject<{
402
+ method: z.ZodLiteral<"api_key">;
403
+ fields: z.ZodArray<z.ZodObject<{
404
+ name: z.ZodString;
405
+ label: z.ZodString;
406
+ type: z.ZodEnum<{
407
+ text: "text";
408
+ select: "select";
409
+ textarea: "textarea";
410
+ password: "password";
411
+ file: "file";
412
+ }>;
413
+ required: z.ZodBoolean;
414
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
415
+ help: z.ZodOptional<z.ZodString>;
416
+ }, z.core.$strict>>;
417
+ }, z.core.$strict>], "method">;
418
+ }, z.core.$strict>, z.ZodObject<{
336
419
  kind: z.ZodEnum<{
337
420
  chat: "chat";
338
421
  tracker: "tracker";
@@ -354,8 +437,8 @@ declare const manifestSchema: z.ZodObject<{
354
437
  required: z.ZodArray<z.ZodString>;
355
438
  }, z.core.$strict>;
356
439
  attachments: z.ZodArray<z.ZodEnum<{
357
- image: "image";
358
440
  link: "link";
441
+ image: "image";
359
442
  }>>;
360
443
  comments: z.ZodEnum<{
361
444
  none: "none";
@@ -373,7 +456,7 @@ declare const manifestSchema: z.ZodObject<{
373
456
  user: "user";
374
457
  install: "install";
375
458
  }>;
376
- }, z.core.$strict>>;
459
+ }, z.core.$strict>]>>;
377
460
  }, z.core.$strict>;
378
461
  server: z.ZodOptional<z.ZodObject<{
379
462
  baseUrl: z.ZodURL;
@@ -428,5 +511,7 @@ declare const manifestSchema: z.ZodObject<{
428
511
  }, z.core.$strict>;
429
512
  declare function manifestJsonSchema(): Record<string, unknown>;
430
513
  declare function validateManifest(value: unknown): ManifestValidation;
514
+ /** Migration warnings are separate from validation during SDK v2 compatibility. */
515
+ declare function workManifestWarnings(manifest: ExtensionManifest): ManifestIssue[];
431
516
 
432
- export { ExposableKind, ExtensionManifest, ManifestValidation, UiContributionRef, defineManifest, exposeName, manifestJsonSchema, manifestSchema, remoteName, sdkMajors, uiContributions, validateManifest };
517
+ export { ExposableKind, ExtensionManifest, ManifestIssue, ManifestValidation, UiContributionRef, defineManifest, exposeName, manifestJsonSchema, manifestSchema, remoteName, sdkMajors, uiContributions, validateManifest, workManifestWarnings };
package/dist/manifest.mjs CHANGED
@@ -1,3 +1,9 @@
1
+ import {
2
+ defineManifest,
3
+ exposeName,
4
+ remoteName,
5
+ uiContributions
6
+ } from "./chunk-Z43DPNZ6.mjs";
1
7
  import {
2
8
  CARD_KEYS,
3
9
  CATEGORIES,
@@ -17,70 +23,8 @@ import {
17
23
  findScope,
18
24
  findTable,
19
25
  slotsForPage
20
- } from "./chunk-MNDVYPEP.mjs";
21
-
22
- // src/manifest/define.ts
23
- var EXPOSE_FOLDER = {
24
- page: "pages",
25
- tab: "tabs",
26
- widget: "widgets",
27
- rowAction: "rowActions"
28
- };
29
- function defineManifest(manifest) {
30
- return manifest;
31
- }
32
- function exposeName(kind, id) {
33
- if (kind === "settings") return "./settings";
34
- return `./${EXPOSE_FOLDER[kind]}/${id ?? ""}`;
35
- }
36
- function remoteName(extensionId) {
37
- return `ext_${extensionId.replace(/-/g, "_")}`;
38
- }
39
- function uiContributions(manifest) {
40
- const contributes = manifest.contributes;
41
- const refs = [];
42
- for (const page of contributes.pages ?? []) {
43
- refs.push({
44
- kind: "page",
45
- id: page.id,
46
- entry: page.entry,
47
- expose: exposeName("page", page.id)
48
- });
49
- }
50
- for (const tab of contributes.tabs ?? []) {
51
- refs.push({
52
- kind: "tab",
53
- id: tab.id,
54
- entry: tab.entry,
55
- expose: exposeName("tab", tab.id)
56
- });
57
- }
58
- for (const widget of contributes.widgets ?? []) {
59
- refs.push({
60
- kind: "widget",
61
- id: widget.id,
62
- entry: widget.entry,
63
- expose: exposeName("widget", widget.id)
64
- });
65
- }
66
- for (const rowAction of contributes.rowActions ?? []) {
67
- refs.push({
68
- kind: "rowAction",
69
- id: rowAction.id,
70
- entry: rowAction.entry,
71
- expose: exposeName("rowAction", rowAction.id)
72
- });
73
- }
74
- if (contributes.settings) {
75
- refs.push({
76
- kind: "settings",
77
- id: "settings",
78
- entry: contributes.settings.entry,
79
- expose: exposeName("settings")
80
- });
81
- }
82
- return refs;
83
- }
26
+ } from "./chunk-SGCYEEXD.mjs";
27
+ import "./chunk-J5LGTIGS.mjs";
84
28
 
85
29
  // src/manifest/schema.ts
86
30
  import { z } from "zod";
@@ -254,7 +198,10 @@ var connectorContribution = z.object({
254
198
  ),
255
199
  scopes: z.array(z.string()).describe(
256
200
  "The scopes asked of the outside service. These are that service's scopes, not Tappify's."
257
- )
201
+ ),
202
+ tokenRequestEncoding: z.enum(["form", "json"]).describe(
203
+ "The request body encoding for authorization-code and refresh token exchanges. When omitted, uses form encoding (application/x-www-form-urlencoded); json uses application/json."
204
+ ).optional()
258
205
  }).strict().describe('The endpoints, for `method: "oauth"`.').optional()
259
206
  }).strict().describe("How owners authenticate this connector.").optional(),
260
207
  sync: z.enum(["5m", "15m", "1h", "6h", "24h"]).describe("How often Tappify asks your server to sync.").optional(),
@@ -398,7 +345,7 @@ var aiContribution = z.object({
398
345
  ).optional()
399
346
  }).strict();
400
347
  var statusNames = (stage) => z.array(z.string()).describe(`Your own status names that mean ${stage}.`);
401
- var workContribution = z.object({
348
+ var legacyWorkContribution = z.object({
402
349
  kind: z.enum(["tracker", "docs", "chat"]).describe("What kind of destination this is."),
403
350
  container: z.object({
404
351
  label: z.string().min(1).max(60).describe(
@@ -433,6 +380,55 @@ var workContribution = z.object({
433
380
  "Whether items are created as the owner who asked (`user`) or as the install itself."
434
381
  )
435
382
  }).strict();
383
+ var workDirection = z.enum([
384
+ "none",
385
+ "to_provider",
386
+ "from_provider",
387
+ "two-way"
388
+ ]);
389
+ var workAuth = z.discriminatedUnion("method", [
390
+ z.object({
391
+ method: z.literal("oauth"),
392
+ provider: z.string().min(1).describe("The OAuth provider identifier."),
393
+ scopes: z.array(z.string()).describe("The scopes requested from the provider.")
394
+ }).strict(),
395
+ z.object({
396
+ method: z.literal("api_key"),
397
+ fields: z.array(credentialField).max(20)
398
+ }).strict()
399
+ ]);
400
+ var currentWorkContribution = legacyWorkContribution.extend({
401
+ container: legacyWorkContribution.shape.container.describe(
402
+ "Deprecated. Resolve containers dynamically with describe_container."
403
+ ).optional(),
404
+ fields: legacyWorkContribution.shape.fields.describe("Deprecated. Resolve fields dynamically with describe_container.").optional(),
405
+ comments: z.union([
406
+ z.enum(["two-way", "none"]).describe("Deprecated. Declare a comments capability object."),
407
+ z.object({
408
+ direction: workDirection,
409
+ supportsEdits: z.literal(false),
410
+ supportsDeletes: z.literal(false)
411
+ }).strict()
412
+ ]),
413
+ status: z.object({
414
+ direction: workDirection,
415
+ webhook: z.string().regex(DOMAIN_EVENT).optional(),
416
+ map: z.object({
417
+ open: statusNames("not started"),
418
+ in_progress: statusNames("under way"),
419
+ done: statusNames("finished")
420
+ }).strict().describe(
421
+ "Deprecated. Resolve statuses dynamically with describe_container."
422
+ ).optional()
423
+ }).strict().optional(),
424
+ auth: workAuth.describe("How owners authenticate the work destination.")
425
+ });
426
+ var workContribution = z.union([
427
+ currentWorkContribution,
428
+ legacyWorkContribution.describe(
429
+ "Deprecated SDK v2 work declaration. Migrate to work capabilities and auth."
430
+ )
431
+ ]);
436
432
  var listing = z.object({
437
433
  longDescription: z.string().min(1).max(5e3).describe("The body of your listing page, in markdown.").optional(),
438
434
  screenshots: z.array(z.string().min(1)).min(1, "A listing shows 1 to 6 screenshots.").max(6, "A listing shows 1 to 6 screenshots.").describe(
@@ -524,7 +520,7 @@ var manifestObject = z.object({
524
520
  "What this extension offers the assistant: tools, mentions, actions, knowledge, skills, prompts and context providers."
525
521
  ).optional(),
526
522
  work: workContribution.describe(
527
- "The work destination this extension creates issues, pages or messages in. Needs the `work:create` and `work:sync` scopes."
523
+ "The work destination this extension creates issues, pages or messages in. Needs `review.threads:read` and `work:create`; active comment or status sync also needs `work:sync`."
528
524
  ).optional()
529
525
  }).strict().describe(
530
526
  "What this extension adds to the host. At most 20 UI contributions in total, and a page, tab, widget, row action, marker or settings panel needs the `ui:render` scope."
@@ -745,16 +741,36 @@ var manifestSchema = manifestObject.superRefine((manifest, ctx) => {
745
741
  }
746
742
  }
747
743
  if (contributes.work) {
744
+ const work = contributes.work;
745
+ const legacy = isLegacyWork(work);
746
+ if (!legacy || !granted.has("reviews:read")) {
747
+ requireScope(
748
+ "review.threads:read",
749
+ ["scopes"],
750
+ "the work destination reads Review threads."
751
+ );
752
+ }
748
753
  requireScope(
749
754
  "work:create",
750
755
  ["scopes"],
751
756
  "the work destination creates items."
752
757
  );
753
- requireScope(
754
- "work:sync",
755
- ["scopes"],
756
- "the work destination syncs comments and status."
757
- );
758
+ const comments = typeof work.comments === "string" ? work.comments : work.comments.direction;
759
+ const status = work.status ? "direction" in work.status ? work.status.direction : "from_provider" : "none";
760
+ if (comments !== "none" || status !== "none") {
761
+ requireScope(
762
+ "work:sync",
763
+ ["scopes"],
764
+ "the work destination syncs comments or status."
765
+ );
766
+ }
767
+ if (work.identity === "user") {
768
+ ctx.addIssue({
769
+ code: "custom",
770
+ path: ["contributes", "work", "identity"],
771
+ message: 'Per-user work identity is not supported. Set identity to "install".'
772
+ });
773
+ }
758
774
  }
759
775
  const needsServer = contributes.connector !== void 0 || (contributes.webhooks?.length ?? 0) > 0 || ai !== void 0 || contributes.work !== void 0 || manifest.server?.procedures !== void 0;
760
776
  if (needsServer && !manifest.server?.baseUrl) {
@@ -841,6 +857,45 @@ function validateManifest(value) {
841
857
  }));
842
858
  return { ok: false, issues };
843
859
  }
860
+ function isLegacyWork(work) {
861
+ return !("auth" in work);
862
+ }
863
+ function workManifestWarnings(manifest) {
864
+ const work = manifest.contributes.work;
865
+ if (!work) return [];
866
+ const warnings = [];
867
+ if (work.container) {
868
+ warnings.push({
869
+ path: "contributes.work.container",
870
+ message: "Static work containers are deprecated. Resolve containers dynamically with describe_container."
871
+ });
872
+ }
873
+ if (work.fields) {
874
+ warnings.push({
875
+ path: "contributes.work.fields",
876
+ message: "Static work fields are deprecated. Resolve fields dynamically with describe_container."
877
+ });
878
+ }
879
+ if (typeof work.comments === "string") {
880
+ warnings.push({
881
+ path: "contributes.work.comments",
882
+ message: "String work comments are deprecated. Declare direction, supportsEdits: false and supportsDeletes: false."
883
+ });
884
+ }
885
+ if (work.status?.map) {
886
+ warnings.push({
887
+ path: "contributes.work.status.map",
888
+ message: "Static work status maps are deprecated. Resolve statuses dynamically with describe_container."
889
+ });
890
+ }
891
+ if (isLegacyWork(work) && manifest.scopes.some((scope) => scope.key === "reviews:read") && !manifest.scopes.some((scope) => scope.key === "review.threads:read")) {
892
+ warnings.push({
893
+ path: "scopes",
894
+ message: "Using reviews:read for work is deprecated. Add review.threads:read for Review threads; reviews:read grants store-review access."
895
+ });
896
+ }
897
+ return warnings;
898
+ }
844
899
  export {
845
900
  CARD_KEYS,
846
901
  CATEGORIES,
@@ -867,6 +922,7 @@ export {
867
922
  sdkMajors,
868
923
  slotsForPage,
869
924
  uiContributions,
870
- validateManifest
925
+ validateManifest,
926
+ workManifestWarnings
871
927
  };
872
928
  //# sourceMappingURL=manifest.mjs.map