@flexkit/studio 0.0.36 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +81 -0
  2. package/dist/astro.d.ts +3 -5
  3. package/dist/astro.js +3 -8
  4. package/dist/chat-page-NWMI4XOE.js +2 -0
  5. package/dist/chat-page-NWMI4XOE.js.map +1 -0
  6. package/dist/chunk-2DXR5NJV.js +2 -0
  7. package/dist/chunk-2DXR5NJV.js.map +1 -0
  8. package/dist/chunk-3CPWATOI.js +2 -0
  9. package/dist/chunk-3CPWATOI.js.map +1 -0
  10. package/dist/chunk-5DHOBLAE.js +2 -0
  11. package/dist/chunk-5DHOBLAE.js.map +1 -0
  12. package/dist/chunk-6LYEDKFY.js +7 -0
  13. package/dist/chunk-6LYEDKFY.js.map +1 -0
  14. package/dist/chunk-7PDYCDX6.js +2 -0
  15. package/dist/chunk-7PDYCDX6.js.map +1 -0
  16. package/dist/chunk-7SK5YPHT.js +2 -0
  17. package/dist/chunk-7SK5YPHT.js.map +1 -0
  18. package/dist/chunk-AKQ6ELDX.js +2 -0
  19. package/dist/chunk-AKQ6ELDX.js.map +1 -0
  20. package/dist/chunk-CSUHZFEP.js +2 -0
  21. package/dist/chunk-CSUHZFEP.js.map +1 -0
  22. package/dist/chunk-G4PYYHI3.js +2 -0
  23. package/dist/chunk-G4PYYHI3.js.map +1 -0
  24. package/dist/chunk-GZIMMYLK.js +2 -0
  25. package/dist/chunk-GZIMMYLK.js.map +1 -0
  26. package/dist/chunk-HROHAMPM.js +3 -0
  27. package/dist/chunk-HROHAMPM.js.map +1 -0
  28. package/dist/chunk-NNA4MLFC.js +3 -0
  29. package/dist/chunk-NNA4MLFC.js.map +1 -0
  30. package/dist/chunk-NSYO57O3.js +5 -0
  31. package/dist/chunk-NSYO57O3.js.map +1 -0
  32. package/dist/chunk-ODORXGGY.js +2 -0
  33. package/dist/chunk-ODORXGGY.js.map +1 -0
  34. package/dist/chunk-OUSEULBR.js +384 -0
  35. package/dist/chunk-OUSEULBR.js.map +1 -0
  36. package/dist/chunk-P6BZ4QP7.js +2 -0
  37. package/dist/chunk-P6BZ4QP7.js.map +1 -0
  38. package/dist/chunk-QQUNCDUB.js +2 -0
  39. package/dist/chunk-QQUNCDUB.js.map +1 -0
  40. package/dist/chunk-SZEGGBOC.js +2 -0
  41. package/dist/chunk-SZEGGBOC.js.map +1 -0
  42. package/dist/chunk-TXK4OFAG.js +248 -0
  43. package/dist/chunk-W2EBZZAY.js +3 -0
  44. package/dist/chunk-W2EBZZAY.js.map +1 -0
  45. package/dist/chunk-YINI2YKQ.js +4 -0
  46. package/dist/chunk-YINI2YKQ.js.map +1 -0
  47. package/dist/{core-handler-C3xC98bN.d.ts → core-handler-XAVVKLhV.d.ts} +0 -3
  48. package/dist/edit-entity-PVT34FD7.js +2 -0
  49. package/dist/edit-entity-PVT34FD7.js.map +1 -0
  50. package/dist/index.css +1402 -0
  51. package/dist/index.d.ts +433 -33
  52. package/dist/index.js +12 -395
  53. package/dist/index.js.map +1 -1
  54. package/dist/list-SQCN7HA3.js +2 -0
  55. package/dist/list-SQCN7HA3.js.map +1 -0
  56. package/dist/nextjs.d.ts +61 -56
  57. package/dist/nextjs.js +3 -8
  58. package/dist/pages-OIAPASPF.js +3 -0
  59. package/dist/pages-OIAPASPF.js.map +1 -0
  60. package/dist/plugin-pages-AHOA6YJE.js +2 -0
  61. package/dist/plugin-pages-AHOA6YJE.js.map +1 -0
  62. package/dist/project-selector-72VM6SUI.js +2 -0
  63. package/dist/project-selector-72VM6SUI.js.map +1 -0
  64. package/dist/root-4FGNRGCD.js +23 -0
  65. package/dist/root-4FGNRGCD.js.map +1 -0
  66. package/dist/root-5ZW536V7.js +2 -0
  67. package/dist/root-5ZW536V7.js.map +1 -0
  68. package/dist/root-IIILTOJI.js +31 -0
  69. package/dist/root-IIILTOJI.js.map +1 -0
  70. package/dist/root-QPQQ3DFJ.js +2 -0
  71. package/dist/root-QPQQ3DFJ.js.map +1 -0
  72. package/dist/search-2K2BU4UU.js +2 -0
  73. package/dist/{search-XKG5A7XM.js.map → search-2K2BU4UU.js.map} +1 -1
  74. package/dist/skills-pages-PSBRTFGK.js +2 -0
  75. package/dist/skills-pages-PSBRTFGK.js.map +1 -0
  76. package/dist/tanstack-start.d.ts +4 -6
  77. package/dist/tanstack-start.js +5 -12
  78. package/dist/ui.d.ts +5 -7
  79. package/dist/ui.js +1 -6
  80. package/dist/ui.js.map +1 -1
  81. package/dist/user-nav-QZFCICK3.js +2 -0
  82. package/dist/{user-nav-LSEOOH4E.js.map → user-nav-QZFCICK3.js.map} +1 -1
  83. package/package.json +30 -12
  84. package/dist/asset-3XMRPTA5.js +0 -2
  85. package/dist/asset-3XMRPTA5.js.map +0 -1
  86. package/dist/boolean-MTD44LXP.js +0 -2
  87. package/dist/boolean-MTD44LXP.js.map +0 -1
  88. package/dist/chunk-3VOTTOJT.js +0 -2
  89. package/dist/chunk-3VOTTOJT.js.map +0 -1
  90. package/dist/chunk-5I7Q5ODB.js +0 -2
  91. package/dist/chunk-5I7Q5ODB.js.map +0 -1
  92. package/dist/chunk-6NRQMG26.js +0 -2
  93. package/dist/chunk-6NRQMG26.js.map +0 -1
  94. package/dist/chunk-6V73336R.js +0 -623
  95. package/dist/chunk-7BOX7HHO.js +0 -2
  96. package/dist/chunk-7BOX7HHO.js.map +0 -1
  97. package/dist/chunk-7JFLGBWE.js +0 -2
  98. package/dist/chunk-7JFLGBWE.js.map +0 -1
  99. package/dist/chunk-7ZJN4MWQ.js +0 -2
  100. package/dist/chunk-7ZJN4MWQ.js.map +0 -1
  101. package/dist/chunk-AICNS7KW.js +0 -2
  102. package/dist/chunk-AICNS7KW.js.map +0 -1
  103. package/dist/chunk-D4XLXU2H.js +0 -2
  104. package/dist/chunk-D4XLXU2H.js.map +0 -1
  105. package/dist/chunk-FLT6RWXH.js +0 -2
  106. package/dist/chunk-FLT6RWXH.js.map +0 -1
  107. package/dist/chunk-GBM7VKFS.js +0 -2
  108. package/dist/chunk-GBM7VKFS.js.map +0 -1
  109. package/dist/chunk-HMMBYXYA.js +0 -2
  110. package/dist/chunk-HMMBYXYA.js.map +0 -1
  111. package/dist/chunk-IRY4KWB5.js +0 -2
  112. package/dist/chunk-IRY4KWB5.js.map +0 -1
  113. package/dist/chunk-JH4MVD36.js +0 -2
  114. package/dist/chunk-JH4MVD36.js.map +0 -1
  115. package/dist/chunk-JKHUO27E.js +0 -2
  116. package/dist/chunk-JKHUO27E.js.map +0 -1
  117. package/dist/chunk-LIV5RBWJ.js +0 -2
  118. package/dist/chunk-LIV5RBWJ.js.map +0 -1
  119. package/dist/chunk-PENRGDNC.js +0 -2
  120. package/dist/chunk-PENRGDNC.js.map +0 -1
  121. package/dist/chunk-POQX5GIA.js +0 -366
  122. package/dist/chunk-QOX3QNMM.js +0 -2
  123. package/dist/chunk-QOX3QNMM.js.map +0 -1
  124. package/dist/chunk-QVBNGGOE.js +0 -2
  125. package/dist/chunk-QVBNGGOE.js.map +0 -1
  126. package/dist/chunk-S6MOM5G3.js +0 -2
  127. package/dist/chunk-S6MOM5G3.js.map +0 -1
  128. package/dist/chunk-UGRS4FEI.js +0 -2
  129. package/dist/chunk-UGRS4FEI.js.map +0 -1
  130. package/dist/chunk-USNXQOMJ.js +0 -2
  131. package/dist/chunk-USNXQOMJ.js.map +0 -1
  132. package/dist/chunk-UWMJBBTY.js +0 -2
  133. package/dist/chunk-UWMJBBTY.js.map +0 -1
  134. package/dist/chunk-W3Z33ETA.js +0 -2
  135. package/dist/chunk-W3Z33ETA.js.map +0 -1
  136. package/dist/chunk-WDRCARCP.js +0 -3
  137. package/dist/chunk-WDRCARCP.js.map +0 -1
  138. package/dist/chunk-WIUPQHZ5.js +0 -2
  139. package/dist/chunk-WIUPQHZ5.js.map +0 -1
  140. package/dist/chunk-WJ4ORIXF.js +0 -2
  141. package/dist/chunk-WJ4ORIXF.js.map +0 -1
  142. package/dist/chunk-YSLN4XT6.js +0 -2
  143. package/dist/chunk-YSLN4XT6.js.map +0 -1
  144. package/dist/datetime-C55QQQJK.js +0 -2
  145. package/dist/datetime-C55QQQJK.js.map +0 -1
  146. package/dist/editor-NZLXIOE7.js +0 -2
  147. package/dist/editor-NZLXIOE7.js.map +0 -1
  148. package/dist/project-selector-GQ24PVO6.js +0 -2
  149. package/dist/project-selector-GQ24PVO6.js.map +0 -1
  150. package/dist/search-XKG5A7XM.js +0 -2
  151. package/dist/select-SO3DICYX.js +0 -2
  152. package/dist/select-SO3DICYX.js.map +0 -1
  153. package/dist/switch-SU3OIXL6.js +0 -2
  154. package/dist/switch-SU3OIXL6.js.map +0 -1
  155. package/dist/text-FZSI6W5I.js +0 -2
  156. package/dist/text-FZSI6W5I.js.map +0 -1
  157. package/dist/text-QXGOD2KW.js +0 -2
  158. package/dist/text-QXGOD2KW.js.map +0 -1
  159. package/dist/textarea-INLURFNU.js +0 -2
  160. package/dist/textarea-INLURFNU.js.map +0 -1
  161. package/dist/tools.d.ts +0 -78
  162. package/dist/tools.js +0 -60
  163. package/dist/types-U28Ppixq.d.ts +0 -56
  164. package/dist/types.d-CPIuPrvL.d.ts +0 -458
  165. package/dist/user-nav-LSEOOH4E.js +0 -2
