Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ MEMORY_LAST_MESSAGES='500'
LISTS='3072' # IVF lists for PgVector (adjust based on dataset size, default: 3072 for gemini-embedding-001 1-4k limits, this so can use 3072 dims)
#PG_HNSW_M=16 # HNSW connections per layer (default: 16, higher = better recall, more memory)
#PG_HNSW_EF_CONSTRUCTION=64 # HNSW build-time candidates (default: 64, higher = better quality, slower build)
PG_M='32'
PG_EF='79' # HNSW query-time candidates (default: 100, higher = better recall, slower queries)
PG_MIN_SCORE='0.65' # Minimum similarity score for vector search results (default: 0.7, lower = more results, less relevant)
# Graph-based Retrieval Configuration
Expand Down
9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
7 changes: 7 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ['{|}']
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
37 changes: 37 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.25.0
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.7.4
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- node@22.16.0
- python@3.10.8
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- actionlint@1.7.10
- checkov@3.2.497
- eslint@9.39.2
- git-diff-check
- markdownlint@0.47.0
- osv-scanner@2.3.1
- oxipng@10.0.0
- prettier@3.7.4
- taplo@0.10.0
- trufflehog@3.92.4
- yamllint@1.37.1
actions:
disabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
enabled:
- trunk-upgrade-available
19 changes: 19 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -831,3 +831,22 @@
transparent 100%
);
}

/* Amber Glow for Agent Thinking States */
@layer utilities {
.glow-amber {
box-shadow: 0 0 25px oklch(0.7 0.15 60 / 40%);
}

.typing-effect {
overflow: hidden;
white-space: pre-wrap;
animation: typing-fade 0.5s ease;
}

@keyframes typing-fade {
from { opacity: 0; transform: translateX(-4px); }
to { opacity: 1; transform: translateX(0); }
}
}

53 changes: 45 additions & 8 deletions app/workflows/components/workflow-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
import { Panel } from "@/src/components/ai-elements/panel"
import { Button } from "@/ui/button"
import { useWorkflowContext } from "@/app/workflows/providers/workflow-context"
import { DownloadIcon, CodeIcon, ExternalLinkIcon } from "lucide-react"
import {
DownloadIcon,
CodeIcon,
ExternalLinkIcon,
LayoutHorizontalIcon,
LayoutVerticalIcon,
LayoutGridIcon
} from "lucide-react"
import { useCallback } from "react"
import { useReactFlow } from "@xyflow/react"

