@manta-eu/react 0.1.8 → 0.1.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.
@@ -11,6 +11,7 @@ type ActioningViewProps = {
11
11
  datastoreId?: string;
12
12
  userId?: string;
13
13
  hideTopBar?: boolean;
14
+ hideRunControls?: boolean;
14
15
  chatIri?: string;
15
16
  completedChangesSlot?: ReactNode;
16
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ActioningView.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ActioningView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAGtF,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAclF,OAAO,EAA0B,KAAK,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAM1G,KAAK,kBAAkB,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;IACtB,gBAAgB,CAAC,EAAE,4BAA4B,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAClC,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAyLtD"}
1
+ {"version":3,"file":"ActioningView.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ActioningView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAGtF,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAclF,OAAO,EAA0B,KAAK,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAM1G,KAAK,kBAAkB,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;IACtB,gBAAgB,CAAC,EAAE,4BAA4B,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAClC,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CA8LtD"}
@@ -21,16 +21,18 @@ import { useActionPlanDiff, useActionPlanExecutionProvenance, useManualActions }
21
21
  import { getPendingManualActions } from "#lib/manual-actions";
22
22
  import { cn } from "#lib/utils";
23
23
  export function ActioningView(props) {
24
- const { planGraphIri, diff, isLoading, executionControl, executePromptNonce, datastoreId, userId, hideTopBar = false, chatIri, completedChangesSlot, } = props;
24
+ const { planGraphIri, diff, isLoading, executionControl, executePromptNonce, datastoreId, userId, hideTopBar = false, hideRunControls = false, chatIri, completedChangesSlot, } = props;
25
25
  const planName = extractPlanName(planGraphIri);
26
26
  const [isExecuteDialogOpen, setIsExecuteDialogOpen] = useState(false);
27
27
  const internalExecutionControl = useActionPlanExecution(planGraphIri, chatIri);
28
28
  const { execute, isTriggered, triggeredAtMs, dryRun, workflowId, triggerError } = executionControl ?? internalExecutionControl;
29
29
  useEffect(() => {
30
+ if (hideRunControls)
31
+ return;
30
32
  if ((executePromptNonce ?? 0) > 0) {
31
33
  setIsExecuteDialogOpen(true);
32
34
  }
33
- }, [executePromptNonce]);
35
+ }, [executePromptNonce, hideRunControls]);
34
36
  const { plan } = useActionPlanDetail(planGraphIri);
35
37
  const hasCurrentFacts = plan?.hasCurrentFacts ?? false;
36
38
  const { data: fetchedDiff } = useActionPlanDiff({ planGraphIri, enabled: !!planGraphIri });
@@ -79,6 +81,9 @@ export function ActioningView(props) {
79
81
  toast.error(nextDryRun ? "Failed to preview plan re-run" : "Failed to re-run plan");
80
82
  }
81
83
  }, [execute]);
84
+ const canRunPlan = !hideRunControls && hasCurrentFacts;
85
+ const onExecute = canRunPlan ? handleExecute : undefined;
86
+ const onRerun = canRunPlan ? handleConfirmRerun : undefined;
82
87
  const manualActionEntities = useManualActionTargets(manualActions);
