unity-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorkflow Skills
工作流技能
Persistent history and rollback system for AI operations ("Time Machine").
Allows tagging tasks, snapshotting objects before modification, and undoing specific tasks even after Editor restarts.
NEW: Session-level undo - Group all changes from a conversation and undo them together.
适用于AI操作的持久化历史与回滚系统("时光机")。
支持为任务添加标签、在修改前为对象创建快照,甚至在编辑器重启后仍可撤销特定任务。
新增:会话级撤销 - 将一次对话中的所有变更分组,可一次性撤销所有变更。
Guardrails
约束规则
Mode: Semi-Auto (available by default)
DO NOT (common hallucinations):
- does not exist → use
workflow_saveto end and save a taskworkflow_task_end - does not exist → use
workflow_rollback(by taskId) orworkflow_undo_task(by sessionId)workflow_session_undo - does not exist → use
workflow_createworkflow_task_start - is deprecated → use
workflow_revert_taskworkflow_undo_task
Routing:
- For simple undo/redo (1 step) → /
editor_undo(editor module)editor_redo - For multi-step undo → with
history_undoparameter (this module)steps - For conversation-level undo → (this module)
workflow_session_undo
模式:半自动(默认启用)
禁止操作(常见错误):
- 不存在 → 请使用
workflow_save来结束并保存任务workflow_task_end - 不存在 → 请使用
workflow_rollback(通过taskId)或workflow_undo_task(通过sessionId)workflow_session_undo - 不存在 → 请使用
workflow_createworkflow_task_start - 已废弃 → 请使用
workflow_revert_taskworkflow_undo_task
路由规则:
- 简单的撤销/重做(单步)→ 使用/
editor_undo(编辑器模块)editor_redo - 多步撤销 → 使用本模块的并传入
history_undo参数steps - 对话级撤销 → 使用本模块的
workflow_session_undo
Bookmark Skills
书签技能
bookmark_set
bookmark_setbookmark_set
bookmark_setSave current selection and scene view position as a bookmark.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| bookmarkName | string | Yes | - | Name for the bookmark |
| note | string | No | null | Optional note for the bookmark |
Returns:
{ success, bookmark, selectedCount, hasSceneView, note }将当前选择的对象和场景视图位置保存为书签。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| bookmarkName | string | 是 | - | 书签名称 |
| note | string | 否 | null | 书签的可选备注 |
返回值:
{ success, bookmark, selectedCount, hasSceneView, note }bookmark_goto
bookmark_gotobookmark_goto
bookmark_gotoRestore selection and scene view from a bookmark.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| bookmarkName | string | Yes | - | Name of the bookmark to restore |
Returns:
{ success, bookmark, restoredSelection, note }从书签恢复选择的对象和场景视图。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| bookmarkName | string | 是 | - | 要恢复的书签名称 |
返回值:
{ success, bookmark, restoredSelection, note }bookmark_list
bookmark_listbookmark_list
bookmark_listList all saved bookmarks.
No parameters.
Returns:
{ success, count, bookmarks: [{ name, selectedCount, hasSceneView, note, createdAt }] }列出所有已保存的书签。
无参数。
返回值:
{ success, count, bookmarks: [{ name, selectedCount, hasSceneView, note, createdAt }] }bookmark_delete
bookmark_deletebookmark_delete
bookmark_deleteDelete a bookmark.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| bookmarkName | string | Yes | - | Name of the bookmark to delete |
Returns:
{ success, deleted }删除一个书签。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| bookmarkName | string | 是 | - | 要删除的书签名称 |
返回值:
{ success, deleted }History Skills
历史技能
history_undo
history_undohistory_undo
history_undoUndo the last operation (or multiple steps).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| steps | int | No | 1 | Number of undo steps to perform |
Returns:
{ success, undoneSteps }撤销最后一次操作(或多步操作)。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| steps | int | 否 | 1 | 要执行的撤销步数 |
返回值:
{ success, undoneSteps }history_redo
history_redohistory_redo
history_redoRedo the last undone operation (or multiple steps).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| steps | int | No | 1 | Number of redo steps to perform |
Returns:
{ success, redoneSteps }重做最后一次被撤销的操作(或多步操作)。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| steps | int | 否 | 1 | 要执行的重做步数 |
返回值:
{ success, redoneSteps }history_get_current
history_get_currenthistory_get_current
history_get_currentGet the name of the current undo group.
No parameters.
Returns:
{ success, currentGroup, groupIndex }获取当前撤销组的名称。
无参数。
返回值:
{ success, currentGroup, groupIndex }Planning And Batch Governance
规划与批量治理
workflow_plan
workflow_planworkflow_plan
workflow_planGenerate a combined execution plan for multiple skills on the server side.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | JSON array of |
Returns:
{ totalSteps, totalRisk, steps, dependencies, warnings, mayDisconnect }在服务器端为多个技能生成组合执行计划。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 包含 |
返回值:
{ totalSteps, totalRisk, steps, dependencies, warnings, mayDisconnect }batch_query_assets
batch_query_assetsbatch_query_assets
batch_query_assetsQuery project assets with filters that are useful before batch cleanup or migration work.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | No | - | Extra |
| string | No | | Search root |
| string | No | - | Asset type filter such as |
| string | No | - | Regex applied to file name without extension |
| string | No | - | Asset label filter such as |
| int | No | | Max assets returned |
Returns:
{ count, totalMatched, summary, assets }在批量清理或迁移工作前,使用筛选条件查询项目资产。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 否 | - | |
| string | 否 | | 搜索根目录 |
| string | 否 | - | 资产类型筛选器,如 |
| string | 否 | - | 应用于不带扩展名的文件名的正则表达式 |
| string | 否 | - | 资产标签筛选器,如 |
| int | 否 | | 返回的最大资产数量 |
返回值:
{ count, totalMatched, summary, assets }batch_retry_failed
batch_retry_failedbatch_retry_failed
batch_retry_failedRetry only the failed items from an earlier batch execution report. This now reuses the original operation context stored in the report.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Source report ID from |
| bool | No | | Return a |
| int | No | | Chunk size for retry execution |
Returns:
{ status, jobId?, retryCount, originalReportId, reportId? }仅重试之前批量执行报告中的失败项。现在会重用报告中存储的原始操作上下文。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 来自 |
| bool | 否 | | 立即返回 |
| int | 否 | | 重试执行的块大小 |
返回值:
{ status, jobId?, retryCount, originalReportId, reportId? }Session Management (Conversation-Level Undo)
会话管理(对话级撤销)
workflow_session_start
workflow_session_startworkflow_session_start
workflow_session_startStart a new session (conversation-level). All changes will be tracked and can be undone together.
Call this at the beginning of each conversation.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| tag | string | No | null | Label for the session |
Returns:
{ success, sessionId, message }启动一个新的会话(对话级)。所有变更将被追踪,可一次性撤销。
请在每次对话开始时调用此函数。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| tag | string | 否 | null | 会话的标签 |
返回值:
{ success, sessionId, message }workflow_session_end
workflow_session_endworkflow_session_end
workflow_session_endEnd the current session and save all tracked changes.
Call this at the end of each conversation.
No parameters.
Returns:
{ success, sessionId, message }结束当前会话并保存所有追踪的变更。
请在每次对话结束时调用此函数。
无参数。
返回值:
{ success, sessionId, message }workflow_session_undo
workflow_session_undoworkflow_session_undo
workflow_session_undoUndo all changes made during a specific session (conversation-level undo).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| sessionId | string | No | null | The UUID of the session to undo. If not provided, undoes the most recent session |
Returns:
{ success, sessionId, message }撤销特定会话中所做的所有变更(对话级撤销)。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| sessionId | string | 否 | null | 要撤销的会话UUID。如果未提供,则撤销最近的会话 |
返回值:
{ success, sessionId, message }workflow_session_list
workflow_session_listworkflow_session_list
workflow_session_listList all recorded sessions (conversation-level history).
No parameters.
Returns:
{ success, count, currentSessionId, sessions: [{ sessionId, taskCount, totalChanges, startTime, endTime, tags }] }列出所有已记录的会话(对话级历史)。
无参数。
返回值:
{ success, count, currentSessionId, sessions: [{ sessionId, taskCount, totalChanges, startTime, endTime, tags }] }workflow_session_status
workflow_session_statusworkflow_session_status
workflow_session_statusGet the current session status.
No parameters.
Returns:
{ success, hasActiveSession, currentSessionId, isRecording, currentTaskId, currentTaskTag, currentTaskDescription, snapshotCount }获取当前会话状态。
无参数。
返回值:
{ success, hasActiveSession, currentSessionId, isRecording, currentTaskId, currentTaskTag, currentTaskDescription, snapshotCount }Task-Level Skills
任务级技能
workflow_task_start
workflow_task_startworkflow_task_start
workflow_task_startStart a new persistent workflow task to track changes for undo. Call workflow_task_end when done.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| tag | string | Yes | - | Short label for the task (e.g., "Create NPC") |
| description | string | No | "" | Detailed description or prompt |
Returns:
{ success, taskId, message }启动一个新的持久化工作流任务,用于追踪变更以便撤销。完成后请调用workflow_task_end。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| tag | string | 是 | - | 任务的短标签(例如:"创建NPC") |
| description | string | 否 | "" | 详细描述或提示词 |
返回值:
{ success, taskId, message }workflow_task_end
workflow_task_endworkflow_task_end
workflow_task_endEnd the current workflow task and save it. Requires an active task (call workflow_task_start first).
No parameters.
Returns:
{ success, taskId, snapshotCount, message }结束当前工作流任务并保存。需要存在活跃任务(需先调用workflow_task_start)。
无参数。
返回值:
{ success, taskId, snapshotCount, message }workflow_snapshot_object
workflow_snapshot_objectworkflow_snapshot_object
workflow_snapshot_objectManually snapshot an object's state before modification. Requires an active task (call workflow_task_start first).
Call this BEFORE , , etc.
component_set_propertygameobject_set_transform| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | No | null | Name of the Game Object |
| instanceId | int | No | 0 | Instance ID of the object (preferred) |
Returns:
{ success, objectName, type }在修改前手动为对象状态创建快照。需要存在活跃任务(需先调用workflow_task_start)。
请在调用、等函数之前调用此函数。
component_set_propertygameobject_set_transform| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| name | string | 否 | null | 游戏对象的名称 |
| instanceId | int | 否 | 0 | 对象的实例ID(优先使用) |
返回值:
{ success, objectName, type }workflow_snapshot_created
workflow_snapshot_createdworkflow_snapshot_created
workflow_snapshot_createdRecord a newly created object for undo tracking. Requires an active task (call workflow_task_start first).
Note: and automatically record created objects, so you typically don't need to call this manually.
component_addgameobject_create| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | No | null | Name of the Game Object |
| instanceId | int | No | 0 | Instance ID of the object (preferred) |
Returns:
{ success, objectName, type }记录新创建的对象以便追踪撤销。需要存在活跃任务(需先调用workflow_task_start)。
注意: 和会自动记录创建的对象,因此通常无需手动调用此函数。
component_addgameobject_create| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| name | string | 否 | null | 游戏对象的名称 |
| instanceId | int | 否 | 0 | 对象的实例ID(优先使用) |
返回值:
{ success, objectName, type }workflow_list
workflow_listworkflow_list
workflow_listList persistent workflow history.
No parameters.
Returns:
{ success, count, history: [{ id, tag, description, time, changes }] }列出持久化工作流历史。
无参数。
返回值:
{ success, count, history: [{ id, tag, description, time, changes }] }workflow_undo_task
workflow_undo_taskworkflow_undo_task
workflow_undo_taskUndo changes from a specific task (restore to previous state). The undone task is saved and can be redone later.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| taskId | string | Yes | - | The UUID of the task to undo |
Returns:
{ success, taskId }撤销特定任务的变更(恢复到之前的状态)。被撤销的任务会被保存,之后可重做。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| taskId | string | 是 | - | 要撤销的任务UUID |
返回值:
{ success, taskId }workflow_redo_task
workflow_redo_taskworkflow_redo_task
workflow_redo_taskRedo a previously undone task (restore changes).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| taskId | string | No | null | The UUID of the task to redo. If not provided, redoes the most recently undone task |
Returns:
{ success, taskId }重做之前被撤销的任务(恢复变更)。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| taskId | string | 否 | null | 要重做的任务UUID。如果未提供,则重做最近被撤销的任务 |
返回值:
{ success, taskId }workflow_undone_list
workflow_undone_listworkflow_undone_list
workflow_undone_listList all undone tasks that can be redone.
No parameters.
Returns:
{ success, count, undoneStack: [{ id, tag, description, time, changes }] }列出所有可重做的已撤销任务。
无参数。
返回值:
{ success, count, undoneStack: [{ id, tag, description, time, changes }] }workflow_revert_task
workflow_revert_taskworkflow_revert_task
workflow_revert_task(deprecated) Alias for . Use instead.
workflow_undo_taskworkflow_undo_task| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| taskId | string | Yes | - | The UUID of the task to undo |
Returns:
{ success, taskId }(已废弃) 的别名。请使用替代。
workflow_undo_taskworkflow_undo_task| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| taskId | string | 是 | - | 要撤销的任务UUID |
返回值:
{ success, taskId }workflow_delete_task
workflow_delete_taskworkflow_delete_task
workflow_delete_taskDelete a task from history (does not revert changes, just removes the record).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| taskId | string | Yes | - | The UUID of the task to delete |
Returns:
{ success, deletedId }从历史中删除一个任务(不会恢复变更,仅移除记录)。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| taskId | string | 是 | - | 要删除的任务UUID |
返回值:
{ success, deletedId }Minimal Example
极简示例
python
import unity_skillspython
import unity_skillsSession-level: wrap entire conversation for bulk undo
会话级:包裹整个对话以支持批量撤销
unity_skills.call_skill("workflow_session_start", tag="Build Player")
unity_skills.call_skill("gameobject_create", name="Player", primitiveType="Capsule")
unity_skills.call_skill("component_add", name="Player", componentType="Rigidbody")
unity_skills.call_skill("workflow_session_end")
unity_skills.call_skill("workflow_session_start", tag="Build Player")
unity_skills.call_skill("gameobject_create", name="Player", primitiveType="Capsule")
unity_skills.call_skill("component_add", name="Player", componentType="Rigidbody")
unity_skills.call_skill("workflow_session_end")
Later: undo entire session
后续操作:撤销整个会话
sessions = unity_skills.call_skill("workflow_session_list")
unity_skills.call_skill("workflow_session_undo", sessionId=sessions["sessions"][0]["sessionId"])
undefinedsessions = unity_skills.call_skill("workflow_session_list")
unity_skills.call_skill("workflow_session_undo", sessionId=sessions["sessions"][0]["sessionId"])
undefinedAuto-Tracked Operations
自动追踪的操作
The following operations are automatically tracked for undo when a session/task is active:
- /
gameobject_creategameobject_create_batch - /
gameobject_duplicategameobject_duplicate_batch - /
component_addcomponent_add_batch - (canvas, button, text, image, etc.)
ui_create_* light_create- /
prefab_instantiateprefab_instantiate_batch - /
material_creatematerial_duplicate terrain_createcinemachine_create_vcam
For modification operations, the system auto-snapshots target objects before changes when possible.
当会话/任务处于活跃状态时,以下操作会被自动追踪以支持撤销:
- /
gameobject_creategameobject_create_batch - /
gameobject_duplicategameobject_duplicate_batch - /
component_addcomponent_add_batch - (画布、按钮、文本、图片等)
ui_create_* light_create- /
prefab_instantiateprefab_instantiate_batch - /
material_creatematerial_duplicate terrain_createcinemachine_create_vcam
对于修改操作,系统会尽可能在变更前自动为目标对象创建快照。
Exact Signatures
精确签名
Exact names, parameters, defaults, and returns are defined by or , not by this file.
GET /skills/schemaunity_skills.get_skill_schema()精确的名称、参数、默认值和返回值由或定义,而非本文件。
GET /skills/schemaunity_skills.get_skill_schema()