@genispace/geniapp 0.1.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -0
  3. package/dist/CrossAppRecordPicker-BXchXcK5.js +624 -0
  4. package/dist/CrossAppRecordPicker-BXchXcK5.js.map +1 -0
  5. package/dist/Page-wHZrMN17.js +24 -0
  6. package/dist/Page-wHZrMN17.js.map +1 -0
  7. package/dist/ai/adopt/AiSuggestionPanel.d.ts +30 -0
  8. package/dist/ai/adopt/BusinessGuidancePanel.d.ts +31 -0
  9. package/dist/ai/adopt/DetailPageAiLayout.d.ts +7 -0
  10. package/dist/ai/adopt/adoptPresets.d.ts +11 -0
  11. package/dist/ai/adopt/guidanceContent.d.ts +27 -0
  12. package/dist/ai/adopt/parseAiSummary.d.ts +7 -0
  13. package/dist/ai/components/AgentJobProgress.d.ts +124 -0
  14. package/dist/ai/components/AsyncCombobox.d.ts +44 -0
  15. package/dist/ai/components/BulkActionBar.d.ts +44 -0
  16. package/dist/ai/components/EntityRef.d.ts +39 -0
  17. package/dist/ai/components/JobProgress.d.ts +64 -0
  18. package/dist/ai/components/ServerDataTable.d.ts +89 -0
  19. package/dist/ai/components/Timeline.d.ts +35 -0
  20. package/dist/ai/components/useInfiniteRows.d.ts +25 -0
  21. package/dist/ai/errors/userFacingError.d.ts +14 -0
  22. package/dist/ai/errors/userFacingError.js +48 -0
  23. package/dist/ai/errors/userFacingError.js.map +1 -0
  24. package/dist/ai/index.d.ts +34 -0
  25. package/dist/ai/integrations/partner/createPartnerRecordPickerHook.d.ts +15 -0
  26. package/dist/ai/integrations/partner/partnerRecordPicker.d.ts +20 -0
  27. package/dist/ai/layout/ModalWithAiLayout.d.ts +11 -0
  28. package/dist/ai/layout/aiUi.d.ts +16 -0
  29. package/dist/ai/layout/layoutConstants.d.ts +19 -0
  30. package/dist/ai/layout/modalSizeForAi.d.ts +5 -0
  31. package/dist/ai/locales/sharedAiCopy.d.ts +6 -0
  32. package/dist/ai/managed-data/DatasourceReadonlyTable.d.ts +11 -0
  33. package/dist/ai/managed-data/createTableClient.d.ts +7 -0
  34. package/dist/ai/managed-data/emitManagedEvent.d.ts +18 -0
  35. package/dist/ai/managed-data/executeManagedDatasource.d.ts +21 -0
  36. package/dist/ai/managed-data/queryManagedDatasource.d.ts +28 -0
  37. package/dist/ai/providers/AppUiProviders.d.ts +6 -0
  38. package/dist/ai/types/app-ai.types.d.ts +29 -0
  39. package/dist/ai/types/index.d.ts +1 -0
  40. package/dist/ai.d.ts +1 -0
  41. package/dist/ai.js +1817 -0
  42. package/dist/ai.js.map +1 -0
  43. package/dist/case-workspace/domain.d.ts +41 -0
  44. package/dist/case-workspace/domain.js +24 -0
  45. package/dist/case-workspace/domain.js.map +1 -0
  46. package/dist/case-workspace/index.d.ts +91 -0
  47. package/dist/case-workspace.d.ts +1 -0
  48. package/dist/case-workspace.js +392 -0
  49. package/dist/case-workspace.js.map +1 -0
  50. package/dist/cn-B6yFEsav.js +9 -0
  51. package/dist/cn-B6yFEsav.js.map +1 -0
  52. package/dist/components/ui/calendar.css +7 -0
  53. package/dist/cookieSettings-D_v3KS02.js +97 -0
  54. package/dist/cookieSettings-D_v3KS02.js.map +1 -0
  55. package/dist/dashboard/index.d.ts +16 -0
  56. package/dist/dashboard/src/ChartFrame.d.ts +18 -0
  57. package/dist/dashboard/src/ChartTooltip.d.ts +38 -0
  58. package/dist/dashboard/src/FilterBar.d.ts +23 -0
  59. package/dist/dashboard/src/KpiStatCard.d.ts +29 -0
  60. package/dist/dashboard/src/StatGrid.d.ts +15 -0
  61. package/dist/dashboard/src/TimeRangePicker.d.ts +14 -0
  62. package/dist/dashboard/src/chart.d.ts +10 -0
  63. package/dist/dashboard/src/format.d.ts +16 -0
  64. package/dist/dashboard/src/links.d.ts +2 -0
  65. package/dist/dashboard/src/useDashboardRange.d.ts +27 -0
  66. package/dist/dashboard.d.ts +1 -0
  67. package/dist/dashboard.js +361 -0
  68. package/dist/dashboard.js.map +1 -0
  69. package/dist/fonts.css +15 -0
  70. package/dist/hooks/access/AppAccessGate.d.ts +20 -0
  71. package/dist/hooks/access/AppAccessNotice.d.ts +8 -0
  72. package/dist/hooks/access/useAppAccess.d.ts +26 -0
  73. package/dist/hooks/config/businessLocale.d.ts +12 -0
  74. package/dist/hooks/config/currencies.d.ts +9 -0
  75. package/dist/hooks/index.d.ts +17 -0
  76. package/dist/hooks/picker/CrossAppRecordPicker.d.ts +37 -0
  77. package/dist/hooks/picker/managedAppPicker.d.ts +21 -0
  78. package/dist/hooks/picker/partnerPayload.d.ts +6 -0
  79. package/dist/hooks/routing/draftEntityId.d.ts +5 -0
  80. package/dist/hooks/routing/useRefetchOnRouteMatch.d.ts +6 -0
  81. package/dist/hooks/shell/resolveApiRoot.d.ts +13 -0
  82. package/dist/hooks/shell/shell.d.ts +4 -0
  83. package/dist/hooks/shell/useGenispacePlatformClient.d.ts +7 -0
  84. package/dist/hooks.d.ts +1 -0
  85. package/dist/hooks.js +42 -0
  86. package/dist/hooks.js.map +1 -0
  87. package/dist/index.d.ts +3 -0
  88. package/dist/index.js +77 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/kit.d.ts +50 -0
  91. package/dist/kit.js +2067 -0
  92. package/dist/kit.js.map +1 -0
  93. package/dist/page.d.ts +1 -0
  94. package/dist/page.js +5 -0
  95. package/dist/page.js.map +1 -0
  96. package/dist/shell-DIHnXIUb.js +6 -0
  97. package/dist/shell-DIHnXIUb.js.map +1 -0
  98. package/dist/shell.d.ts +30 -0
  99. package/dist/shell.js +104 -0
  100. package/dist/shell.js.map +1 -0
  101. package/dist/storage/assetPreview.d.ts +12 -0
  102. package/dist/storage/components/AssetThumbnail.d.ts +15 -0
  103. package/dist/storage/components/CopyStorageLinkButton.d.ts +13 -0
  104. package/dist/storage/components/StorageImage.d.ts +9 -0
  105. package/dist/storage/components/StoragePreviewContent.d.ts +22 -0
  106. package/dist/storage/components/StorageVideo.d.ts +9 -0
  107. package/dist/storage/copyTextToClipboard.d.ts +5 -0
  108. package/dist/storage/hooks/useAuthenticatedStorageBlobs.d.ts +3 -0
  109. package/dist/storage/hooks/useImageThumbnailBlobs.d.ts +4 -0
  110. package/dist/storage/hooks/useShareableStorageLink.d.ts +7 -0
  111. package/dist/storage/index.d.ts +12 -0
  112. package/dist/storage/openUrlInNewTab.d.ts +6 -0
  113. package/dist/storage/platformStorage.d.ts +43 -0
  114. package/dist/storage.d.ts +1 -0
  115. package/dist/storage.js +605 -0
  116. package/dist/storage.js.map +1 -0
  117. package/dist/style.css +1 -0
  118. package/dist/styles/base.css +616 -0
  119. package/dist/styles/reduced-motion.css +14 -0
  120. package/dist/styles/tailwind-preset.js +269 -0
  121. package/dist/task-workspace/domain.d.ts +35 -0
  122. package/dist/task-workspace/domain.js +45 -0
  123. package/dist/task-workspace/domain.js.map +1 -0
  124. package/dist/task-workspace/experience.d.ts +50 -0
  125. package/dist/task-workspace/index.d.ts +172 -0
  126. package/dist/task-workspace.d.ts +1 -0
  127. package/dist/task-workspace.js +626 -0
  128. package/dist/task-workspace.js.map +1 -0
  129. package/dist/ui/components/features/app/AppCheckboxInput.d.ts +9 -0
  130. package/dist/ui/components/features/app/AppConfirmDialog.d.ts +12 -0
  131. package/dist/ui/components/features/app/AppDashboardSkeleton.d.ts +9 -0
  132. package/dist/ui/components/features/app/AppDatePicker.d.ts +69 -0
  133. package/dist/ui/components/features/app/AppModal.d.ts +27 -0
  134. package/dist/ui/components/features/app/AppPageStates.d.ts +17 -0
  135. package/dist/ui/components/features/app/AppSelectInput.d.ts +10 -0
  136. package/dist/ui/components/features/app/AppTemporalInput.d.ts +19 -0
  137. package/dist/ui/components/features/app/Page.d.ts +14 -0
  138. package/dist/ui/components/features/app/QueryErrorAlert.d.ts +7 -0
  139. package/dist/ui/components/features/app/Sidebar.d.ts +47 -0
  140. package/dist/ui/components/features/app/index.d.ts +17 -0
  141. package/dist/ui/components/features/user/UserAvatar.d.ts +17 -0
  142. package/dist/ui/components/features/user/UserDisplay.d.ts +10 -0
  143. package/dist/ui/components/features/user/UserSelect.d.ts +14 -0
  144. package/dist/ui/components/features/user/useUserDirectory.d.ts +13 -0
  145. package/dist/ui/components/features/user/userDirectoryTypes.d.ts +18 -0
  146. package/dist/ui/components/patterns/form-section.d.ts +11 -0
  147. package/dist/ui/components/primitives/feedback/index.d.ts +2 -0
  148. package/dist/ui/components/primitives/feedback/toaster.d.ts +1 -0
  149. package/dist/ui/components/primitives/feedback/use-toast.d.ts +46 -0
  150. package/dist/ui/components/primitives/page-skeleton/ChartAreaSkeleton.d.ts +13 -0
  151. package/dist/ui/components/primitives/page-skeleton/ChartEmptyState.d.ts +14 -0
  152. package/dist/ui/components/primitives/page-skeleton/ComponentSkeletonShell.d.ts +16 -0
  153. package/dist/ui/components/primitives/page-skeleton/ConfigEditorSkeleton.d.ts +5 -0
  154. package/dist/ui/components/primitives/page-skeleton/DetailTabsSkeleton.d.ts +6 -0
  155. package/dist/ui/components/primitives/page-skeleton/EmptyStateBadge.d.ts +13 -0
  156. package/dist/ui/components/primitives/page-skeleton/FormCardSkeleton.d.ts +7 -0
  157. package/dist/ui/components/primitives/page-skeleton/FormFieldSkeleton.d.ts +6 -0
  158. package/dist/ui/components/primitives/page-skeleton/FormPageSkeleton.d.ts +6 -0
  159. package/dist/ui/components/primitives/page-skeleton/GridCardsSkeleton.d.ts +6 -0
  160. package/dist/ui/components/primitives/page-skeleton/ListSkeleton.d.ts +26 -0
  161. package/dist/ui/components/primitives/page-skeleton/PageHeaderSkeleton.d.ts +6 -0
  162. package/dist/ui/components/primitives/page-skeleton/SplitPaneSkeleton.d.ts +4 -0
  163. package/dist/ui/components/primitives/page-skeleton/StatsRowSkeleton.d.ts +5 -0
  164. package/dist/ui/components/primitives/page-skeleton/TableEmptyState.d.ts +27 -0
  165. package/dist/ui/components/primitives/page-skeleton/TablePageSkeleton.d.ts +8 -0
  166. package/dist/ui/components/primitives/page-skeleton/TabsBarSkeleton.d.ts +6 -0
  167. package/dist/ui/components/primitives/page-skeleton/index.d.ts +24 -0
  168. package/dist/ui/components/primitives/page-skeleton/skeletonMetrics.d.ts +9 -0
  169. package/dist/ui/components/primitives/page-skeleton/useVisibleCenter.d.ts +34 -0
  170. package/dist/ui/components/ui/accordion.d.ts +7 -0
  171. package/dist/ui/components/ui/ai-draft-banner.d.ts +21 -0
  172. package/dist/ui/components/ui/alert-dialog.d.ts +48 -0
  173. package/dist/ui/components/ui/alert.d.ts +8 -0
  174. package/dist/ui/components/ui/avatar.d.ts +6 -0
  175. package/dist/ui/components/ui/badge.d.ts +9 -0
  176. package/dist/ui/components/ui/breadcrumb.d.ts +19 -0
  177. package/dist/ui/components/ui/button.d.ts +11 -0
  178. package/dist/ui/components/ui/calendar.d.ts +8 -0
  179. package/dist/ui/components/ui/card.d.ts +8 -0
  180. package/dist/ui/components/ui/chart.d.ts +16 -0
  181. package/dist/ui/components/ui/checkbox.d.ts +4 -0
  182. package/dist/ui/components/ui/collapsible.d.ts +5 -0
  183. package/dist/ui/components/ui/column-config.d.ts +42 -0
  184. package/dist/ui/components/ui/date-picker.d.ts +9 -0
  185. package/dist/ui/components/ui/date-range-filter.d.ts +32 -0
  186. package/dist/ui/components/ui/date-range-picker.d.ts +11 -0
  187. package/dist/ui/components/ui/dialog-input.d.ts +17 -0
  188. package/dist/ui/components/ui/dialog-safe-select.d.ts +13 -0
  189. package/dist/ui/components/ui/dialog.d.ts +25 -0
  190. package/dist/ui/components/ui/dropdown-menu.d.ts +27 -0
  191. package/dist/ui/components/ui/feature-guide.d.ts +43 -0
  192. package/dist/ui/components/ui/form.d.ts +25 -0
  193. package/dist/ui/components/ui/help-tip.d.ts +29 -0
  194. package/dist/ui/components/ui/hint-notice.d.ts +22 -0
  195. package/dist/ui/components/ui/index.d.ts +6 -0
  196. package/dist/ui/components/ui/input.d.ts +3 -0
  197. package/dist/ui/components/ui/label.d.ts +5 -0
  198. package/dist/ui/components/ui/modal-container.d.ts +56 -0
  199. package/dist/ui/components/ui/modal-templates.d.ts +46 -0
  200. package/dist/ui/components/ui/multi-select.d.ts +20 -0
  201. package/dist/ui/components/ui/pagination.d.ts +28 -0
  202. package/dist/ui/components/ui/popover.d.ts +7 -0
  203. package/dist/ui/components/ui/progress.d.ts +7 -0
  204. package/dist/ui/components/ui/radio-button-group.d.ts +18 -0
  205. package/dist/ui/components/ui/radio-group.d.ts +5 -0
  206. package/dist/ui/components/ui/scroll-area.d.ts +5 -0
  207. package/dist/ui/components/ui/select.d.ts +16 -0
  208. package/dist/ui/components/ui/separator.d.ts +7 -0
  209. package/dist/ui/components/ui/sheet.d.ts +25 -0
  210. package/dist/ui/components/ui/sidebar-rail.d.ts +9 -0
  211. package/dist/ui/components/ui/skeleton.d.ts +2 -0
  212. package/dist/ui/components/ui/slider.d.ts +13 -0
  213. package/dist/ui/components/ui/switch.d.ts +4 -0
  214. package/dist/ui/components/ui/table.d.ts +10 -0
  215. package/dist/ui/components/ui/tabs.d.ts +10 -0
  216. package/dist/ui/components/ui/textarea.d.ts +3 -0
  217. package/dist/ui/components/ui/toast.d.ts +21 -0
  218. package/dist/ui/components/ui/toggle-group.d.ts +12 -0
  219. package/dist/ui/components/ui/toggle.d.ts +12 -0
  220. package/dist/ui/components/ui/tooltip.d.ts +7 -0
  221. package/dist/ui/components/ui/typography.d.ts +15 -0
  222. package/dist/ui/components/ui/underline-tabs.d.ts +13 -0
  223. package/dist/ui/components/ui/view-mode-toggle.d.ts +9 -0
  224. package/dist/ui/hooks/useIsMobile.d.ts +16 -0
  225. package/dist/ui/styles/design-tokens.d.ts +189 -0
  226. package/dist/ui/styles/z-index-layers.d.ts +46 -0
  227. package/dist/ui.d.ts +2 -0
  228. package/dist/ui.js +35 -0
  229. package/dist/ui.js.map +1 -0
  230. package/dist/useUserDirectory-CqkyCQoR.js +2377 -0
  231. package/dist/useUserDirectory-CqkyCQoR.js.map +1 -0
  232. package/dist/utils/cookieSettings.d.ts +12 -0
  233. package/dist/utils/data/countryCodes.d.ts +26 -0
  234. package/dist/utils/index.d.ts +18 -0
  235. package/dist/utils/utils/appPath.d.ts +5 -0
  236. package/dist/utils/utils/chunkLoadRecovery.d.ts +7 -0
  237. package/dist/utils/utils/cn.d.ts +3 -0
  238. package/dist/utils/utils/crossApp.d.ts +71 -0
  239. package/dist/utils/utils/debounce.d.ts +1 -0
  240. package/dist/utils/utils/formatUserLabel.d.ts +8 -0
  241. package/dist/utils/utils/formatting.d.ts +18 -0
  242. package/dist/utils/utils/logoutNotification.d.ts +28 -0
  243. package/dist/utils/utils/operatorLocale.d.ts +32 -0
  244. package/dist/utils/utils/routeLocalePrefetch.d.ts +5 -0
  245. package/dist/utils/utils/shellIframeUrl.d.ts +20 -0
  246. package/dist/utils/utils/spaceSettings.d.ts +20 -0
  247. package/dist/utils/utils/sso.d.ts +42 -0
  248. package/dist/utils/utils/throttle.d.ts +1 -0
  249. package/dist/utils/utils/timezones.d.ts +14 -0
  250. package/dist/utils/utils/toDateInputValue.d.ts +5 -0
  251. package/dist/utils/utils/watermark.d.ts +1 -0
  252. package/dist/utils.d.ts +1 -0
  253. package/dist/utils.js +1334 -0
  254. package/dist/utils.js.map +1 -0
  255. package/dist/vite.d.ts +22 -0
  256. package/dist/vite.js +74 -0
  257. package/dist/vite.js.map +1 -0
  258. package/package.json +191 -0