83
88
  const entityTypes = useMemo(() => {
84
89
  if (!ldoDiff)
@@ -111,6 +116,6 @@ export function ActioningView(props) {
111
116
  return Array.from(byType.values());
112
117
  }, [entityTypes, manualActions]);
113
118
  const completedChanges = executionStatus === "completed" ? completedChangesSlot : null;
114
- return (_jsxs("div", { className: cn("flex flex-col", !hideTopBar && "h-full bg-background"), children: [!hideTopBar && (_jsx(ExecutionTopBar, { planName: planName, status: executionStatus, workflowId: workflowId, triggerError: triggerError, onExecute: hasCurrentFacts ? handleExecute : undefined, onRerun: hasCurrentFacts ? handleConfirmRerun : undefined, isExecuteDialogOpen: isExecuteDialogOpen, onExecuteDialogOpenChange: setIsExecuteDialogOpen, isDryRun: isDryRun })), !hideTopBar && isDryRunCompleted && _jsx(DryRunCompleteBanner, {}), _jsx("div", { className: cn(!hideTopBar && "flex-1 overflow-y-auto"), children: _jsxs("div", { className: cn("space-y-6", hideTopBar ? "mx-auto w-full max-w-7xl px-8" : "mx-auto max-w-[960px] px-16 py-8"), children: [!hideTopBar && plan && !plan.hasCurrentFacts && (_jsx(UnavailablePlanNotice, { hasExecutionHistory: plan.hasExecutionHistory })), executionStatus === "failed" && (provenance?.planErrorMessage || triggerError) && (_jsx(FailedBanner, { message: provenance?.planErrorMessage ?? triggerError ?? "Execution failed" })), isLoading && !isPresent(effectiveEntityTypes) && (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader, { className: "size-6" }) })), plan && (_jsx(SummaryBar, { plan: plan, executionStatus: executionStatus, startedAtMs: planStartedAtMs, endedAtMs: planEndedAtMs })), completedChanges ??
119
+ return (_jsxs("div", { className: cn("flex flex-col", !hideTopBar && "h-full bg-background"), children: [!hideTopBar && (_jsx(ExecutionTopBar, { planName: planName, status: executionStatus, workflowId: workflowId, triggerError: triggerError, onExecute: onExecute, onRerun: onRerun, isExecuteDialogOpen: isExecuteDialogOpen, onExecuteDialogOpenChange: setIsExecuteDialogOpen, isDryRun: isDryRun })), !hideTopBar && isDryRunCompleted && _jsx(DryRunCompleteBanner, {}), _jsx("div", { className: cn(!hideTopBar && "flex-1 overflow-y-auto"), children: _jsxs("div", { className: cn("space-y-6", hideTopBar ? "mx-auto w-full max-w-7xl px-8" : "mx-auto max-w-[960px] px-16 py-8"), children: [!hideTopBar && plan && !plan.hasCurrentFacts && (_jsx(UnavailablePlanNotice, { hasExecutionHistory: plan.hasExecutionHistory })), executionStatus === "failed" && (provenance?.planErrorMessage || triggerError) && (_jsx(FailedBanner, { message: provenance?.planErrorMessage ?? triggerError ?? "Execution failed" })), isLoading && !isPresent(effectiveEntityTypes) && (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader, { className: "size-6" }) })), plan && (_jsx(SummaryBar, { plan: plan, executionStatus: executionStatus, startedAtMs: planStartedAtMs, endedAtMs: planEndedAtMs })), completedChanges ??
115
120
  (isPresent(effectiveEntityTypes) && (_jsx(ExecutionSections, { entityTypes: effectiveEntityTypes, provenance: provenance ?? null, manualActions: manualActions, manualActionEntities: manualActionEntities, activeStartedAtMs: activeStartedAtMs, onManualActionResolve: manualActionResolver.resolve, resolvingManualAction: manualActionResolver.resolving, canResolveManualAction: manualActionResolver.canResolve, manualActionDisabledReason: manualActionResolver.disabledReason })))] }) })] }));
116
121
  }
@@ -1 +1 @@
1
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AAe;;;AAYxB,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -39,7 +39,10 @@ const SelectValue = SelectPrimitive.Value;
39
39
  function SelectTrigger(props) {
40
40
  const { className, children, size = "base", hideChevron, label, error, hiddenLabel, required, ref, "aria-invalid": ariaInvalid, ...otherProps } = props;
41
41
  const errorId = `${otherProps.id}-error`;
42
- return (_jsxs("div", { className: "flex w-full flex-col gap-1.5", children: [label && (_jsx("div", { className: cn("flex justify-between items-end gap-2", hiddenLabel && "sr-only"), children: _jsxs("label", { htmlFor: otherProps.id, className: "typography-small text-default-foreground", children: [label, required && _jsx("span", { className: "text-error-foreground ml-1", children: "*" })] }) })), _jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn(createSelectClassName({ size }), className), "aria-invalid": ariaInvalid ?? (error ? true : undefined), "aria-errormessage": error ? errorId : undefined, ...otherProps, children: [_jsx("span", { className: "flex-1 min-w-0 truncate", children: children }), _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: cn("size-4 shrink-0 text-muted-foreground", hideChevron && "hidden") }) })] }), error && (_jsx("p", { id: errorId, className: "typography-small text-error-foreground", children: error }))] }));
42
+ return (_jsxs("div", { className: "flex w-full flex-col gap-1.5", children: [label && (_jsx("div", { className: cn("flex justify-between items-end gap-2", hiddenLabel && "sr-only"), children: _jsxs("label", { htmlFor: otherProps.id, className: "typography-small text-default-foreground", onClick: (event) => {
43
+ event.preventDefault();
44
+ event.currentTarget.control?.focus();
45
+ }, children: [label, required && _jsx("span", { className: "text-error-foreground ml-1", children: "*" })] }) })), _jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn(createSelectClassName({ size }), className), "aria-invalid": ariaInvalid ?? (error ? true : undefined), "aria-errormessage": error ? errorId : undefined, ...otherProps, children: [_jsx("span", { className: "flex-1 min-w-0 truncate", children: children }), _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: cn("size-4 shrink-0 text-muted-foreground", hideChevron && "hidden") }) })] }), error && (_jsx("p", { id: errorId, className: "typography-small text-error-foreground", children: error }))] }));
43
46
  }