package/dist/index.d.ts CHANGED
@@ -1,20 +1,209 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { Dispatch, JSX, SetStateAction, UIEvent, ReactElement } from 'react';
3
- import { A as AppContextType, a as ActionSetRelationship, b as ActionSetScope, C as Config, c as AppOptions, E as Entity, S as StudioContributions, d as StudioExtension, P as ProjectOptions, O as OrderedAssetValue, e as SearchRequestProps, f as SearchResultItem, g as Attribute, F as FieldGroup, h as AuthService, U as UseEntityQueryParams, M as MappedEntityItem, i as FormEntityItem, I as ImageValue, j as Schema, k as User, l as EntityQuerySelection, m as AttributeValue, n as MultipleRelationshipConnection, o as SingleRelationshipConnection } from './types.d-CPIuPrvL.js';
4
- export { p as ConditionalFieldContext, q as ConditionalFlag, D as DataType, r as DefaultValue, s as DefaultValueByDataType, t as EntityData, u as FormFieldParams, v as FormFieldProps, w as FormFieldValue, L as LogoProps, x as ScopeType, y as SingleProject } from './types.d-CPIuPrvL.js';
5
- export { Outlet, useLocation, useParams } from 'react-router-dom';
2
+ import React__default, { Dispatch, JSX, ReactNode, SetStateAction, UIEvent, ReactElement } from 'react';
6
3
  import { OperationVariables, DocumentNode, ErrorLike } from '@apollo/client';
