Skip to content

Commit c5489f5

Browse files
author
Sam
authored
Merge pull request #73 from ssdeanx/develop
feat: enhance write-note tool with logging and input/output hooks
2 parents 3cdba49 + bd22041 commit c5489f5

72 files changed

Lines changed: 12556 additions & 6430 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ MEMORY_LAST_MESSAGES='500'
5353
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)
5454
#PG_HNSW_M=16 # HNSW connections per layer (default: 16, higher = better recall, more memory)
5555
#PG_HNSW_EF_CONSTRUCTION=64 # HNSW build-time candidates (default: 64, higher = better quality, slower build)
56+
PG_M='32'
5657
PG_EF='79' # HNSW query-time candidates (default: 100, higher = better recall, slower queries)
5758
PG_MIN_SCORE='0.65' # Minimum similarity score for vector search results (default: 0.7, lower = more results, less relevant)
5859
# Graph-based Retrieval Configuration

.trunk/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*out
2+
*logs
3+
*actions
4+
*notifications
5+
*tools
6+
plugins
7+
user_trunk.yaml
8+
user.yaml
9+
tmp

.trunk/configs/.yamllint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
quoted-strings:
3+
required: only-when-needed
4+
extra-allowed: ['{|}']
5+
key-duplicates: {}
6+
octal-values:
7+
forbid-implicit-octal: true

.trunk/trunk.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
2+
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
3+
version: 0.1
4+
cli:
5+
version: 1.25.0
6+
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
7+
plugins:
8+
sources:
9+
- id: trunk
10+
ref: v1.7.4
11+
uri: https://github.com/trunk-io/plugins
12+
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
13+
runtimes:
14+
enabled:
15+
- node@22.16.0
16+
- python@3.10.8
17+
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
18+
lint:
19+
enabled:
20+
- actionlint@1.7.10
21+
- checkov@3.2.497
22+
- eslint@9.39.2
23+
- git-diff-check
24+
- markdownlint@0.47.0
25+
- osv-scanner@2.3.1
26+
- oxipng@10.0.0
27+
- prettier@3.7.4
28+
- taplo@0.10.0
29+
- trufflehog@3.92.4
30+
- yamllint@1.37.1
31+
actions:
32+
disabled:
33+
- trunk-announce
34+
- trunk-check-pre-push
35+
- trunk-fmt-pre-commit
36+
enabled:
37+
- trunk-upgrade-available

app/globals.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,3 +831,22 @@
831831
transparent 100%
832832
);
833833
}
834+
835+
/* Amber Glow for Agent Thinking States */
836+
@layer utilities {
837+
.glow-amber {
838+
box-shadow: 0 0 25px oklch(0.7 0.15 60 / 40%);
839+
}
840+
841+
.typing-effect {
842+
overflow: hidden;
843+
white-space: pre-wrap;
844+
animation: typing-fade 0.5s ease;
845+
}
846+
847+
@keyframes typing-fade {
848+
from { opacity: 0; transform: translateX(-4px); }
849+
to { opacity: 1; transform: translateX(0); }
850+
}
851+
}
852+

app/workflows/components/workflow-actions.tsx

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
import { Panel } from "@/src/components/ai-elements/panel"
44
import { Button } from "@/ui/button"
55
import { useWorkflowContext } from "@/app/workflows/providers/workflow-context"
6-
import { DownloadIcon, CodeIcon, ExternalLinkIcon } from "lucide-react"
6+
import {
7+
DownloadIcon,
8+
CodeIcon,
9+
ExternalLinkIcon,
10+
LayoutHorizontalIcon,
11+
LayoutVerticalIcon,
12+
LayoutGridIcon
13+
} from "lucide-react"
714
import { useCallback } from "react"
815
import { useReactFlow } from "@xyflow/react"
916

