@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 +1 @@
1
- {"version":3,"sources":["../src/codegen/generate.ts","../src/client/errors.ts"],"sourcesContent":["import { compile } from 'json-schema-to-typescript';\nimport { dirname, join } from 'node:path';\nimport { TapError } from '../client/errors';\nimport type {\n CredentialField,\n ExtensionManifest,\n JsonSchema,\n} from '../manifest/types';\n\nexport const GENERATED_HEADER = `/* eslint-disable */\n/**\n * Generated by \\`tappify extension types\\`. Do not edit by hand.\n * Re-run the command after changing tappify.extension.json or any schema it points at.\n */`;\n\nexport interface RegistrySnapshot {\n events: { name: string; payload?: JsonSchema }[];\n}\n\nexport interface GenerateTypesOptions {\n manifest: ExtensionManifest;\n registrySnapshot?: RegistrySnapshot;\n readSchemaFile?(path: string): JsonSchema;\n /**\n * The extension root. A `$ref` inside a schema file resolves against that\n * file's own directory under it, the way the host and the Tap Store read\n * it; without a root the process directory stands in.\n */\n cwd?: string;\n}\n\nconst STYLE = {\n bracketSpacing: true,\n printWidth: 80,\n semi: true,\n singleQuote: true,\n tabWidth: 2,\n trailingComma: 'all',\n useTabs: false,\n} as const;\n\nfunction pascal(value: string): string {\n return value\n .split(/[^A-Za-z0-9]+/)\n .filter(part => part !== '')\n .map(part => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n}\n\ninterface Emitter {\n declare(preferredName: string, schema: JsonSchema): Promise<string>;\n declarations(): string[];\n}\n\ninterface ResolvedSchema {\n schema: JsonSchema;\n /** Where the schema's own nested `$ref`s resolve from. */\n cwd?: string;\n}\n\nfunction createEmitter(\n resolveSchema: (schema: JsonSchema) => ResolvedSchema,\n): Emitter {\n const used = new Set<string>();\n const blocks: string[] = [];\n\n return {\n async declare(preferredName, schema) {\n let name = pascal(preferredName);\n let suffix = 2;\n while (used.has(name)) {\n name = `${pascal(preferredName)}${String(suffix)}`;\n suffix += 1;\n }\n used.add(name);\n\n const resolved = resolveSchema(schema);\n const input: Parameters<typeof compile>[0] = {\n ...resolved.schema,\n title: name,\n };\n\n const text = await compile(input, name, {\n bannerComment: '',\n additionalProperties: false,\n declareExternallyReferenced: true,\n enableConstEnums: false,\n format: true,\n style: STYLE,\n unknownAny: true,\n ...(resolved.cwd === undefined ? {} : { cwd: resolved.cwd }),\n });\n\n blocks.push(text.trim());\n return name;\n },\n declarations() {\n return blocks;\n },\n };\n}\n\nfunction credentialSchema(fields: CredentialField[]): JsonSchema {\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n\n for (const field of fields) {\n const property: JsonSchema =\n field.type === 'select' && field.options\n ? { type: 'string', enum: field.options }\n : { type: 'string' };\n if (field.help !== undefined) property.description = field.help;\n properties[field.name] = property;\n if (field.required) required.push(field.name);\n }\n\n return { type: 'object', properties, required, additionalProperties: false };\n}\n\nexport async function generateTypes(\n options: GenerateTypesOptions,\n): Promise<string> {\n const { manifest, registrySnapshot } = options;\n const contributes = manifest.contributes;\n\n const resolveSchema = (schema: JsonSchema): ResolvedSchema => {\n const ref = schema.$ref;\n if (typeof ref !== 'string' || ref.startsWith('#')) {\n return { schema, cwd: options.cwd };\n }\n if (options.readSchemaFile === undefined) {\n throw new TapError(\n 'TAP_SCHEMA_UNRESOLVED',\n `The manifest points at the schema file \"${ref}\", but this call passed no readSchemaFile. Run \\`tappify extension types\\`, which reads schema files from the extension directory, or supply readSchemaFile.`,\n );\n }\n return {\n schema: options.readSchemaFile(ref),\n cwd:\n options.cwd === undefined ? undefined : dirname(join(options.cwd, ref)),\n };\n };\n\n const emitter = createEmitter(resolveSchema);\n const augmentations: string[] = [];\n\n const storageEntries = Object.entries(contributes.storage ?? {});\n if (storageEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, collection] of storageEntries) {\n const typeName = await emitter.declare(name, collection.schema);\n const kind = collection.singleton === true ? 'singleton' : 'collection';\n lines.push(\n ` '${name}': { kind: '${kind}'; scope: '${collection.scope}'; document: ${typeName} };`,\n );\n }\n augmentations.push(` interface TapStorageMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const procedureEntries = Object.entries(manifest.server?.procedures ?? {});\n if (procedureEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, declaration] of procedureEntries) {\n const inputName = await emitter.declare(\n `${name}Input`,\n declaration.input,\n );\n const outputName = await emitter.declare(\n `${name}Output`,\n declaration.output,\n );\n lines.push(\n ` '${name}': { input: ${inputName}; output: ${outputName} };`,\n );\n }\n augmentations.push(\n ` interface TapProcedureMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const actions = contributes.ai?.actions ?? [];\n if (actions.length > 0) {\n const lines: string[] = [];\n for (const action of actions) {\n const name = await emitter.declare(`${action.id}Input`, action.input);\n lines.push(` '${action.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapActionMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const tools = contributes.ai?.tools ?? [];\n if (tools.length > 0) {\n const lines: string[] = [];\n for (const tool of tools) {\n const name = await emitter.declare(`${tool.id}Input`, tool.input);\n lines.push(` '${tool.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapToolMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const prompts = (contributes.ai?.prompts ?? []).filter(\n prompt => prompt.input !== undefined,\n );\n if (prompts.length > 0) {\n const lines: string[] = [];\n for (const prompt of prompts) {\n const name = await emitter.declare(\n `${prompt.id}PromptInput`,\n prompt.input ?? { type: 'object' },\n );\n lines.push(` '${prompt.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapPromptMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const webhooks = contributes.webhooks ?? [];\n if (webhooks.length > 0) {\n const lines: string[] = [];\n for (const webhook of webhooks) {\n const name = await emitter.declare(\n `${webhook.event}Payload`,\n webhook.payload,\n );\n lines.push(` '${webhook.event}': ${name};`);\n }\n augmentations.push(` interface TapWebhookMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n if (registrySnapshot !== undefined && registrySnapshot.events.length > 0) {\n const lines: string[] = [];\n for (const event of registrySnapshot.events) {\n const name = await emitter.declare(\n `${event.name}Event`,\n event.payload ?? { type: 'object' },\n );\n lines.push(` '${event.name}': ${name};`);\n }\n augmentations.push(\n ` interface TapHostEventMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const telemetry = manifest.telemetry ?? [];\n if (telemetry.length > 0) {\n const lines = telemetry.map(name => ` '${name}': true;`);\n augmentations.push(\n ` interface TapTelemetryEvents {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n if (contributes.settings) {\n const name = await emitter.declare('Settings', contributes.settings.schema);\n augmentations.push(` interface TapSettings extends ${name} {}`);\n }\n\n const credentialFields = contributes.connector?.auth?.fields ?? [];\n if (credentialFields.length > 0) {\n const name = await emitter.declare(\n 'Credentials',\n credentialSchema(credentialFields),\n );\n augmentations.push(` interface TapCredentials extends ${name} {}`);\n }\n\n const declarations = emitter.declarations();\n const module =\n augmentations.length === 0\n ? \"declare module '@tappify/extension-sdk' {}\"\n : `declare module '@tappify/extension-sdk' {\\n${augmentations.join('\\n\\n')}\\n}`;\n\n return [\n GENERATED_HEADER,\n '',\n ...(declarations.length > 0 ? [declarations.join('\\n\\n'), ''] : []),\n module,\n '',\n 'export {};',\n '',\n ].join('\\n');\n}\n","/** Every code a `TapError` the SDK raises carries. */\nexport type TapErrorCode =\n | 'TAP_OUTSIDE_HOST'\n | 'TAP_SCOPE_MISSING'\n | 'TAP_UNKNOWN_COLLECTION'\n | 'TAP_UNKNOWN_PROCEDURE'\n | 'TAP_NO_PORTAL'\n | 'TAP_NO_QUERY_CLIENT'\n | 'TAP_MANIFEST_INVALID'\n | 'TAP_ENTRY_MISSING'\n | 'TAP_STYLES_UNRESOLVED'\n | 'TAP_SCHEMA_UNRESOLVED'\n | 'TAP_TOKEN_MISSING'\n | 'TAP_TOKEN_INVALID'\n | 'TAP_TOKEN_AUDIENCE'\n | 'TAP_EVENT_ID_MISSING'\n | 'TAP_BODY_INVALID'\n | 'TAP_BODY_TOO_LARGE'\n | 'TAP_ROUTE_UNKNOWN'\n | 'TAP_HANDLER_MISSING'\n | 'TAP_INTERNAL_ERROR'\n | 'TAP_WEBHOOK_REJECTED'\n | 'TAP_TEST_TARGET_INVALID';\n\n/**\n * The same codes as `TapErrorCode`, as an array to iterate or check membership\n * against at runtime.\n */\nexport const TAP_ERROR_CODES: readonly TapErrorCode[] = [\n 'TAP_OUTSIDE_HOST',\n 'TAP_SCOPE_MISSING',\n 'TAP_UNKNOWN_COLLECTION',\n 'TAP_UNKNOWN_PROCEDURE',\n 'TAP_NO_PORTAL',\n 'TAP_NO_QUERY_CLIENT',\n 'TAP_MANIFEST_INVALID',\n 'TAP_ENTRY_MISSING',\n 'TAP_STYLES_UNRESOLVED',\n 'TAP_SCHEMA_UNRESOLVED',\n 'TAP_TOKEN_MISSING',\n 'TAP_TOKEN_INVALID',\n 'TAP_TOKEN_AUDIENCE',\n 'TAP_EVENT_ID_MISSING',\n 'TAP_BODY_INVALID',\n 'TAP_BODY_TOO_LARGE',\n 'TAP_ROUTE_UNKNOWN',\n 'TAP_HANDLER_MISSING',\n 'TAP_INTERNAL_ERROR',\n 'TAP_WEBHOOK_REJECTED',\n 'TAP_TEST_TARGET_INVALID',\n];\n\nconst CODE_SET = new Set<string>(TAP_ERROR_CODES);\n\n/**\n * The error the SDK and the host raise when a call cannot be served at all.\n *\n * @remarks\n * The SDK throws it for a mount outside the host (`TAP_OUTSIDE_HOST`), a\n * collection or procedure the manifest does not declare\n * (`TAP_UNKNOWN_COLLECTION`, `TAP_UNKNOWN_PROCEDURE`), a missing portal or query\n * client, a token the server rejected, and a misused testing helper. The host\n * turns a refused read or write into `TAP_SCOPE_MISSING`. Branch on `code`, which\n * is stable; the message is prose and changes. An error your own server raised is\n * a `TapServerError` instead.\n *\n * @example\n * ```tsx\n * import { TapError, TapErrorState, useTapQuery } from '@tappify/extension-sdk';\n *\n * function Revenue() {\n * const revenue = useTapQuery({\n * kind: 'revenue',\n * range: { from: '2026-09-01', to: '2026-09-08' },\n * });\n * if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {\n * return <TapErrorState title=\"Revenue is not shared with this extension\" />;\n * }\n * return <span>{revenue.data?.mrr ?? 0}</span>;\n * }\n * ```\n */\nexport class TapError extends Error {\n readonly code: TapErrorCode;\n\n constructor(code: TapErrorCode, message: string) {\n super(message);\n this.name = 'TapError';\n this.code = code;\n }\n\n /**\n * Narrows an unknown value to a `TapError`, by name and by a code it\n * recognises, so it holds across module instances.\n */\n static is(value: unknown): value is TapError {\n return (\n value instanceof Error &&\n value.name === 'TapError' &&\n 'code' in value &&\n typeof value.code === 'string' &&\n CODE_SET.has(value.code)\n );\n }\n}\n\n/**\n * The error a vendor server throws to answer a Tappify call with a code and a\n * message the owner sees.\n *\n * @remarks\n * `createTappifyHandler` catches it and answers `{ error: { code, message } }`\n * with `status`, or 400 when no status was given; the host relays both to the\n * calling mount, where they arrive as the `error` of `useTapServer`. Pick a code\n * of your own and keep it stable — the SDK's own codes are `SERVER_ERROR_CODES` —\n * and write the message for the owner, who reads it on screen.\n *\n * @example\n * ```ts\n * import { TapServerError } from '@tappify/extension-sdk/server';\n *\n * function assertRange(days: number) {\n * if (days > 0) return;\n * throw new TapServerError(\n * 'RANGE_TOO_SHORT',\n * 'getSummary needs a range of at least one day. Widen the date picker, then retry.',\n * 400,\n * );\n * }\n * ```\n */\nexport class TapServerError extends Error {\n readonly code: string;\n readonly status: number | undefined;\n\n constructor(code: string, message: string, status?: number) {\n super(message);\n this.name = 'TapServerError';\n this.code = code;\n this.status = status;\n }\n\n /** The wire body the handler answers with, without the status. */\n toJSON(): { error: { code: string; message: string } } {\n return { error: { code: this.code, message: this.message } };\n }\n\n /**\n * Narrows an unknown value to a `TapServerError` by name and by carrying a\n * string `code`, so it holds across module instances.\n */\n static is(value: unknown): value is TapServerError {\n return (\n value instanceof Error &&\n value.name === 'TapServerError' &&\n 'code' in value &&\n typeof value.code === 'string'\n );\n }\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;;;AC2BvB,IAAM,kBAA2C;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,WAAW,IAAI,IAAY,eAAe;AA8BzC,IAAM,WAAN,cAAuB,MAAM;AAAA,EAGlC,YAAY,MAAoB,SAAiB;AAC/C,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,GAAG,OAAmC;AAC3C,WACE,iBAAiB,SACjB,MAAM,SAAS,cACf,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,SAAS,IAAI,MAAM,IAAI;AAAA,EAE3B;AACF;;;AD/FO,IAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAsBhC,IAAM,QAAQ;AAAA,EACZ,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV,eAAe;AAAA,EACf,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,UAAU,IAAI,UAAQ,QAAQ,IAAI,UAAU;AAC1D,kBAAc;AAAA,MACZ;AAAA,EAAqC,MAAM,KAAK,IAAI,CAAC;AAAA;AAAA,IACvD;AAAA,EACF;AAEA,MAAI,YAAY,UAAU;AACxB,UAAM,OAAO,MAAM,QAAQ,QAAQ,YAAY,YAAY,SAAS,MAAM;AAC1E,kBAAc,KAAK,mCAAmC,IAAI,KAAK;AAAA,EACjE;AAEA,QAAM,mBAAmB,YAAY,WAAW,MAAM,UAAU,CAAC;AACjE,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,OAAO,MAAM,QAAQ;AAAA,MACzB;AAAA,MACA,iBAAiB,gBAAgB;AAAA,IACnC;AACA,kBAAc,KAAK,sCAAsC,IAAI,KAAK;AAAA,EACpE;AAEA,QAAM,eAAe,QAAQ,aAAa;AAC1C,QAAM,SACJ,cAAc,WAAW,IACrB,+CACA;AAAA,EAA8C,cAAc,KAAK,MAAM,CAAC;AAAA;AAE9E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAI,aAAa,SAAS,IAAI,CAAC,aAAa,KAAK,MAAM,GAAG,EAAE,IAAI,CAAC;AAAA,IACjE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;","names":[]}
1
+ {"version":3,"sources":["../src/codegen/generate.ts","../src/client/errors.ts"],"sourcesContent":["import { compile } from 'json-schema-to-typescript';\nimport { dirname, join } from 'node:path';\nimport { TapError } from '../client/errors';\nimport type {\n CredentialField,\n ExtensionManifest,\n JsonSchema,\n} from '../manifest/types';\n\nexport const GENERATED_HEADER = `/* eslint-disable */\n/**\n * Generated by \\`tappify extension types\\`. Do not edit by hand.\n * Re-run the command after changing tappify.extension.json or any schema it points at.\n */`;\n\nexport interface RegistrySnapshot {\n events: { name: string; payload?: JsonSchema }[];\n}\n\nexport interface GenerateTypesOptions {\n manifest: ExtensionManifest;\n registrySnapshot?: RegistrySnapshot;\n readSchemaFile?(path: string): JsonSchema;\n /**\n * The extension root. A `$ref` inside a schema file resolves against that\n * file's own directory under it, the way the host and the Tap Store read\n * it; without a root the process directory stands in.\n */\n cwd?: string;\n}\n\nconst STYLE = {\n bracketSpacing: true,\n printWidth: 80,\n semi: true,\n singleQuote: true,\n tabWidth: 2,\n trailingComma: 'all',\n useTabs: false,\n} as const;\n\nfunction pascal(value: string): string {\n return value\n .split(/[^A-Za-z0-9]+/)\n .filter(part => part !== '')\n .map(part => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n}\n\ninterface Emitter {\n declare(preferredName: string, schema: JsonSchema): Promise<string>;\n declarations(): string[];\n}\n\ninterface ResolvedSchema {\n schema: JsonSchema;\n /** Where the schema's own nested `$ref`s resolve from. */\n cwd?: string;\n}\n\nfunction createEmitter(\n resolveSchema: (schema: JsonSchema) => ResolvedSchema,\n): Emitter {\n const used = new Set<string>();\n const blocks: string[] = [];\n\n return {\n async declare(preferredName, schema) {\n let name = pascal(preferredName);\n let suffix = 2;\n while (used.has(name)) {\n name = `${pascal(preferredName)}${String(suffix)}`;\n suffix += 1;\n }\n used.add(name);\n\n const resolved = resolveSchema(schema);\n const input: Parameters<typeof compile>[0] = {\n ...resolved.schema,\n title: name,\n };\n\n const text = await compile(input, name, {\n bannerComment: '',\n additionalProperties: false,\n declareExternallyReferenced: true,\n enableConstEnums: false,\n format: true,\n style: STYLE,\n unknownAny: true,\n ...(resolved.cwd === undefined ? {} : { cwd: resolved.cwd }),\n });\n\n blocks.push(text.trim());\n return name;\n },\n declarations() {\n return blocks;\n },\n };\n}\n\nfunction credentialSchema(fields: CredentialField[]): JsonSchema {\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n\n for (const field of fields) {\n const property: JsonSchema =\n field.type === 'select' && field.options\n ? { type: 'string', enum: field.options }\n : { type: 'string' };\n if (field.help !== undefined) property.description = field.help;\n properties[field.name] = property;\n if (field.required) required.push(field.name);\n }\n\n return { type: 'object', properties, required, additionalProperties: false };\n}\n\nexport async function generateTypes(\n options: GenerateTypesOptions,\n): Promise<string> {\n const { manifest, registrySnapshot } = options;\n const contributes = manifest.contributes;\n\n const resolveSchema = (schema: JsonSchema): ResolvedSchema => {\n const ref = schema.$ref;\n if (typeof ref !== 'string' || ref.startsWith('#')) {\n return { schema, cwd: options.cwd };\n }\n if (options.readSchemaFile === undefined) {\n throw new TapError(\n 'TAP_SCHEMA_UNRESOLVED',\n `The manifest points at the schema file \"${ref}\", but this call passed no readSchemaFile. Run \\`tappify extension types\\`, which reads schema files from the extension directory, or supply readSchemaFile.`,\n );\n }\n return {\n schema: options.readSchemaFile(ref),\n cwd:\n options.cwd === undefined ? undefined : dirname(join(options.cwd, ref)),\n };\n };\n\n const emitter = createEmitter(resolveSchema);\n const augmentations: string[] = [];\n\n const storageEntries = Object.entries(contributes.storage ?? {});\n if (storageEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, collection] of storageEntries) {\n const typeName = await emitter.declare(name, collection.schema);\n const kind = collection.singleton === true ? 'singleton' : 'collection';\n lines.push(\n ` '${name}': { kind: '${kind}'; scope: '${collection.scope}'; document: ${typeName} };`,\n );\n }\n augmentations.push(` interface TapStorageMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const procedureEntries = Object.entries(manifest.server?.procedures ?? {});\n if (procedureEntries.length > 0) {\n const lines: string[] = [];\n for (const [name, declaration] of procedureEntries) {\n const inputName = await emitter.declare(\n `${name}Input`,\n declaration.input,\n );\n const outputName = await emitter.declare(\n `${name}Output`,\n declaration.output,\n );\n lines.push(\n ` '${name}': { input: ${inputName}; output: ${outputName} };`,\n );\n }\n augmentations.push(\n ` interface TapProcedureMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const actions = contributes.ai?.actions ?? [];\n if (actions.length > 0) {\n const lines: string[] = [];\n for (const action of actions) {\n const name = await emitter.declare(`${action.id}Input`, action.input);\n lines.push(` '${action.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapActionMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const tools = contributes.ai?.tools ?? [];\n if (tools.length > 0) {\n const lines: string[] = [];\n for (const tool of tools) {\n const name = await emitter.declare(`${tool.id}Input`, tool.input);\n lines.push(` '${tool.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapToolMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const prompts = (contributes.ai?.prompts ?? []).filter(\n prompt => prompt.input !== undefined,\n );\n if (prompts.length > 0) {\n const lines: string[] = [];\n for (const prompt of prompts) {\n const name = await emitter.declare(\n `${prompt.id}PromptInput`,\n prompt.input ?? { type: 'object' },\n );\n lines.push(` '${prompt.id}': { input: ${name} };`);\n }\n augmentations.push(` interface TapPromptMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n const webhooks = contributes.webhooks ?? [];\n if (webhooks.length > 0) {\n const lines: string[] = [];\n for (const webhook of webhooks) {\n const name = await emitter.declare(\n `${webhook.event}Payload`,\n webhook.payload,\n );\n lines.push(` '${webhook.event}': ${name};`);\n }\n augmentations.push(` interface TapWebhookMap {\\n${lines.join('\\n')}\\n }`);\n }\n\n if (registrySnapshot !== undefined && registrySnapshot.events.length > 0) {\n const lines: string[] = [];\n for (const event of registrySnapshot.events) {\n const name = await emitter.declare(\n `${event.name}Event`,\n event.payload ?? { type: 'object' },\n );\n lines.push(` '${event.name}': ${name};`);\n }\n augmentations.push(\n ` interface TapHostEventMap {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n const telemetry = manifest.telemetry ?? [];\n if (telemetry.length > 0) {\n const lines = telemetry.map(name => ` '${name}': true;`);\n augmentations.push(\n ` interface TapTelemetryEvents {\\n${lines.join('\\n')}\\n }`,\n );\n }\n\n if (contributes.settings) {\n const name = await emitter.declare('Settings', contributes.settings.schema);\n augmentations.push(` interface TapSettings extends ${name} {}`);\n }\n\n const credentialFields = contributes.connector?.auth?.fields ?? [];\n if (credentialFields.length > 0) {\n const name = await emitter.declare(\n 'Credentials',\n credentialSchema(credentialFields),\n );\n augmentations.push(` interface TapCredentials extends ${name} {}`);\n }\n\n const declarations = emitter.declarations();\n const module =\n augmentations.length === 0\n ? \"declare module '@tappify/extension-sdk' {}\"\n : `declare module '@tappify/extension-sdk' {\\n${augmentations.join('\\n\\n')}\\n}`;\n\n return [\n GENERATED_HEADER,\n '',\n ...(declarations.length > 0 ? [declarations.join('\\n\\n'), ''] : []),\n module,\n '',\n 'export {};',\n '',\n ].join('\\n');\n}\n","/** Every code a `TapError` the SDK raises carries. */\nexport type TapErrorCode =\n | 'TAP_OUTSIDE_HOST'\n | 'TAP_SCOPE_MISSING'\n | 'TAP_UNKNOWN_COLLECTION'\n | 'TAP_UNKNOWN_PROCEDURE'\n | 'TAP_NO_PORTAL'\n | 'TAP_NO_QUERY_CLIENT'\n | 'TAP_MANIFEST_INVALID'\n | 'TAP_ENTRY_MISSING'\n | 'TAP_STYLES_UNRESOLVED'\n | 'TAP_SCHEMA_UNRESOLVED'\n | 'TAP_TOKEN_MISSING'\n | 'TAP_TOKEN_INVALID'\n | 'TAP_TOKEN_AUDIENCE'\n | 'TAP_EVENT_ID_MISSING'\n | 'TAP_BODY_INVALID'\n | 'TAP_BODY_TOO_LARGE'\n | 'TAP_ROUTE_UNKNOWN'\n | 'TAP_HANDLER_MISSING'\n | 'TAP_INTERNAL_ERROR'\n | 'TAP_WEBHOOK_REJECTED'\n | 'TAP_TEST_TARGET_INVALID';\n\n/**\n * The same codes as `TapErrorCode`, as an array to iterate or check membership\n * against at runtime.\n */\nexport const TAP_ERROR_CODES: readonly TapErrorCode[] = [\n 'TAP_OUTSIDE_HOST',\n 'TAP_SCOPE_MISSING',\n 'TAP_UNKNOWN_COLLECTION',\n 'TAP_UNKNOWN_PROCEDURE',\n 'TAP_NO_PORTAL',\n 'TAP_NO_QUERY_CLIENT',\n 'TAP_MANIFEST_INVALID',\n 'TAP_ENTRY_MISSING',\n 'TAP_STYLES_UNRESOLVED',\n 'TAP_SCHEMA_UNRESOLVED',\n 'TAP_TOKEN_MISSING',\n 'TAP_TOKEN_INVALID',\n 'TAP_TOKEN_AUDIENCE',\n 'TAP_EVENT_ID_MISSING',\n 'TAP_BODY_INVALID',\n 'TAP_BODY_TOO_LARGE',\n 'TAP_ROUTE_UNKNOWN',\n 'TAP_HANDLER_MISSING',\n 'TAP_INTERNAL_ERROR',\n 'TAP_WEBHOOK_REJECTED',\n 'TAP_TEST_TARGET_INVALID',\n];\n\nconst CODE_SET = new Set<string>(TAP_ERROR_CODES);\n\n/**\n * The error the SDK and the host raise when a call cannot be served at all.\n *\n * @remarks\n * The SDK throws it for a mount outside the host (`TAP_OUTSIDE_HOST`), a\n * collection or procedure the manifest does not declare\n * (`TAP_UNKNOWN_COLLECTION`, `TAP_UNKNOWN_PROCEDURE`), a missing portal or query\n * client, a token the server rejected, and a misused testing helper. The host\n * turns a refused read or write into `TAP_SCOPE_MISSING`. Branch on `code`, which\n * is stable; the message is prose and changes. An error your own server raised is\n * a `TapServerError` instead.\n *\n * @example\n * ```tsx\n * import { TapError, useTapQuery } from '@tappify/extension-sdk';\n * import { ErrorState } from '@tappify/extension-sdk/ui';\n *\n * function Revenue() {\n * const revenue = useTapQuery({\n * kind: 'revenue',\n * range: { from: '2026-09-01', to: '2026-09-08' },\n * });\n * if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {\n * return <ErrorState title=\"Revenue is not shared with this extension\" />;\n * }\n * return <span>{revenue.data?.mrr ?? 0}</span>;\n * }\n * ```\n */\nexport class TapError extends Error {\n readonly code: TapErrorCode;\n\n constructor(code: TapErrorCode, message: string) {\n super(message);\n this.name = 'TapError';\n this.code = code;\n }\n\n /**\n * Narrows an unknown value to a `TapError`, by name and by a code it\n * recognises, so it holds across module instances.\n */\n static is(value: unknown): value is TapError {\n return (\n value instanceof Error &&\n value.name === 'TapError' &&\n 'code' in value &&\n typeof value.code === 'string' &&\n CODE_SET.has(value.code)\n );\n }\n}\n\n/**\n * The error a vendor server throws to answer a Tappify call with a code and a\n * message the owner sees.\n *\n * @remarks\n * `createTappifyHandler` catches it and answers `{ error: { code, message } }`\n * with `status`, or 400 when no status was given; the host relays both to the\n * calling mount, where they arrive as the `error` of `useTapServer`. Pick a code\n * of your own and keep it stable — the SDK's own codes are `SERVER_ERROR_CODES` —\n * and write the message for the owner, who reads it on screen.\n *\n * @example\n * ```ts\n * import { TapServerError } from '@tappify/extension-sdk/server';\n *\n * function assertRange(days: number) {\n * if (days > 0) return;\n * throw new TapServerError(\n * 'RANGE_TOO_SHORT',\n * 'getSummary needs a range of at least one day. Widen the date picker, then retry.',\n * 400,\n * );\n * }\n * ```\n */\nexport class TapServerError extends Error {\n readonly code: string;\n readonly status: number | undefined;\n\n constructor(code: string, message: string, status?: number) {\n super(message);\n this.name = 'TapServerError';\n this.code = code;\n this.status = status;\n }\n\n /** The wire body the handler answers with, without the status. */\n toJSON(): { error: { code: string; message: string } } {\n return { error: { code: this.code, message: this.message } };\n }\n\n /**\n * Narrows an unknown value to a `TapServerError` by name and by carrying a\n * string `code`, so it holds across module instances.\n */\n static is(value: unknown): value is TapServerError {\n return (\n value instanceof Error &&\n value.name === 'TapServerError' &&\n 'code' in value &&\n typeof value.code === 'string'\n );\n }\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;;;AC2BvB,IAAM,kBAA2C;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,WAAW,IAAI,IAAY,eAAe;AA+BzC,IAAM,WAAN,cAAuB,MAAM;AAAA,EAGlC,YAAY,MAAoB,SAAiB;AAC/C,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;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uthTokenRequestEncoding = 'form' | 'json';
78
79
  interface ConnectorAuth {
79
80
  method: 'none' | 'api_key' | 'oauth';
80
81
  fields?: CredentialField[];
@@ -82,6 +83,8 @@ interface ConnectorAuth {
82
83
  authorizationUrl: string;
83
84
  tokenUrl: string;
84
85
  scopes: string[];
86
+ /** The token request body encoding. When omitted, uses form encoding. */
87
+ tokenRequestEncoding?: OAuthTokenRequestEncoding;
85
88
  };
86
89
  }
87
90
  interface DimensionDeclaration {
@@ -163,26 +166,53 @@ interface AiContribution {
163
166
  prompts?: PromptDeclaration[];
164
167
  context?: ContextDeclaration[];
165
168
  }
169
+ type WorkDirection = 'none' | 'to_provider' | 'from_provider' | 'two-way';
170
+ type WorkAuth = {
171
+ method: 'oauth';
172
+ provider: string;
173
+ scopes: string[];
174
+ } | {
175
+ method: 'api_key';
176
+ fields: CredentialField[];
177
+ };
166
178
  interface WorkContribution {
167
179
  kind: 'tracker' | 'docs' | 'chat';
168
- container: {
180
+ creates: ('issue' | 'page' | 'message')[];
181
+ identity: 'install' | 'user';
182
+ comments: 'two-way' | 'none' | {
183
+ direction: WorkDirection;
184
+ supportsEdits: false;
185
+ supportsDeletes: false;
186
+ };
187
+ status?: {
188
+ direction: WorkDirection;
189
+ webhook?: string;
190
+ map?: Record<'open' | 'in_progress' | 'done', string[]>;
191
+ };
192
+ attachments: ('image' | 'link')[];
193
+ auth: WorkAuth;
194
+ /** @deprecated resolved dynamically by describe_container */
195
+ container?: {
169
196
  label: string;
170
197
  list: string;
171
198
  };
172
- creates: ('issue' | 'page' | 'message')[];
173
- fields: {
199
+ /** @deprecated resolved dynamically by describe_container */
200
+ fields?: {
174
201
  priority?: string[];
175
202
  labels?: boolean;
176
203
  assignee?: boolean;
177
204
  required: string[];
178
205
  };
179
- attachments: ('image' | 'link')[];
206
+ }
207
+ /** @deprecated Migrate to WorkContribution during the SDK v2 compatibility window. */
208
+ interface LegacyWorkContribution extends Omit<WorkContribution, 'auth' | 'container' | 'fields' | 'comments' | 'status'> {
209
+ container: NonNullable<WorkContribution['container']>;
210
+ fields: NonNullable<WorkContribution['fields']>;
180
211
  comments: 'two-way' | 'none';
181
212
  status?: {
182
213
  webhook: string;
183
214
  map: Record<'open' | 'in_progress' | 'done', string[]>;
184
215
  };
185
- identity: 'user' | 'install';
186
216
  }
187
217
  interface ExtensionListing {
188
218
  longDescription?: string;
@@ -215,7 +245,7 @@ interface ExtensionManifest {
215
245
  connector?: ConnectorContribution;
216
246
  webhooks?: WebhookContribution[];
217
247
  ai?: AiContribution;
218
- work?: WorkContribution;
248
+ work?: WorkContribution | LegacyWorkContribution;
219
249
  };
220
250
  server?: {
221
251
  baseUrl: string;
@@ -277,6 +307,12 @@ declare const SCOPES: readonly [{
277
307
  readonly description: "Review text, ratings and replies";
278
308
  readonly requiresSecurityReview: false;
279
309
  readonly requiresJustification: false;
310
+ }, {
311
+ readonly key: "review.threads:read";
312
+ readonly label: "Read Review threads";
313
+ readonly description: "Review threads, comments, screenshot descriptors, build context and safe device context";
314
+ readonly requiresSecurityReview: false;
315
+ readonly requiresJustification: false;
280
316
  }, {
281
317
  readonly key: "crashes:read";
282
318
  readonly label: "Read crash data";
@@ -340,7 +376,7 @@ declare const SCOPES: readonly [{
340
376
  }, {
341
377
  readonly key: "work:sync";
342
378
  readonly label: "Sync work items";
343
- readonly description: "Two-way comments and status on created work items";
379
+ readonly description: "Sync comments and status on created work items";
344
380
  readonly requiresSecurityReview: false;
345
381
  readonly requiresJustification: true;
346
382
  }, {
@@ -446,4 +482,4 @@ declare const findPage: (key: string) => PageDefinition | undefined;
446
482
  declare const findTable: (key: string) => TableDefinition | undefined;
447
483
  declare const slotsForPage: (page: string) => readonly SlotId[];
448
484
 
449
- export { TABLES as $, type ActionDeclaration as A, type BannerContribution as B, CARD_KEYS as C, type DataQueryKind as D, type ExtensionManifest as E, type PageDefinition as F, type ProcedureDeclaration as G, type HostEventName as H, type PromptDeclaration as I, type JsonSchema as J, KINDS as K, SCOPES as L, type ManifestValidation as M, SCOPE_KEYS as N, SERVED_SDK_MAJORS as O, PAGES as P, QUERY_SCOPES as Q, type RowActionContribution as R, type ScopeKey as S, SLOTS as T, type UiContributionRef as U, type ScopeDefinition as V, type ScopeEntry as W, type SeriesContribution as X, type SettingsContribution as Y, type SkillDeclaration as Z, type StorageCollection as _, type HostPage as a, TABLE_KEYS as a0, type TabContribution as a1, type TableDefinition as a2, type ToolDeclaration as a3, type WebhookContribution as a4, type WidgetContribution as a5, type WorkContribution as a6, findPage as a7, findScope as a8, findTable as a9, slotsForPage as aa, type SlotId as b, type ExposableKind as c, type AiContribution as d, CATEGORIES as e, CHARTS as f, type ConnectorAuth as g, type ConnectorContribution as h, type ContextDeclaration as i, type ContributionKind as j, type CredentialField as k, type DimensionDeclaration as l, EVENTS as m, type ExtensionCategory as n, type ExtensionInstallScope as o, type ExtensionListing as p, type ExtensionVisibility as q, type HostChart as r, type HostTable as s, type KnowledgeDeclaration as t, type ManifestIssue as u, type MarkerContribution as v, type MentionDeclaration as w, type MetricDeclaration as x, PAGE_KEYS as y, type PageContribution as z };
485
+ export { type SkillDeclaration as $, type ActionDeclaration as A, type BannerContribution as B, CARD_KEYS as C, type DataQueryKind as D, type ExtensionManifest as E, type PageDefinition as F, type ProcedureDeclaration as G, type HostEventName as H, type PromptDeclaration as I, type JsonSchema as J, KINDS as K, type LegacyWorkContribution as L, type ManifestValidation as M, SCOPES as N, type OAuthTokenRequestEncoding as O, PAGES as P, QUERY_SCOPES as Q, type RowActionContribution as R, type ScopeKey as S, SCOPE_KEYS as T, type UiContributionRef as U, SERVED_SDK_MAJORS as V, SLOTS as W, type ScopeDefinition as X, type ScopeEntry as Y, type SeriesContribution as Z, type SettingsContribution as _, type HostPage as a, type StorageCollection as a0, TABLES as a1, TABLE_KEYS as a2, type TabContribution as a3, type TableDefinition as a4, type ToolDeclaration as a5, type WebhookContribution as a6, type WidgetContribution as a7, type WorkAuth as a8, type WorkContribution as a9, type WorkDirection as aa, findPage as ab, findScope as ac, findTable as ad, slotsForPage as ae, type SlotId as b, type ExposableKind as c, type ManifestIssue as d, type AiContribution as e, CATEGORIES as f, CHARTS as g, type ConnectorAuth as h, type ConnectorContribution as i, type ContextDeclaration as j, type ContributionKind as k, type CredentialField as l, type DimensionDeclaration as m, EVENTS as n, type ExtensionCategory as o, type ExtensionInstallScope as p, type ExtensionListing as q, type ExtensionVisibility as r, type HostChart as s, type HostTable as t, type KnowledgeDeclaration as u, type MarkerContribution as v, type MentionDeclaration as w, type MetricDeclaration as x, PAGE_KEYS as y, type PageContribution as z };
@@ -75,6 +75,7 @@ interface CredentialField {
75
75
  options?: string[];
76
76
  help?: string;
77
77
  }
78
+ type OAuthTokenRequestEncoding = 'form' | 'json';
78
79
  interface ConnectorAuth {
79
80
  method: 'none' | 'api_key' | 'oauth';
80
81
  fields?: CredentialField[];
@@ -82,6 +83,8 @@ interface ConnectorAuth {
82
83
  authorizationUrl: string;
83
84
  tokenUrl: string;
84
85
  scopes: string[];
86
+ /** The token request body encoding. When omitted, uses form encoding. */
87
+ tokenRequestEncoding?: OAuthTokenRequestEncoding;
85
88
  };
86
89
  }
87
90
  interface DimensionDeclaration {
@@ -163,26 +166,53 @@ interface AiContribution {
163
166
  prompts?: PromptDeclaration[];
164
167
  context?: ContextDeclaration[];
165
168
  }
169
+ type WorkDirection = 'none' | 'to_provider' | 'from_provider' | 'two-way';
170
+ type WorkAuth = {
171
+ method: 'oauth';
172
+ provider: string;
173
+ scopes: string[];
174
+ } | {
175
+ method: 'api_key';
176
+ fields: CredentialField[];
177
+ };
166
178
  interface WorkContribution {
167
179
  kind: 'tracker' | 'docs' | 'chat';
168
- container: {
180
+ creates: ('issue' | 'page' | 'message')[];
181
+ identity: 'install' | 'user';
182
+ comments: 'two-way' | 'none' | {
183
+ direction: WorkDirection;
184
+ supportsEdits: false;
185
+ supportsDeletes: false;
186
+ };
187
+ status?: {
188
+ direction: WorkDirection;
189
+ webhook?: string;
190
+ map?: Record<'open' | 'in_progress' | 'done', string[]>;
191
+ };
192
+ attachments: ('image' | 'link')[];
193
+ auth: WorkAuth;
194
+ /** @deprecated resolved dynamically by describe_container */
195
+ container?: {
169
196
  label: string;
170
197
  list: string;
171
198
  };
172
- creates: ('issue' | 'page' | 'message')[];
173
- fields: {
199
+ /** @deprecated resolved dynamically by describe_container */
200
+ fields?: {
174
201
  priority?: string[];
175
202
  labels?: boolean;
176
203
  assignee?: boolean;
177
204
  required: string[];
178
205
  };
179
- attachments: ('image' | 'link')[];
206
+ }
207
+ /** @deprecated Migrate to WorkContribution during the SDK v2 compatibility window. */
208
+ interface LegacyWorkContribution extends Omit<WorkContribution, 'auth' | 'container' | 'fields' | 'comments' | 'status'> {
209
+ container: NonNullable<WorkContribution['container']>;
210
+ fields: NonNullable<WorkContribution['fields']>;
180
211
  comments: 'two-way' | 'none';
181
212
  status?: {
182
213
  webhook: string;
183
214
  map: Record<'open' | 'in_progress' | 'done', string[]>;
184
215
  };
185
- identity: 'user' | 'install';
186
216
  }
187
217
  interface ExtensionListing {
188
218
  longDescription?: string;
@@ -215,7 +245,7 @@ interface ExtensionManifest {
215
245
  connector?: ConnectorContribution;
216
246
  webhooks?: WebhookContribution[];
217
247
  ai?: AiContribution;
218
- work?: WorkContribution;
248
+ work?: WorkContribution | LegacyWorkContribution;
219
249
  };
220
250
  server?: {
221
251
  baseUrl: string;
@@ -277,6 +307,12 @@ declare const SCOPES: readonly [{
277
307
  readonly description: "Review text, ratings and replies";
278
308
  readonly requiresSecurityReview: false;
279
309
  readonly requiresJustification: false;
310
+ }, {
311
+ readonly key: "review.threads:read";
312
+ readonly label: "Read Review threads";
313
+ readonly description: "Review threads, comments, screenshot descriptors, build context and safe device context";
314
+ readonly requiresSecurityReview: false;
315
+ readonly requiresJustification: false;
280
316
  }, {
281
317
  readonly key: "crashes:read";
282
318
  readonly label: "Read crash data";
@@ -340,7 +376,7 @@ declare const SCOPES: readonly [{
340
376
  }, {
341
377
  readonly key: "work:sync";
342
378
  readonly label: "Sync work items";
343
- readonly description: "Two-way comments and status on created work items";
379
+ readonly description: "Sync comments and status on created work items";
344
380
  readonly requiresSecurityReview: false;
345
381
  readonly requiresJustification: true;
346
382
  }, {
@@ -446,4 +482,4 @@ declare const findPage: (key: string) => PageDefinition | undefined;
446
482
  declare const findTable: (key: string) => TableDefinition | undefined;
447
483
  declare const slotsForPage: (page: string) => readonly SlotId[];
448
484
 
449
- export { TABLES as $, type ActionDeclaration as A, type BannerContribution as B, CARD_KEYS as C, type DataQueryKind as D, type ExtensionManifest as E, type PageDefinition as F, type ProcedureDeclaration as G, type HostEventName as H, type PromptDeclaration as I, type JsonSchema as J, KINDS as K, SCOPES as L, type ManifestValidation as M, SCOPE_KEYS as N, SERVED_SDK_MAJORS as O, PAGES as P, QUERY_SCOPES as Q, type RowActionContribution as R, type ScopeKey as S, SLOTS as T, type UiContributionRef as U, type ScopeDefinition as V, type ScopeEntry as W, type SeriesContribution as X, type SettingsContribution as Y, type SkillDeclaration as Z, type StorageCollection as _, type HostPage as a, TABLE_KEYS as a0, type TabContribution as a1, type TableDefinition as a2, type ToolDeclaration as a3, type WebhookContribution as a4, type WidgetContribution as a5, type WorkContribution as a6, findPage as a7, findScope as a8, findTable as a9, slotsForPage as aa, type SlotId as b, type ExposableKind as c, type AiContribution as d, CATEGORIES as e, CHARTS as f, type ConnectorAuth as g, type ConnectorContribution as h, type ContextDeclaration as i, type ContributionKind as j, type CredentialField as k, type DimensionDeclaration as l, EVENTS as m, type ExtensionCategory as n, type ExtensionInstallScope as o, type ExtensionListing as p, type ExtensionVisibility as q, type HostChart as r, type HostTable as s, type KnowledgeDeclaration as t, type ManifestIssue as u, type MarkerContribution as v, type MentionDeclaration as w, type MetricDeclaration as x, PAGE_KEYS as y, type PageContribution as z };
485
+ export { type SkillDeclaration as $, type ActionDeclaration as A, type BannerContribution as B, CARD_KEYS as C, type DataQueryKind as D, type ExtensionManifest as E, type PageDefinition as F, type ProcedureDeclaration as G, type HostEventName as H, type PromptDeclaration as I, type JsonSchema as J, KINDS as K, type LegacyWorkContribution as L, type ManifestValidation as M, SCOPES as N, type OAuthTokenRequestEncoding as O, PAGES as P, QUERY_SCOPES as Q, type RowActionContribution as R, type ScopeKey as S, SCOPE_KEYS as T, type UiContributionRef as U, SERVED_SDK_MAJORS as V, SLOTS as W, type ScopeDefinition as X, type ScopeEntry as Y, type SeriesContribution as Z, type SettingsContribution as _, type HostPage as a, type StorageCollection as a0, TABLES as a1, TABLE_KEYS as a2, type TabContribution as a3, type TableDefinition as a4, type ToolDeclaration as a5, type WebhookContribution as a6, type WidgetContribution as a7, type WorkAuth as a8, type WorkContribution as a9, type WorkDirection as aa, findPage as ab, findScope as ac, findTable as ad, slotsForPage as ae, type SlotId as b, type ExposableKind as c, type ManifestIssue as d, type AiContribution as e, CATEGORIES as f, CHARTS as g, type ConnectorAuth as h, type ConnectorContribution as i, type ContextDeclaration as j, type ContributionKind as k, type CredentialField as l, type DimensionDeclaration as m, EVENTS as n, type ExtensionCategory as o, type ExtensionInstallScope as p, type ExtensionListing as q, type ExtensionVisibility as r, type HostChart as s, type HostTable as t, type KnowledgeDeclaration as u, type MarkerContribution as v, type MentionDeclaration as w, type MetricDeclaration as x, PAGE_KEYS as y, type PageContribution as z };
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'react';
2
- import { T as Tap } from './types-DrpQSv_2.cjs';
2
+ import { T as Tap } from './types-BdDaLnqs.cjs';
3
3
 
4
4
  declare const TapContext: Context<Tap | null>;
5
5
  /**
@@ -13,14 +13,15 @@ declare const TapContext: Context<Tap | null>;
13
13
  *
14
14
  * @example
15
15
  * ```tsx
16
- * import { TapButton, useTap } from '@tappify/extension-sdk';
16
+ * import { useTap } from '@tappify/extension-sdk';
17
+ * import { Button } from '@tappify/extension-sdk/ui';
17
18
  *
18
19
  * function CopyId() {
19
20
  * const tap = useTap();
20
21
  * return (
21
- * <TapButton onClick={() => void tap.ui.copy(tap.project.id)}>
22
+ * <Button onClick={() => void tap.ui.copy(tap.project.id)}>
22
23
  * Copy project id
23
- * </TapButton>
24
+ * </Button>
24
25
  * );
25
26
  * }
26
27
  * ```
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'react';
2
- import { T as Tap } from './types-DDAGLpov.js';
2
+ import { T as Tap } from './types-uGHrRaOj.js';
3
3
 
4
4
  declare const TapContext: Context<Tap | null>;
5
5
  /**
@@ -13,14 +13,15 @@ declare const TapContext: Context<Tap | null>;
13
13
  *
14
14
  * @example
15
15
  * ```tsx
16
- * import { TapButton, useTap } from '@tappify/extension-sdk';
16
+ * import { useTap } from '@tappify/extension-sdk';
17
+ * import { Button } from '@tappify/extension-sdk/ui';
17
18
  *
18
19
  * function CopyId() {
19
20
  * const tap = useTap();
20
21
  * return (
21
- * <TapButton onClick={() => void tap.ui.copy(tap.project.id)}>
22
+ * <Button onClick={() => void tap.ui.copy(tap.project.id)}>
22
23
  * Copy project id
23
- * </TapButton>
24
+ * </Button>
24
25
  * );
25
26
  * }
26
27
  * ```
@@ -19,7 +19,8 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
19
19
  *
20
20
  * @example
21
21
  * ```tsx
22
- * import { TapError, TapErrorState, useTapQuery } from '@tappify/extension-sdk';
22
+ * import { TapError, useTapQuery } from '@tappify/extension-sdk';
23
+ * import { ErrorState } from '@tappify/extension-sdk/ui';
23
24
  *
24
25
  * function Revenue() {
25
26
  * const revenue = useTapQuery({
@@ -27,7 +28,7 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
27
28
  * range: { from: '2026-09-01', to: '2026-09-08' },
28
29
  * });
29
30
  * if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {
30
- * return <TapErrorState title="Revenue is not shared with this extension" />;
31
+ * return <ErrorState title="Revenue is not shared with this extension" />;
31
32
  * }
32
33
  * return <span>{revenue.data?.mrr ?? 0}</span>;
33
34
  * }
@@ -19,7 +19,8 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
19
19
  *
20
20
  * @example
21
21
  * ```tsx
22
- * import { TapError, TapErrorState, useTapQuery } from '@tappify/extension-sdk';
22
+ * import { TapError, useTapQuery } from '@tappify/extension-sdk';
23
+ * import { ErrorState } from '@tappify/extension-sdk/ui';
23
24
  *
24
25
  * function Revenue() {
25
26
  * const revenue = useTapQuery({
@@ -27,7 +28,7 @@ declare const TAP_ERROR_CODES: readonly TapErrorCode[];
27
28
  * range: { from: '2026-09-01', to: '2026-09-08' },
28
29
  * });
29
30
  * if (TapError.is(revenue.error) && revenue.error.code === 'TAP_SCOPE_MISSING') {
30
- * return <TapErrorState title="Revenue is not shared with this extension" />;
31
+ * return <ErrorState title="Revenue is not shared with this extension" />;
31
32
  * }
32
33
  * return <span>{revenue.data?.mrr ?? 0}</span>;
33
34
  * }
package/dist/host.cjs CHANGED
@@ -1,11 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunk7KIKOH5Hcjs = require('./chunk-7KIKOH5H.cjs');
4
+ var _chunkVV7ELNRWcjs = require('./chunk-VV7ELNRW.cjs');
5
5
 
6
6
 
7
- var _chunkOPPYEA7Fcjs = require('./chunk-OPPYEA7F.cjs');
8
- require('./chunk-2DBSVKAU.cjs');
7
+ var _chunkPRCZMOLDcjs = require('./chunk-PRCZMOLD.cjs');
8
+ require('./chunk-6HETNZJY.cjs');
9
+ require('./chunk-Q7SFCCGT.cjs');
9
10
 
10
11
  // src/host/collect-styles.ts
11
12
  function collectStyles(remoteModule) {
@@ -20,5 +21,5 @@ function collectStyles(remoteModule) {
20
21
 
21
22
 
22
23
 
23
- exports.TapContext = _chunkOPPYEA7Fcjs.TapContext; exports.TapHostProvider = _chunk7KIKOH5Hcjs.TapHostProvider; exports.collectStyles = collectStyles; exports.createHostQueryClient = _chunk7KIKOH5Hcjs.createHostQueryClient;
24
+ exports.TapContext = _chunkPRCZMOLDcjs.TapContext; exports.TapHostProvider = _chunkVV7ELNRWcjs.TapHostProvider; exports.collectStyles = collectStyles; exports.createHostQueryClient = _chunkVV7ELNRWcjs.createHostQueryClient;
24
25
  //# sourceMappingURL=host.cjs.map
package/dist/host.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/vulakh/Desktop/Work/Tappify/extension-sdk/dist/host.cjs","../src/host/collect-styles.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACTO,SAAS,aAAA,CAAc,YAAA,EAAiC;AAC7D,EAAA,GAAA,CAAI,OAAO,aAAA,IAAiB,SAAA,GAAY,aAAA,IAAiB,IAAA,EAAM,OAAO,CAAC,CAAA;AACvE,EAAA,GAAA,CAAI,CAAA,CAAE,SAAA,GAAY,YAAA,CAAA,EAAe,OAAO,CAAC,CAAA;AAEzC,EAAA,MAAM,OAAA,EAAS,YAAA,CAAa,MAAA;AAC5B,EAAA,GAAA,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG,OAAO,CAAC,CAAA;AAEpC,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,CAAC,KAAA,EAAA,GAA2B,OAAO,MAAA,IAAU,QAAQ,CAAA;AAC5E;ADSA;AACE;AACA;AACA;AACA;AACF,+NAAC","file":"/Users/vulakh/Desktop/Work/Tappify/extension-sdk/dist/host.cjs","sourcesContent":[null,"export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/extension-sdk/extension-sdk/dist/host.cjs","../src/host/collect-styles.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACVO,SAAS,aAAA,CAAc,YAAA,EAAiC;AAC7D,EAAA,GAAA,CAAI,OAAO,aAAA,IAAiB,SAAA,GAAY,aAAA,IAAiB,IAAA,EAAM,OAAO,CAAC,CAAA;AACvE,EAAA,GAAA,CAAI,CAAA,CAAE,SAAA,GAAY,YAAA,CAAA,EAAe,OAAO,CAAC,CAAA;AAEzC,EAAA,MAAM,OAAA,EAAS,YAAA,CAAa,MAAA;AAC5B,EAAA,GAAA,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG,OAAO,CAAC,CAAA;AAEpC,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,CAAC,KAAA,EAAA,GAA2B,OAAO,MAAA,IAAU,QAAQ,CAAA;AAC5E;ADUA;AACE;AACA;AACA;AACA;AACF,+NAAC","file":"/home/runner/work/extension-sdk/extension-sdk/dist/host.cjs","sourcesContent":[null,"export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"]}
package/dist/host.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- export { T as TapContext } from './context-Dt6xh_5t.cjs';
2
- import { T as Tap } from './types-DrpQSv_2.cjs';
3
- export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-DrpQSv_2.cjs';
1
+ export { T as TapContext } from './context-DI0EJCRD.cjs';
2
+ import { T as Tap } from './types-BdDaLnqs.cjs';
3
+ export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-BdDaLnqs.cjs';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import { ReactNode, ReactElement } from 'react';
6
- export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-DJ_KgZpN.cjs';
6
+ export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-Bh759FUI.cjs';
7
7
 
8
8
  declare function collectStyles(remoteModule: unknown): string[];
9
9
 
@@ -12,7 +12,7 @@ interface TapHostProviderProps {
12
12
  children: ReactNode;
13
13
  /**
14
14
  * A host that already renders a QueryClientProvider leaves this out; a
15
- * standalone host such as the portal preview passes one from
15
+ * standalone host such as the local preview passes one from
16
16
  * `createHostQueryClient()` so the data hooks find a client.
17
17
  */
18
18
  queryClient?: QueryClient;
package/dist/host.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { T as TapContext } from './context-Ml7k_V14.js';
2
- import { T as Tap } from './types-DDAGLpov.js';
3
- export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-DDAGLpov.js';
1
+ export { T as TapContext } from './context-mr8R5CNt.js';
2
+ import { T as Tap } from './types-uGHrRaOj.js';
3
+ export { A as ActionId, k as ActionInput, P as PromptId, l as PromptInput, m as TapActionMap, n as TapActionRun, o as TapApp, p as TapChangeKey, q as TapChatCard, r as TapCollection, s as TapComparisonSide, t as TapConfirmOptions, u as TapCrashIssue, v as TapCrashesResult, w as TapCredentialValues, x as TapCredentials, y as TapDateRange, a as TapFilters, z as TapFormatters, B as TapHostEventMap, c as TapHostEvents, C as TapInternals, D as TapKeyword, E as TapKeywordsResult, F as TapListing, G as TapListingResult, H as TapPageProps, I as TapPath, J as TapPlatform, K as TapPlatformFilter, g as TapProcedureInput, L as TapProcedureMap, f as TapProcedureName, h as TapProcedureOutput, M as TapProcedures, N as TapProjectResult, O as TapPromptMap, d as TapQuery, Q as TapRelease, e as TapResult, R as TapRevenueResult, S as TapReview, U as TapReviewsResult, V as TapRowActionProps, W as TapSeriesMetric, X as TapSeriesPoint, Y as TapSeriesResult, Z as TapSettings, _ as TapSettingsProps, $ as TapSettingsValues, a0 as TapSingleton, j as TapSingletonDocument, i as TapSingletonName, b as TapSize, a1 as TapStorage, a2 as TapStorageMap, a3 as TapTabProps, a4 as TapTableColumn, a5 as TapTelemetryEvents, a6 as TapToastTone, a7 as TapToolMap, a8 as TapWebhookMap, a9 as TapWidgetProps, aa as TelemetryEvent, ab as ToolId, ac as ToolInput, ad as WebhookName, ae as WebhookPayload } from './types-uGHrRaOj.js';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import { ReactNode, ReactElement } from 'react';
6
- export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-DJ_KgZpN.js';
6
+ export { D as DataQueryKind, H as HostEventName, a as HostPage, S as ScopeKey, b as SlotId } from './constants-Bh759FUI.js';
7
7
 
8
8
  declare function collectStyles(remoteModule: unknown): string[];
9
9
 
@@ -12,7 +12,7 @@ interface TapHostProviderProps {
12
12
  children: ReactNode;
13
13
  /**
14
14
  * A host that already renders a QueryClientProvider leaves this out; a
15
- * standalone host such as the portal preview passes one from
15
+ * standalone host such as the local preview passes one from
16
16
  * `createHostQueryClient()` so the data hooks find a client.
17
17
  */
18
18
  queryClient?: QueryClient;
package/dist/host.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  TapHostProvider,
3
3
  createHostQueryClient
4
- } from "./chunk-4C5Z3CIK.mjs";
4
+ } from "./chunk-RBIQT75L.mjs";
5
5
  import {
6
6
  TapContext
7
- } from "./chunk-QHM7XNRK.mjs";
8
- import "./chunk-CSTYBKZC.mjs";
7
+ } from "./chunk-QA5AL3VZ.mjs";
8
+ import "./chunk-QXD7WVKK.mjs";
9
+ import "./chunk-J5LGTIGS.mjs";
9
10
 
10
11
  // src/host/collect-styles.ts
11
12
  function collectStyles(remoteModule) {
package/dist/host.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/host/collect-styles.ts"],"sourcesContent":["export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"],"mappings":";;;;;;;;;;AAAO,SAAS,cAAc,cAAiC;AAC7D,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAAM,QAAO,CAAC;AACvE,MAAI,EAAE,YAAY,cAAe,QAAO,CAAC;AAEzC,QAAM,SAAS,aAAa;AAC5B,MAAI,CAAC,MAAM,QAAQ,MAAM,EAAG,QAAO,CAAC;AAEpC,SAAO,OAAO,OAAO,CAAC,UAA2B,OAAO,UAAU,QAAQ;AAC5E;","names":[]}
1
+ {"version":3,"sources":["../src/host/collect-styles.ts"],"sourcesContent":["export function collectStyles(remoteModule: unknown): string[] {\n if (typeof remoteModule !== 'object' || remoteModule === null) return [];\n if (!('styles' in remoteModule)) return [];\n\n const styles = remoteModule.styles;\n if (!Array.isArray(styles)) return [];\n\n return styles.filter((entry): entry is string => typeof entry === 'string');\n}\n"],"mappings":";;;;;;;;;;;AAAO,SAAS,cAAc,cAAiC;AAC7D,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAAM,QAAO,CAAC;AACvE,MAAI,EAAE,YAAY,cAAe,QAAO,CAAC;AAEzC,QAAM,SAAS,aAAa;AAC5B,MAAI,CAAC,MAAM,QAAQ,MAAM,EAAG,QAAO,CAAC;AAEpC,SAAO,OAAO,OAAO,CAAC,UAA2B,OAAO,UAAU,QAAQ;AAC5E;","names":[]}