@burdenoff/fluidgrids-fe-sdk 2026.1111.16 → 2026.1111.17

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 (112) hide show
  1. package/README.md +41 -0
  2. package/dist/AiStudioPage-kJHSsIcj.js +774 -0
  3. package/dist/ApprovalInboxPage-dbBDSJ-f.js +558 -0
  4. package/dist/DataSinkDashboardPage-1h2QsMzH.js +270 -0
  5. package/dist/DataTablesPage-BZy2z0LB.js +1690 -0
  6. package/dist/EntityTagPicker-BqRNsLCQ.js +135 -0
  7. package/dist/{ExecutionDetailPage-D-0_POAf.js → ExecutionDetailPage-BdcZmLT4.js} +799 -4420
  8. package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
  9. package/dist/ExecutionsListPage-BCUJoAIE.js +2742 -0
  10. package/dist/{FailureTriagePanel-BHiduL7A.js → FailureTriagePanel-B9hDQymi.js} +4 -97
  11. package/dist/{FluidGridsProvider-DmvFADFa.js → FluidGridsProvider-dvZSNtSW.js} +10 -350
  12. package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
  13. package/dist/{HistoryPage-BbUgxx1I.js → HistoryPage-U0tqupBN.js} +6 -4
  14. package/dist/HumanRequestCard-D-ooVPDn.js +439 -0
  15. package/dist/{InsightsPage-s6f5bU-8.js → InsightsPage-CALo16eB.js} +17 -328
  16. package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
  17. package/dist/{ManagedAiPolicyAuthority-CGux_DaV.d.ts → ManagedAiPolicyAuthority-DM3t3wNr.d.ts} +1 -5
  18. package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
  19. package/dist/{MissingNodesInstallModal-B-9gHy2K.js → MissingNodesInstallModal-CMybsI8h.js} +3 -2
  20. package/dist/{NodesPage-ClvhUfbh.js → NodesPage-Bf5PhfBK.js} +7 -3
  21. package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
  22. package/dist/{PublishCustomNodeAction-D2F7oN0S.js → PublishCustomNodeAction-5XXnSA3H.js} +3 -45
  23. package/dist/QuotaExhaustedDialog-7IFSaLyi.js +54 -0
  24. package/dist/RunnerStatusPill-Ctg4TJcP.js +187 -0
  25. package/dist/RunnersPage-CLCOCclc.js +467 -0
  26. package/dist/{ManagedAiPolicyAuthority-DsSaz-vg.js → SettingsPage-CgkRlCM5.js} +19 -50
  27. package/dist/SettingsPage-DMHQFj5-.d.ts +9 -0
  28. package/dist/TagFilterSelect-DCBOH6Ou.js +41 -0
  29. package/dist/TaskQueuesPage-9VgSnLdL.js +951 -0
  30. package/dist/TemplateCard-DsC0KNH1.js +1416 -0
  31. package/dist/{TemplateConfigurationModal-D_Mvgxqa.js → TemplateConfigurationModal-BhGWIzpm.js} +3 -2
  32. package/dist/{TemplateDetailPanel-DfFfUcOe.js → TemplateDetailPanel-D4cUVr-m.js} +3 -3
  33. package/dist/TemplatePreview-GthzCOSo.js +231 -0
  34. package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
  35. package/dist/{TemplatesPage-Cku13bav.js → TemplatesPage-CsDNT54N.js} +11 -228
  36. package/dist/VariablesPage-67WR_lVE.js +949 -0
  37. package/dist/{VersionDiffDialog-Dq2xlPFI.js → VersionDiffDialog-DSN0mU0f.js} +2 -1
  38. package/dist/WorkflowBuilder-DEi_9YOb.js +555 -0
  39. package/dist/{WorkflowSearchRedirect-CaoOOpEl.js → WorkflowBuilder-iPqXgbYr.js} +19 -585
  40. package/dist/{WorkflowProposalCard-8Vr56kQa.js → WorkflowProposalCard-qrEeNyYG.js} +4 -405
  41. package/dist/WorkflowSearchRedirect-DwDNZ_q5.js +36 -0
  42. package/dist/{WorkflowShareDialog-6RRDe-_v.js → WorkflowShareDialog-B_gn968c.js} +6 -52
  43. package/dist/{WorkflowsList-B2j1Pehb.js → WorkflowsList-CA20dVIl.js} +11 -6
  44. package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
  45. package/dist/agent-form-Bfvm32j1.js +83 -0
  46. package/dist/{agentTools-DJ5o2ekg.js → agentTools-CkRJB7r5.js} +3 -2
  47. package/dist/{ai-usage-D5p7ZeRR.js → ai-usage-glCwHyQz.js} +1 -1
  48. package/dist/api-BrCHB5oA.js +224 -0
  49. package/dist/api-C8e0iV-Q.js +55 -0
  50. package/dist/button-DG7y_FVJ.js +48 -0
  51. package/dist/{canvasNoteTools-D3zUdEeg.js → canvasNoteTools-CQIc7Oxg.js} +2 -2
  52. package/dist/client-C9XSzSXr.js +1147 -0
  53. package/dist/{codec-client-DstqyzTN.js → codec-client-CJ95Rmqo.js} +1 -1
  54. package/dist/constants-B2lhWNoN.js +202 -0
  55. package/dist/constants-XdvUxeWK.d.ts +162 -0
  56. package/dist/dialog-Cjb4lB4D.js +105 -0
  57. package/dist/executions.d.ts +1 -1
  58. package/dist/executions.js +2 -1
  59. package/dist/feature-flags-DM5myWaD.js +296 -0
  60. package/dist/flags.d.ts +3 -0
  61. package/dist/flags.js +4 -0
  62. package/dist/{flow-builder-DEzT8TQu.js → flow-builder-y2Y1iG4Y.js} +70 -1731
  63. package/dist/{node-endpoint-configs-DHFGA5MQ.js → graphql-operation-types-kX-MMjgW.js} +1 -1194
  64. package/dist/{graphql-types-XcDLtFwU.js → graphql-types-CDKVWH2R.js} +2 -202
  65. package/dist/history.d.ts +1 -1
  66. package/dist/history.js +1 -1
  67. package/dist/index-72XFgvbn.d.ts +132 -0
  68. package/dist/index-BcdtKBM-.d.ts +56 -0
  69. package/dist/{index-B3BWqafN.d.ts → index-DjiFgEQl.d.ts} +5 -131
  70. package/dist/{index-DRf25-D3.d.ts → index-W2o__Nm6.d.ts} +32 -214
  71. package/dist/index.d.ts +13 -9
  72. package/dist/index.js +50 -5300
  73. package/dist/{node-detail-view-LNqeIqN-.js → node-detail-view-B91kXzIy.js} +11 -8
  74. package/dist/node-endpoint-configs-B5bjNMDW.js +37 -0
  75. package/dist/node-registry-refresh-Dy0uRg9f.js +84 -0
  76. package/dist/nodes.d.ts +1 -1
  77. package/dist/nodes.js +1 -1
  78. package/dist/observability.d.ts +1 -1
  79. package/dist/observability.js +2 -1
  80. package/dist/{quick-config-panel-D3ogsaFL.js → quick-config-panel-DggPl1vY.js} +2 -2
  81. package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
  82. package/dist/run-display-BycKYSU0.js +46 -0
  83. package/dist/run-list-links-ByYC0OlV.js +98 -0
  84. package/dist/settings.d.ts +2 -1
  85. package/dist/settings.js +2 -1
  86. package/dist/shared-CMfn30xT.js +196 -0
  87. package/dist/templates.d.ts +1 -1
  88. package/dist/templates.js +2 -1
  89. package/dist/theme-provider-B3mIuz2d.js +11 -0
  90. package/dist/{useAgentDefinitions-NFtLytDR.js → useAgentDefinitions-Dpz0HDTq.js} +2 -1
  91. package/dist/useDurableParity-CzUQMFJ3.js +415 -0
  92. package/dist/useEntityTags-DhnsZcTl.js +236 -0
  93. package/dist/{useExecutions-DAzeWHS6.js → useExecutions-9aLuOt1c.js} +4 -3
  94. package/dist/{useObservability-COCZ0hUS.js → useObservability-CfEw3ZFD.js} +2 -2
  95. package/dist/{useRunHistory-CsYUbouO.js → useRunHistory-B1xJDwl1.js} +4 -3
  96. package/dist/{useWorkflows-w4Dx2fF2.js → useWorkflows-BlVVu8NM.js} +3 -2
  97. package/dist/utils-uaL5UVxb.js +65 -0
  98. package/dist/workflow-builder.d.ts +1 -1
  99. package/dist/workflow-builder.js +4 -2
  100. package/dist/workflow-host.d.ts +6 -0
  101. package/dist/workflow-host.js +9 -0
  102. package/dist/workflow-pages.d.ts +55 -0
  103. package/dist/workflow-pages.js +113 -0
  104. package/dist/workflows-list.d.ts +1 -1
  105. package/dist/workflows-list.js +1 -1
  106. package/package.json +13 -1
  107. package/dist/ExecutionDetailPage-MvsnOnE1.d.ts +0 -4
  108. package/dist/HistoryPage-BqUizaFv.d.ts +0 -3
  109. package/dist/NodesPage-C97-9K2Y.d.ts +0 -3
  110. package/dist/TemplatesPage-D0qnXzHh.d.ts +0 -4
  111. package/dist/WorkflowsList-0d5GSKdh.d.ts +0 -3
  112. package/dist/agent-form-BvMWhQ42.js +0 -496
@@ -1,1164 +1,4 @@
1
1
  "use client";
