experience-ai 0.1.1-preview.8.f3c2222 → 0.1.1

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 (237) hide show
  1. package/dist/agent/tools.d.ts +516 -1
  2. package/dist/agent/tools.d.ts.map +1 -1
  3. package/dist/agent/tools.js +234 -0
  4. package/dist/agent/tools.js.map +1 -0
  5. package/dist/ai-sdk/client/experience-card.d.ts +88 -0
  6. package/dist/ai-sdk/client/experience-card.d.ts.map +1 -0
  7. package/dist/ai-sdk/client/experience-card.js +158 -0
  8. package/dist/ai-sdk/client/experience-card.js.map +1 -0
  9. package/dist/ai-sdk/client/index.d.ts +12 -0
  10. package/dist/ai-sdk/client/index.d.ts.map +1 -0
  11. package/dist/ai-sdk/client/index.js +15 -0
  12. package/dist/ai-sdk/client/index.js.map +1 -0
  13. package/dist/ai-sdk/client/is-experience-output.d.ts +26 -0
  14. package/dist/ai-sdk/client/is-experience-output.d.ts.map +1 -0
  15. package/dist/ai-sdk/client/is-experience-output.js +21 -0
  16. package/dist/ai-sdk/client/is-experience-output.js.map +1 -0
  17. package/dist/{react/tool-ui.d.ts → ai-sdk/client/tool-card.d.ts} +5 -10
  18. package/dist/ai-sdk/client/tool-card.d.ts.map +1 -0
  19. package/dist/ai-sdk/client/tool-card.js +49 -0
  20. package/dist/ai-sdk/client/tool-card.js.map +1 -0
  21. package/dist/{server.d.ts → ai-sdk/server/index.d.ts} +9 -2
  22. package/dist/ai-sdk/server/index.d.ts.map +1 -0
  23. package/dist/ai-sdk/server/index.js +70 -0
  24. package/dist/ai-sdk/server/index.js.map +1 -0
  25. package/dist/index.d.ts +13 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +14 -21
  28. package/dist/index.js.map +1 -9
  29. package/dist/internal/defaults.generated.d.ts +2 -2
  30. package/dist/internal/defaults.generated.d.ts.map +1 -1
  31. package/dist/internal/defaults.generated.js +9 -11
  32. package/dist/internal/defaults.generated.js.map +1 -10
  33. package/dist/lib/auth-client.d.ts +9 -2328
  34. package/dist/lib/auth-client.d.ts.map +1 -1
  35. package/dist/lib/auth-client.js +23 -0
  36. package/dist/lib/auth-client.js.map +1 -0
  37. package/dist/lib/tool-helper.d.ts +7 -4
  38. package/dist/lib/tool-helper.d.ts.map +1 -1
  39. package/dist/lib/tool-helper.js +77 -0
  40. package/dist/lib/tool-helper.js.map +1 -0
  41. package/dist/middleware/middleware.js +98 -0
  42. package/dist/middleware/middleware.js.map +1 -0
  43. package/dist/react/client/experience-transport.d.ts.map +1 -0
  44. package/dist/react/client/experience-transport.js +46 -0
  45. package/dist/react/client/experience-transport.js.map +1 -0
  46. package/dist/react/{hooks.d.ts → client/hooks.d.ts} +2 -6
  47. package/dist/react/client/hooks.d.ts.map +1 -0
  48. package/dist/react/client/hooks.js +200 -0
  49. package/dist/react/client/hooks.js.map +1 -0
  50. package/dist/react/client/icons.d.ts +17 -0
  51. package/dist/react/client/icons.d.ts.map +1 -0
  52. package/dist/react/client/icons.js +30 -0
  53. package/dist/react/client/icons.js.map +1 -0
  54. package/dist/react/client/index.d.ts +14 -0
  55. package/dist/react/client/index.d.ts.map +1 -0
  56. package/dist/react/client/index.js +20 -0
  57. package/dist/react/client/index.js.map +1 -0
  58. package/dist/react/client/styles.d.ts +25 -0
  59. package/dist/react/client/styles.d.ts.map +1 -0
  60. package/dist/react/client/styles.js +97 -0
  61. package/dist/react/client/styles.js.map +1 -0
  62. package/dist/react/{token-manager.d.ts → client/token-manager.d.ts} +2 -0
  63. package/dist/react/client/token-manager.d.ts.map +1 -0
  64. package/dist/react/client/token-manager.js +187 -0
  65. package/dist/react/client/token-manager.js.map +1 -0
  66. package/dist/scopes.d.ts +20 -0
  67. package/dist/scopes.d.ts.map +1 -0
  68. package/dist/scopes.js +21 -0
  69. package/dist/scopes.js.map +1 -0
  70. package/dist/system-prompts.js +32 -0
  71. package/dist/system-prompts.js.map +1 -0
  72. package/dist/types.d.ts +109 -1
  73. package/dist/types.d.ts.map +1 -1
  74. package/dist/types.js +2 -2
  75. package/dist/types.js.map +1 -9
  76. package/node_modules/backend/dist-client/api/client.d.ts +138 -0
  77. package/node_modules/backend/dist-client/api/client.d.ts.map +1 -0
  78. package/node_modules/backend/dist-client/api/client.js +50 -0
  79. package/node_modules/backend/dist-client/api/client.js.map +1 -0
  80. package/node_modules/backend/dist-client/api/index.d.ts +129 -0
  81. package/node_modules/backend/dist-client/api/index.d.ts.map +1 -0
  82. package/node_modules/backend/dist-client/api/index.js +42 -0
  83. package/node_modules/backend/dist-client/api/index.js.map +1 -0
  84. package/node_modules/backend/dist-client/api/oauth/errors.d.ts +68 -0
  85. package/node_modules/backend/dist-client/api/oauth/errors.d.ts.map +1 -0
  86. package/node_modules/backend/dist-client/api/oauth/errors.js +71 -0
  87. package/node_modules/backend/dist-client/api/oauth/errors.js.map +1 -0
  88. package/node_modules/backend/dist-client/api/oauth/group.d.ts +37 -0
  89. package/node_modules/backend/dist-client/api/oauth/group.d.ts.map +1 -0
  90. package/node_modules/backend/dist-client/api/oauth/group.js +93 -0
  91. package/node_modules/backend/dist-client/api/oauth/group.js.map +1 -0
  92. package/node_modules/backend/dist-client/api/oauth/middleware.types.d.ts +36 -0
  93. package/node_modules/backend/dist-client/api/oauth/middleware.types.d.ts.map +1 -0
  94. package/node_modules/backend/dist-client/api/oauth/middleware.types.js +26 -0
  95. package/node_modules/backend/dist-client/api/oauth/middleware.types.js.map +1 -0
  96. package/node_modules/backend/dist-client/api/oauth/schemas.d.ts +94 -0
  97. package/node_modules/backend/dist-client/api/oauth/schemas.d.ts.map +1 -0
  98. package/node_modules/backend/dist-client/api/oauth/schemas.js +105 -0
  99. package/node_modules/backend/dist-client/api/oauth/schemas.js.map +1 -0
  100. package/node_modules/backend/dist-client/api/portal/errors.d.ts +50 -0
  101. package/node_modules/backend/dist-client/api/portal/errors.d.ts.map +1 -0
  102. package/node_modules/backend/dist-client/api/portal/errors.js +49 -0
  103. package/node_modules/backend/dist-client/api/portal/errors.js.map +1 -0
  104. package/node_modules/backend/dist-client/api/portal/group.d.ts +30 -0
  105. package/node_modules/backend/dist-client/api/portal/group.d.ts.map +1 -0
  106. package/node_modules/backend/dist-client/api/portal/group.js +64 -0
  107. package/node_modules/backend/dist-client/api/portal/group.js.map +1 -0
  108. package/node_modules/backend/dist-client/api/portal/middleware.types.d.ts +34 -0
  109. package/node_modules/backend/dist-client/api/portal/middleware.types.d.ts.map +1 -0
  110. package/node_modules/backend/dist-client/api/portal/middleware.types.js +26 -0
  111. package/node_modules/backend/dist-client/api/portal/middleware.types.js.map +1 -0
  112. package/node_modules/backend/dist-client/api/portal/schemas.d.ts +62 -0
  113. package/node_modules/backend/dist-client/api/portal/schemas.d.ts.map +1 -0
  114. package/node_modules/backend/dist-client/api/portal/schemas.js +43 -0
  115. package/node_modules/backend/dist-client/api/portal/schemas.js.map +1 -0
  116. package/node_modules/backend/dist-client/api/tools/calendar/errors.d.ts +11 -0
  117. package/node_modules/backend/dist-client/api/tools/calendar/errors.d.ts.map +1 -0
  118. package/node_modules/backend/dist-client/api/tools/calendar/errors.js +11 -0
  119. package/node_modules/backend/dist-client/api/tools/calendar/errors.js.map +1 -0
  120. package/node_modules/backend/dist-client/api/tools/calendar/group.d.ts +26 -0
  121. package/node_modules/backend/dist-client/api/tools/calendar/group.d.ts.map +1 -0
  122. package/node_modules/backend/dist-client/api/tools/calendar/group.js +32 -0
  123. package/node_modules/backend/dist-client/api/tools/calendar/group.js.map +1 -0
  124. package/node_modules/backend/dist-client/api/tools/calendar/schemas.d.ts +32 -0
  125. package/node_modules/backend/dist-client/api/tools/calendar/schemas.d.ts.map +1 -0
  126. package/node_modules/backend/dist-client/api/tools/calendar/schemas.js +27 -0
  127. package/node_modules/backend/dist-client/api/tools/calendar/schemas.js.map +1 -0
  128. package/node_modules/backend/dist-client/api/tools/drive/errors.d.ts +11 -0
  129. package/node_modules/backend/dist-client/api/tools/drive/errors.d.ts.map +1 -0
  130. package/node_modules/backend/dist-client/api/tools/drive/errors.js +11 -0
  131. package/node_modules/backend/dist-client/api/tools/drive/errors.js.map +1 -0
  132. package/node_modules/backend/dist-client/api/tools/drive/group.d.ts +23 -0
  133. package/node_modules/backend/dist-client/api/tools/drive/group.d.ts.map +1 -0
  134. package/node_modules/backend/dist-client/api/tools/drive/group.js +32 -0
  135. package/node_modules/backend/dist-client/api/tools/drive/group.js.map +1 -0
  136. package/node_modules/backend/dist-client/api/tools/drive/schemas.d.ts +27 -0
  137. package/node_modules/backend/dist-client/api/tools/drive/schemas.d.ts.map +1 -0
  138. package/node_modules/backend/dist-client/api/tools/drive/schemas.js +24 -0
  139. package/node_modules/backend/dist-client/api/tools/drive/schemas.js.map +1 -0
  140. package/node_modules/backend/dist-client/api/tools/gmail/errors.d.ts +11 -0
  141. package/node_modules/backend/dist-client/api/tools/gmail/errors.d.ts.map +1 -0
  142. package/node_modules/backend/dist-client/api/tools/gmail/errors.js +13 -0
  143. package/node_modules/backend/dist-client/api/tools/gmail/errors.js.map +1 -0
  144. package/node_modules/backend/dist-client/api/tools/gmail/group.d.ts +24 -0
  145. package/node_modules/backend/dist-client/api/tools/gmail/group.d.ts.map +1 -0
  146. package/node_modules/backend/dist-client/api/tools/gmail/group.js +32 -0
  147. package/node_modules/backend/dist-client/api/tools/gmail/group.js.map +1 -0
  148. package/node_modules/backend/dist-client/api/tools/gmail/schemas.d.ts +30 -0
  149. package/node_modules/backend/dist-client/api/tools/gmail/schemas.d.ts.map +1 -0
  150. package/node_modules/backend/dist-client/api/tools/gmail/schemas.js +25 -0
  151. package/node_modules/backend/dist-client/api/tools/gmail/schemas.js.map +1 -0
  152. package/node_modules/backend/dist-client/api/tools/middleware/sdk-auth.types.d.ts +47 -0
  153. package/node_modules/backend/dist-client/api/tools/middleware/sdk-auth.types.d.ts.map +1 -0
  154. package/node_modules/backend/dist-client/api/tools/middleware/sdk-auth.types.js +30 -0
  155. package/node_modules/backend/dist-client/api/tools/middleware/sdk-auth.types.js.map +1 -0
  156. package/node_modules/backend/dist-client/api/tools/notion/errors.d.ts +11 -0
  157. package/node_modules/backend/dist-client/api/tools/notion/errors.d.ts.map +1 -0
  158. package/node_modules/backend/dist-client/api/tools/notion/errors.js +11 -0
  159. package/node_modules/backend/dist-client/api/tools/notion/errors.js.map +1 -0
  160. package/node_modules/backend/dist-client/api/tools/notion/group.d.ts +22 -0
  161. package/node_modules/backend/dist-client/api/tools/notion/group.d.ts.map +1 -0
  162. package/node_modules/backend/dist-client/api/tools/notion/group.js +33 -0
  163. package/node_modules/backend/dist-client/api/tools/notion/group.js.map +1 -0
  164. package/node_modules/backend/dist-client/api/tools/notion/schemas.d.ts +25 -0
  165. package/node_modules/backend/dist-client/api/tools/notion/schemas.d.ts.map +1 -0
  166. package/node_modules/backend/dist-client/api/tools/notion/schemas.js +23 -0
  167. package/node_modules/backend/dist-client/api/tools/notion/schemas.js.map +1 -0
  168. package/node_modules/backend/dist-client/api/tools/schemas/errors.d.ts +64 -0
  169. package/node_modules/backend/dist-client/api/tools/schemas/errors.d.ts.map +1 -0
  170. package/node_modules/backend/dist-client/api/tools/schemas/errors.js +58 -0
  171. package/node_modules/backend/dist-client/api/tools/schemas/errors.js.map +1 -0
  172. package/node_modules/backend/dist-client/api/tools/slack/errors.d.ts +11 -0
  173. package/node_modules/backend/dist-client/api/tools/slack/errors.d.ts.map +1 -0
  174. package/node_modules/backend/dist-client/api/tools/slack/errors.js +11 -0
  175. package/node_modules/backend/dist-client/api/tools/slack/errors.js.map +1 -0
  176. package/node_modules/backend/dist-client/api/tools/slack/group.d.ts +30 -0
  177. package/node_modules/backend/dist-client/api/tools/slack/group.d.ts.map +1 -0
  178. package/node_modules/backend/dist-client/api/tools/slack/group.js +41 -0
  179. package/node_modules/backend/dist-client/api/tools/slack/group.js.map +1 -0
  180. package/node_modules/backend/dist-client/api/tools/slack/schemas.d.ts +45 -0
  181. package/node_modules/backend/dist-client/api/tools/slack/schemas.d.ts.map +1 -0
  182. package/node_modules/backend/dist-client/api/tools/slack/schemas.js +36 -0
  183. package/node_modules/backend/dist-client/api/tools/slack/schemas.js.map +1 -0
  184. package/node_modules/backend/package.json +86 -0
  185. package/node_modules/common/dist/contracts/oauth/access-token.d.ts +173 -0
  186. package/node_modules/common/dist/contracts/oauth/access-token.d.ts.map +1 -0
  187. package/node_modules/common/dist/index.d.ts +19 -0
  188. package/node_modules/common/dist/index.d.ts.map +1 -0
  189. package/node_modules/common/dist/index.js +14038 -0
  190. package/node_modules/common/dist/internal-auth.d.ts +65 -0
  191. package/node_modules/common/dist/internal-auth.d.ts.map +1 -0
  192. package/node_modules/common/dist/scopes/experience.d.ts +29 -0
  193. package/node_modules/common/dist/scopes/experience.d.ts.map +1 -0
  194. package/node_modules/common/dist/scopes/experience.js +118 -0
  195. package/node_modules/common/dist/scopes/google.d.ts +35 -0
  196. package/node_modules/common/dist/scopes/google.d.ts.map +1 -0
  197. package/node_modules/common/dist/scopes/google.js +50 -0
  198. package/node_modules/common/dist/scopes/index.d.ts +53 -0
  199. package/node_modules/common/dist/scopes/index.d.ts.map +1 -0
  200. package/node_modules/common/dist/scopes/index.js +146 -0
  201. package/node_modules/common/dist/scopes/notion.d.ts +26 -0
  202. package/node_modules/common/dist/scopes/notion.d.ts.map +1 -0
  203. package/node_modules/common/dist/scopes/notion.js +33 -0
  204. package/node_modules/common/dist/scopes/slack.d.ts +31 -0
  205. package/node_modules/common/dist/scopes/slack.d.ts.map +1 -0
  206. package/node_modules/common/dist/scopes/slack.js +43 -0
  207. package/node_modules/common/dist/tools/index.d.ts +2 -0
  208. package/node_modules/common/dist/tools/index.d.ts.map +1 -0
  209. package/node_modules/common/dist/tools/index.js +13574 -0
  210. package/node_modules/common/dist/tools/schemas.d.ts +53 -0
  211. package/node_modules/common/dist/tools/schemas.d.ts.map +1 -0
  212. package/node_modules/common/package.json +48 -0
  213. package/package.json +32 -22
  214. package/dist/client.d.ts +0 -58
  215. package/dist/client.d.ts.map +0 -1
  216. package/dist/client.js +0 -47
  217. package/dist/client.js.map +0 -10
  218. package/dist/index-3c5epavj.js +0 -21
  219. package/dist/index-3c5epavj.js.map +0 -10
  220. package/dist/index-50t9xbsr.js +0 -413
  221. package/dist/index-50t9xbsr.js.map +0 -16
  222. package/dist/lib/api-client.d.ts +0 -475
  223. package/dist/lib/api-client.d.ts.map +0 -1
  224. package/dist/lib/api-client.js +0 -314
  225. package/dist/lib/api-client.js.map +0 -13
  226. package/dist/react/experience-transport.d.ts.map +0 -1
  227. package/dist/react/hooks.d.ts.map +0 -1
  228. package/dist/react/index.d.ts +0 -11
  229. package/dist/react/index.d.ts.map +0 -1
  230. package/dist/react/index.js +0 -35
  231. package/dist/react/index.js.map +0 -10
  232. package/dist/react/token-manager.d.ts.map +0 -1
  233. package/dist/react/tool-ui.d.ts.map +0 -1
  234. package/dist/server.d.ts.map +0 -1
  235. package/dist/server.js +0 -208
  236. package/dist/server.js.map +0 -14
  237. /package/dist/react/{experience-transport.d.ts → client/experience-transport.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"auth-client.d.ts","sourceRoot":"","sources":["../../src/lib/auth-client.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;yBAU01Q,CAAC;;;;;;;;;;;;;;;;;6BAN52Q,CAAC;iBAAa,CAAC;;;;;;;;;;;;;;;6BAAf,CAAC;iBAAa,CAAC;;;;;;;;;;;;;;6BAAf,CAAC;iBAAa,CAAC;;;;;;;;;;6BAAf,CAAC;iBAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAmC,CAAC;YAA+B,CAAC;gBAAuC,CAAC;gBAA2C,CAAC;sBAAwC,CAAC;cAAwC,CAAC;cAA8C,CAAC;eAA+B,CAAC;mBAAyG,CAAC;yBAAuB,CAAC;;eAAyC,CAAC;;;aAA0G,CAAC;YAA+B,CAAC;;;;;;;;;;;;YAA+e,CAAC;aAAgB,CAAC;cAAiB,CAAC;cAAiB,CAAC;;aAA8F,CAAC;oBAAiE,CAAC;cAAgC,CAAC;mBAAkG,CAAC;yBAA0E,CAAC;qBAAwC,CAAC;;;uBAAkF,CAAC;+GAAuL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD59J,CAAC"}
1
+ {"version":3,"file":"auth-client.d.ts","sourceRoot":"","sources":["../../src/lib/auth-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAUrD;;;;;;GAMG;AAEH,eAAO,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAS9D,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { createAuthClient } from "better-auth/react";
2
+ import { jwtClient, genericOAuthClient, organizationClient, apiKeyClient, } from "better-auth/client/plugins";
3
+ import { oauthProviderClient } from "@better-auth/oauth-provider/client";
4
+ import { EXPERIENCE_FRONTEND_URL } from "../internal/defaults.generated";
5
+ /**
6
+ * Pre-configured Better Auth client for Experience SDK.
7
+ * Includes JWT, OAuth, Organization, and API Key plugins.
8
+ *
9
+ * Note: Using explicit any type due to @better-auth/oauth-provider internal type inference issues
10
+ * that cause TS2742 errors during declaration emit with tsgo.
11
+ */
12
+ // biome-ignore lint/suspicious/noExplicitAny: Required to avoid TS2742 with oauth-provider internal types
13
+ export const authClient = createAuthClient({
14
+ baseURL: EXPERIENCE_FRONTEND_URL,
15
+ plugins: [
16
+ jwtClient(),
17
+ genericOAuthClient(),
18
+ organizationClient(),
19
+ apiKeyClient(),
20
+ oauthProviderClient(),
21
+ ],
22
+ });
23
+ //# sourceMappingURL=auth-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-client.js","sourceRoot":"","sources":["../../src/lib/auth-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,0GAA0G;AAC1G,MAAM,CAAC,MAAM,UAAU,GAA6C,gBAAgB,CAAC;IACnF,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE;QACP,SAAS,EAAE;QACX,kBAAkB,EAAE;QACpB,kBAAkB,EAAE;QACpB,YAAY,EAAE;QACd,mBAAmB,EAAE;KACtB;CACF,CAAC,CAAC"}
@@ -3,6 +3,7 @@ import type { ExperienceToolOutput } from "../types";
3
3
  export type ToolContext = {
4
4
  accessToken: string | undefined;
5
5
  apiKey: string;
6
+ clientId: string | undefined;
6
7
  };
7
8
  export type ToolFactory = (ctx: ToolContext) => ToolSet;
8
9
  /**
@@ -33,11 +34,13 @@ export declare const factory: {
33
34
  build(ctx: ToolContext): ToolSet;
34
35
  };
35
36
  /**
36
- * Resolve client ID from API key for consent flow.
37
+ * Create a consent payload for tools that require OAuth.
37
38
  */
38
- export declare function resolveClientId(apiKey: string): Promise<string>;
39
+ export declare function createConsentPayload(clientId: string, requiredScopes: readonly string[]): ExperienceToolOutput;
39
40
  /**
40
- * Create a consent payload for tools that require OAuth.
41
+ * Create a connect-provider payload for tools that require provider account linking.
42
+ * This is used when the user has completed Atlas OAuth but hasn't connected
43
+ * their provider account (Google, Notion, Slack).
41
44
  */
42
- export declare function createConsentPayload(clientId: string | undefined, requiredScopes: string[]): ExperienceToolOutput;
45
+ export declare function createConnectProviderPayload(provider: string, clientId: string): ExperienceToolOutput;
43
46
  //# sourceMappingURL=tool-helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-helper.d.ts","sourceRoot":"","sources":["../../src/lib/tool-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAOrD,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC;AAQxD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO;IAClB;;;OAGG;iBACU,WAAW,GAAG,IAAI;IAI/B;;OAEG;eACQ,WAAW,GAAG,OAAO;CAKjC,CAAC;AAMF;;GAEG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAcrE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,EAAE,MAAM,EAAE,GACvB,oBAAoB,CAStB"}
1
+ {"version":3,"file":"tool-helper.d.ts","sourceRoot":"","sources":["../../src/lib/tool-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAMrD,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC;AAQxD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO;IAClB;;;OAGG;iBACU,WAAW,GAAG,IAAI;IAI/B;;OAEG;eACQ,WAAW,GAAG,OAAO;CAKjC,CAAC;AAMF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,oBAAoB,CAStB;AAWD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,oBAAoB,CAQtB"}
@@ -0,0 +1,77 @@
1
+ import { EXPERIENCE_LOGIN_MESSAGE as LOGIN_MESSAGE } from "../system-prompts";
2
+ // =============================================================================
3
+ // Tool Factory Registry
4
+ // =============================================================================
5
+ const toolFactories = [];
6
+ /**
7
+ * Tool factory registry for registering and building tools.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { factory } from "@lib/tool-helper";
12
+ *
13
+ * factory.register((ctx) => ({
14
+ * MyTool: tool({
15
+ * description: "My tool",
16
+ * inputSchema: z.object({}),
17
+ * execute: async () => { ... },
18
+ * }),
19
+ * }));
20
+ * ```
21
+ */
22
+ export const factory = {
23
+ /**
24
+ * Register a tool factory. All registered factories will be called
25
+ * when building the tool set.
26
+ */
27
+ register(fn) {
28
+ toolFactories.push(fn);
29
+ },
30
+ /**
31
+ * Build the complete tool set from all registered factories.
32
+ */
33
+ build(ctx) {
34
+ return toolFactories.reduce((acc, fn) => {
35
+ return { ...acc, ...fn(ctx) };
36
+ }, {});
37
+ },
38
+ };
39
+ // =============================================================================
40
+ // Helpers
41
+ // =============================================================================
42
+ /**
43
+ * Create a consent payload for tools that require OAuth.
44
+ */
45
+ export function createConsentPayload(clientId, requiredScopes) {
46
+ return {
47
+ kind: "experience-consent",
48
+ message: LOGIN_MESSAGE,
49
+ consentRequired: {
50
+ scopes: [...requiredScopes],
51
+ clientId,
52
+ },
53
+ };
54
+ }
55
+ /**
56
+ * Provider display names for user-friendly messages.
57
+ */
58
+ const PROVIDER_NAMES = {
59
+ google: "Google",
60
+ notion: "Notion",
61
+ slack: "Slack",
62
+ };
63
+ /**
64
+ * Create a connect-provider payload for tools that require provider account linking.
65
+ * This is used when the user has completed Atlas OAuth but hasn't connected
66
+ * their provider account (Google, Notion, Slack).
67
+ */
68
+ export function createConnectProviderPayload(provider, clientId) {
69
+ const providerName = PROVIDER_NAMES[provider] ?? provider;
70
+ return {
71
+ kind: "experience-connect-provider",
72
+ message: `Please connect your ${providerName} account to continue. Go to your Atlas dashboard and link your ${providerName} account.`,
73
+ provider,
74
+ clientId,
75
+ };
76
+ }
77
+ //# sourceMappingURL=tool-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-helper.js","sourceRoot":"","sources":["../../src/lib/tool-helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAe9E,gFAAgF;AAChF,wBAAwB;AACxB,gFAAgF;AAEhF,MAAM,aAAa,GAAkB,EAAE,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAe;QACtB,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAgB;QACpB,OAAO,aAAa,CAAC,MAAM,CAAU,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;YAC/C,OAAO,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF,CAAC;AAEF,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAgB,EAChB,cAAiC;IAEjC,OAAO;QACL,IAAI,EAAE,oBAA6B;QACnC,OAAO,EAAE,aAAa;QACtB,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,GAAG,cAAc,CAAC;YAC3B,QAAQ;SACT;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,cAAc,GAA2B;IAC7C,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAgB,EAChB,QAAgB;IAEhB,MAAM,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;IAC1D,OAAO;QACL,IAAI,EAAE,6BAAsC;QAC5C,OAAO,EAAE,uBAAuB,YAAY,kEAAkE,YAAY,WAAW;QACrI,QAAQ;QACR,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { buildExperienceSystemInstructions } from "../system-prompts";
2
+ // =============================================================================
3
+ // Types
4
+ // =============================================================================
5
+ // =============================================================================
6
+ // Context Extraction
7
+ // =============================================================================
8
+ /**
9
+ * Build Atlas context from options.
10
+ */
11
+ function buildAtlasContext(options) {
12
+ const grantedScopes = Array.isArray(options.grantedScopes)
13
+ ? options.grantedScopes
14
+ : typeof options.grantedScopes === "string"
15
+ ? options.grantedScopes.split(" ").filter(Boolean)
16
+ : [];
17
+ return {
18
+ accessToken: options.accessToken,
19
+ grantedScopes,
20
+ };
21
+ }
22
+ // =============================================================================
23
+ // Middleware Factory
24
+ // =============================================================================
25
+ /**
26
+ * Create Atlas middleware for wrapping language models.
27
+ *
28
+ * This middleware:
29
+ * - Injects Atlas system instructions into the prompt
30
+ * - Provides hooks for message interception and completion callbacks
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * import { wrapLanguageModel } from "ai";
35
+ * import { createAtlasMiddleware } from "experience-ai/server";
36
+ *
37
+ * const middleware = createAtlasMiddleware({ request: req });
38
+ * const wrappedModel = wrapLanguageModel({ model, middleware });
39
+ * ```
40
+ */
41
+ export function createExperienceMiddleware(options = {}) {
42
+ const context = buildAtlasContext(options);
43
+ const systemInstructions = buildExperienceSystemInstructions({
44
+ grantedScopes: context.grantedScopes,
45
+ customInstructions: options.customInstructions,
46
+ });
47
+ return {
48
+ specificationVersion: "v3",
49
+ transformParams: async ({ params }) => {
50
+ // Get the current prompt array - use type assertion since we're manipulating it
51
+ const prompt = [...(params.prompt ?? [])];
52
+ // Find existing system message index
53
+ const systemIndex = prompt.findIndex((msg) => msg.role === "system");
54
+ if (systemIndex >= 0) {
55
+ // Prepend Atlas instructions to existing system message
56
+ const existingMsg = prompt[systemIndex];
57
+ const existingContent = typeof existingMsg.content === "string"
58
+ ? existingMsg.content
59
+ : JSON.stringify(existingMsg.content);
60
+ prompt[systemIndex] = {
61
+ ...existingMsg,
62
+ content: `${systemInstructions}\n\n${existingContent}`,
63
+ };
64
+ }
65
+ else {
66
+ // Insert new system message at the beginning
67
+ prompt.unshift({
68
+ role: "system",
69
+ content: systemInstructions,
70
+ });
71
+ }
72
+ // Call onMessages callback if provided (for future backend sync)
73
+ if (options.onMessages) {
74
+ await options.onMessages(prompt, context);
75
+ }
76
+ // Return with the original prompt type preserved via assertion
77
+ return { ...params, prompt };
78
+ },
79
+ wrapGenerate: async ({ doGenerate }) => {
80
+ const result = await doGenerate();
81
+ // Call onComplete callback if provided
82
+ if (options.onComplete) {
83
+ await options.onComplete(result, context);
84
+ }
85
+ return result;
86
+ },
87
+ wrapStream: async ({ doStream }) => {
88
+ const result = await doStream();
89
+ // For streaming, onComplete fires at stream start
90
+ // Future: wrap the stream transformer to call when finished
91
+ if (options.onComplete) {
92
+ await options.onComplete({ streaming: true }, context);
93
+ }
94
+ return result;
95
+ },
96
+ };
97
+ }
98
+ //# sourceMappingURL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,QAAQ,EAAE,CAAC;YAEhC,kDAAkD;YAClD,4DAA4D;YAC5D,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,MAAM,OAAO,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;YACzD,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experience-transport.d.ts","sourceRoot":"","sources":["../../../src/react/client/experience-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAM5E"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Experience Headers
3
+ *
4
+ * Provides async header generation with automatic token refresh.
5
+ * Can be used with any HTTP client or transport.
6
+ */
7
+ import { getAccessToken } from "./token-manager";
8
+ /**
9
+ * Get headers with the Experience access token.
10
+ *
11
+ * This function:
12
+ * - Gets the current access token
13
+ * - Auto-refreshes the token when it has < 10 minutes remaining
14
+ * - Returns headers with X-Experience-Access-Token if authenticated
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * // With DefaultChatTransport
19
+ * import { DefaultChatTransport } from "ai";
20
+ * import { getExperienceHeaders } from "experience-ai/react";
21
+ *
22
+ * const transport = new DefaultChatTransport({
23
+ * api: "/api/chat",
24
+ * credentials: "include",
25
+ * headers: getExperienceHeaders,
26
+ * });
27
+ *
28
+ * // With fetch
29
+ * const response = await fetch("/api/chat", {
30
+ * method: "POST",
31
+ * headers: {
32
+ * "Content-Type": "application/json",
33
+ * ...(await getExperienceHeaders()),
34
+ * },
35
+ * body: JSON.stringify({ messages }),
36
+ * });
37
+ * ```
38
+ */
39
+ export async function getExperienceHeaders() {
40
+ const accessToken = await getAccessToken();
41
+ if (accessToken) {
42
+ return { "X-Experience-Access-Token": accessToken };
43
+ }
44
+ return {};
45
+ }
46
+ //# sourceMappingURL=experience-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experience-transport.js","sourceRoot":"","sources":["../../../src/react/client/experience-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAC3C,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -1,25 +1,21 @@
1
- import type { ExperienceToolOutput, UseExperienceReturn } from "../types";
1
+ import type { ExperienceToolOutput, UseExperienceReturn } from "../../types";
2
2
  export { getAccessToken, isConnected, clearTokens as disconnect } from "./token-manager";
3
3
  /**
4
4
  * Hook for handling the Experience consent flow.
5
5
  *
6
6
  * @param output - The tool output containing consent info (connectUrl, connectId)
7
- * @param pollUrl - URL to poll for consent status (your backend's proxy endpoint)
8
7
  * @param onConsented - Callback when consent is granted
9
8
  *
10
9
  * @example
11
10
  * ```tsx
12
11
  * const { state, error, consent, retry } = useExperience({
13
12
  * output: toolResult,
14
- * pollUrl: "/api/experience/consent-status", // Your backend endpoint
15
13
  * onConsented: ({ scopes }) => refetch(),
16
14
  * });
17
15
  * ```
18
16
  */
19
- export declare function useExperience({ output, pollUrl, onConsented, }: {
17
+ export declare function useExperience({ output, onConsented, }: {
20
18
  output: ExperienceToolOutput;
21
- /** URL to poll for consent status. Your backend should proxy to Experience. */
22
- pollUrl: string;
23
19
  onConsented?: (args: {
24
20
  scopes: string[];
25
21
  }) => void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/react/client/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAK7E,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAsFzF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAC;IAC7B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;CACpD,GAAG,mBAAmB,CAoJtB"}
@@ -0,0 +1,200 @@
1
+ import { useCallback, useEffect, useRef, useState } from "react";
2
+ import { Effect, Exit, Layer } from "effect";
3
+ import { HttpApiClient, FetchHttpClient } from "@effect/platform";
4
+ import { Api } from "backend/api/client";
5
+ import { EXPERIENCE_FRONTEND_URL, EXPERIENCE_BACKEND_URL } from "../../internal/defaults.generated";
6
+ import { setTokens } from "./token-manager";
7
+ // Re-export token manager functions for convenience
8
+ export { getAccessToken, isConnected, clearTokens as disconnect } from "./token-manager";
9
+ // PKCE utilities for OAuth 2.1
10
+ function generateCodeVerifier() {
11
+ const array = new Uint8Array(32);
12
+ crypto.getRandomValues(array);
13
+ return base64UrlEncode(array);
14
+ }
15
+ async function generateCodeChallenge(verifier) {
16
+ const encoder = new TextEncoder();
17
+ const data = encoder.encode(verifier);
18
+ const digest = await crypto.subtle.digest("SHA-256", data);
19
+ return base64UrlEncode(new Uint8Array(digest));
20
+ }
21
+ function base64UrlEncode(buffer) {
22
+ const base64 = btoa(String.fromCharCode(...buffer));
23
+ return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
24
+ }
25
+ /**
26
+ * Custom FetchHttpClient layer with credentials: "include" for cookie auth.
27
+ * Trace context propagation is enabled by default in Effect Platform's HttpClient.
28
+ */
29
+ const FetchHttpClientWithCredentials = Layer.succeed(FetchHttpClient.Fetch, Object.assign((input, init) => fetch(input, { ...init, credentials: "include" }), { preconnect: (_url) => { } })).pipe(Layer.provideMerge(FetchHttpClient.layer));
30
+ /**
31
+ * Create an OAuth API client (requires FetchHttpClient to be provided)
32
+ */
33
+ const makeOAuthClient = () => HttpApiClient.make(Api, {
34
+ baseUrl: EXPERIENCE_BACKEND_URL,
35
+ });
36
+ /**
37
+ * Exchange authorization code for tokens using Effect Platform client.
38
+ */
39
+ async function exchangeCodeForTokens(params) {
40
+ const program = Effect.gen(function* () {
41
+ const client = yield* makeOAuthClient();
42
+ const result = yield* client.oauth.token({
43
+ payload: {
44
+ grant_type: "authorization_code",
45
+ code: params.code,
46
+ code_verifier: params.codeVerifier,
47
+ client_id: params.clientId,
48
+ redirect_uri: params.redirectUri,
49
+ },
50
+ });
51
+ return result;
52
+ }).pipe(Effect.provide(FetchHttpClientWithCredentials));
53
+ const exit = await Effect.runPromiseExit(program);
54
+ if (Exit.isFailure(exit)) {
55
+ const cause = exit.cause;
56
+ // Try to extract error message from the cause
57
+ const errorMessage = cause._tag === "Fail" && cause.error && typeof cause.error === "object"
58
+ ? "error_description" in cause.error
59
+ ? String(cause.error.error_description)
60
+ : "error" in cause.error
61
+ ? String(cause.error.error)
62
+ : "Token exchange failed"
63
+ : "Token exchange failed";
64
+ return { error: errorMessage };
65
+ }
66
+ return exit.value;
67
+ }
68
+ /**
69
+ * Hook for handling the Experience consent flow.
70
+ *
71
+ * @param output - The tool output containing consent info (connectUrl, connectId)
72
+ * @param onConsented - Callback when consent is granted
73
+ *
74
+ * @example
75
+ * ```tsx
76
+ * const { state, error, consent, retry } = useExperience({
77
+ * output: toolResult,
78
+ * onConsented: ({ scopes }) => refetch(),
79
+ * });
80
+ * ```
81
+ */
82
+ export function useExperience({ output, onConsented, }) {
83
+ const [state, setState] = useState("idle");
84
+ const [error, setError] = useState(null);
85
+ const lastPopupRef = useRef(null);
86
+ const pollIntervalRef = useRef(null);
87
+ // Clean up polling on unmount
88
+ useEffect(() => {
89
+ return () => {
90
+ if (pollIntervalRef.current) {
91
+ clearInterval(pollIntervalRef.current);
92
+ }
93
+ };
94
+ }, []);
95
+ // Listen for postMessage from callback popup
96
+ useEffect(() => {
97
+ const handleMessage = async (event) => {
98
+ // Only accept messages from Experience origin
99
+ if (event.origin !== EXPERIENCE_FRONTEND_URL)
100
+ return;
101
+ const data = event.data;
102
+ if (data?.type !== "experience_auth_complete")
103
+ return;
104
+ // Close popup if still open
105
+ if (lastPopupRef.current && !lastPopupRef.current.closed) {
106
+ lastPopupRef.current.close();
107
+ }
108
+ if (!data.ok) {
109
+ setError(data.error || "Authentication failed");
110
+ setState("error");
111
+ return;
112
+ }
113
+ // Exchange code for tokens
114
+ const code = data.code;
115
+ const codeVerifier = sessionStorage.getItem("atlas_code_verifier");
116
+ const clientId = output.kind === "experience-consent" ? output.consentRequired?.clientId : output.clientId;
117
+ if (!code || !codeVerifier || !clientId) {
118
+ setError("Missing authorization code, verifier, or client ID");
119
+ setState("error");
120
+ return;
121
+ }
122
+ // Use Effect Platform client for token exchange
123
+ const result = await exchangeCodeForTokens({
124
+ code,
125
+ codeVerifier,
126
+ clientId,
127
+ redirectUri: new URL("/experience/callback", EXPERIENCE_FRONTEND_URL).toString(),
128
+ });
129
+ if ("error" in result) {
130
+ setError(result.error);
131
+ setState("error");
132
+ return;
133
+ }
134
+ // Clear stored verifier
135
+ sessionStorage.removeItem("atlas_code_verifier");
136
+ // Store access_token in memory via token manager
137
+ if (result.access_token && result.expires_in) {
138
+ setTokens(result.access_token, clientId, result.expires_in);
139
+ }
140
+ setState("idle");
141
+ onConsented?.({ scopes: [] });
142
+ };
143
+ window.addEventListener("message", handleMessage);
144
+ return () => window.removeEventListener("message", handleMessage);
145
+ }, [output, onConsented]);
146
+ const consent = useCallback(async () => {
147
+ // Handle experience-connect-provider: redirect to Atlas dashboard
148
+ if (output.kind === "experience-connect-provider") {
149
+ // Open Atlas dashboard in a new tab for the user to connect the provider
150
+ const dashboardUrl = new URL("/", EXPERIENCE_FRONTEND_URL);
151
+ window.open(dashboardUrl.toString(), "_blank");
152
+ setError(`Please connect your ${output.provider} account in Atlas, then try again.`);
153
+ setState("error");
154
+ return;
155
+ }
156
+ // Handle experience-consent: normal OAuth flow
157
+ const clientId = output.consentRequired?.clientId;
158
+ const requiredScopes = output.consentRequired?.scopes ?? [];
159
+ if (!clientId) {
160
+ setError("Missing client ID");
161
+ setState("error");
162
+ return;
163
+ }
164
+ // Use scopes from the tool output (provider-specific) plus standard OIDC scopes
165
+ const requestScopes = ["openid", "profile", "email", "offline_access", ...requiredScopes];
166
+ // Generate PKCE parameters (required for offline_access scope)
167
+ const codeVerifier = generateCodeVerifier();
168
+ const codeChallenge = await generateCodeChallenge(codeVerifier);
169
+ // Store code verifier for token exchange (will be needed at callback)
170
+ sessionStorage.setItem("atlas_code_verifier", codeVerifier);
171
+ // Build OAuth authorize URL manually (can't use fetch for OAuth redirects)
172
+ const authorizeUrl = new URL("/api/auth/oauth2/authorize", EXPERIENCE_FRONTEND_URL);
173
+ authorizeUrl.searchParams.set("client_id", clientId);
174
+ authorizeUrl.searchParams.set("redirect_uri", new URL("/experience/callback", EXPERIENCE_FRONTEND_URL).toString());
175
+ authorizeUrl.searchParams.set("response_type", "code");
176
+ authorizeUrl.searchParams.set("scope", requestScopes.join(" "));
177
+ authorizeUrl.searchParams.set("code_challenge", codeChallenge);
178
+ authorizeUrl.searchParams.set("code_challenge_method", "S256");
179
+ // Open popup for consent flow
180
+ const popup = window.open(authorizeUrl.toString(), "atlas-consent", "popup=yes,width=520,height=720");
181
+ lastPopupRef.current = popup;
182
+ if (!popup) {
183
+ setError("Popup blocked. Please allow popups to connect.");
184
+ setState("error");
185
+ return;
186
+ }
187
+ setState("connecting");
188
+ setError(null);
189
+ }, [output, onConsented]);
190
+ const retry = useCallback(() => {
191
+ setState("idle");
192
+ setError(null);
193
+ if (pollIntervalRef.current) {
194
+ clearInterval(pollIntervalRef.current);
195
+ pollIntervalRef.current = null;
196
+ }
197
+ }, []);
198
+ return { state, error, consent, retry };
199
+ }
200
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/react/client/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,oDAAoD;AACpD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEzF,+BAA+B;AAC/B,SAAS,oBAAoB;IAC3B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACjC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,QAAgB;IACnD,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,eAAe,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,C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AC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QAC/D,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;QAE/D,8BAA8B;QAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CACvB,YAAY,CAAC,QAAQ,EAAE,EACvB,eAAe,EACf,gCAAgC,CACjC,CAAC;QACF,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;QAE7B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,QAAQ,CAAC,gDAAgD,CAAC,CAAC;YAC3D,QAAQ,CAAC,OAAO,CAAC,CAAC;YAClB,OAAO;QACT,CAAC;QAED,QAAQ,CAAC,YAAY,CAAC,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1B,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;YAC5B,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACvC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QACjC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Google logo icon (official colors)
3
+ */
4
+ export declare function GoogleIcon(): import("react/jsx-runtime").JSX.Element;
5
+ /**
6
+ * Notion logo icon
7
+ */
8
+ export declare function NotionIcon(): import("react/jsx-runtime").JSX.Element;
9
+ /**
10
+ * Slack logo icon (official colors)
11
+ */
12
+ export declare function SlackIcon(): import("react/jsx-runtime").JSX.Element;
13
+ /**
14
+ * Generic connection icon (used when provider is unknown)
15
+ */
16
+ export declare function DefaultIcon(): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/react/client/icons.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,UAAU,4CAqBzB;AAED;;GAEG;AACH,wBAAgB,UAAU,4CAWzB;AAED;;GAEG;AACH,wBAAgB,SAAS,4CAqBxB;AAED;;GAEG;AACH,wBAAgB,WAAW,4CAc1B"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const iconStyle = {
3
+ width: "48px",
4
+ height: "48px",
5
+ };
6
+ /**
7
+ * Google logo icon (official colors)
8
+ */
9
+ export function GoogleIcon() {
10
+ return (_jsxs("svg", { style: iconStyle, viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { fill: "#EA4335", d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" }), _jsx("path", { fill: "#4285F4", d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" }), _jsx("path", { fill: "#FBBC05", d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" }), _jsx("path", { fill: "#34A853", d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" })] }));
11
+ }
12
+ /**
13
+ * Notion logo icon
14
+ */
15
+ export function NotionIcon() {
16
+ return (_jsxs("svg", { style: iconStyle, viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { width: "48", height: "48", rx: "8", fill: "#000000" }), _jsx("path", { fill: "#FFFFFF", d: "M11.5 8.5c.8-.7 1.8-1 3.2-1h18.6c1.8 0 3.2.7 3.2 2.1v29.8c0 1.4-.6 2.3-2 2.7-.4.1-.9.2-1.3.2H15c-2.2 0-3.5-1.1-3.5-3.1V11c0-.9.3-1.8 1-2.5l-1 0zm3.3 1.5c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v26.4c0 .5.3.8.8.8h16.8c.3 0 .5-.1.6-.3.1-.2.2-.4.2-.6V12c0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.7-.3H14.8z" }), _jsx("path", { fill: "#FFFFFF", d: "M16 15h10v2H16zM16 20h14v2H16zM16 25h14v2H16zM16 30h10v2H16z" })] }));
17
+ }
18
+ /**
19
+ * Slack logo icon (official colors)
20
+ */
21
+ export function SlackIcon() {
22
+ return (_jsxs("svg", { style: iconStyle, viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { fill: "#E01E5A", d: "M10.1 30.2c0 2.8-2.2 5-5 5s-5-2.2-5-5 2.2-5 5-5h5v5zm2.5 0c0-2.8 2.2-5 5-5s5 2.2 5 5v12.6c0 2.8-2.2 5-5 5s-5-2.2-5-5V30.2z" }), _jsx("path", { fill: "#36C5F0", d: "M17.6 10.1c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5v5h-5zm0 2.5c2.8 0 5 2.2 5 5s-2.2 5-5 5H5c-2.8 0-5-2.2-5-5s2.2-5 5-5h12.6z" }), _jsx("path", { fill: "#2EB67D", d: "M37.9 17.6c0-2.8 2.2-5 5-5s5 2.2 5 5-2.2 5-5 5h-5v-5zm-2.5 0c0 2.8-2.2 5-5 5s-5-2.2-5-5V5c0-2.8 2.2-5 5-5s5 2.2 5 5v12.6z" }), _jsx("path", { fill: "#ECB22E", d: "M30.4 37.9c2.8 0 5 2.2 5 5s-2.2 5-5 5-5-2.2-5-5v-5h5zm0-2.5c-2.8 0-5-2.2-5-5s2.2-5 5-5H43c2.8 0 5 2.2 5 5s-2.2 5-5 5H30.4z" })] }));
23
+ }
24
+ /**
25
+ * Generic connection icon (used when provider is unknown)
26
+ */
27
+ export function DefaultIcon() {
28
+ return (_jsxs("svg", { style: iconStyle, viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("circle", { cx: "24", cy: "24", r: "22", stroke: "#6b7280", strokeWidth: "2", fill: "none" }), _jsx("path", { d: "M24 14v10l7 7", stroke: "#6b7280", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("circle", { cx: "24", cy: "24", r: "3", fill: "#6b7280" })] }));
29
+ }
30
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../src/react/client/icons.tsx"],"names":[],"mappings":";AAEA,MAAM,SAAS,GAAkB;IAC/B,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,CACL,eAAK,KAAK,EAAE,SAAS,EAAE,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,aAC3E,eACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,yIAAyI,GAC3I,EACF,eACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,2HAA2H,GAC7H,EACF,eACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,kIAAkI,GACpI,EACF,eACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,6IAA6I,GAC/I,IACE,CACP,CAAC;AACJ,CAA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iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,SAAS,GAAG,IAC3C,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * React Client - Framework-agnostic OAuth components and utilities
3
+ *
4
+ * These exports work with any React framework (Next.js, TanStack Start, Remix, etc.)
5
+ * and don't depend on the Vercel AI SDK.
6
+ *
7
+ * For AI SDK-specific components, use "experience-ai/ai-sdk/client" instead.
8
+ */
9
+ export { useExperience, getAccessToken, isConnected, disconnect } from "./hooks";
10
+ export { setTokens, hasSession, getClientId, clearTokens } from "./token-manager";
11
+ export { getExperienceHeaders } from "./experience-transport";
12
+ export { defaultTheme, resolveTheme, createStyles } from "./styles";
13
+ export { GoogleIcon, NotionIcon, SlackIcon, DefaultIcon } from "./icons";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGjF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}