2512 Commits

Author SHA1 Message Date
everywhere.z
22bf14dd1a docs: 根据 2.16.0 文档更新中英文 README
- 新增 AI Agent 编排章节(liteflow-react-agent,v2.16.0 头号特性)
- 同步特性列表:Spring Boot 4、JDK21+ 虚拟线程、脚本语言、规则持久化
- 概述升级为现代化规则引擎定位,补充 AI Agent 一等公民编排
- 顶部互加中英文语言切换链接
- 保留中文 README 赞助商与 LF CLUB 社区段落

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v2.16.0
2026-06-03 00:51:46 +08:00
everywhere.z
ef5e09a93c 添加 release 脚本 2026-06-02 23:53:52 +08:00
everywhere.z
2f238d3a82 添加 release 脚本 2026-06-02 00:45:16 +08:00
everywhere.z
5b749ffd80 test(agent): 按 feature/platform 维度重组 react-agent 测试模块
将原先扁平的 connectivity/feature/unit/cmp 测试布局重构为按功能
(feature/*)和按供应商平台(platform/*)划分的独立目录,每个目录
自带隔离的测试资源(application.properties + flow.el.xml),并相应
更新 BaseAgentLiveTest、LiveTestEnv、LiveTestSupport 等支撑类与使用指南文档。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 23:55:42 +08:00
everywhere.z
53f7e20cf3 docs: 更新并翻译 CLAUDE.md 为简体中文
- 同步版本号 2.15.3 -> 2.16.0
- 修正失效的构建命令:移除不存在的 compile/release profile,
  补充 JDK 驱动的模块选择(compile-8-to-16 / compile-17+)及
  release-on-8 / release-on-17 发布 profile 说明
- 新增 liteflow-react-agent(5 个子模块)与 liteflow-spring-boot4-starter
  的模块说明,并指向 docs/liteflow-react-agent-guide.md
- 将全文叙述性内容翻译为简体中文,代码/类名/方法名/配置项保持原样

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:43:18 +08:00
everywhere.z
49044d1b76 refactor(agent): drop fixed assistant identity line from default system prompt
移除 DEFAULT_SYSTEM_PROMPT 中固定的「你是 LiteFlow ReAct Agent 助手。」身份行,
并同步更新 react-agent guide 文档中的对应描述。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 21:33:27 +08:00
everywhere.z
e6d6a37869 docs(agent): refresh react-agent guide for skill tool DI and fix stale content
- Document that the framework always prepends DEFAULT_SYSTEM_PROMPT before the
  component systemPrompt(), and its behavioral implications.
- Correct §7.6: skillBox.codeExecution() is enabled and bound to the conversation
  workspace; add the related security note in §7.6 and §10.
- Update §7.4 for container-based DI of skill tools (no-arg ctor is only a
  fallback) and native YAML inline-list tools; drop the dead SkillToolManifest
  reference and add a troubleshooting row for instantiation failure.
- Add §5.6 covering the AgentSessionFactory SPI for custom persistence backends.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:29:59 +08:00
everywhere.z
115ffd652c refactor(agent): replace SkillToolManifest with SkillToolResolver and relocate test
- Switch SkillBoxFactory to SkillToolResolver, which resolves tool classes from
  the framework container (enabling DI) and falls back to no-arg reflection,
  resolving tools per AgentSkill instead of by name.
- Remove the obsolete SkillToolManifest.
- Move ReActAgentComponentTest from liteflow-react-agent-core to
  liteflow-testcase-el per the test-placement convention.
- Drop the temporary surefire skipTests=false override in react-agent-core.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:29:49 +08:00
everywhere.z
ec5562c45f build(agent): allow surefire tests to run in react-agent test module
The root POM hardcodes skipTests=true in pluginManagement. Override
at module level with ${maven.test.skip} so tests actually execute
when invoked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:40:15 +08:00
everywhere.z
29e387426a test(agent): cover skill tool container fallback and defensive paths
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:40:09 +08:00
everywhere.z
e8cb271d5a feat(agent): resolve skill tools from container to enable DI
SkillToolResolver 优先按类型从 ContextAware 容器取已注册的工具 bean,
使其依赖注入生效;容器未就绪/未注册时降级反射实例化。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:30:57 +08:00
everywhere.z
0668ae6f35 docs(agent): add implementation plan for skill tools Spring DI
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:12:03 +08:00
everywhere.z
6152e34000 docs(agent): add design spec for skill tools Spring DI
通过 ContextAware SPI 从容器按类型引用已注册的 skill 工具 bean,
使其依赖注入生效;无容器/未注册时降级反射实例化。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:03:09 +08:00
everywhere.z
fdda94a568 Merge branch 'master' into dev
# Conflicts:
#	.gitignore
2026-05-31 15:01:20 +08:00
everywhere.z
fea04eb39f 更改 ignore 文件 2026-05-25 11:38:21 +08:00
everywhere.z
083bdfa0f2 feat(agent): track per-invocation chat usage across ReAct reasoning steps
Add ChatUsageTrackingHook that accumulates ChatUsage from every
PostReasoningEvent within a single process() call, expose it via
ReActAgentContext#getChatUsage(), and emit a per-step usage line in
ReActLoggingHook. The hook is cached on AgentSession and reset at the
start of each process() so the snapshot reflects the full invocation
(not just the last reasoning step).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 20:50:23 +08:00
everywhere.z
8ea01d2e88 feat: add default system prompt, shell safety checks, and deterministic test models
- Add DEFAULT_SYSTEM_PROMPT and effectiveSystemPrompt() to ReActAgentComponent
- Block unsupported shell syntax (pipes, redirections, chaining) in ManagedShellCommandTool
- Fix process I/O to prevent hangs when command waits for stdin
- Fix missing sessionId in ReActLoggingHook result log line
- Introduce FakeEchoModel for deterministic local testing
- Add unit tests for ReActAgentComponent, ReActLoggingHook, and shell syntax rejection
- Remove LiveTestSupport credential skip calls from feature tests

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 23:23:45 +08:00
everywhere.z
5c91e56bec chore: update LiteFlow build after logging improvements
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 23:51:33 +08:00
everywhere.z
c5891515f9 feat: improve PostActingEvent log with multiline result display 2026-05-16 23:45:19 +08:00
everywhere.z
a9fe301d1b feat: display thinking content in PostReasoningEvent logs 2026-05-16 23:40:39 +08:00
everywhere.z
be439e1a3e feat: add extractThinking method to ReActLoggingHook
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 23:36:36 +08:00
everywhere.z
686e43be55 fix: update truncate calls with maxLen parameter
Update all calling sites of truncate() method to pass the max length
parameter as required by the updated method signature.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 23:32:35 +08:00
everywhere.z
fbeab8b880 refactor: make truncate method accept maxLen parameter
The truncate method now accepts a maxLen parameter instead of using
the hardcoded MAX_TEXT_LEN constant. This allows different types of
content to use different truncation lengths. Note: calling sites will
need to be updated to pass the maxLen parameter.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 23:30:28 +08:00
everywhere.z
ab0efe6bd1 chore: add MAX_THINKING_LEN and MAX_RESULT_LEN constants 2026-05-16 23:26:06 +08:00
everywhere.z
6cf7faed41 chore: add ThinkingBlock import to ReActLoggingHook 2026-05-16 23:22:17 +08:00
everywhere.z
65cbb1ecd5 feat(agent): wire conversation workspace into skill code execution
Pass the ReAct agent context workspace directory through SkillBoxFactory
so SkillBox's code execution runs against the conversation workspace
instead of the process default.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 14:00:37 +08:00
everywhere.z
f70d4aa1c1 build(test): drop redundant surefire override for react agent tests
Remove the maven-surefire-plugin skipTests=false override in
liteflow-testcase-el-react-agent, leaving the test module to inherit
the parent configuration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 19:13:44 +08:00
everywhere.z
daee30dad3 build(starter): expose liteflow.agent.skills config hints
Register liteflow.agent.skills.{enabled,path,strict} and the
openai-compatible / anthropic-compatible credential maps in the
additional-spring-configuration-metadata.json of both Spring Boot
starters so IDEs surface completion and type hints for these keys.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 19:13:39 +08:00
everywhere.z
d72d04475b docs(agent): clarify lifecycle and security caveats in react agent guide
Add notes on framework integration prerequisites, event listener
threading, build-time capability methods, session reuse semantics,
built-in tool risks, and two new troubleshooting entries.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 19:13:31 +08:00
everywhere.z
828a2d9099 test(agent): reorganize react agent test coverage 2026-05-13 23:31:07 +08:00
everywhere.z
2011d6898b test(agent): cover react-agent feature scenarios end-to-end
Add focused feature suites under react-agent test resources for
conversation/agentKey isolation, compatible-custom platform handshake,
managed shell mode, workspace file tools, skills loading, and a live
platform connectivity probe — each with its own EL chain, properties,
and prepare/record components.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 16:24:21 +08:00
everywhere.z
65a6213b72 feat(core): add generic flow event channel for streaming output
Introduce FlowEvent/FlowEventListener/FlowEventPublisher on the Slot so
callers can subscribe via ExecuteOption.eventListener and receive
incremental events while a chain is running. ReActAgentComponent wires
agentscope reasoning/tool_result/summary/result events into this channel
when a listener is registered, keeping the non-listener path as a plain
blocking call.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 16:24:10 +08:00
everywhere.z
9b227cf126 docs(agent): complete react agent skills guide 2026-05-10 22:31:09 +08:00
everywhere.z
dc5d328941 docs(agent): describe react agent skills 2026-05-10 22:23:13 +08:00
everywhere.z
d8fd7f6015 feat(agent): integrate skills with react agent component 2026-05-10 22:20:14 +08:00
everywhere.z
a3bf935c5c feat(agent): track loaded skills 2026-05-10 21:53:06 +08:00
everywhere.z
db4a099361 feat(agent): load skills into skill box 2026-05-10 21:34:13 +08:00
everywhere.z
18007cf855 test(agent): cover skill box factory behavior 2026-05-10 16:41:28 +08:00
everywhere.z
e950cc38f2 feat(agent): add skills configuration 2026-05-10 16:24:15 +08:00
everywhere.z
7adfbe7f5f docs(agent): plan react-agent skills support 2026-05-10 16:19:11 +08:00
everywhere.z
b9de094d33 docs(agent): design react-agent skills support 2026-05-10 16:12:43 +08:00
everywhere.z
ccebedc77e docs(agent): update react-agent guide to dual-key (conversationId + agentKey) model
Reflect the session management refactor from single sessionId to
(conversationId, agentKey) dual-key: update all hook signatures to
parameterless style with ctx(), add curl/wget to shell whitelist,
and remove obsolete SlotAttachmentTest.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 15:57:51 +08:00
everywhere.z
29073e23c4 docs: add design spec and implementation plan for react-agent context refactor
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 15:01:45 +08:00
everywhere.z
3175af400d feat(agent): refactor session management to dual-key (conversationId + agentKey)
AgentSessionManager 从单一 sessionId 改为 (conversationId, agentKey) 双 key 架构:
同一 conversationId 下多个 agent 共享 workspace 目录但各自拥有独立的 AgentSession
和对话记忆。删除 NanoIdSessionIdGenerator(conversationId 生成职责上移到 core 层
的 ConversationIdGenerator)。新增 ReActAgentConversationContinuityTest 和
ReActAgentMultiAgentChainTest 覆盖对话连续性和多 agent 协作场景。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 15:01:39 +08:00
everywhere.z
a5735c3f4d feat(core): add ExecuteOption and ConversationIdGenerator to FlowExecutor
新增 ExecuteOption 统一入口,支持 requestId、conversationId、上下文等维度的自由组合,
避免 execute2RespWithXxx 系列方法命名爆炸。同时新增 ConversationIdGenerator 为
agent 对话连续性提供 NanoId 格式的 conversationId 生成能力。LiteflowResponse 增加
conversationId 字段用于返回给调用方。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 15:01:19 +08:00
everywhere.z
36d945fca2 test(react-agent): cover ctx() lifecycle invariants
- 验证 agent 缓存复用时 model 内 ctx() 取到当次 ctx 而非陈旧引用
- 验证不变量字段(conversationId/agentKey/workspaceDir)跨次一致

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 14:29:40 +08:00
everywhere.z
67a9b9bed7 refactor(react-agent): make all hooks parameterless via slot-bound ctx
- ReActAgentComponent 所有 hook 改为无参签名,新增 protected final ctx() 访问器
- ctx 通过 Slot.setAttachment 按 _react_agent_ctx_<nodeId> 挂载,process() finally 解绑
- 按 nodeId 隔离 attachment key,支持 WHEN 并发场景多个 agent 节点共享 slot
- 7 个测试 cmp 子类全部迁移到新签名
- StubModel 改为持有组件引用,运行时动态调 comp.ctx() 取当次 ctx

破坏性变更:所有 ReActAgentComponent 子类必须更新签名。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 14:22:43 +08:00
everywhere.z
4c1218f6cd feat(core): add generic attachment API to Slot
为后续 per-invocation 插件上下文挂载提供通用 KV 入口。
复用已有 metaDataMap,包含 set/get/has/remove 四个 public 方法。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 14:16:39 +08:00
everywhere.z
c31e279560 refactor(agent): rename WORKSPACE_FILE to LOCAL_FILE for memory storage mode
该模式的 .agent-session 目录实际位于 workspace.root 之下、与各 session
的 workspace 子目录平级而非嵌套,旧名 WORKSPACE_FILE 容易误导为"存储在
某个 workspace 内部"。LOCAL_FILE 与 REDIS、MYSQL 同层级地描述后端类型,
更准确地反映实际行为。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 00:11:21 +08:00
everywhere.z
7fe12ed624 chore(agent): 补全 agent 配置 javadoc 与 spring 配置元数据,精简测试模块 pom
- 为 agent 配置类(AgentConfig/SessionConfig/ShellConfig/MemoryStorageConfig 等)补充中文 javadoc
- 在 spring-boot-starter / spring-boot4-starter 的 additional-spring-configuration-metadata.json 中补全 liteflow.agent.* 配置项,提供 IDE 配置提示
- 合并 testcase-el 中 react-agent 与 springboot4 的 profile,移除子模块冗余的 maven-compiler/surefire 配置
- 移除已不再使用的 AgentConfig / LiteflowConfigAgentField / Boot4AutoConfiguration 测试文件

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 23:25:07 +08:00