1017
export function WorkflowActions() {
11-
const { workflowConfig } = useWorkflowContext()
18+
const { workflowConfig, layoutNodes } = useWorkflowContext()
1219

1320
let reactFlowInstance: ReturnType<typeof useReactFlow> | null = null
1421
try {
@@ -38,34 +45,64 @@ export function WorkflowActions() {
3845
return (
3946
<Panel position="top-right" className="p-2">
4047
<div className="flex gap-2">
48+
<div className="flex bg-muted/50 p-1 rounded-md border border-border/50">
49+
<Button
50+
size="icon-sm"
51+
variant="ghost"
52+
onClick={() => layoutNodes("LR")}
53+
className="h-8 w-8"
54+
title="Horizontal Layout"
55+
>
56+
<LayoutHorizontalIcon className="size-3.5" />
57+
</Button>
58+
<Button
59+
size="icon-sm"
60+
variant="ghost"
61+
onClick={() => layoutNodes("TB")}
62+
className="h-8 w-8"
63+
title="Vertical Layout"
64+
>
65+
<LayoutVerticalIcon className="size-3.5" />
66+
</Button>
67+
<Button
68+
size="icon-sm"
69+
variant="ghost"
70+
onClick={() => layoutNodes("GRID")}
71+
className="h-8 w-8"
72+
title="Grid Layout"
73+
>
74+
<LayoutGridIcon className="size-3.5" />
75+
</Button>
76+
</div>
77+
4178
<Button
4279
size="sm"
4380
variant="outline"
4481
onClick={handleFitView}
45-
className="h-8"
82+
className="h-8 px-3"
4683
title="Fit to view"
4784
>
48-
<ExternalLinkIcon className="size-3 mr-1" />
85+
<ExternalLinkIcon className="size-3 mr-1.5" />
4986
Fit View
5087
</Button>
5188
<Button
5289
size="sm"
5390
variant="outline"
5491
onClick={handleExportSvg}
55-
className="h-8"
92+
className="h-8 px-3"
5693
title="Export as SVG"
5794
>
58-
<DownloadIcon className="size-3 mr-1" />
95+
<DownloadIcon className="size-3 mr-1.5" />
5996
Export
6097
</Button>
6198
<Button
6299
size="sm"
63100
variant="outline"
64101
onClick={handleViewCode}
65-
className="h-8"
102+
className="h-8 px-3 font-semibold"
66103
title="View workflow source code"
67104
>
68-
<CodeIcon className="size-3 mr-1" />
105+
<CodeIcon className="size-3 mr-1.5" />
69106
Code
70107
</Button>
71108
</div>

app/workflows/components/workflow-canvas.tsx

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Canvas } from "@/src/components/ai-elements/canvas"
44
import { Connection } from "@/src/components/ai-elements/connection"
55
import { Controls } from "@/src/components/ai-elements/controls"
66
import { Edge } from "@/src/components/ai-elements/edge"
7-
import { useWorkflowContext, type WorkflowProgressEvent } from "@/app/workflows/providers/workflow-context"
7+
import { useWorkflowContext } from "@/app/workflows/providers/workflow-context"
88
import { workflowNodeTypes } from "./workflow-node"
99
import { WorkflowInfoPanel } from "./workflow-info-panel"
1010
import { WorkflowLegend } from "./workflow-legend"
@@ -13,6 +13,7 @@ import { WorkflowOutput } from "./workflow-output"
1313
import { WorkflowInputPanel } from "./workflow-input-panel"
1414
import { WorkflowProgressPanel } from "./workflow-progress-panel"
1515
import { WorkflowSuspendDialog } from "./workflow-suspend-dialog"
16+
import { MiniMap, Panel, Background, BackgroundVariant } from "@xyflow/react"
1617
import type { ReactNode } from "react"
1718

1819
const edgeTypes = {
@@ -25,20 +26,76 @@ interface WorkflowCanvasProps {
2526
}
2627

2728
export function WorkflowCanvas({ children }: WorkflowCanvasProps) {
28-
const { nodes, edges } = useWorkflowContext()
29+
const {
30+
nodes,
31+
edges,
32+
workflowConfig,
33+
onNodesChange,
34+
onEdgesChange
35+
} = useWorkflowContext()
2936

3037
return (
31-
<div className="flex-1">
38+
<div className="flex-1 relative noise overflow-hidden mesh-gradient">
3239
<Canvas
3340
nodes={nodes}
3441
edges={edges}
42+
onNodesChange={onNodesChange}
43+
onEdgesChange={onEdgesChange}
3544
nodeTypes={workflowNodeTypes}
3645
edgeTypes={edgeTypes}
3746
connectionLineComponent={Connection}
3847
fitView
3948
fitViewOptions={{ padding: 0.3 }}
49+
snapToGrid
50+
snapGrid={[20, 20]}
51+
defaultEdgeOptions={{
52+
type: "animated",
53+
animated: true,
54+
}}
4055
>
41-
<Controls />
56+
<Background
57+
variant={BackgroundVariant.Dots}
58+
gap={20}
59+
size={1}
60+
color="oklch(var(--primary) / 0.1)"
61+
/>
62+
<Controls showInteractive={false} className="bg-background/80 backdrop-blur-md border-border/50 shadow-xl" />
63+
<MiniMap
64+
zoomable
65+
pannable
66+
className="!bg-card/60 !backdrop-blur-xl !border-border/30 rounded-2xl shadow-2xl !bottom-4 !right-4 overflow-hidden"
67+
nodeStrokeWidth={3}
68+
maskColor="oklch(var(--background) / 0.6)"
69+
nodeColor={(n) => {
70+
if (n.data?.status === "completed") {return "oklch(0.7 0.15 150)"}
71+
if (n.data?.status === "running") {return "oklch(0.7 0.2 60)"}
72+
if (n.data?.status === "error") {return "oklch(0.6 0.2 20)"}
73+
return "oklch(0.7 0 0 / 0.2)"
74+
}}
75+
/>
76+
<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">
77+
<span className="flex items-center gap-2">
78+
<div className="size-1.5 bg-primary rounded-full animate-pulse" />
79+
{workflowConfig?.name} • CORE ENGINE 2026
80+
</span>
81+
</Panel>
82+
83+
{/* Floating status display */}
84+
<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">
85+
<div className="flex items-center gap-3 mb-2">
86+
<div className="size-8 rounded-lg bg-primary/10 flex items-center justify-center">
87+
<div className="size-4 text-primary">⚙️</div>
88+
</div>
89+
<div>
90+
<p className="text-[10px] font-bold text-primary uppercase tracking-widest">Active Runtime</p>
91+
<p className="text-xs font-semibold truncate">{workflowConfig?.id}</p>
92+
</div>
93+
</div>
94+
<p className="text-[11px] text-muted-foreground leading-relaxed italic">
95+
{workflowConfig?.description}
96+
</p>
97+
</Panel>
98+
4299
<WorkflowProgressPanel />
43100
<WorkflowInfoPanel />
44101
<WorkflowLegend />

0 commit comments

Comments
 (0)