@burdenoff/fluidgrids-fe-sdk 2026.1111.16 → 2026.1111.18

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 (119) hide show
  1. package/README.md +41 -0
  2. package/dist/AiStudioPage-BHVEU4Wp.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-CJLZvv4J.js} +743 -773
  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-FayF6jxh.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-CPnXEL5J.js +555 -0
  39. package/dist/{WorkflowSearchRedirect-CaoOOpEl.js → WorkflowBuilder-YXRysvZc.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-mbIwRQUY.js +168 -0
  43. package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
  44. package/dist/{WorkflowsList-B2j1Pehb.js → WorkflowsList-DiiGyZkT.js} +12 -6
  45. package/dist/agent-form-Bfvm32j1.js +83 -0
  46. package/dist/{agentTools-DJ5o2ekg.js → agentTools-8s_25Q_F.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-B6pYARgU.js} +2 -2
  52. package/dist/client-C9XSzSXr.js +1147 -0
  53. package/dist/code-editor-field-9-GdVE_8.js +111 -0
  54. package/dist/{codec-client-DstqyzTN.js → codec-client-CJ95Rmqo.js} +1 -1
  55. package/dist/constants-B2lhWNoN.js +202 -0
  56. package/dist/constants-XdvUxeWK.d.ts +162 -0
  57. package/dist/dialog-Cjb4lB4D.js +105 -0
  58. package/dist/executions.d.ts +1 -1
  59. package/dist/executions.js +2 -1
  60. package/dist/feature-flags-DM5myWaD.js +296 -0
  61. package/dist/flags.d.ts +3 -0
  62. package/dist/flags.js +4 -0
  63. package/dist/{flow-builder-DEzT8TQu.js → flow-builder-CZDKRc6f.js} +662 -10716
  64. package/dist/{node-endpoint-configs-DHFGA5MQ.js → graphql-operation-types-kX-MMjgW.js} +1 -1194
  65. package/dist/{graphql-types-XcDLtFwU.js → graphql-types-CDKVWH2R.js} +2 -202
  66. package/dist/history.d.ts +1 -1
  67. package/dist/history.js +1 -1
  68. package/dist/{index-DRf25-D3.d.ts → index-6JR2vD9J.d.ts} +33 -215
  69. package/dist/index-72XFgvbn.d.ts +132 -0
  70. package/dist/index-BcdtKBM-.d.ts +56 -0
  71. package/dist/{index-B3BWqafN.d.ts → index-DjiFgEQl.d.ts} +5 -131
  72. package/dist/index.d.ts +13 -9
  73. package/dist/index.js +52 -5300
  74. package/dist/{node-detail-view-LNqeIqN-.js → node-detail-view-CV4ZRwqh.js} +13 -8
  75. package/dist/node-editor-tab-body-DU-dh35X.js +174 -0
  76. package/dist/node-endpoint-configs-B5bjNMDW.js +37 -0
  77. package/dist/node-registry-refresh-Dy0uRg9f.js +84 -0
  78. package/dist/nodes.d.ts +1 -1
  79. package/dist/nodes.js +1 -1
  80. package/dist/observability.d.ts +1 -1
  81. package/dist/observability.js +2 -1
  82. package/dist/popover-BJHvrFGR.js +472 -0
  83. package/dist/{quick-config-panel-D3ogsaFL.js → quick-config-panel-ws3pLvbt.js} +3 -2
  84. package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
  85. package/dist/run-display-BycKYSU0.js +46 -0
  86. package/dist/run-list-links-ByYC0OlV.js +98 -0
  87. package/dist/schedule-panel-C0mfGQSD.js +7542 -0
  88. package/dist/settings.d.ts +2 -1
  89. package/dist/settings.js +2 -1
  90. package/dist/shared-CMfn30xT.js +196 -0
  91. package/dist/sidebar-node-editor-CR1PiZO-.js +177 -0
  92. package/dist/templates.d.ts +1 -1
  93. package/dist/templates.js +2 -1
  94. package/dist/theme-provider-B3mIuz2d.js +11 -0
  95. package/dist/{useAgentDefinitions-NFtLytDR.js → useAgentDefinitions-B0dam3_o.js} +3 -397
  96. package/dist/useConnections-Cs7LCWEM.js +401 -0
  97. package/dist/useDurableParity-CzUQMFJ3.js +415 -0
  98. package/dist/useEntityTags-DhnsZcTl.js +236 -0
  99. package/dist/{useExecutions-DAzeWHS6.js → useExecutions-9aLuOt1c.js} +4 -3
  100. package/dist/{useObservability-COCZ0hUS.js → useObservability-CfEw3ZFD.js} +2 -2
  101. package/dist/{useRunHistory-CsYUbouO.js → useRunHistory-B1xJDwl1.js} +4 -3
  102. package/dist/{WorkflowShareDialog-6RRDe-_v.js → useWorkflowCodeExport-Bu2QYJzA.js} +7 -210
  103. package/dist/{useWorkflows-w4Dx2fF2.js → useWorkflows-BlVVu8NM.js} +3 -2
  104. package/dist/utils-uaL5UVxb.js +65 -0
  105. package/dist/workflow-builder.d.ts +1 -1
  106. package/dist/workflow-builder.js +4 -2
  107. package/dist/workflow-host.d.ts +6 -0
  108. package/dist/workflow-host.js +9 -0
  109. package/dist/workflow-pages.d.ts +55 -0
  110. package/dist/workflow-pages.js +113 -0
  111. package/dist/workflows-list.d.ts +1 -1
  112. package/dist/workflows-list.js +1 -1
  113. package/package.json +13 -1
  114. package/dist/ExecutionDetailPage-MvsnOnE1.d.ts +0 -4
  115. package/dist/HistoryPage-BqUizaFv.d.ts +0 -3
  116. package/dist/NodesPage-C97-9K2Y.d.ts +0 -3
  117. package/dist/TemplatesPage-D0qnXzHh.d.ts +0 -4
  118. package/dist/WorkflowsList-0d5GSKdh.d.ts +0 -3
  119. package/dist/agent-form-BvMWhQ42.js +0 -496
@@ -1,496 +0,0 @@
1
- "use client";
2
- import { Bi as describeOperationError, C as CodecServerSettingsDocument, Cr as WorkflowBatchOperationsDocument, D as CreateActivityPauseRuleDocument, F as CreateWorkflowSignalTokenDocument, H as DeleteActivityPauseRuleDocument, In as StartBatchExportDocument, Ln as StartBatchOperationDocument, Lt as PauseActivityDocument, Oi as getFluidGridsClient, P as CreateWorkflowSearchAttributeDocument, Qn as UnpauseWorkflowScheduleDocument, Rn as StartBatchTerminateDocument, Tr as WorkflowCodeBundleSdkDocument, Ui as throwIfResultError, Y as DeleteWorkflowSearchAttributeDocument, Yn as TriggerWorkflowScheduleDocument, Zn as UnpauseActivityDocument, Zr as WorkflowRunHistoryArchiveDocument, _r as WorkflowActivityPauseRulesDocument, ai as WorkflowScheduleDescribeDocument, an as ResetWorkflowRunToLastCleanTaskDocument, d as ArchiveSettingsDocument, fi as WorkflowSignalTokensDocument, fr as UpsertWorkflowRunSearchAttributesDocument, in as ResetWorkflowRunDocument, li as WorkflowSearchAttributesDocument, mn as RunControlFieldsDocument, ni as WorkflowRunUpdateDocument, nr as UpdateArchiveSettingsDocument, p as BackfillWorkflowScheduleDocument, pt as FailActivityByIdDocument, qt as QueryWorkflowRunDocument, rn as ResetActivityDocument, rr as UpdateCodecServerSettingsDocument, tr as UpdateActivityOptionsDocument, un as RevokeWorkflowSignalTokenDocument, ur as UpdateWorkflowRunDocument, v as CancelBatchOperationDocument, w as CompleteActivityByIdDocument, xr as WorkflowBatchOperationDocument, zt as PauseWorkflowScheduleDocument } from "./node-endpoint-configs-DHFGA5MQ.js";
3
- import { useCallback, useEffect, useRef, useState } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import { Label, Textarea } from "@burdenoff/fe-libs/ui";
6
-
7
- // src/graphql/typed-calls.ts
8
- async function readTyped(query, variables) {
9
- const result = await getFluidGridsClient().query({
10
- query,
11
- variables,
12
- fetchPolicy: "network-only"
13
- });
14
- throwIfResultError(result);
15
- if (!result.data) throw new Error("The request returned no data");
16
- return result.data;
17
- }
18
- async function writeTyped(mutation, variables) {
19
- const result = await getFluidGridsClient().mutate({
20
- mutation,
21
- variables
22
- });
23
- throwIfResultError(result);
24
- if (!result.data) throw new Error("The request returned no data");
25
- return result.data;
26
- }
27
-
28
- // src/modules/run-control/api.ts
29
- /**
30
- * Phase C run control (BOFF-9906): the reads and writes the run page, the
31
- * Runs list, Settings and the builder's schedule panel send. Each is a plain
32
- * network call through the shared FluidGrids client; the callers send them
33
- * only while the matching Phase C flag is on (usePhaseCFlags), so with every
34
- * flag off none of these operations is ever sent.
35
- */
36
- /**
37
- * A JSON scalar argument. Codegen types every JSON scalar as an object
38
- * record, but the service takes any JSON value (a string, a number, an
39
- * array); the value is sent as is, so this is the one place the generated
40
- * record type is widened.
41
- */
42
- function jsonArg(value) {
43
- if (value === void 0) return null;
44
- return value;
45
- }
46
- async function fetchRunControlFields(runId) {
47
- return (await readTyped(RunControlFieldsDocument, { id: runId })).workflowRun ?? null;
48
- }
49
- async function fetchRunHistoryArchive(runId) {
50
- return (await readTyped(WorkflowRunHistoryArchiveDocument, { runId })).workflowRunHistory;
51
- }
52
- async function queryRun(input) {
53
- return (await readTyped(QueryWorkflowRunDocument, {
54
- runId: input.runId,
55
- name: input.name,
56
- args: jsonArg(input.args),
57
- rejectCondition: input.rejectCondition ?? null
58
- })).queryWorkflowRun;
59
- }
60
- async function sendRunUpdate(input) {
61
- return (await writeTyped(UpdateWorkflowRunDocument, {
62
- runId: input.runId,
63
- name: input.name,
64
- args: jsonArg(input.args),
65
- updateId: input.updateId,
66
- waitFor: input.waitFor,
67
- timeoutMs: input.timeoutMs ?? null
68
- })).updateWorkflowRun;
69
- }
70
- async function fetchRunUpdate(runId, updateId) {
71
- return (await readTyped(WorkflowRunUpdateDocument, {
72
- runId,
73
- updateId
74
- })).workflowRunUpdate;
75
- }
76
- async function pauseActivities(input) {
77
- await writeTyped(PauseActivityDocument, input);
78
- }
79
- async function unpauseActivities(input) {
80
- await writeTyped(UnpauseActivityDocument, {
81
- runId: input.runId,
82
- selector: input.selector,
83
- resetAttempts: input.resetAttempts ?? false,
84
- resetHeartbeat: input.resetHeartbeat ?? false
85
- });
86
- }
87
- async function resetActivities(input) {
88
- await writeTyped(ResetActivityDocument, {
89
- runId: input.runId,
90
- selector: input.selector,
91
- resetHeartbeat: input.resetHeartbeat ?? false
92
- });
93
- }
94
- async function updateActivityOptions(input) {
95
- await writeTyped(UpdateActivityOptionsDocument, input);
96
- }
97
- async function completeActivityById(input) {
98
- return (await writeTyped(CompleteActivityByIdDocument, {
99
- runId: input.runId,
100
- activityId: input.activityId,
101
- result: jsonArg(input.result)
102
- })).completeActivityById;
103
- }
104
- async function failActivityById(input) {
105
- return (await writeTyped(FailActivityByIdDocument, input)).failActivityById;
106
- }
107
- /** The run the reset forked (the original is terminated with RESET). */
108
- async function resetRun(input) {
109
- return (await writeTyped(ResetWorkflowRunDocument, {
110
- runId: input.runId,
111
- to: input.to,
112
- reason: input.reason?.trim() || null,
113
- reapplySignals: input.reapplySignals ?? true,
114
- reapplyUpdates: input.reapplyUpdates ?? true
115
- })).resetWorkflowRun;
116
- }
117
- async function resetRunToLastCleanTask(input) {
118
- return (await writeTyped(ResetWorkflowRunToLastCleanTaskDocument, {
119
- runId: input.runId,
120
- reason: input.reason?.trim() || null
121
- })).resetWorkflowRunToLastCleanTask;
122
- }
123
- async function fetchSignalTokens(runId) {
124
- return (await readTyped(WorkflowSignalTokensDocument, { runId })).workflowSignalTokens;
125
- }
126
- async function createSignalToken(input) {
127
- return (await writeTyped(CreateWorkflowSignalTokenDocument, { input })).createWorkflowSignalToken;
128
- }
129
- async function revokeSignalToken(id) {
130
- return (await writeTyped(RevokeWorkflowSignalTokenDocument, { id })).revokeWorkflowSignalToken;
131
- }
132
- async function fetchSearchAttributes() {
133
- return (await readTyped(WorkflowSearchAttributesDocument, {})).workflowSearchAttributes;
134
- }
135
- async function createSearchAttribute(input) {
136
- return (await writeTyped(CreateWorkflowSearchAttributeDocument, { input: {
137
- name: input.name.trim(),
138
- type: input.type,
139
- description: input.description?.trim() || null
140
- } })).createWorkflowSearchAttribute;
141
- }
142
- async function deleteSearchAttribute(id) {
143
- return (await writeTyped(DeleteWorkflowSearchAttributeDocument, { id })).deleteWorkflowSearchAttribute;
144
- }
145
- async function upsertRunSearchAttributes(runId, attributes) {
146
- return (await writeTyped(UpsertWorkflowRunSearchAttributesDocument, {
147
- runId,
148
- attributes
149
- })).upsertWorkflowRunSearchAttributes.searchAttributes;
150
- }
151
- async function fetchPauseRules() {
152
- return (await readTyped(WorkflowActivityPauseRulesDocument, {})).workflowActivityPauseRules;
153
- }
154
- async function createPauseRule(input) {
155
- return (await writeTyped(CreateActivityPauseRuleDocument, { input })).createActivityPauseRule;
156
- }
157
- async function deletePauseRule(id) {
158
- return (await writeTyped(DeleteActivityPauseRuleDocument, { id })).deleteActivityPauseRule;
159
- }
160
- async function fetchCodecServerSettings() {
161
- return (await readTyped(CodecServerSettingsDocument, {})).workflowExecutionSettings ?? {
162
- __typename: "WorkflowExecutionSettings",
163
- codecServerUrl: null,
164
- codecServerIncludeCredentials: false
165
- };
166
- }
167
- async function saveCodecServerSettings(input) {
168
- return (await writeTyped(UpdateCodecServerSettingsDocument, input)).updateWorkflowExecutionSettings;
169
- }
170
- async function fetchArchiveSettings() {
171
- return (await readTyped(ArchiveSettingsDocument, {})).workflowExecutionSettings?.archive ?? null;
172
- }
173
- async function saveArchiveSettings(archive) {
174
- return (await writeTyped(UpdateArchiveSettingsDocument, {
175
- archive,
176
- clearArchive: null
177
- })).updateWorkflowExecutionSettings.archive ?? null;
178
- }
179
- async function clearArchiveSettings() {
180
- await writeTyped(UpdateArchiveSettingsDocument, {
181
- archive: null,
182
- clearArchive: true
183
- });
184
- }
185
- async function startBatchOperation(input) {
186
- return (await writeTyped(StartBatchOperationDocument, { input })).startBatchOperation;
187
- }
188
- async function startBatchTerminate(input) {
189
- return (await writeTyped(StartBatchTerminateDocument, { input })).startBatchTerminate;
190
- }
191
- async function startBatchExport(input) {
192
- return (await writeTyped(StartBatchExportDocument, { input })).startBatchExport;
193
- }
194
- async function cancelBatchOperation(id) {
195
- return (await writeTyped(CancelBatchOperationDocument, { id })).cancelBatchOperation;
196
- }
197
- async function fetchBatchOperation(id) {
198
- return (await readTyped(WorkflowBatchOperationDocument, { id })).workflowBatchOperation;
199
- }
200
- async function fetchBatchOperations(input) {
201
- const page = (await readTyped(WorkflowBatchOperationsDocument, {
202
- status: input.status ?? null,
203
- first: input.first ?? 20,
204
- after: input.after ?? null
205
- })).workflowBatchOperations;
206
- return {
207
- items: page.items,
208
- nextCursor: page.nextCursor ?? null
209
- };
210
- }
211
- async function describeSchedule(workflowKey, triggerNodeId) {
212
- return (await readTyped(WorkflowScheduleDescribeDocument, {
213
- workflowKey,
214
- triggerNodeId
215
- })).workflowScheduleDescribe;
216
- }
217
- async function triggerSchedule(input) {
218
- return (await writeTyped(TriggerWorkflowScheduleDocument, {
219
- workflowKey: input.workflowKey,
220
- triggerNodeId: input.triggerNodeId,
221
- overlapPolicy: input.overlapPolicy ?? null
222
- })).triggerWorkflowSchedule;
223
- }
224
- async function backfillSchedule(input) {
225
- return (await writeTyped(BackfillWorkflowScheduleDocument, {
226
- ...input,
227
- overlapPolicy: input.overlapPolicy ?? null
228
- })).backfillWorkflowSchedule;
229
- }
230
- async function pauseSchedule(input) {
231
- return (await writeTyped(PauseWorkflowScheduleDocument, {
232
- workflowKey: input.workflowKey,
233
- triggerNodeId: input.triggerNodeId,
234
- note: input.note?.trim() || null
235
- })).pauseWorkflowSchedule;
236
- }
237
- async function unpauseSchedule(input) {
238
- return (await writeTyped(UnpauseWorkflowScheduleDocument, input)).unpauseWorkflowSchedule;
239
- }
240
- async function fetchCodeBundleSdk(workflowKey, version) {
241
- return (await readTyped(WorkflowCodeBundleSdkDocument, {
242
- workflowKey,
243
- version
244
- })).workflowCodeBundle ?? null;
245
- }
246
-
247
- // src/modules/run-control/hooks/useResource.ts
248
- /**
249
- * A read keyed by its arguments that sends nothing while `enabled` is false,
250
- * keeps the last good answer, ignores answers to superseded requests, and
251
- * re-reads every `intervalMs` while `live`. The Phase C views use it so that
252
- * a gateway or service without the Phase C release only leaves a view empty.
253
- */
254
- function useResource(key, enabled, load, { live = false, intervalMs = 0 } = {}) {
255
- const [data, setData] = useState(null);
256
- const [loading, setLoading] = useState(false);
257
- const [error, setError] = useState(null);
258
- const request = useRef(0);
259
- const loadRef = useRef(load);
260
- loadRef.current = load;
261
- const active = enabled && key !== null;
262
- const refetch = useCallback(async () => {
263
- if (!enabled || key === null) return;
264
- const id = ++request.current;
265
- setLoading(true);
266
- try {
267
- const next = await loadRef.current();
268
- if (id !== request.current) return;
269
- setData(next);
270
- setError(null);
271
- } catch (err) {
272
- if (id !== request.current) return;
273
- setError(describeOperationError(err));
274
- } finally {
275
- if (id === request.current) setLoading(false);
276
- }
277
- }, [enabled, key]);
278
- useEffect(() => {
279
- request.current += 1;
280
- setData(null);
281
- setError(null);
282
- setLoading(false);
283
- refetch();
284
- }, [refetch]);
285
- useEffect(() => {
286
- if (!live || !active || intervalMs <= 0) return;
287
- const timer = setInterval(() => void refetch(), intervalMs);
288
- return () => clearInterval(timer);
289
- }, [
290
- live,
291
- active,
292
- intervalMs,
293
- refetch
294
- ]);
295
- const set = useCallback((value) => {
296
- request.current += 1;
297
- setData(value);
298
- setError(null);
299
- setLoading(false);
300
- }, []);
301
- return {
302
- data: active ? data : null,
303
- loading,
304
- error,
305
- refetch,
306
- set
307
- };
308
- }
309
-
310
- // src/modules/run-control/utils/json-input.ts
311
- function parseJsonInput(text) {
312
- const trimmed = text.trim();
313
- if (!trimmed) return {
314
- ok: true,
315
- value: void 0
316
- };
317
- try {
318
- return {
319
- ok: true,
320
- value: JSON.parse(trimmed)
321
- };
322
- } catch (error) {
323
- return {
324
- ok: false,
325
- error: error instanceof Error ? error.message : String(error)
326
- };
327
- }
328
- }
329
- /** Like {@link parseJsonInput}, but the value must be a JSON object. */
330
- function parseJsonObjectInput(text) {
331
- const parsed = parseJsonInput(text);
332
- if (!parsed.ok) return parsed;
333
- const value = parsed.value;
334
- if (typeof value !== "object" || value === null || Array.isArray(value)) return {
335
- ok: false,
336
- error: "Enter a JSON object, for example {\"key\": 1}"
337
- };
338
- return {
339
- ok: true,
340
- value: Object.fromEntries(Object.entries(value))
341
- };
342
- }
343
- /** Pretty JSON for display; `undefined` and `null` show as an em dash. */
344
- function formatJson(value) {
345
- if (value === void 0 || value === null) return "—";
346
- if (typeof value === "string") return JSON.stringify(value);
347
- return JSON.stringify(value, null, 2);
348
- }
349
- /** A fresh idempotency id for an update (kept while its dialog stays open). */
350
- function newRunControlId(prefix) {
351
- return `${prefix}-${typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`}`;
352
- }
353
-
354
- // src/modules/run-control/components/shared.tsx
355
- /** Dialog layers sit above the builder's canvas and the NDV (1100). */
356
- const RUN_CONTROL_DIALOG_STYLE = { zIndex: 1100 };
357
- function FieldError({ message, testId }) {
358
- if (!message) return null;
359
- return /* @__PURE__ */ jsx("p", {
360
- role: "alert",
361
- className: "text-sm text-[var(--color-status-error-text)]",
362
- "data-testid": testId,
363
- children: message
364
- });
365
- }
366
- function JsonField({ id, label, value, onChange, placeholder, error, rows = 4, testId }) {
367
- return /* @__PURE__ */ jsxs("div", {
368
- className: "space-y-1.5",
369
- children: [
370
- /* @__PURE__ */ jsx(Label, {
371
- htmlFor: id,
372
- children: label
373
- }),
374
- /* @__PURE__ */ jsx(Textarea, {
375
- id,
376
- value,
377
- onChange: (event) => onChange(event.target.value),
378
- placeholder,
379
- rows,
380
- className: "font-mono text-xs",
381
- "data-testid": testId
382
- }),
383
- /* @__PURE__ */ jsx(FieldError, { message: error })
384
- ]
385
- });
386
- }
387
- function JsonBlock({ value, testId }) {
388
- return /* @__PURE__ */ jsx("pre", {
389
- className: "max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-background-primary p-3 font-mono text-xs text-text-primary",
390
- "data-testid": testId,
391
- children: formatJson(value)
392
- });
393
- }
394
- function NativeSelect({ id, value, onChange, children, testId, disabled, ariaLabel }) {
395
- return /* @__PURE__ */ jsx("select", {
396
- id,
397
- value,
398
- disabled,
399
- "aria-label": ariaLabel,
400
- onChange: (event) => onChange(event.target.value),
401
- className: "h-9 w-full rounded-md border border-border-primary bg-background-primary px-2 text-sm text-text-primary",
402
- "data-testid": testId,
403
- children
404
- });
405
- }
406
- function StatusPill({ tone, children, testId }) {
407
- const classes = tone === "neutral" ? "border-border-secondary bg-background-tertiary text-text-secondary" : `border-[var(--color-status-${tone}-border)] bg-[var(--color-status-${tone}-bg-subtle)] text-[var(--color-status-${tone}-text)]`;
408
- return /* @__PURE__ */ jsx("span", {
409
- className: `inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${classes}`,
410
- "data-testid": testId,
411
- children
412
- });
413
- }
414
-
415
- // src/modules/agent-definitions/utils/agent-form.ts
416
- const MAX_GRANT_DAYS = 365;
417
- const MAX_TOOL_RULES = 100;
418
- const MAX_CONNECTIONS = 100;
419
- var AgentFormError = class extends Error {
420
- constructor(message) {
421
- super(message);
422
- this.name = "AgentFormError";
423
- }
424
- };
425
- function emptyAgentForm() {
426
- return {
427
- name: "",
428
- description: "",
429
- tools: [{
430
- nodeType: "",
431
- operations: ""
432
- }],
433
- connectionScope: [],
434
- requireToolApproval: false,
435
- status: "ACTIVE"
436
- };
437
- }
438
- function agentToForm(agent) {
439
- return {
440
- name: agent.name,
441
- description: agent.description ?? "",
442
- tools: agent.toolAllowlist.length > 0 ? agent.toolAllowlist.map((rule) => ({
443
- nodeType: rule.nodeType,
444
- operations: rule.operations.join(", ")
445
- })) : [{
446
- nodeType: "",
447
- operations: ""
448
- }],
449
- connectionScope: [...agent.connectionScope],
450
- requireToolApproval: agent.requireToolApproval,
451
- status: agent.status
452
- };
453
- }
454
- function splitOperations(value) {
455
- return [...new Set(value.split(",").map((operation) => operation.trim()).filter(Boolean))];
456
- }
457
- /** Validate the form and build the mutation input. Throws AgentFormError on invalid input. */
458
- function formToInput(form) {
459
- const name = form.name.trim();
460
- if (name.length === 0 || name.length > 200) throw new AgentFormError("Give the agent a name of 1 to 200 characters.");
461
- const description = form.description.trim();
462
- if (description.length > 2e3) throw new AgentFormError("The description must be at most 2000 characters.");
463
- const rules = form.tools.map((row) => ({
464
- nodeType: row.nodeType.trim(),
465
- operations: splitOperations(row.operations)
466
- })).filter((rule) => rule.nodeType.length > 0 || rule.operations.length > 0);
467
- if (rules.some((rule) => rule.nodeType.length === 0)) throw new AgentFormError("Every tool rule needs a node type.");
468
- if (rules.length > 100) throw new AgentFormError(`At most ${100} tool rules.`);
469
- const connectionScope = [...new Set(form.connectionScope.filter(Boolean))];
470
- if (connectionScope.length > 100) throw new AgentFormError(`At most ${100} connections.`);
471
- return {
472
- name,
473
- description: description || null,
474
- toolAllowlist: rules,
475
- connectionScope,
476
- requireToolApproval: form.requireToolApproval,
477
- status: form.status
478
- };
479
- }
480
- /** Whole days for a grant, or an error message when out of range. */
481
- function grantDays(value) {
482
- const days = Number(value);
483
- if (!Number.isInteger(days) || days < 1 || days > 365) throw new AgentFormError(`A grant lasts between 1 and ${365} days.`);
484
- return days;
485
- }
486
- /** "store/slack: postMessage, listChannels" / "store/notion: any operation". */
487
- function describeRule(rule) {
488
- return rule.operations.length > 0 ? `${rule.nodeType}: ${rule.operations.join(", ")}` : `${rule.nodeType}: any operation`;
489
- }
490
- /** Whether a node type is the AI Agent node (raw types carry a `store:` prefix and an op suffix). */
491
- function isAgentNodeType(nodeType) {
492
- if (!nodeType) return false;
493
- return nodeType === "store/ai-agent" || nodeType.includes("store/ai-agent");
494
- }
495
-
496
- export { startBatchTerminate as $, fetchBatchOperation as A, jsonArg as B, createSearchAttribute as C, describeSchedule as D, deleteSearchAttribute as E, fetchRunControlFields as F, resetRun as G, pauseSchedule as H, fetchRunHistoryArchive as I, saveArchiveSettings as J, resetRunToLastCleanTask as K, fetchRunUpdate as L, fetchCodeBundleSdk as M, fetchCodecServerSettings as N, failActivityById as O, fetchPauseRules as P, startBatchOperation as Q, fetchSearchAttributes as R, createPauseRule as S, deletePauseRule as T, queryRun as U, pauseActivities as V, resetActivities as W, sendRunUpdate as X, saveCodecServerSettings as Y, startBatchExport as Z, useResource as _, formToInput as a, readTyped as at, clearArchiveSettings as b, FieldError as c, NativeSelect as d, triggerSchedule as et, RUN_CONTROL_DIALOG_STYLE as f, parseJsonObjectInput as g, parseJsonInput as h, emptyAgentForm as i, upsertRunSearchAttributes as it, fetchBatchOperations as j, fetchArchiveSettings as k, JsonBlock as l, newRunControlId as m, agentToForm as n, unpauseSchedule as nt, grantDays as o, writeTyped as ot, StatusPill as p, revokeSignalToken as q, describeRule as r, updateActivityOptions as rt, isAgentNodeType as s, AgentFormError as t, unpauseActivities as tt, JsonField as u, backfillSchedule as v, createSignalToken as w, completeActivityById as x, cancelBatchOperation as y, fetchSignalTokens as z };