7
4
  export { gql } from '@apollo/client';
5
+ import { UiSchema, ProjectSchemaResponse, UiEntity, UiAttribute, FieldGroup, AttributeOptions } from '@flexkit/schema';
6
+ export { UiAttribute as Attribute, Config, Attribute as ConfigAttribute, Entity as ConfigEntity, DataType, DefaultValue, DefaultValueByDataType, UiEntity as Entity, EntityMenu, FieldGroup, MenuGroup, ProjectConfig, ProjectSchemaResponse, UiSchema as Schema, ScopeType, UiAttribute, UiEntity, UiProjectSchema, ZodValidation, defineConfig, defineEntity } from '@flexkit/schema';
7
+ import { AgentChat, AgentChatMessage, AutomationApproval, AutomationMutationPolicy, AutomationToolAllowRule, AutomationRun } from '@flexkit/agent-protocol';
8
+ export { AgentChat, AgentChatAttachment, AgentChatMessage, AgentChatMessageRole, AgentChatMessageStatus, AgentChatPart, AgentChatTurn, AutomationApproval, AutomationApprovalStatus, AutomationMutationPolicy, AutomationRun, AutomationRunStatus } from '@flexkit/agent-protocol';
9
+ export { Outlet, useLocation, useParams } from 'react-router-dom';
10
+ import { Control, UseFormSetValue, FieldValues } from 'react-hook-form';
8
11
  import { Column, Row, ColumnDef, Table, RowSelectionState, OnChangeFn, SortingState } from '@tanstack/react-table';
