From 6969beb347dcc46c128a3feb28c1b8e26879034f Mon Sep 17 00:00:00 2001 From: "openai-code-agent[bot]" <242516109+Codex@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:53:01 +0000 Subject: [PATCH 1/2] Initial plan From 28c450e0f83c1236f7cc5f1a09a594f56c237941 Mon Sep 17 00:00:00 2001 From: "openai-code-agent[bot]" <242516109+Codex@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:55:09 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20bluecode=20?= =?UTF-8?q?=E8=93=9D=E5=9B=BE=20DSL=20=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: winyunq <50171884+winyunq@users.noreply.github.com> --- Readme.md | 17 +++++++++++++++-- Readme_zh.md | 13 +++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 0742d72..0ad8403 100644 --- a/Readme.md +++ b/Readme.md @@ -221,8 +221,21 @@ flowchart LR | | `connect_data_to_pin` | ✅ | Connect pins precisely (Supports `NodeID:PinName` format). | | | `add_variable` | ✅ | Add new member variable. | | | `delete_variable` | ✅ | Delete member variable. | - | | `delete_node` | ✅ | Delete specific node. | - | | `compile_blueprint` | ✅ | Compile and apply changes. | +| | `delete_node` | ✅ | Delete specific node. | +| | `compile_blueprint` | ✅ | Compile and apply changes. | + +## Bluecode: Blueprint Flow DSL (Design) + +**Goal:** reduce chatty, step-by-step MCP calls by letting AI describe an executable flow in one shot, while keeping human-like focus (easy to append/overwrite, hard to delete). + +- **Targeting (`bluecode_set_function`)**: `path:domain?:FunctionName` with robust matching (default path = current UMG target; widget targets take precedence). On success the cursor starts at `begin` and ends at `end`/`return`. Ambiguities should be returned for disambiguation. +- **Core primitives**: `main` (entry), `begin` (branch node), `end` (empty terminator), `return` (explicit return). Node list is a tree that already implies execution edges; connect list is the low-level wire view when needed. +- **Read (`bluecode_read`)**: traverse from `main` to `end/return`, returning a flattened code-like expression such as `main(i)->if(i%2==0){print("hi")->return; print("fail")->end}`; nodes may be annotated with ids (`1:main-2:end`) to support precise edits. +- **Write (`bluecode_write`)**: accepts expressions like `main-print2-end` or `1:main-print("hello")-2:end`. Default attachment is to the right of `end`; explicit left/right ids are honored with right bias. Writes never hard-delete nodes; instead they merge by priority (id match > arg match > function match > node kind) and insert new nodes to the right. Duplicate/intended-overwrite examples: + - Existing `main-print1-print3-end`, AI sends `main-print2-end` -> result `main-print1-print3-print2-end` (report insertion). + - Existing `main-print1-print3-end`, AI sends `main-print2-print3-end` -> `print3` is matched and preserved, yielding `main-print1-print2-print3-end`. +- **Non-executable nodes**: if a node cannot be connected, first try to reinterpret it as parameters; then try a single implicit cast; otherwise move it to a floating list. AI can also edit the connect list explicitly for edge cases. +- **Compile (`bluecode_compile`)**: compiles the current bluecode graph and returns a compact JSON payload with only essential diagnostics. ## UMG Sequencer API Status diff --git a/Readme_zh.md b/Readme_zh.md index 6d7a7f0..e228eda 100644 --- a/Readme_zh.md +++ b/Readme_zh.md @@ -224,6 +224,19 @@ flowchart LR | | `delete_node` | ✅ | 删除特定节点。 | | | `compile_blueprint` | ✅ | 编译并应用更改。 | +## Bluecode:蓝图流程 DSL(设计阶段) + +**目标:** 减少逐步的啰嗦调用,让 AI 一次描述完整的执行流,同时保持“易写难删、聚焦人类思维”的行为。 + +- **定位 (`bluecode_set_function`)**:`路径:域?:函数名` 的鲁棒匹配(默认路径=当前 UMG 目标,若有 widget target 优先生效)。成功后光标默认从 `begin` 到 `end/return`,若存在歧义需返回待消歧信息。 +- **核心基元**:`main`(入口)、`begin`(分支)、`end`(空终止)、`return`(显式返回)。node list 是已经包含执行关系的树;connect list 是必要时的底层连线视图。 +- **读取 (`bluecode_read`)**:从 `main` 到 `end/return` 展开,返回代码式表达,如 `main(i)->if(i%2==0){print(\"hi\")->return; print(\"fail\")->end}`;可附带节点编号(如 `1:main-2:end`)便于精确编辑。 +- **写入 (`bluecode_write`)**:接受 `main-print2-end` 或 `1:main-print(\"hello\")-2:end` 形式。默认右侧挂接到 `end`,显式左右 id 优先且右侧优先。写入不做硬删除,而是按优先级合并(id > 参数 > 函数名 > 节点类型)并向右插入新节点。重复/覆盖示例: + - 已有 `main-print1-print3-end`,AI 写 `main-print2-end` -> 结果 `main-print1-print3-print2-end`(返回插入信息)。 + - 已有 `main-print1-print3-end`,AI 写 `main-print2-print3-end` -> `print3` 被匹配保留,结果 `main-print1-print2-print3-end`。 +- **不可连节点**:无法连线的节点先尝试转换为参数,再尝试一次隐式 cast,否则移入游离列表。必要时 AI 也可直接操作 connect list。 +- **编译 (`bluecode_compile`)**:编译当前 bluecode 图,返回精简 JSON 诊断。 + ## UMG 动画 (Sequencer) API 实现状态 | 命令 | 状态 | 描述 |