export function WorkflowActions() {
const { workflowConfig } = useWorkflowContext()
const { workflowConfig, layoutNodes } = useWorkflowContext()

let reactFlowInstance: ReturnType<typeof useReactFlow> | null = null
try {
Expand Down Expand Up @@ -38,34 +45,64 @@ export function WorkflowActions() {
return (
<Panel position="top-right" className="p-2">
<div className="flex gap-2">
<div className="flex bg-muted/50 p-1 rounded-md border border-border/50">
<Button
size="icon-sm"
variant="ghost"
onClick={() => layoutNodes("LR")}
className="h-8 w-8"
title="Horizontal Layout"
>
<LayoutHorizontalIcon className="size-3.5" />
</Button>
<Button
size="icon-sm"
variant="ghost"
onClick={() => layoutNodes("TB")}
className="h-8 w-8"
title="Vertical Layout"
>
<LayoutVerticalIcon className="size-3.5" />
</Button>
<Button
size="icon-sm"
variant="ghost"
onClick={() => layoutNodes("GRID")}
className="h-8 w-8"
title="Grid Layout"
>
<LayoutGridIcon className="size-3.5" />
</Button>
</div>

<Button
size="sm"
variant="outline"
onClick={handleFitView}
className="h-8"
className="h-8 px-3"
title="Fit to view"
>
<ExternalLinkIcon className="size-3 mr-1" />
<ExternalLinkIcon className="size-3 mr-1.5" />
Fit View
</Button>
<Button
size="sm"
variant="outline"
onClick={handleExportSvg}
className="h-8"
className="h-8 px-3"
title="Export as SVG"
>
<DownloadIcon className="size-3 mr-1" />
<DownloadIcon className="size-3 mr-1.5" />
Export
</Button>
<Button
size="sm"
variant="outline"
onClick={handleViewCode}
className="h-8"
className="h-8 px-3 font-semibold"
title="View workflow source code"
>
<CodeIcon className="size-3 mr-1" />
<CodeIcon className="size-3 mr-1.5" />
Code
</Button>
</div>
Expand Down
65 changes: 61 additions & 4 deletions app/workflows/components/workflow-canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Canvas } from "@/src/components/ai-elements/canvas"
import { Connection } from "@/src/components/ai-elements/connection"
import { Controls } from "@/src/components/ai-elements/controls"
import { Edge } from "@/src/components/ai-elements/edge"
import { useWorkflowContext, type WorkflowProgressEvent } from "@/app/workflows/providers/workflow-context"
import { useWorkflowContext } from "@/app/workflows/providers/workflow-context"
import { workflowNodeTypes } from "./workflow-node"
import { WorkflowInfoPanel } from "./workflow-info-panel"
import { WorkflowLegend } from "./workflow-legend"
Expand All @@ -13,6 +13,7 @@ import { WorkflowOutput } from "./workflow-output"
import { WorkflowInputPanel } from "./workflow-input-panel"
import { WorkflowProgressPanel } from "./workflow-progress-panel"
import { WorkflowSuspendDialog } from "./workflow-suspend-dialog"
import { MiniMap, Panel, Background, BackgroundVariant } from "@xyflow/react"
import type { ReactNode } from "react"

const edgeTypes = {
Expand All @@ -25,20 +26,76 @@ interface WorkflowCanvasProps {
}

export function WorkflowCanvas({ children }: WorkflowCanvasProps) {
const { nodes, edges } = useWorkflowContext()
const {
nodes,
edges,
workflowConfig,
onNodesChange,
onEdgesChange
} = useWorkflowContext()

return (
<div className="flex-1">
<div className="flex-1 relative noise overflow-hidden mesh-gradient">
<Canvas
nodes={nodes}
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
nodeTypes={workflowNodeTypes}
edgeTypes={edgeTypes}
connectionLineComponent={Connection}
fitView
fitViewOptions={{ padding: 0.3 }}
snapToGrid
snapGrid={[20, 20]}
defaultEdgeOptions={{
type: "animated",
animated: true,
}}
>
<Controls />
<Background
variant={BackgroundVariant.Dots}
gap={20}
size={1}
color="oklch(var(--primary) / 0.1)"
/>
<Controls showInteractive={false} className="bg-background/80 backdrop-blur-md border-border/50 shadow-xl" />
<MiniMap
zoomable
pannable
className="!bg-card/60 !backdrop-blur-xl !border-border/30 rounded-2xl shadow-2xl !bottom-4 !right-4 overflow-hidden"
nodeStrokeWidth={3}
maskColor="oklch(var(--background) / 0.6)"
nodeColor={(n) => {
if (n.data?.status === "completed") {return "oklch(0.7 0.15 150)"}
if (n.data?.status === "running") {return "oklch(0.7 0.2 60)"}
if (n.data?.status === "error") {return "oklch(0.6 0.2 20)"}
return "oklch(0.7 0 0 / 0.2)"
}}
/>
<Panel position="bottom-left" className="bg-background/40 backdrop-blur-xl border-border/20 rounded-full px-4 py-1.5 text-[10px] text-muted-foreground uppercase font-bold tracking-[0.2em] shadow-lg animate-fade-in">
<span className="flex items-center gap-2">
<div className="size-1.5 bg-primary rounded-full animate-pulse" />
{workflowConfig?.name} • CORE ENGINE 2026
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The string 'CORE ENGINE 2026' is hardcoded. This should ideally be sourced from a configuration file or a constant to improve maintainability and make future updates easier.

</span>
</Panel>

{/* Floating status display */}
<Panel position="top-left" className="bg-card/30 backdrop-blur-2xl border-border/10 rounded-xl p-3 shadow-2xl mt-16 max-w-xs animate-in slide-in-from-left-4 duration-500">
<div className="flex items-center gap-3 mb-2">
<div className="size-8 rounded-lg bg-primary/10 flex items-center justify-center">
<div className="size-4 text-primary">⚙️</div>
</div>
<div>
<p className="text-[10px] font-bold text-primary uppercase tracking-widest">Active Runtime</p>
<p className="text-xs font-semibold truncate">{workflowConfig?.id}</p>
</div>
</div>
<p className="text-[11px] text-muted-foreground leading-relaxed italic">
{workflowConfig?.description}
</p>
</Panel>

<WorkflowProgressPanel />
<WorkflowInfoPanel />
<WorkflowLegend />
Expand Down
Loading
Loading