9
12
  export { ColumnDef, ColumnFiltersState, Table as ReactTable, Row, RowSelectionState, SortingState, TableMeta, Updater, VisibilityState, flexRender, getCoreRowModel, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
10
13
  export { useVirtualizer } from '@tanstack/react-virtual';
11
14
  import * as react_jsx_runtime from 'react/jsx-runtime';
12
- import 'zod';
13
- import 'react-hook-form';
15
+
16
+ type AttributeValue = {
17
+ _id: string;
18
+ [key: string]: string | AttributeValue | AttributeValue[] | null;
19
+ __typename: string;
20
+ };
21
+ type EntityItem = {
22
+ [attribute: string]: AttributeValue;
23
+ };
24
+ type EntityData = {
25
+ [attributeName: string]: EntityItem;
26
+ };
27
+ type MappedEntityItem = {
28
+ _id: string;
29
+ [attributeName: string]: string | OrderedAssetValue[];
30
+ };
31
+ type ImageValue = {
32
+ _id: string;
33
+ path: string;
34
+ url?: string;
35
+ size: number;
36
+ mimeType: string;
37
+ originalFilename: string;
38
+ lqip: string;
39
+ width: number;
40
+ height: number;
41
+ };
42
+ type OrderedAssetValue = ImageValue & {
43
+ sortOrder?: number;
44
+ /** Aggregate count of all connected assets; edges are bounded by `first`. */
45
+ totalCount?: number;
46
+ };
47
+ type FormEntityItem = {
48
+ [attributeName: string]: FormFieldValue;
49
+ };
50
+ type EntityQuerySelection = 'list' | 'full' | 'display';
51
+ type UseEntityQueryParams = {
52
+ entityNamePlural: string;
53
+ schema: UiSchema;
54
+ scope: string;
55
+ variables?: OperationVariables;
56
+ isForm?: boolean;
57
+ /**
58
+ * `list` only selects each related entity's display attribute (desk/list grids).
59
+ * `full` keeps nested relationship fields (forms, relationship pickers). Default: `full`.
60
+ * `display` selects only the entity's display attribute (menus and selectors).
61
+ */
62
+ selection?: EntityQuerySelection;
63
+ /** Omit the collection count when only rows are needed; count returns 0. Default: true. */
64
+ includeCount?: boolean;
65
+ };
66
+ type FormFieldValue = {
67
+ _id?: string;
68
+ count?: number;
69
+ disabled: boolean;
70
+ /**
71
+ * Server-known asset sort orders for ordered asset relationships. Grows as
72
+ * the form field pages in more connection edges beyond the initial `first`.
73
+ * Update mutations use this so paged-in assets are treated as existing
74
+ * (reorder/disconnect) rather than new connects.
75
+ */
76
+ knownAssetSortOrders?: {
77
+ [id: string]: number;
78
+ };
79
+ relationships?: {
80
+ connect?: SingleRelationshipConnection | MultipleRelationshipConnection;
81
+ disconnect?: string[];
82
+ };
83
+ scope: string;
84
+ value: boolean | number | string | MappedEntityItem | MappedEntityItem[] | EntityItem | EntityItem[] | AttributeValue | AttributeValue[] | ImageValue | OrderedAssetValue[] | undefined | null;
85
+ };
86
+
87
+ type SingleRelationshipConnection = {
88
+ _id: string;
89
+ value: string | MappedEntityItem | MappedEntityItem[] | EntityItem | EntityItem[] | AttributeValue | AttributeValue[] | ImageValue | OrderedAssetValue[] | undefined | null;
90
+ };
91
+ type MultipleRelationshipConnection = {
92
+ _id: string;
93
+ sortOrder?: number;
94
+ value: string | MappedEntityItem | MappedEntityItem[] | EntityItem | EntityItem[] | AttributeValue | AttributeValue[] | ImageValue | OrderedAssetValue[] | undefined | null;
95
+ }[];
96
+ type Relationships = {
97
+ [relationshipId: string]: {
98
+ connect?: SingleRelationshipConnection | MultipleRelationshipConnection;
99
+ disconnect?: string[];
100
+ } | undefined;
101
+ };
102
+ type AppContextType = {
103
+ isRouteLoading: boolean;
104
+ pageTitle: string;
105
+ scope: string;
106
+ relationships: Relationships;
107
+ };
108
+ type ActionSetScope = {
109
+ type: 'setScope';
110
+ payload: {
111
+ projectId?: string;
112
+ scope: string;
113
+ };
114
+ };
115
+ type ActionSetRelationship = {
116
+ type: 'setRelationship';
117
+ payload: {
118
+ [relationshipId: string]: {
119
+ connect?: SingleRelationshipConnection | MultipleRelationshipConnection;
120
+ disconnect: string[];
121
+ };
122
+ };
123
+ };
124
+
125
+ interface SearchResultItem {
126
+ _id: string;
127
+ _entityName: string;
128
+ _entityNamePlural: string;
129
+ [key: string]: string;
130
+ }
131
+ interface SearchRequestProps {
132
+ searchRequests: {
133
+ searches: {
134
+ collection: string;
135
+ }[];
136
+ };
137
+ commonParams: {
138
+ q: string;
139
+ };
140
+ }
14
141
 
15
142
  declare function useAppContext(): AppContextType;
16
143
  declare function useAppDispatch(): Dispatch<ActionSetRelationship | ActionSetScope>;
17
144
 
145
+ /** A built-in Studio app (Desk, Asset Manager, Explorer, AI). */
146
+ interface AppOptions {
147
+ name: string;
148
+ title: string;
149
+ icon?: JSX.Element;
150
+ component: ReactNode;
151
+ routes?: AppRoute[];
152
+ }
153
+
154
+ interface AppRoute {
155
+ path: string;
156
+ component: ReactNode;
157
+ children?: AppRoute[];
158
+ }
159
+
160
+ /**
161
+ * A project as the Studio renders it: the deployed schema fetched from
162
+ * `GET /<projectId>/api/schema`, plus the reserved asset and tag entities the
163
+ * Studio appends itself.
164
+ */
165
+ type ProjectUiConfig = ProjectSchemaResponse;
166
+
167
+ /** Why a project's schema could not be loaded. */
168
+ type ProjectSchemaError = {
169
+ /** HTTP status, or 0 when the request itself failed. */
170
+ status: number;
171
+ message: string;
172
+ };
173
+
174
+ /** How the Studio learned which projects it can open. */
175
+ type StudioMode = 'hosted' | 'projects';
176
+
177
+ /** A project as listed for the signed-in user, before its schema is loaded (hosted mode). */
178
+ interface ProjectSummary {
179
+ avatarUrl: string | null;
180
+ id: string;
181
+ name: string;
182
+ readOnly: boolean;
183
+ /** Project role, or `owner` for team owners without a seat. Display only; permissions come from `/users/me`. */
184
+ role: string;
185
+ suspended: boolean;
186
+ team: { id: string; name: string };
187
+ }
188
+
189
+ interface HostedUser {
190
+ avatarUrl: string | null;
191
+ displayName: string | null;
192
+ email: string;
193
+ id: string;
194
+ }
195
+
196
+ interface FlexkitStudioProps {
197
+ /**
198
+ * Ids of the projects this Studio can open; the first one is the default.
199
+ * Omit it to run in hosted mode: the Studio signs the user in once and
200
+ * lists every project they can access.
201
+ */
202
+ projectIds?: string[];
203
+ /** Path the host mounts the Studio under, e.g. `/studio`. Defaults to `/`. */
204
+ basename?: string;
205
+ }
206
+
18
207
  /**
19
208
  * AppContext:
20
209
  * - global loader state
@@ -31,20 +220,37 @@ declare function useAppDispatch(): Dispatch<ActionSetRelationship | ActionSetSco
31
220
  *
32
221
  * Query params: sort, filter, page, pageSize
33
222
  * Path params: id specific entity
223
+ *
224
+ * The Studio renders the schema deployed to each project (`flexkit deploy`).
225
+ * The host either lists the projects (`projectIds`) or omits them, in which
226
+ * case the Studio signs the user in and lists every project they can access.
34
227
  */
35
- declare function FlexkitStudio({ config }: {
36
- config: Config;
37
- }): JSX.Element | null;
228
+ declare function FlexkitStudio({ projectIds, basename }: FlexkitStudioProps): JSX.Element | null;
38
229
 
39
230
  interface ConfigContext {
231
+ /** `projects` when the host passed `projectIds`, `hosted` when the Studio listed the user's projects itself. */
232
+ mode: StudioMode;
233
+ /** The Studio apps shown in the app bar, in order. */
234
+ apps: AppOptions[];
235
+ /** Kept for callers that read `contributions.apps`; same list as `apps`. */
40
236
  contributions: {
41
- apps: AppOptions[] | [];
237
+ apps: AppOptions[];
42
238
  };
43
239
  currentProjectId?: string;
44
- currentProjectSchema: Entity[];
45
- getContributionPointConfig: <T extends keyof StudioContributions>(contributionPoint: T, subPath?: string[]) => StudioContributions[T][] | [];
46
- extensions: StudioExtension[];
47
- projects: ProjectOptions[];
240
+ /** The project named by the `:projectId` route param, once its schema has loaded. */
241
+ currentProject?: ProjectUiConfig;
242
+ currentProjectSchema: UiEntity[];
243
+ /** Projects whose schema loaded, in `projectIds` order. */
244
+ projects: ProjectUiConfig[];
245
+ /** Every project id the Studio can open, loaded or not. */
246
+ projectIds: string[];
247
+ /** Hosted mode: name, avatar, role and team of each project, known before any schema loads. */
248
+ projectSummaries: ProjectSummary[];
249
+ /** Per project id: why its schema could not be loaded. */
250
+ schemaErrors: {
251
+ [projectId: string]: ProjectSchemaError;
252
+ };
253
+ isLoadingSchemas: boolean;
48
254
  }
49
255
  declare function useConfig(): ConfigContext;
50
256
 
@@ -89,13 +295,6 @@ declare function useSearch(projectId: string, searchRequest: SearchRequestProps
89
295
  isLoading: boolean;
90
296
  };
91
297
 
92
- declare function defineConfig<T extends Config>(config: T): T;
93
-
94
- /** Define a Studio extension while preserving its specific contribution types. */
95
- declare function defineExtension<T extends StudioExtension>(extension: T): T;
96
-
97
- declare function defineEntity<T extends Entity>(entity: T): Entity;
98
-
99
298
  /**
100
299
  * Space bindings use OR semantics: a resource bound to ['finance', 'mkt'] is
101
300
  * accessible to members of either space. Unbound resources are accessible to
@@ -108,8 +307,8 @@ declare function defineEntity<T extends Entity>(entity: T): Entity;
108
307
  * `spaces` is always an array — possibly empty for users with no memberships.
109
308
  */
110
309
  declare function canAccessSpaces(userSpaces: string[] | undefined, resourceSpaces: string[] | undefined): boolean;
111
- declare function filterAttributesForSpaces(attributes: Attribute[], userSpaces: string[] | undefined): Attribute[];
112
- declare function filterEntitiesForSpaces(schema: Entity[], userSpaces: string[] | undefined): Entity[];
310
+ declare function filterAttributesForSpaces(attributes: UiAttribute[], userSpaces: string[] | undefined): UiAttribute[];
311
+ declare function filterEntitiesForSpaces(schema: UiEntity[], userSpaces: string[] | undefined): UiEntity[];
113
312
 
114
313
  /**
115
314
  * Viewers are read-only: the GraphQL route and the automations API reject
@@ -124,6 +323,189 @@ declare function useCanMutate(): boolean;
124
323
  declare const ALL_FIELDS_GROUP_NAME = "all";
125
324
  declare const ALL_FIELDS_GROUP: FieldGroup;
126
325
 
326
+ type AutomationTriggerEvent = 'create' | 'update' | 'delete';
327
+ type AutomationToolProvider = 'slack' | 'teams';
328
+ type AutomationVisibility = 'project' | 'space' | 'personal';
329
+ interface AutomationScheduleTrigger {
330
+ cron: string;
331
+ id?: string;
332
+ timezone: string;
333
+ type: 'schedule';
334
+ }
335
+ interface AutomationWebhookTrigger {
336
+ id?: string;
337
+ secret: string | null;
338
+ token: string;
339
+ type: 'webhook';
340
+ url?: string;
341
+ }
342
+ interface AutomationEntityTrigger {
343
+ entities: string[];
344
+ events: AutomationTriggerEvent[];
345
+ id?: string;
346
+ type: 'entity';
347
+ }
348
+ type AutomationTrigger = AutomationScheduleTrigger | AutomationWebhookTrigger | AutomationEntityTrigger;
349
+ interface AutomationToolChannel {
350
+ id: string;
351
+ name: string;
352
+ serviceUrl?: string;
353
+ teamId?: string;
354
+ }
355
+ interface Skill {
356
+ content: string;
357
+ createdAt: string;
358
+ createdBy: string;
359
+ description: string;
360
+ id: string;
361
+ logoUrl: string | null;
362
+ name: string;
363
+ projectId: string;
364
+ source: 'code' | 'studio' | 'plugin';
365
+ spaceId: string | null;
366
+ updatedAt: string;
367
+ visibility: AutomationVisibility;
368
+ }
369
+ interface SkillsList {
370
+ count: number;
371
+ hasMore: boolean;
372
+ skills: Skill[];
373
+ }
374
+ interface SkillInput {
375
+ content: string;
376
+ description: string;
377
+ name: string;
378
+ /** Space id required when visibility is "space". */
379
+ spaceId?: string | null;
380
+ visibility: AutomationVisibility;
381
+ }
382
+ interface Automation {
383
+ toolConfigs?: AutomationToolConfigInput[];
384
+ createdAt: string | null;
385
+ createdBy?: string;
386
+ /** Customer tool names attached to this automation. */
387
+ customToolNames?: string[];
388
+ enabled: boolean;
389
+ id: string;
390
+ instructions: string;
391
+ lastRunAt: string | null;
392
+ modelId: string;
393
+ /** May be absent from older API responses. */
394
+ mutationPolicy?: AutomationMutationPolicy;
395
+ name: string;
396
+ projectId: string;
397
+ /** Plugin tools a reviewer chose to always allow in this automation. */
398
+ toolAllowRules?: AutomationToolAllowRule[];
399
+ /** Attached skill ids. Only populated by the detail endpoint. */
400
+ skillIds?: string[];
401
+ /** Space the automation belongs to when visibility is "space". */
402
+ spaceId?: string | null;
403
+ totalRuns: number;
404
+ triggers: AutomationTrigger[];
405
+ updatedAt: string | null;
406
+ /** May be absent from older API responses; treated as "project". */
407
+ visibility?: AutomationVisibility;
408
+ }
409
+ interface AutomationApprovals {
410
+ approvals: AutomationApproval[];
411
+ hasMore: boolean;
412
+ pendingCount: number;
413
+ }
414
+ interface RunHistoryRun extends AutomationRun {
415
+ automationName: string;
416
+ }
417
+ interface RunHistoryMetrics {
418
+ failed24h: number;
419
+ failed7d: number;
420
+ successful24h: number;
421
+ successful7d: number;
422
+ }
423
+ interface RunHistory {
424
+ hasMore: boolean;
425
+ metrics: RunHistoryMetrics;
426
+ runs: RunHistoryRun[];
427
+ }
428
+ interface AutomationCreditBalance {
429
+ availableMicros: number;
430
+ billingUrl: string;
431
+ display: string;
432
+ isLowBalance: boolean;
433
+ teamId: string;
434
+ }
435
+ interface AutomationArtifact {
436
+ artifactId: string;
437
+ contentType: string;
438
+ createdAt: string;
439
+ downloadUrl: string;
440
+ filename: string;
441
+ kind: 'html' | 'pdf';
442
+ previewUrl: string;
443
+ sizeBytes: number;
444
+ }
445
+ interface AutomationToolConfigInput {
446
+ pluginId: string;
447
+ enabled: boolean;
448
+ connectionMode: 'project' | 'personal';
449
+ connectionId: string | null;
450
+ /** Every tool of the plugin, including ones added later; `selectedTools` applies only when false. */
451
+ allTools?: boolean;
452
+ selectedTools: string[];
453
+ deliveryEnabled: boolean;
454
+ channels: AutomationToolChannel[];
455
+ }
456
+ interface AutomationInput {
457
+ /** Customer tool names this automation may call. */
458
+ customToolNames: string[];
459
+ enabled: boolean;
460
+ instructions: string;
461
+ modelId: string;
462
+ mutationPolicy?: AutomationMutationPolicy;
463
+ name: string;
464
+ /** Omitted keeps the stored rules; an array replaces them. */
465
+ toolAllowRules?: AutomationToolAllowRule[];
466
+ /** Skills that are always loaded into the agent context on every run. */
467
+ skillIds: string[];
468
+ /** Space id required when visibility is "space". */
469
+ spaceId?: string | null;
470
+ toolConfigs: AutomationToolConfigInput[];
471
+ triggers: AutomationTrigger[];
472
+ visibility?: AutomationVisibility;
473
+ }
474
+ interface AgentChatsList {
475
+ chats: AgentChat[];
476
+ hasMore: boolean;
477
+ }
478
+ interface AgentChatDetail {
479
+ chat: AgentChat;
480
+ messages: AgentChatMessage[];
481
+ pendingApproval: AutomationApproval | null;
482
+ }
483
+ interface AgentChatSearchResult {
484
+ chatId: string;
485
+ chatTitle: string | null;
486
+ createdAt: string;
487
+ messageId: string;
488
+ score: number;
489
+ snippet: string;
490
+ }
491
+
492
+ type User = {
493
+ id: string;
494
+ email: string;
495
+ display_name: string;
496
+ avatar_url: string;
497
+ role: string;
498
+ /** Space codes the user belongs to (owners receive every project space). */
499
+ spaces: string[];
500
+ };
501
+
502
+ type Auth = {
503
+ user: User | undefined;
504
+ logout: (projectId: string) => Promise<void>;
505
+ };
506
+
507
+ type AuthService = [boolean, Auth];
508
+
127
509
  declare function useAuth(): AuthService;