@@ -0,0 +1,89 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export type SortDir = 'asc' | 'desc';
4
+ /**
5
+ * One column of a {@link ServerDataTable}. User-facing text is passed in by the
6
+ * caller (i18n-agnostic). A column is sortable when `sortKey` is set; the table
7
+ * then emits the server sort token `${sortKey}_${dir}` (e.g. `last_purchase_desc`),
8
+ * which the datasource maps to a whitelisted `ORDER BY` via CASE.
9
+ */
10
+ export interface ServerColumn<Row> {
11
+ /** Stable column id (used for React keys). */
12
+ key: string;
13
+ /** Header content (already localized by the caller). */
14
+ header: ReactNode;
15
+ /** Server sort token base; presence makes the column sortable. */
16
+ sortKey?: string;
17
+ /** Cell renderer; defaults to the row's value at `key` stringified. */
18
+ cell?: (row: Row) => ReactNode;
19
+ className?: string;
20
+ headClassName?: string;
21
+ }
22
+ export interface ServerDataTableLabels {
23
+ empty: string;
24
+ error: string;
25
+ retry: string;
26
+ previous: string;
27
+ next: string;
28
+ /** Localized "Page N" label; receives the 1-based page number. */
29
+ page: (page: number) => string;
30
+ /** Accessible label for ascending sort toggle. */
31
+ sortAscLabel?: string;
32
+ /** Accessible label for descending sort toggle. */
33
+ sortDescLabel?: string;
34
+ /** Accessible label for the header "select all on this page" checkbox. */
35
+ selectAllLabel?: string;
36
+ /** Accessible label for a per-row select checkbox. */
37
+ selectRowLabel?: string;
38
+ }
39
+ export interface ServerDataTableProps<Row> {
40
+ columns: ServerColumn<Row>[];
41
+ /**
42
+ * Fetch one page. Return up to `limit` rows; the table internally requests
43
+ * `pageSize + 1` to detect "has more" without a COUNT query.
44
+ */
45
+ fetchRows: (args: {
46
+ limit: number;
47
+ offset: number;
48
+ sort?: string;
49
+ }) => Promise<Row[]>;
50
+ rowKey: (row: Row) => string;
51
+ labels: ServerDataTableLabels;
52
+ pageSize?: number;
53
+ /**
54
+ * When this value changes (e.g. the caller's search/filter state), pagination
55
+ * resets to the first page. `fetchRows` should be memoized over the same deps.
56
+ */
57
+ resetKey?: unknown;
58
+ initialSort?: {
59
+ sortKey: string;
60
+ dir: SortDir;
61
+ };
62
+ onRowClick?: (row: Row) => void;
63
+ emptyContent?: ReactNode;
64
+ className?: string;
65
+ /**
66
+ * Enable a leading checkbox column for row selection. Off by default so every
67
+ * existing usage is unchanged. When on, `selectedIds`/`onSelectionChange` make
68
+ * the selection controlled by the caller (keyed by `rowKey`).
69
+ */
70
+ selectable?: boolean;
71
+ /** Controlled set of selected row keys (only used when `selectable`). */
72
+ selectedIds?: Set<string>;
73
+ /** Called with the next selection whenever the user toggles a checkbox. */
74
+ onSelectionChange?: (next: Set<string>) => void;
75
+ /**
76
+ * Mobile (H5) row renderer. When provided, the table falls back to a stacked
77
+ * card list below the `sm` breakpoint instead of a horizontally-scrolling
78
+ * `<table>` — the H5 pattern for entity lists (see 12-h5-mobile-design.md §2.3).
79
+ * Receives the row; return the card body (the frame, tap target, selection
80
+ * checkbox and pagination are supplied by the table). Desktop is unaffected.
81
+ */
82
+ mobileCard?: (row: Row) => ReactNode;
83
+ }
84
+ /**
85
+ * Server-paginated, server-sorted data table for managed datasources. Renders one
86
+ * bounded page at a time (default 50 rows) — no client-side load-all, no COUNT.
87
+ * Generic over the row shape; all labels are injected for i18n.
88
+ */
89
+ export declare function ServerDataTable<Row>({ columns, fetchRows, rowKey, labels, pageSize, resetKey, initialSort, onRowClick, emptyContent, className, selectable, selectedIds, onSelectionChange, mobileCard, }: ServerDataTableProps<Row>): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+
3
+ export interface TimelineProps {
4
+ children: ReactNode;
5
+ className?: string;
6
+ }
7
+ /** Vertical activity timeline rail. Wrap a list of <TimelineItem>. */
8
+ export declare function Timeline({ children, className }: TimelineProps): import("react").JSX.Element;
9
+ export interface TimelineItemProps {
10
+ /** Lucide icon for the node chip. */
11
+ icon?: ComponentType<{
12
+ className?: string;
13
+ }>;
14
+ /** Tailwind text-color class for the icon (e.g. "text-emerald-600"). */
15
+ dotClassName?: string;
16
+ /** Tailwind background tint for the node chip (e.g. "bg-emerald-500/10"). Defaults to muted. */
17
+ nodeClassName?: string;
18
+ /** Tailwind left-border accent class for the event card (e.g. "border-l-emerald-500"). */
19
+ accentClassName?: string;
20
+ title: ReactNode;
21
+ /** Right-aligned timestamp / relative time. */
22
+ time?: ReactNode;
23
+ /** Secondary meta line (channel, store, SA…). */
24
+ meta?: ReactNode;
25
+ /** Rich body (badges, amount, content). */
26
+ children?: ReactNode;
27
+ /** Hide the connector below the node (last item). */
28
+ isLast?: boolean;
29
+ }
30
+ /**
31
+ * One node on the vertical timeline: a filled, ringed icon chip on the rail (left)
32
+ * and a styled event card (right) with an accent edge. Newest-first ordering is
33
+ * the caller's job; pass node/accent classes per event type for distinct styling.
34
+ */
35
+ export declare function TimelineItem({ icon: Icon, dotClassName, nodeClassName, accentClassName, title, time, meta, children, isLast, }: TimelineItemProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ export interface UseInfiniteRowsResult<Row> {
2
+ rows: Row[];
3
+ loading: boolean;
4
+ hasMore: boolean;
5
+ error: string | null;
6
+ /** Manually request the next page. */
7
+ loadMore: () => void;
8
+ /** Clear + reload from offset 0. */
9
+ reset: () => void;
10
+ /** Attach to a sentinel element at the list tail; auto-loads on intersect. */
11
+ sentinelRef: (el: HTMLElement | null) => void;
12
+ }
13
+ /**
14
+ * Accumulating infinite-scroll over a paginated fetcher. `fetchPage` returns up
15
+ * to `limit` rows; when fewer than `limit` come back, there is no more data.
16
+ * Pass a `resetKey` that changes when the query identity changes (e.g. a new
17
+ * entity id or filter) to clear and reload from the top.
18
+ */
19
+ export declare function useInfiniteRows<Row>(fetchPage: (args: {
20
+ limit: number;
21
+ offset: number;
22
+ }) => Promise<Row[]>, opts?: {
23
+ pageSize?: number;
24
+ resetKey?: unknown;
25
+ }): UseInfiniteRowsResult<Row>;
@@ -0,0 +1,14 @@
1
+ export type UserFacingErrorKind = 'permission' | 'validation' | 'unavailable' | 'unknown';
2
+ export type UserFacingErrorMessages = Record<UserFacingErrorKind, string>;
3
+ export declare class UserFacingError extends Error {
4
+ readonly kind: UserFacingErrorKind;
5
+ constructor(kind: UserFacingErrorKind, message: string, cause?: unknown);
6
+ }
7
+ /** Read the original failure for branching or telemetry; never render this value. */
8
+ export declare function diagnosticErrorText(error: unknown): string;
9
+ export declare function classifyUserFacingError(error: unknown): UserFacingErrorKind;
10
+ /**
11
+ * Converts an implementation-level failure into copy that is safe to render.
12
+ * The original failure is retained as `cause` and written to diagnostics only.
13
+ */
14
+ export declare function toUserFacingError(error: unknown, messages: UserFacingErrorMessages, context?: string): UserFacingError;
@@ -0,0 +1,48 @@
1
+ const o = /\b(?:401|403|forbidden|unauthori[sz]ed|permission|access denied|not[_ -]?visible|missing (?:api )?auth(?:entication)?|session token)\b/i, u = /\b(?:400|409|422|validation|invalid|required|conflict|duplicate|already exists|business rule|not applicable)\b/i, c = /\b(?:408|429|5\d\d|timeout|timed out|network|failed to fetch|service unavailable|bad gateway|gateway timeout|api returned html|invalid json|unexpected token|vite_|api_base|shell_init|datasource not found|managed datasource|agent not found|collector failed)\b/i;
2
+ class s extends Error {
3
+ kind;
4
+ constructor(n, e, i) {
5
+ super(e, i === void 0 ? void 0 : { cause: i }), this.name = "UserFacingError", this.kind = n;
6
+ }
7
+ }
8
+ function a(t) {
9
+ if (t instanceof Error) {
10
+ const n = t;
11
+ return [n.status, n.statusCode, n.code, n.message].filter(Boolean).join(" ");
12
+ }
13
+ if (t && typeof t == "object") {
14
+ const n = t;
15
+ return [n.status, n.statusCode, n.code, n.message].filter(Boolean).join(" ");
16
+ }
17
+ return String(t ?? "");
18
+ }
19
+ function r(t) {
20
+ if (!t || typeof t != "object") return null;
21
+ const n = t, e = n.status ?? n.statusCode, i = typeof e == "number" ? e : Number(e);
22
+ return Number.isInteger(i) ? i : null;
23
+ }
24
+ function l(t) {
25
+ return t instanceof s && t.cause !== void 0 ? a(t.cause) : a(t);
26
+ }
27
+ function d(t) {
28
+ if (t instanceof s) return t.kind;
29
+ const n = r(t);
30
+ if (n === 401 || n === 403) return "permission";
31
+ if (n === 400 || n === 404 || n === 409 || n === 422) return "validation";
32
+ if (n === 408 || n === 429 || n !== null && n >= 500) return "unavailable";
33
+ const e = a(t);
34
+ return o.test(e) ? "permission" : c.test(e) ? "unavailable" : u.test(e) ? "validation" : "unknown";
35
+ }
36
+ function f(t, n, e = "operation") {
37
+ if (t instanceof s) return t;
38
+ console.error(`[GeniApp] ${e} failed`, t);
39
+ const i = d(t);
40
+ return new s(i, n[i], t);
41
+ }
42
+ export {
43
+ s as UserFacingError,
44
+ d as classifyUserFacingError,
45
+ l as diagnosticErrorText,
46
+ f as toUserFacingError
47
+ };
48
+ //# sourceMappingURL=userFacingError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userFacingError.js","sources":["../../../src/ai/errors/userFacingError.ts"],"sourcesContent":["export type UserFacingErrorKind = 'permission' | 'validation' | 'unavailable' | 'unknown';\n\nexport type UserFacingErrorMessages = Record<UserFacingErrorKind, string>;\n\ntype ErrorLike = {\n message?: unknown;\n status?: unknown;\n statusCode?: unknown;\n code?: unknown;\n};\n\nconst PERMISSION_PATTERN = /\\b(?:401|403|forbidden|unauthori[sz]ed|permission|access denied|not[_ -]?visible|missing (?:api )?auth(?:entication)?|session token)\\b/i;\nconst VALIDATION_PATTERN = /\\b(?:400|409|422|validation|invalid|required|conflict|duplicate|already exists|business rule|not applicable)\\b/i;\nconst UNAVAILABLE_PATTERN = /\\b(?:408|429|5\\d\\d|timeout|timed out|network|failed to fetch|service unavailable|bad gateway|gateway timeout|api returned html|invalid json|unexpected token|vite_|api_base|shell_init|datasource not found|managed datasource|agent not found|collector failed)\\b/i;\n\nexport class UserFacingError extends Error {\n readonly kind: UserFacingErrorKind;\n\n constructor(kind: UserFacingErrorKind, message: string, cause?: unknown) {\n super(message, cause === undefined ? undefined : { cause });\n this.name = 'UserFacingError';\n this.kind = kind;\n }\n}\n\nfunction errorDetails(error: unknown): string {\n if (error instanceof Error) {\n const value = error as Error & ErrorLike;\n return [value.status, value.statusCode, value.code, value.message].filter(Boolean).join(' ');\n }\n if (error && typeof error === 'object') {\n const value = error as ErrorLike;\n return [value.status, value.statusCode, value.code, value.message].filter(Boolean).join(' ');\n }\n return String(error ?? '');\n}\n\nfunction errorStatus(error: unknown): number | null {\n if (!error || typeof error !== 'object') return null;\n const value = error as ErrorLike;\n const candidate = value.status ?? value.statusCode;\n const status = typeof candidate === 'number' ? candidate : Number(candidate);\n return Number.isInteger(status) ? status : null;\n}\n\n/** Read the original failure for branching or telemetry; never render this value. */\nexport function diagnosticErrorText(error: unknown): string {\n if (error instanceof UserFacingError && error.cause !== undefined) {\n return errorDetails(error.cause);\n }\n return errorDetails(error);\n}\n\nexport function classifyUserFacingError(error: unknown): UserFacingErrorKind {\n if (error instanceof UserFacingError) return error.kind;\n const status = errorStatus(error);\n if (status === 401 || status === 403) return 'permission';\n if (status === 400 || status === 404 || status === 409 || status === 422) return 'validation';\n if (status === 408 || status === 429 || (status !== null && status >= 500)) return 'unavailable';\n const details = errorDetails(error);\n if (PERMISSION_PATTERN.test(details)) return 'permission';\n if (UNAVAILABLE_PATTERN.test(details)) return 'unavailable';\n if (VALIDATION_PATTERN.test(details)) return 'validation';\n return 'unknown';\n}\n\n/**\n * Converts an implementation-level failure into copy that is safe to render.\n * The original failure is retained as `cause` and written to diagnostics only.\n */\nexport function toUserFacingError(\n error: unknown,\n messages: UserFacingErrorMessages,\n context = 'operation'\n): UserFacingError {\n if (error instanceof UserFacingError) return error;\n console.error(`[GeniApp] ${context} failed`, error);\n const kind = classifyUserFacingError(error);\n return new UserFacingError(kind, messages[kind], error);\n}\n"],"names":["PERMISSION_PATTERN","VALIDATION_PATTERN","UNAVAILABLE_PATTERN","UserFacingError","kind","message","cause","errorDetails","error","value","errorStatus","candidate","status","diagnosticErrorText","classifyUserFacingError","details","toUserFacingError","messages","context"],"mappings":"AAWA,MAAMA,IAAqB,2IACrBC,IAAqB,mHACrBC,IAAsB;AAErB,MAAMC,UAAwB,MAAM;AAAA,EAChC;AAAA,EAET,YAAYC,GAA2BC,GAAiBC,GAAiB;AACvE,UAAMD,GAASC,MAAU,SAAY,SAAY,EAAE,OAAAA,GAAO,GAC1D,KAAK,OAAO,mBACZ,KAAK,OAAOF;AAAA,EACd;AACF;AAEA,SAASG,EAAaC,GAAwB;AAC5C,MAAIA,aAAiB,OAAO;AAC1B,UAAMC,IAAQD;AACd,WAAO,CAACC,EAAM,QAAQA,EAAM,YAAYA,EAAM,MAAMA,EAAM,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAC7F;AACA,MAAID,KAAS,OAAOA,KAAU,UAAU;AACtC,UAAMC,IAAQD;AACd,WAAO,CAACC,EAAM,QAAQA,EAAM,YAAYA,EAAM,MAAMA,EAAM,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAC7F;AACA,SAAO,OAAOD,KAAS,EAAE;AAC3B;AAEA,SAASE,EAAYF,GAA+B;AAClD,MAAI,CAACA,KAAS,OAAOA,KAAU,SAAU,QAAO;AAChD,QAAMC,IAAQD,GACRG,IAAYF,EAAM,UAAUA,EAAM,YAClCG,IAAS,OAAOD,KAAc,WAAWA,IAAY,OAAOA,CAAS;AAC3E,SAAO,OAAO,UAAUC,CAAM,IAAIA,IAAS;AAC7C;AAGO,SAASC,EAAoBL,GAAwB;AAC1D,SAAIA,aAAiBL,KAAmBK,EAAM,UAAU,SAC/CD,EAAaC,EAAM,KAAK,IAE1BD,EAAaC,CAAK;AAC3B;AAEO,SAASM,EAAwBN,GAAqC;AAC3E,MAAIA,aAAiBL,EAAiB,QAAOK,EAAM;AACnD,QAAMI,IAASF,EAAYF,CAAK;AAChC,MAAII,MAAW,OAAOA,MAAW,IAAK,QAAO;AAC7C,MAAIA,MAAW,OAAOA,MAAW,OAAOA,MAAW,OAAOA,MAAW,IAAK,QAAO;AACjF,MAAIA,MAAW,OAAOA,MAAW,OAAQA,MAAW,QAAQA,KAAU,IAAM,QAAO;AACnF,QAAMG,IAAUR,EAAaC,CAAK;AAClC,SAAIR,EAAmB,KAAKe,CAAO,IAAU,eACzCb,EAAoB,KAAKa,CAAO,IAAU,gBAC1Cd,EAAmB,KAAKc,CAAO,IAAU,eACtC;AACT;AAMO,SAASC,EACdR,GACAS,GACAC,IAAU,aACO;AACjB,MAAIV,aAAiBL,EAAiB,QAAOK;AAC7C,UAAQ,MAAM,aAAaU,CAAO,WAAWV,CAAK;AAClD,QAAMJ,IAAOU,EAAwBN,CAAK;AAC1C,SAAO,IAAIL,EAAgBC,GAAMa,EAASb,CAAI,GAAGI,CAAK;AACxD;"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @genispace/geniapp/ai — shared AI adopt UI, workflow results, managed datasource, integrations.
3
+ * Import only from this barrel in application code.
4
+ */
5
+ export { createTableClient } from './managed-data/createTableClient';
6
+ export { queryManagedDatasourceRows, queryManagedDatasourceRowsAll, findManagedAppDataSourceId, createGeniSpaceClient, } from './managed-data/queryManagedDatasource';
7
+ export { executeManagedDatasourceOperation, executeManagedDatasourceTransaction, createTransactionDatasourceClient, type ManagedDatasourceOperationResult, type ExecuteManagedDatasourceParams, type TransactionDatasourceClient, } from './managed-data/executeManagedDatasource';
8
+ export { emitManagedEvent, createManagedEventClient, type EmittedEventEnvelope, type ManagedEventClient, } from './managed-data/emitManagedEvent';
9
+ export { DatasourceReadonlyTable } from './managed-data/DatasourceReadonlyTable';
10
+ export { ServerDataTable, type ServerDataTableProps, type ServerColumn, type ServerDataTableLabels, type SortDir, } from './components/ServerDataTable';
11
+ export { AsyncCombobox, type AsyncComboboxProps, type AsyncOption, type AsyncComboboxLabels, } from './components/AsyncCombobox';
12
+ export { useInfiniteRows, type UseInfiniteRowsResult } from './components/useInfiniteRows';
13
+ export { Timeline, TimelineItem, type TimelineProps, type TimelineItemProps } from './components/Timeline';
14
+ export { EntityRef, useEntityNames, type EntityRefProps, type UseEntityNamesResult, } from './components/EntityRef';
15
+ export { BulkActionBar, type BulkActionBarProps, type BulkAction, type BulkActionBarLabels, } from './components/BulkActionBar';
16
+ export { AgentJobProgressInline, useAgentJobRunner, type AgentJobProgressInlineProps, type AgentJobProgressLabels, type AgentRunState, type AgentJobLike, type AgentTaskContext, type AgentJobStartOptions, type UseAgentJobRunnerResult, } from './components/AgentJobProgress';
17
+ export { JobProgress, useAsyncJob, type JobProgressProps, type JobProgressLabels, type JobStatus, type JobProgressState, type JobResult, type JobRunner, type UseAsyncJobResult, } from './components/JobProgress';
18
+ export { UserFacingError, classifyUserFacingError, diagnosticErrorText, toUserFacingError, type UserFacingErrorKind, type UserFacingErrorMessages, } from './errors/userFacingError';
19
+ export { AppUiProviders } from './providers/AppUiProviders';
20
+ export { AI_SIDEBAR_MIN, AI_SIDEBAR_MAX, MODAL_SIZE_WITH_AI, AI_ADOPT_MODAL_GRID_STYLE, AI_ADOPT_GRID_CLASS, AI_ADOPT_PAGE_GRID_CLASS, } from './layout/layoutConstants';
21
+ export { ModalWithAiLayout } from './layout/ModalWithAiLayout';
22
+ export { modalSizeForAi } from './layout/modalSizeForAi';
23
+ export { DetailPageAiLayout } from './adopt/DetailPageAiLayout';
24
+ export { AiSuggestionPanel, productDescriptionAdoptFields } from './adopt/AiSuggestionPanel';
25
+ export type { AiSuggestionPanelProps } from './adopt/AiSuggestionPanel';
26
+ export { BusinessGuidancePanel } from './adopt/BusinessGuidancePanel';
27
+ export type { BusinessGuidancePanelProps } from './adopt/BusinessGuidancePanel';
28
+ export { guidanceContentFromSummary, guidanceStatus } from './adopt/guidanceContent';
29
+ export type { GuidanceContent, GuidanceLanguage } from './adopt/guidanceContent';
30
+ export { parseAiSummary, getByPath, formatDisplayValue, localizedText } from './adopt/parseAiSummary';
31
+ export { genericSummaryField, narrationAdoptField, recommendationAdoptField, descriptionAdoptField, synopsisAdoptField, noteAdoptField, internalNotesAdoptField, jobTitleAdoptField, appendTextAdoptField, } from './adopt/adoptPresets';
32
+ export { PARTNER_GENIAPP, PARTNER_RECORD_PICKER_DS, probePartnerRecordPicker, loadPartnerRecordOptions, type PartnerRecordOption, type PartnerRecordRole, type LoadPartnerRecordOptionsParams, } from './integrations/partner/partnerRecordPicker';
33
+ export { createPartnerRecordPickerHook, type PartnerRecordPickerHookOptions, } from './integrations/partner/createPartnerRecordPickerHook';
34
+ export type { AdoptFieldConfig, AppTableClient, WorkflowResultRow } from './types';
@@ -0,0 +1,15 @@
1
+ import { PartnerRecordRole } from './partnerRecordPicker';
2
+
3
+ export type PartnerRecordPickerHookOptions = {
4
+ role?: PartnerRecordRole;
5
+ partyType?: 'organization' | 'person';
6
+ legalEntityRef?: string;
7
+ };
8
+ export declare function createPartnerRecordPickerHook(buildApiRoot: () => string, hookOptions?: PartnerRecordPickerHookOptions): (enabled: boolean, ensureIds?: string[]) => {
9
+ pickerAvailable: boolean;
10
+ options: import('../../../hooks').ManagedPickerOption[];
11
+ loading: boolean;
12
+ loadError: string | null;
13
+ reload: () => Promise<void>;
14
+ providerGeniappId: string;
15
+ };
@@ -0,0 +1,20 @@
1
+ export declare const PARTNER_GENIAPP = "partner";
2
+ export declare const PARTNER_RECORD_PICKER_DS = "partner_record_picker";
3
+ export type PartnerRecordRole = 'customer' | 'supplier' | 'prospect' | 'service_provider' | 'manufacturer' | 'carrier' | 'franchisee' | 'equipment_owner';
4
+ export type PartnerRecordOption = {
5
+ id: string;
6
+ label: string;
7
+ secondary?: string;
8
+ /** Read-only business details published by Partner for directory and picker experiences. */
9
+ snapshot?: Record<string, unknown>;
10
+ };
11
+ export type LoadPartnerRecordOptionsParams = {
12
+ role?: PartnerRecordRole;
13
+ partyType?: 'organization' | 'person';
14
+ legalEntityRef?: string;
15
+ limit?: number;
16
+ offset?: number;
17
+ ensureIds?: string[];
18
+ };
19
+ export declare function probePartnerRecordPicker(apiRoot: string, token: string | null): Promise<boolean>;
20
+ export declare function loadPartnerRecordOptions(apiRoot: string, token: string | null, params?: LoadPartnerRecordOptionsParams): Promise<PartnerRecordOption[]>;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /**
4
+ * Two-column body for modals/dialogs with AiSuggestionPanel (DESIGN_GUIDELINE §16.1).
5
+ * Uses inline grid columns so layout works even when Tailwind does not scan shared/ai/**.
6
+ */
7
+ export declare function ModalWithAiLayout({ children, sidebar, className, }: {
8
+ children: ReactNode;
9
+ sidebar?: ReactNode | null;
10
+ className?: string;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { Button } from '../../kit';
3
+
4
+ /** Read-only AI/workflow text block (matches shared-ui AiMessage; kept here for CI kit compatibility). */
5
+ export declare function AiMessage({ children, className, }: {
6
+ children: ReactNode;
7
+ className?: string;
8
+ }): import("react").JSX.Element;
9
+ /** Field suggestion row for audit adopt (matches shared-ui AiSuggestion). */
10
+ export declare function AiSuggestion({ label, children, action, className, }: {
11
+ label: string;
12
+ children: ReactNode;
13
+ action?: ReactNode;
14
+ className?: string;
15
+ }): import("react").JSX.Element;
16
+ export declare function AiSuggestionAction({ children, ...props }: ComponentProps<typeof Button>): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ /** AI adopt sidebar column (DESIGN_GUIDELINE §16.1). */
4
+ export declare const AI_SIDEBAR_MIN = "280px";
5
+ export declare const AI_SIDEBAR_MAX = "320px";
6
+ /**
7
+ * Modal size when AiSuggestionPanel is shown beside the form.
8
+ * Uses `xl` for compatibility with published shared-ui; switch to `wide` once
9
+ * @genispace/geniapp exports AppModalSize `'wide'`.
10
+ */
11
+ export declare const MODAL_SIZE_WITH_AI: "xl";
12
+ export type ModalSizeWithAi = typeof MODAL_SIZE_WITH_AI;
13
+ /** Modal / dialog: form + AI sidebar columns (inline — not dependent on Tailwind scan). */
14
+ export declare const AI_ADOPT_MODAL_GRID_STYLE: CSSProperties;
15
+ /** Tailwind class for apps that include shared/ai/** in content paths (optional). */
16
+ export declare const AI_ADOPT_GRID_CLASS = "grid grid-cols-[minmax(0,1fr)_minmax(280px,320px)] gap-4";
17
+ /** Full-page adopt layout: same columns from lg breakpoint upward. */
18
+ export declare const AI_ADOPT_PAGE_GRID_CLASS = "space-y-6 lg:grid lg:grid-cols-[1fr_minmax(280px,320px)] lg:gap-6 lg:space-y-0";
19
+ export declare const AI_ADOPT_MODAL_MAX_HEIGHT = "max-h-[70vh]";
@@ -0,0 +1,5 @@
1
+ import { AppModalSize } from '../../kit';
2
+ import { MODAL_SIZE_WITH_AI } from './layoutConstants';
3
+
4
+ /** Use wide modal when an AI adopt sidebar is shown; otherwise keep the app default. */
5
+ export declare function modalSizeForAi<S extends AppModalSize>(hasAiSidebar: boolean, defaultSize: S): S | typeof MODAL_SIZE_WITH_AI;
@@ -0,0 +1,6 @@
1
+ import { default as en } from './en.json';
2
+
3
+ export type SharedAiLanguage = 'en' | 'zh';
4
+ export type SharedAiCopy = typeof en;
5
+ /** English is the deterministic fallback; Chinese is used only after an explicit locale switch. */
6
+ export declare function sharedAiCopy(language: SharedAiLanguage): SharedAiCopy;
@@ -0,0 +1,11 @@
1
+ export declare function DatasourceReadonlyTable({ title, hint, rows, columns, emptyLabel, }: {
2
+ title: string;
3
+ hint?: string;
4
+ rows: Record<string, unknown>[];
5
+ columns: Array<{
6
+ key: string;
7
+ label: string;
8
+ format?: (v: unknown) => string;
9
+ }>;
10
+ emptyLabel?: string;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { AppTableClient } from '../types';
2
+
3
+ /** Adapter for apps using apiList / apiUpdate style helpers. */
4
+ export declare function createTableClient(handlers: {
5
+ list: <T>(table: string, params?: Record<string, string | number | boolean | null>) => Promise<T[]>;
6
+ update: (table: string, id: string, payload: Record<string, unknown>) => Promise<unknown>;
7
+ }): AppTableClient;
@@ -0,0 +1,18 @@
1
+ export type EmittedEventEnvelope = {
2
+ id: string;
3
+ status: string;
4
+ eventName: string;
5
+ [k: string]: unknown;
6
+ };
7
+ /**
8
+ * Emit a Space-level event from a GeniApp. The app's installed events.json must
9
+ * declare the event; the payload is validated server-side against its schema.
10
+ */
11
+ export declare function emitManagedEvent(apiRoot: string, accessToken: string | null, geniappIdentifier: string, eventName: string, payload: Record<string, unknown>, opts?: {
12
+ idempotencyKey?: string;
13
+ }): Promise<EmittedEventEnvelope>;
14
+ export type ManagedEventClient = (eventName: string, payload: Record<string, unknown>, opts?: {
15
+ idempotencyKey?: string;
16
+ }) => Promise<EmittedEventEnvelope>;
17
+ /** Factory for per-app event emitters. */
18
+ export declare function createManagedEventClient(geniappIdentifier: string, resolveApiRoot: () => string, resolveAccessToken?: () => string | null): ManagedEventClient;
@@ -0,0 +1,21 @@
1
+ /** Result from POST /datasources/:id/data for TRANSACTION / CREATE / UPDATE operations. */
2
+ export type ManagedDatasourceOperationResult = {
3
+ operationType?: string;
4
+ affectedRows?: number;
5
+ insertId?: number | string;
6
+ executionTime?: number;
7
+ statementCount?: number;
8
+ [key: string]: unknown;
9
+ };
10
+ export type ExecuteManagedDatasourceParams = Record<string, string | number | boolean | null | undefined>;
11
+ /**
12
+ * Execute a managed GeniApp datasource write operation (TRANSACTION, CREATE, UPDATE, etc.)
13
+ * via POST /datasources/:id/data. For TRANSACTION datasources with JSON payloads, pass
14
+ * `payload` as a JSON string (SQL uses `{{payload}}::jsonb`).
15
+ */
16
+ export declare function executeManagedDatasourceOperation(apiRoot: string, accessToken: string | null, geniappIdentifier: string, seedIdentifier: string, params: ExecuteManagedDatasourceParams): Promise<ManagedDatasourceOperationResult>;
17
+ /** Convenience wrapper for TRANSACTION datasources that accept a single JSON payload parameter. */
18
+ export declare function executeManagedDatasourceTransaction(apiRoot: string, accessToken: string | null, geniappIdentifier: string, seedIdentifier: string, payload: unknown, payloadParamName?: string): Promise<ManagedDatasourceOperationResult>;
19
+ export type TransactionDatasourceClient = (seedIdentifier: string, payload: unknown) => Promise<ManagedDatasourceOperationResult>;
20
+ /** Factory for per-app transaction executors. */
21
+ export declare function createTransactionDatasourceClient(geniappIdentifier: string, resolveApiRoot: () => string, resolveAccessToken?: () => string | null): TransactionDatasourceClient;
@@ -0,0 +1,28 @@
1
+ import { GeniSpace } from 'genispace';
2
+
3
+ export declare function findManagedAppDataSourceId(client: GeniSpace, seedIdentifier: string, geniappIdentifier: string): Promise<string | null>;
4
+ export declare function createGeniSpaceClient(apiRoot: string, accessToken: string | null): GeniSpace;
5
+ type DsQueryParams = Record<string, string | number | boolean | undefined>;
6
+ /**
7
+ * Run one READ query with pagination expressed in a way EVERY API version
8
+ * honors.
9
+ *
10
+ * Why this exists: `GET /datasources/:id/data` derives the `{{offset}}` SQL
11
+ * binding from `(page - 1) * limit` and OVERWRITES any `offset` sent as a plain
12
+ * query param (see api datasource.service `getDataSourceData`). So a bare
13
+ * `{ limit, offset }` GET silently pins `{{offset}}` to 0 — page turns fetch
14
+ * the same first page. Newer API branches may honor the `offset` param
15
+ * directly, so every request here keeps `page`, `limit` and `offset` mutually
16
+ * consistent (`offset === (page - 1) * limit`); both interpretations then
17
+ * yield the same window.
18
+ *
19
+ * - `offset` aligned to `limit` → one request with the matching `page`.
20
+ * - misaligned `offset` (e.g. ServerDataTable's `limit = pageSize + 1`,
21
+ * `offset = pageIndex * pageSize`) → stitch the two aligned windows that
22
+ * cover the requested range.
23
+ */
24
+ export declare function queryReadRowsPaged(gs: GeniSpace, datasourceId: string, params: DsQueryParams): Promise<Record<string, unknown>[]>;
25
+ export declare function queryManagedDatasourceRows(apiRoot: string, accessToken: string | null, geniappIdentifier: string, seedIdentifier: string, params?: DsQueryParams): Promise<Record<string, unknown>[]>;
26
+ /** Fetch all rows from a managed datasource, paginating at the API max limit (1000). */
27
+ export declare function queryManagedDatasourceRowsAll(apiRoot: string, accessToken: string | null, geniappIdentifier: string, seedIdentifier: string, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>[]>;
28
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /** Mount once at GeniApp root (enables kit toast, tooltips). */
4
+ export declare function AppUiProviders({ children }: {
5
+ children: ReactNode;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ export interface WorkflowResultRow {
2
+ id: string;
3
+ run_no?: string | null;
4
+ source_record_key?: string | null;
5
+ summary?: string | null;
6
+ status?: string | null;
7
+ owner?: string | null;
8
+ created_at?: string | null;
9
+ }
10
+ export interface AdoptFieldConfig {
11
+ /** i18n key or plain label */
12
+ label: string;
13
+ /** Dot path in parsed summary JSON */
14
+ summaryPath: string;
15
+ /** Target column on the business record */
16
+ targetField: string;
17
+ /** Optional transform before PATCH */
18
+ toValue?: (raw: unknown, parsed: Record<string, unknown> | null, language?: 'en' | 'zh') => unknown;
19
+ }
20
+ export interface AppTableClient {
21
+ list<T>(table: string, options?: {
22
+ filters?: Record<string, string | number | boolean | null>;
23
+ limit?: number;
24
+ offset?: number;
25
+ }): Promise<{
26
+ items: T[];
27
+ }>;
28
+ update(table: string, id: string, payload: Record<string, unknown>): Promise<unknown>;
29
+ }
@@ -0,0 +1 @@
1
+ export type { WorkflowResultRow, AdoptFieldConfig, AppTableClient } from './app-ai.types';
package/dist/ai.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ai/index';