Files
ragflow/internal/agent/tool/email.go

387 lines
11 KiB
Go
Raw Normal View History

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
2026-06-12 22:58:28 +08:00
//
// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package tool
import (
"context"
"crypto/tls"
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
2026-06-12 22:58:28 +08:00
"encoding/json"
"fmt"
"io"
"net"
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"net/mail"
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
2026-06-12 22:58:28 +08:00
"net/smtp"
"strings"
"time"
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
2026-06-12 22:58:28 +08:00
"github.com/cloudwego/eino/components/tool"
"github.com/cloudwego/eino/schema"
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"ragflow/internal/agent/runtime"
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
2026-06-12 22:58:28 +08:00
)
const emailToolName = "email"
const emailToolDescription = "Send an email via SMTP. Returns success/failure status."
const (
emailDialTimeout = 10 * time.Second
emailSessionTimeout = 30 * time.Second
)
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
// emailParams contains both the Python model-call inputs and the Canvas node
// configuration used to deliver the message. Info exposes only the former.
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
2026-06-12 22:58:28 +08:00
type emailParams struct {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
SMTPServer string `json:"smtp_server"`
SMTPPort int `json:"smtp_port"`
Email string `json:"email"`
SMTPUsername string `json:"smtp_username"`
Password string `json:"password"`
SenderName string `json:"sender_name"`
ToEmail string `json:"to_email"`
CCEmail string `json:"cc_email"`
Content string `json:"content"`
Subject string `json:"subject"`
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
2026-06-12 22:58:28 +08:00
}
// emailEnvelope is what the model sees.
type emailEnvelope struct {
OK bool `json:"ok"`
Error string `json:"_ERROR,omitempty"`
}
// EmailTool is the SMTP email
// sender tool. It composes an
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
2026-06-12 22:58:28 +08:00
// RFC 822 message and submits it via the stdlib net/smtp client. All
// authentication modes supported by net/smtp.Auth are available
// (PLAIN, LOGIN, CRAM-MD5) by selecting the appropriate creds.
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
type EmailTool struct {
defaults emailParams
}
var _ ToolComponent = (*EmailTool)(nil)
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
2026-06-12 22:58:28 +08:00
// NewEmailTool returns an EmailTool. There is no shared HTTPHelper
// (SMTP is not HTTP), so the constructor is the simplest possible.
func NewEmailTool() *EmailTool {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
return newEmailTool(emailParams{SMTPPort: 465})
}
func newEmailTool(defaults emailParams) *EmailTool {
if defaults.SMTPPort == 0 {
defaults.SMTPPort = 465
}
return &EmailTool{defaults: defaults}
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
2026-06-12 22:58:28 +08:00
}
// Info returns the tool's metadata for the chat model.
func (e *EmailTool) Info(_ context.Context) (*schema.ToolInfo, error) {
return &schema.ToolInfo{
Name: emailToolName,
Desc: emailToolDescription,
ParamsOneOf: schema.NewParamsOneOfByParams(map[string]*schema.ParameterInfo{
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"to_email": {
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
2026-06-12 22:58:28 +08:00
Type: schema.String,
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
Desc: "The target email address.",
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
2026-06-12 22:58:28 +08:00
Required: true,
},
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"cc_email": {
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
2026-06-12 22:58:28 +08:00
Type: schema.String,
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
Desc: "Other email addresses to send to, separated by commas.",
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
2026-06-12 22:58:28 +08:00
Required: false,
},
"subject": {
Type: schema.String,
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
Desc: "The subject/title of the email.",
Required: false,
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
2026-06-12 22:58:28 +08:00
},
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"content": {
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
2026-06-12 22:58:28 +08:00
Type: schema.String,
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
Desc: "The content of the email.",
Required: false,
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
2026-06-12 22:58:28 +08:00
},
}),
}, nil
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
func (e *EmailTool) ComponentSpec() ComponentSpec {
return ComponentSpec{
Inputs: map[string]string{
"to_email": "Recipient email address list.",
"cc_email": "Optional CC recipient list.",
"content": "Email body.",
"subject": "Email subject.",
},
Outputs: map[string]string{
"success": "Whether the email was sent successfully.",
},
InputForm: map[string]any{
"to_email": map[string]any{"name": "To ", "type": "line"},
"subject": map[string]any{"name": "Subject", "type": "line", "optional": true},
"cc_email": map[string]any{"name": "CC To", "type": "line", "optional": true},
},
}
}
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
2026-06-12 22:58:28 +08:00
// buildEmailMessage composes the RFC 822 wire format: headers + blank
// line + body. Extracted so tests can verify subject / recipient
// inclusion without opening a real socket.
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
func buildEmailMessage(from, senderName string, to, cc []string, subject, body string) []byte {
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
2026-06-12 22:58:28 +08:00
var b strings.Builder
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
fromHeader := (&mail.Address{
Name: stripEmailHeaderLineBreaks(senderName),
Address: stripEmailHeaderLineBreaks(from),
}).String()
b.WriteString("From: " + fromHeader + "\r\n")
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
2026-06-12 22:58:28 +08:00
b.WriteString("To: " + strings.Join(to, ", ") + "\r\n")
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
if len(cc) > 0 {
b.WriteString("Cc: " + strings.Join(cc, ", ") + "\r\n")
}
b.WriteString("Subject: " + stripEmailHeaderLineBreaks(subject) + "\r\n")
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
2026-06-12 22:58:28 +08:00
b.WriteString("MIME-Version: 1.0\r\n")
b.WriteString("Content-Type: text/plain; charset=UTF-8\r\n")
b.WriteString("\r\n")
b.WriteString(body)
b.WriteString("\r\n")
return []byte(b.String())
}
func stripEmailHeaderLineBreaks(value string) string {
return strings.NewReplacer("\r", "", "\n", "").Replace(value)
}
type emailSender func(ctx context.Context, p emailParams, msg []byte) error
var sendEmail = sendEmailSMTP
// InvokableRun sends the email.
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
2026-06-12 22:58:28 +08:00
func (e *EmailTool) InvokableRun(ctx context.Context, argsJSON string, _ ...tool.Option) (string, error) {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
p := e.defaults
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
2026-06-12 22:58:28 +08:00
if err := json.Unmarshal([]byte(argsJSON), &p); err != nil {
return emailErrJSON(fmt.Errorf("email: parse arguments: %w", err)),
fmt.Errorf("email: parse arguments: %w", err)
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
state, _, _ := runtime.GetStateFromContext[*runtime.CanvasState](ctx)
p.ToEmail = runtime.ResolveTemplateForDisplay(p.ToEmail, state)
p.CCEmail = runtime.ResolveTemplateForDisplay(p.CCEmail, state)
p.Subject = stripEmailHeaderLineBreaks(runtime.ResolveTemplateForDisplay(p.Subject, state))
p.Content = runtime.ResolveTemplateForDisplay(p.Content, state)
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
2026-06-12 22:58:28 +08:00
if err := validateEmailParams(&p); err != nil {
return emailErrJSON(err), err
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
toRecipients := splitEmailList(p.ToEmail)
ccRecipients := splitEmailList(p.CCEmail)
if len(toRecipients) == 0 {
err := fmt.Errorf("email: to_email is required")
return emailErrJSON(err), err
}
subject := p.Subject
if subject == "" {
subject = "No Subject"
}
content := p.Content
if content == "" {
content = "No content provided"
}
msg := buildEmailMessage(p.Email, p.SenderName, toRecipients, ccRecipients, subject, content)
if err := sendEmail(ctx, p, msg); err != nil {
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
2026-06-12 22:58:28 +08:00
return emailErrJSON(fmt.Errorf("email: send: %w", err)),
fmt.Errorf("email: send: %w", err)
}
if err := ctx.Err(); err != nil {
return emailErrJSON(err), err
}
return emailJSON(emailEnvelope{OK: true}), nil
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
func (e *EmailTool) BuildComponentOutputs(envelope map[string]any) map[string]any {
ok, _ := envelope["ok"].(bool)
return map[string]any{"success": ok}
}
func sendEmailSMTP(ctx context.Context, p emailParams, msg []byte) error {
if p.SMTPPort == 465 {
return sendEmailSMTPS(ctx, p, msg)
}
return sendEmailSTARTTLS(ctx, p, msg)
}
func sendEmailSTARTTLS(ctx context.Context, p emailParams, msg []byte) error {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
addr := fmt.Sprintf("%s:%d", p.SMTPServer, p.SMTPPort)
dialer := &net.Dialer{Timeout: emailDialTimeout}
conn, err := dialer.DialContext(ctx, "tcp", addr)
if err != nil {
return err
}
defer conn.Close()
setEmailDeadline(ctx, conn)
stopWatch := watchEmailContext(ctx, conn)
defer stopWatch()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
client, err := smtp.NewClient(conn, p.SMTPServer)
if err != nil {
return err
}
defer client.Close()
if err := client.Hello("localhost"); err != nil {
return err
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
if ok, _ := client.Extension("STARTTLS"); !ok {
return fmt.Errorf("email: SMTP server does not advertise STARTTLS")
}
if err := client.StartTLS(&tls.Config{ServerName: p.SMTPServer, MinVersion: tls.VersionTLS12}); err != nil {
return err
}
return submitEmail(ctx, client, p, msg)
}
func sendEmailSMTPS(ctx context.Context, p emailParams, msg []byte) error {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
addr := fmt.Sprintf("%s:%d", p.SMTPServer, p.SMTPPort)
dialer := &net.Dialer{Timeout: emailDialTimeout}
rawConn, err := dialer.DialContext(ctx, "tcp", addr)
if err != nil {
return err
}
setEmailDeadline(ctx, rawConn)
stopWatch := watchEmailContext(ctx, rawConn)
defer stopWatch()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
conn := tls.Client(rawConn, &tls.Config{ServerName: p.SMTPServer, MinVersion: tls.VersionTLS12})
if err := conn.HandshakeContext(ctx); err != nil {
_ = rawConn.Close()
return err
}
defer conn.Close()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
client, err := smtp.NewClient(conn, p.SMTPServer)
if err != nil {
return err
}
defer client.Close()
if err := client.Hello("localhost"); err != nil {
return err
}
return submitEmail(ctx, client, p, msg)
}
func submitEmail(ctx context.Context, client *smtp.Client, p emailParams, msg []byte) error {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
username := p.SMTPUsername
if username == "" {
username = p.Email
}
if username != "" && p.Password != "" {
if err := client.Auth(smtp.PlainAuth("", username, p.Password, p.SMTPServer)); err != nil {
return err
}
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
if err := client.Mail(p.Email); err != nil {
return err
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
for _, addr := range emailRecipients(p.ToEmail, p.CCEmail) {
if err := client.Rcpt(addr); err != nil {
return err
}
}
wc, err := client.Data()
if err != nil {
return err
}
if _, err := wc.Write(msg); err != nil {
_ = wc.Close()
return err
}
if err := wc.Close(); err != nil {
return err
}
if err := ctx.Err(); err != nil {
return err
}
if err := client.Quit(); err != nil && err != io.EOF {
return err
}
return nil
}
func setEmailDeadline(ctx context.Context, conn net.Conn) {
deadline := time.Now().Add(emailSessionTimeout)
if ctxDeadline, ok := ctx.Deadline(); ok && ctxDeadline.Before(deadline) {
deadline = ctxDeadline
}
_ = conn.SetDeadline(deadline)
}
func watchEmailContext(ctx context.Context, conn net.Conn) func() {
done := make(chan struct{})
go func() {
select {
case <-ctx.Done():
_ = conn.SetDeadline(time.Now())
case <-done:
}
}()
return func() { close(done) }
}
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
2026-06-12 22:58:28 +08:00
// validateEmailParams guards against obviously broken inputs. The
// upstream SMTP server will give a better error for malformed
// addresses, but the common case (empty / missing) is caught here.
func validateEmailParams(p *emailParams) error {
switch {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
case p.SMTPServer == "":
return fmt.Errorf("email: smtp_server is required")
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
2026-06-12 22:58:28 +08:00
case p.SMTPPort <= 0 || p.SMTPPort > 65535:
return fmt.Errorf("email: smtp_port must be in [1, 65535]")
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
case p.Email == "":
return fmt.Errorf("email: email is required")
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
2026-06-12 22:58:28 +08:00
}
return nil
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
func emailRecipients(toEmail, ccEmail string) []string {
recipients := splitEmailList(toEmail)
return append(recipients, splitEmailList(ccEmail)...)
}
func splitEmailList(value string) []string {
parts := strings.FieldsFunc(value, func(r rune) bool {
return r == ',' || r == ';' || r == '\n' || r == '\r'
})
out := make([]string, 0, len(parts))
for _, part := range parts {
if recipient := strings.TrimSpace(part); recipient != "" {
out = append(out, recipient)
}
}
return out
}
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
2026-06-12 22:58:28 +08:00
func emailJSON(env emailEnvelope) string {
b, err := json.Marshal(env)
if err != nil {
return fmt.Sprintf(`{"_ERROR":"email: marshal result: %s"}`, err)
}
return string(b)
}
func emailErrJSON(err error) string {
return emailJSON(emailEnvelope{Error: err.Error()})
}