44
47
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
45
48
  function SelectScrollUpButton(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"use-connection-problems.d.ts","sourceRoot":"","sources":["../../src/hooks/use-connection-problems.ts"],"names":[],"mappings":"AAKA,wBAAgB,qBAAqB;;;;;;;;;kBAMm50H,CAAC;;YAAsC,CAAC;;IAD/90H"}
1
+ {"version":3,"file":"use-connection-problems.d.ts","sourceRoot":"","sources":["../../src/hooks/use-connection-problems.ts"],"names":[],"mappings":"AAKA,wBAAgB,qBAAqB;;;;;;;;;kBAMgi2H,CAAC;;YAAsC,CAAC;;IAD5m2H"}
@@ -1 +1 @@
1
- {"version":3,"file":"useValidateActionPlan.d.ts","sourceRoot":"","sources":["../../src/hooks/useValidateActionPlan.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS;;;;;;;;;sBAkB4gkJ,CAAC;;sBAAwE,CAAC;iBAA8B,CAAC;uBAAoC,CAAC;;;mBAA+G,CAAC;;;;;EADt2kJ"}
1
+ {"version":3,"file":"useValidateActionPlan.d.ts","sourceRoot":"","sources":["../../src/hooks/useValidateActionPlan.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS;;;;;;;;;sBAkB++lJ,CAAC;;sBAAwE,CAAC;iBAA8B,CAAC;uBAAoC,CAAC;;;mBAA+G,CAAC;;;;;EADz0mJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"InferalCredentialConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/InferalCredentialConnectForm.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAU1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMvF,MAAM,MAAM,eAAe,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACzD,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IAClF,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAE7B,QAAQ,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,uBAAuB,CAAC;CACnF,CAAC;AAKF,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D;AAcD,KAAK,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AASjG,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,OAAO,GACvB,OAAO,CAET;AA6DD,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,EAC5C,MAAM,EAAE,2BAA2B,CAAC,GAAG,CAAC,EACxC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,EAC5D,KAAK,CAAC,EAAE,yBAAyB,GAChC,UAAU,CAAC,MAAM,CAAC,EAAE,CAqFtB;AAED,MAAM,MAAM,iCAAiC,CAAC,GAAG,SAAS,MAAM,IAAI,gBAAgB,GAAG;IACrF,MAAM,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC;CAC1C,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,CAAC,2CAmG7G"}
1
+ {"version":3,"file":"InferalCredentialConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/InferalCredentialConnectForm.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAE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,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AASjG,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,OAAO,GACvB,OAAO,CAET;AA6DD,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,EAC5C,MAAM,EAAE,2BAA2B,CAAC,GAAG,CAAC,EACxC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,EAC5D,KAAK,CAAC,EAAE,yBAAyB,GAChC,UAAU,CAAC,MAAM,CAAC,EAAE,CAqFtB;AAED,MAAM,MAAM,iCAAiC,CAAC,GAAG,SAAS,MAAM,IAAI,gBAAgB,GAAG;IACrF,MAAM,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC;CAC1C,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,CAAC,2CAmG7G"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from "@hookform/resolvers/zod";
3
3
  import { GQLInferalLocation, useCreateInferalIntegrationMutation, } from "@manta-eu/client";
4
4
  import { parseError } from "@manta-eu/client/shared/error-utils";
5
+ import { inferalStreamNameMaxLength } from "@manta-eu/client/shared/inferal-stream";
5
6
  import { isPresent } from "@manta-eu/lib/present";
6
7
  import { Fragment, useEffect, useMemo, useState } from "react";
7
8
  import { Controller, useForm } from "react-hook-form";
@@ -23,7 +24,7 @@ const streamNameSchema = z
23
24
  .string()
24
25
  .trim()
25
26
  .min(1, "Stream name is required")
26
- .max(64, "64 characters or fewer")
27
+ .max(inferalStreamNameMaxLength, `${inferalStreamNameMaxLength} characters or fewer`)
27
28
  .regex(/^[a-zA-Z0-9_:-]+$/, "Use letters, numbers, dashes (-), underscores (_), or colons (:). No spaces.");
28
29
  function blankValues(fields) {
29
30
  return { ...Object.fromEntries(fields.map((field) => [field.key, ""])), streamName: "" };
@@ -9,6 +9,7 @@ export type ActionPlanPageProps = {
9
9
  initialMode?: ActionPlanPageMode;
10
10
  datastoreId?: string;
11
11
  userId?: string;
12
+ hideRunControls?: boolean;
12
13
  };
13
14
  export declare function ActionPlanPage(props: ActionPlanPageProps): import("react/jsx-runtime").JSX.Element;
14
15
  //# sourceMappingURL=ActionPlanPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionPlanPage.d.ts","sourceRoot":"","sources":["../../../../src/routes/plans/components/ActionPlanPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAgC,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAahH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;IAC1D,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAqLxD"}
1
+ {"version":3,"file":"ActionPlanPage.d.ts","sourceRoot":"","sources":["../../../../src/routes/plans/components/ActionPlanPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAgC,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAahH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;IAC1D,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CA6LxD"}
@@ -18,7 +18,7 @@ import { useActionPlanExecution } from "#hooks/useActionPlanExecution";
18
18
  import { useActionPlanDiff } from "#ldo-ui";
19
19
  import { useMantaClient } from "#providers/index";
20
20
  export function ActionPlanPage(props) {
21
- const { planName, listHref = "/", LinkComponent = "a", renderLayout = renderDefaultActionPlanFrame, initialMode = "planning", datastoreId, userId, } = props;
21
+ const { planName, listHref = "/", LinkComponent = "a", renderLayout = renderDefaultActionPlanFrame, initialMode = "planning", datastoreId, userId, hideRunControls = false, } = props;
22
22
  const planGraphIri = useMemo(() => buildPlanIri(planName), [planName]);
23
23
  const viewRef = useRef(null);
24
24
  const { mantaBaseUrl } = useMantaClient();
@@ -48,13 +48,13 @@ export function ActionPlanPage(props) {
48
48
  }
49
49
  }, [executionControl]);
50
50
  useEffect(() => {
51
- if (initialMode === "actioning") {
51
+ if (!hideRunControls && initialMode === "actioning") {
52
52
  setPageMode("actioning");
53
53
  setExecutePromptNonce((prev) => prev + 1);
54
54
  return;
55
55
  }
56
56
  setPageMode("planning");
57
- }, [initialMode, planGraphIri]);
57
+ }, [hideRunControls, initialMode, planGraphIri]);
58
58
  useEffect(() => {
59
59
  const shouldShowExecution = (plan?.state ?? GQLActionPlanState.Draft) !== GQLActionPlanState.Draft;
60
60
  if (shouldShowExecution) {
@@ -67,7 +67,11 @@ export function ActionPlanPage(props) {
67
67
  const isRunning = planState === GQLActionPlanState.Running;
68
68
  const isTerminal = isTerminalActionPlanState(planState);
69
69
  const showPlanningSurface = !plan || (isDraft && pageMode === "planning");
70
- const header = (_jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsxs("h1", { className: "flex items-center gap-2 typography-caption-medium", children: [_jsx(Zap, { className: "size-6" }), _jsx(LinkComponent, { href: listHref, to: listHref, className: "text-muted-foreground transition-colors hover:text-default-foreground", children: "Action Plans" }), _jsx("span", { className: "text-disabled-foreground", children: "/" }), _jsx("span", { className: "typography-small-medium", children: planLabel })] }), _jsxs("div", { className: "ml-2 flex shrink-0 items-center gap-2", children: [plan?.hasCurrentFacts && isDraft && pageMode === "planning" && (_jsx(Button, { onClick: openExecutionPrompt, variant: "primary", size: "base", icon: Zap, label: "Execute plan", rounded: "md", className: "text-nowrap" })), plan && isRunning && showPlanningSurface && (_jsx(Button, { onClick: () => viewRef.current?.cancel(), variant: "tertiary", size: "base", icon: CircleStop, label: "Cancel", rounded: "md", className: "text-nowrap" })), plan?.hasCurrentFacts && isTerminal && (_jsx(Button, { onClick: () => setIsRerunDialogOpen(true), variant: "primary", size: "base", icon: RotateCcw, label: "Re-run", rounded: "md", className: "text-nowrap" }))] })] }));
71
- const body = (_jsxs(_Fragment, { children: [isLoading && (_jsx("div", { className: "flex min-h-96 items-center justify-center", children: _jsx(Loader, { className: "size-8 text-muted-foreground" }) })), !isLoading && (error || !plan) && (_jsxs("div", { className: "flex min-h-96 flex-col items-center justify-center gap-4", children: [_jsx("p", { className: "text-muted-foreground", children: error ?? "Action plan not found." }), _jsx(LinkComponent, { href: listHref, to: listHref, className: "typography-small text-muted-foreground underline transition-colors hover:text-default-foreground", children: "Back to Action Plans" })] })), !isLoading && plan && showPlanningSurface && (_jsx(ConnectedPlanDetailView, { ref: viewRef, plan: plan, graphDocument: graphDocument, isLoading: isLoading, error: error, hideTopBar: true, hideChanges: true, onExecute: plan.hasCurrentFacts ? openExecutionPrompt : undefined, rulesSlot: _jsx(ActionPlanRulesSection, { planGraphIri: planGraphIri, LinkComponent: LinkComponent }) })), !isLoading && plan && !showPlanningSurface && (_jsx(ActioningView, { planGraphIri: planGraphIri, diff: diff, isLoading: isLoading || isDiffLoading, mantaChatBaseUrl: mantaBaseUrl, executionControl: executionControl, executePromptNonce: executePromptNonce, datastoreId: datastoreId, userId: userId })), _jsx(ExecutePlanDialog, { action: "rerun", onConfirm: handleConfirmRerun, open: isRerunDialogOpen, onOpenChange: setIsRerunDialogOpen, trigger: null })] }));
70
+ const showExecutePlan = !hideRunControls && Boolean(plan?.hasCurrentFacts) && isDraft && pageMode === "planning";
71
+ const showCancelRun = !hideRunControls && Boolean(plan) && isRunning && showPlanningSurface;
72
+ const showRerunPlan = !hideRunControls && Boolean(plan?.hasCurrentFacts) && isTerminal;
73
+ const openExecution = !hideRunControls && plan?.hasCurrentFacts ? openExecutionPrompt : undefined;
74
+ const header = (_jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsxs("h1", { className: "flex items-center gap-2 typography-caption-medium", children: [_jsx(Zap, { className: "size-6" }), _jsx(LinkComponent, { href: listHref, to: listHref, className: "text-muted-foreground transition-colors hover:text-default-foreground", children: "Action Plans" }), _jsx("span", { className: "text-disabled-foreground", children: "/" }), _jsx("span", { className: "typography-small-medium", children: planLabel })] }), _jsxs("div", { className: "ml-2 flex shrink-0 items-center gap-2", children: [showExecutePlan && (_jsx(Button, { onClick: openExecutionPrompt, variant: "primary", size: "base", icon: Zap, label: "Execute plan", rounded: "md", className: "text-nowrap" })), showCancelRun && (_jsx(Button, { onClick: () => viewRef.current?.cancel(), variant: "tertiary", size: "base", icon: CircleStop, label: "Cancel", rounded: "md", className: "text-nowrap" })), showRerunPlan && (_jsx(Button, { onClick: () => setIsRerunDialogOpen(true), variant: "primary", size: "base", icon: RotateCcw, label: "Re-run", rounded: "md", className: "text-nowrap" }))] })] }));
75
+ const body = (_jsxs(_Fragment, { children: [isLoading && (_jsx("div", { className: "flex min-h-96 items-center justify-center", children: _jsx(Loader, { className: "size-8 text-muted-foreground" }) })), !isLoading && (error || !plan) && (_jsxs("div", { className: "flex min-h-96 flex-col items-center justify-center gap-4", children: [_jsx("p", { className: "text-muted-foreground", children: error ?? "Action plan not found." }), _jsx(LinkComponent, { href: listHref, to: listHref, className: "typography-small text-muted-foreground underline transition-colors hover:text-default-foreground", children: "Back to Action Plans" })] })), !isLoading && plan && showPlanningSurface && (_jsx(ConnectedPlanDetailView, { ref: viewRef, plan: plan, graphDocument: graphDocument, isLoading: isLoading, error: error, hideTopBar: true, hideChanges: true, onExecute: openExecution, rulesSlot: _jsx(ActionPlanRulesSection, { planGraphIri: planGraphIri, LinkComponent: LinkComponent }) })), !isLoading && plan && !showPlanningSurface && (_jsx(ActioningView, { planGraphIri: planGraphIri, diff: diff, isLoading: isLoading || isDiffLoading, mantaChatBaseUrl: mantaBaseUrl, executionControl: executionControl, executePromptNonce: executePromptNonce, datastoreId: datastoreId, userId: userId, hideRunControls: hideRunControls })), !hideRunControls && (_jsx(ExecutePlanDialog, { action: "rerun", onConfirm: handleConfirmRerun, open: isRerunDialogOpen, onOpenChange: setIsRerunDialogOpen, trigger: null }))] }));
72
76
  return _jsx(_Fragment, { children: renderLayout({ header, body }) });
73
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DatalogBodyFormulaComponent.d.ts","sourceRoot":"","sources":["../../../src/rules/datalog-ast/DatalogBodyFormulaComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,kBAAkB,EAInB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG1D,KAAK,gCAAgC,GAAG;IACtC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACpD,CAAC;AAsBF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,2CAgIlF"}
1
+ {"version":3,"file":"DatalogBodyFormulaComponent.d.ts","sourceRoot":"","sources":["../../../src/rules/datalog-ast/DatalogBodyFormulaComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,kBAAkB,EAInB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG1D,KAAK,gCAAgC,GAAG;IACtC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACpD,CAAC;AA8BF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,2CAgIlF"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { isPresent } from "@manta-eu/lib/present";
3
3
  import { Minus } from "lucide-react";
4
4
  import { match, P } from "ts-pattern";
@@ -11,6 +11,9 @@ function renderAggregateExpression(binding, variableColors, hoverState, onVariab
11
11
  return "*";
12
12
  }
13
13
  const first = renderExpressionWithVariables(binding.expression, variableColors, hoverState, onVariableHover);
14
+ if (binding.percentile !== undefined) {
15
+ return (_jsxs(_Fragment, { children: [first, _jsxs("span", { className: "text-orange-100 font-mono", children: ["; PERCENTILE=\"", binding.percentile, "\""] })] }));
16
+ }
14
17
  if (!binding.secondExpression)
15
18
  return first;
16
19
  return (_jsxs(_Fragment, { children: [first, _jsx("span", { className: "text-orange-100 font-mono", children: ", " }), renderExpressionWithVariables(binding.secondExpression, variableColors, hoverState, onVariableHover)] }));
@@ -1,4 +1,5 @@
1
1
  import type { AggregateBinding, DatalogExpression } from "@manta-eu/datalog-parser";
2
2
  import { type NarrativeSegment } from "./rule-narrative-format.js";
3
+ export declare function percentileLabel(percentile: string): string;
3
4
  export declare function aggregateBindingSegments(binding: AggregateBinding, expressionSegments: (expression: DatalogExpression) => NarrativeSegment[]): NarrativeSegment[];
4
5
  //# sourceMappingURL=rule-narrative-aggregates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rule-narrative-aggregates.d.ts","sourceRoot":"","sources":["../../src/rules/rule-narrative-aggregates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,iBAAiB,EAGlB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE1F,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,gBAAgB,EAAE,GACxE,gBAAgB,EAAE,CAyDpB"}
1
+ {"version":3,"file":"rule-narrative-aggregates.d.ts","sourceRoot":"","sources":["../../src/rules/rule-narrative-aggregates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,iBAAiB,EAIlB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK1F,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,gBAAgB,EAAE,GACxE,gBAAgB,EAAE,CAsEpB"}
@@ -1,5 +1,14 @@
1
1
  import { match, P } from "ts-pattern";
2
2
  import { codeSegment, textSegment } from "./rule-narrative-format.js";
3
+ const ordinalSuffixes = { one: "st", two: "nd", few: "rd", other: "th" };
4
+ const ordinalRules = new Intl.PluralRules("en-US", { type: "ordinal" });
5
+ export function percentileLabel(percentile) {
6
+ const percent = Number((Number(percentile) * 100).toPrecision(12));
7
+ if (!Number.isInteger(percent))
8
+ return `${percent}th percentile`;
9
+ const category = ordinalRules.select(percent);
10
+ return `${percent}${category in ordinalSuffixes ? ordinalSuffixes[category] : "th"} percentile`;
11
+ }
3
12
  export function aggregateBindingSegments(binding, expressionSegments) {
4
13
  const operand = (expression) => {
5
14
  if (expression === "*")
@@ -24,6 +33,7 @@ export function aggregateBindingSegments(binding, expressionSegments) {
24
33
  textSegment(` is ${order} (ties choose the ${tieOrder} result)`),
25
34
  ...(binding.distinct ? [textSegment(" (ignoring duplicate pairs)")] : []),
26
35
  ];
36
+ const percentile = (binding, phrase) => unary(binding, `${phrase}${percentileLabel(binding.percentile)} of `);
27
37
  return match(binding)
28
38
  .returnType()
29
39
  .with({ function: P.optional(undefined) }, (binding) => expressionSegments(binding.expression))
@@ -39,6 +49,16 @@ export function aggregateBindingSegments(binding, expressionSegments) {
39
49
  ...unary(binding, binding.distinct ? "the " : "the values of "),
40
50
  textSegment(" multiplied together"),
41
51
  ])
52
+ .with({ function: "VAR_POP" }, (binding) => unary(binding, "the population variance of "))
53
+ .with({ function: "VAR_SAMP" }, (binding) => unary(binding, "the sample variance of "))
54
+ .with({ function: "STDDEV_POP" }, (binding) => unary(binding, "the population standard deviation of "))
55
+ .with({ function: "STDDEV_SAMP" }, (binding) => unary(binding, "the sample standard deviation of "))
56
+ .with({ function: "MODE" }, (binding) => [
57
+ ...unary(binding, "the most common of "),
58
+ textSegment(" (ties choose the lowest value)"),
59
+ ])
60
+ .with({ function: "PERCENTILE_CONT" }, (binding) => percentile(binding, "the interpolated "))
61
+ .with({ function: "PERCENTILE_DISC" }, (binding) => percentile(binding, "the nearest value to the "))
42
62
  .with({ function: "COUNT_MIN" }, (binding) => countExtreme(binding, "lowest"))
43
63
  .with({ function: "COUNT_MAX" }, (binding) => countExtreme(binding, "highest"))
44
64
  .with({ function: "MIN_ARGMIN" }, (binding) => selection(binding, "lowest", "lowest"))
@@ -1 +1 @@
1
- {"version":3,"file":"rule-narrative-context.d.ts","sourceRoot":"","sources":["../../src/rules/rule-narrative-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAE/E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAyDzE"}
1
+ {"version":3,"file":"rule-narrative-context.d.ts","sourceRoot":"","sources":["../../src/rules/rule-narrative-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAE/E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAmDzE"}
@@ -1,10 +1,10 @@
1
- import { classAssertionFromAtom, isDatalogAtom, isVariableTerm, propertyAssertionFromAtom, variableNamesFromAtom, } from "@manta-eu/datalog-parser";
1
+ import { classAssertionFromAtom, isDatalogAtom, isVariableTerm, mintedVariableNames as ruleMintedVariableNames, propertyAssertionFromAtom, variableNamesFromAtom, } from "@manta-eu/datalog-parser";
2
2
  import { isOwlNothing } from "@manta-eu/rdf-lib/namespaces";
3
3
  import { match } from "ts-pattern";
4
4
  export function buildNarrativeContext(rule) {
5
5
  const entityVariableNames = new Set();
6
6
  const outputVariableNames = new Set();
7
- const skolemVariableNames = new Set();
7
+ const mintedVariableNames = ruleMintedVariableNames(rule);
8
8
  const variableLabels = new Map();
9
9
  const setLabel = (name, label) => {
10
10
  if (!variableLabels.has(name))
@@ -34,12 +34,6 @@ export function buildNarrativeContext(rule) {
34
34
  .with({ type: "triple" }, (triple) => {
35
35
  if (isVariableTerm(triple.subject))
36
36
  entityVariableNames.add(triple.subject.name);
37
- })
38
- .with({ type: "skolem" }, (skolem) => {
39
- const lastArg = skolem.args[skolem.args.length - 1];
40
- if (lastArg?.type === "term" && isVariableTerm(lastArg.term)) {
41
- skolemVariableNames.add(lastArg.term.name);
42
- }
43
37
  })
44
38
  .with({ type: "negation" }, (negation) => negation.formulas.forEach(visit))
45
39
  .with({ type: "aggregate" }, (aggregate) => aggregate.atoms.forEach(visit))
@@ -53,7 +47,7 @@ export function buildNarrativeContext(rule) {
53
47
  return {
54
48
  showEntityVariables: entityVariableNames.size > 1,
55
49
  outputVariableNames,
56
- skolemVariableNames,
50
+ mintedVariableNames,
57
51
  variableLabels,
58
52
  };
59
53
  }
@@ -51,7 +51,7 @@ export type VariableLabel = {
51
51
  export type NarrativeContext = {
52
52
  showEntityVariables: boolean;
53
53
  outputVariableNames: ReadonlySet<string>;
54
- skolemVariableNames: ReadonlySet<string>;
54
+ mintedVariableNames: ReadonlySet<string>;
55
55
  variableLabels: ReadonlyMap<string, VariableLabel>;
56
56
  };
57
57
  export declare const narrativeDatalogTextOptions: {
@@ -1 +1 @@
1
- {"version":3,"file":"rule-narrative.d.ts","sourceRoot":"","sources":["../../src/rules/rule-narrative.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBL,KAAK,WAAW,EAMjB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EASL,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,WAAW,CAAC;IACjB,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACvC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAGrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,kBAAkB,EAAE,CAa1E"}
1
+ {"version":3,"file":"rule-narrative.d.ts","sourceRoot":"","sources":["../../src/rules/rule-narrative.ts"],"names":[],"mappings":"AAAA,OAAO,EAkBL,KAAK,WAAW,EAMjB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EASL,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,WAAW,CAAC;IACjB,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACvC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAGrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,kBAAkB,EAAE,CAa1E"}
@@ -1,4 +1,4 @@
1
- import { atomToDatalogText, classAssertionFromAtom, expressionToDatalogText, isDatalogAtom, isIriTerm, isVariableTerm, propertyAssertionFromAtom, simpleComparisonFromFilter, termToDatalogText, } from "@manta-eu/datalog-parser";
1
+ import { atomToDatalogText, classAssertionFromAtom, expressionToDatalogText, isDatalogAtom, isIriTerm, isVariableTerm, propertyAssertionFromAtom, simpleComparisonFromFilter, termToDatalogText, variableNamesFromExpression, } from "@manta-eu/datalog-parser";
2
2
  import { isPresent } from "@manta-eu/lib/present";
3
3
  import { isActionPlanGraphIri, isOwlNothing } from "@manta-eu/rdf-lib/namespaces";
4
4
  import { match, P } from "ts-pattern";
@@ -175,6 +175,9 @@ function buildBodyRow(formula, primary, merged, renderer) {
175
175
  .with({ type: "negation" }, (negation) => buildNegationRow(negation, renderer))
176
176
  .with({ type: "aggregate" }, (aggregate) => buildAggregateRow(aggregate, renderer))
177
177
  .with({ type: "bind" }, (bind) => {
178
+ if (renderer.context.mintedVariableNames.has(bind.variable)) {
179
+ return createEntityRow(bind.variable, mintInputs(bind.expression), renderer);
180
+ }
178
181
  const row = {
179
182
  segments: [
180
183
  textSegment("Calculate "),
@@ -191,11 +194,7 @@ function buildBodyRow(formula, primary, merged, renderer) {
191
194
  const lastArg = skolem.args[skolem.args.length - 1];
192
195
  const inputs = skolem.args.slice(0, -1);
193
196
  if (lastArg?.type === "term" && isVariableTerm(lastArg.term)) {
194
- const segments = [textSegment("Create entity "), variableSegment(lastArg.term.name)];
195
- if (isPresent(inputs)) {
196
- segments.push(textSegment(" from "), ...renderer.expressionListSegments(inputs));
197
- }
198
- return { muted: true, segments };
197
+ return createEntityRow(lastArg.term.name, inputs, renderer);
199
198
  }
200
199
  return {
201
200
  muted: true,
@@ -206,6 +205,22 @@ function buildBodyRow(formula, primary, merged, renderer) {
206
205
  })
207
206
  .exhaustive();
208
207
  }
208
+ function createEntityRow(variableName, inputs, renderer) {
209
+ const segments = [textSegment("Create entity "), variableSegment(variableName)];
210
+ if (isPresent(inputs)) {
211
+ segments.push(textSegment(" from "), ...renderer.expressionListSegments(inputs));
212
+ }
213
+ return { muted: true, segments };
214
+ }
215
+ // An IRI(...) is named by the variables it reads; its namespace and label text read as noise.
216
+ function mintInputs(expression) {
217
+ if (expression.type === "function" && expression.name === "SKOLEM")
218
+ return expression.args;
219
+ return [...new Set(variableNamesFromExpression(expression))].map((name) => ({
220
+ type: "term",
221
+ term: { type: "variable", name },
222
+ }));
223
+ }
209
224
  function normalizeNarrativeAtom(atom) {
210
225
  const classAssertion = classAssertionFromAtom(atom);
211
226
  if (classAssertion)
@@ -366,7 +381,7 @@ function generalAtomRow(general) {
366
381
  function classHeadSegments(assertion, renderer) {
367
382
  const classSegment = labeledEntitySegment(assertion.className, "class");
368
383
  const { instance } = assertion;
369
- if (isVariableTerm(instance) && renderer.context.skolemVariableNames.has(instance.name)) {
384
+ if (isVariableTerm(instance) && renderer.context.mintedVariableNames.has(instance.name)) {
370
385
  return [
371
386
  textSegment("Create a new "),
372
387
  classSegment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manta-eu/react",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "The Manta design system, knowledge-graph UI and agent components",
5
5
  "homepage": "https://developers.manta.eu",
6
6
  "keywords": [
@@ -1126,12 +1126,12 @@
1126
1126
  "usehooks-ts": "^3.1.1",
1127
1127
  "zod": "^4.5.0",
1128
1128
  "zustand": "^5.0.2",
1129
- "@manta-eu/client": "0.1.8",
1130
- "@manta-eu/lib": "0.1.8",
1131
- "@manta-eu/rdf-lib": "0.1.8",
1132
- "@manta-eu/ldo": "0.1.8",
1133
- "@manta-eu/datalog-parser": "0.1.8",
1134
- "@manta-eu/auth": "0.1.8"
1129
+ "@manta-eu/auth": "0.1.9",
1130
+ "@manta-eu/client": "0.1.9",
1131
+ "@manta-eu/ldo": "0.1.9",
1132
+ "@manta-eu/rdf-lib": "0.1.9",
1133
+ "@manta-eu/datalog-parser": "0.1.9",
1134
+ "@manta-eu/lib": "0.1.9"
1135
1135
  },
1136
1136
  "peerDependencies": {
1137
1137
  "@ulb-darmstadt/shacl-form": "^2.1.1-rc1",