128
510
 
129
511
  type Props$1 = {
@@ -134,6 +516,24 @@ type Props$1 = {
134
516
  };
135
517
  declare function DefaultValueSwitch({ scope, checked, disabled, onChange }: Props$1): JSX.Element | null;
136
518
 
519
+ type FormFieldParams<T extends keyof AttributeOptions> = {
520
+ control: Control | undefined;
521
+ defaultScope: string;
522
+ defaultValue: FormFieldValue;
523
+ entityId?: string;
524
+ entityName: string;
525
+ entityNamePlural: string;
526
+ fieldSchema: Omit<UiAttribute, 'options'> & {
527
+ options: AttributeOptions[T];
528
+ };
529
+ getValues: (_payload?: string | string[]) => FormFieldValue | undefined;
530
+ readOnly: boolean;
531
+ relationshipEntityName?: string;
532
+ schema: UiSchema;
533
+ scope: string;
534
+ setValue: UseFormSetValue<FieldValues>;
535
+ };
536
+
137
537
  type FetchMoreOptions = {
138
538
  variables: OperationVariables & {
139
539
  offset: number;
@@ -199,8 +599,8 @@ type SortNotNullWhere = {
199
599
  };
200
600
  };
201
601
  };
202
- declare function getSortNotNullWhere(sort: unknown, entity: Entity | undefined): SortNotNullWhere | undefined;
203
- declare function getEntityQuery(entityNamePlural: string, scope: string, schema: Schema, options?: {
602
+ declare function getSortNotNullWhere(sort: unknown, entity: UiEntity | undefined): SortNotNullWhere | undefined;
603
+ declare function getEntityQuery(entityNamePlural: string, scope: string, schema: UiSchema, options?: {
204
604
  selection?: EntityQuerySelection;
205
605
  /**
206
606
  * The top-level aggregate count is a filtered label scan on the server.
@@ -214,14 +614,14 @@ declare function getEntityQuery(entityNamePlural: string, scope: string, schema:
214
614
  /**
215
615
  * Returns a string with the GraphQl query needed to mutate the dataToMutate object for the given entity and scope.
216
616
  */
217
- declare function getEntityUpdateMutation(entityNamePlural: string, entityId: string, scope: string, schema: Schema, originalData: FormEntityItem, dataToMutate: FormEntityItem, options?: {
617
+ declare function getEntityUpdateMutation(entityNamePlural: string, entityId: string, scope: string, schema: UiSchema, originalData: FormEntityItem, dataToMutate: FormEntityItem, options?: {
218
618
  currentUser?: User;
219
619
  responseFields?: string;
220
620
  }): string;
221
621
  /**
222
622
  * Returns a string with the GraphQl mutation needed to delete one or more entities.
223
623
  */
224
- declare function getEntityDeleteMutation(entityName: string, schema: Schema, ids: string | readonly string[]): string;
624
+ declare function getEntityDeleteMutation(entityName: string, schema: UiSchema, ids: string | readonly string[]): string;
225
625
  declare function getEntityDeleteWhere(ids: string | readonly string[]): {
226
626
  _id: {
227
627
  eq: string;
@@ -231,10 +631,10 @@ declare function getEntityDeleteWhere(ids: string | readonly string[]): {
231
631
  in: string[];
232
632
  };
233
633
  };
234
- declare function getEntityCreateMutation(entityNamePlural: string, schema: Schema, entityData: FormEntityItem, _id: string, options?: {
634
+ declare function getEntityCreateMutation(entityNamePlural: string, schema: UiSchema, entityData: FormEntityItem, _id: string, _options?: {
235
635
  currentUser?: User;
236
636
  }): string;
237
- declare function getEntitySchema(schema: Schema, entityNamePlural: string): Entity | undefined;
637
+ declare function getEntitySchema(schema: UiSchema, entityNamePlural: string): UiEntity | undefined;
238
638
 
239
639
  interface DataTableFacetedFilterProps<TData, TValue> {
240
640
  column?: Column<TData, TValue>;
@@ -250,7 +650,7 @@ interface DataTableFacetedFilterProps<TData, TValue> {
250
650
  declare function DataTableFacetedFilter<TData, TValue>({ column, title, options, }: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime.JSX.Element;
251
651
 
252
652
  type Props<TData> = {
253
- attributesSchema: Attribute[];
653
+ attributesSchema: UiAttribute[];
254
654
  checkboxSelect?: 'single' | 'multiple';
255
655
  actionsComponent?: (row: Row<TData>) => JSX.Element;
256
656
  enableColumnSorting?: boolean;
@@ -390,8 +790,8 @@ type ActionAlertDialog = {
390
790
 
391
791
  declare function useDispatch(): Dispatch<Action>;
392
792
 
393
- declare const assetSchema: Entity;
793
+ declare const assetSchema: UiEntity;
394
794
 
395
- declare const tagSchema: Entity;
795
+ declare const tagSchema: UiEntity;
396
796
 
397
- export { ALL_FIELDS_GROUP, ALL_FIELDS_GROUP_NAME, AppOptions, Attribute, AttributeValue, type ConfigContext, DataTable, DataTableColumnHeader, DataTableFacetedFilter, DataTableRowActions, DataTableSortedBy, DataTableToolbar, DataTableViewOptions, DefaultValueSwitch, Entity, type EntityListRowPatch, FieldGroup, FlexkitStudio, FormEntityItem, IMAGES_BASE_URL, MappedEntityItem, ProjectDisabled, Schema, SchemaError, SearchRequestProps, SearchResultItem, StudioContributions, StudioExtension, type UploadedFileResult, assetSchema, canAccessSpaces, canMutateData, defineConfig, defineEntity, defineExtension, filterAttributesForSpaces, filterEntitiesForSpaces, getEntityCreateMutation, getEntityDeleteMutation, getEntityDeleteWhere, getEntityQuery, getEntitySchema, getEntityUpdateMutation, getSortNotNullWhere, tagSchema, useAppContext, useAppDispatch, useAuth, useCanMutate, useConfig, useDispatch, useEntityMutation, useEntityQuery, useGraphQLError, useGridColumnsDefinition, usePatchEntityList, useRefreshEntityList, useSearch, useUploadAssets };
797
+ export { ALL_FIELDS_GROUP, ALL_FIELDS_GROUP_NAME, type AgentChatDetail, type AgentChatSearchResult, type AgentChatsList, type AttributeValue, type Automation, type AutomationApprovals, type AutomationArtifact, type AutomationCreditBalance, type AutomationInput, type AutomationToolChannel, type AutomationToolProvider, type ConfigContext, DataTable, DataTableColumnHeader, DataTableFacetedFilter, DataTableRowActions, DataTableSortedBy, DataTableToolbar, DataTableViewOptions, DefaultValueSwitch, type EntityData, type EntityListRowPatch, FlexkitStudio, type FlexkitStudioProps, type FormEntityItem, type FormFieldParams, type FormFieldValue, type HostedUser, IMAGES_BASE_URL, type MappedEntityItem, ProjectDisabled, type ProjectSchemaError, type ProjectSummary, type ProjectUiConfig, type RunHistory, type RunHistoryRun, SchemaError, type SearchRequestProps, type SearchResultItem, type Skill, type SkillInput, type SkillsList, type StudioMode, type UploadedFileResult, assetSchema, canAccessSpaces, canMutateData, filterAttributesForSpaces, filterEntitiesForSpaces, getEntityCreateMutation, getEntityDeleteMutation, getEntityDeleteWhere, getEntityQuery, getEntitySchema, getEntityUpdateMutation, getSortNotNullWhere, tagSchema, useAppContext, useAppDispatch, useAuth, useCanMutate, useConfig, useDispatch, useEntityMutation, useEntityQuery, useGraphQLError, useGridColumnsDefinition, usePatchEntityList, useRefreshEntityList, useSearch, useUploadAssets };