Repository navigation
Releases
v0.3.35
[0.3.35] — 2026-06-23
Fixes patch_source over-strict old_string matching: the TrioBASIC compiler is case-insensitive, but the matcher used StringComparison.Ordinal (case-sensitive), so when the AI remembered identifiers in all-lower/upper case, old_string not found was returned and it retried repeatedly. Also fixes an offset bug in the TrimEnd fuzzy branch.
Fixed
patch_sourcematching is now case-insensitive (TrioBASIC semantics) —FindTextpreviously usedIndexOf(Ordinal)for strict comparison, while the TrioBASIC compiler treatscVR_x/cvr_x/CVR_Xas identical. After reading source, the AI rewritesold_stringfrom semantic memory and frequently lowercases mixed-case identifiers (e.g.cVR_bakdecelper→cvr_bakdecelper) — legal and equivalent in TrioBASIC, but rejected as "different strings" by the case-sensitive matcher →old_string not found→ repeated retries (seechat_history/20260621_202830.jsonmsg#68-70: 3 consecutive failures).FindTextnow adds anOrdinalIgnoreCasefallback after the exact match, aligning with the target language's semantics.CountOccurrences(the uniqueness check) is switched toOrdinalIgnoreCaseas well, eliminating the "match found but count is 0" semantic split.- Fixed offset bug in
FindText's TrimEnd branch — The oldsource.IndexOf(srcLines[i], source.Length - source.Length)hadlength - lengthalways equal to 0, equivalent to "find the line text's first occurrence from the file start". Whenold_stringwas a multi-line block and a line inside it recurred elsewhere in the file, the returned offset pointed to a different identical line → replacement at the wrong location. Now computes the true offset by summing line lengths. FindTextreturns a(pos, length)tuple; replacement slices by the actual match length — In the Trim fuzzy branch, source lines may carry trailing/leading whitespace, making the real matched block longer thanold_string. The old code sliced withop.oldString.Length, cutting in the middle of the block and leaving a half-residue. Now returns the block's true length and the caller slices accordingly.
Behavioral impact
- AI mis-remembering identifier case → previously always failed and retried; now matches and replaces directly.
- Exact match still takes priority (when case is correct the fallback layer is not reached — behavior unchanged).
- Uniqueness protection is NOT relaxed: fragments that recur (e.g. the
VR(cvr_hmibtn0)=0clear-to-zero pattern across multiple subroutines) still require the AI to supply more context to locate — this remains a reasonable safety guard.
v0.3.34
v0.3.34 — 子 agent 方言感知补全
补全 0.3.33 的方言切换:子 agent(research / review / debug / explore / verify)现在也感知当前项目方言,与主线对齐。
修复
- 子 agent 方言感知 — 0.3.33 的方言提示词切换只覆盖主线 system prompt,子 agent 拿不到主线项目上下文(
BuildDynamicContext),导致 IEC 项目里 verify/review 不知用library="iec"查证、缺 IEC 防漂移锚点。现给子 agent system 注入一段轻量方言上下文块:当前方言 +lookup_command的 library 指向 + 关键防漂移锚点(TrioBASIC:防 VB/VB.NET 漂移;IEC:TC_* 非 PLCOpen、域 FB 逐引脚查证)。dialect 未知则不注入。不打 cache_control,与 memory 块同处理。
安装:下载 TrioAI.MPPlugin,Motion Perfect 自动识别(无需改扩展名)。
v0.3.33
v0.3.33 — 系统提示词按方言动态切换
系统提示词现按编程方言(TrioBASIC / IEC ST)动态切换。IEC 项目首次获得与 TrioBASIC 同等深度的专属提示词,从源头抑制向 PLCOpen 漂移。
新增
- 方言专属系统提示词动态切换 — 内置两份自包含精炼提示词
skills/prompts/{triobasic,iec}.md,运行时按「生效方言」选用。Auto 模式扫描项目程序推断主导方言(纯 IEC → IEC,否则 TrioBASIC);也可手动锁定。 - 设置面板方言选择 — 新增「提示词方言」下拉(Auto / TrioBASIC / IEC ST),配置持久化
dialectMode(默认 Auto)。 - 三层兜底读取 — DataDir 用户版 → 插件打包源 → 内嵌 DefaultPrompt,确保开箱即用且部署异常不崩。
变更
- 提示词真源从单一
DefaultPrompt迁移到打包资源skills/prompts/*.md(DefaultPrompt 降级为通用兜底)。 - 移除已废弃的
AI_INSTRUCTIONS.md落盘机制。 - 方言会话内稳定,Block1 缓存大部分命中;仅手动切换方言那一轮 cache miss。
安装:下载 TrioAI.MPPlugin,Motion Perfect 自动识别(无需改扩展名)。
v0.3.32 — V5.7 双语帮助 + 中英开关 + lookup 稳定性
v0.3.32 — V5.7 双语帮助替换三参考库 + 中英开关 + lookup 稳定性修复
变更
- 参考库切换为 MP V5.7 mkdocs 帮助 —— triobasic / iec / plcopen 改用 V5.7 自带双语帮助,正文更干净(提取 后 ~6KB/页 vs 整页 134KB)、类别(type)更准、自带中英;包体积 23MB → 3.4MB。新构建脚本 build_skills_v57.py
- 中英双语 + 语言开关 —— 每库按 {lib}/{lang}/ 组织,自带中英两套;新增「使用中文帮助文档」开关(useChineseDocs,默认关闭=英文)
- 丢弃图片/导航资源 —— 纯文本 API 渲染不了图片,构建时丢弃每命令图片目录与 mkdocs 的 assets/index/404
修复(lookup 查询稳定性)
- 命令签名恢复 —— 从每页 Syntax
提取权威签名存入 index.json 独立 sig 字段,覆盖回到 ~25%,lookup summary 档与代码参数个数校验恢复 - 库标识修正(回归) —— 修正 {lib}/{lang} 目录改造引入的 Lib 回归(catalog 分类 / 库过滤 / 返回值 / 校验索引判定)
- 切换语言后重建校验索引 —— _triobasicIds / _signatures 按新语言目录的文件重建
其他
- README:MotionPerfect 版本更新为 V5.6 / V5.7(保留双兼容),安装路径示例改 V5.7
- 兼容 Motion Perfect V5.6 与 V5.7(运行时反射,详见 0.3.31)
v0.3.31 — V5.6/V5.7 双版本兼容
V5.6 / V5.7 双版本兼容
0.3.30 适配 V5.7 时失去了 V5.6 兼容——编译错误 API 在 V5.6→V5.7 被整体重做(成员互斥),静态绑定注定只能认一个版本。本版本新增运行时反射层 CompileApiCompat,让同一个 TrioAI.MPPlugin 同时可运行在 Motion Perfect V5.6 与 V5.7。
0.3.30 是过渡版(仅 V5.7),未单独发布 Release。0.3.31 是首个双版本兼容版,V5.6 / V5.7 用户都装这一个即可。
修复
- 编译事件(
COMPILEStateEventArgs):V5.6 读ErrorCode/ErrorLine/ErrorDescription,V5.7 读isError+Errors,反射探测实际形态后统一成同一错误列表,逐条展示不丢错误。 - CompileProgram:反射调用,兼容 V5.6 返回单个
TrioBasicError与 V5.7 返回List<TrioBasicError>(字段名两版一致,按名反射读取)。 - Parser_BAS.EnumTokens:V5.6/V5.7 仅命名空间不同(
EnumTokens签名与EnumTokenDelegate两版一致),反射探测命名空间并把 lambda 重绑到运行时委托,token 表校验两版均可用。
安装
下载下方 TrioAI.MPPlugin,按 Motion Perfect 插件方式部署(文件名即部署名,无需改扩展名)。V5.6、V5.7 均可。
v0.3.28 — 子 agent 内部轨迹折叠显示
子 agent 内部轨迹折叠显示
子 agent(research / review / debug / explore / verify)跑完后,聊天流新增一条可折叠的内部轨迹消息,用户可见其每轮思考、工具调用与结果摘要。
新增
- 子 agent 内部轨迹折叠显示 — 此前 subagent 跑时 UI 只有顶部进度条 banner,内部 thinking / 工具调用 / 结果跑完即丢,用户无法看见它做了什么。现
RunSubagent收集轨迹(每轮 💭 思考 + 🔧 工具调用+入参 + → 结果摘要 + ── conclusion ──),跑完通过新回调OnResearchTrace回传,ChatPanel 插一条深蓝色[agentType]折叠消息(复用现成 Expander)。每步摘要按 ~500 字截断,紧凑可读;取消 / 异常也回传已有部分。Expander header 按 Role 区分(普通消息 = 思考 / Subagent = 📋 子 agent 轨迹)。
部署:下载下方 TrioAI.MPPlugin,部署到 Motion Perfect 插件目录。
v0.3.27
主线命令查证改走 research 子 agent + 分层 lookup
改进
- 主线 full 命令查证改走 research 子 agent —— 此前主线直接
lookup_command full=true把完整 HTML(~16KB/次)拉进主对话历史,是主上下文膨胀主因之一。现改为:需要命令完整语法/示例/参数时派 research 子 agent(在隔离上下文读 full 文档、返回精炼结论,raw HTML 不进主历史);lookup_command(full=false)仅作轻量确认/签名。撤回 0.3.26 的"主线 lookup 强制 full=true"。 - research 内部分层 lookup(两档) —— 此前 research 对每个命令都
full=true一次;改为先full=false(name+signature+description),仅在不足以提取所需时才对该命令升级full=true,多数命令只需 summary。 - research 工具描述 去掉"单命令别用 research",改为单/多命令完整查证都可用 research(可批量)。
修复
- 修 lookup summary 档 signature 空返回 bug ——
LookupCommand取签名表前未触发EnsureValidationIndex(),导致 full=false 时 signature 经常空(日志 7 个命令全空)。补EnsureValidationIndex()后 summary 档带真实签名,分层第一档可用。 - 子 agent 跳过主线 lookup 去重(修误命中) —— 主线去重扫
_conversationHistory,子 agent 调用在隔离 subMessages,既扫不到自己的、又会误命中主线历史返回误导性 note(但子 agent 隔离看不到)。加_inSubagent标志,子 agent 执行期间 ExecuteTool 跳过去重。
v0.3.26
修复主线 system prompt 的 DIM 语法错误
修复
- 主线 safe-coding 对照表的 DIM 行原本是错的 —— 旧表把数组"正确"写法标为
DIM arr(10)(不带 AS type),与官方文档DIM name AS type(size)冲突。这正是日志中 agent 对 FINDMARK 的DIM userregpos(裸、不带类型)下"在 TrioBASIC 正确"结论的根因——system prompt 自己误导了它。 现按skills/triobasic/DIM.html纠正:标量x = 0(隐式 FLOAT)或DIM x AS FLOAT;数组DIM name AS type(size);新增裸DIM x(不带 AS type)在 TrioBASIC 非法的反例行。 - 主线 lookup 强制 full=true —— 不带 full=true 只拿到截断摘要 + 空 signature,判不了带参数用法。MANDATORY 条款现明确要求 full=true。
- MANDATORY 点名声明/类型 drift 高危 —— DIM/AS/类型/数组是 BASIC 方言差异最大的地方,不得凭记忆判断。
此次错误来自主线模型,非子 agent;0.3.25 的子 agent 加强不覆盖主线,本次补主线侧。
v0.3.24
子 agent 注入持久化记忆
此前持久化记忆(memory.md)只注入主对话,5 种子 agent(research / review / debug / explore / verify)拿不到——所以 review / debug 子 agent 写结论时可能不遵循用户偏好(如中文注释)。现给子 agent system 追加 memory 块(_memoryEnabled 且非空时),与主线一致。子 agent 仍不拿主线历史 / 项目上下文 / task 清单(独立上下文设计不变),memory 是它了解用户偏好的唯一补充来源。memory 块放在 prompt 块之后(不加 cache_control,不影响 prompt 块的前缀缓存)。
详见 CHANGELOG.md / CHANGELOG_EN.md。
v0.3.23
编辑类免确认改为会话级首次许可
0.3.22 把 6 个编辑/编译类工具(write_source / patch_source / create_program / delete_program / rename_program / compile_program)设为永久免确认,意味着 AI 可在新对话一上来就随意改/删程序源码而用户完全不介入。改为会话级首次许可:当前对话内首次用到编辑/编译类工具时仍弹一次确认,点「允许」后本对话内这类操作自动放行;新对话或切换会话重新要首次许可。运行/上下传/变量写入类(run_program / stop_program / set_program_process / upload / download / write_vr / write_table / write_iec_variables)不受影响,仍每次确认。新增会话级状态 _sessionEditApproved,在 StartNewSession / LoadSession / ClearHistory 三处重置。AiOptimizationTests 新增 P-S21。
详见 CHANGELOG.md / CHANGELOG_EN.md。