feat: 支持智能体自主编写 Tool/MCP / Guide self-authored Tools and MCP (#272)

用户要求自建可复用工具或设备协议接入时,现有指南缺少从代码到工具登记与调用的完整路径。新增双语 tool-mcp-authoring
Skill,提供 AgentFS Tool 和 MCP 作者合同、依赖/权限及生命周期验证;同步内置清单和目录元数据。修正
app-developer 的正文、参考和示例,作者动作统一使用 AppAuthoring,安装生命周期保留 AppManage。

When users request reusable tools or device integrations, the existing
guidance does not explain the complete
code-to-registration-to-invocation path. Add bilingual Tool/MCP
authoring guidance and references, and update builtin/catalog metadata.
Migrate app-developer authoring instructions and examples to
AppAuthoring while keeping installation lifecycle on AppManage.

验证 / Validation: market i18n and complete catalog validation pass (0
errors; existing governance warnings retained); all translation
freshness checks pass. Both localized script examples pass the real Tool
frontmatter Schema, execute valid input and reject invalid input.
Full-tree credential-pattern and customer-neutrality checks pass. No
hardware operation, model decision or full application release is
claimed.
This commit is contained in:
yige authored and GitHub committed 2026-11-09 17:11:25 +08:00
1 parent 2a6a814a0f
commit da94f5361b
18 files changed
+474 -51

No files matched your search

+19 -19
View File
@@ -4,15 +4,15 @@
"description": "用户要求开发、修改或发布自己的工作台应用,或把固定应用版本分发到 GitHub/Gitea 与 Registry 时使用。按所选技术栈使用的外部 Node/Docker 运行时、托管、Git 服务和数据库须有真实环境或连接及适用条款,可能另行部署或收费;缺能力时说明原因。",
"license": "MIT",
"compatibility": "Requires DesireCore app-authoring-v1 capability handshake. Depending on the chosen stack, Node/Docker runtimes, hosting, GitHub/Gitea and databases require actual authorized environments or connections and applicable licensing/deployment terms; separate costs may apply. Unavailable capabilities stop the affected operation.",
"version": "1.0.1",
"requiredClientVersion": "10.0.180",
"version": "1.0.2",
"requiredClientVersion": "10.0.203",
"type": "procedural",
"risk_level": "high",
"status": "enabled",
"disable-model-invocation": true,
"provides": {
"tools": [
"AppManage"
"AppAuthoring"
]
},
"tags": [
@@ -23,7 +23,7 @@
],
"metadata": {
"author": "desirecore",
"updated_at": "2026-10-28",
"updated_at": "2026-11-09",
"i18n": {
"default_locale": "en-US",
"source_locale": "zh-CN",
@@ -36,18 +36,18 @@
"short_desc": "开发个人工作台并发布到我的应用,按需分发固定版本",
"description": "用户要求开发、修改或发布自己的工作台应用,或把固定应用版本分发到 GitHub/Gitea 与 Registry 时使用。按所选技术栈使用的外部 Node/Docker 运行时、托管、Git 服务和数据库须有真实环境或连接及适用条款,可能另行部署或收费;缺能力时说明原因。",
"body": "./SKILL.zh-CN.md",
"source_hash": "sha256:9c37c5ad344e380e",
"source_hash": "sha256:1e03d05fc50bb017",
"translated_by": "ai:gpt-6",
"translated_at": "2026-10-28"
"translated_at": "2026-11-09"
},
"en-US": {
"name": "Application Development and Publishing",
"short_desc": "Develop a personal workbench, publish it to My Apps, and distribute fixed releases on request",
"description": "Use when the user asks to develop, modify or publish a personal workbench application, or distribute a fixed release through GitHub/Gitea and Registry. Node/Docker runtimes, hosting, Git services and databases used by the chosen stack need actual environments or connections and applicable terms; separate deployment or costs may apply. Report unavailable capabilities.",
"body": "./SKILL.md",
"source_hash": "sha256:9c37c5ad344e380e",
"translated_by": "ai:claude-opus-5-5",
"translated_at": "2026-10-28"
"source_hash": "sha256:1e03d05fc50bb017",
"translated_by": "ai:gpt-6",
"translated_at": "2026-11-09"
}
}
},
@@ -72,8 +72,8 @@ The Agent chooses the implementation, framework and working method. The platform
## L1: Read Capabilities and Context
1. Read or create the task's single file-based Plan, preserving the actual Agent/session, device, authorized work directory and development Task. Continue within the user's existing requirements and authorization.
2. Use the original `AppManage` action `authoring_capabilities`. Require `capabilities.protocol: app-authoring-v1` and inspect supported, authorized, available and reason independently. Its `fileRoots` are real readable roots for the current Agent, and `registryTargetIds` are registered catalog targets. These read facts grant neither upload nor filesystem write authority. `draftSource` is this conversation's draft source `{agentId,sessionId}`; copy it verbatim as the app-draft.json source. If the result carries `draftSourceUnavailable`, or an older client returns no such field, the current conversation ID is unavailable; handle it as described in L2. The minimum version is a code baseline, not proof that a shipped client supports this protocol. Authoring actions enter the original domain owners without passing platform credentials to the model.
3. Natural-language development needs no additional handoff protocol. Installation, registration, update or uninstall continues through ApplicationManagement-v2 and the single writer. Read `app-install-manager` when available; never edit installed-entries.json directly.
2. Use the original `AppAuthoring` action `authoring_capabilities`. Require `capabilities.protocol: app-authoring-v1` and inspect supported, authorized, available and reason independently. Its `fileRoots` are real readable roots for the current Agent, and `registryTargetIds` are registered catalog targets. These read facts grant neither upload nor filesystem write authority. `draftSource` is this conversation's draft source `{agentId,sessionId}`; copy it verbatim as the app-draft.json source. If the result carries `draftSourceUnavailable`, or an older client returns no such field, the current conversation ID is unavailable; handle it as described in L2. The minimum version is a code baseline, not proof that a shipped client supports this protocol. Authoring actions enter the original domain owners without passing platform credentials to the model.
3. Use `AppManage` for installation switches, uninstall, recovery and data cleanup, and `AppAuthoring` for authoring. A retired AppManage action's migration error is not an executed operation. Natural-language development needs no additional handoff protocol. Installation, registration, update or uninstall continues through ApplicationManagement-v2 and the single writer. Read `app-install-manager` when available; never edit installed-entries.json directly.
4. Read [authoring interfaces](references/authoring-api.zh-CN.md) and [distribution](references/distribution.zh-CN.md) on demand. The candidate main-repository authority is `docs/功能/市场系统/API/应用开发发布接口.md`; an external PR does not establish a shipped client or official seed. `examples/static-workbench/` and `examples/service-workbench/` are editable teaching materials, not evidence of autonomous Agent development or production acceptance.
## L2: Development, Preview and Personal Publication
@@ -81,12 +81,12 @@ The Agent chooses the implementation, framework and working method. The platform
- Establish the user's actual work, data ownership and collaboration needs. Choose suitable languages and frameworks; examples do not prescribe a stack. Reuse the actual Task, Plan and originating context.
- Separate program material, business data and secrets. The portable `application.json` contains no sourceId, installation identity, host path, builtin route or credential. Its product identity, version and entrypoints are the single source for release and catalog views.
- Create fixed `app-release.json` from an explicit file whitelist, actual byte hashes, entrypoint mappings, data contract and truthful platform evidence. Exclude the manifest itself from files. `scripts/create-release.mjs` builds the example manifest; the service independently verifies actual bytes.
- Deliver `app-draft.json` with real fileRef, Plan, stable draftId and target installationId. Its source is the `draftSource` returned by `authoring_capabilities`, copied verbatim; never use a runId or make up a value. Without `draftSource` (an older client, or a result with `draftSourceUnavailable`), ask the user for the current conversation ID, or ask the user to continue in this Agent's default conversation, whose sessionId equals the agentId. Never infer it from a runId, topic title or another conversation. Its workdir points to the actual release material directory; do not guess a release/ subdirectory or fabricate a fileRef. Read the actual authorized file using `AppManage.read_draft` with `file_ref`, preserving the returned draft. When read_draft, preview_prepare or development_enroll rejects the source conversation, the error body carries this conversation's `draftSource`; correct the draft's source with it and retry. Return a clickable absolute path so the user can read and continue it in the application development workspace.
- Call `AppManage.preview_prepare` with the original draft/mode/expectedRevision in `owner_request`, including release for snapshot. Use preview_read to read and preview_end to end it. Snapshot preview and formal installation use separate identities and data. Freeze a snapshot before publishing a live preview. Replacement uses the actual revision. Ending preview revokes its bridge and disposes only its owned temporary runtime while preserving data and development material. Closing a page does not stop a formal application or accepted Task. Never convert a temporary URL/token into a formal entrypoint.
- Enroll a real authorized source development server using `AppManage.development_enroll` with the original prepareRef/draft/terminalId/endpoint in `owner_request` for live preview. Its development-only contract cannot become formal startup; mutable source and fixed releases remain separate. The original command must respect owner-injected PORT and APP_DATA_DIR, using shell `${VAR:-default}` only for initial defaults rather than overriding preview ports or formal data roots.
- Use `AppManage.prepare_release` with the complete `release_request` to freeze real material. Construct materialRoot as a FileResourceRef from the returned readable roots. Inspect the candidate, then call commit_release with the complete original AppReleaseCommitRequest in `release_request`, retaining prepareRef, installationId, expectedRevision and submissionId. Do not reduce its installation material to a name or digest. Continue authorized publication without repeated per-command questions; new targets or additional data/external effects follow existing governance.
- Saving a release and making it runnable are separate facts. Static files use fixed mappings; services use `AppManage.runtime_enroll` to bind original-owner spawn, generation and handshake. Use runtime_read/start/stop for formal operation; startupPolicy is not permanent execution authority. Docker releases declare complete registry/repository@sha256 imageRefs, then use `AppManage.docker_prepare` to receive owned CID/env paths and the actual command. Execute it through original TaskHost approval, then use docker_enroll with the original enrollmentRef/terminalId and verify daemon/CID/RepoDigest/mount/port facts. Normal create/start/stop repeats current approval; internal transient preview disposal compensates only its originally approved owned CID; candidate, formal and preview roots/nonces differ. Reconcile unknown outcomes against the original CID before another effect. Missing adapters or supported environments keep the original Agent-managed lifecycle with an honest reason. A CLI exit, format check, port, PID or historical observation does not prove availability.
- For timeout, lost response or disconnection, preserve the original mutation/submission/clientRequest ID and body. Query publication using `AppManage.lookup_release_submission` with the original installation_id/submission_id, and read actual runtime/preview state separately. Do not blindly replay unknown writes with a new ID. Check current material and data compatibility before an update. Investigate interrupted migrations; code rollback is not data recovery.
- Deliver `app-draft.json` with real fileRef, Plan, stable draftId and target installationId. Its source is the `draftSource` returned by `authoring_capabilities`, copied verbatim; never use a runId or make up a value. Without `draftSource` (an older client, or a result with `draftSourceUnavailable`), ask the user for the current conversation ID, or ask the user to continue in this Agent's default conversation, whose sessionId equals the agentId. Never infer it from a runId, topic title or another conversation. Its workdir points to the actual release material directory; do not guess a release/ subdirectory or fabricate a fileRef. Read the actual authorized file using `AppAuthoring.read_draft` with `file_ref`, preserving the returned draft. When read_draft, preview_prepare or development_enroll rejects the source conversation, the error body carries this conversation's `draftSource`; correct the draft's source with it and retry. Return a clickable absolute path so the user can read and continue it in the application development workspace.
- Call `AppAuthoring.preview_prepare` with the original draft/mode/expectedRevision in `owner_request`, including release for snapshot. Use preview_read to read and preview_end to end it. Snapshot preview and formal installation use separate identities and data. Freeze a snapshot before publishing a live preview. Replacement uses the actual revision. Ending preview revokes its bridge and disposes only its owned temporary runtime while preserving data and development material. Closing a page does not stop a formal application or accepted Task. Never convert a temporary URL/token into a formal entrypoint.
- Enroll a real authorized source development server using `AppAuthoring.development_enroll` with the original prepareRef/draft/terminalId/endpoint in `owner_request` for live preview. Its development-only contract cannot become formal startup; mutable source and fixed releases remain separate. The original command must respect owner-injected PORT and APP_DATA_DIR, using shell `${VAR:-default}` only for initial defaults rather than overriding preview ports or formal data roots.
- Use `AppAuthoring.prepare_release` with the complete `release_request` to freeze real material. Construct materialRoot as a FileResourceRef from the returned readable roots. Inspect the candidate, then call commit_release with the complete original AppReleaseCommitRequest in `release_request`, retaining prepareRef, installationId, expectedRevision and submissionId. Do not reduce its installation material to a name or digest. Continue authorized publication without repeated per-command questions; new targets or additional data/external effects follow existing governance.
- Saving a release and making it runnable are separate facts. Static files use fixed mappings; services use `AppAuthoring.runtime_enroll` to bind original-owner spawn, generation and handshake. Use runtime_read/start/stop for formal operation; startupPolicy is not permanent execution authority. Docker releases declare complete registry/repository@sha256 imageRefs, then use `AppAuthoring.docker_prepare` to receive owned CID/env paths and the actual command. Execute it through original TaskHost approval, then use docker_enroll with the original enrollmentRef/terminalId and verify daemon/CID/RepoDigest/mount/port facts. Normal create/start/stop repeats current approval; internal transient preview disposal compensates only its originally approved owned CID; candidate, formal and preview roots/nonces differ. Reconcile unknown outcomes against the original CID before another effect. Missing adapters or supported environments keep the original Agent-managed lifecycle with an honest reason. A CLI exit, format check, port, PID or historical observation does not prove availability.
- For timeout, lost response or disconnection, preserve the original mutation/submission/clientRequest ID and body. Query publication using `AppAuthoring.lookup_release_submission` with the original installation_id/submission_id, and read actual runtime/preview state separately. Do not blindly replay unknown writes with a new ID. Check current material and data compatibility before an update. Investigate interrupted migrations; code rollback is not data recovery.
## L3: Webpage and Agent Collaboration
@@ -101,8 +101,8 @@ The webpage uses the finite `window.desirecoreApp.call(method,payload)` and `onE
## L4: Distribution and Evidence
Personal publication is private and local by default. When the user requests distribution, call `AppManage.export_release` with the fixed complete whitelist in `owner_request`, and review the exact files and actual target. Exclude databases, .env, credentials, chats, Task/Plan, logs, machine paths and installation identity. Environment templates can describe names without real secret values.
Personal publication is private and local by default. When the user requests distribution, call `AppAuthoring.export_release` with the fixed complete whitelist in `owner_request`, and review the exact files and actual target. Exclude databases, .env, credentials, chats, Task/Plan, logs, machine paths and installation identity. Environment templates can describe names without real secret values.
To deliver ZIP bytes to an upload tool, also pass top-level `export_file_ref`, a destination FileResourceRef under the original tool's actual write authority, with exactly one of `expected_absent:true` or the original `expected_etag`. The returned `archiveFile` contains the actual fileRef/sha256/size/etag/replayed. Verify sha256 equals archiveDigest before handing the file to an already authorized GitHub/Gitea upload tool and inspecting immutable source/artifact results. For a lost response, preserve the same destination, condition and complete body; never overwrite an unknown file. Readable fileRoots do not grant write authority. Then call `AppManage.distribution_prepare` with `owner_request` containing the same exportRef, a registryTargetIds target, the actual immutable source and metadata to generate Registry manifest.json, catalog-metadata.v1.json and install.md. The draft is still neither uploaded nor submitted; report missing targets and upload channels separately. Ordinary HttpRequest does not automatically inject platform credentials; never extract instance tokens or change Origin to bypass 401. The target Provider injects catalog identity; the personal installation remains unchanged. Verify archiveDigest, releaseDigest and source-materialized descriptorDigest independently. A different payload under the same version requires a new revision, not overwriting fixed material.
To deliver ZIP bytes to an upload tool, also pass top-level `export_file_ref`, a destination FileResourceRef under the original tool's actual write authority, with exactly one of `expected_absent:true` or the original `expected_etag`. The returned `archiveFile` contains the actual fileRef/sha256/size/etag/replayed. Verify sha256 equals archiveDigest before handing the file to an already authorized GitHub/Gitea upload tool and inspecting immutable source/artifact results. For a lost response, preserve the same destination, condition and complete body; never overwrite an unknown file. Readable fileRoots do not grant write authority. Then call `AppAuthoring.distribution_prepare` with `owner_request` containing the same exportRef, a registryTargetIds target, the actual immutable source and metadata to generate Registry manifest.json, catalog-metadata.v1.json and install.md. The draft is still neither uploaded nor submitted; report missing targets and upload channels separately. Ordinary HttpRequest does not automatically inject platform credentials; never extract instance tokens or change Origin to bypass 401. The target Provider injects catalog identity; the personal installation remains unchanged. Verify archiveDigest, releaseDigest and source-materialized descriptorDigest independently. A different payload under the same version requires a new revision, not overwriting fixed material.
Report code/functional verification, preview, personal saving, runtime availability, upload, catalog PR/admission and second-user installation independently. A candidate 4.3 Schema, external PR or generated ZIP does not establish official-market availability, client capability release or another device's runtime acceptance. External hosting, databases and Git services require actual connections and applicable licensing/deployment terms and can carry separate costs; when unavailable, stop the affected external operation.
+10 -10
View File
@@ -7,8 +7,8 @@ Agent 选择技术栈、构建方法与工作方式;平台核验材料、作
## L1:先读能力与当前上下文
1. 读取或创建本任务唯一文件化 Plan,保存实际来源 Agent/会话、目标设备、工作目录及开发 Task。已有用户需求和授权直接沿用。
2. 使用原 `AppManage` 的 `authoring_capabilities` 动作。返回的 `capabilities` 必须为 `protocol: app-authoring-v1`,分别看 features 的 supported、authorized、available 和 reason;`fileRoots` 是当前 Agent 可读的真实文件根,`registryTargetIds` 是已登记的目录目标;这些只读事实不授予目录上传或文件写权限。`draftSource` 是本次会话的草稿来源 `{agentId,sessionId}`,原样写入 app-draft.json 的 source;返回 `draftSourceUnavailable`,或旧客户端没有这个字段时,当前会话 ID 拿不到,按 L2 处理。10.0.180 只是代码基线,已发行的同版本客户端不因此支持新协议。作者动作直接进入原领域 owner,不把平台凭据交给模型。
3. 普通自然语言开发不要求新的交接协议。若要登记、安装、更新或卸载,读取 `app-install-manager`;继续沿 ApplicationManagement-v2 解析和唯一 writer,不直接编辑 installed-entries.json。
2. 使用原 `AppAuthoring` 的 `authoring_capabilities` 动作。返回的 `capabilities` 必须为 `protocol: app-authoring-v1`,分别看 features 的 supported、authorized、available 和 reason;`fileRoots` 是当前 Agent 可读的真实文件根,`registryTargetIds` 是已登记的目录目标;这些只读事实不授予目录上传或文件写权限。`draftSource` 是本次会话的草稿来源 `{agentId,sessionId}`,原样写入 app-draft.json 的 source;返回 `draftSourceUnavailable`,或旧客户端没有这个字段时,当前会话 ID 拿不到,按 L2 处理。10.0.203 只是代码基线,已发行的同版本客户端不因此支持新协议。作者动作直接进入原领域 owner,不把平台凭据交给模型。
3. 安装开关、卸载、恢复与清理数据使用 `AppManage`,作者动作使用 `AppAuthoring`;旧 AppManage 作者动作的迁移提示不代表操作已执行。普通自然语言开发不要求新的交接协议。若要登记、安装、更新或卸载,读取 `app-install-manager`;继续沿 ApplicationManagement-v2 解析和唯一 writer,不直接编辑 installed-entries.json。
4. 按需读 [作者接口](references/authoring-api.zh-CN.md) 和 [分发指南](references/distribution.zh-CN.md)。候选主仓正文为 `docs/功能/市场系统/API/应用开发发布接口.md`,按实际能力读取;外仓 PR 不表示客户端或官方 seed 已发行。两份示例位于 `examples/static-workbench/` 与 `examples/service-workbench/`,只是可修改的教学材料,不能代替真实 Agent 开发和业务验收。
## L2:开发、预览和个人发布
@@ -16,12 +16,12 @@ Agent 选择技术栈、构建方法与工作方式;平台核验材料、作
- 先确认要解决的工作、数据位置与必要协作。可以使用任何适合的语言/框架,示例不固定技术栈。小任务直接完成;复杂工作保留原 Task、Plan 和用户来源,不另造开发状态机。
- 程序材料、业务数据与秘密分开。作者定义 `application.json` 不包含 sourceId、安装实例、宿主路径、builtin 路由或权限凭据。release 的产品 ID/名称/版本/入口只有这份定义。
- 固定 `app-release.json`:按显式文件白名单、原始字节摘要、入口映射、数据合同和真实平台证据生成;清单自身不进入 files。可用 `scripts/create-release.mjs` 为示例生成清单,平台仍重新核验实际字节。
- 向平台交付 `app-draft.json`,记录真实 fileRef、Plan、稳定 draftId 与目标 installationId。source 原样使用 `authoring_capabilities` 返回的 `draftSource`,不填 runId,也不自己编一个值。没有 `draftSource` 时(旧客户端,或返回 `draftSourceUnavailable`),请用户提供当前会话 ID,或请用户改在该 Agent 的默认会话里继续(默认会话的 sessionId 等于 agentId),不要从 runId、话题标题或别的会话推断。workdir 指向实际完成的 release 材料目录,不猜测 release/ 子目录,也不编造 fileRef。用 `AppManage.read_draft` 的 `file_ref` 读取授权根内实际文件,保留返回的 draft。read_draft、preview_prepare、development_enroll 因来源会话被拒时,错误正文会带回本次会话的 `draftSource`,按它改正草稿的 source 再重试。返回此文件的可点击绝对路径,说明可在应用开发工作区读取并继续。
- 预览沿 `AppManage.preview_prepare` 的 `owner_request` 传原 draft/mode/expectedRevision,snapshot 另给 release;读取用 preview_read,结束用 preview_end。snapshot 预览与正式安装隔离,数据不自动转移。live 预览必须先固定 snapshot 才可发布;刷新/替换用实际 revision。结束预览撤销当前桥并回收本次 owned 临时运行资源,保留数据与开发材料;普通关页不停止正式应用或已接纳的后台 Task,不将预览临时 URL/token 保存为正式入口。
- 原开发服务器/HMR 使用真实授权的 draft 工作目录,由 `AppManage.development_enroll` 的 `owner_request` 传原 prepareRef/draft/terminalId/endpoint 接入。它只用于 live 预览,不能成为正式 startup;可变源码与固定 release 分开。原命令须尊重 owner 注入的 PORT 和 APP_DATA_DIR,初次开发默认值用 shell 的 `${VAR:-default}`,不能写死赋值盖掉预览端口或正式数据根。
- 个人发布由 `AppManage.prepare_release` 的 `release_request` 固定真实材料:materialRoot 使用能力返回的授权根构造 FileResourceRef。检查候选后,`commit_release` 的 `release_request` 使用完整原 AppReleaseCommitRequest,保留精确 prepareRef、installationId、expectedRevision 与原 submissionId;不能把安装 material 对象简化为产品名称或摘要。旧会话里明确授权的发布可继续,不逐命令重复确认。新目标或超出授权的数据/外部副作用沿现有治理处理。
- 发布保存与运行可用分开。静态包通过固定映射承载;带服务应用用 `AppManage.runtime_enroll` 固定原执行 owner 的真实 spawn、代际身份和握手;正式运行用 runtime_read/start/stop,不能把 startupPolicy 当长期执行授权。Docker release 声明完整 imageRefs(注册表/repository@sha256),先用 `AppManage.docker_prepare` 获得私有短期 CID/env 文件及实际命令,沿原审批执行后以 docker_enroll 的原 enrollmentRef/terminalId 核验真实 daemon/CID/RepoDigest/挂载/端口。普通用户启动/停止沿当前审批,私有临时预览回收只补偿原批准的 owned CID;候选、正式和预览的数据根与 nonce 分开。unknown 先检查原 CID,不重复创建;缺 adapter 或支持的环境时保留原 Agent 管理并明确原因。端口响应、Docker CLI 退出、PID、历史 observation 或格式检查不能替代运行绑定;失败如实说明“版本已保存,启动待修复”。
- 写入超时、响应丢失或断线,保留原 mutation/submission/clientRequest ID 与正文;发布用 `AppManage.lookup_release_submission` 的原 installation_id/submission_id 查询,运行和预览分别重读实际状态。unknown 时不创建新 ID 盲重放。修改候选前重读当前版本与数据兼容,迁移中断先观察;代码回退不代表业务数据恢复。
- 向平台交付 `app-draft.json`,记录真实 fileRef、Plan、稳定 draftId 与目标 installationId。source 原样使用 `authoring_capabilities` 返回的 `draftSource`,不填 runId,也不自己编一个值。没有 `draftSource` 时(旧客户端,或返回 `draftSourceUnavailable`),请用户提供当前会话 ID,或请用户改在该 Agent 的默认会话里继续(默认会话的 sessionId 等于 agentId),不要从 runId、话题标题或别的会话推断。workdir 指向实际完成的 release 材料目录,不猜测 release/ 子目录,也不编造 fileRef。用 `AppAuthoring.read_draft` 的 `file_ref` 读取授权根内实际文件,保留返回的 draft。read_draft、preview_prepare、development_enroll 因来源会话被拒时,错误正文会带回本次会话的 `draftSource`,按它改正草稿的 source 再重试。返回此文件的可点击绝对路径,说明可在应用开发工作区读取并继续。
- 预览沿 `AppAuthoring.preview_prepare` 的 `owner_request` 传原 draft/mode/expectedRevision,snapshot 另给 release;读取用 preview_read,结束用 preview_end。snapshot 预览与正式安装隔离,数据不自动转移。live 预览必须先固定 snapshot 才可发布;刷新/替换用实际 revision。结束预览撤销当前桥并回收本次 owned 临时运行资源,保留数据与开发材料;普通关页不停止正式应用或已接纳的后台 Task,不将预览临时 URL/token 保存为正式入口。
- 原开发服务器/HMR 使用真实授权的 draft 工作目录,由 `AppAuthoring.development_enroll` 的 `owner_request` 传原 prepareRef/draft/terminalId/endpoint 接入。它只用于 live 预览,不能成为正式 startup;可变源码与固定 release 分开。原命令须尊重 owner 注入的 PORT 和 APP_DATA_DIR,初次开发默认值用 shell 的 `${VAR:-default}`,不能写死赋值盖掉预览端口或正式数据根。
- 个人发布由 `AppAuthoring.prepare_release` 的 `release_request` 固定真实材料:materialRoot 使用能力返回的授权根构造 FileResourceRef。检查候选后,`commit_release` 的 `release_request` 使用完整原 AppReleaseCommitRequest,保留精确 prepareRef、installationId、expectedRevision 与原 submissionId;不能把安装 material 对象简化为产品名称或摘要。旧会话里明确授权的发布可继续,不逐命令重复确认。新目标或超出授权的数据/外部副作用沿现有治理处理。
- 发布保存与运行可用分开。静态包通过固定映射承载;带服务应用用 `AppAuthoring.runtime_enroll` 固定原执行 owner 的真实 spawn、代际身份和握手;正式运行用 runtime_read/start/stop,不能把 startupPolicy 当长期执行授权。Docker release 声明完整 imageRefs(注册表/repository@sha256),先用 `AppAuthoring.docker_prepare` 获得私有短期 CID/env 文件及实际命令,沿原审批执行后以 docker_enroll 的原 enrollmentRef/terminalId 核验真实 daemon/CID/RepoDigest/挂载/端口。普通用户启动/停止沿当前审批,私有临时预览回收只补偿原批准的 owned CID;候选、正式和预览的数据根与 nonce 分开。unknown 先检查原 CID,不重复创建;缺 adapter 或支持的环境时保留原 Agent 管理并明确原因。端口响应、Docker CLI 退出、PID、历史 observation 或格式检查不能替代运行绑定;失败如实说明“版本已保存,启动待修复”。
- 写入超时、响应丢失或断线,保留原 mutation/submission/clientRequest ID 与正文;发布用 `AppAuthoring.lookup_release_submission` 的原 installation_id/submission_id 查询,运行和预览分别重读实际状态。unknown 时不创建新 ID 盲重放。修改候选前重读当前版本与数据兼容,迁移中断先观察;代码回退不代表业务数据恢复。
## L3:网页与 Agent 协作
@@ -36,8 +36,8 @@ Agent 选择技术栈、构建方法与工作方式;平台核验材料、作
## L4:分发与交付证据
个人发布默认私有本机,不隐含上传。用户要求分发后,用 `AppManage.export_release` 的 `owner_request` 导出固定版本的完整白名单,审阅确切文件与目标。业务库、.env、凭据、聊天/Task/Plan、日志、机器路径和安装身份不得进入包;环境模板可以包含名称和说明,不能包含真实值。
个人发布默认私有本机,不隐含上传。用户要求分发后,用 `AppAuthoring.export_release` 的 `owner_request` 导出固定版本的完整白名单,审阅确切文件与目标。业务库、.env、凭据、聊天/Task/Plan、日志、机器路径和安装身份不得进入包;环境模板可以包含名称和说明,不能包含真实值。
需要交给上传工具的 ZIP 时,export_release 另在顶层提供 `export_file_ref`(原工具真实写权限目录中的目标 FileResourceRef),并二选一给 `expected_absent:true` 或原 `expected_etag`。返回的 `archiveFile` 包含实际 fileRef/sha256/size/etag/replayed;核验 sha256 等于 archiveDigest,再交已授权的 GitHub/Gitea 上传工具并核读不可变提交/制品 SHA。响应丢失保留同一目标、条件与完整正文查询/重试,不覆盖未知文件;只有只读 fileRoots 不代表有写权限。随后用 `AppManage.distribution_prepare` 的 `owner_request`,以同一 exportRef、能力返回的 registryTargetIds 中的目标、实际固定来源和 metadata 生成 Registry `manifest.json`、`catalog-metadata.v1.json`、`install.md`。草稿仍未上传、未提交目录;缺少真实目标或上传通道时分别说明不可用。普通 HttpRequest 不自动注入平台凭据,不能读取实例 token 或变更 Origin 绕过 401。目录身份由目标 Provider 注入,个人安装仍是原实例。archiveDigest、releaseDigest、物化 descriptorDigest 分别核验;同版本异内容创建新修订,不覆盖旧固定材料。
需要交给上传工具的 ZIP 时,export_release 另在顶层提供 `export_file_ref`(原工具真实写权限目录中的目标 FileResourceRef),并二选一给 `expected_absent:true` 或原 `expected_etag`。返回的 `archiveFile` 包含实际 fileRef/sha256/size/etag/replayed;核验 sha256 等于 archiveDigest,再交已授权的 GitHub/Gitea 上传工具并核读不可变提交/制品 SHA。响应丢失保留同一目标、条件与完整正文查询/重试,不覆盖未知文件;只有只读 fileRoots 不代表有写权限。随后用 `AppAuthoring.distribution_prepare` 的 `owner_request`,以同一 exportRef、能力返回的 registryTargetIds 中的目标、实际固定来源和 metadata 生成 Registry `manifest.json`、`catalog-metadata.v1.json`、`install.md`。草稿仍未上传、未提交目录;缺少真实目标或上传通道时分别说明不可用。普通 HttpRequest 不自动注入平台凭据,不能读取实例 token 或变更 Origin 绕过 401。目录身份由目标 Provider 注入,个人安装仍是原实例。archiveDigest、releaseDigest、物化 descriptorDigest 分别核验;同版本异内容创建新修订,不覆盖旧固定材料。
按真实情况分别报告:代码/业务验证、预览、个人发布、启动、来源上传、目录 PR/准入、第二用户安装。候选 4.3 Schema、外仓 PR 或 ZIP 生成都不代表官方市场已开放,也不能代替客户端能力发行或另一设备运行。外部托管/数据库/Git服务的登录、许可、部署及费用由其真实连接和条款决定,缺少时停止相应外部调用。
@@ -29,13 +29,13 @@
},
"release": {
"state": "known",
"version": "1.0.1",
"version": "1.0.2",
"versionScheme": "semver"
},
"timestamps": {
"catalogUpdatedAt": {
"state": "known",
"value": "2026-10-28",
"value": "2026-11-09",
"precision": "day"
},
"releasePublishedAt": {
@@ -67,7 +67,7 @@
"platforms": {
"state": "unknown"
},
"requiredClientVersion": "10.0.180"
"requiredClientVersion": "10.0.203"
},
"spec": {
"kind": "skill",
@@ -4,12 +4,12 @@
在获授权的材料目录生成 release 并 prepare 后,使用原执行工具实际启动 `PORT="${PORT:-32000}" node runtime/server.mjs`,初次默认值须替换为实际空闲端口。保留该默认表达式,不能用写死的 PORT 赋值覆盖 Harness 后续注入的预览端口。端口需固定在原接受的执行合同,不能靠网页声明任意 endpoint。身份由原 TaskHost 在受控正式 spawn 时注入:DESIRECORE_APP_RUNTIME_PROOF、DESIRECORE_APP_RELEASE_DIGEST、DESIRECORE_APP_SCOPE_ID、DESIRECORE_APP_RUNTIME_GENERATION。应用不能自报固定 PID 或伪造 proof,不能将 proof 用于其他 API 或日志。
通过原 `AppManage.runtime_enroll` 的 `owner_request` 给真实 prepareRef、installationId、terminalId、endpoint.port 与 identityPath `/.desirecore-app-identity`,以及用户选择的 manual/on-open。普通 HttpRequest 不自动注入平台凭据,不能读取实例 token 或改 Origin 绕过认证。纳管读取原accepted-command冻结执行合同;由原执行工具明确停掉此前命令,commit后由原owner启动正式新代际,再核读运行身份和应用功能。原先裸启动的服务在没有managed身份时会明确返回503,它只能帮助开发调试,不能证明正式可信直开。
通过原 `AppAuthoring.runtime_enroll` 的 `owner_request` 给真实 prepareRef、installationId、terminalId、endpoint.port 与 identityPath `/.desirecore-app-identity`,以及用户选择的 manual/on-open。普通 HttpRequest 不自动注入平台凭据,不能读取实例 token 或改 Origin 绕过认证。纳管读取原accepted-command冻结执行合同;由原执行工具明确停掉此前命令,commit后由原owner启动正式新代际,再核读运行身份和应用功能。原先裸启动的服务在没有managed身份时会明确返回503,它只能帮助开发调试,不能证明正式可信直开。
公开执行环境不接受任意.env。若改造应用需要后端直接读写数据,须使用实际数据owner授予并注入的独立根;缺授权时不写盘,不默认使用cwd或release目录。此教学服务没有后端数据写入,因此不需要APP_DATA_DIR,不持有平台凭据。
停止、更新、失败恢复沿原TaskHost/Run,不重复开第二个后台进程。scope/release/generation改变后旧连接失效;重启须重新取得owner身份与审批事实。端口被占用不接管,不把HTTP200作为运行归属证明。
开发时若需要直接看授权源码的修改,可用当前真实 draft、原 source 目录启动的 terminalId 和已固定 prepareRef 通过 `AppManage.development_enroll` 的 `owner_request` 登记原 prepareRef/draft/terminalId/endpoint。它只承接 live 预览,正式发布须另固定 snapshot 并登记正式运行合同;普通读取静态源码的变化不等于框架 dev-server/HMR 协议已经验收。
开发时若需要直接看授权源码的修改,可用当前真实 draft、原 source 目录启动的 terminalId 和已固定 prepareRef 通过 `AppAuthoring.development_enroll` 的 `owner_request` 登记原 prepareRef/draft/terminalId/endpoint。它只承接 live 预览,正式发布须另固定 snapshot 并登记正式运行合同;普通读取静态源码的变化不等于框架 dev-server/HMR 协议已经验收。
要将此服务改为 Docker release,须由作者实际选择并验证固定 Node 镜像 RepoDigest、声明全部 imageRefs,容器服务监听 `0.0.0.0` 而宿主只发布 `127.0.0.1`,并沿 AppManage.docker_prepare/docker_enroll 的实际 argv、nonce、CID 和 data mount 核验。当前文件是 native Node 教学样例,不能只改 delivery 类型就声称容器运行通过;镜像及 Docker 许可、安装与运维属于其实际外部 owner。
要将此服务改为 Docker release,须由作者实际选择并验证固定 Node 镜像 RepoDigest、声明全部 imageRefs,容器服务监听 `0.0.0.0` 而宿主只发布 `127.0.0.1`,并沿 AppAuthoring.docker_prepare/docker_enroll 的实际 argv、nonce、CID 和 data mount 核验。当前文件是 native Node 教学样例,不能只改 delivery 类型就声称容器运行通过;镜像及 Docker 许可、安装与运维属于其实际外部 owner。
@@ -1,6 +1,6 @@
# 服务笔记工作台教学示例
这是可修改的固定网页+原生Node只读服务,不是正式市场条目。先读本Skill作者接口和runtime/运行说明.md,在真实目标环境按目标组合原 AppManage.prepare_release/runtime_enroll/commit_release 动作,纳管原执行合同、正式发布并核验。缺TaskHost owner或真实身份时保持不可用,不能重标为静态网页来绕过。
这是可修改的固定网页+原生Node只读服务,不是正式市场条目。先读本Skill作者接口和runtime/运行说明.md,在真实目标环境按目标组合原 AppAuthoring.prepare_release/runtime_enroll/commit_release 动作,纳管原执行合同、正式发布并核验。缺TaskHost owner或真实身份时保持不可用,不能重标为静态网页来绕过。
笔记仍通过应用桥的notes key持久化,用户、实例和预览各有独立scope;Node端不写个人数据或固定程序目录。网页可在本源 `/api/summary?count=<当前笔记条数>` 请求只读统计;这个能力不使用平台token,也不接收任意文件路径或SQL。
@@ -10,4 +10,4 @@
用户可显式选择“在这台设备记住所选位置”。示例 viewStateContract 只允许 selection 键并限制 1024 字节,不保存笔记正文;需实际 saveViewState grant,设备保存保持原 mutationId、expectedRevision 和正文。能力缺失时保持业务数据与视图偏好分别报告,预览不借正式设备状态。
用户要求分发时,用原 AppManage.export_release 的 owner_request 显式导出全部 payload 与 app-release.json;另给原工具真实写权限内的 export_file_ref,首次 expected_absent:true,已有目标用原 expected_etag。返回 archiveFile 的实际 fileRef/sha256/size/etag,核验 sha256/size 与 export 的 archiveDigest/size 一致后交原授权上传工具。取得真实固定来源再用 distribution_prepare 的 owner_request,registryRepoId 从 authoring_capabilities.registryTargetIds 选本次实际目标,生成三文件草稿;它不上传、不提交目录,也不改变个人安装身份。普通 HTTP 不自动注入平台凭据,不能读取实例 token 或绕过认证。
用户要求分发时,用原 AppAuthoring.export_release 的 owner_request 显式导出全部 payload 与 app-release.json;另给原工具真实写权限内的 export_file_ref,首次 expected_absent:true,已有目标用原 expected_etag。返回 archiveFile 的实际 fileRef/sha256/size/etag,核验 sha256/size 与 export 的 archiveDigest/size 一致后交原授权上传工具。取得真实固定来源再用 distribution_prepare 的 owner_request,registryRepoId 从 authoring_capabilities.registryTargetIds 选本次实际目标,生成三文件草稿;它不上传、不提交目录,也不改变个人安装身份。普通 HTTP 不自动注入平台凭据,不能读取实例 token 或绕过认证。
@@ -1,6 +1,6 @@
# 个人笔记工作台教学示例
这是可修改的最小材料,不是正式市场条目或已经完成的真实 Agent 验收。将示例复制到任务实际授权工作目录,用本 Skill 的 create-release.mjs 生成 app-release.json,再按目标组合原 AppManage.prepare_release/preview_prepare/commit_release 动作,准备固定材料、snapshot 预览与个人发布。
这是可修改的最小材料,不是正式市场条目或已经完成的真实 Agent 验收。将示例复制到任务实际授权工作目录,用本 Skill 的 create-release.mjs 生成 app-release.json,再按目标组合原 AppAuthoring.prepare_release/preview_prepare/commit_release 动作,准备固定材料、snapshot 预览与个人发布。
笔记保存在声明的 notes key,由平台按用户/实例/预览分配专用数据根。预览数据不自动成为正式数据;包中没有 notes.json。裸浏览器打开可看到页面,缺少可信桥时不会假装已持久保存。Web 须有独立 app origin 和真实 parent MessagePort;同源或无来源时桥拒绝。
@@ -14,4 +14,4 @@
用户可显式选择“在这台设备记住所选位置”。示例 viewStateContract 只允许 selection 键并限制 1024 字节,不保存笔记正文;需实际 saveViewState grant,设备保存保持原 mutationId、expectedRevision 和正文。能力缺失时保持业务数据与视图偏好分别报告,预览不借正式设备状态。
用户要求分发时,用原 AppManage.export_release 的 owner_request 显式导出全部 payload 与 app-release.json;另给原工具真实写权限内的 export_file_ref,首次 expected_absent:true,已有目标用原 expected_etag。返回 archiveFile 的实际 fileRef/sha256/size/etag,核验 sha256/size 与 export 的 archiveDigest/size 一致后交原授权上传工具。取得真实固定来源再用 distribution_prepare 的 owner_request,registryRepoId 从 authoring_capabilities.registryTargetIds 选本次实际目标,生成三文件草稿;它不上传、不提交目录,也不改变个人安装身份。普通 HTTP 不自动注入平台凭据,不能读取实例 token 或绕过认证。
用户要求分发时,用原 AppAuthoring.export_release 的 owner_request 显式导出全部 payload 与 app-release.json;另给原工具真实写权限内的 export_file_ref,首次 expected_absent:true,已有目标用原 expected_etag。返回 archiveFile 的实际 fileRef/sha256/size/etag,核验 sha256/size 与 export 的 archiveDigest/size 一致后交原授权上传工具。取得真实固定来源再用 distribution_prepare 的 owner_request,registryRepoId 从 authoring_capabilities.registryTargetIds 选本次实际目标,生成三文件草稿;它不上传、不提交目录,也不改变个人安装身份。普通 HTTP 不自动注入平台凭据,不能读取实例 token 或绕过认证。
@@ -2,9 +2,9 @@
本文是未发行候选协议的知识材料。中文权威接口正文位于主仓 `docs/功能/市场系统/API/应用开发发布接口.md`;该路径与外仓 PR 不声明在线文档、客户端或官方 seed 已更新。每次先读取实际 capability 结果和当前 Schema。
Agent 使用原 `AppManage` 的有限作者动作,直接进入已有 release、preview、runtime 或 Docker owner。原 ToolExecutor 调用源、真实 Run/用户/Agent/宿主、材料读取根、当前策略与审批在效果边界重新核验。参数不自报 owner,也不获得平台管理凭据。以下动作可按目标组合,表格不是固定开发步骤。
Agent 使用原 `AppAuthoring` 的有限作者动作,直接进入已有 release、preview、runtime 或 Docker owner。原 ToolExecutor 调用源、真实 Run/用户/Agent/宿主、材料读取根、当前策略与审批在效果边界重新核验。参数不自报 owner,也不获得平台管理凭据。以下动作可按目标组合,表格不是固定开发步骤。
| AppManage action | 参数包络 | 返回事实 |
| AppAuthoring action | 参数包络 | 返回事实 |
|---|---|---|
| `authoring_capabilities` | 无额外参数 | `capabilities` 的实际 features/policy/hostInstanceId 和当前 Agent 可读的 `fileRoots` 与已登记的 `registryTargetIds`;本次会话可用作草稿来源时给 `draftSource:{agentId,sessionId}`,否则给 `draftSourceUnavailable`(旧客户端两者都没有);不授上传或文件写权限 |
| `read_draft` | `file_ref: FileResourceRef` | 从真实授权文件读取并核验的 `draft: AppDraftRef` |
@@ -26,7 +26,7 @@ Agent 使用原 `AppManage` 的有限作者动作,直接进入已有 release
| `export_release` | `owner_request: AppReleaseExportRequest`;可另给顶层 `export_file_ref` 与 `expected_absent:true` 或 `expected_etag` | exportRef、archiveDigest、releaseDigest、实际 files/size;显式导出时 archiveFile 包含真实 ZIP fileRef/sha256/size/etag/replayed,不上传 |
| `distribution_prepare` | `owner_request: AppDistributionPrepareRequest`(exportRef、registryRepoId、source、metadata) | 从真实 export 与 capability 中的目录目标生成三文件草稿,未上传/未提交 |
例如能力调用为 `AppManage({action:'authoring_capabilities'})`。读草稿使用 `action:'read_draft'` 与返回的授权根对应的 `file_ref`;发布准备/提交分别使用 `release_request`,预览/运行纳管/导出使用 `owner_request`。这些包络不是互换字段,原工具及内部 owner 仍逐个严格核验完整 DTO。
例如能力调用为 `AppAuthoring({action:'authoring_capabilities'})`。读草稿使用 `action:'read_draft'` 与返回的授权根对应的 `file_ref`;发布准备/提交分别使用 `release_request`,预览/运行纳管/导出使用 `owner_request`。这些包络不是互换字段,原工具及内部 owner 仍逐个严格核验完整 DTO。
`prepare_release` 的 AppReleasePrepareRequest 包含 `mutationId`、已授权 `materialRoot: FileResourceRef`、`manifestPath`、可选 expectedReleaseDigest、`target:{appId,installationId,deviceId,sourceId}`。FileResourceRef 的 schemaVersion/instanceId/agentId/rootId/path 来自真实 fileRoots 与本次材料;path 是授权根内相对路径,不能复制别的宿主/Agent/root。首次个人 sourceId 为服务约定的 `user-managed`,不能用名字冒充目录身份。
@@ -42,7 +42,7 @@ web-bundle.delivery.entrypoints 固定 `{entrypointId,path,spaFallback?}`;nati
数据合同声明 formatVersion、readableVersions、writableVersions、有限 files key/path/maxBytes/contentType 和 uninstallRetention: retain。备份/迁移/恢复说明引用必须在 payload 白名单中;说明不授权自动执行,安装历史不代表真实数据备份。
动态 Node 示例的 `/.desirecore-app-identity` 返回当前 TaskHost 注入的 proof/releaseDigest/scopeId/runtimeGeneration;proof 仅用于本次运行身份握手,不当应用 API token,不写日志。`AppManage.runtime_enroll` 使用已 prepare 的材料、installationId、真实 terminalId、endpoint.port/identityPath 与 startupPolicy。服务固定原执行合同后,原 Bash 显式停原命令,正式 commit 后由原 owner 启动新代际再核验。具体环境、执行审批和数据根均由实际 owner 决定。
动态 Node 示例的 `/.desirecore-app-identity` 返回当前 TaskHost 注入的 proof/releaseDigest/scopeId/runtimeGeneration;proof 仅用于本次运行身份握手,不当应用 API token,不写日志。`AppAuthoring.runtime_enroll` 使用已 prepare 的材料、installationId、真实 terminalId、endpoint.port/identityPath 与 startupPolicy。服务固定原执行合同后,原 Bash 显式停原命令,正式 commit 后由原 owner 启动新代际再核验。具体环境、执行审批和数据根均由实际 owner 决定。
原执行命令的初始默认端口写成 `PORT="${PORT:-32000}" node runtime/server.mjs`,其中默认端口需实际可用。重启仍执行原真实 argv,Harness 注入的 preview PORT 不能被写死赋值盖掉。若应用后端需要数据,APP_DATA_DIR 也用已授权 seed 根作为初次默认,后续严格使用 owner 注入的独立根;不可将 seed/candidate 数据自动迁入正式实例。
@@ -50,7 +50,7 @@ Docker prepare 的 owner_request 为 `{prepareRef,installationId,endpoint:{port,
## 平台 HTTP 管理消费者
HTTP 接口保留给平台 UI 或具有合法管理凭据的消费者,普通 HttpRequest 不自动注入实例凭据。Agent 缺少对应原工具能力时说明不可用,不读取实例 token、不改 Origin 绕过 401,也不把凭据交网页。HTTP 返回包络与原 AppManage 结果各按实际合同读取。
HTTP 接口保留给平台 UI 或具有合法管理凭据的消费者,普通 HttpRequest 不自动注入实例凭据。Agent 缺少对应原工具能力时说明不可用,不读取实例 token、不改 Origin 绕过 401,也不把凭据交网页。HTTP 返回包络与原 AppAuthoring 结果各按实际合同读取。
| 平台接口 | 用途 |
|---|---|
@@ -65,7 +65,7 @@ HTTP 接口保留给平台 UI 或具有合法管理凭据的消费者,普通 H
downloadPath 仍是平台管理下载路径,不授予网页或普通 HTTP 工具访问。Agent 需要实际 ZIP 时,在 export_release 顶层另给 export_file_ref:使用当前 Agent 原写权限内的 FileResourceRef 目标,path 为该根内相对路径;不能把服务 exports 私有目录挂成工作根。首次给 expected_absent:true,覆盖已有文件给原 expected_etag,两者不能同时提供。返回 archiveFile={fileRef,sha256,size,etag,replayed},sha256/size 必须等于 export 的 archiveDigest/size;这才是可交原授权上传工具的实际文件。只读 fileRoots 不授写权限。响应丢失保持相同目标/条件/完整正文,已有同一固定字节可重放,其他内容必须按实际 ETag 决定,不能盲覆盖。
目录草稿用原 AppManage.distribution_prepare,完整 AppDistributionPrepareRequest 放在 owner_request;registryRepoId 从 authoring_capabilities.registryTargetIds 选本次真实目标,不自报 sourceId 或构造连接。source 指向用户已实际上传并核验的不可变来源,sha256 等于 archiveDigest。返回 draft 三文件及 mapping/facts;upload 仍为 unverified,catalog 仍为 not-submitted,sourceAcl 仍为 source-admin-managed。写入目录仓库、提交 PR、目录准入和第二用户获取各由原工具取得实际回执;没有目标或来源连接时说明不可用。
目录草稿用原 AppAuthoring.distribution_prepare,完整 AppDistributionPrepareRequest 放在 owner_request;registryRepoId 从 authoring_capabilities.registryTargetIds 选本次真实目标,不自报 sourceId 或构造连接。source 指向用户已实际上传并核验的不可变来源,sha256 等于 archiveDigest。返回 draft 三文件及 mapping/facts;upload 仍为 unverified,catalog 仍为 not-submitted,sourceAcl 仍为 source-admin-managed。写入目录仓库、提交 PR、目录准入和第二用户获取各由原工具取得实际回执;没有目标或来源连接时说明不可用。
## 网页协作合同
@@ -1,14 +1,14 @@
# 固定应用版本分发
1. 确认用户要分发的精确版本、真实目标仓库/Registry、公共或私有范围、实际登录连接和材料许可。生成文件、个人发布或已有预览都不是上传授权;既有会话中的明确分发授权直接沿用。
2. 用原 AppManage 的 export_release 动作,从 prepareRef,或 installationId + expectedRevision 导出;完整 AppReleaseExportRequest 放在 owner_request。`paths` 必须显式覆盖全部 payload + app-release.json;不包含服务物化 descriptor、owner 标记、个人数据和秘密。需要实际 ZIP 时,另在顶层给 export_file_ref(当前 Agent 原写权限目录的目标 FileResourceRef)与 expected_absent:true 或原 expected_etag;不能同时给两个条件或覆盖未知文件。核验响应的 files/size 和 archiveFile 的实际 fileRef/sha256/size/etag/replayed,sha256/size 必须等于 export 的 archiveDigest/size。读能力返回的 fileRoots 不授写权限;响应丢失保持同一目标、条件与完整正文恢复。downloadPath 是平台管理消费者路径,普通 HttpRequest 不自动注入凭据。
2. 用原 AppAuthoring 的 export_release 动作,从 prepareRef,或 installationId + expectedRevision 导出;完整 AppReleaseExportRequest 放在 owner_request。`paths` 必须显式覆盖全部 payload + app-release.json;不包含服务物化 descriptor、owner 标记、个人数据和秘密。需要实际 ZIP 时,另在顶层给 export_file_ref(当前 Agent 原写权限目录的目标 FileResourceRef)与 expected_absent:true 或原 expected_etag;不能同时给两个条件或覆盖未知文件。核验响应的 files/size 和 archiveFile 的实际 fileRef/sha256/size/etag/replayed,sha256/size 必须等于 export 的 archiveDigest/size。读能力返回的 fileRoots 不授写权限;响应丢失保持同一目标、条件与完整正文恢复。downloadPath 是平台管理消费者路径,普通 HttpRequest 不自动注入凭据。
3. 将真实 archiveFile.fileRef 交原实际授权上传工具;GitHub Release 上传此 ZIP 后,核读真实下载地址、固定 commit 和原始字节摘要;Gitea 私有仓库可提交 `releases/<version>.zip`,取得完整 commit 与该路径。可变 tag/latest 只作展示,必须解析到固定引用。没有真实来源回执就报告“制品已生成,尚未上传”。
4. 使用原 AppManage 的 distribution_prepare 动作,owner_request 为 AppDistributionPrepareRequest:`exportRef`、从 authoring_capabilities.registryTargetIds 选择的真实 registryRepoId、`source:{kind:'release'|'git',url,ref,sha256,path?}` 和实际 metadata。目录目标列表是配置事实,不授予源端上传权限;普通模型不读取实例 token 或改 Origin 绕过认证。git 必须给固定包路径,sha256 必须等于导出 archiveDigest。产品 ID/名称/版本/入口不由 metadata 另填。
4. 使用原 AppAuthoring 的 distribution_prepare 动作,owner_request 为 AppDistributionPrepareRequest:`exportRef`、从 authoring_capabilities.registryTargetIds 选择的真实 registryRepoId、`source:{kind:'release'|'git',url,ref,sha256,path?}` 和实际 metadata。目录目标列表是配置事实,不授予源端上传权限;普通模型不读取实例 token 或改 Origin 绕过认证。git 必须给固定包路径,sha256 必须等于导出 archiveDigest。产品 ID/名称/版本/入口不由 metadata 另填。
5. metadata 包含 author/description/tags/category/license/redistribution/availability/requiredClientVersion,以及实际维护者、品牌和复核材料。证据不足保留 listing-only;不要填不存在的审核者、认证、发布时间或平台验收。已复核的许可证路径应来自同一 release 的 license role 文件。
6. 返回的是 `entries/<id>/manifest.json`、`catalog-metadata.v1.json`、`install.md` 内容和摘要。mapping 关联目标 sourceId、逻辑 ID、releaseDigest 与 archiveDigest,descriptor 安装时按真实来源物化。将三文件写入实际授权的目录仓库后审阅 diff,通过其原治理提交 PR;不能自动合并或说目录已开放。
7. 查询真实目录可获取状态与目标客户端握手,再由第二用户/设备沿原 acquisition/app-install-manager 路径安装并核验。两来源同名不共享实例或数据;目录更新仅给更新候选,不改原安装快照。
候选 Registry 4.3 Schema 与客户端 reader 必须先分别 review;正式 Registry seed 只指已合入的受审提交。候选 reader 仅在明确受信的非官方测试来源开放,正式条目等待客户端能力发行,不能借 10.0.180 字符串跳过 app-authoring-v1。
候选 Registry 4.3 Schema 与客户端 reader 必须先分别 review;正式 Registry seed 只指已合入的受审提交。候选 reader 仅在明确受信的非官方测试来源开放,正式条目等待客户端能力发行,不能借 10.0.203 字符串跳过 app-authoring-v1。
私有源使用 `access: private` 的真实 Registry 连接,只读登记端点、不转公开镜像;认证失败拒绝新获取。字段不是 ACL,GitHub/Gitea 管理员仍负责实际成员权限。平台团队成员移除不自动改变源端 ACL,不能宣称已撤销。已下载字节不能收回,本机数据不自动删除。