@burdenoff/fluidgrids-fe-sdk 2026.1112.7 → 2026.1112.9
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.
- package/dist/{AiStudioPage-QGTFaVpx.js → AiStudioPage-DfoV1Olc.js} +5 -5
- package/dist/ApprovalInboxPage-Bb8H9ruw.js +1317 -0
- package/dist/{DataSinkDashboardPage-kyzcjpzL.js → DataSinkDashboardPage-Dt3xTBb8.js} +1 -1
- package/dist/{DataTablesPage-0U89KNBt.js → DataTablesPage-Zz23QZQp.js} +6 -4
- package/dist/Disclosure-DQiUKrqd.js +41 -0
- package/dist/{EntityTagPicker-dxfzv8aO.js → EntityTagPicker-CuZAMby_.js} +1 -1
- package/dist/{ExecutionDetailPage-D4Mdbzb2.js → ExecutionDetailPage-CcUxFexZ.js} +15 -14
- package/dist/{ExecutionsListPage-g_SPxAGX.js → ExecutionsListPage-JpByw6nA.js} +11 -9
- package/dist/{FailureTriagePanel-D4lJ4zqQ.js → FailureTriagePanel-BjatYyAa.js} +1 -1
- package/dist/{FluidGridsProvider-B1hgCbxG.js → FluidGridsProvider-TQ-aDPtn.js} +3 -3
- package/dist/{HistoryPage-C7NwkVNC.js → HistoryPage-s9pl5gyl.js} +2 -2
- package/dist/{InsightsPage-D9B_qW8e.js → InsightsPage-CtjJCky-.js} +4 -4
- package/dist/{MissingNodesInstallModal-BkkgeFeN.js → MissingNodesInstallModal-olEc52p2.js} +1 -1
- package/dist/{NodesPage-BEeUbIts.js → NodesPage-BSNpOUMX.js} +2 -2
- package/dist/OpenTemplateAsCodeButton-Dh3ee2OR.js +94 -0
- package/dist/PaidTemplateConfirm-DjmVi_m-.js +28 -0
- package/dist/{RunActionsMenu-DmO14hEE.js → RunActionsMenu-BE_1r3bF.js} +1 -50
- package/dist/{RunnersPage-CvAPHdfU.js → RunnersPage-CAt4YDhB.js} +2 -1
- package/dist/{SettingsPage-k21044-Z.js → SettingsPage-ywyjIAL8.js} +6 -6
- package/dist/{TagFilterSelect-CqhxcDjh.js → TagFilterSelect-DcusTt1p.js} +1 -1
- package/dist/{TaskQueuesPage-B86p51gH.js → TaskQueuesPage-C2dkenVF.js} +2 -2
- package/dist/TechnicalDetails-D4xGy201.js +19 -0
- package/dist/{TemplateCard-DanOe65C.js → TemplateCard--WYJZlA_.js} +293 -36
- package/dist/{TemplateConfigurationModal-CeMpPEhT.js → TemplateConfigurationModal-cd0-QVMZ.js} +20 -11
- package/dist/{TemplateDetailPanel-DnoA6mC3.js → TemplateDetailPanel-C-2JuXg6.js} +1 -1
- package/dist/TemplatePreview-BCnGjMuN.js +646 -0
- package/dist/{TemplatesPage-C7f2xq12.js → TemplatesPage-u7bXJYfv.js} +377 -138
- package/dist/{VariablesPage-BtoLjmUA.js → VariablesPage-CPL34WBc.js} +2 -358
- package/dist/{VersionDiffDialog-pLpG_I1r.js → VersionDiffDialog-c27yet_-.js} +1 -1
- package/dist/{WorkflowBuilder-Aslfa2vj.js → WorkflowBuilder-BWxBmBoP.js} +3 -3
- package/dist/{WorkflowBuilder-DY1_KJiV.js → WorkflowBuilder-DxAAPHsn.js} +8 -8
- package/dist/{WorkflowProposalCard-BjYAZH3q.js → WorkflowProposalCard-BvmJ5ea8.js} +1 -1
- package/dist/{WorkflowSearchRedirect-iPQBL6WO.js → WorkflowSearchRedirect-BGKduhfZ.js} +1 -1
- package/dist/{WorkflowShareDialog-DB-qJLB2.js → WorkflowShareDialog-BRwTF9QB.js} +1 -1
- package/dist/{WorkflowsList-rOxlI49U.js → WorkflowsList-Bocag4TX.js} +9 -8
- package/dist/{agentTools-B8gnHFVM.js → agentTools-JHtYGgd7.js} +3 -3
- package/dist/{api-JpNuowX4.js → api-Dw8nfVRD.js} +1 -1
- package/dist/{api-Dvitj1aT.js → api-m8hX_l2k.js} +1 -1
- package/dist/{canvasNoteTools-Cj7MvVDH.js → canvasNoteTools-B2ouyIbj.js} +2 -2
- package/dist/{HumanRequestCard-lbWDpWd7.js → channel-CZ70oI81.js} +5 -228
- package/dist/{code-editor-field-yJZEDJBi.js → code-editor-field-CWGZyNGM.js} +1 -1
- package/dist/executions.js +2 -2
- package/dist/{feature-flags-DM5myWaD.js → feature-flags-B_b8PJ6Z.js} +63 -3
- package/dist/flags.d.ts +1 -1
- package/dist/flags.js +1 -1
- package/dist/{flow-builder-dvqpKs8d.js → flow-builder-DzKPrW2r.js} +535 -313
- package/dist/{graphql-operation-types-z2oXfQvM.js → graphql-operation-types-DZVhCBEi.js} +250 -1
- package/dist/history.js +1 -1
- package/dist/{index-BcdtKBM-.d.ts → index-B4g88tCa.d.ts} +15 -1
- package/dist/{index-DNo9aFUT.d.ts → index-CGCAcRKo.d.ts} +32 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +38 -38
- package/dist/{node-detail-view-ZnJ3Hvvo.js → node-detail-view-DNilUGcx.js} +9 -9
- package/dist/{node-editor-tab-body-BuiIr7VD.js → node-editor-tab-body-XBedxkpN.js} +3 -3
- package/dist/{node-endpoint-configs-typvqw2c.js → node-endpoint-configs-BI7zc8eM.js} +1 -1
- package/dist/nodes.js +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/observability.js +2 -2
- package/dist/{popover-mexhIFP3.js → popover-BC4r84K0.js} +3 -3
- package/dist/{quick-config-panel-EV66lJOM.js → quick-config-panel-BPmrhIOb.js} +3 -3
- package/dist/{schedule-panel-BeLfDNFh.js → schedule-panel-DJN1TDQH.js} +8 -8
- package/dist/settings.js +1 -1
- package/dist/{sidebar-node-editor-D85Moj5d.js → sidebar-node-editor-DKdfcd2r.js} +3 -3
- package/dist/templates.js +2 -2
- package/dist/{useAgentDefinitions-Uy6nhpKN.js → useAgentDefinitions-B4sw7bLw.js} +1 -1
- package/dist/{useDurableParity-04-5PTk2.js → useDurableParity-B3h8jqP0.js} +2 -2
- package/dist/{useEntityTags-D5C0tdLs.js → useEntityTags-BpDeLhzV.js} +1 -1
- package/dist/{useExecutions-DJXtbA15.js → useExecutions-BbkBSYpS.js} +2 -2
- package/dist/{useObservability-Dfgh4yjv.js → useObservability-BASo2sA3.js} +1 -1
- package/dist/{useRunHistory-BZQ3t68Q.js → useRunHistory-C3Pv_SJW.js} +2 -2
- package/dist/useVariables-cI8uLwye.js +361 -0
- package/dist/useWorkflowCodeExport-k5Emm4ZS.js +226 -0
- package/dist/{useWorkflows-CP-d3ygY.js → useWorkflows-CRUlQBd3.js} +2 -2
- package/dist/workflow-builder.js +4 -4
- package/dist/workflow-code-transfer-Cshsgf2H.js +375 -0
- package/dist/workflow-host.d.ts +1 -1
- package/dist/workflow-host.js +1 -1
- package/dist/workflow-pages.d.ts +1 -1
- package/dist/workflow-pages.js +19 -19
- package/dist/workflow-transfer-CQnQC-ke.js +104 -0
- package/dist/workflows-list.js +1 -1
- package/package.json +1 -1
- package/dist/ApprovalInboxPage-QAJim81n.js +0 -559
- package/dist/QuotaExhaustedDialog-Bj7AG_0y.js +0 -55
- package/dist/TemplatePreview-DY4GxnfC.js +0 -231
- package/dist/useWorkflowCodeExport-D0zapXXm.js +0 -643
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { B as NODE_TYPE_DRAG_DATA_FORMAT, G as isTriggerOperation, H as useFlowStore, M as isImageIcon, T as resolveInputHandles, U as useIsValidConnection, V as STICKY_NOTE_TYPE, j as NodeTypeIcon, r as CODE_WORKFLOW_NODE_TYPE, z as NODE_OPERATION_DRAG_DATA_FORMAT } from "./node-operation-selection-DAbS6jSY.js";
|
|
3
|
-
import { $t as AUTOSAVE_DEBOUNCE_MS, Bn as useMarkdownRenderer, Bt as leaseCallSequence, Cn as loadDefinitionJson, Ct as watchLeavingLosesChanges, D as InstallWorkflowNodeDocument, E as InstallPurchasedNodeDocument, Et as useSaveWorkflow, F as getNodeMetadata, Ft as useEditLeaseLocked, Gt as tickAction, H as MissingParametersDialog, Hn as useBuilderReadOnly, Ht as phaseAfterTakeOver, It as useEditLeaseStore, Jt as rememberSessionForReload, Kt as EDIT_SESSION_ID, Ln as getNodeDetail, Lt as bannerOf, M as UninstallOrganizationPrivateNodeDocument, Mt as saveIndicatorOf, N as UninstallWorkflowNodeDocument, Nt as useSaveStatusStore, Pt as workflowSaveQueue, Qt as revisionOf, Rn as buildStickyNode, Rt as isLocked, S as CreateStoreOrderDocument, St as touchesSavedFields, T as InstallOrganizationPrivateNodeDocument, Tt as useFlowValidator, U as useRunGuard, Ut as releasesOnClose, V as useInsertNode, Vn as BuilderReadOnlyProvider, Vt as phaseAfterAcquire, W as workflowParameterIssues, Wt as shouldReleaseForIdle, Xt as rememberOwnStatusChange, Yt as sessionBeforeReload, Zt as rememberRevision, _t as departingSave, a as NODES_METADATA, an as resettledBaseline, b as BrowseWorkflowNodesDocument, bn as useCanvasEdges, bt as leavingLosesChanges, cn as useNodeExecution, en as AUTOSAVE_RETRY_DELAYS_MS, f as isNodeConfigsInitialized, g as registerWorkflowNodeTypes, gt as autosaveAllowedFor, ht as useManualSave, i as AVAILABLE_NODES, in as inAppLeaveTarget, jt as refusalOfQuota, k as OrganizationPrivateNodesDocument, l as ensureNodeConfigsLoaded, m as refetchStoreNodes, mt as useGuardedNavigate, o as NODE_CONFIGS, on as saveFailureActionOf, p as onNodeTypesUpdate, qt as forgetSessionForReload, s as NODE_TYPES, sn as workflowFingerprint, t as FluidGridsContext, tn as canAutosave, v as scheduleNodePaletteLoad, vt as editStateFor, w as GetNodeInstallableVersionsDocument, wt as isFlowComplete, xn as useNodeRegistryRevision, xt as savedEverythingBeforeLeaving, yt as editingLeaseLocked, z as buildOperationSeed, zn as loadMarkdown, zt as leaseCallQueue } from "./FluidGridsProvider-
|
|
3
|
+
import { $t as AUTOSAVE_DEBOUNCE_MS, Bn as useMarkdownRenderer, Bt as leaseCallSequence, Cn as loadDefinitionJson, Ct as watchLeavingLosesChanges, D as InstallWorkflowNodeDocument, E as InstallPurchasedNodeDocument, Et as useSaveWorkflow, F as getNodeMetadata, Ft as useEditLeaseLocked, Gt as tickAction, H as MissingParametersDialog, Hn as useBuilderReadOnly, Ht as phaseAfterTakeOver, It as useEditLeaseStore, Jt as rememberSessionForReload, Kt as EDIT_SESSION_ID, Ln as getNodeDetail, Lt as bannerOf, M as UninstallOrganizationPrivateNodeDocument, Mt as saveIndicatorOf, N as UninstallWorkflowNodeDocument, Nt as useSaveStatusStore, Pt as workflowSaveQueue, Qt as revisionOf, Rn as buildStickyNode, Rt as isLocked, S as CreateStoreOrderDocument, St as touchesSavedFields, T as InstallOrganizationPrivateNodeDocument, Tt as useFlowValidator, U as useRunGuard, Ut as releasesOnClose, V as useInsertNode, Vn as BuilderReadOnlyProvider, Vt as phaseAfterAcquire, W as workflowParameterIssues, Wt as shouldReleaseForIdle, Xt as rememberOwnStatusChange, Yt as sessionBeforeReload, Zt as rememberRevision, _t as departingSave, a as NODES_METADATA, an as resettledBaseline, b as BrowseWorkflowNodesDocument, bn as useCanvasEdges, bt as leavingLosesChanges, cn as useNodeExecution, en as AUTOSAVE_RETRY_DELAYS_MS, f as isNodeConfigsInitialized, g as registerWorkflowNodeTypes, gt as autosaveAllowedFor, ht as useManualSave, i as AVAILABLE_NODES, in as inAppLeaveTarget, jt as refusalOfQuota, k as OrganizationPrivateNodesDocument, l as ensureNodeConfigsLoaded, m as refetchStoreNodes, mt as useGuardedNavigate, o as NODE_CONFIGS, on as saveFailureActionOf, p as onNodeTypesUpdate, qt as forgetSessionForReload, s as NODE_TYPES, sn as workflowFingerprint, t as FluidGridsContext, tn as canAutosave, v as scheduleNodePaletteLoad, vt as editStateFor, w as GetNodeInstallableVersionsDocument, wt as isFlowComplete, xn as useNodeRegistryRevision, xt as savedEverythingBeforeLeaving, yt as editingLeaseLocked, z as buildOperationSeed, zn as loadMarkdown, zt as leaseCallQueue } from "./FluidGridsProvider-TQ-aDPtn.js";
|
|
4
4
|
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
5
5
|
import { n as preloadableLazy } from "./preloadable-lazy-Pp47mqQ9.js";
|
|
6
6
|
import { a as DialogFooter$1, d as Input$1, i as DialogDescription$1, l as DialogTitle$1, o as DialogHeader$1, r as DialogContent$1, t as Dialog$1 } from "./dialog-Cjb4lB4D.js";
|
|
7
|
-
import {
|
|
7
|
+
import { C as useGlobalStoreClient, N as filterPaletteNodes, S as useInstalledNodes, _ as getStoreNodeIcon, b as storeNodeDisplayVersion, g as getStoreNodeAvailability, h as filterStoreNodesForPalette, m as useWorkflowTemplates, s as useTemplateImportFlow, t as TemplateCard, v as getStoreNodeType, x as storeNodeInstallVersion, y as isStoreNodeUpdateAvailable } from "./TemplateCard--WYJZlA_.js";
|
|
8
8
|
import { _ as throwIfResultError, d as emitFluidGridsEvent, m as describeOperationError, n as getFluidGridsClient, s as waitForFluidGridsClient, x as getFluidGridsConfig } from "./client-C9XSzSXr.js";
|
|
9
|
-
import {
|
|
9
|
+
import { _ as useWorkflowTestsEnabled, d as useFluidGridsFlag, h as usePhaseDFlags, l as useDurableFunctionNodesEnabled, p as usePaletteGates, t as FLUIDGRIDS_FLAGS, u as useDurableParityEnabled } from "./feature-flags-B_b8PJ6Z.js";
|
|
10
10
|
import { t as Button$2 } from "./button-DG7y_FVJ.js";
|
|
11
11
|
import { t as PublishCustomNodeAction } from "./PublishCustomNodeAction-5XXnSA3H.js";
|
|
12
12
|
import { o as emitUpgradeClicked, t as emitNodeInstalled } from "./fluidgridsEvents-Dm5CaHtr.js";
|
|
13
|
-
import { $t as RemoveNodeFromWorkflowsDocument, Br as WorkflowGitPushesDocument, Ci as
|
|
13
|
+
import { $t as RemoveNodeFromWorkflowsDocument, Br as WorkflowGitPushesDocument, Ci as WorkflowVersionDrainageDocument, Ft as NodeUsageStatusDocument, Gr as WorkflowPromotionRequestsDocument, Hn as TakeOverWorkflowEditLeaseDocument, Kr as WorkflowProposalCodeDocument, Lr as WorkflowGenerationTemplatesDocument, Mn as SetWorkflowRolloutDocument, Mr as WorkflowEditLeaseDocument, Nt as NodeSchemaIntrospectionDocument, Or as WorkflowDefinitionDocument, Pr as WorkflowEnvironmentsDocument, Q as DeployWorkflowVersionToDevDocument, Qt as ReleaseWorkflowEditLeaseDocument, Rr as WorkflowGitCommitsDocument, S as CancelWorkflowPromotionDocument, Vr as WorkflowGitRepositoryDocument, Xt as RejectWorkflowPromotionDocument, Y as DeleteWorkflowRolloutDocument, Zn as UnlinkWorkflowGitRepositoryDocument, br as WorkflowAuthoringDocument, l as ApproveWorkflowPromotionDocument, lr as UpdateWorkflowEnvironmentPolicyDocument, qt as PushWorkflowToGitDocument, r as ActivateWorkflowVersionCheckedDocument, rn as RequestWorkflowPromotionDocument, sn as RestoreWorkflowFromGitDocument, t as AcquireWorkflowEditLeaseDocument, wi as WorkflowVersioningDocument, wt as LinkWorkflowGitRepositoryDocument, zr as WorkflowGitDiffDocument } from "./graphql-operation-types-DZVhCBEi.js";
|
|
14
|
+
import { t as NavigationV2Provider } from "./NavigationV2Provider-DCDt35eG.js";
|
|
14
15
|
import { n as useAgentMarksStore } from "./marksStore-DGCXjTmZ.js";
|
|
15
|
-
import {
|
|
16
|
+
import { a as saveWorkflowDescription, c as CreateWorkflowRefusalDialog, i as normalizeWorkflowDescription, n as useWorkflowCodeExport, o as visibleWorkflowDescription, r as commitWorkflowDescription, s as workflowDescriptionCharactersLeft } from "./useWorkflowCodeExport-k5Emm4ZS.js";
|
|
16
17
|
import { r as RUNS_QUOTA_NAME, t as BILLING_PLANS_PATH } from "./quota-Cdt8yz7N.js";
|
|
17
|
-
import { t as EntityTagPicker } from "./EntityTagPicker-
|
|
18
|
+
import { t as EntityTagPicker } from "./EntityTagPicker-CuZAMby_.js";
|
|
18
19
|
import { t as FluidGridsDocsLink } from "./FluidGridsDocsLink-JxkBpOeb.js";
|
|
19
20
|
import { n as runsQuotaLevel, t as readRunsQuota } from "./runsQuota-DvXR6mRN.js";
|
|
20
21
|
import { a as SdkPermissionGate, i as SdkPermissionButton, s as useFluidGridsPermission, t as FLUIDGRIDS_PERMISSIONS } from "./constants-dcxg6zG6.js";
|
|
21
|
-
import { a as useDeactivateWorkflow, d as useRestoreWorkflowVersion, o as useDeleteWorkflow, t as useActivateWorkflow, v as useWorkflowVersions } from "./useWorkflows-
|
|
22
|
-
import { n as VersionLifecycleBar, r as countLifecycle, t as VersionDiffDialog } from "./VersionDiffDialog-
|
|
22
|
+
import { a as useDeactivateWorkflow, d as useRestoreWorkflowVersion, o as useDeleteWorkflow, t as useActivateWorkflow, v as useWorkflowVersions } from "./useWorkflows-CRUlQBd3.js";
|
|
23
|
+
import { n as VersionLifecycleBar, r as countLifecycle, t as VersionDiffDialog } from "./VersionDiffDialog-c27yet_-.js";
|
|
23
24
|
import { $P as VersioningBehavior, Eu as DrainageStatus, MI as WorkflowTestExpectedStatus, jo as CodeReplaceStatus, nI as WorkflowEnvironment, rI as WorkflowExportFormat } from "./graphql-types-v6CTGwA0.js";
|
|
24
25
|
import { n as useConnections } from "./useConnections-Cs7LCWEM.js";
|
|
25
26
|
import { t as buildNodeDisplayMap } from "./run-display-BycKYSU0.js";
|
|
26
|
-
import { a as TEST_STATUS_TONE_CLASS, c as draftToInput, d as isTestRunOpen, f as nextSortOrder, g as testStatusTone, h as testStatusLabel, i as useWorkflowTests, l as emptyTestCaseDraft, m as testRunSummaryText, n as useWorkflowProposal, p as pinnedOutputsFromCanvas, s as draftFromTestCase, t as WorkflowProposalCard, u as enabledCaseIds } from "./WorkflowProposalCard-
|
|
27
|
+
import { a as TEST_STATUS_TONE_CLASS, c as draftToInput, d as isTestRunOpen, f as nextSortOrder, g as testStatusTone, h as testStatusLabel, i as useWorkflowTests, l as emptyTestCaseDraft, m as testRunSummaryText, n as useWorkflowProposal, p as pinnedOutputsFromCanvas, s as draftFromTestCase, t as WorkflowProposalCard, u as enabledCaseIds } from "./WorkflowProposalCard-BvmJ5ea8.js";
|
|
27
28
|
import { n as useRequestedProposal } from "./useRequestedProposal-B7uPXfZB.js";
|
|
28
29
|
import { t as AiCreditBalanceSlot } from "./aiCreditsBridge-BuE92tKo.js";
|
|
30
|
+
import { t as downloadBlob } from "./workflow-transfer-CQnQC-ke.js";
|
|
31
|
+
import { _ as sortFidelityItems, c as fileBaseName, d as isLosslessReport, f as isLossyFidelityItem, m as orderedExportFiles, o as buildExportDownload, p as lineOfNode } from "./workflow-code-transfer-Cshsgf2H.js";
|
|
29
32
|
import * as React$1 from "react";
|
|
30
33
|
import { Suspense, createContext, lazy, memo, useCallback, useContext, useDeferredValue, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
31
34
|
import { Link, useNavigate, useParams } from "react-router";
|
|
@@ -260,10 +263,10 @@ function IntroductionPropertyPanel() {
|
|
|
260
263
|
* waiting for its chunk and React's Suspense throttle (about 0.5 s on first
|
|
261
264
|
* open even with the chunk cached).
|
|
262
265
|
*/
|
|
263
|
-
const NodeDetailViewOverlay = preloadableLazy(() => import("./node-detail-view-
|
|
264
|
-
const QuickConfigPanelOverlay = preloadableLazy(() => import("./quick-config-panel-
|
|
265
|
-
const SidebarNodeEditorOverlay = preloadableLazy(() => import("./sidebar-node-editor-
|
|
266
|
-
const WorkflowShareDialogOverlay = preloadableLazy(() => import("./WorkflowShareDialog-
|
|
266
|
+
const NodeDetailViewOverlay = preloadableLazy(() => import("./node-detail-view-DNilUGcx.js").then((m) => m.NodeDetailView), "NodeDetailView");
|
|
267
|
+
const QuickConfigPanelOverlay = preloadableLazy(() => import("./quick-config-panel-BPmrhIOb.js").then((m) => m.QuickConfigPanel), "QuickConfigPanel");
|
|
268
|
+
const SidebarNodeEditorOverlay = preloadableLazy(() => import("./sidebar-node-editor-DKdfcd2r.js").then((m) => m.SidebarNodeEditor), "SidebarNodeEditor");
|
|
269
|
+
const WorkflowShareDialogOverlay = preloadableLazy(() => import("./WorkflowShareDialog-BRwTF9QB.js").then((n) => n.n).then((m) => m.WorkflowShareDialog), "WorkflowShareDialog");
|
|
267
270
|
const ConnectionFormDialogOverlay = preloadableLazy(() => import("./ConnectionFormDialog-Bg9_OdHX.js").then((n) => n.n).then((m) => m.ConnectionFormDialog), "ConnectionFormDialog");
|
|
268
271
|
/**
|
|
269
272
|
* Loads every overlay's code (and the markdown renderer the sticky notes and
|
|
@@ -2721,13 +2724,16 @@ function TemplatesGrid({ templates, loading, hasMore, onLoadMore, onTemplateClic
|
|
|
2721
2724
|
});
|
|
2722
2725
|
return /* @__PURE__ */ jsxs("div", {
|
|
2723
2726
|
className: "space-y-6",
|
|
2724
|
-
children: [/* @__PURE__ */ jsx(
|
|
2725
|
-
|
|
2726
|
-
children:
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2727
|
+
children: [/* @__PURE__ */ jsx(NavigationV2Provider, {
|
|
2728
|
+
enabled: false,
|
|
2729
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2730
|
+
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",
|
|
2731
|
+
children: templates.map((template) => /* @__PURE__ */ jsx(TemplateCard, {
|
|
2732
|
+
template,
|
|
2733
|
+
onClick: () => onTemplateClick(template),
|
|
2734
|
+
onUseTemplate
|
|
2735
|
+
}, template.id))
|
|
2736
|
+
})
|
|
2731
2737
|
}), hasMore && /* @__PURE__ */ jsx("div", {
|
|
2732
2738
|
className: "flex justify-center pt-4",
|
|
2733
2739
|
children: /* @__PURE__ */ jsx(Button$2, {
|
|
@@ -2742,7 +2748,7 @@ function TemplatesGrid({ templates, loading, hasMore, onLoadMore, onTemplateClic
|
|
|
2742
2748
|
}
|
|
2743
2749
|
|
|
2744
2750
|
// src/builder/components/flow-builder/components/templates/TemplatesModal.tsx
|
|
2745
|
-
const LazyTemplateDetailPanel = lazy(() => import("./TemplateDetailPanel-
|
|
2751
|
+
const LazyTemplateDetailPanel = lazy(() => import("./TemplateDetailPanel-C-2JuXg6.js").then((m) => ({ default: m.TemplateDetailPanel })));
|
|
2746
2752
|
/**
|
|
2747
2753
|
* Modal for browsing and selecting workflow templates
|
|
2748
2754
|
* Features:
|
|
@@ -9623,9 +9629,7 @@ function ControlBtn({ onClick, title, disabled, active, children }) {
|
|
|
9623
9629
|
}
|
|
9624
9630
|
function CanvasControls() {
|
|
9625
9631
|
const tr = useTr();
|
|
9626
|
-
const
|
|
9627
|
-
const leaseLocked = useEditLeaseLocked();
|
|
9628
|
-
const isReadOnly = searchParams.get("readonly") === "true" || leaseLocked;
|
|
9632
|
+
const isReadOnly = useBuilderReadOnly();
|
|
9629
9633
|
const [showMinimap, setShowMinimap] = useState(false);
|
|
9630
9634
|
const [edgesHidden, setEdgesHidden] = useState(false);
|
|
9631
9635
|
const [shortcutsHelpOpen, setShortcutsHelpOpen] = useState(false);
|
|
@@ -16234,6 +16238,435 @@ function canvasHasWork(nodes) {
|
|
|
16234
16238
|
return nodes.length > 1;
|
|
16235
16239
|
}
|
|
16236
16240
|
|
|
16241
|
+
// src/hooks/useWorkflowProposalCode.ts
|
|
16242
|
+
/**
|
|
16243
|
+
* Generate with AI emits code (BOFF-9907, PLAN-D D1): an AI proposal's
|
|
16244
|
+
* definition lifted to TypeScript or Python.
|
|
16245
|
+
*
|
|
16246
|
+
* The model never writes code (DD5): the service lifts the validated
|
|
16247
|
+
* definition through C-LIFT on each read (`WorkflowProposal.code(format)`),
|
|
16248
|
+
* so the files always lower back to the proposal and the fidelity report
|
|
16249
|
+
* proves it. The AI panel reads it only while a code tab is open, with
|
|
16250
|
+
* `fluidgrids.code-first` and `fluidgrids.ai-code` on; the service re-checks
|
|
16251
|
+
* both flags on every read.
|
|
16252
|
+
*/
|
|
16253
|
+
/**
|
|
16254
|
+
* One network round trip; never served from the Apollo cache, because the
|
|
16255
|
+
* lift follows the proposal's current definition. Null while the proposal has
|
|
16256
|
+
* no definition (still processing, or failed).
|
|
16257
|
+
*/
|
|
16258
|
+
async function fetchWorkflowProposalCode(id, format) {
|
|
16259
|
+
const result = await getFluidGridsClient().query({
|
|
16260
|
+
query: WorkflowProposalCodeDocument,
|
|
16261
|
+
variables: {
|
|
16262
|
+
id,
|
|
16263
|
+
format
|
|
16264
|
+
},
|
|
16265
|
+
fetchPolicy: "network-only"
|
|
16266
|
+
});
|
|
16267
|
+
throwIfResultError(result);
|
|
16268
|
+
return result.data?.workflowProposal?.code ?? null;
|
|
16269
|
+
}
|
|
16270
|
+
/**
|
|
16271
|
+
* The lifted code of one proposal in one format, fetched while `enabled` (a
|
|
16272
|
+
* code tab is open). A response for an older request (the format or the
|
|
16273
|
+
* proposal changed meanwhile) is dropped, so the Python tab never shows
|
|
16274
|
+
* TypeScript. `revision` refetches when it changes, for example when the
|
|
16275
|
+
* proposal's status or definition moved on.
|
|
16276
|
+
*/
|
|
16277
|
+
function useWorkflowProposalCode(id, format, enabled, revision, errorFallback) {
|
|
16278
|
+
const key = `${id ?? ""}\u0000${format}\u0000${revision}`;
|
|
16279
|
+
const [answer, setAnswer] = useState(null);
|
|
16280
|
+
const [pendingKey, setPendingKey] = useState(null);
|
|
16281
|
+
const request = useRef(0);
|
|
16282
|
+
const refetch = useCallback(async () => {
|
|
16283
|
+
if (!id) return;
|
|
16284
|
+
const current = ++request.current;
|
|
16285
|
+
setPendingKey(key);
|
|
16286
|
+
try {
|
|
16287
|
+
const code = await fetchWorkflowProposalCode(id, format);
|
|
16288
|
+
if (current !== request.current) return;
|
|
16289
|
+
setAnswer({
|
|
16290
|
+
key,
|
|
16291
|
+
data: code,
|
|
16292
|
+
error: null
|
|
16293
|
+
});
|
|
16294
|
+
} catch (err) {
|
|
16295
|
+
if (current !== request.current) return;
|
|
16296
|
+
setAnswer({
|
|
16297
|
+
key,
|
|
16298
|
+
data: null,
|
|
16299
|
+
error: describeOperationError(err, errorFallback)
|
|
16300
|
+
});
|
|
16301
|
+
} finally {
|
|
16302
|
+
if (current === request.current) setPendingKey(null);
|
|
16303
|
+
}
|
|
16304
|
+
}, [
|
|
16305
|
+
id,
|
|
16306
|
+
format,
|
|
16307
|
+
key,
|
|
16308
|
+
errorFallback
|
|
16309
|
+
]);
|
|
16310
|
+
useEffect(() => {
|
|
16311
|
+
if (!enabled || !id) {
|
|
16312
|
+
request.current++;
|
|
16313
|
+
return;
|
|
16314
|
+
}
|
|
16315
|
+
refetch();
|
|
16316
|
+
}, [
|
|
16317
|
+
enabled,
|
|
16318
|
+
id,
|
|
16319
|
+
refetch
|
|
16320
|
+
]);
|
|
16321
|
+
const current = answer?.key === key ? answer : null;
|
|
16322
|
+
return {
|
|
16323
|
+
data: current?.data ?? null,
|
|
16324
|
+
loading: enabled && id !== null && pendingKey === key,
|
|
16325
|
+
error: current?.error ?? null,
|
|
16326
|
+
refetch
|
|
16327
|
+
};
|
|
16328
|
+
}
|
|
16329
|
+
|
|
16330
|
+
// src/builder/components/flow-builder/components/ui/code-view-fidelity.tsx
|
|
16331
|
+
/**
|
|
16332
|
+
* The fidelity report of a code export (BOFF-9904, spec 07 §2), as the
|
|
16333
|
+
* builder's Code view shows it: whether lowering the exported code gives the
|
|
16334
|
+
* same workflow back, and every item the service reported, each linked to its
|
|
16335
|
+
* node on the canvas.
|
|
16336
|
+
*/
|
|
16337
|
+
function FidelityLevelBadge({ fidelity }) {
|
|
16338
|
+
const tr = useTr();
|
|
16339
|
+
const lossless = isLosslessReport(fidelity);
|
|
16340
|
+
return /* @__PURE__ */ jsxs(Badge, {
|
|
16341
|
+
variant: lossless ? "secondary" : "destructive",
|
|
16342
|
+
"data-testid": "fluidgrids-code-fidelity-level",
|
|
16343
|
+
"data-level": lossless ? "lossless" : "lossy",
|
|
16344
|
+
className: "gap-1",
|
|
16345
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16346
|
+
icon: lossless ? "mynaui:check-circle" : "mynaui:danger-triangle",
|
|
16347
|
+
className: "size-3.5"
|
|
16348
|
+
}), lossless ? tr("fluidgrids.builder.codeView.lossless", "Lossless") : tr("fluidgrids.builder.codeView.lossy", "Lossy")]
|
|
16349
|
+
});
|
|
16350
|
+
}
|
|
16351
|
+
function FidelityReportList({ fidelity, source, hasNode, onShowNode, hints }) {
|
|
16352
|
+
const tr = useTr();
|
|
16353
|
+
const items = sortFidelityItems(fidelity.items);
|
|
16354
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
16355
|
+
"aria-labelledby": "fg-code-fidelity",
|
|
16356
|
+
"data-testid": "fluidgrids-code-fidelity",
|
|
16357
|
+
className: "space-y-2",
|
|
16358
|
+
children: [
|
|
16359
|
+
/* @__PURE__ */ jsxs("div", {
|
|
16360
|
+
className: "flex items-center justify-between gap-2",
|
|
16361
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
16362
|
+
id: "fg-code-fidelity",
|
|
16363
|
+
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
16364
|
+
children: tr("fluidgrids.builder.codeView.fidelityTitle", "Fidelity")
|
|
16365
|
+
}), /* @__PURE__ */ jsx(FidelityLevelBadge, { fidelity })]
|
|
16366
|
+
}),
|
|
16367
|
+
/* @__PURE__ */ jsx("p", {
|
|
16368
|
+
className: "text-xs text-muted-foreground",
|
|
16369
|
+
children: hints ? isLosslessReport(fidelity) ? hints.lossless : hints.lossy : isLosslessReport(fidelity) ? tr("fluidgrids.builder.codeView.losslessHint", "Lowering this code gives back exactly this workflow.") : tr("fluidgrids.builder.codeView.lossyHint", "Lowering this code does not give back exactly this workflow. The items marked lossy say what differs.")
|
|
16370
|
+
}),
|
|
16371
|
+
items.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
16372
|
+
className: "text-xs text-muted-foreground",
|
|
16373
|
+
children: tr("fluidgrids.builder.codeView.noFidelityItems", "Nothing to report.")
|
|
16374
|
+
}) : /* @__PURE__ */ jsx("ul", {
|
|
16375
|
+
className: "space-y-1.5",
|
|
16376
|
+
children: items.map((item, index) => {
|
|
16377
|
+
const lossy = isLossyFidelityItem(item);
|
|
16378
|
+
const nodeId = item.nodeId ?? null;
|
|
16379
|
+
const line = nodeId && source !== void 0 ? lineOfNode(source, nodeId) : null;
|
|
16380
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
16381
|
+
"data-testid": "fluidgrids-code-fidelity-item",
|
|
16382
|
+
"data-kind": item.kind,
|
|
16383
|
+
"data-lossy": lossy ? "true" : "false",
|
|
16384
|
+
className: cn("rounded-md border p-2 text-xs", lossy ? "border-[var(--color-status-error-border)] bg-[var(--color-status-error-bg)]" : "border-border bg-muted/30"),
|
|
16385
|
+
children: [
|
|
16386
|
+
/* @__PURE__ */ jsxs("div", {
|
|
16387
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
16388
|
+
children: [
|
|
16389
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
16390
|
+
variant: lossy ? "destructive" : "outline",
|
|
16391
|
+
className: "text-[10px]",
|
|
16392
|
+
children: lossy ? tr("fluidgrids.builder.codeView.itemLossy", "Lossy") : tr("fluidgrids.builder.codeView.itemLossless", "Kept")
|
|
16393
|
+
}),
|
|
16394
|
+
/* @__PURE__ */ jsx("code", {
|
|
16395
|
+
className: "font-mono text-[11px] text-card-foreground",
|
|
16396
|
+
children: item.kind
|
|
16397
|
+
}),
|
|
16398
|
+
line !== null && /* @__PURE__ */ jsx("span", {
|
|
16399
|
+
className: "text-muted-foreground",
|
|
16400
|
+
children: tr("fluidgrids.builder.codeView.itemLine", "line {{line}}", { line: String(line) })
|
|
16401
|
+
})
|
|
16402
|
+
]
|
|
16403
|
+
}),
|
|
16404
|
+
/* @__PURE__ */ jsx("p", {
|
|
16405
|
+
className: "mt-1 break-words text-card-foreground",
|
|
16406
|
+
children: item.detail
|
|
16407
|
+
}),
|
|
16408
|
+
item.path && /* @__PURE__ */ jsx("p", {
|
|
16409
|
+
className: "mt-0.5 break-all font-mono text-[11px] text-muted-foreground",
|
|
16410
|
+
children: item.path
|
|
16411
|
+
}),
|
|
16412
|
+
nodeId && onShowNode && /* @__PURE__ */ jsxs(Button, {
|
|
16413
|
+
variant: "link",
|
|
16414
|
+
size: "sm",
|
|
16415
|
+
className: "mt-1 h-auto gap-1 p-0 text-xs",
|
|
16416
|
+
disabled: !hasNode?.(nodeId),
|
|
16417
|
+
onClick: () => onShowNode(nodeId),
|
|
16418
|
+
"data-testid": "fluidgrids-code-fidelity-node",
|
|
16419
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16420
|
+
icon: "mynaui:location",
|
|
16421
|
+
className: "size-3.5"
|
|
16422
|
+
}), tr("fluidgrids.builder.codeView.showNode", "Show node {{nodeId}}", { nodeId })]
|
|
16423
|
+
})
|
|
16424
|
+
]
|
|
16425
|
+
}, `${item.kind}-${nodeId ?? ""}-${item.path ?? ""}-${index}`);
|
|
16426
|
+
})
|
|
16427
|
+
})
|
|
16428
|
+
]
|
|
16429
|
+
});
|
|
16430
|
+
}
|
|
16431
|
+
|
|
16432
|
+
// src/builder/components/flow-builder/components/ui/code-files-view.tsx
|
|
16433
|
+
/**
|
|
16434
|
+
* CodeFilesView — the presentational part of a read-only code view
|
|
16435
|
+
* (BOFF-9904, split out for BOFF-9907 PLAN-D D1).
|
|
16436
|
+
*
|
|
16437
|
+
* Shows a set of lifted files (the workflow module first, then its sidecars
|
|
16438
|
+
* and generated node clients) syntax-highlighted and read-only, the irHash,
|
|
16439
|
+
* the fidelity report, and *Copy* and *Download*. It fetches nothing: the
|
|
16440
|
+
* builder's Code view passes an `exportWorkflow` result, and the AI panel's
|
|
16441
|
+
* code tabs pass `WorkflowProposal.code`. Both download exactly what the
|
|
16442
|
+
* service lifted, through `buildExportDownload`.
|
|
16443
|
+
*/
|
|
16444
|
+
const LazyCodeEditorField = lazy(() => import("./code-editor-field-CWGZyNGM.js").then((n) => n.n).then((m) => ({ default: m.CodeEditorField })));
|
|
16445
|
+
function editorLanguageOf(path) {
|
|
16446
|
+
if (path.endsWith(".py")) return "python";
|
|
16447
|
+
if (path.endsWith(".ts")) return "typescript";
|
|
16448
|
+
return "javascript";
|
|
16449
|
+
}
|
|
16450
|
+
function CodeFilesView({ format, result, loading, error, onRetry, download, toolbarStart, notice, hasNode, onShowNode, editorLabel, loadingText, emptyText, save = downloadBlob }) {
|
|
16451
|
+
const tr = useTr();
|
|
16452
|
+
const [picked, setPicked] = useState(null);
|
|
16453
|
+
const selectedPath = picked?.format === format ? picked.path : null;
|
|
16454
|
+
const [downloading, setDownloading] = useState(false);
|
|
16455
|
+
const files = useMemo(() => result ? orderedExportFiles(result.files, format) : [], [result, format]);
|
|
16456
|
+
const shown = files.find((file) => file.path === selectedPath) ?? files[0] ?? null;
|
|
16457
|
+
const shownContent = shown?.content ?? "";
|
|
16458
|
+
const copy = async () => {
|
|
16459
|
+
if (!shown) return;
|
|
16460
|
+
try {
|
|
16461
|
+
await navigator.clipboard.writeText(shownContent);
|
|
16462
|
+
toast.success(tr("fluidgrids.builder.codeView.copied", "Code copied"));
|
|
16463
|
+
} catch (err) {
|
|
16464
|
+
toast.error(tr("fluidgrids.builder.codeView.copyError", "Copy failed"), { description: describeOperationError(err) });
|
|
16465
|
+
}
|
|
16466
|
+
};
|
|
16467
|
+
const startDownload = async () => {
|
|
16468
|
+
if (!result) return;
|
|
16469
|
+
setDownloading(true);
|
|
16470
|
+
try {
|
|
16471
|
+
const { filename, blob } = await buildExportDownload({
|
|
16472
|
+
...download,
|
|
16473
|
+
files: [...result.files]
|
|
16474
|
+
}, format);
|
|
16475
|
+
save(filename, blob);
|
|
16476
|
+
} catch (err) {
|
|
16477
|
+
toast.error(tr("fluidgrids.builder.codeView.downloadError", "Download failed"), { description: describeOperationError(err) });
|
|
16478
|
+
} finally {
|
|
16479
|
+
setDownloading(false);
|
|
16480
|
+
}
|
|
16481
|
+
};
|
|
16482
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16483
|
+
className: "flex flex-1 flex-col gap-4",
|
|
16484
|
+
children: [
|
|
16485
|
+
/* @__PURE__ */ jsxs("div", {
|
|
16486
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
16487
|
+
children: [toolbarStart ?? /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsxs("div", {
|
|
16488
|
+
className: "flex items-center gap-2",
|
|
16489
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
16490
|
+
variant: "outline",
|
|
16491
|
+
size: "sm",
|
|
16492
|
+
className: "h-8 gap-1 text-xs",
|
|
16493
|
+
onClick: () => void copy(),
|
|
16494
|
+
disabled: !shown || loading,
|
|
16495
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16496
|
+
icon: "mynaui:copy",
|
|
16497
|
+
className: "size-3.5"
|
|
16498
|
+
}), tr("fluidgrids.builder.codeView.copy", "Copy")]
|
|
16499
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
16500
|
+
variant: "outline",
|
|
16501
|
+
size: "sm",
|
|
16502
|
+
className: "h-8 gap-1 text-xs",
|
|
16503
|
+
onClick: () => void startDownload(),
|
|
16504
|
+
disabled: !result || loading || downloading,
|
|
16505
|
+
"data-testid": "fluidgrids-code-download",
|
|
16506
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16507
|
+
icon: "mynaui:download",
|
|
16508
|
+
className: "size-3.5"
|
|
16509
|
+
}), tr("fluidgrids.builder.codeView.download", "Download")]
|
|
16510
|
+
})]
|
|
16511
|
+
})]
|
|
16512
|
+
}),
|
|
16513
|
+
notice,
|
|
16514
|
+
loading && !result ? /* @__PURE__ */ jsxs("div", {
|
|
16515
|
+
className: "flex items-center justify-center py-8 text-sm text-muted-foreground",
|
|
16516
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16517
|
+
icon: "mynaui:spinner",
|
|
16518
|
+
className: "mr-2 size-4 animate-spin"
|
|
16519
|
+
}), loadingText]
|
|
16520
|
+
}) : error ? /* @__PURE__ */ jsxs("div", {
|
|
16521
|
+
className: "py-6 text-sm",
|
|
16522
|
+
role: "alert",
|
|
16523
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
16524
|
+
className: "text-[var(--color-status-error-text)]",
|
|
16525
|
+
children: error
|
|
16526
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
16527
|
+
variant: "outline",
|
|
16528
|
+
size: "sm",
|
|
16529
|
+
className: "mt-3",
|
|
16530
|
+
onClick: onRetry,
|
|
16531
|
+
children: tr("fluidgrids.builder.codeView.retry", "Retry")
|
|
16532
|
+
})]
|
|
16533
|
+
}) : result && shown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
16534
|
+
files.length > 1 && /* @__PURE__ */ jsx("div", {
|
|
16535
|
+
className: "flex flex-wrap gap-1",
|
|
16536
|
+
role: "group",
|
|
16537
|
+
"aria-label": tr("fluidgrids.builder.codeView.files", "Files"),
|
|
16538
|
+
children: files.map((file) => /* @__PURE__ */ jsx(Button, {
|
|
16539
|
+
variant: file === shown ? "secondary" : "ghost",
|
|
16540
|
+
size: "sm",
|
|
16541
|
+
className: "h-7 font-mono text-[11px]",
|
|
16542
|
+
title: file.path,
|
|
16543
|
+
"aria-pressed": file === shown,
|
|
16544
|
+
onClick: () => setPicked({
|
|
16545
|
+
format,
|
|
16546
|
+
path: file.path
|
|
16547
|
+
}),
|
|
16548
|
+
children: fileBaseName(file.path)
|
|
16549
|
+
}, file.path))
|
|
16550
|
+
}),
|
|
16551
|
+
/* @__PURE__ */ jsxs("div", {
|
|
16552
|
+
className: "flex items-center justify-between gap-2 text-[11px] text-muted-foreground",
|
|
16553
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
16554
|
+
className: "truncate font-mono",
|
|
16555
|
+
title: shown.path,
|
|
16556
|
+
children: shown.path
|
|
16557
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
16558
|
+
className: "flex shrink-0 items-center gap-2",
|
|
16559
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
16560
|
+
className: "font-mono",
|
|
16561
|
+
title: result.irHash,
|
|
16562
|
+
children: result.irHash.slice(0, 19)
|
|
16563
|
+
}), /* @__PURE__ */ jsx(FidelityLevelBadge, { fidelity: result.fidelity })]
|
|
16564
|
+
})]
|
|
16565
|
+
}),
|
|
16566
|
+
/* @__PURE__ */ jsx(Suspense, {
|
|
16567
|
+
fallback: /* @__PURE__ */ jsx("div", {
|
|
16568
|
+
className: "min-h-[260px] rounded-md border border-border bg-muted/30",
|
|
16569
|
+
role: "status",
|
|
16570
|
+
"aria-label": editorLabel
|
|
16571
|
+
}),
|
|
16572
|
+
children: /* @__PURE__ */ jsx(LazyCodeEditorField, {
|
|
16573
|
+
value: shownContent,
|
|
16574
|
+
language: editorLanguageOf(shown.path),
|
|
16575
|
+
label: editorLabel,
|
|
16576
|
+
readOnly: true,
|
|
16577
|
+
minHeight: "260px",
|
|
16578
|
+
maxHeight: "55vh",
|
|
16579
|
+
"data-testid": "fluidgrids-code-editor"
|
|
16580
|
+
})
|
|
16581
|
+
}),
|
|
16582
|
+
/* @__PURE__ */ jsx(FidelityReportList, {
|
|
16583
|
+
fidelity: result.fidelity,
|
|
16584
|
+
source: shownContent,
|
|
16585
|
+
hasNode,
|
|
16586
|
+
onShowNode
|
|
16587
|
+
})
|
|
16588
|
+
] }) : /* @__PURE__ */ jsx("p", {
|
|
16589
|
+
className: "py-6 text-sm text-muted-foreground",
|
|
16590
|
+
children: emptyText
|
|
16591
|
+
})
|
|
16592
|
+
]
|
|
16593
|
+
});
|
|
16594
|
+
}
|
|
16595
|
+
|
|
16596
|
+
// src/builder/components/flow-builder/components/ui/ai-draft-code-tabs.tsx
|
|
16597
|
+
/**
|
|
16598
|
+
* The AI panel's *Canvas | TypeScript | Python* tabs (BOFF-9907, PLAN-D D1).
|
|
16599
|
+
*
|
|
16600
|
+
* *Canvas* is the proposal card exactly as before. The code tabs show the
|
|
16601
|
+
* proposed definition lifted by the service (`WorkflowProposal.code`), read
|
|
16602
|
+
* when the tab opens and never from the cache, with its fidelity report and
|
|
16603
|
+
* *Download*. The model never writes the code (DD5): what the tab shows is the
|
|
16604
|
+
* validated proposal, so importing the files gives back the same workflow.
|
|
16605
|
+
*
|
|
16606
|
+
* Rendered only while `fluidgrids.code-first` and `fluidgrids.ai-code` are on
|
|
16607
|
+
* (the panel checks `usePhaseDFlags().aiCode`) and the proposal has a
|
|
16608
|
+
* definition; otherwise the panel renders the card alone, as it always did.
|
|
16609
|
+
*/
|
|
16610
|
+
function isDraftTab(value) {
|
|
16611
|
+
return value === "canvas" || value === "TYPESCRIPT" || value === "PYTHON";
|
|
16612
|
+
}
|
|
16613
|
+
/** The version label a lifted proposal carries: it is not a stored version. */
|
|
16614
|
+
const DRAFT_CODE_VERSION = "draft";
|
|
16615
|
+
function AiDraftCodeTabs({ proposal, canvas, save }) {
|
|
16616
|
+
const tr = useTr();
|
|
16617
|
+
const [tab, setTab] = useState("canvas");
|
|
16618
|
+
const format = tab === "canvas" ? "TYPESCRIPT" : tab;
|
|
16619
|
+
const revision = `${proposal.status}:${proposal.updatedAt ?? ""}`;
|
|
16620
|
+
const code = useWorkflowProposalCode(proposal.id, format, tab !== "canvas", revision, tr("fluidgrids.builder.aiDraft.codeLoadFailed", "The code could not be loaded"));
|
|
16621
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16622
|
+
className: "flex flex-col gap-3",
|
|
16623
|
+
"data-testid": "ai-draft-tabs",
|
|
16624
|
+
children: [/* @__PURE__ */ jsx(Tabs, {
|
|
16625
|
+
value: tab,
|
|
16626
|
+
onValueChange: (value) => {
|
|
16627
|
+
if (isDraftTab(value)) setTab(value);
|
|
16628
|
+
},
|
|
16629
|
+
children: /* @__PURE__ */ jsxs(TabsList, { children: [
|
|
16630
|
+
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
16631
|
+
value: "canvas",
|
|
16632
|
+
"data-testid": "ai-draft-tab-canvas",
|
|
16633
|
+
children: tr("fluidgrids.builder.aiDraft.tabCanvas", "Canvas")
|
|
16634
|
+
}),
|
|
16635
|
+
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
16636
|
+
value: "TYPESCRIPT",
|
|
16637
|
+
"data-testid": "ai-draft-tab-typescript",
|
|
16638
|
+
children: tr("fluidgrids.builder.aiDraft.tabTypescript", "TypeScript")
|
|
16639
|
+
}),
|
|
16640
|
+
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
16641
|
+
value: "PYTHON",
|
|
16642
|
+
"data-testid": "ai-draft-tab-python",
|
|
16643
|
+
children: tr("fluidgrids.builder.aiDraft.tabPython", "Python")
|
|
16644
|
+
})
|
|
16645
|
+
] })
|
|
16646
|
+
}), tab === "canvas" ? canvas : /* @__PURE__ */ jsxs("div", {
|
|
16647
|
+
"data-testid": "ai-draft-code",
|
|
16648
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
16649
|
+
className: "mb-3 text-xs text-muted-foreground",
|
|
16650
|
+
children: tr("fluidgrids.builder.aiDraft.codeDescription", "The proposal as code, lifted by FluidGrids from the validated draft. Importing these files gives back the same workflow.")
|
|
16651
|
+
}), /* @__PURE__ */ jsx(CodeFilesView, {
|
|
16652
|
+
format,
|
|
16653
|
+
result: code.data,
|
|
16654
|
+
loading: code.loading,
|
|
16655
|
+
error: code.error,
|
|
16656
|
+
onRetry: () => void code.refetch(),
|
|
16657
|
+
download: {
|
|
16658
|
+
workflowKey: proposal.workflowKey || proposal.name || "workflow",
|
|
16659
|
+
version: DRAFT_CODE_VERSION
|
|
16660
|
+
},
|
|
16661
|
+
editorLabel: tr("fluidgrids.builder.aiDraft.codeEditorLabel", "Proposed workflow code (read-only)"),
|
|
16662
|
+
loadingText: tr("fluidgrids.builder.aiDraft.codeLoading", "Lifting the proposal…"),
|
|
16663
|
+
emptyText: tr("fluidgrids.builder.aiDraft.codeEmpty", "The proposal has no definition to show as code yet."),
|
|
16664
|
+
save
|
|
16665
|
+
})]
|
|
16666
|
+
})]
|
|
16667
|
+
});
|
|
16668
|
+
}
|
|
16669
|
+
|
|
16237
16670
|
// src/builder/components/flow-builder/components/ui/ai-draft-panel.tsx
|
|
16238
16671
|
/**
|
|
16239
16672
|
* AiDraftPanel — "Generate with AI" in the builder (BOFF-4304, BOFF-3662).
|
|
@@ -16275,6 +16708,7 @@ function AiDraftPanel({ className, compact = false }) {
|
|
|
16275
16708
|
setOpen(true);
|
|
16276
16709
|
openProposal(proposalId);
|
|
16277
16710
|
}, [openProposal]), Boolean(workflowKey));
|
|
16711
|
+
const { aiCode } = usePhaseDFlags();
|
|
16278
16712
|
const [nodes, setNodes, setEdges] = useFlowStore(useShallow((s) => [
|
|
16279
16713
|
s.workflow.nodes,
|
|
16280
16714
|
s.actions.nodes.setNodes,
|
|
@@ -16367,6 +16801,22 @@ function AiDraftPanel({ className, compact = false }) {
|
|
|
16367
16801
|
proposal.reset();
|
|
16368
16802
|
}, [proposal]);
|
|
16369
16803
|
const finished = status !== void 0 && status !== "PROCESSING" && status !== "PROPOSED";
|
|
16804
|
+
const proposalCanvas = current ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(WorkflowProposalCard, {
|
|
16805
|
+
proposal: current,
|
|
16806
|
+
isDeciding: proposal.isDeciding || reverting,
|
|
16807
|
+
onApply: () => void handleApply(),
|
|
16808
|
+
onReject: () => void handleReject(),
|
|
16809
|
+
onCancel: () => void proposal.cancel(),
|
|
16810
|
+
onOpenWorkflow: openWorkflow,
|
|
16811
|
+
onRevert: (key, version) => void handleRevert(key, version)
|
|
16812
|
+
}), status === "PROPOSED" && !workflowKey && /* @__PURE__ */ jsx(Button, {
|
|
16813
|
+
variant: "ghost",
|
|
16814
|
+
size: "sm",
|
|
16815
|
+
className: "mt-2",
|
|
16816
|
+
"data-testid": "ai-draft-accept",
|
|
16817
|
+
onClick: handlePutOnCanvas,
|
|
16818
|
+
children: tr("fluidgrids.builder.aiDraft.putOnCanvas", "Add to canvas without saving")
|
|
16819
|
+
})] }) : null;
|
|
16370
16820
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Sheet, {
|
|
16371
16821
|
open,
|
|
16372
16822
|
onOpenChange: setOpen,
|
|
@@ -16465,24 +16915,18 @@ function AiDraftPanel({ className, compact = false }) {
|
|
|
16465
16915
|
className: "rounded-md border border-[var(--color-status-error-border)] bg-[var(--color-status-error-bg-subtle)] p-3 text-sm text-[var(--color-status-error-text)]",
|
|
16466
16916
|
children: proposal.timedOut ? tr("fluidgrids.builder.aiDraft.timedOut", "The draft is taking longer than expected. Try again in a moment.") : proposal.error
|
|
16467
16917
|
}),
|
|
16468
|
-
current && /* @__PURE__ */
|
|
16918
|
+
current && /* @__PURE__ */ jsx("div", {
|
|
16469
16919
|
"data-testid": "ai-draft-result",
|
|
16470
|
-
children:
|
|
16471
|
-
proposal:
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
size: "sm",
|
|
16481
|
-
className: "mt-2",
|
|
16482
|
-
"data-testid": "ai-draft-accept",
|
|
16483
|
-
onClick: handlePutOnCanvas,
|
|
16484
|
-
children: tr("fluidgrids.builder.aiDraft.putOnCanvas", "Add to canvas without saving")
|
|
16485
|
-
})]
|
|
16920
|
+
children: aiCode && current.definitionJson ? /* @__PURE__ */ jsx(AiDraftCodeTabs, {
|
|
16921
|
+
proposal: {
|
|
16922
|
+
id: current.id,
|
|
16923
|
+
status: String(current.status),
|
|
16924
|
+
workflowKey: current.workflowKey,
|
|
16925
|
+
name: current.name,
|
|
16926
|
+
updatedAt: current.updatedAt
|
|
16927
|
+
},
|
|
16928
|
+
canvas: proposalCanvas
|
|
16929
|
+
}, current.id) : proposalCanvas
|
|
16486
16930
|
})
|
|
16487
16931
|
]
|
|
16488
16932
|
})]
|
|
@@ -16498,108 +16942,6 @@ function AiDraftPanel({ className, compact = false }) {
|
|
|
16498
16942
|
})] });
|
|
16499
16943
|
}
|
|
16500
16944
|
|
|
16501
|
-
// src/builder/components/flow-builder/components/ui/code-view-fidelity.tsx
|
|
16502
|
-
/**
|
|
16503
|
-
* The fidelity report of a code export (BOFF-9904, spec 07 §2), as the
|
|
16504
|
-
* builder's Code view shows it: whether lowering the exported code gives the
|
|
16505
|
-
* same workflow back, and every item the service reported, each linked to its
|
|
16506
|
-
* node on the canvas.
|
|
16507
|
-
*/
|
|
16508
|
-
function FidelityLevelBadge({ fidelity }) {
|
|
16509
|
-
const tr = useTr();
|
|
16510
|
-
const lossless = isLosslessReport(fidelity);
|
|
16511
|
-
return /* @__PURE__ */ jsxs(Badge, {
|
|
16512
|
-
variant: lossless ? "secondary" : "destructive",
|
|
16513
|
-
"data-testid": "fluidgrids-code-fidelity-level",
|
|
16514
|
-
"data-level": lossless ? "lossless" : "lossy",
|
|
16515
|
-
className: "gap-1",
|
|
16516
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16517
|
-
icon: lossless ? "mynaui:check-circle" : "mynaui:danger-triangle",
|
|
16518
|
-
className: "size-3.5"
|
|
16519
|
-
}), lossless ? tr("fluidgrids.builder.codeView.lossless", "Lossless") : tr("fluidgrids.builder.codeView.lossy", "Lossy")]
|
|
16520
|
-
});
|
|
16521
|
-
}
|
|
16522
|
-
function FidelityReportList({ fidelity, source, hasNode, onShowNode }) {
|
|
16523
|
-
const tr = useTr();
|
|
16524
|
-
const items = sortFidelityItems(fidelity.items);
|
|
16525
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
16526
|
-
"aria-labelledby": "fg-code-fidelity",
|
|
16527
|
-
"data-testid": "fluidgrids-code-fidelity",
|
|
16528
|
-
className: "space-y-2",
|
|
16529
|
-
children: [
|
|
16530
|
-
/* @__PURE__ */ jsxs("div", {
|
|
16531
|
-
className: "flex items-center justify-between gap-2",
|
|
16532
|
-
children: [/* @__PURE__ */ jsx("h3", {
|
|
16533
|
-
id: "fg-code-fidelity",
|
|
16534
|
-
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
16535
|
-
children: tr("fluidgrids.builder.codeView.fidelityTitle", "Fidelity")
|
|
16536
|
-
}), /* @__PURE__ */ jsx(FidelityLevelBadge, { fidelity })]
|
|
16537
|
-
}),
|
|
16538
|
-
/* @__PURE__ */ jsx("p", {
|
|
16539
|
-
className: "text-xs text-muted-foreground",
|
|
16540
|
-
children: isLosslessReport(fidelity) ? tr("fluidgrids.builder.codeView.losslessHint", "Lowering this code gives back exactly this workflow.") : tr("fluidgrids.builder.codeView.lossyHint", "Lowering this code does not give back exactly this workflow. The items marked lossy say what differs.")
|
|
16541
|
-
}),
|
|
16542
|
-
items.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
16543
|
-
className: "text-xs text-muted-foreground",
|
|
16544
|
-
children: tr("fluidgrids.builder.codeView.noFidelityItems", "Nothing to report.")
|
|
16545
|
-
}) : /* @__PURE__ */ jsx("ul", {
|
|
16546
|
-
className: "space-y-1.5",
|
|
16547
|
-
children: items.map((item, index) => {
|
|
16548
|
-
const lossy = isLossyFidelityItem(item);
|
|
16549
|
-
const nodeId = item.nodeId ?? null;
|
|
16550
|
-
const line = nodeId && source !== void 0 ? lineOfNode(source, nodeId) : null;
|
|
16551
|
-
return /* @__PURE__ */ jsxs("li", {
|
|
16552
|
-
"data-testid": "fluidgrids-code-fidelity-item",
|
|
16553
|
-
"data-kind": item.kind,
|
|
16554
|
-
"data-lossy": lossy ? "true" : "false",
|
|
16555
|
-
className: cn("rounded-md border p-2 text-xs", lossy ? "border-[var(--color-status-error-border)] bg-[var(--color-status-error-bg)]" : "border-border bg-muted/30"),
|
|
16556
|
-
children: [
|
|
16557
|
-
/* @__PURE__ */ jsxs("div", {
|
|
16558
|
-
className: "flex flex-wrap items-center gap-1.5",
|
|
16559
|
-
children: [
|
|
16560
|
-
/* @__PURE__ */ jsx(Badge, {
|
|
16561
|
-
variant: lossy ? "destructive" : "outline",
|
|
16562
|
-
className: "text-[10px]",
|
|
16563
|
-
children: lossy ? tr("fluidgrids.builder.codeView.itemLossy", "Lossy") : tr("fluidgrids.builder.codeView.itemLossless", "Kept")
|
|
16564
|
-
}),
|
|
16565
|
-
/* @__PURE__ */ jsx("code", {
|
|
16566
|
-
className: "font-mono text-[11px] text-card-foreground",
|
|
16567
|
-
children: item.kind
|
|
16568
|
-
}),
|
|
16569
|
-
line !== null && /* @__PURE__ */ jsx("span", {
|
|
16570
|
-
className: "text-muted-foreground",
|
|
16571
|
-
children: tr("fluidgrids.builder.codeView.itemLine", "line {{line}}", { line: String(line) })
|
|
16572
|
-
})
|
|
16573
|
-
]
|
|
16574
|
-
}),
|
|
16575
|
-
/* @__PURE__ */ jsx("p", {
|
|
16576
|
-
className: "mt-1 break-words text-card-foreground",
|
|
16577
|
-
children: item.detail
|
|
16578
|
-
}),
|
|
16579
|
-
item.path && /* @__PURE__ */ jsx("p", {
|
|
16580
|
-
className: "mt-0.5 break-all font-mono text-[11px] text-muted-foreground",
|
|
16581
|
-
children: item.path
|
|
16582
|
-
}),
|
|
16583
|
-
nodeId && /* @__PURE__ */ jsxs(Button, {
|
|
16584
|
-
variant: "link",
|
|
16585
|
-
size: "sm",
|
|
16586
|
-
className: "mt-1 h-auto gap-1 p-0 text-xs",
|
|
16587
|
-
disabled: !hasNode(nodeId),
|
|
16588
|
-
onClick: () => onShowNode(nodeId),
|
|
16589
|
-
"data-testid": "fluidgrids-code-fidelity-node",
|
|
16590
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16591
|
-
icon: "mynaui:location",
|
|
16592
|
-
className: "size-3.5"
|
|
16593
|
-
}), tr("fluidgrids.builder.codeView.showNode", "Show node {{nodeId}}", { nodeId })]
|
|
16594
|
-
})
|
|
16595
|
-
]
|
|
16596
|
-
}, `${item.kind}-${nodeId ?? ""}-${item.path ?? ""}-${index}`);
|
|
16597
|
-
})
|
|
16598
|
-
})
|
|
16599
|
-
]
|
|
16600
|
-
});
|
|
16601
|
-
}
|
|
16602
|
-
|
|
16603
16945
|
// src/builder/components/flow-builder/components/ui/code-view-panel.tsx
|
|
16604
16946
|
/**
|
|
16605
16947
|
* CodeViewPanel — the builder's read-only Code view (BOFF-9904, spec 07 §8).
|
|
@@ -16613,31 +16955,6 @@ function FidelityReportList({ fidelity, source, hasNode, onShowNode }) {
|
|
|
16613
16955
|
* Behind the `fluidgrids.code-first` flag (default off); with the flag off
|
|
16614
16956
|
* the panel renders nothing and the header is exactly as before.
|
|
16615
16957
|
*/
|
|
16616
|
-
const LazyCodeEditorField = lazy(() => import("./code-editor-field-yJZEDJBi.js").then((n) => n.n).then((m) => ({ default: m.CodeEditorField })));
|
|
16617
|
-
/** Read-only lifted-code editor with a sized placeholder while its chunk loads. */
|
|
16618
|
-
function CodeViewEditor({ content, path, label }) {
|
|
16619
|
-
return /* @__PURE__ */ jsx(Suspense, {
|
|
16620
|
-
fallback: /* @__PURE__ */ jsx("div", {
|
|
16621
|
-
className: "min-h-[260px] rounded-md border border-border bg-muted/30",
|
|
16622
|
-
role: "status",
|
|
16623
|
-
"aria-label": label
|
|
16624
|
-
}),
|
|
16625
|
-
children: /* @__PURE__ */ jsx(LazyCodeEditorField, {
|
|
16626
|
-
value: content,
|
|
16627
|
-
language: editorLanguageOf(path),
|
|
16628
|
-
label,
|
|
16629
|
-
readOnly: true,
|
|
16630
|
-
minHeight: "260px",
|
|
16631
|
-
maxHeight: "55vh",
|
|
16632
|
-
"data-testid": "fluidgrids-code-editor"
|
|
16633
|
-
})
|
|
16634
|
-
});
|
|
16635
|
-
}
|
|
16636
|
-
function editorLanguageOf(path) {
|
|
16637
|
-
if (path.endsWith(".py")) return "python";
|
|
16638
|
-
if (path.endsWith(".ts")) return "typescript";
|
|
16639
|
-
return "javascript";
|
|
16640
|
-
}
|
|
16641
16958
|
function isCodeViewFormat(value) {
|
|
16642
16959
|
return value === "TYPESCRIPT" || value === "PYTHON";
|
|
16643
16960
|
}
|
|
@@ -16655,8 +16972,6 @@ function CodeViewSheet({ className, compact }) {
|
|
|
16655
16972
|
const version = params?.version ?? null;
|
|
16656
16973
|
const [open, setOpen] = useState(false);
|
|
16657
16974
|
const [format, setFormat] = useState("TYPESCRIPT");
|
|
16658
|
-
const [selectedPath, setSelectedPath] = useState(null);
|
|
16659
|
-
const [downloading, setDownloading] = useState(false);
|
|
16660
16975
|
const { data, loading, error, refetch } = useWorkflowCodeExport({
|
|
16661
16976
|
workflowKey,
|
|
16662
16977
|
version,
|
|
@@ -16674,10 +16989,6 @@ function CodeViewSheet({ className, compact }) {
|
|
|
16674
16989
|
open,
|
|
16675
16990
|
refetch
|
|
16676
16991
|
]);
|
|
16677
|
-
const files = useMemo(() => data ? orderedExportFiles(data.files, format) : [], [data, format]);
|
|
16678
|
-
const shown = files.find((file) => file.path === selectedPath) ?? files[0] ?? null;
|
|
16679
|
-
const shownContent = shown?.content ?? "";
|
|
16680
|
-
useEffect(() => setSelectedPath(null), [format]);
|
|
16681
16992
|
const { fitView } = useReactFlow();
|
|
16682
16993
|
const nodes = useFlowStore((s) => s.workflow.nodes);
|
|
16683
16994
|
const onNodesChange = useFlowStore((s) => s.actions.nodes.onNodesChange);
|
|
@@ -16709,26 +17020,6 @@ function CodeViewSheet({ className, compact }) {
|
|
|
16709
17020
|
showNodePropertiesOf,
|
|
16710
17021
|
fitView
|
|
16711
17022
|
]);
|
|
16712
|
-
const copy = async () => {
|
|
16713
|
-
if (!shown) return;
|
|
16714
|
-
try {
|
|
16715
|
-
await navigator.clipboard.writeText(shownContent);
|
|
16716
|
-
toast.success(tr("fluidgrids.builder.codeView.copied", "Code copied"));
|
|
16717
|
-
} catch (err) {
|
|
16718
|
-
toast.error(tr("fluidgrids.builder.codeView.copyError", "Copy failed"), { description: describeOperationError(err) });
|
|
16719
|
-
}
|
|
16720
|
-
};
|
|
16721
|
-
const download = async () => {
|
|
16722
|
-
if (!data) return;
|
|
16723
|
-
setDownloading(true);
|
|
16724
|
-
try {
|
|
16725
|
-
await downloadWorkflowCodeExport(data, format);
|
|
16726
|
-
} catch (err) {
|
|
16727
|
-
toast.error(tr("fluidgrids.builder.codeView.downloadError", "Download failed"), { description: describeOperationError(err) });
|
|
16728
|
-
} finally {
|
|
16729
|
-
setDownloading(false);
|
|
16730
|
-
}
|
|
16731
|
-
};
|
|
16732
17023
|
const label = tr("fluidgrids.builder.codeView.triggerButton", "Code");
|
|
16733
17024
|
return /* @__PURE__ */ jsxs(Sheet, {
|
|
16734
17025
|
open,
|
|
@@ -16758,120 +17049,44 @@ function CodeViewSheet({ className, compact }) {
|
|
|
16758
17049
|
icon: "mynaui:code",
|
|
16759
17050
|
className: "size-5"
|
|
16760
17051
|
}), tr("fluidgrids.builder.codeView.title", "Code")]
|
|
16761
|
-
}), /* @__PURE__ */ jsx(SheetDescription, { children: tr("fluidgrids.builder.codeView.description", "This version as code, read-only. It is what the FluidGrids CLI pulls; edit the canvas or push code with the CLI to change it.") })] }), /* @__PURE__ */
|
|
16762
|
-
className: "mt-4 flex flex-1 flex-col
|
|
16763
|
-
children:
|
|
16764
|
-
|
|
16765
|
-
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
}), /* @__PURE__ */ jsxs(Button, {
|
|
16793
|
-
variant: "outline",
|
|
16794
|
-
size: "sm",
|
|
16795
|
-
className: "h-8 gap-1 text-xs",
|
|
16796
|
-
onClick: () => void download(),
|
|
16797
|
-
disabled: !data || loading || downloading,
|
|
16798
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16799
|
-
icon: "mynaui:download",
|
|
16800
|
-
className: "size-3.5"
|
|
16801
|
-
}), tr("fluidgrids.builder.codeView.download", "Download")]
|
|
16802
|
-
})]
|
|
16803
|
-
})]
|
|
17052
|
+
}), /* @__PURE__ */ jsx(SheetDescription, { children: tr("fluidgrids.builder.codeView.description", "This version as code, read-only. It is what the FluidGrids CLI pulls; edit the canvas or push code with the CLI to change it.") })] }), /* @__PURE__ */ jsx("div", {
|
|
17053
|
+
className: "mt-4 flex flex-1 flex-col pb-6",
|
|
17054
|
+
children: /* @__PURE__ */ jsx(CodeFilesView, {
|
|
17055
|
+
format,
|
|
17056
|
+
result: data,
|
|
17057
|
+
loading,
|
|
17058
|
+
error,
|
|
17059
|
+
onRetry: () => void refetch(),
|
|
17060
|
+
download: {
|
|
17061
|
+
workflowKey: data?.workflowKey ?? workflowKey,
|
|
17062
|
+
version: data?.version ?? version ?? ""
|
|
17063
|
+
},
|
|
17064
|
+
hasNode,
|
|
17065
|
+
onShowNode: showNode,
|
|
17066
|
+
editorLabel: tr("fluidgrids.builder.codeView.editorLabel", "Workflow code (read-only)"),
|
|
17067
|
+
loadingText: tr("fluidgrids.builder.codeView.loading", "Lifting the workflow…"),
|
|
17068
|
+
emptyText: tr("fluidgrids.builder.codeView.empty", "The export returned no files."),
|
|
17069
|
+
toolbarStart: /* @__PURE__ */ jsx(Tabs, {
|
|
17070
|
+
value: format,
|
|
17071
|
+
onValueChange: (value) => {
|
|
17072
|
+
if (isCodeViewFormat(value)) setFormat(value);
|
|
17073
|
+
},
|
|
17074
|
+
children: /* @__PURE__ */ jsxs(TabsList, { children: [/* @__PURE__ */ jsx(TabsTrigger, {
|
|
17075
|
+
value: "TYPESCRIPT",
|
|
17076
|
+
"data-testid": "fluidgrids-code-tab-typescript",
|
|
17077
|
+
children: tr("fluidgrids.builder.codeView.typescript", "TypeScript")
|
|
17078
|
+
}), /* @__PURE__ */ jsx(TabsTrigger, {
|
|
17079
|
+
value: "PYTHON",
|
|
17080
|
+
"data-testid": "fluidgrids-code-tab-python",
|
|
17081
|
+
children: tr("fluidgrids.builder.codeView.python", "Python")
|
|
17082
|
+
})] })
|
|
16804
17083
|
}),
|
|
16805
|
-
dirty
|
|
17084
|
+
notice: dirty ? /* @__PURE__ */ jsx("p", {
|
|
16806
17085
|
role: "status",
|
|
16807
17086
|
className: "rounded-md border border-[var(--color-status-warning-border)] bg-[var(--color-status-warning-bg)] px-3 py-2 text-xs text-[var(--color-status-warning-text)]",
|
|
16808
17087
|
children: tr("fluidgrids.builder.codeView.unsavedNotice", "You have unsaved changes. The code shows the saved version and updates after the next save.")
|
|
16809
|
-
})
|
|
16810
|
-
|
|
16811
|
-
className: "flex items-center justify-center py-8 text-sm text-muted-foreground",
|
|
16812
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
16813
|
-
icon: "mynaui:spinner",
|
|
16814
|
-
className: "mr-2 size-4 animate-spin"
|
|
16815
|
-
}), tr("fluidgrids.builder.codeView.loading", "Lifting the workflow…")]
|
|
16816
|
-
}) : error ? /* @__PURE__ */ jsxs("div", {
|
|
16817
|
-
className: "py-6 text-sm",
|
|
16818
|
-
role: "alert",
|
|
16819
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
16820
|
-
className: "text-[var(--color-status-error-text)]",
|
|
16821
|
-
children: error
|
|
16822
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
16823
|
-
variant: "outline",
|
|
16824
|
-
size: "sm",
|
|
16825
|
-
className: "mt-3",
|
|
16826
|
-
onClick: () => void refetch(),
|
|
16827
|
-
children: tr("fluidgrids.builder.codeView.retry", "Retry")
|
|
16828
|
-
})]
|
|
16829
|
-
}) : data && shown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
16830
|
-
files.length > 1 && /* @__PURE__ */ jsx("div", {
|
|
16831
|
-
className: "flex flex-wrap gap-1",
|
|
16832
|
-
role: "group",
|
|
16833
|
-
"aria-label": tr("fluidgrids.builder.codeView.files", "Files"),
|
|
16834
|
-
children: files.map((file) => /* @__PURE__ */ jsx(Button, {
|
|
16835
|
-
variant: file === shown ? "secondary" : "ghost",
|
|
16836
|
-
size: "sm",
|
|
16837
|
-
className: "h-7 font-mono text-[11px]",
|
|
16838
|
-
title: file.path,
|
|
16839
|
-
"aria-pressed": file === shown,
|
|
16840
|
-
onClick: () => setSelectedPath(file.path),
|
|
16841
|
-
children: fileBaseName(file.path)
|
|
16842
|
-
}, file.path))
|
|
16843
|
-
}),
|
|
16844
|
-
/* @__PURE__ */ jsxs("div", {
|
|
16845
|
-
className: "flex items-center justify-between gap-2 text-[11px] text-muted-foreground",
|
|
16846
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
16847
|
-
className: "truncate font-mono",
|
|
16848
|
-
title: shown.path,
|
|
16849
|
-
children: shown.path
|
|
16850
|
-
}), /* @__PURE__ */ jsxs("span", {
|
|
16851
|
-
className: "flex shrink-0 items-center gap-2",
|
|
16852
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
16853
|
-
className: "font-mono",
|
|
16854
|
-
title: data.irHash,
|
|
16855
|
-
children: data.irHash.slice(0, 19)
|
|
16856
|
-
}), /* @__PURE__ */ jsx(FidelityLevelBadge, { fidelity: data.fidelity })]
|
|
16857
|
-
})]
|
|
16858
|
-
}),
|
|
16859
|
-
/* @__PURE__ */ jsx(CodeViewEditor, {
|
|
16860
|
-
content: shownContent,
|
|
16861
|
-
path: shown.path,
|
|
16862
|
-
label: tr("fluidgrids.builder.codeView.editorLabel", "Workflow code (read-only)")
|
|
16863
|
-
}),
|
|
16864
|
-
/* @__PURE__ */ jsx(FidelityReportList, {
|
|
16865
|
-
fidelity: data.fidelity,
|
|
16866
|
-
source: shownContent,
|
|
16867
|
-
hasNode,
|
|
16868
|
-
onShowNode: showNode
|
|
16869
|
-
})
|
|
16870
|
-
] }) : /* @__PURE__ */ jsx("p", {
|
|
16871
|
-
className: "py-6 text-sm text-muted-foreground",
|
|
16872
|
-
children: tr("fluidgrids.builder.codeView.empty", "The export returned no files.")
|
|
16873
|
-
})
|
|
16874
|
-
]
|
|
17088
|
+
}) : null
|
|
17089
|
+
})
|
|
16875
17090
|
})]
|
|
16876
17091
|
})]
|
|
16877
17092
|
});
|
|
@@ -17726,17 +17941,20 @@ function useEditingBlocked(isReadOnly) {
|
|
|
17726
17941
|
editingBlocked: isReadOnly || leaseLocked
|
|
17727
17942
|
};
|
|
17728
17943
|
}
|
|
17729
|
-
|
|
17944
|
+
/** How far out the canvas zooms to fit a whole graph when asked to. */
|
|
17945
|
+
const FIT_TO_SCREEN_MIN_ZOOM = .2;
|
|
17946
|
+
const FlowBuilder = ({ readOnly = false, fitToScreen = false }) => {
|
|
17730
17947
|
const searchParams = new URLSearchParams(window.location.search);
|
|
17731
17948
|
const isReadOnly = readOnly || searchParams.get("readonly") === "true";
|
|
17732
17949
|
const { leaseLocked, editingBlocked } = useEditingBlocked(isReadOnly);
|
|
17950
|
+
const initialMinZoom = fitToScreen ? FIT_TO_SCREEN_MIN_ZOOM : 1;
|
|
17733
17951
|
const paletteGates = usePaletteGates();
|
|
17734
17952
|
const paletteGatesRef = useRef(paletteGates);
|
|
17735
17953
|
useEffect(() => {
|
|
17736
17954
|
paletteGatesRef.current = paletteGates;
|
|
17737
17955
|
}, [paletteGates]);
|
|
17738
17956
|
useWarmBuilderOverlays();
|
|
17739
|
-
useLazyAgentTools(() => import("./agentTools-
|
|
17957
|
+
useLazyAgentTools(() => import("./agentTools-JHtYGgd7.js").then(({ createBuilderAgentTools }) => createBuilderAgentTools({ durableFunctionsEnabled: () => paletteGatesRef.current })), !editingBlocked, "Agent tools");
|
|
17740
17958
|
const [nodes, edges, onNodesChange, onEdgesChange, onConnect] = useFlowStore(useShallow((s) => {
|
|
17741
17959
|
return [
|
|
17742
17960
|
s.workflow.nodes,
|
|
@@ -17778,7 +17996,7 @@ const FlowBuilder = ({ readOnly = false }) => {
|
|
|
17778
17996
|
useEffect(() => {
|
|
17779
17997
|
fitViewRef.current = fitView;
|
|
17780
17998
|
}, [fitView]);
|
|
17781
|
-
useLazyAgentTools(() => import("./canvasNoteTools-
|
|
17999
|
+
useLazyAgentTools(() => import("./canvasNoteTools-B2ouyIbj.js").then(({ createCanvasNoteTools }) => createCanvasNoteTools({ focusNode: (nodeId) => fitViewRef.current({
|
|
17782
18000
|
nodes: [{ id: nodeId }],
|
|
17783
18001
|
duration: 400,
|
|
17784
18002
|
padding: .6,
|
|
@@ -17856,7 +18074,7 @@ const FlowBuilder = ({ readOnly = false }) => {
|
|
|
17856
18074
|
/* @__PURE__ */ jsxs(ReactFlow, {
|
|
17857
18075
|
proOptions: { hideAttribution: true },
|
|
17858
18076
|
onInit: ({ fitView }) => fitView({
|
|
17859
|
-
minZoom:
|
|
18077
|
+
minZoom: initialMinZoom,
|
|
17860
18078
|
maxZoom: 1
|
|
17861
18079
|
}).then(),
|
|
17862
18080
|
nodeTypes,
|
|
@@ -17882,9 +18100,10 @@ const FlowBuilder = ({ readOnly = false }) => {
|
|
|
17882
18100
|
snapToGrid: true,
|
|
17883
18101
|
fitView: true,
|
|
17884
18102
|
fitViewOptions: {
|
|
17885
|
-
minZoom:
|
|
18103
|
+
minZoom: initialMinZoom,
|
|
17886
18104
|
maxZoom: 1
|
|
17887
18105
|
},
|
|
18106
|
+
...fitToScreen ? { minZoom: FIT_TO_SCREEN_MIN_ZOOM } : {},
|
|
17888
18107
|
defaultEdgeOptions: edgeOptions,
|
|
17889
18108
|
children: [/* @__PURE__ */ jsx(Background, { gap: 24 }), /* @__PURE__ */ jsx(CanvasNotesLayer, {})]
|
|
17890
18109
|
}),
|
|
@@ -17914,8 +18133,8 @@ const FlowBuilder = ({ readOnly = false }) => {
|
|
|
17914
18133
|
})
|
|
17915
18134
|
]
|
|
17916
18135
|
}),
|
|
17917
|
-
/* @__PURE__ */ jsx(ChatPanel, {}),
|
|
17918
|
-
/* @__PURE__ */ jsx(LogsPanel, {}),
|
|
18136
|
+
!isReadOnly && /* @__PURE__ */ jsx(ChatPanel, {}),
|
|
18137
|
+
!isReadOnly && /* @__PURE__ */ jsx(LogsPanel, {}),
|
|
17919
18138
|
ndvEverOpened && /* @__PURE__ */ jsx(Suspense, {
|
|
17920
18139
|
fallback: null,
|
|
17921
18140
|
children: /* @__PURE__ */ jsx(LazyNodeDetailView, {})
|
|
@@ -18023,7 +18242,7 @@ function HistoricalRunLoader() {
|
|
|
18023
18242
|
]);
|
|
18024
18243
|
return null;
|
|
18025
18244
|
}
|
|
18026
|
-
const FlowBuilderPage = ({ workflow, readOnly = false }) => {
|
|
18245
|
+
const FlowBuilderPage = ({ workflow, readOnly = false, fitToScreen = false }) => {
|
|
18027
18246
|
const setWorkflow = useFlowStore((s) => s.actions.setWorkflow);
|
|
18028
18247
|
const searchParams = new URLSearchParams(window.location.search);
|
|
18029
18248
|
const isReadOnly = readOnly || searchParams.get("readonly") === "true";
|
|
@@ -18069,7 +18288,10 @@ const FlowBuilderPage = ({ workflow, readOnly = false }) => {
|
|
|
18069
18288
|
className: "relative flex grow min-h-0 divide-x divide-card-foreground/10",
|
|
18070
18289
|
children: [/* @__PURE__ */ jsx("div", {
|
|
18071
18290
|
className: "grow min-w-0 bg-card md:bg-transparent",
|
|
18072
|
-
children: /* @__PURE__ */ jsx(FlowBuilder, {
|
|
18291
|
+
children: /* @__PURE__ */ jsx(FlowBuilder, {
|
|
18292
|
+
readOnly: isReadOnly,
|
|
18293
|
+
fitToScreen
|
|
18294
|
+
})
|
|
18073
18295
|
}), !isReadOnly && !leaseLocked && /* @__PURE__ */ jsx(SidebarModule, {})]
|
|
18074
18296
|
})
|
|
18075
18297
|
})
|