@fayz-ai/admin 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/dist/CommandPalette-GQ6SPITD.js +297 -0
  2. package/dist/CommandPalette-GQ6SPITD.js.map +1 -0
  3. package/dist/{ScheduleEditor-63TVSCJC.js → ScheduleEditor-YZPOCBTW.js} +6 -6
  4. package/dist/{ScheduleEditor-63TVSCJC.js.map → ScheduleEditor-YZPOCBTW.js.map} +1 -1
  5. package/dist/SubscriptionPage-JXJ56OOH.js +8 -0
  6. package/dist/{SubscriptionPage-5PJ25YAD.js.map → SubscriptionPage-JXJ56OOH.js.map} +1 -1
  7. package/dist/access/headless.d.ts +2 -2
  8. package/dist/access/limits-registry.d.ts +6 -3
  9. package/dist/access/limits-registry.d.ts.map +1 -1
  10. package/dist/app/AdminShell.d.ts.map +1 -1
  11. package/dist/app/admin-app.d.ts.map +1 -1
  12. package/dist/app/settings-tabs.store.d.ts +21 -0
  13. package/dist/app/settings-tabs.store.d.ts.map +1 -0
  14. package/dist/billing/index.js +2 -2
  15. package/dist/{chunk-7DFJEXCR.js → chunk-5GWUM4SM.js} +3 -3
  16. package/dist/{chunk-7DFJEXCR.js.map → chunk-5GWUM4SM.js.map} +1 -1
  17. package/dist/{chunk-ERDS4OJS.js → chunk-HYDNIBN6.js} +3 -3
  18. package/dist/{chunk-ERDS4OJS.js.map → chunk-HYDNIBN6.js.map} +1 -1
  19. package/dist/{chunk-WN6PGQSG.js → chunk-NB6X5O5L.js} +81 -10
  20. package/dist/chunk-NB6X5O5L.js.map +1 -0
  21. package/dist/{chunk-LZRLWKJ2.js → chunk-UHHEPU4A.js} +379 -88
  22. package/dist/chunk-UHHEPU4A.js.map +1 -0
  23. package/dist/{chunk-VTEP2AQX.js → chunk-WJ3H3RJN.js} +5 -3
  24. package/dist/chunk-WJ3H3RJN.js.map +1 -0
  25. package/dist/{chunk-G5PBC5OB.js → chunk-ZNV7Q2TO.js} +8 -8
  26. package/dist/chunk-ZNV7Q2TO.js.map +1 -0
  27. package/dist/components/GetStarted.d.ts +45 -0
  28. package/dist/components/GetStarted.d.ts.map +1 -0
  29. package/dist/components/RightRail.d.ts.map +1 -1
  30. package/dist/components/TeachMe.d.ts +83 -0
  31. package/dist/components/TeachMe.d.ts.map +1 -0
  32. package/dist/components/auth/SplitLogin.d.ts.map +1 -1
  33. package/dist/components/billing/SoftLimitProbes.d.ts +5 -0
  34. package/dist/components/billing/SoftLimitProbes.d.ts.map +1 -0
  35. package/dist/components/billing/SoftLimitWidget.d.ts +3 -0
  36. package/dist/components/billing/SoftLimitWidget.d.ts.map +1 -0
  37. package/dist/components/billing/index.d.ts +3 -1
  38. package/dist/components/billing/index.d.ts.map +1 -1
  39. package/dist/components/billing/soft-limit.store.d.ts +23 -0
  40. package/dist/components/billing/soft-limit.store.d.ts.map +1 -0
  41. package/dist/components/chat/ChatConversation.d.ts.map +1 -1
  42. package/dist/components/chat/ChatHistory.d.ts.map +1 -1
  43. package/dist/components/chat/ChatMessages.d.ts.map +1 -1
  44. package/dist/components/chat/ConfirmActionCard.d.ts +5 -1
  45. package/dist/components/chat/ConfirmActionCard.d.ts.map +1 -1
  46. package/dist/components/chat/index.d.ts +0 -1
  47. package/dist/components/chat/index.d.ts.map +1 -1
  48. package/dist/components/connect/ConnectorRuns.d.ts +1 -1
  49. package/dist/components/connect/ConnectorsPanel.d.ts.map +1 -1
  50. package/dist/components/connect/ConnectorsTab.d.ts.map +1 -1
  51. package/dist/components/connect/connector-status.d.ts +1 -1
  52. package/dist/components/connect/model.d.ts +1 -1
  53. package/dist/components/layout/CommandPalette.d.ts.map +1 -1
  54. package/dist/components/organization/PermissionProfilesTab.d.ts.map +1 -1
  55. package/dist/components/settings/LocationsCrudPage.d.ts.map +1 -1
  56. package/dist/components/settings/SettingsPage.d.ts.map +1 -1
  57. package/dist/components/shared/RecordPickerModal.d.ts +24 -1
  58. package/dist/components/shared/RecordPickerModal.d.ts.map +1 -1
  59. package/dist/components/survey/PublicSurveyPage.d.ts +8 -0
  60. package/dist/components/survey/PublicSurveyPage.d.ts.map +1 -0
  61. package/dist/crud/CrudDetailPage.d.ts.map +1 -1
  62. package/dist/crud/CrudFormPage.d.ts.map +1 -1
  63. package/dist/crud/CrudListView.d.ts +3 -1
  64. package/dist/crud/CrudListView.d.ts.map +1 -1
  65. package/dist/crud/CrudPage.d.ts.map +1 -1
  66. package/dist/crud/CrudRecordModal.d.ts.map +1 -1
  67. package/dist/crud/LookupCreateInline.d.ts.map +1 -1
  68. package/dist/crud/RelatedListTab.d.ts +10 -0
  69. package/dist/crud/RelatedListTab.d.ts.map +1 -0
  70. package/dist/crud/archetypes/BookableToggle.d.ts +12 -0
  71. package/dist/crud/archetypes/BookableToggle.d.ts.map +1 -0
  72. package/dist/crud/archetypes/DetailTabHeader.d.ts +23 -0
  73. package/dist/crud/archetypes/DetailTabHeader.d.ts.map +1 -0
  74. package/dist/crud/archetypes/KanbanBoard.d.ts +89 -0
  75. package/dist/crud/archetypes/KanbanBoard.d.ts.map +1 -0
  76. package/dist/crud/archetypes/OrderAmount.d.ts +25 -0
  77. package/dist/crud/archetypes/OrderAmount.d.ts.map +1 -0
  78. package/dist/crud/archetypes/OrderBoardView.d.ts +61 -0
  79. package/dist/crud/archetypes/OrderBoardView.d.ts.map +1 -0
  80. package/dist/crud/archetypes/OrderCreateScreen.d.ts +116 -0
  81. package/dist/crud/archetypes/OrderCreateScreen.d.ts.map +1 -0
  82. package/dist/crud/archetypes/OrderDetailPage.d.ts +35 -0
  83. package/dist/crud/archetypes/OrderDetailPage.d.ts.map +1 -0
  84. package/dist/crud/archetypes/OrderDetailRail.d.ts +97 -0
  85. package/dist/crud/archetypes/OrderDetailRail.d.ts.map +1 -0
  86. package/dist/crud/archetypes/OrderDetailView.d.ts.map +1 -1
  87. package/dist/crud/archetypes/OrderFormView.d.ts +20 -1
  88. package/dist/crud/archetypes/OrderFormView.d.ts.map +1 -1
  89. package/dist/crud/archetypes/OrderListView.d.ts +59 -1
  90. package/dist/crud/archetypes/OrderListView.d.ts.map +1 -1
  91. package/dist/crud/archetypes/OrderPaymentChip.d.ts +8 -0
  92. package/dist/crud/archetypes/OrderPaymentChip.d.ts.map +1 -0
  93. package/dist/crud/archetypes/PaymentStatusBadge.d.ts +47 -0
  94. package/dist/crud/archetypes/PaymentStatusBadge.d.ts.map +1 -0
  95. package/dist/crud/archetypes/PersonDetailTabs.d.ts.map +1 -1
  96. package/dist/crud/archetypes/orderVocabulary.d.ts +19 -0
  97. package/dist/crud/archetypes/orderVocabulary.d.ts.map +1 -0
  98. package/dist/crud/archetypes/useOrderEditor.d.ts +20 -0
  99. package/dist/crud/archetypes/useOrderEditor.d.ts.map +1 -0
  100. package/dist/crud/archetypes/useOrderReceivable.d.ts +46 -0
  101. package/dist/crud/archetypes/useOrderReceivable.d.ts.map +1 -0
  102. package/dist/crud/archetypes/useOrdersPaymentStatus.d.ts +15 -0
  103. package/dist/crud/archetypes/useOrdersPaymentStatus.d.ts.map +1 -0
  104. package/dist/crud/createCrudPage.d.ts +3 -0
  105. package/dist/crud/createCrudPage.d.ts.map +1 -1
  106. package/dist/crud/relation-field.d.ts.map +1 -1
  107. package/dist/directory/AppSwitcher.d.ts +48 -0
  108. package/dist/directory/AppSwitcher.d.ts.map +1 -0
  109. package/dist/directory/FamilyWordmark.d.ts +20 -0
  110. package/dist/directory/FamilyWordmark.d.ts.map +1 -0
  111. package/dist/directory/app-id.d.ts +21 -0
  112. package/dist/directory/app-id.d.ts.map +1 -0
  113. package/dist/directory/directory.store.d.ts +20 -0
  114. package/dist/directory/directory.store.d.ts.map +1 -0
  115. package/dist/directory/index.d.ts +7 -0
  116. package/dist/directory/index.d.ts.map +1 -0
  117. package/dist/directory/types.d.ts +43 -0
  118. package/dist/directory/types.d.ts.map +1 -0
  119. package/dist/directory/useAppDirectory.d.ts +14 -0
  120. package/dist/directory/useAppDirectory.d.ts.map +1 -0
  121. package/dist/hooks/useAITools.d.ts +7 -0
  122. package/dist/hooks/useAITools.d.ts.map +1 -1
  123. package/dist/hooks/useAppConfig.d.ts.map +1 -1
  124. package/dist/hooks/useChat.d.ts +4 -0
  125. package/dist/hooks/useChat.d.ts.map +1 -1
  126. package/dist/hooks/useTenant.d.ts +12 -12
  127. package/dist/hooks/useTenant.d.ts.map +1 -1
  128. package/dist/index.d.ts +43 -5
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +25069 -21491
  131. package/dist/index.js.map +1 -1
  132. package/dist/lib/agent-staff.d.ts +46 -96
  133. package/dist/lib/agent-staff.d.ts.map +1 -1
  134. package/dist/lib/ai-tool-handlers.d.ts +24 -7
  135. package/dist/lib/ai-tool-handlers.d.ts.map +1 -1
  136. package/dist/lib/assistant-invite.d.ts.map +1 -1
  137. package/dist/lib/bookable-service.d.ts +7 -0
  138. package/dist/lib/bookable-service.d.ts.map +1 -0
  139. package/dist/lib/core-ai-tools.d.ts +0 -17
  140. package/dist/lib/core-ai-tools.d.ts.map +1 -1
  141. package/dist/lib/fayz-agent.d.ts +2 -0
  142. package/dist/lib/fayz-agent.d.ts.map +1 -1
  143. package/dist/lib/product-name.d.ts +38 -0
  144. package/dist/lib/product-name.d.ts.map +1 -0
  145. package/dist/lib/tool-search.d.ts +82 -0
  146. package/dist/lib/tool-search.d.ts.map +1 -0
  147. package/dist/onboarding/ActivationAgentSurface.d.ts.map +1 -1
  148. package/dist/onboarding/ActivationChecklistCard.d.ts +11 -1
  149. package/dist/onboarding/ActivationChecklistCard.d.ts.map +1 -1
  150. package/dist/onboarding/ActivationProvider.d.ts.map +1 -1
  151. package/dist/onboarding/WorkspaceSetupFlow.d.ts.map +1 -1
  152. package/dist/onboarding/business-profile.d.ts +67 -0
  153. package/dist/onboarding/business-profile.d.ts.map +1 -0
  154. package/dist/onboarding/checklist.d.ts +10 -0
  155. package/dist/onboarding/checklist.d.ts.map +1 -1
  156. package/dist/onboarding/decide.d.ts +23 -0
  157. package/dist/onboarding/decide.d.ts.map +1 -1
  158. package/dist/onboarding/guided-runner.d.ts +11 -0
  159. package/dist/onboarding/guided-runner.d.ts.map +1 -1
  160. package/dist/onboarding/guided.d.ts +21 -1
  161. package/dist/onboarding/guided.d.ts.map +1 -1
  162. package/dist/onboarding/index.d.ts +4 -2
  163. package/dist/onboarding/index.d.ts.map +1 -1
  164. package/dist/onboarding/packs/retail.d.ts.map +1 -1
  165. package/dist/onboarding/programs.d.ts +25 -1
  166. package/dist/onboarding/programs.d.ts.map +1 -1
  167. package/dist/onboarding/useWorkspaceSetupGate.d.ts.map +1 -1
  168. package/dist/onboarding/welcome.d.ts +27 -0
  169. package/dist/onboarding/welcome.d.ts.map +1 -0
  170. package/dist/org/WorkspaceChooser.d.ts +20 -0
  171. package/dist/org/WorkspaceChooser.d.ts.map +1 -0
  172. package/dist/org/WorkspaceChooserGate.d.ts +21 -0
  173. package/dist/org/WorkspaceChooserGate.d.ts.map +1 -0
  174. package/dist/org/WorkspaceSwitching.d.ts +25 -0
  175. package/dist/org/WorkspaceSwitching.d.ts.map +1 -0
  176. package/dist/org/WorkspaceSwitchingHost.d.ts +11 -0
  177. package/dist/org/WorkspaceSwitchingHost.d.ts.map +1 -0
  178. package/dist/org/adapters/supabase.d.ts +1 -1
  179. package/dist/org/adapters/supabase.d.ts.map +1 -1
  180. package/dist/org/choice.d.ts +41 -0
  181. package/dist/org/choice.d.ts.map +1 -0
  182. package/dist/org/context.d.ts +8 -0
  183. package/dist/org/context.d.ts.map +1 -1
  184. package/dist/org/index.d.ts +12 -1
  185. package/dist/org/index.d.ts.map +1 -1
  186. package/dist/org/index.js +4 -4
  187. package/dist/org/self.d.ts.map +1 -1
  188. package/dist/org/store.d.ts +2 -1
  189. package/dist/org/store.d.ts.map +1 -1
  190. package/dist/org/switching.store.d.ts +27 -0
  191. package/dist/org/switching.store.d.ts.map +1 -0
  192. package/dist/permissions/context.d.ts +26 -0
  193. package/dist/permissions/context.d.ts.map +1 -1
  194. package/dist/permissions/index.js +1 -1
  195. package/dist/projects/SeuSiteWidget.d.ts.map +1 -1
  196. package/dist/setup/SetupAgentSurface.d.ts +2 -0
  197. package/dist/setup/SetupAgentSurface.d.ts.map +1 -0
  198. package/dist/setup/format.d.ts +21 -0
  199. package/dist/setup/format.d.ts.map +1 -0
  200. package/dist/setup/registry.d.ts +29 -0
  201. package/dist/setup/registry.d.ts.map +1 -0
  202. package/dist/setup/validate.d.ts +26 -0
  203. package/dist/setup/validate.d.ts.map +1 -0
  204. package/dist/stores/chat.store.d.ts +15 -18
  205. package/dist/stores/chat.store.d.ts.map +1 -1
  206. package/dist/stores/createCrudStore.d.ts +2 -0
  207. package/dist/stores/createCrudStore.d.ts.map +1 -1
  208. package/dist/tasks/components/TaskDetail.d.ts.map +1 -1
  209. package/dist/units/UnitMenuSection.d.ts.map +1 -1
  210. package/dist/units/UnitSwitcher.d.ts.map +1 -1
  211. package/dist/units/UnitSwitching.d.ts +24 -0
  212. package/dist/units/UnitSwitching.d.ts.map +1 -0
  213. package/dist/units/UnitSwitchingHost.d.ts +11 -0
  214. package/dist/units/UnitSwitchingHost.d.ts.map +1 -0
  215. package/dist/units/data.d.ts +30 -4
  216. package/dist/units/data.d.ts.map +1 -1
  217. package/dist/units/index.d.ts +2 -0
  218. package/dist/units/index.d.ts.map +1 -1
  219. package/dist/units/switching.store.d.ts +31 -0
  220. package/dist/units/switching.store.d.ts.map +1 -0
  221. package/package.json +6 -6
  222. package/dist/CommandPalette-XY3VOEAV.js +0 -291
  223. package/dist/CommandPalette-XY3VOEAV.js.map +0 -1
  224. package/dist/SubscriptionPage-5PJ25YAD.js +0 -8
  225. package/dist/chunk-G5PBC5OB.js.map +0 -1
  226. package/dist/chunk-LZRLWKJ2.js.map +0 -1
  227. package/dist/chunk-VTEP2AQX.js.map +0 -1
  228. package/dist/chunk-WN6PGQSG.js.map +0 -1
  229. package/dist/components/billing/SoftLimitBanner.d.ts +0 -5
  230. package/dist/components/billing/SoftLimitBanner.d.ts.map +0 -1
  231. package/dist/components/chat/StaffHireView.d.ts +0 -21
  232. package/dist/components/chat/StaffHireView.d.ts.map +0 -1
  233. package/dist/components/chat/StaffPitchCard.d.ts +0 -15
  234. package/dist/components/chat/StaffPitchCard.d.ts.map +0 -1
  235. package/dist/components/chat/StaffSwitcher.d.ts +0 -23
  236. package/dist/components/chat/StaffSwitcher.d.ts.map +0 -1
  237. package/dist/lib/staff-cards.d.ts +0 -11
  238. package/dist/lib/staff-cards.d.ts.map +0 -1
