mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-05 10:58:34 +08:00
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952)
Ports the agent canvas subsystem from Python to Go.
## What's included
### Canvas Engine (Phase 0/1)
- State engine, scheduler, variable resolver, Redis checkpoint store,
cancel protocol
- **209 tests** across canvas / component / io packages
### 22 Components (P0–P4)
| Tier | Components |
|---|---|
| P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin,
Message, Invoke |
| P1 T3 | VariableAggregator, VariableAssigner, StringTransform,
ListOperations, DataOperations |
| P2 T3 | Iteration, IterationItem, Loop, LoopItem |
| P3 T3 | UserFillUp, Fillup |
| P4 T5 | Browser, ExcelProcessor, DocsGenerator |
### DSL v2 Schema (Phase 2.5)
- Typed v2 in-memory model with v1-to-v2 auto-detect converter
- v1 legacy field stripping per plan §2.11.7
### HTTP Endpoints & Bug Fixes (Plans PR1–PR3)
- **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)`
pattern
- **CreateAgent validation**: title/DSL required, duplicate check, 103
envelope
- **13 new endpoints**: templates, prompts, tags, sessions CRUD,
chat/completions (SSE + non-stream stubs), rerun, test_db_connection,
logs, webhook/logs
- **756 Go unit tests** (745 → 756, +18)
- **17 → 0 Python integration test failures** (test_agents.py +
test_session_management/)
### Tools
21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory
stubs
### Infrastructure
OTel observability, NATS message queue, DeepDoc gRPC client, SSRF
guards, IDOR mitigation
This commit is contained in:
@@ -29,6 +29,7 @@ export const FilterButton = React.forwardRef<
|
||||
<Button
|
||||
variant="outline"
|
||||
size={count > 0 ? 'default' : 'icon'}
|
||||
asChild
|
||||
{...props}
|
||||
ref={ref}
|
||||
>
|
||||
|
||||
@@ -133,50 +133,50 @@ export type ButtonProps<IsAnchor extends boolean = false> = {
|
||||
? LinkProps
|
||||
: React.ButtonHTMLAttributes<HTMLButtonElement>);
|
||||
|
||||
const Button = React.forwardRef(
|
||||
<IsAnchor extends boolean = false>(
|
||||
{
|
||||
children,
|
||||
className,
|
||||
variant,
|
||||
size,
|
||||
dot = false,
|
||||
asChild = false,
|
||||
asLink = false,
|
||||
loading = false,
|
||||
disabled = false,
|
||||
block = false,
|
||||
...props
|
||||
}: ButtonProps<IsAnchor>,
|
||||
ref: React.ForwardedRef<
|
||||
IsAnchor extends true ? HTMLAnchorElement : HTMLButtonElement
|
||||
>,
|
||||
) => {
|
||||
const Comp = asChild ? Slot : asLink ? Link : 'button';
|
||||
const Button = React.forwardRef(function Button<
|
||||
IsAnchor extends boolean = false,
|
||||
>(
|
||||
{
|
||||
children,
|
||||
className,
|
||||
variant,
|
||||
size,
|
||||
dot = false,
|
||||
asChild = false,
|
||||
asLink = false,
|
||||
loading = false,
|
||||
disabled = false,
|
||||
block = false,
|
||||
...props
|
||||
}: ButtonProps<IsAnchor>,
|
||||
ref: React.ForwardedRef<
|
||||
IsAnchor extends true ? HTMLAnchorElement : HTMLButtonElement
|
||||
>,
|
||||
) {
|
||||
const Comp = asChild ? Slot : asLink ? Link : 'button';
|
||||
|
||||
return (
|
||||
<Comp
|
||||
className={cn(
|
||||
buttonVariants({ variant, size, className }),
|
||||
{ 'w-full': block },
|
||||
{ relative: dot },
|
||||
return (
|
||||
<Comp
|
||||
className={cn(
|
||||
buttonVariants({ variant, size, className }),
|
||||
{ 'w-full': block },
|
||||
{ relative: dot },
|
||||
)}
|
||||
// @ts-ignore
|
||||
ref={ref as React.RefObject<HTMLButtonElement | HTMLAnchorElement>}
|
||||
disabled={loading || disabled}
|
||||
{...props}
|
||||
>
|
||||
<>
|
||||
{dot && (
|
||||
<span className="absolute size-[6px] rounded-full -right-[3px] -top-[3px] bg-state-error animate" />
|
||||
)}
|
||||
// @ts-ignore
|
||||
ref={ref as React.RefObject<HTMLButtonElement | HTMLAnchorElement>}
|
||||
disabled={loading || disabled}
|
||||
{...props}
|
||||
>
|
||||
<>
|
||||
{dot && (
|
||||
<span className="absolute size-[6px] rounded-full -right-[3px] -top-[3px] bg-state-error animate" />
|
||||
)}
|
||||
{loading && <LucideLoader2 className="animate-spin" />}
|
||||
{children}
|
||||
</>
|
||||
</Comp>
|
||||
);
|
||||
},
|
||||
);
|
||||
{loading && <LucideLoader2 className="animate-spin" />}
|
||||
{children}
|
||||
</>
|
||||
</Comp>
|
||||
);
|
||||
});
|
||||
|
||||
Button.displayName = 'Button';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user