unity-package
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBefore calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.GET /skills/recommend?includeSchema=true
在调用本模块中的任何技能之前: 如果你打算根据技能名称或描述猜测参数来调用技能,请停止——先阅读本文档(或通过获取其架构)。如果你已经从推荐/架构中获取了参数定义,可以直接进行dryRun。GET /skills/recommend?includeSchema=true
Triggers
触发场景
- Adding or removing UPM packages
- Checking installed versions
- Searching the registry
- Scripting package operations
- 添加或移除 UPM 包、检查已装版本、搜索 registry、脚本化包操作
- 添加或移除UPM包
- 检查已安装版本
- 搜索注册表
- 编写包操作脚本
- 添加或移除 UPM 包、检查已装版本、搜索 registry、脚本化包操作
Package Skills
包管理技能
Manage installed Unity packages and package-related helper flows such as Cinemachine and Splines setup.
管理已安装的Unity包以及与包相关的辅助流程,例如Cinemachine和Splines的设置。
Guardrails
防护规则
Operating Mode (v1.9 three-tier):
- Approval (default): query skills (,
package_list,package_check,package_search,package_get_dependencies,package_get_versions) run directly.package_get_cinemachine_statusis the only FullAuto mutator — onpackage_refresh, run the grant protocol for it. Every other mutator is auto-forbidden (next bullet) and grant does not unlock it.MODE_RESTRICTED - Auto / Bypass: SemiAuto and FullAuto run directly.
- Auto-forbidden in this module: ,
package_install,package_remove,package_install_cinemachine(allpackage_install_splines,MayTriggerReload = true;RiskLevel = "high"also carriespackage_remove). They returnSkillOperation.Deleteunder both Approval and Auto, and are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returnsMODE_FORBIDDENtoo, so do not attempt it.MODE_FORBIDDEN - Install/remove/refresh jobs return immediately with a ; the actual package import + Domain Reload happens asynchronously and may make the REST server transiently unavailable. Poll with
jobId/job_status.job_wait
DO NOT (common hallucinations):
- /
package_adddo not exist -> usepackage_updatepackage_install - does not exist -> use
package_get_info,package_list,package_check, orpackage_get_dependenciespackage_get_versions - searches the installed package cache only; it does not query the Unity Registry
package_search - Package query skills initialize their cache automatically after Domain Reload. During the short cold-start window they return ; retry instead of treating this as
{ success: false, status: "refreshing", cacheReady: false, retryStrategy: "wait_and_retry", retryAfterSeconds: 2 }.installed=false - Package install/remove/refresh jobs can trigger package import and Domain Reload; expect transient server unavailability and use returned job IDs
Routing:
- For Cinemachine quick setup -> use
package_install_cinemachine - For Splines quick setup -> use
package_install_splines - For project manifest inspection -> use
project_get_packages - For define symbol changes after package installation -> use
debug_set_defines
操作模式(v1.9三层模式):
- 审批模式(默认):查询类技能(、
package_list、package_check、package_search、package_get_dependencies、package_get_versions)可直接运行。package_get_cinemachine_status是唯一的全自动变更类技能——在package_refresh模式下,需运行授权协议才能执行。其他所有变更类技能均自动禁用(见下一点),且授权操作无法解锁它们。MODE_RESTRICTED - 自动模式 / 绕过模式:半自动和全自动技能可直接运行。
- 本模块中自动禁用的技能:、
package_install、package_remove、package_install_cinemachine(这些技能均满足package_install_splines、MayTriggerReload = true;RiskLevel = "high"还带有package_remove属性)。它们在审批模式和自动模式下均返回SkillOperation.Delete,仅能在绕过模式下或通过用户管理的允许列表条目执行;授权流程也会返回MODE_FORBIDDEN,因此请勿尝试授权。MODE_FORBIDDEN - 安装/移除/刷新任务会立即返回;实际的包导入+域重载操作会异步进行,可能导致REST服务器暂时不可用。请使用
jobId/job_status进行轮询。job_wait
请勿(常见错误):
- /
package_add不存在 -> 使用package_updatepackage_install - 不存在 -> 使用
package_get_info、package_list、package_check或package_get_dependenciespackage_get_versions - 仅搜索已安装的包缓存;不查询Unity注册表
package_search - 包查询类技能会在域重载后自动初始化缓存。在短暂的冷启动窗口期间,它们会返回;请重试,不要将其视为
{ success: false, status: "refreshing", cacheReady: false, retryStrategy: "wait_and_retry", retryAfterSeconds: 2 }。installed=false - 包安装/移除/刷新任务可能触发包导入和域重载;请预期服务器会暂时不可用,并使用返回的任务ID。
路由指引:
- 如需快速设置Cinemachine -> 使用
package_install_cinemachine - 如需快速设置Splines -> 使用
package_install_splines - 如需检查项目清单 -> 使用
project_get_packages - 如需在包安装后修改定义符号 -> 使用
debug_set_defines
Skills
技能列表
package_list
package_listpackage_list
package_listList all installed packages currently cached by UnitySkills.
Parameters: None.
Returns:
{ success, count, packages }列出UnitySkills当前缓存的所有已安装包。
参数: 无。
返回值:
{ success, count, packages }package_check
package_checkpackage_check
package_checkCheck whether a package is installed.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Package ID such as |
Returns:
{ packageId, installed, version }检查某个包是否已安装。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 包ID,例如 |
返回值:
{ packageId, installed, version }package_install
package_installpackage_install
package_installInstall a package. Returns an async job when the request is accepted.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Package ID to install |
| string | No | null | Optional explicit version |
Returns:
{ success, status, jobId, message, serverAvailability }安装一个包。请求被接受后会返回一个异步任务。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 要安装的包ID |
| string | 否 | null | 可选的指定版本 |
返回值:
{ success, status, jobId, message, serverAvailability }package_remove
package_removepackage_remove
package_removeRemove an installed package. Returns an async job when the request is accepted.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Installed package ID to remove |
Returns:
{ success, status, jobId, message, serverAvailability }移除一个已安装的包。请求被接受后会返回一个异步任务。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 要移除的已安装包ID |
返回值:
{ success, status, jobId, message, serverAvailability }package_refresh
package_refreshpackage_refresh
package_refreshRefresh the installed package cache used by query skills.
Parameters: None.
Returns:
{ success, status, jobId, message }刷新查询类技能使用的已安装包缓存。
参数: 无。
返回值:
{ success, status, jobId, message }package_install_cinemachine
package_install_cinemachinepackage_install_cinemachine
package_install_cinemachineInstall Cinemachine using the supported package/version strategy.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| int | No | 3 | |
Notes:
- CM3 auto-installs the Splines dependency.
- If the requested line is already installed, this skill can return immediate success instead of a job.
Returns:
{ success, status?, jobId?, message, serverAvailability? }使用受支持的包/版本策略安装Cinemachine。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| int | 否 | 3 | |
注意:
- CM3会自动安装Splines依赖。
- 如果请求的版本已安装,该技能可能直接返回成功,而非返回任务。
返回值:
{ success, status?, jobId?, message, serverAvailability? }package_install_splines
package_install_splinespackage_install_splines
package_install_splinesInstall or upgrade Unity Splines using the recommended version for the current Unity editor line.
Parameters: None.
Returns:
{ success, status?, jobId?, message, serverAvailability? }使用当前Unity编辑器版本推荐的版本安装或升级Unity Splines。
参数: 无。
返回值:
{ success, status?, jobId?, message, serverAvailability? }package_get_cinemachine_status
package_get_cinemachine_statuspackage_get_cinemachine_status
package_get_cinemachine_statusGet current Cinemachine and Splines installation status.
Parameters: None.
Returns:
{ cinemachine, splines }获取当前Cinemachine和Splines的安装状态。
参数: 无。
返回值:
{ cinemachine, splines }package_search
package_searchpackage_search
package_searchSearch the installed package cache by package name or display name.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Search keyword |
Returns:
{ success, query, count, packages }按包名称或显示名称搜索已安装的包缓存。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 搜索关键词 |
返回值:
{ success, query, count, packages }package_get_dependencies
package_get_dependenciespackage_get_dependencies
package_get_dependenciesGet dependency information for one installed package.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Installed package ID |
Returns:
{ success, packageId, version, dependencyCount, dependencies }获取一个已安装包的依赖信息。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 已安装包的ID |
返回值:
{ success, packageId, version, dependencyCount, dependencies }package_get_versions
package_get_versionspackage_get_versions
package_get_versionsGet available versions for one installed package.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Installed package ID |
Returns:
{ success, packageId, currentVersion, compatibleVersion, latestVersion, allVersions }获取一个已安装包的可用版本。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| string | 是 | - | 已安装包的ID |
返回值:
{ success, packageId, currentVersion, compatibleVersion, latestVersion, allVersions }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()