@@ -8,10 +8,33 @@ export interface SetupDecisionInput {
8
8
  hasTenant: boolean;
9
9
  /** The bootstrap has finished FOR THIS ACCOUNT. */
10
10
  settled: boolean;
11
+ /**
12
+ * The membership list was actually READ for this account — not just waited on.
13
+ *
14
+ * `settled` only says the wait is over, and it is set in a `finally`, so a
15
+ * `listUserOrgs` that threw settles too. That is right for releasing the
16
+ * screen and catastrophic for this decision: "we asked and could not tell"
17
+ * was being read as "this account has no workspace", which raised the
18
+ * unexitable first-run wizard over a working store. Reported as: a new
19
+ * account that had already created its tenant getting the setup flow on
20
+ * `#/products` with no way to dismiss it.
21
+ */
22
+ orgsKnown: boolean;
11
23
  /** An org is on screen (from cache or from the network). */
12
24
  hasOrg: boolean;
13
25
  /** How many workspaces this account belongs to. */
14
26
  orgCount: number;
27
+ /**
28
+ * The provider is mid-bootstrap.
29
+ *
30
+ * `orgsKnown` and `orgCount` come from two different stores — React state in
31
+ * the provider, and the zustand org store — so there are windows where the
32
+ * first says "we read the list" while the second has already been emptied by
33
+ * a `reset()` for the load that is running right now. That window is short,
34
+ * unreproducible on demand, and long enough to raise an unexitable first-run
35
+ * wizard over a working account. A load in flight is never an answer.
36
+ */
37
+ loading: boolean;
15
38
  /** Someone asked for the flow: the switcher, or the route. */
16
39
  requested: SetupSource | null;
17
40
  onRoute: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/onboarding/decide.ts"],"names":[],"mappings":"AAAA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AA;IAChB,8DAA8D;IAC9D,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAA;IACf,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAsB7E"}
@@ -71,6 +71,17 @@ export declare function currentRunKey(): string | null;
71
71
  export declare function clearRun(): void;
72
72
  /** A line from the assistant, straight into the thread. No turn, no bill. */
73
73
  export declare function say(text: string, cards?: ChatCard[]): void;
74
+ /**
75
+ * Put every half-typed line on screen at once.
76
+ *
77
+ * Called whenever a new run takes the floor: the previous script's sentence was
78
+ * mid-reveal, and letting it keep dribbling in UNDER the new one is the same
79
+ * talking-over-itself this module exists to prevent. A line that was worth
80
+ * saying is worth finishing; only the pacing is abandoned.
81
+ *
82
+ * Also what makes `say` assertable — a transcript is text, not an animation.
83
+ */
84
+ export declare function flushTyping(): void;
74
85
  export interface PlayOptions {
75
86
  /** Overridden in tests; the real one is `setTimeout`. */
76
87
  wait?: (ms: number) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"guided-runner.d.ts","sourceRoot":"","sources":["../../src/onboarding/guided-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAe,MAAM,eAAe,CAAA;AAGzE,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;CAC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}
@@ -1,4 +1,21 @@
1
1
  import type { ActivationStep } from './programs';
2
+ /**
3
+ * Make sure the checklist EXISTS before anybody tries to walk it.
4
+ *
5
+ * The shell seeds on boot, but it deliberately refuses to seed a workspace that
6
+ * has no rows at all (see ActivationProvider): a business that has been running
7
+ * for months must not be handed a "set up your workspace" list it never asked
8
+ * for. That guard is right for a silent boot and wrong for this: somebody who
9
+ * just asked to be walked through the setup HAS asked for the list.
10
+ *
11
+ * Without it the run was theatre — every step showed as open (nothing had ever
12
+ * been closed), the checklist rendered nothing (`rows.length === 0`), and every
13
+ * tick was dropped on the floor, because `complete()` needs a row to update.
14
+ *
15
+ * The write is the same idempotent upsert the wizard does, so a second ask
16
+ * converges on the same N rows.
17
+ */
18
+ export declare function ensureChecklist(): Promise<void>;
2
19
  /**
3
20
  * Start the guided run — the assistant walking somebody through the checklist.
4
21
  *
@@ -13,8 +30,11 @@ import type { ActivationStep } from './programs';
13
30
  * the step, and only then the assistant is asked to take over — arriving at a
14
31
  * page that is already open reads as company, arriving before it reads as a
15
32
  * chatbot describing a menu.
33
+ *
34
+ * The list is created first when this workspace never had one — see
35
+ * `ensureChecklist`. Fire-and-forget is fine for the callers that are buttons.
16
36
  */
17
- export declare function startGuidedRun(stepKey?: string): void;
37
+ export declare function startGuidedRun(stepKey?: string): Promise<void>;
18
38
  /**
19
39
  * One step of the run: play its script, or hand the model the job when it has
20
40
  * none. Everything that advances the run — the button, the auto-start, a step
@@ -1 +1 @@
1
- {"version":3,"file":"guided.d.ts","sourceRoot":"","sources":["../../src/onboarding/guided.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAOrD;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC7E;AAED,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAOvE"}
1
+ {"version":3,"file":"guided.d.ts","sourceRoot":"","sources":["../../src/onboarding/guided.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAgBrD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpE;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC7E;AAED,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAOvE"}
@@ -16,11 +16,13 @@ export { GettingStartedWidget } from './GettingStartedWidget';
16
16
  export { ActivationProvider } from './ActivationProvider';
17
17
  export { ActivationChecklistCard, type ActivationChecklistCardProps } from './ActivationChecklistCard';
18
18
  export { useActivationWatch } from './useActivationWatch';
19
- export { startGuidedRun, runStep, celebrate } from './guided';
19
+ export { startGuidedRun, ensureChecklist, runStep, celebrate } from './guided';
20
20
  export { planScript, playScript, runStepScript, say, type ScriptAct, type ScriptPlan, type PlayOptions, } from './guided-runner';
21
21
  export { ActivationAgentSurface } from './ActivationAgentSurface';
22
22
  export { useActivationStore, selectSteps, openStepKeys, type ActivationState, } from './activation.store';
23
- export { buildActivationCatalog, programInstructions, supersededKeys, type ActivationStep, type BuildCatalogInput, } from './programs';
23
+ export { buildActivationCatalog, programInstructions, supersededKeys, retiredKeys, type ActivationStep, type BuildCatalogInput, } from './programs';
24
+ export { useBusinessProfileStore, buildBusinessProfile, businessProfileBlock, currentBusinessProfileBlock, describeAnswers, type BusinessProfile, type BusinessFact, } from './business-profile';
25
+ export { runWelcome, orientationTour, type WelcomeInput } from './welcome';
24
26
  export { onboardingChecklist, mergeOnboardingSteps, dueDateFor, type OnboardingTaskSeed, type MergeContext, } from './checklist';
25
27
  export { seedOnboardingTasks, listOnboardingTasks, completeOnboardingTask, cancelOnboardingTask } from './tasks';
26
28
  export { toQuestionSpecs, coerceAnswers, type QuestionSpec, type QuestionType } from './questions';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/onboarding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACvF,OAAO,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC5F,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC9H,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC9G,OAAO,EAAE,iBAAiB,EAAE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U,EACrD,KAAK,kBAAkB,EAAE,KAAK,YAAY,GAC3C,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAChH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAClG,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,SAAS,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"retail.d.ts","sourceRoot":"","sources":["../../../src/onboarding/packs/retail.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,YAkKxB,CAAA"}
1
+ {"version":3,"file":"retail.d.ts","sourceRoot":"","sources":["../../../src/onboarding/packs/retail.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,YAqLxB,CAAA"}
@@ -36,6 +36,15 @@ export interface ActivationStep extends OnboardingTaskSeed {
36
36
  export interface BuildCatalogInput {
37
37
  verticalId?: string;
38
38
  programs?: ResolvedOnboardingProgram[];
39
+ /**
40
+ * The setup answers, raw (see `BusinessProfile.answers`).
41
+ *
42
+ * Absent — a workspace older than the questionnaire, or the profile still
43
+ * loading — means every step that asked about the answers is KEPT. A
44
+ * checklist that shrinks while a read is in flight is worse than one that
45
+ * carries a step somebody can tick off.
46
+ */
47
+ answers?: Record<string, unknown>;
39
48
  /**
40
49
  * "Does this app have that screen?"
41
50
  *
@@ -57,7 +66,22 @@ export interface BuildCatalogInput {
57
66
  * "name your business" has to come before "import your catalog", and a module's
58
67
  * own steps have to stay in the order the module wrote them.
59
68
  */
60
- export declare function buildActivationCatalog({ verticalId, programs, hasRoute, }: BuildCatalogInput): ActivationStep[];
69
+ export declare function buildActivationCatalog({ verticalId, programs, hasRoute, answers, }: BuildCatalogInput): ActivationStep[];
70
+ /**
71
+ * Steps this workspace has since grown out of, by key.
72
+ *
73
+ * The wizard seeds the checklist at signup — before the setup answers can be
74
+ * read back, and before the app's own routes are known. So a row can already
75
+ * exist for a step that this business turns out not to need ("configure o
76
+ * frete" where nothing ships) or that this app cannot serve ("publique seu
77
+ * site" in a product with no site). Either way it is a row in the Tasks panel
78
+ * with no checklist behind it, and nothing can ever tick it.
79
+ *
80
+ * Derived rather than re-decided: the UNFILTERED catalog minus the real one is
81
+ * exactly the set that was dropped, so a new filter is covered here the day it
82
+ * is added. Read by the shell and closed, the same way a superseded step is.
83
+ */
84
+ export declare function retiredKeys(input: BuildCatalogInput): Set<string>;
61
85
  /**
62
86
  * Base keys the active programs supersede.
63
87
  *
@@ -1 +1 @@
1
- {"version":3,"file":"programs.d.ts","sourceRoot":"","sources":["../../src/onboarding/programs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAqB,yBAAyB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC1G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAE1E;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;IACzB,4DAA4D;IAC5D,SAAS,C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AAClF,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAEtD,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,CAgC/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAK/D"}
1
+ {"version":3,"file":"useWorkspaceSetupGate.d.ts","sourceRoot":"","sources":["../../src/onboarding/useWorkspaceSetupGate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAEtD,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,CAyC/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAK/D"}
@@ -0,0 +1,27 @@
1
+ import { type TourDef } from '@fayz-ai/core';
2
+ /**
3
+ * The room, in two stops.
4
+ *
5
+ * Deliberately about the SHELL and not about any one screen: what the checklist
6
+ * is, where it lives when this conversation is over, and that the assistant is
7
+ * a permanent fixture rather than a setup wizard that disappears. Everything
8
+ * screen-specific belongs to the step that opens that screen.
9
+ */
10
+ export declare function orientationTour(stepCount: number): TourDef;
11
+ export interface WelcomeInput {
12
+ userName?: string;
13
+ businessName?: string;
14
+ verticalId?: string;
15
+ /** Overridden in tests. */
16
+ wait?: (ms: number) => Promise<void>;
17
+ }
18
+ /**
19
+ * Greet, orient, then hand over to the guided run.
20
+ *
21
+ * Takes the run token BEFORE it says anything: a sensor firing while the
22
+ * greeting is still being read would otherwise start a second script into the
23
+ * same thread, and two walkthroughs talking at once is the failure this
24
+ * machinery exists to prevent (see guided-runner's `beginRun`).
25
+ */
26
+ export declare function runWelcome(input?: WelcomeInput): Promise<void>;
27
+ //# sourceMappingURL=welcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../src/onboarding/welcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AA2EhD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAsB1D;AAQD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACrC;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,KAAK,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDxE"}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import type { OrgMembership } from '@fayz-ai/core';
3
+ export interface WorkspaceChooserProps {
4
+ /** Every workspace this account can open in THIS app. */
5
+ memberships: OrgMembership[];
6
+ /** The last one this browser was in — pre-selected, not auto-entered. */
7
+ suggestedId: string | null;
8
+ /** Present only when there is a workspace to go back to (the switcher route). */
9
+ onCancel?: () => void;
10
+ }
11
+ /**
12
+ * "Which of your workspaces?" — asked once, on the way in.
13
+ *
14
+ * Deliberately a full screen rather than a dialog. Behind it the shell would be
15
+ * rendering an account nobody has chosen yet, and every plugin on it would be
16
+ * firing tenant-scoped requests against that guess; a dialog implies there is
17
+ * something valid underneath, and there is not.
18
+ */
19
+ export declare function WorkspaceChooser({ memberships, suggestedId, onCancel }: WorkspaceChooserProps): React.JSX.Element;
20
+ //# sourceMappingURL=WorkspaceChooser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceChooser.d.ts","sourceRoot":"","sources":["../../src/org/WorkspaceChooser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAOlD,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,WAAW,EAAE,aAAa,EAAE,CAAA;IAC5B,yEAAyE;IACzE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,qBAAqB,qBAmI7F"}
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export interface WorkspaceChooserGateProps {
3
+ /** Held on screen while the membership list is still in flight. */
4
+ fallback?: React.ReactNode;
5
+ children: React.ReactNode;
6
+ }
7
+ /**
8
+ * Puts the workspace picker in front of the shell when this account owes a
9
+ * choice, and gets out of the way when it does not.
10
+ *
11
+ * There is no new state to keep: `decideWorkspaceChoice` already refuses to
12
+ * pick for the provider in exactly this case, so "a list we have read, more
13
+ * than one row in it, and no active workspace" IS the question being open.
14
+ * A separate flag would be a second copy of that fact, free to disagree.
15
+ *
16
+ * Mounted between the setup gate and the shell: an account with NO workspace
17
+ * belongs to the setup flow (there is nothing to choose from), and an account
18
+ * with one never sees this at all.
19
+ */
20
+ export declare function WorkspaceChooserGate({ fallback, children }: WorkspaceChooserGateProps): React.JSX.Element;
21
+ //# sourceMappingURL=WorkspaceChooserGate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceChooserGate.d.ts","sourceRoot":"","sources":["../../src/org/WorkspaceChooserGate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,yBAAyB;IACxC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,yBAAyB,qBA2BrF"}
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ export interface WorkspaceSwitchingProps {
3
+ /** The workspace being entered, named — the one fact that makes this concrete. */
4
+ orgName: string;
5
+ /** Its logo, when it has one. */
6
+ orgLogoUrl?: string;
7
+ /** Runs once the last step has been shown. Reloads the page, in practice. */
8
+ onDone: () => void;
9
+ }
10
+ /**
11
+ * The screen between two workspaces.
12
+ *
13
+ * Changing tenant ends in a full reload, because half the app holds the old
14
+ * tenant's rows in plugin stores and caches that nothing else invalidates. A
15
+ * reload with no cover reads as a crash — the app blanks, comes back, and the
16
+ * numbers are different. This covers it and says what is happening, so the
17
+ * second it costs is spent visibly rather than suspiciously.
18
+ *
19
+ * Sized like a moment, not a toast: the workspace name is the largest thing on
20
+ * screen because it is the answer to the only question anyone has here — where
21
+ * am I about to be. The steps are honest about the order of operations, and the
22
+ * last one is a security claim, so it gets an icon rather than another dot.
23
+ */
24
+ export declare function WorkspaceSwitching({ orgName, orgLogoUrl, onDone }: WorkspaceSwitchingProps): React.JSX.Element;
25
+ //# sourceMappingURL=WorkspaceSwitching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceSwitching.d.ts","sourceRoot":"","sources":["../../src/org/WorkspaceSwitching.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,MAAM,WAAW,uBAAuB;IACtC,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,uBAAuB,qBAkH1F"}
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Renders the workspace transition over whatever is on screen, and performs the
4
+ * reload it exists to cover.
5
+ *
6
+ * Mounted once, high in the shell: the switch can be started from the topbar
7
+ * picker or from anywhere else that grows one, and none of those places should
8
+ * own a full-screen overlay.
9
+ */
10
+ export declare function WorkspaceSwitchingHost(): React.JSX.Element | null;
11
+ //# sourceMappingURL=WorkspaceSwitchingHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceSwitchingHost.d.ts","sourceRoot":"","sources":["../../src/org/WorkspaceSwitchingHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,6BAerC"}
@@ -7,7 +7,7 @@ export interface RoleIdentity {
7
7
  name: string;
8
8
  description?: string;
9
9
  /** System roles are app-defined and static (not user-editable). Custom roles
10
- * (duplicated by users, stored in tenant_roles) are false. Defaults true. */
10
+ * (duplicated by users, stored in app.roles) are false. Defaults true. */
11
11
  isSystem?: boolean;
12
12
  }
13
13
  export interface SupabaseOrgAdapterConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../../src/org/adapters/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAuC,WAAW,EAAE,MAAM,eAAe,CAAA;AAoGrF;iFACiF;AACjF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;kFAC8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAoID,MAAM,WAAW,wBAAwB;IACvC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;uDACmD;IACnD,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;IACtB;;gEAE4D;IAC5D,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB;;;;;;4DAMwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,UAAU,CAgdtF"}
1
+ {"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../../src/org/adapters/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAuC,WAAW,EAAE,MAAM,eAAe,CAAA;AAqGrF;iFACiF;AACjF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;+EAC2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AA4ID,MAAM,WAAW,wBAAwB;IACvC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;uDACmD;IACnD,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;IACtB;;gEAE4D;IAC5D,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB;;;;;;4DAMwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,UAAU,CAwgBtF"}
@@ -0,0 +1,41 @@
1
+ import type { OrgMembership } from '@fayz-ai/core';
2
+ /** Records the destination, for the boot that happens after the reload. */
3
+ export declare function markWorkspaceSwitch(orgId: string): void;
4
+ /** Reads the destination and consumes it — it is good for one boot only. */
5
+ export declare function takeWorkspaceSwitch(): string | null;
6
+ /** Whether the last explicit choice stands in for every future login. */
7
+ export declare function getAutoPick(): boolean;
8
+ export declare function setAutoPick(on: boolean): void;
9
+ export interface WorkspaceChoiceInput {
10
+ /** Every workspace this account belongs to, as the membership list read it. */
11
+ memberships: OrgMembership[];
12
+ /** A switch that is completing across a reload — already answered, once. */
13
+ switchingToId?: string | null;
14
+ /** A sibling app's switcher named a workspace on the way in (008). */
15
+ handoffId: string | null;
16
+ /** `fayz:current-org` — the last workspace this browser was in. */
17
+ pinnedId: string | null;
18
+ /** "Não perguntar novamente" is on for this browser. */
19
+ autoPick: boolean;
20
+ }
21
+ export type WorkspaceChoice =
22
+ /** Open this one without asking. */
23
+ {
24
+ kind: 'resolved';
25
+ orgId: string;
26
+ }
27
+ /** Put the picker on screen; `suggestedId` is the row to pre-select. */
28
+ | {
29
+ kind: 'ask';
30
+ suggestedId: string | null;
31
+ }
32
+ /** No workspace at all — the first-run setup flow's business, not ours. */
33
+ | {
34
+ kind: 'none';
35
+ };
36
+ /**
37
+ * The decision, as a function, so the one piece of logic that decides what a
38
+ * multi-workspace account sees after login can be tested without a browser.
39
+ */
40
+ export declare function decideWorkspaceChoice({ memberships, switchingToId, handoffId, pinnedId, autoPick, }: WorkspaceChoiceInput): WorkspaceChoice;
41
+ //# sourceMappingURL=choice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../src/org/choice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AA4BlD,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAOvD;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CASnD;AAED,yEAAyE;AACzE,wBAAgB,WAAW,IAAI,OAAO,CAOrC;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAQ7C;AAED,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,WAAW,EAAE,aAAa,EAAE,CAAA;IAC5B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,sEAAsE;IACtE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,wDAAwD;IACxD,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,eAAe;AACzB,oCAAoC;AAClC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AACrC,wEAAwE;GACtE;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;AAC7C,2EAA2E;GACzE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpB;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,aAAoB,EACpB,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE,oBAAoB,GAAG,eAAe,CA0BxC"}
@@ -18,6 +18,14 @@ export interface TenantContext {
18
18
  * mind a frame later.
19
19
  */
20
20
  settled: boolean;
21
+ /**
22
+ * The membership list was actually READ for this account, and answered.
23
+ *
24
+ * Distinct from `settled`, which only says the wait is over — it is set in a
25
+ * `finally`, so a failed `listUserOrgs` settles too. Anything that treats
26
+ * "no orgs" as a FACT (the first-run setup gate) has to ask this instead.
27
+ */
28
+ orgsKnown: boolean;
21
29
  /** Switch the active org */
22
30
  switchOrg: (orgId: string) => Promise<void>;
23
31
  /** Refresh the current org from the adapter */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/org/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAoB5E,wBAAgB,aAAa,IAAI,UAAU,CAM1C;AAED,wBAAgB,qBAAqB,IAAI,UAAU,GAAG,IAAI,CAEzD;AAMD,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAA;IACxB,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,4BAA4B;IAC5B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAID;;;GAGG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAMzC;AAED,wBAAgB,iBAAiB,IAAI,aAAa,GAAG,IAAI,CAExD;AAMD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,UAAU,CAAA;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAKD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,UAAkB,EAClB,UAA6B,EAC7B,QAAQ,GACT,EAAE,gBAAgB,qBAoQlB"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/org/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAqB5E,wBAAgB,aAAa,IAAI,UAAU,CAM1C;AAED,wBAAgB,qBAAqB,IAAI,UAAU,GAAG,IAAI,CAEzD;AAMD,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAA;IACxB,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB,4BAA4B;IAC5B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAID;;;GAGG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAMzC;AAED,wBAAgB,iBAAiB,IAAI,aAAa,GAAG,IAAI,CAExD;AAMD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,UAAU,CAAA;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAKD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,UAAkB,EAClB,UAA6B,EAC7B,QAAQ,GACT,EAAE,gBAAgB,qBAmSlB"}
@@ -1,8 +1,19 @@
1
1
  export { createSupabaseOrgAdapter } from './adapters/supabase';
2
2
  export type { SupabaseOrgAdapterConfig } from './adapters/supabase';
3
3
  export { createMockOrgAdapter } from './adapters/mock';
4
- export { useOrganizationStore, getPersistedOrgId } from './store';
4
+ export { useOrganizationStore, getPersistedOrgId, persistOrgId } from './store';
5
5
  export type { OrgStore } from './store';
6
+ export { decideWorkspaceChoice, getAutoPick, setAutoPick, markWorkspaceSwitch, takeWorkspaceSwitch } from './choice';
7
+ export type { WorkspaceChoice, WorkspaceChoiceInput } from './choice';
8
+ export { WorkspaceChooser } from './WorkspaceChooser';
9
+ export type { WorkspaceChooserProps } from './WorkspaceChooser';
10
+ export { WorkspaceChooserGate } from './WorkspaceChooserGate';
11
+ export type { WorkspaceChooserGateProps } from './WorkspaceChooserGate';
12
+ export { useWorkspaceSwitchingStore } from './switching.store';
13
+ export type { WorkspaceSwitchingStore, SwitchTarget } from './switching.store';
14
+ export { WorkspaceSwitching } from './WorkspaceSwitching';
15
+ export type { WorkspaceSwitchingProps } from './WorkspaceSwitching';
16
+ export { WorkspaceSwitchingHost } from './WorkspaceSwitchingHost';
6
17
  export { ORG_CACHE_TTL_MS, readOrgSnapshot, clearOrgSnapshot } from './cache';
7
18
  export type { OrgSnapshot } from './cache';
8
19
  export { OrgProvider, useTenant, useTenantOptional, useOrgAdapter, useOrgAdapterOptional, } from './context';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/org/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,YAAY,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAGtD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACjE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAGvC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAA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BAA0B,CAAA;AAGjE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EACL,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
package/dist/org/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { createMockOrgAdapter, createSupabaseOrgAdapter } from '../chunk-LZRLWKJ2.js';
2
- export { ORG_CACHE_TTL_MS, OrgProvider, clearOrgSnapshot, readOrgSnapshot, useOrgAdapter, useOrgAdapterOptional, useTenant, useTenantOptional } from '../chunk-WN6PGQSG.js';
3
- import '../chunk-VTEP2AQX.js';
4
- export { getPersistedOrgId, useOrganizationStore } from '../chunk-7DFJEXCR.js';
1
+ export { WorkspaceChooser, WorkspaceChooserGate, WorkspaceSwitching, WorkspaceSwitchingHost, createMockOrgAdapter, createSupabaseOrgAdapter, useWorkspaceSwitchingStore } from '../chunk-UHHEPU4A.js';
2
+ export { ORG_CACHE_TTL_MS, OrgProvider, clearOrgSnapshot, decideWorkspaceChoice, getAutoPick, markWorkspaceSwitch, readOrgSnapshot, setAutoPick, takeWorkspaceSwitch, useOrgAdapter, useOrgAdapterOptional, useTenant, useTenantOptional } from '../chunk-NB6X5O5L.js';
3
+ import '../chunk-WJ3H3RJN.js';
4
+ export { getPersistedOrgId, persistOrgId, useOrganizationStore } from '../chunk-5GWUM4SM.js';
5
5
  //# sourceMappingURL=index.js.map
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../../src/org/self.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA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AM,GACb,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAqB9B;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAuB9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;sDACsD;AACtD,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CAkB1D;AAED;8EAC8E;AAC9E,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,OAAO,UAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAcvE"}
@@ -1,5 +1,6 @@
1
1
  import { type Organization, type OrgMember, type OrgMembership } from '@fayz-ai/core';
2
2
  declare function getPersistedOrgId(): string | null;
3
+ declare function persistOrgId(orgId: string | null): void;
3
4
  export interface OrgStore {
4
5
  currentOrg: Organization | null;
5
6
  userOrgs: OrgMembership[];
@@ -16,5 +17,5 @@ export interface OrgStore {
16
17
  reset: () => void;
17
18
  }
18
19
  export declare const useOrganizationStore: import("zustand").UseBoundStore<import("zustand").StoreApi<OrgStore>>;
19
- export { getPersistedOrgId };
20
+ export { getPersistedOrgId, persistOrgId };
20
21
  //# sourceMappingURL=store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/org/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAQxG,iBAAS,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAO1C;AAmBD,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,YAAY,GAAG,IAAI,CAAA;IAC/B,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB;6EACyE;IACzE,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAEhB,aAAa,EAAE,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,WAAW,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,IAAI,CAAA;IAC5C,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,IAAI,CAAA;IAC1C,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC7C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,eAAO,MAAM,oBAAoB,uEA6B9B,CAAA;AAEH,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/org/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAQxG,iBAAS,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAO1C;AAED,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAWhD;AAMD,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,YAAY,GAAG,IAAI,CAAA;IAC/B,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB;6EACyE;IACzE,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAEhB,aAAa,EAAE,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,WAAW,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,IAAI,CAAA;IAC5C,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,IAAI,CAAA;IAC1C,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC7C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,eAAO,MAAM,oBAAoB,uEA6B9B,CAAA;AAEH,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,27 @@
1
+ export interface SwitchTarget {
2
+ orgId: string;
3
+ orgName: string;
4
+ /** So the transition shows the same mark the switcher row did. */
5
+ orgLogoUrl?: string;
6
+ }
7
+ export interface WorkspaceSwitchingStore {
8
+ /** The workspace being entered, while the transition is on screen. */
9
+ target: SwitchTarget | null;
10
+ /** Commit to a workspace and raise the transition. Ends in a reload. */
11
+ begin: (target: SwitchTarget) => void;
12
+ cancel: () => void;
13
+ }
14
+ /**
15
+ * Changing workspace, as a two-phase move: commit now, rebuild on the far side
16
+ * of a reload.
17
+ *
18
+ * Switching in place was the alternative and it does not work. `switchOrg`
19
+ * swaps the active tenant and re-hydrates the org, but every plugin store, the
20
+ * offline cache and whatever screen is open still hold the PREVIOUS tenant's
21
+ * rows, and nothing invalidates them centrally. The result is a shell that says
22
+ * one workspace while the table under it lists another's — a tenant boundary
23
+ * failure as far as anyone reading the screen is concerned, even though the
24
+ * database never leaked a row.
25
+ */
26
+ export declare const useWorkspaceSwitchingStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WorkspaceSwitchingStore>>;
27
+ //# sourceMappingURL=switching.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switching.store.d.ts","sourceRoot":"","sources":["../../src/org/switching.store.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,wEAAwE;IACxE,KAAK,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACrC,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,sFAiBpC,CAAA"}
@@ -2,8 +2,23 @@ import * as React from 'react';
2
2
  import type { FeatureDeclaration, PermissionsConfig, PermissionProfile } from '@fayz-ai/core';
3
3
  import { profileHasPermission } from '@fayz-ai/core/access';
4
4
  export { profileHasPermission };
5
+ /**
6
+ * Why a `hasPermission` answer can be trusted, in three states rather than two:
7
+ *
8
+ * - `loading` — the RBAC catalog has not arrived. Checks DENY (the engine
9
+ * fails closed), but the answer is not final: render a
10
+ * skeleton, not "you don't have access".
11
+ * - `ready` — the catalog arrived. A denial is the real answer, including
12
+ * for a member the org gave no role.
13
+ * - `unmanaged` — no <PermissionsProvider> in the tree at all. Only reported
14
+ * by the *Optional hooks, which allow everything: an SDK
15
+ * component under a bare host shell has no RBAC runtime to
16
+ * ask, and gating there is an enhancement, not a guarantee.
17
+ */
18
+ export type PermissionsStatus = 'loading' | 'ready' | 'unmanaged';
5
19
  interface PermissionsContextValue {
6
20
  hasPermission: (feature: string, action?: string) => boolean;
21
+ status: PermissionsStatus;
7
22
  canImpersonate: boolean;
8
23
  startImpersonation: (profile: PermissionProfile) => void;
9
24
  stopImpersonation: () => void;
@@ -23,8 +38,19 @@ export declare function usePermission(): (feature: string, action?: string) => b
23
38
  * is mounted — so SDK components (e.g. the CRUD engine's PermissionGate) work
24
39
  * under any host shell instead of throwing. Gating is an enhancement, not a
25
40
  * hard requirement at the component level.
41
+ *
42
+ * That fallback covers `unmanaged` ONLY. Under a provider this is the real
43
+ * check, which denies until the profile resolves: a missing provider means
44
+ * nobody asked for gating, while a missing profile means we cannot yet say yes.
45
+ * Pair with {@link usePermissionsStatus} to show a skeleton while `loading`.
26
46
  */
27
47
  export declare function usePermissionOptional(): (feature: string, action?: string) => boolean;
48
+ /**
49
+ * Why the current answers are what they are — `unmanaged` outside a provider.
50
+ * The signal a surface needs to avoid rendering a lock over a decision that has
51
+ * not been made yet.
52
+ */
53
+ export declare function usePermissionsStatus(): PermissionsStatus;
28
54
  /**
29
55
  * Convenience hook — returns true/false for a specific feature + action.
30
56
  * Example: `const canEdit = useHasPermission('clients', 'write')`
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/permissions/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAU7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAoB/B,UAAU,uBAAuB;IAC/B,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5D,cAAc,EAAE,OAAO,CAAA;IACvB,kBAAkB,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACxD,iBAAiB,EAAE,MAAM,IAAI,CAAA;CAC9B;AAQD,MAAM,WAAW,wBAAwB;IACv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A;IACxD,iBAAiB,EAAE,MAAM,IAAI,CAAA;CAC9B;AAQD,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,wBAAwB,qBA0CjF;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAM7E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAGrF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAM1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,uBAAuB,CAMxD;AAGD,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,3 +1,3 @@
1
- export { PermissionsProvider, useHasPermission, usePermission, usePermissionOptional, usePermissions, usePermissionsStore } from '../chunk-VTEP2AQX.js';
1
+ export { PermissionsProvider, useHasPermission, usePermission, usePermissionOptional, usePermissions, usePermissionsStore } from '../chunk-WJ3H3RJN.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SeuSiteWidget.d.ts","sourceRoot":"","sources":["../../src/projects/SeuSiteWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAiClD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,4BA+IpG"}
1
+ {"version":3,"file":"SeuSiteWidget.d.ts","sourceRoot":"","sources":["../../src/projects/SeuSiteWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AA0ClD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,4BAwJpG"}
@@ -0,0 +1,2 @@
1
+ export declare function SetupAgentSurface(): null;
2
+ //# sourceMappingURL=SetupAgentSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetupAgentSurface.d.ts","sourceRoot":"","sources":["../../src/setup/SetupAgentSurface.tsx"],"names":[],"mappings":"AA2FA,wBAAgB,iBAAiB,SAkGhC"}