code-engine-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Engine Package Update (CLI)
Code Engine 包更新(CLI)
Use this skill for package update/version workflows and safe contract evolution.
使用此skill进行包更新/版本工作流和安全的契约演进。
Intent
意图
This skill covers:
- update existing package code
- create a new version on an existing package id
- detect and handle mapping drift between package and app manifest
- validate datatype contract stability
For app-runtime invocation code, use .
~/.agents/skills/code-engine/SKILL.md此skill涵盖:
- 更新现有包代码
- 在现有包ID上创建新版本
- 检测并处理包与应用清单之间的映射漂移
- 验证数据类型契约稳定性
对于app-runtime调用代码,请使用。
~/.agents/skills/code-engine/SKILL.mdPrimary Execution Path
主要执行路径
Prefer :
community-domo-clibash
community-domo-cli --instance <instance> code-engine update-version <package_id> <version> --body-file payload.jsonFallback endpoint pattern:
http
POST /api/codeengine/v2/packageswith and set in body for versioned update behavior.
idversion优先使用:
community-domo-clibash
community-domo-cli --instance <instance> code-engine update-version <package_id> <version> --body-file payload.json备用端点模式:
http
POST /api/codeengine/v2/packages在请求体中设置和以实现版本化更新行为。
idversionRelease Safety Rule
发布安全规则
Hard rule: never call any Code Engine release endpoint unless the user explicitly says "release".
- Do not infer release from context.
- Do not release as part of "finish", "publish", or "make it work".
- If release appears necessary, stop and ask for explicit release approval first.
硬性规则:除非用户明确说**“release”**,否则绝不调用任何Code Engine发布端点。
- 不要从上下文推断发布。
- 不要将发布作为“完成”、“发布”或“使其工作”的一部分。
- 如果发布看似必要,请先停止并请求明确的发布批准。
Update/New-Version Behavior
更新/新版本行为
Preferred create/update model:
- Create a new package:
POST /api/codeengine/v2/packages - Create a new version of an existing package: also with
POST /api/codeengine/v2/packagesandid(for exampleversion) in the request body, including code/manifest payload.1.0.1 - Update an existing package version:
PUT /api/codeengine/v2/packages/{id}/versions/{version} - If update fails because the target version is deployed/immutable, create a new version and then update that new version.
Execution notes:
- For new-version creation, prefer creating the version with full code+manifest payload immediately.
- Use for subsequent changes to that specific version.
PUT
Always emit resulting and for downstream manifest sync.
packageIdversion首选创建/更新模型:
- 创建新包:
POST /api/codeengine/v2/packages - 创建现有包的新版本:同样使用,在请求体中包含
POST /api/codeengine/v2/packages和id(例如version),包括代码/清单负载。1.0.1 - 更新现有包版本:
PUT /api/codeengine/v2/packages/{id}/versions/{version} - 如果更新失败,因为目标版本已部署/不可变,请创建新版本,然后更新该新版本。
执行说明:
- 对于新版本创建,建议立即使用完整的代码+清单负载创建版本。
- 对于该特定版本的后续更改,使用。
PUT
始终输出最终的和以进行下游清单同步。
packageIdversionContract Safeguards
契约保护
Before update publish:
- compare existing function aliases vs proposed aliases
- compare parameter names/types/nullability
- compare output shape/type
- flag breaking changes (removed required params, incompatible type changes)
When breaking change is intentional, require explicit migration note in generated output.
在更新发布前:
- 比较现有函数别名与建议别名
- 比较参数名称/类型/可空性
- 比较输出形状/类型
- 标记破坏性变更(移除必需参数、不兼容的类型变更)
当破坏性变更是有意为之,需要在生成的输出中提供明确的迁移说明。
Drift Handling
漂移处理
After update:
- compare against returned package id/version
manifest.json packagesMapping - sync ,
packageId, and parameter/output contracts when drift detectedversion - keep mapping aliases stable unless user requested rename
更新后:
- 将与返回的包id/version进行比较
manifest.json packagesMapping - 检测到漂移时,同步、
packageId以及参数/输出契约version - 保持映射别名稳定,除非用户要求重命名
Checklist
检查清单
- Correct update path selected (existing vs versioned)
- Input/output datatype contracts validated
- Breaking changes flagged clearly
- Manifest drift checked and synchronized
packagesMapping - Output includes updated package id/version and contract summary
- 选择了正确的更新路径(现有 vs 版本化)
- 输入/输出数据类型契约已验证
- 破坏性变更已清晰标记
- 清单漂移已检查并同步
packagesMapping - 输出包含更新的包id/version和契约摘要