2
- import { ApolloClient, ApolloLink, InMemoryCache, Observable, createHttpLink, split } from "@apollo/client/core";
3
- import { setContext } from "@apollo/client/link/context";
4
- import { getMainDefinition } from "@apollo/client/utilities";
5
- import { GraphQLWsLink } from "@apollo/client/link/subscriptions";
6
- import { createClient } from "graphql-ws";
7
- import { create } from "zustand";
8
- import { CombinedGraphQLErrors, ServerError } from "@apollo/client/errors";
9
-
10
- // \0rolldown/runtime.js
11
- var __defProp = Object.defineProperty;
12
- var __exportAll = (all, flags) => {
13
- let target = Object.setPrototypeOf({}, null);
14
- for (var name in all) {
15
- __defProp(target, name, {
16
- get: all[name],
17
- enumerable: true
18
- });
19
- }
20
- if (!(flags & 1)) {
21
- __defProp(target, Symbol.toStringTag, { value: "Module" });
22
- }
23
- return flags & 2 ? target : Object.preventExtensions(target);
24
- };
25
-
26
- // src/modules/executions/store/executionsStore.ts
27
- const DEFAULT_EXECUTIONS_FILTER = {
28
- status: "all",
29
- workflowKey: "",
30
- dateRange: {
31
- start: null,
32
- end: null,
33
- preset: "all"
34
- },
35
- search: "",
36
- triggerType: "all",
37
- durationMinSeconds: null,
38
- durationMaxSeconds: null,
39
- errorType: "all",
40
- nodeId: "",
41
- failedNodeType: "",
42
- tagId: "",
43
- workflowId: ""
44
- };
45
- const defaultPagination = {
46
- page: 1,
47
- pageSize: 25,
48
- total: 0
49
- };
50
- const useExecutionsStore = create((set) => ({
51
- viewMode: "table",
52
- selectedExecution: null,
53
- expandedRows: /* @__PURE__ */ new Set(),
54
- selection: {
55
- runIds: [],
56
- allSelected: false
57
- },
58
- filter: DEFAULT_EXECUTIONS_FILTER,
59
- pagination: defaultPagination,
60
- isFilterPanelOpen: false,
61
- isDetailsPanelOpen: false,
62
- autoRefresh: true,
63
- autoRefreshInterval: 5e3,
64
- liveRunIds: /* @__PURE__ */ new Set(),
65
- setViewMode: (mode) => set({ viewMode: mode }),
66
- setSelectedExecution: (execution) => set({
67
- selectedExecution: execution,
68
- isDetailsPanelOpen: execution !== null
69
- }),
70
- toggleRowExpanded: (runId) => set((state) => {
71
- const newExpanded = new Set(state.expandedRows);
72
- if (newExpanded.has(runId)) newExpanded.delete(runId);
73
- else newExpanded.add(runId);
74
- return { expandedRows: newExpanded };
75
- }),
76
- setSelection: (selection) => set({ selection }),
77
- toggleSelectRun: (runId) => set((state) => {
78
- return { selection: {
79
- runIds: state.selection.runIds.includes(runId) ? state.selection.runIds.filter((id) => id !== runId) : [...state.selection.runIds, runId],
80
- allSelected: false
81
- } };
82
- }),
83
- selectAll: (runIds) => set((state) => ({ selection: {
84
- runIds: state.selection.allSelected ? [] : runIds,
85
- allSelected: !state.selection.allSelected
86
- } })),
87
- clearSelection: () => set({ selection: {
88
- runIds: [],
89
- allSelected: false
90
- } }),
91
- updateFilter: (filterUpdate) => set((state) => ({
92
- filter: {
93
- ...state.filter,
94
- ...filterUpdate
95
- },
96
- pagination: {
97
- ...state.pagination,
98
- page: 1
99
- }
100
- })),
101
- setStatusFilter: (status) => set((state) => ({
102
- filter: {
103
- ...state.filter,
104
- status
105
- },
106
- pagination: {
107
- ...state.pagination,
108
- page: 1
109
- }
110
- })),
111
- setWorkflowFilter: (workflowKey) => set((state) => ({
112
- filter: {
113
- ...state.filter,
114
- workflowKey
115
- },
116
- pagination: {
117
- ...state.pagination,
118
- page: 1
119
- }
120
- })),
121
- setDateRange: (dateRange) => set((state) => ({
122
- filter: {
123
- ...state.filter,
124
- dateRange
125
- },
126
- pagination: {
127
- ...state.pagination,
128
- page: 1
129
- }
130
- })),
131
- setSearchQuery: (search) => set((state) => ({
132
- filter: {
133
- ...state.filter,
134
- search
135
- },
136
- pagination: {
137
- ...state.pagination,
138
- page: 1
139
- }
140
- })),
141
- setTriggerTypeFilter: (triggerType) => set((state) => ({
142
- filter: {
143
- ...state.filter,
144
- triggerType
145
- },
146
- pagination: {
147
- ...state.pagination,
148
- page: 1
149
- }
150
- })),
151
- setDurationFilter: (durationMinSeconds, durationMaxSeconds) => set((state) => ({
152
- filter: {
153
- ...state.filter,
154
- durationMinSeconds,
155
- durationMaxSeconds
156
- },
157
- pagination: {
158
- ...state.pagination,
159
- page: 1
160
- }
161
- })),
162
- setErrorTypeFilter: (errorType) => set((state) => ({
163
- filter: {
164
- ...state.filter,
165
- errorType
166
- },
167
- pagination: {
168
- ...state.pagination,
169
- page: 1
170
- }
171
- })),
172
- setNodeFilter: (nodeId) => set((state) => ({
173
- filter: {
174
- ...state.filter,
175
- nodeId
176
- },
177
- pagination: {
178
- ...state.pagination,
179
- page: 1
180
- }
181
- })),
182
- setFailedNodeTypeFilter: (failedNodeType) => set((state) => ({
183
- filter: {
184
- ...state.filter,
185
- failedNodeType
186
- },
187
- pagination: {
188
- ...state.pagination,
189
- page: 1
190
- }
191
- })),
192
- setTagFilter: (tagId) => set((state) => ({
193
- filter: {
194
- ...state.filter,
195
- tagId
196
- },
197
- pagination: {
198
- ...state.pagination,
199
- page: 1
200
- }
201
- })),
202
- setWorkflowIdFilter: (workflowId) => set((state) => ({
203
- filter: {
204
- ...state.filter,
205
- workflowId
206
- },
207
- pagination: {
208
- ...state.pagination,
209
- page: 1
210
- }
211
- })),
212
- resetFilters: () => set({
213
- filter: DEFAULT_EXECUTIONS_FILTER,
214
- pagination: { ...defaultPagination }
215
- }),
216
- setPage: (page) => set((state) => ({ pagination: {
217
- ...state.pagination,
218
- page
219
- } })),
220
- setPageSize: (pageSize) => set((state) => ({ pagination: {
221
- ...state.pagination,
222
- pageSize,
223
- page: 1
224
- } })),
225
- setTotal: (total) => set((state) => ({ pagination: {
226
- ...state.pagination,
227
- total
228
- } })),
229
- toggleFilterPanel: () => set((state) => ({ isFilterPanelOpen: !state.isFilterPanelOpen })),
230
- toggleDetailsPanel: () => set((state) => ({ isDetailsPanelOpen: !state.isDetailsPanelOpen })),
231
- setAutoRefresh: (enabled) => set({ autoRefresh: enabled }),
232
- setAutoRefreshInterval: (interval) => set({ autoRefreshInterval: interval }),
233
- addLiveRun: (runId) => set((state) => {
234
- const newLiveRunIds = new Set(state.liveRunIds);
235
- newLiveRunIds.add(runId);
236
- return { liveRunIds: newLiveRunIds };
237
- }),
238
- removeLiveRun: (runId) => set((state) => {
239
- const newLiveRunIds = new Set(state.liveRunIds);
240
- newLiveRunIds.delete(runId);
241
- return { liveRunIds: newLiveRunIds };
242
- }),
243
- clearLiveRuns: () => set({ liveRunIds: /* @__PURE__ */ new Set() })
244
- }));
245
-
246
- // src/theme/fluidgridsTheme.ts
247
- const color = (...cssVariables) => ({
248
- kind: "color",
249
- cssVariables
250
- });
251
- const length = (...cssVariables) => ({
252
- kind: "length",
253
- cssVariables
254
- });
255
- const font = (...cssVariables) => ({
256
- kind: "font",
257
- cssVariables
258
- });
259
- /**
260
- * Theme token → the fe-libs semantic CSS variables it sets. This table is the
261
- * public contract: a token keeps its variables across minor releases.
262
- */
263
- const FLUIDGRIDS_THEME_TOKEN_MAP = {
264
- "colors.bgCanvas": color("--color-bg-canvas"),
265
- "colors.bgSurface": color("--color-bg-surface"),
266
- "colors.bgElevated": color("--color-bg-elevated"),
267
- "colors.bgSunken": color("--color-bg-sunken"),
268
- "colors.textPrimary": color("--color-text-primary"),
269
- "colors.textSecondary": color("--color-text-secondary"),
270
- "colors.textMuted": color("--color-text-muted"),
271
- "colors.borderDefault": color("--color-border-default"),
272
- "colors.borderSubtle": color("--color-border-subtle"),
273
- "colors.borderStrong": color("--color-border-strong"),
274
- "colors.primary": color("--color-action-primary-bg", "--color-action-primary-border"),
275
- "colors.primaryHover": color("--color-action-primary-bgHover"),
276
- "colors.primaryActive": color("--color-action-primary-bgActive"),
277
- "colors.primaryText": color("--color-action-primary-text"),
278
- "colors.success": color("--color-status-success-bg"),
279
- "colors.warning": color("--color-status-warning-bg"),
280
- "colors.error": color("--color-status-error-bg"),
281
- "colors.info": color("--color-status-info-bg"),
282
- "radius.base": length("--radius"),
283
- "radius.card": length("--radius-card"),
284
- "radius.button": length("--radius-button"),
285
- "radius.input": length("--radius-input"),
286
- "font.body": font("--font-family-body", "--font-sans"),
287
- "font.heading": font("--font-family-heading"),
288
- "font.mono": font("--font-family-mono", "--font-mono")
289
- };
290
- const MAX_VALUE_LENGTH = 200;
291
- const FORBIDDEN_VALUE = /[;{}<>\\!@"`]|\/\*|\*\/|url\s*\(|expression\s*\(|image\s*\(|image-set\s*\(|javascript:|@import/i;
292
- const HEX_COLOR = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
293
- const NAMED_COLOR = /^[a-z]{3,30}$/i;
294
- const COLOR_FUNCTION = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\([a-z0-9#%.,/\s()+-]*\)$/i;
295
- const CSS_VAR = /^var\(--[a-z0-9-]+\)$/i;
296
- const LENGTH = /^(?:0|\d*\.?\d+(?:px|rem|em|%|vh|vw|vmin|vmax|ch|ex|pt))$/i;
297
- const CALC = /^calc\([a-z0-9%.\s()*/+-]*\)$/i;
298
- const FONT_FAMILY_ITEM = /^(?:[a-z0-9][a-z0-9 _-]*|'[a-z0-9 _-]+')$/i;
299
- function balancedParentheses(value) {
300
- let depth = 0;
301
- for (const char of value) {
302
- if (char === "(") depth += 1;
303
- if (char === ")") depth -= 1;
304
- if (depth < 0) return false;
305
- }
306
- return depth === 0;
307
- }
308
- /**
309
- * Validate one token value. Returns the trimmed value, or null when it is not
310
- * a plain CSS value of the expected kind.
311
- */
312
- function sanitizeThemeValue(kind, value) {
313
- if (typeof value !== "string") return null;
314
- const trimmed = value.trim();
315
- if (!trimmed || trimmed.length > MAX_VALUE_LENGTH) return null;
316
- if (FORBIDDEN_VALUE.test(trimmed) || !balancedParentheses(trimmed)) return null;
317
- if (CSS_VAR.test(trimmed)) return trimmed;
318
- switch (kind) {
319
- case "color": return HEX_COLOR.test(trimmed) || NAMED_COLOR.test(trimmed) || COLOR_FUNCTION.test(trimmed) ? trimmed : null;
320
- case "length": return LENGTH.test(trimmed) || CALC.test(trimmed) ? trimmed : null;
321
- case "font": {
322
- const items = trimmed.split(",").map((item) => item.trim());
323
- return items.every((item) => FONT_FAMILY_ITEM.test(item)) ? items.join(", ") : null;
324
- }
325
- }
326
- }
327
- function warnDropped(key, value) {
328
- console.warn(`[FluidGrids SDK] theme token "${key}" ignored: ${JSON.stringify(value)} is not a plain CSS value.`);
329
- }
330
- /** Relative luminance of a hex colour, or null for any other notation. */
331
- function hexLuminance(value) {
332
- if (!HEX_COLOR.test(value)) return null;
333
- let hex = value.slice(1);
334
- if (hex.length <= 4) hex = hex.split("").map((digit) => digit + digit).join("");
335
- const [red = 0, green = 0, blue = 0] = [
336
- 0,
337
- 2,
338
- 4
339
- ].map((offset) => {
340
- const channel = parseInt(hex.slice(offset, offset + 2), 16) / 255;
341
- return channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
342
- });
343
- return .2126 * red + .7152 * green + .0722 * blue;
344
- }
345
- /**
346
- * The resolved mode of a theme: the shortcut itself, `theme.mode`, or
347
- * undefined when the theme leaves the mode to the host.
348
- */
349
- function themeMode(theme) {
350
- if (theme === "light" || theme === "dark") return theme;
351
- if (theme && typeof theme === "object") return theme.mode === "light" || theme.mode === "dark" ? theme.mode : void 0;
352
- }
353
- function groupEntries(theme, group) {
354
- const values = theme[group];
355
- if (!values || typeof values !== "object") return [];
356
- return Object.entries(values);
357
- }
358
- function isTokenKey(key) {
359
- return Object.prototype.hasOwnProperty.call(FLUIDGRIDS_THEME_TOKEN_MAP, key);
360
- }
361
- /**
362
- * Turn a theme into the CSS custom properties it sets. Pure: no DOM access.
363
- *
364
- * Values that are not plain CSS values of the token's kind (anything with
365
- * `;`, `{`, `}`, `url(`, `expression(`, quotes other than single-quoted font
366
- * names, …) are dropped with a console warning. Unknown keys are dropped the
367
- * same way. When `colors.primary` is set, the hover / pressed shades and the
368
- * text colour are derived from it unless they are set explicitly; the text
369
- * colour is picked for contrast when `primary` is a hex colour.
370
- */
371
- function themeToCssVariables(theme) {
372
- const variables = {};
373
- if (!theme || typeof theme !== "object") return variables;
374
- const colors = {};
375
- for (const group of [
376
- "colors",
377
- "radius",
378
- "font"
379
- ]) for (const [name, raw] of groupEntries(theme, group)) {
380
- if (raw === void 0) continue;
381
- const key = `${group}.${name}`;
382
- if (!isTokenKey(key)) {
383
- warnDropped(key, raw);
384
- continue;
385
- }
386
- const mapping = FLUIDGRIDS_THEME_TOKEN_MAP[key];
387
- const value = sanitizeThemeValue(mapping.kind, raw);
388
- if (value === null) {
389
- warnDropped(key, raw);
390
- continue;
391
- }
392
- if (group === "colors") colors[name] = value;
393
- for (const cssVariable of mapping.cssVariables) variables[cssVariable] = value;
394
- }
395
- const primary = colors.primary;
396
- if (primary) {
397
- if (!colors.primaryHover) variables["--color-action-primary-bgHover"] = `color-mix(in oklab, ${primary} 84%, var(--palette-black))`;
398
- if (!colors.primaryActive) variables["--color-action-primary-bgActive"] = `color-mix(in oklab, ${primary} 70%, var(--palette-black))`;
399
- if (!colors.primaryText) {
400
- const luminance = hexLuminance(primary);
401
- if (luminance !== null) variables["--color-action-primary-text"] = luminance > .4 ? "var(--palette-black)" : "var(--palette-white)";
402
- }
403
- }
404
- return variables;
405
- }
406
- const stack = [];
407
- let nextId = 1;
408
- let observer = null;
409
- const hostVariables = /* @__PURE__ */ new Map();
410
- const appliedVariables = /* @__PURE__ */ new Map();
411
- let hostMode = null;
412
- function readHostMode(root) {
413
- return {
414
- dataTheme: root.getAttribute("data-theme"),
415
- dark: root.classList.contains("dark")
416
- };
417
- }
418
- function writeMode(root, mode) {
419
- if (mode.dataTheme === null) root.removeAttribute("data-theme");
420
- else if (root.getAttribute("data-theme") !== mode.dataTheme) root.setAttribute("data-theme", mode.dataTheme);
421
- if (root.classList.contains("dark") !== mode.dark) root.classList.toggle("dark", mode.dark);
422
- }
423
- function modeDrifted(root, mode) {
424
- return root.getAttribute("data-theme") !== mode || root.classList.contains("dark") !== (mode === "dark");
425
- }
426
- function restoreVariable(root, name) {
427
- const previous = hostVariables.get(name) ?? "";
428
- if (previous) root.style.setProperty(name, previous);
429
- else root.style.removeProperty(name);
430
- hostVariables.delete(name);
431
- appliedVariables.delete(name);
432
- }
433
- function forceVariable(root, name, value) {
434
- root.style.setProperty(name, value);
435
- appliedVariables.set(name, root.style.getPropertyValue(name));
436
- }
437
- /** Re-force the winning theme where something else changed it. */
438
- function reconcileDrift() {
439
- const top = stack.at(-1);
440
- if (!top || typeof document === "undefined") return;
441
- const root = document.documentElement;
442
- for (const [name, value] of Object.entries(top.variables)) {
443
- const current = root.style.getPropertyValue(name);
444
- if (current !== appliedVariables.get(name)) {
445
- hostVariables.set(name, current);
446
- forceVariable(root, name, value);
447
- }
448
- }
449
- if (top.mode && modeDrifted(root, top.mode)) {
450
- hostMode = readHostMode(root);
451
- writeMode(root, {
452
- dataTheme: top.mode,
453
- dark: top.mode === "dark"
454
- });
455
- }
456
- }
457
- /** Make the document match the top of the stack. */
458
- function sync() {
459
- if (typeof document === "undefined") return;
460
- const root = document.documentElement;
461
- const top = stack.at(-1);
462
- const wanted = top?.variables ?? {};
463
- for (const name of [...appliedVariables.keys()]) if (!(name in wanted)) restoreVariable(root, name);
464
- for (const [name, value] of Object.entries(wanted)) {
465
- if (!hostVariables.has(name)) hostVariables.set(name, root.style.getPropertyValue(name));
466
- if (appliedVariables.get(name) !== value) forceVariable(root, name, value);
467
- }
468
- if (top?.mode) {
469
- if (!hostMode) hostMode = readHostMode(root);
470
- writeMode(root, {
471
- dataTheme: top.mode,
472
- dark: top.mode === "dark"
473
- });
474
- } else if (hostMode) {
475
- writeMode(root, hostMode);
476
- hostMode = null;
477
- }
478
- if (!top) {
479
- observer?.disconnect();
480
- observer = null;
481
- return;
482
- }
483
- if (!observer && typeof MutationObserver !== "undefined") {
484
- observer = new MutationObserver(reconcileDrift);
485
- observer.observe(root, {
486
- attributes: true,
487
- attributeFilter: [
488
- "style",
489
- "data-theme",
490
- "class"
491
- ]
492
- });
493
- }
494
- }
495
- /**
496
- * Apply a theme to the document and return a function that removes it again.
497
- *
498
- * Sets each variable from {@link themeToCssVariables} as an inline custom
499
- * property on `document.documentElement`, and for a mode sets `data-theme`
500
- * and the `.dark` class. While applied, the values are re-forced if something
501
- * else (a host ThemeProvider) rewrites them. Disposing restores the inline
502
- * values and mode the document had (including any change the host made in
503
- * between). When several themes are applied, the most recent one wins.
504
- * Calling the returned function more than once is safe. Without a DOM
505
- * (server rendering) it does nothing.
506
- */
507
- function applyFluidGridsTheme(theme) {
508
- if (typeof document === "undefined") return () => void 0;
509
- const entry = {
510
- id: nextId++,
511
- variables: themeToCssVariables(theme),
512
- mode: themeMode(theme)
513
- };
514
- stack.push(entry);
515
- sync();
516
- let disposed = false;
517
- return () => {
518
- if (disposed) return;
519
- disposed = true;
520
- const index = stack.findIndex((active) => active.id === entry.id);
521
- if (index >= 0) stack.splice(index, 1);
522
- sync();
523
- };
524
- }
525
- /**
526
- * Stable key for a theme value, so callers can tell two theme objects with the
527
- * same content apart from a real change (hosts often pass inline objects).
528
- */
529
- function themeKey(theme) {
530
- if (!theme) return "";
531
- if (typeof theme === "string") return theme;
532
- const sortedGroup = (group) => groupEntries(theme, group).filter(([, value]) => value !== void 0).sort(([a], [b]) => a.localeCompare(b));
533
- return JSON.stringify([
534
- theme.mode ?? null,
535
- sortedGroup("colors"),
536
- sortedGroup("radius"),
537
- sortedGroup("font")
538
- ]);
539
- }
540
-
541
- // src/config/index.ts
542
- var config_exports = /* @__PURE__ */ __exportAll({ getFluidGridsConfig: () => getFluidGridsConfig });
543
- let runtimeConfig = {
544
- apiGatewayUrl: "",
545
- workspaceId: ""
546
- };
547
- /**
548
- * Get current configuration via proxy for live access
549
- */
550
- const config = new Proxy({}, { get(_, prop) {
551
- return runtimeConfig[prop];
552
- } });
553
- /**
554
- * Get the full configuration object
555
- */
556
- function getFluidGridsConfig() {
557
- return { ...runtimeConfig };
558
- }
559
- /**
560
- * Set runtime configuration
561
- */
562
- function setFluidGridsConfig(newConfig) {
563
- const previous = runtimeConfig;
564
- runtimeConfig = {
565
- ...runtimeConfig,
566
- ...newConfig
567
- };
568
- if (previous.authToken !== runtimeConfig.authToken || previous.workspaceToken !== runtimeConfig.workspaceToken) tokenRevision += 1;
569
- if ("theme" in newConfig) syncConfigTheme(newConfig.theme);
570
- }
571
- /**
572
- * Reset configuration to defaults
573
- */
574
- function resetFluidGridsConfig() {
575
- tokenRevision += 1;
576
- runtimeConfig = {
577
- apiGatewayUrl: "",
578
- workspaceId: ""
579
- };
580
- syncConfigTheme(void 0);
581
- }
582
- let tokenRevision = 0;
583
- /** Current token revision. Internal: used by the SDK's Apollo clients. */
584
- function getFluidGridsTokenRevision() {
585
- return tokenRevision;
586
- }
587
- let configTheme = null;
588
- function syncConfigTheme(theme) {
589
- const key = themeKey(theme);
590
- if (configTheme?.key === key) return;
591
- const previous = configTheme;
592
- configTheme = key ? {
593
- key,
594
- dispose: applyFluidGridsTheme(theme)
595
- } : null;
596
- previous?.dispose();
597
- }
598
- function normalizeOrigin(origin) {
599
- return origin.replace(/\/$/, "");
600
- }
601
- function validateTrustedOrigin(trustedOrigins) {
602
- if (typeof window === "undefined" || !trustedOrigins?.length) return;
603
- const currentOrigin = normalizeOrigin(window.location.origin);
604
- if (!trustedOrigins.map(normalizeOrigin).includes(currentOrigin)) throw new Error(`FluidGrids SDK blocked untrusted origin: ${currentOrigin}`);
605
- }
606
- /**
607
- * Get the GraphQL endpoint URL
608
- */
609
- function getGraphQLEndpoint(baseUrl) {
610
- const url = baseUrl || runtimeConfig.apiGatewayUrl;
611
- if (!url) throw new Error("FluidGrids SDK requires apiGatewayUrl to be configured");
612
- const normalizedBase = url.endsWith("/") ? url.slice(0, -1) : url;
613
- if (normalizedBase.endsWith("/graphql")) return normalizedBase;
614
- return `${normalizedBase}/workspaces/graphql`;
615
- }
616
- /** Clear user execution state only when a host session ends or changes identity. */
617
- function resetFluidGridsExecutionState() {
618
- useExecutionsStore.setState(useExecutionsStore.getInitialState(), true);
619
- }
620
-
621
- // src/graphql/live-tokens.ts
622
- /**
623
- * Token reader for an SDK-created Apollo client (BOFF-9961).
624
- *
625
- * The client starts with the tokens it was created with. Once a token is set
626
- * in the SDK config after that — a refresh through `auth.onTokenExpired`, or
627
- * a host calling `setFluidGridsConfig({ authToken })` — every later request
628
- * reads the configured value instead. Reading per request (never capturing
629
- * the token in a closure) is what lets a refreshed token reach in-flight
630
- * retries and websocket reconnects.
631
- */
632
- function createLiveTokenReader(initial) {
633
- const createdAt = getFluidGridsTokenRevision();
634
- return () => {
635
- if (getFluidGridsTokenRevision() === createdAt) return initial;
636
- return {
637
- authToken: config.authToken ?? initial.authToken,
638
- workspaceToken: config.workspaceToken ?? initial.workspaceToken
639
- };
640
- };
641
- }
642
-
643
- // src/graphql/errors.ts
644
- /**
645
- * Operation-error helpers.
646
- *
647
- * The SDK usually runs against a host-injected Apollo client (see
648
- * `setFluidGridsClient`). App shells configure their shared client with
649
- * `errorPolicy: 'all'`, so `client.mutate` / `client.query` RESOLVE on
650
- * GraphQL errors — `result.data` is empty and the real failure sits in
651
- * `result.error`. Callers that only check `result.data` silently swallow
652
- * server errors (e.g. QUOTA_EXHAUSTED) and surface generic messages.
653
- *
654
- * Use `throwIfResultError(result)` right after a mutate/query so failures
655
- * flow through the existing catch paths, and `describeOperationError(err)`
656
- * to turn whatever was thrown into a user-presentable message.
657
- */
658
- /** Well-known gateway error codes mapped to user-friendly messages. */
659
- function describeGraphQLError(error) {
660
- switch (typeof error.extensions?.code === "string" ? error.extensions.code : void 0) {
661
- case "QUOTA_EXHAUSTED": {
662
- const quota = /Quota exhausted for (\S+)/.exec(error.message)?.[1];
663
- return `Quota exhausted — your workspace has used up its ${quota ? `"${quota}" quota` : "usage quota"}. Upgrade your plan or wait for the quota to reset.`;
664
- }
665
- case "QUOTA_NOT_PROVISIONED": return "This workspace's plan does not include this usage allowance yet. Contact your workspace admin or support to have it provisioned.";
666
- case "UNAUTHENTICATED": return "Your session has expired. Please sign in again.";
667
- case "FORBIDDEN": return error.message || "You don't have permission to perform this action.";
668
- default: return error.message || "Unknown error";
669
- }
670
- }
671
- /** The first GraphQL error of a raw JSON response body, if it carries one. */
672
- function firstGraphQLErrorInBody(bodyText) {
673
- try {
674
- const parsed = JSON.parse(bodyText);
675
- if (typeof parsed !== "object" || parsed === null) return null;
676
- const errors = parsed.errors;
677
- if (!Array.isArray(errors) || errors.length === 0) return null;
678
- const first = errors[0];
679
- if (typeof first !== "object" || first === null) return null;
680
- if (typeof first.message !== "string") return null;
681
- return first;
682
- } catch {
683
- return null;
684
- }
685
- }
686
- /**
687
- * Turn anything thrown (or found in `result.error`) into a message fit for
688
- * a toast / run log. Unwraps Apollo `CombinedGraphQLErrors` so well-known
689
- * gateway codes (quota, auth) read properly instead of a concatenated dump.
690
- */
691
- function describeOperationError(error, fallback = "Unknown error") {
692
- if (CombinedGraphQLErrors.is(error)) {
693
- const first = error.errors[0];
694
- return first ? describeGraphQLError(first) : error.message || fallback;
695
- }
696
- if (ServerError.is(error)) {
697
- const first = firstGraphQLErrorInBody(error.bodyText);
698
- if (first) return describeGraphQLError(first);
699
- }
700
- if (error instanceof Error) return error.message || fallback;
701
- if (typeof error === "string" && error.length > 0) return error;
702
- return fallback;
703
- }
704
- /**
705
- * Throw `result.error` when the injected client resolved an errored
706
- * operation (errorPolicy 'all'). Returns the result unchanged otherwise, so
707
- * it can be chained inline:
708
- *
709
- * ```ts
710
- * const result = throwIfResultError(await client.mutate({ ... }));
711
- * ```
712
- */
713
- function throwIfResultError(result) {
714
- if (result.error) throw new Error(describeOperationError(result.error), { cause: result.error });
715
- return result;
716
- }
717
- /** True when a GraphQL error list carries a FORBIDDEN code. */
718
- function hasForbiddenCode(errors) {
719
- return (errors ?? []).some((error) => error.extensions?.code === "FORBIDDEN");
720
- }
721
- /**
722
- * True when an operation failed because the caller lacks the permission
723
- * (gateway `@rbac` denial). Accepts the raw Apollo error, a `result.error`,
724
- * or the Error `throwIfResultError` throws (the original sits in `cause`).
725
- * Pages use it to render a no-access state instead of a load failure.
726
- */
727
- function isForbiddenError(error) {
728
- if (CombinedGraphQLErrors.is(error)) return hasForbiddenCode(error.errors);
729
- if (ServerError.is(error)) {
730
- if (error.statusCode === 403) return true;
731
- const first = firstGraphQLErrorInBody(error.bodyText);
732
- return first ? hasForbiddenCode([first]) : false;
733
- }
734
- if (error instanceof Error && error.cause !== void 0) return isForbiddenError(error.cause);
735
- return false;
736
- }
737
- const REFRESHABLE_AUTH_FAILURES = /* @__PURE__ */ new Set(["CREDENTIAL_EXPIRED", "CREDENTIAL_REVOKED"]);
738
- const EXPIRED_TOKEN_MESSAGE = /\b(?:jwt|token)\b[^.]{0,40}\bexpired\b|\bexpired\b[^.]{0,20}\b(?:jwt|token)\b/i;
739
- function isUnauthenticatedGraphQLError(error) {
740
- if (error.extensions?.code === "UNAUTHENTICATED") return true;
741
- const authFailure = error.extensions?.authFailure;
742
- if (typeof authFailure === "string" && REFRESHABLE_AUTH_FAILURES.has(authFailure)) return true;
743
- return typeof error.message === "string" && EXPIRED_TOKEN_MESSAGE.test(error.message);
744
- }
745
- /**
746
- * True when a GraphQL error list says the caller's credential expired or is
747
- * not accepted: an `UNAUTHENTICATED` code, an expired / revoked
748
- * `authFailure` category, or an expired-token message.
749
- */
750
- function hasUnauthenticatedGraphQLError(errors) {
751
- return (errors ?? []).some(isUnauthenticatedGraphQLError);
752
- }
753
- /**
754
- * True when an operation failed because the session expired: HTTP 401, a
755
- * GraphQL `UNAUTHENTICATED` error, or an expired / revoked credential.
756
- * Accepts the raw Apollo error, a `result.error`, or the Error
757
- * `throwIfResultError` throws (the original sits in `cause`). A 503
758
- * `AUTH_SERVICE_UNAVAILABLE` is not an expired session and returns false.
759
- */
760
- function isUnauthenticatedError(error) {
761
- if (CombinedGraphQLErrors.is(error)) return hasUnauthenticatedGraphQLError(error.errors);
762
- if (ServerError.is(error)) {
763
- if (error.statusCode === 401) return true;
764
- const first = firstGraphQLErrorInBody(error.bodyText);
765
- return first ? isUnauthenticatedGraphQLError(first) : false;
766
- }
767
- if (error instanceof Error && error.cause !== void 0) return isUnauthenticatedError(error.cause);
768
- return false;
769
- }
770
- /** The gateway error code of an operation failure, when it carries one. */
771
- function operationErrorCode(error) {
772
- const codeOf = (graphQLError) => {
773
- const code = graphQLError?.extensions?.code;
774
- return typeof code === "string" ? code : void 0;
775
- };
776
- if (CombinedGraphQLErrors.is(error)) return codeOf(error.errors[0]);
777
- if (ServerError.is(error)) return codeOf(firstGraphQLErrorInBody(error.bodyText) ?? void 0);
778
- if (error instanceof Error && error.cause !== void 0) return operationErrorCode(error.cause);
779
- }
780
-
781
- // src/events/eventBus.ts
782
- /**
783
- * Host event bus for embedders (BOFF-9961).
784
- *
785
- * The SDK reports what happens inside the embedded builder to the host page
786
- * through one typed callback, `onEvent`, set on `FluidGridsConfig` (or the
787
- * `onEvent` prop of `FluidGridsProvider`). Hosts use it to sync their own UI,
788
- * analytics or backend: a workflow was saved or activated, a run started or
789
- * finished, the user selected a node, something failed.
790
- *
791
- * This bus is separate from the product-analytics emitters in
792
- * `analytics/fluidgridsEvents.ts`, which publish `fluidgrids.*` facts on the
793
- * fe-libs shell bus for Rybbit/OTel. Those stay as they are; this one is the
794
- * documented, versioned contract for third-party hosts.
795
- *
796
- * Versioning: {@link FLUIDGRIDS_EVENTS_VERSION} follows semver.
797
- * - A new event name, or a new optional payload field, is a minor bump.
798
- * - Removing or renaming an event, removing a payload field, or changing a
799
- * field's type or meaning is a major bump (and a breaking SDK release).
800
- *
801
- * Delivery: events are synchronous and best effort. A handler that throws is
802
- * caught and logged with a warning; it never breaks the SDK action that
803
- * emitted the event.
804
- *
805
- * @module events/eventBus
806
- */
807
- /** Version of the host event contract. See the module note for the rules. */
808
- const FLUIDGRIDS_EVENTS_VERSION = "1.1.0";
809
- /** Every host event name, in documentation order. */
810
- const FLUIDGRIDS_EVENT_NAMES = [
811
- "workflow:saved",
812
- "workflow:activated",
813
- "run:started",
814
- "run:completed",
815
- "node:selected",
816
- "error",
817
- "auth:failed",
818
- "builder:fullscreen"
819
- ];
820
- /** Drop undefined keys so hosts see only the fields that are known. */
821
- function withoutUndefined(payload) {
822
- return Object.fromEntries(Object.entries(payload).filter(([, value]) => value !== void 0));
823
- }
824
- /**
825
- * Deliver one host event. Never throws: a missing handler is a no-op and a
826
- * handler that throws is logged, so SDK code can call this anywhere.
827
- */
828
- function emitFluidGridsEvent(name, payload) {
829
- let handler;
830
- try {
831
- handler = config.onEvent;
832
- } catch {
833
- return;
834
- }
835
- if (typeof handler !== "function") return;
836
- try {
837
- const args = [name, withoutUndefined(payload)];
838
- handler(...args);
839
- } catch (error) {
840
- console.warn(`[FluidGrids SDK] onEvent handler failed for ${name}`, error);
841
- }
842
- }
843
- /**
844
- * Emit an `error` event for a failed SDK operation: the user-presentable
845
- * message and, when the gateway sent one, its error code.
846
- */
847
- function emitOperationErrorEvent(source, error) {
848
- emitFluidGridsEvent("error", {
849
- source,
850
- message: describeOperationError(error),
851
- code: operationErrorCode(error)
852
- });
853
- }
854
- const MAX_COMPLETED_RUNS = 500;
855
- const completedRuns = /* @__PURE__ */ new Set();
856
- /**
857
- * Emit `run:completed` once per run id. Later calls for the same run (a
858
- * second poll that sees the terminal status, a remounted builder following
859
- * the same run) are ignored.
860
- */
861
- function emitRunCompletedOnce(payload) {
862
- if (!payload.runId || completedRuns.has(payload.runId)) return;
863
- completedRuns.add(payload.runId);
864
- if (completedRuns.size > MAX_COMPLETED_RUNS) {
865
- const oldest = completedRuns.values().next().value;
866
- if (oldest !== void 0) completedRuns.delete(oldest);
867
- }
868
- emitFluidGridsEvent("run:completed", payload);
869
- }
870
-
871
- // src/graphql/token-refresh-link.ts
872
- /**
873
- * Token refresh on expiry (BOFF-9961).
874
- *
875
- * Workspace tokens are short-lived, so a builder left open outlives the token
876
- * it was mounted with. The gateway then answers 401 with a GraphQL
877
- * `UNAUTHENTICATED` error (category `CREDENTIAL_EXPIRED` / `_REVOKED`). This
878
- * link catches that, asks the host for a fresh token through
879
- * `auth.onTokenExpired`, stores it in the SDK config, and retries the failed
880
- * operation once with the new headers.
881
- *
882
- * Rules:
883
- * - one refresh at a time: operations that fail while a refresh is running
884
- * wait for the same promise instead of calling the host again, and an
885
- * operation that was sent before a refresh finished retries with the
886
- * token that refresh produced;
887
- * - each operation is retried at most once, so a token the gateway keeps
888
- * refusing can never loop;
889
- * - when the host cannot refresh (the callback rejects or returns no token),
890
- * `auth:failed` is emitted and the operation fails with its ORIGINAL error;
891
- * - an operation sent before a refresh attempt that has since FAILED does
892
- * not start a new one: its 401 is the same expired session that attempt
893
- * already reported, so it fails with its original error and no second
894
- * `auth:failed`. Only an operation sent after the failure (the host may
895
- * have recovered, e.g. the user signed in again) may try a fresh refresh.
896
- *
897
- * @module graphql/token-refresh-link
898
- */
899
- let inFlight = null;
900
- let refreshGeneration = 0;
901
- let lastRefreshed = null;
902
- let settledAttempts = 0;
903
- let lastFailedAttempt = 0;
904
- function normalizeTokens(value) {
905
- if (typeof value === "string") return value.trim() ? { authToken: value } : null;
906
- if (!value || typeof value !== "object") return null;
907
- const tokens = {};
908
- if (typeof value.authToken === "string" && value.authToken.trim()) tokens.authToken = value.authToken;
909
- if (typeof value.workspaceToken === "string" && value.workspaceToken.trim()) tokens.workspaceToken = value.workspaceToken;
910
- return tokens.authToken || tokens.workspaceToken ? tokens : null;
911
- }
912
- function storeInConfig(tokens) {
913
- setFluidGridsConfig(tokens);
914
- }
915
- /**
916
- * Run the host refresh callback, sharing one call between concurrent
917
- * failures. Resolves with the fresh tokens, or null when the host could not
918
- * provide any (after emitting `auth:failed`).
919
- */
920
- function refreshTokens(callback, store) {
921
- if (inFlight) return inFlight;
922
- const fail = (message) => {
923
- settledAttempts += 1;
924
- lastFailedAttempt = settledAttempts;
925
- emitFluidGridsEvent("auth:failed", { message });
926
- return null;
927
- };
928
- const run = (async () => {
929
- try {
930
- const tokens = normalizeTokens(await callback());
931
- if (!tokens) return fail("onTokenExpired returned no token.");
932
- store(tokens);
933
- settledAttempts += 1;
934
- refreshGeneration += 1;
935
- lastRefreshed = tokens;
936
- return tokens;
937
- } catch (error) {
938
- return fail(describeOperationError(error, "Token refresh failed."));
939
- }
940
- })();
941
- inFlight = run;
942
- run.finally(() => {
943
- if (inFlight === run) inFlight = null;
944
- });
945
- return run;
946
- }
947
- function withTokenHeaders(headers, tokens) {
948
- return {
949
- ...headers,
950
- ...tokens.authToken && { authorization: `Bearer ${tokens.authToken}` },
951
- ...tokens.workspaceToken && { "x-workspace-authorization": `Bearer ${tokens.workspaceToken}` }
952
- };
953
- }
954
- function resultIsUnauthenticated(result) {
955
- return hasUnauthenticatedGraphQLError(result.errors);
956
- }
957
- /**
958
- * Apollo link that refreshes an expired token and retries once.
959
- *
960
- * The SDK adds it to the clients it creates (`createFluidGridsClient`,
961
- * `createGlobalStoreClient`, `createFluidGridsClients`). Hosts that inject
962
- * their own Apollo client add it to their chain, BEFORE the link that sets the
963
- * `authorization` header, and either read the token from the SDK config in
964
- * that link or pass `onTokenRefreshed`:
965
- *
966
- * ```ts
967
- * const link = ApolloLink.from([
968
- * createFluidGridsTokenRefreshLink(),
969
- * authLink, // reads getFluidGridsConfig().authToken per request
970
- * httpLink,
971
- * ]);
972
- * ```
973
- *
974
- * The retried operation also carries the new token in its own headers, so it
975
- * works when the host's auth link runs first, too — as long as that link
976
- * does not overwrite an `authorization` header it finds.
977
- */
978
- function createFluidGridsTokenRefreshLink(options = {}) {
979
- return new ApolloLink((operation, forward) => {
980
- const store = options.onTokenRefreshed ?? storeInConfig;
981
- return new Observable((observer) => {
982
- const sentInGeneration = refreshGeneration;
983
- const sentAfterAttempts = settledAttempts;
984
- let retried = false;
985
- let closed = false;
986
- let current = null;
987
- const pickRefresh = (callback) => {
988
- if (refreshGeneration !== sentInGeneration && lastRefreshed) return Promise.resolve(lastRefreshed);
989
- if (lastFailedAttempt > sentAfterAttempts) return Promise.resolve(null);
990
- return refreshTokens(callback, store);
991
- };
992
- const retryOrFail = (fail) => {
993
- const callback = options.onTokenExpired ?? config.auth?.onTokenExpired;
994
- if (!callback) return false;
995
- retried = true;
996
- current?.unsubscribe();
997
- current = null;
998
- pickRefresh(callback).then((tokens) => {
999
- if (closed) return;
1000
- if (!tokens) {
1001
- fail();
1002
- return;
1003
- }
1004
- const headers = operation.getContext().headers;
1005
- operation.setContext({ headers: withTokenHeaders(headers && typeof headers === "object" ? headers : void 0, tokens) });
1006
- subscribe();
1007
- });
1008
- return true;
1009
- };
1010
- const subscribe = () => {
1011
- let refreshing = false;
1012
- current = forward(operation).subscribe({
1013
- next: (result) => {
1014
- if (!retried && resultIsUnauthenticated(result) && retryOrFail(() => {
1015
- observer.next(result);
1016
- observer.complete();
1017
- })) {
1018
- refreshing = true;
1019
- return;
1020
- }
1021
- observer.next(result);
1022
- },
1023
- error: (error) => {
1024
- if (!retried && isUnauthenticatedError(error) && retryOrFail(() => observer.error(error))) {
1025
- refreshing = true;
1026
- return;
1027
- }
1028
- observer.error(error);
1029
- },
1030
- complete: () => {
1031
- if (!refreshing) observer.complete();
1032
- }
1033
- });
1034
- };
1035
- subscribe();
1036
- return () => {
1037
- closed = true;
1038
- current?.unsubscribe();
1039
- };
1040
- });
1041
- });
1042
- }
1043
-
1044
- // src/graphql/client.ts
1045
- let clientInstance = null;
1046
- /**
1047
- * Create a new Apollo client for FluidGrids SDK.
1048
- *
1049
- * Tokens are read per request: the client starts with `config.authToken` /
1050
- * `config.workspaceToken` and follows any token set later in the SDK config
1051
- * (see `auth.onTokenExpired`). Expired-token responses are refreshed and
1052
- * retried once by `createFluidGridsTokenRefreshLink`; the websocket reads the
1053
- * current token whenever it (re)connects.
1054
- */
1055
- function createFluidGridsClient(config) {
1056
- const graphqlUrl = getGraphQLUrl(config.apiGatewayUrl);
1057
- const wsUrl = graphqlUrl.replace(/^http/, "ws");
1058
- const readTokens = createLiveTokenReader({
1059
- authToken: config.authToken,
1060
- workspaceToken: config.workspaceToken
1061
- });
1062
- const httpLink = createHttpLink({ uri: graphqlUrl });
1063
- const authLink = setContext((_, { headers }) => {
1064
- const { authToken, workspaceToken } = readTokens();
1065
- return { headers: {
1066
- ...headers,
1067
- ...authToken && { authorization: `Bearer ${authToken}` },
1068
- ...workspaceToken && { "x-workspace-authorization": `Bearer ${workspaceToken}` },
1069
- "x-workspace-id": config.workspaceId,
1070
- ...config.tenantId && { "x-tenant-id": config.tenantId },
1071
- ...config.productId && { "x-product-id": config.productId }
1072
- } };
1073
- });
1074
- const wsLink = new GraphQLWsLink(createClient({
1075
- url: wsUrl,
1076
- connectionParams: () => {
1077
- const { authToken, workspaceToken } = readTokens();
1078
- return {
1079
- authorization: authToken ? `Bearer ${authToken}` : "",
1080
- ...workspaceToken && { "x-workspace-authorization": `Bearer ${workspaceToken}` },
1081
- "x-workspace-id": config.workspaceId,
1082
- ...config.tenantId && { "x-tenant-id": config.tenantId },
1083
- ...config.productId && { "x-product-id": config.productId }
1084
- };
1085
- }
1086
- }));
1087
- const splitLink = split(({ query }) => {
1088
- const definition = getMainDefinition(query);
1089
- return definition.kind === "OperationDefinition" && definition.operation === "subscription";
1090
- }, wsLink, createFluidGridsTokenRefreshLink().concat(authLink).concat(httpLink));
1091
- return new ApolloClient({
1092
- link: splitLink,
1093
- cache: new InMemoryCache(),
1094
- defaultOptions: {
1095
- watchQuery: { fetchPolicy: "cache-and-network" },
1096
- query: { fetchPolicy: "network-only" }
1097
- }
1098
- });
1099
- }
1100
- /**
1101
- * Get the GraphQL URL from the API gateway URL
1102
- */
1103
- function getGraphQLUrl(apiGatewayUrl) {
1104
- const normalizedBase = apiGatewayUrl.endsWith("/") ? apiGatewayUrl.slice(0, -1) : apiGatewayUrl;
1105
- if (normalizedBase.endsWith("/graphql")) return normalizedBase;
1106
- return `${normalizedBase}/workspaces/graphql`;
1107
- }
1108
- /**
1109
- * Set the module-level client (for SDK-managed mode or wrapper injection)
1110
- */
1111
- function setFluidGridsClient(client) {
1112
- clientInstance = client;
1113
- }
1114
- /**
1115
- * Get the module-level client
1116
- * @throws Error if client is not initialized
1117
- */
1118
- function getFluidGridsClient() {
1119
- if (!clientInstance) throw new Error("FluidGrids client not initialized. Use FluidGridsProvider or call setFluidGridsClient().");
1120
- return clientInstance;
1121
- }
1122
- /**
1123
- * Get the client if available, or null if not initialized
1124
- */
1125
- function getFluidGridsClientSafe() {
1126
- return clientInstance;
1127
- }
1128
- /**
1129
- * Check if the client is ready
1130
- */
1131
- function isFluidGridsClientReady() {
1132
- return clientInstance !== null;
1133
- }
1134
- /**
1135
- * Wait for the client to be initialized
1136
- */
1137
- function waitForFluidGridsClient(timeoutMs = 1e4, intervalMs = 100) {
1138
- return new Promise((resolve) => {
1139
- if (clientInstance) {
1140
- resolve(clientInstance);
1141
- return;
1142
- }
1143
- const start = Date.now();
1144
- const timer = setInterval(() => {
1145
- if (clientInstance) {
1146
- clearInterval(timer);
1147
- resolve(clientInstance);
1148
- } else if (Date.now() - start >= timeoutMs) {
1149
- clearInterval(timer);
1150
- resolve(null);
1151
- }
1152
- }, intervalMs);
1153
- });
1154
- }
1155
- /**
1156
- * Reset the client reference (for cleanup on unmount)
1157
- */
1158
- function resetFluidGridsClient() {
1159
- clientInstance = null;
1160
- }
1161
-
1162
2
  // src/generated/graphql-operation-types.ts
1163
3
  const AgentStepFieldsFragmentDoc = {
1164
4
  "kind": "Document",
@@ -53304,37 +52144,4 @@ const DataTablesTagsDocument = {
53304
52144
  }
53305
52145
  };
53306
52146
 
53307
- // src/utils/node-endpoint-configs.ts
53308
- const NODE_CONFIG_PAGE_SIZE = 500;
53309
- /** Stops a server that keeps answering `hasMore: true` from looping forever. */
53310
- const NODE_CONFIG_MAX_PAGES = 20;
53311
- /**
53312
- * `query` is any `nodeEndpointConfigs` document with the same variables: the builder
53313
- * palette uses a listing without the operations JSON (BOFF-10387).
53314
- */
53315
- async function fetchAllNodeEndpointConfigs(client, filters = {}, fetchPolicy = "network-only", query = NodeEndpointConfigsDocument) {
53316
- const byId = /* @__PURE__ */ new Map();
53317
- let offset = 0;
53318
- for (let page = 0; page < 20; page++) {
53319
- const { data } = await client.query({
53320
- query,
53321
- variables: {
53322
- ...filters,
53323
- pagination: {
53324
- limit: 500,
53325
- offset
53326
- }
53327
- },
53328
- fetchPolicy
53329
- });
53330
- const result = data?.nodeEndpointConfigs;
53331
- const configs = result?.configs ?? [];
53332
- for (const config of configs) if (config?.id && !byId.has(config.id)) byId.set(config.id, config);
53333
- if (!result?.pagination?.hasMore || configs.length === 0) return [...byId.values()];
53334
- offset += configs.length;
53335
- }
53336
- console.warn(`[Workflows] Stopped loading node configs after ${20} pages; the catalog may be incomplete.`);
53337
- return [...byId.values()];
53338
- }
53339
-
53340
- export { DismissRunFailureClusterDocument as $, FLUIDGRIDS_THEME_TOKEN_MAP as $i, UnpinNodeDataDocument as $n, WorkflowRunMetadataDocument as $r, RenameWorkflowFolderDocument as $t, CreateWorkerTokenDocument as A, isFluidGridsClientReady as Ai, SetWorkerTokenConnectionAllowlistDocument as An, WorkflowDefinitionsTagsDocument as Ar, NodeManifestsDocument as At, DataTablesTagsDocument as B, describeOperationError as Bi, TagFluidgridsEntityDocument as Bn, WorkflowGitRepositoryDocument as Br, PinNodeDataDocument as Bt, CodecServerSettingsDocument as C, WorkflowVersionsDocument as Ci, RunWorkflowTestsDocument as Cn, WorkflowBatchOperationsDocument as Cr, LinkWorkflowGitRepositoryDocument as Ct, CreateActivityPauseRuleDocument as D, createFluidGridsClient as Di, SearchFluidgridsTagsDocument as Dn, WorkflowDefinitionDocument as Dr, NodeEndpointConfigDocument as Dt, ContinuousOptimisationSettingsFieldsFragmentDoc as E, WorkspaceRunsQuotaDocument as Ei, SaveWorkflowDraftDocument as En, WorkflowCodeSourceDocument as Er, MoveWorkflowFolderDocument as Et, CreateWorkflowSignalTokenDocument as F, FLUIDGRIDS_EVENTS_VERSION as Fi, SnoozeOptimisationSuggestionDocument as Fn, WorkflowGenerationDocument as Fr, OptimisationSuggestionFieldsFragmentDoc as Ft, DeleteWorkflowDefinitionDocument as G, config as Gi, TaskQueuesDocument as Gn, WorkflowProposalDocument as Gr, ProposeWorkflowChangeDocument as Gt, DeleteActivityPauseRuleDocument as H, isUnauthenticatedError as Hi, TaskQueueFieldsFragmentDoc as Hn, WorkflowPinnedDataDocument as Hr, PreviewScheduleDocument as Ht, CreateWorkflowTestCaseDocument as I, FLUIDGRIDS_EVENT_NAMES as Ii, StartBatchExportDocument as In, WorkflowGenerationTemplatesDocument as Ir, OptimisationSuggestionsDocument as It, DeleteWorkflowRolloutDocument as J, getGraphQLEndpoint as Ji, TriggerWorkflowDocument as Jn, WorkflowRunDocument as Jr, RegisterNodeDocument as Jt, DeleteWorkflowFolderDocument as K, config_exports as Ki, TerminateExecutionDocument as Kn, WorkflowRolloutFieldsFragmentDoc as Kr, PushWorkflowToGitDocument as Kt, CreateWorkflowTestCaseFromRunDocument as L, emitFluidGridsEvent as Li, StartBatchOperationDocument as Ln, WorkflowGitCommitsDocument as Lr, PauseActivityDocument as Lt, CreateWorkflowFolderDocument as M, setFluidGridsClient as Mi, SetWorkflowRunVersioningOverrideDocument as Mn, WorkflowEditLeaseStatusDocument as Mr, NodeSchemaIntrospectionDocument as Mt, CreateWorkflowProjectDocument as N, waitForFluidGridsClient as Ni, ShareWorkflowDocument as Nn, WorkflowEnvironmentsDocument as Nr, NodeStatesDocument as Nt, CreateFluidgridsTagDocument as O, getFluidGridsClient as Oi, SetContinuousOptimisationEnabledDocument as On, WorkflowDefinitionForBuilderDocument as Or, NodeEndpointConfigsDocument as Ot, CreateWorkflowSearchAttributeDocument as P, createFluidGridsTokenRefreshLink as Pi, SignalWorkflowRunDocument as Pn, WorkflowFoldersDocument as Pr, NodeUsageStatusDocument as Pt, DismissOptimisationSuggestionDocument as Q, validateTrustedOrigin as Qi, UnpauseWorkflowScheduleDocument as Qn, WorkflowRunHistoryDocument as Qr, RemoveNodeFromWorkflowsDocument as Qt, CreateWorkflowVersionDocument as R, emitOperationErrorEvent as Ri, StartBatchTerminateDocument as Rn, WorkflowGitDiffDocument as Rr, PauseExecutionDocument as Rt, CancelWorkflowProposalDocument as S, WorkflowVersioningDocument as Si, RunLogsDocument as Sn, WorkflowBatchOperationUpdatedDocument as Sr, ImportWorkflowTemplateDocument as St, ContinuousOptimisationSettingsDocument as T, WorkspaceAiUsageDocument as Ti, SandboxWorkflowWorkerFieldsFragmentDoc as Tn, WorkflowCodeBundleSdkDocument as Tr, ManagedAiWorkspacePolicyDocument as Tt, DeleteTaskQueueDocument as U, throwIfResultError as Ui, TaskQueueKindStatsFieldsFragmentDoc as Un, WorkflowProjectsDocument as Ur, ProposeOptimisationDocument as Ut, DeactivateWorkflowDefinitionDocument as V, isForbiddenError as Vi, TakeOverWorkflowEditLeaseDocument as Vn, WorkflowNotificationSettingsDocument as Vr, PreviewN8nImportDocument as Vt, DeleteWorkerTokenDocument as W, createLiveTokenReader as Wi, TaskQueueStatsDocument as Wn, WorkflowPromotionRequestsDocument as Wr, ProposeRunFixDocument as Wt, DeleteWorkflowTestCaseDocument as X, resetFluidGridsExecutionState as Xi, UnlinkWorkflowGitRepositoryDocument as Xn, WorkflowRunHierarchyDocument as Xr, RejectWorkflowProposalDocument as Xt, DeleteWorkflowSearchAttributeDocument as Y, resetFluidGridsConfig as Yi, TriggerWorkflowScheduleDocument as Yn, WorkflowRunEventFieldsFragmentDoc as Yr, RejectWorkflowPromotionDocument as Yt, DeployWorkflowVersionToDevDocument as Z, setFluidGridsConfig as Zi, UnpauseActivityDocument as Zn, WorkflowRunHistoryArchiveDocument as Zr, ReleaseWorkflowEditLeaseDocument as Zt, BulkMoveWorkflowsToFolderDocument as _, WorkflowTestRunFieldsFragmentDoc as _i, RunFailureTriageSettingsDocument as _n, WorkflowActivityPauseRulesDocument as _r, FluidgridsAvailableTagFieldsFragmentDoc as _t, ActiveExecutionsDocument as a, useExecutionsStore as aa, WorkflowScheduleDescribeDocument as ai, ResetWorkflowRunToLastCleanTaskDocument as an, UpdateManagedAiWorkspacePolicyDocument as ar, EventRegistrationsDocument as at, CancelWorkflowGenerationDocument as b, WorkflowVersionDiffDocument as bi, RunLogAppendedDocument as bn, WorkflowBatchJobFieldsFragmentDoc as br, GenerateWorkflowFromPromptDocument as bt, AgentTraceDocument as c, WorkflowSearchAttributeFieldsFragmentDoc as ci, ResumeExecutionDocument as cn, UpdateWorkflowEnvironmentPolicyDocument as cr, ExecutionLogsDocument as ct, ArchiveSettingsDocument as d, WorkflowSignalTokenFieldsFragmentDoc as di, RotateWorkerTokenDocument as dn, UpdateWorkflowTestCaseDocument as dr, ExplainRunDocument as dt, applyFluidGridsTheme as ea, WorkflowRunPendingDocument as ei, RenameWorkflowProjectDocument as en, UntagFluidgridsEntityDocument as er, DuplicateWorkflowDocument as et, AvailableFluidgridsTagsDocument as f, WorkflowSignalTokensDocument as fi, RunAiUsageDocument as fn, UpsertWorkflowRunSearchAttributesDocument as fr, ExportWorkflowCodeDocument as ft, BulkDeleteWorkflowsDocument as g, WorkflowTestRunDocument as gi, RunFailureClustersDocument as gn, WorkflowActivityPauseRuleFieldsFragmentDoc as gr, FileDownloadUrlDocument as gt, BulkAssignWorkflowsToProjectDocument as h, WorkflowTestCasesDocument as hi, RunEventAppendedDocument as hn, WorkerTokensDocument as hr, FgTriageFailedRunsDocument as ht, ActivateWorkflowVersionCheckedDocument as i, DEFAULT_EXECUTIONS_FILTER as ia, WorkflowRunsDocument as ii, ResetWorkflowRunDocument as in, UpdateDurableHistoryCapsDocument as ir, ErrorAnalyticsDocument as it, CreateWorkflowDefinitionDocument as j, resetFluidGridsClient as ji, SetWorkflowRolloutDocument as jn, WorkflowEditLeaseDocument as jr, NodePaletteEntriesDocument as jt, CreateTaskQueueDocument as k, getFluidGridsClientSafe as ki, SetRunFailureTriageEnabledDocument as kn, WorkflowDefinitionsDocument as kr, NodeManifestDocument as kt, ApplyWorkflowProposalDocument as l, WorkflowSearchAttributesDocument as li, RetryNodeDocument as ln, UpdateWorkflowNotificationSettingsDocument as lr, ExecutionStatsDocument as lt, BuildWorkflowCodeDocument as m, WorkflowTestCaseResultFieldsFragmentDoc as mi, RunControlFieldsDocument as mn, WebhookTestListenerDocument as mr, FgRunOptimisationScanDocument as mt, AcquireWorkflowEditLeaseDocument as n, themeKey as na, WorkflowRunUpdateDocument as ni, RequestWorkflowPromotionDocument as nn, UpdateArchiveSettingsDocument as nr, DurableParityRunFieldsDocument as nt, AgentStepFieldsFragmentDoc as o, __exportAll as oa, WorkflowScheduleDescriptionFieldsFragmentDoc as oi, RestoreWorkflowFromGitDocument as on, UpdateTaskQueueDocument as or, ExecuteStepDocument as ot, BackfillWorkflowScheduleDocument as p, WorkflowTestCaseFieldsFragmentDoc as pi, RunCodeReplaceFieldsFragmentDoc as pn, UsageTimeSeriesDocument as pr, FailActivityByIdDocument as pt, DeleteWorkflowProjectDocument as q, getFluidGridsConfig as qi, TerminateWorkflowRunDocument as qn, WorkflowRunDeterminismStatusDocument as qr, QueryWorkflowRunDocument as qt, ActivateWorkflowDefinitionDocument as r, themeToCssVariables as ra, WorkflowRunsCountDocument as ri, ResetActivityDocument as rn, UpdateCodecServerSettingsDocument as rr, DurableRunFieldsDocument as rt, AgentStepUpdatedDocument as s, WorkflowScheduleTickFieldsFragmentDoc as si, RestoreWorkflowVersionDocument as sn, UpdateWorkflowDefinitionDocument as sr, ExecutionDetailDocument as st, fetchAllNodeEndpointConfigs as t, sanitizeThemeValue as ta, WorkflowRunStackTraceDocument as ti, ReplaceFluidgridsEntityTagsDocument as tn, UpdateActivityOptionsDocument as tr, DurableHistoryCapsDocument as tt, ApproveWorkflowPromotionDocument as u, WorkflowSharingDocument as ui, RevokeWorkflowSignalTokenDocument as un, UpdateWorkflowRunDocument as ur, ExecutionsListDocument as ut, CancelBatchOperationDocument as v, WorkflowTestRunsDocument as vi, RunFromNodeDocument as vn, WorkflowArchiveSettingsFieldsFragmentDoc as vr, FluidgridsEntityTagsDocument as vt, CompleteActivityByIdDocument as w, WorkflowWorkersDocument as wi, SandboxWorkerTokenFieldsFragmentDoc as wn, WorkflowCallInputsDocument as wr, ListenForWebhookTestEventDocument as wt, CancelWorkflowPromotionDocument as x, WorkflowVersionDrainageDocument as xi, RunLogLineFieldsFragmentDoc as xn, WorkflowBatchOperationDocument as xr, ImportWorkflowDocument as xt, CancelExecutionDocument as y, WorkflowUpdateResultFieldsFragmentDoc as yi, RunFromNodeEligibilityDocument as yn, WorkflowAuthoringDocument as yr, FluidgridsTagAssignmentFieldsFragmentDoc as yt, DashboardSummaryDocument as z, emitRunCompletedOnce as zi, StopWebhookTestListenerDocument as zn, WorkflowGitPushesDocument as zr, PauseWorkflowScheduleDocument as zt };
52147
+ export { DuplicateWorkflowDocument as $, UntagFluidgridsEntityDocument as $n, WorkflowRunPendingDocument as $r, RenameWorkflowProjectDocument as $t, CreateWorkflowDefinitionDocument as A, SetWorkflowRolloutDocument as An, WorkflowEditLeaseDocument as Ar, NodePaletteEntriesDocument as At, DeactivateWorkflowDefinitionDocument as B, TakeOverWorkflowEditLeaseDocument as Bn, WorkflowNotificationSettingsDocument as Br, PreviewN8nImportDocument as Bt, CompleteActivityByIdDocument as C, WorkflowWorkersDocument as Ci, SandboxWorkerTokenFieldsFragmentDoc as Cn, WorkflowCallInputsDocument as Cr, ListenForWebhookTestEventDocument as Ct, CreateFluidgridsTagDocument as D, SetContinuousOptimisationEnabledDocument as Dn, WorkflowDefinitionForBuilderDocument as Dr, NodeEndpointConfigsDocument as Dt, CreateActivityPauseRuleDocument as E, SearchFluidgridsTagsDocument as En, WorkflowDefinitionDocument as Er, NodeEndpointConfigDocument as Et, CreateWorkflowTestCaseDocument as F, StartBatchExportDocument as Fn, WorkflowGenerationTemplatesDocument as Fr, OptimisationSuggestionsDocument as Ft, DeleteWorkflowFolderDocument as G, TerminateExecutionDocument as Gn, WorkflowRolloutFieldsFragmentDoc as Gr, PushWorkflowToGitDocument as Gt, DeleteTaskQueueDocument as H, TaskQueueKindStatsFieldsFragmentDoc as Hn, WorkflowProjectsDocument as Hr, ProposeOptimisationDocument as Ht, CreateWorkflowTestCaseFromRunDocument as I, StartBatchOperationDocument as In, WorkflowGitCommitsDocument as Ir, PauseActivityDocument as It, DeleteWorkflowSearchAttributeDocument as J, TriggerWorkflowScheduleDocument as Jn, WorkflowRunEventFieldsFragmentDoc as Jr, RejectWorkflowPromotionDocument as Jt, DeleteWorkflowProjectDocument as K, TerminateWorkflowRunDocument as Kn, WorkflowRunDeterminismStatusDocument as Kr, QueryWorkflowRunDocument as Kt, CreateWorkflowVersionDocument as L, StartBatchTerminateDocument as Ln, WorkflowGitDiffDocument as Lr, PauseExecutionDocument as Lt, CreateWorkflowProjectDocument as M, ShareWorkflowDocument as Mn, WorkflowEnvironmentsDocument as Mr, NodeStatesDocument as Mt, CreateWorkflowSearchAttributeDocument as N, SignalWorkflowRunDocument as Nn, WorkflowFoldersDocument as Nr, NodeUsageStatusDocument as Nt, CreateTaskQueueDocument as O, SetRunFailureTriageEnabledDocument as On, WorkflowDefinitionsDocument as Or, NodeManifestDocument as Ot, CreateWorkflowSignalTokenDocument as P, SnoozeOptimisationSuggestionDocument as Pn, WorkflowGenerationDocument as Pr, OptimisationSuggestionFieldsFragmentDoc as Pt, DismissRunFailureClusterDocument as Q, UnpinNodeDataDocument as Qn, WorkflowRunMetadataDocument as Qr, RenameWorkflowFolderDocument as Qt, DashboardSummaryDocument as R, StopWebhookTestListenerDocument as Rn, WorkflowGitPushesDocument as Rr, PauseWorkflowScheduleDocument as Rt, CodecServerSettingsDocument as S, WorkflowVersionsDocument as Si, RunWorkflowTestsDocument as Sn, WorkflowBatchOperationsDocument as Sr, LinkWorkflowGitRepositoryDocument as St, ContinuousOptimisationSettingsFieldsFragmentDoc as T, WorkspaceRunsQuotaDocument as Ti, SaveWorkflowDraftDocument as Tn, WorkflowCodeSourceDocument as Tr, MoveWorkflowFolderDocument as Tt, DeleteWorkerTokenDocument as U, TaskQueueStatsDocument as Un, WorkflowPromotionRequestsDocument as Ur, ProposeRunFixDocument as Ut, DeleteActivityPauseRuleDocument as V, TaskQueueFieldsFragmentDoc as Vn, WorkflowPinnedDataDocument as Vr, PreviewScheduleDocument as Vt, DeleteWorkflowDefinitionDocument as W, TaskQueuesDocument as Wn, WorkflowProposalDocument as Wr, ProposeWorkflowChangeDocument as Wt, DeployWorkflowVersionToDevDocument as X, UnpauseActivityDocument as Xn, WorkflowRunHistoryArchiveDocument as Xr, ReleaseWorkflowEditLeaseDocument as Xt, DeleteWorkflowTestCaseDocument as Y, UnlinkWorkflowGitRepositoryDocument as Yn, WorkflowRunHierarchyDocument as Yr, RejectWorkflowProposalDocument as Yt, DismissOptimisationSuggestionDocument as Z, UnpauseWorkflowScheduleDocument as Zn, WorkflowRunHistoryDocument as Zr, RemoveNodeFromWorkflowsDocument as Zt, CancelBatchOperationDocument as _, WorkflowTestRunsDocument as _i, RunFromNodeDocument as _n, WorkflowArchiveSettingsFieldsFragmentDoc as _r, FluidgridsEntityTagsDocument as _t, AgentStepFieldsFragmentDoc as a, WorkflowScheduleDescriptionFieldsFragmentDoc as ai, RestoreWorkflowFromGitDocument as an, UpdateTaskQueueDocument as ar, ExecuteStepDocument as at, CancelWorkflowPromotionDocument as b, WorkflowVersionDrainageDocument as bi, RunLogLineFieldsFragmentDoc as bn, WorkflowBatchOperationDocument as br, ImportWorkflowDocument as bt, ApplyWorkflowProposalDocument as c, WorkflowSearchAttributesDocument as ci, RetryNodeDocument as cn, UpdateWorkflowNotificationSettingsDocument as cr, ExecutionStatsDocument as ct, AvailableFluidgridsTagsDocument as d, WorkflowSignalTokensDocument as di, RunAiUsageDocument as dn, UpsertWorkflowRunSearchAttributesDocument as dr, ExportWorkflowCodeDocument as dt, WorkflowRunStackTraceDocument as ei, ReplaceFluidgridsEntityTagsDocument as en, UpdateActivityOptionsDocument as er, DurableHistoryCapsDocument as et, BackfillWorkflowScheduleDocument as f, WorkflowTestCaseFieldsFragmentDoc as fi, RunCodeReplaceFieldsFragmentDoc as fn, UsageTimeSeriesDocument as fr, FailActivityByIdDocument as ft, BulkMoveWorkflowsToFolderDocument as g, WorkflowTestRunFieldsFragmentDoc as gi, RunFailureTriageSettingsDocument as gn, WorkflowActivityPauseRulesDocument as gr, FluidgridsAvailableTagFieldsFragmentDoc as gt, BulkDeleteWorkflowsDocument as h, WorkflowTestRunDocument as hi, RunFailureClustersDocument as hn, WorkflowActivityPauseRuleFieldsFragmentDoc as hr, FileDownloadUrlDocument as ht, ActiveExecutionsDocument as i, WorkflowScheduleDescribeDocument as ii, ResetWorkflowRunToLastCleanTaskDocument as in, UpdateManagedAiWorkspacePolicyDocument as ir, EventRegistrationsDocument as it, CreateWorkflowFolderDocument as j, SetWorkflowRunVersioningOverrideDocument as jn, WorkflowEditLeaseStatusDocument as jr, NodeSchemaIntrospectionDocument as jt, CreateWorkerTokenDocument as k, SetWorkerTokenConnectionAllowlistDocument as kn, WorkflowDefinitionsTagsDocument as kr, NodeManifestsDocument as kt, ApproveWorkflowPromotionDocument as l, WorkflowSharingDocument as li, RevokeWorkflowSignalTokenDocument as ln, UpdateWorkflowRunDocument as lr, ExecutionsListDocument as lt, BulkAssignWorkflowsToProjectDocument as m, WorkflowTestCasesDocument as mi, RunEventAppendedDocument as mn, WorkerTokensDocument as mr, FgTriageFailedRunsDocument as mt, ActivateWorkflowDefinitionDocument as n, WorkflowRunsCountDocument as ni, ResetActivityDocument as nn, UpdateCodecServerSettingsDocument as nr, DurableRunFieldsDocument as nt, AgentStepUpdatedDocument as o, WorkflowScheduleTickFieldsFragmentDoc as oi, RestoreWorkflowVersionDocument as on, UpdateWorkflowDefinitionDocument as or, ExecutionDetailDocument as ot, BuildWorkflowCodeDocument as p, WorkflowTestCaseResultFieldsFragmentDoc as pi, RunControlFieldsDocument as pn, WebhookTestListenerDocument as pr, FgRunOptimisationScanDocument as pt, DeleteWorkflowRolloutDocument as q, TriggerWorkflowDocument as qn, WorkflowRunDocument as qr, RegisterNodeDocument as qt, ActivateWorkflowVersionCheckedDocument as r, WorkflowRunsDocument as ri, ResetWorkflowRunDocument as rn, UpdateDurableHistoryCapsDocument as rr, ErrorAnalyticsDocument as rt, AgentTraceDocument as s, WorkflowSearchAttributeFieldsFragmentDoc as si, ResumeExecutionDocument as sn, UpdateWorkflowEnvironmentPolicyDocument as sr, ExecutionLogsDocument as st, AcquireWorkflowEditLeaseDocument as t, WorkflowRunUpdateDocument as ti, RequestWorkflowPromotionDocument as tn, UpdateArchiveSettingsDocument as tr, DurableParityRunFieldsDocument as tt, ArchiveSettingsDocument as u, WorkflowSignalTokenFieldsFragmentDoc as ui, RotateWorkerTokenDocument as un, UpdateWorkflowTestCaseDocument as ur, ExplainRunDocument as ut, CancelExecutionDocument as v, WorkflowUpdateResultFieldsFragmentDoc as vi, RunFromNodeEligibilityDocument as vn, WorkflowAuthoringDocument as vr, FluidgridsTagAssignmentFieldsFragmentDoc as vt, ContinuousOptimisationSettingsDocument as w, WorkspaceAiUsageDocument as wi, SandboxWorkflowWorkerFieldsFragmentDoc as wn, WorkflowCodeBundleSdkDocument as wr, ManagedAiWorkspacePolicyDocument as wt, CancelWorkflowProposalDocument as x, WorkflowVersioningDocument as xi, RunLogsDocument as xn, WorkflowBatchOperationUpdatedDocument as xr, ImportWorkflowTemplateDocument as xt, CancelWorkflowGenerationDocument as y, WorkflowVersionDiffDocument as yi, RunLogAppendedDocument as yn, WorkflowBatchJobFieldsFragmentDoc as yr, GenerateWorkflowFromPromptDocument as yt, DataTablesTagsDocument as z, TagFluidgridsEntityDocument as zn, WorkflowGitRepositoryDocument as zr, PinNodeDataDocument as zt };