@alipay/alipay-aipay 1.6.4 → 1.6.5-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/alipay-aipay",
3
- "version": "1.6.4",
3
+ "version": "1.6.5-beta",
4
4
  "description": "支付宝 AI 付 Skill 安装包 - 优先安装 Agent Skill,并在 macOS/Linux 后台准备用户级 CLI 工具",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.4
1
+ 1.6.5-beta
@@ -1 +1 @@
1
- {"schemaVersion":1,"interactionPrompts":{"confirmInputHint":"如确认,可以回复“继续”“确认”“OK”,也可以输入 1;如需调整,请直接说明。","planAdjustmentHint":"我会继续执行,无需回复;如需调整方案,请中断 Agent 执行并说明。","authorizationCompletionInputHint":"授权完成后可回复“继续”“好了”“OK”或输入 1","publicKeyConfirmationCompletionInputHint":"支付宝扫码确认应用公钥完成后可回复“继续”“好了”“OK”或输入 1","completionInputHint":"完成后可回复“继续”“好了”“已完成”“OK”或输入 1;如需调整,请直接说明。","scanReturnHint":"扫码完成后请回到 Agent 对话页面"},"interactionReplySets":{"affirmative":["1","继续","继续推进","继续执行","继续处理","继续下一步","请继续","请继续推进","继续吧","确认","确认继续","确定","同意","可以","可以继续","可以继续推进","没问题","好","好的","好了","好的继续","已完成","完成","完成了","操作完成","操作好了","已经完成","已经好了","处理好了","确认好了","弄好了","OK","Okay","Yes","Y"]},"messages":[{"messageId":"product.unsupported","owner":"catalog_owned","trigger":"route.unsupported_product","blocking":false,"allowedReplies":[],"variables":[{"name":"productName","type":"singleLine","required":true}],"requiredPolicyIds":["P-MCP-CONTRACT-FROZEN"],"variants":{"DEFAULT":{"templateLines":["当前 Skill 只支持接入 AI 按量付费、AI 网页应用收款和 AI 移动应用收款,不支持 `{{productName}}`。","","- 查看支付宝其他收单产品请前往:[支付宝开放平台](https://open.alipay.com)","- 开通支付宝其他收单产品请前往:[支付宝商家平台](https://b.alipay.com/page/portal/home)"]}}},{"messageId":"onboarding.enterprise.unsupported","owner":"catalog_owned","trigger":"onboarding.enterprise_account","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"ONBOARDING_ONLY":{"templateLines":["暂不支持企业账号通过 Skill 完成产品开通。","","请前往支付宝商家平台开通:https://b.alipay.com/page/portal/home","","如需继续进行代码开发,试试对 Agent 说:为我集成 AI 网页应用收款/AI 移动应用收款/AI 按量付费"]},"FULL_PROCESS":{"templateLines":["暂不支持企业账号通过 Skill 完成产品开通。","","请前往支付宝商家平台开通:https://b.alipay.com/page/portal/home"]}}},{"messageId":"onboarding.windows.redirect","owner":"catalog_owned","trigger":"onboarding.windows_platform","blocking":false,"allowedReplies":[],"variables":[{"name":"officialUrl","type":"officialTemporaryUrl","required":true,"urlKind":"windowsOnboardingRedirect"}],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["当前为 Windows 系统,请您暂时前往支付宝 AI 付站点完成产品开通:","{{officialUrl}}"]}}},{"messageId":"product.clarify","owner":"catalog_owned","trigger":"route.product_unclear","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["请确认您的业务场景:","","1. AI 按量付费:买家通过 Agent 使用支付宝完成支付,适用于 API、MCP、算力资源等按调用付费。","2. AI 网页应用收款:买家在电脑网页或手机浏览器页面使用支付宝付款。","3. AI 移动应用收款:买家在 APP 内调起支付宝完成付款。"]}}},{"messageId":"onboarding.mcc.clarify","owner":"catalog_owned","trigger":"onboarding.mcc_unclear","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]}],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["MCC 与经营类目强相关,无法仅从“{{productName}}”确定。","","请补充本次接入的经营内容,例如:","","- 电商购物(实物商品销售)","- 宠物用品","- 在线工具","- 软件开发服务","","也可以直接提供你已知的 MCC 二级类目名称或编码。"]}}},{"messageId":"onboarding.mcc.no_match","owner":"catalog_owned","trigger":"onboarding.mcc_search.none","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["当前经营描述未能匹配到 MCC 参考表中的二级类目,请调整。"]}}},{"messageId":"onboarding.mcc.candidates","owner":"catalog_owned","trigger":"onboarding.mcc_candidates.selection_required","blocking":true,"allowedReplies":[],"replyMode":"runtime_enum","variables":[{"name":"mccCandidates","type":"mccCandidates","required":true},{"name":"candidateTable","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["我找到了几个可能匹配的经营类目,请选择最接近的一项:","","{{candidateTable}}","","请回复序号、MCC 二级类目名称或编码;如果都不匹配,请补充实际销售的商品或服务类型。"]}}},{"messageId":"integration.start.confirm","owner":"catalog_owned","trigger":"integration.step2.ready","blocking":false,"allowedReplies":[],"postRenderHintType":"planAdjustment","variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"projectPath","type":"path","required":true},{"name":"projectOriginLabel","type":"enum","required":true,"values":["现有项目","本轮新建项目"]},{"name":"integrationStatus","type":"enum","required":true,"values":["TARGET_PARTIAL","OTHER_PRODUCT_ONLY","NO_PAYMENT"]},{"name":"otherProducts","type":"singleLine","required":false},{"name":"language","type":"singleLine","required":true},{"name":"framework","type":"singleLine","required":true},{"name":"nextFlow","type":"enum","required":true,"values":["integration"]}],"requiredPolicyIds":["P-PROJECT-PROTECT","P-SENSITIVE-STATE"],"variants":{"AIPAY":{"templateLines":["代码开发方案:","","| 项目 | 内容 |","|---|---|","| 目标产品 | {{productName}} |","| 项目路径 | `{{projectPath}}` |","| 项目来源 | {{projectOriginLabel}} |","| 代码开发状态 | {{integrationStatus}} |","| 检测到的其他支付产品 | {{otherProducts}} |","| 语言 / 框架 | {{language}} / {{framework}} |","","服务声明:","1. 使用本服务需遵守法律法规、自行审核测试并承担使用责任,我方不对使用效果、正确性担保。","2. 生产环境账号密码、API Keys、应用私钥等敏感信息切勿暴露给 Agent;仅沙箱环境信息可按本 Skill 的沙箱配置流程提供和使用。"]},"WEBPAY":{"templateLines":["代码开发方案:","","| 项目 | 内容 |","|---|---|","| 目标产品 | AI 网页应用收款 |","| 项目路径 | `{{projectPath}}` |","| 项目来源 | {{projectOriginLabel}} |","| 代码开发状态 | {{integrationStatus}} |","| 检测到的其他支付产品 | {{otherProducts}} |","| 语言 / 框架 | {{language}} / {{framework}} |","","服务声明:","1. 使用本服务需遵守法律法规、自行审核测试并承担使用责任,我方不对使用效果、正确性担保。","2. 生产环境账号密码、API Keys、应用私钥等敏感信息切勿暴露给 Agent;仅沙箱环境信息可按本 Skill 的沙箱配置流程提供和使用。"]},"APPPAY":{"templateLines":["代码开发方案:","","| 项目 | 内容 |","|---|---|","| 目标产品 | AI 移动应用收款 |","| 项目路径 | `{{projectPath}}` |","| 项目来源 | {{projectOriginLabel}} |","| 代码开发状态 | {{integrationStatus}} |","| 检测到的其他支付产品 | {{otherProducts}} |","| 语言 / 框架 | {{language}} / {{framework}} |","","【前置提醒】接 AI 移动应用收款需要你有自己的 APP,本轮代码开发主要覆盖商家服务端支付接口的实现,APP 还需接入支付宝客户端 SDK 后才能调起支付。你可以在当前 AI 移动应用收款服务端代码开发完毕后,对 Agent 说:“给我做个 APP /给我的 APP 接支付宝客户端 SDK /把我的 APP 客户端和接了支付宝的服务端联动起来”。","","服务声明:","1. 使用本服务需遵守法律法规、自行审核测试并承担使用责任,我方不对使用效果、正确性担保。","2. 生产环境账号密码、API Keys、应用私钥等敏感信息切勿暴露给 Agent;仅沙箱环境信息可按本 Skill 的沙箱配置流程提供和使用。"]}}},{"messageId":"onboarding.plan.confirm","owner":"catalog_owned","trigger":"onboarding.step2.ready","blocking":false,"allowedReplies":[],"postRenderHintType":"planAdjustment","variables":[{"name":"mccCode","type":"mccCode","required":true},{"name":"mccName","type":"singleLine","required":true},{"name":"mccQualification","type":"singleLine","required":true}],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"AIPAY":{"templateLines":["产品开通方案:","","| 项目 | 内容 |","|---|---|","| 产品 | AI 按量付费 |","| 产品码 | `I1080300001000160457` |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 特殊资质 | {{mccQualification}} |","| 授权范围 | `app:all,machine_pay:write,agmnt:write` |","| 材料预告 | 1、签约申请无需页面截图;2、新建或修改服务时收集服务资料;3、新建应用设置应用公钥时由用户提供 |","","你也可以选择前往支付宝 AI 付站点完成产品开通:","https://aipay.alipay.com/?from=alipay-aipay-skill","","暂不支持企业账号通过 Skill 完成产品开通,企业账号如需开通请前往支付宝商家平台(https://b.alipay.com/page/portal/home)"]},"WEBPAY":{"templateLines":["产品开通方案:","","| 项目 | 内容 |","|---|---|","| 产品 | AI 网页应用收款 |","| 产品码 | `I1080300001000041203` |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 特殊资质 | {{mccQualification}} |","| 授权范围 | `app:all,fast_instant_trade_pay:write` |","| 材料预告 | 1、未签约时收集首页、商品页、支付页 3 张截图;支付页是展示支付宝付款方式,等待用户去支付的页面;2、新建应用设置应用公钥时由用户提供 |","","你也可以选择前往支付宝 AI 付站点完成产品开通:","https://aipay.alipay.com/?from=alipay-aipay-skill","","暂不支持企业账号通过 Skill 完成产品开通,企业账号如需开通请前往支付宝商家平台(https://b.alipay.com/page/portal/home)"]},"APPPAY":{"templateLines":["产品开通方案:","","| 项目 | 内容 |","|---|---|","| 产品 | AI 移动应用收款 |","| 产品码 | `I1080300001000041313` |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 特殊资质 | {{mccQualification}} |","| 授权范围 | `app:all,auth_alipay_apppay:write` |","| 材料预告 | 1、未签约时收集 APP 名称和首页、商品页、支付页 3 张截图;支付页是展示支付宝付款方式,等待用户去支付的页面;2、新建应用支持 iOS、Android 或 ALL(二者同时);3、新建应用设置应用公钥时由用户提供 |","| 特别提醒 | 鸿蒙系统移动应用暂不支持通过 Skill 创建,请前往支付宝开放平台-控制台手动创建:https://open.alipay.com/ |","","你也可以选择前往支付宝 AI 付站点完成产品开通:","https://aipay.alipay.com/?from=alipay-aipay-skill","","暂不支持企业账号通过 Skill 完成产品开通,企业账号如需开通请前往支付宝商家平台(https://b.alipay.com/page/portal/home)"]}}},{"messageId":"auth.page","owner":"catalog_owned","trigger":"AUTH_FLOW:READY_TO_OPEN","blocking":false,"allowedReplies":[],"postRenderHintType":"scanReturn","expiresWithPrompt":true,"variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"deviceCode","type":"singleLine","required":true},{"name":"mccCode","type":"mccCode","required":true},{"name":"mccName","type":"singleLine","required":true},{"name":"verificationCode","type":"singleLine","required":true},{"name":"expiresDisplay","type":"singleLine","required":true},{"name":"officialUrl","type":"officialTemporaryUrl","required":true,"urlKind":"authorization"}],"requiredPolicyIds":["P-AUTH-URL","P-AUTH-URL-AUTO-OPEN"],"variants":{"READY":{"templateLines":["接下来会自动打开支付宝扫码授权页面,请在页面中扫码完成授权。","","| 授权信息 | 内容 |","|---|---|","| 产品类型 | {{productName}} |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 确认码 | {{verificationCode}} |","| 授权链接有效期 | {{expiresDisplay}} |","","安全提示:支付宝扫码后,请核对授权页面显示的确认码是否与上方一致;如不一致,请勿授权并立即停止操作。确认码只用于核对,不需要输入。","","如果自动跳转失败,请复制下方链接到网页浏览器打开。","授权链接:","{{officialUrl}}"]}}},{"messageId":"auth.open.manual","owner":"catalog_owned","trigger":"AUTH_OPEN:OPEN_FAILED|GUI_UNAVAILABLE|LINK_ONLY","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-AUTH-URL-AUTO-OPEN"],"variants":{"DEFAULT":{"templateLines":["未能自动打开支付宝授权页面,请手动打开上一条消息中的授权链接并完成扫码。我会继续检查授权结果,无需回复。"]}}},{"messageId":"application.key.page","owner":"catalog_owned","trigger":"application.key_page.ready","blocking":false,"allowedReplies":[],"postRenderHintType":"scanReturn","expiresWithPrompt":true,"variables":[{"name":"appId","type":"singleLine","required":true},{"name":"officialUrl","type":"officialTemporaryUrl","required":true,"urlKind":"publicKeyConfirmation"}],"requiredPolicyIds":["P-KEY-URL","P-KEY-URL-AUTO-OPEN"],"variants":{"READY":{"templateLines":["接下来会自动打开应用 `{{appId}}` 的公钥确认页面,请打开支付宝扫码确认应用公钥。","","如果自动跳转失败,请复制下方链接到网页浏览器打开。","公钥确认链接:","{{officialUrl}}"]}}},{"messageId":"application.key.pending","owner":"catalog_owned","trigger":"FLOW:KEY_NOT_CONFIRMED","blocking":true,"allowedReplySet":"affirmative","inputHintType":"publicKeyConfirmationComplete","variables":[],"requiredPolicyIds":["P-KEY-PUBLIC-USER"],"variants":{"DEFAULT":{"templateLines":["应用公钥尚未确认,请先完成公钥设置确认。"]}}},{"messageId":"onboarding.discovery.summary","owner":"catalog_owned","trigger":"onboarding.discovery.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"signingStatus","type":"enum","required":true,"values":["未签约","已提交待生效","已生效","其他状态待核验","查询失败"]},{"name":"serviceStatus","type":"enum","required":false,"values":["无已有服务","已有服务候选","查询失败"]},{"name":"applicationStatus","type":"enum","required":true,"values":["无同类型应用","有上线应用可复用","仅有未上线应用","查询失败"]}],"requiredPolicyIds":["P-PARTIAL-RESULT","P-MATERIAL-CATEGORY"],"variants":{"AIPAY":{"templateLines":["当前查询结果:","","| 流程 | 当前状态 |","|---|---|","| 产品签约 | {{signingStatus}} |","| 服务市场 | {{serviceStatus}} |","| 应用发布 | {{applicationStatus}} |"]},"WEBPAY":{"templateLines":["当前查询结果:","","| 流程 | 当前状态 |","|---|---|","| 产品签约 | {{signingStatus}} |","| 服务市场 | 无需处理 |","| 应用发布 | {{applicationStatus}} |"]},"APPPAY":{"templateLines":["当前查询结果:","","| 流程 | 当前状态 |","|---|---|","| 产品签约 | {{signingStatus}} |","| 服务市场 | 无需处理 |","| 应用发布 | {{applicationStatus}} |"]}}},{"messageId":"materials.category.collect","owner":"catalog_owned","trigger":"materials.category.ready","blocking":true,"allowedReplies":[],"replyMode":"freeform","expiresWithPrompt":true,"variables":[{"name":"categoryName","type":"enum","required":true,"values":["签约材料","服务资料","应用资料"]},{"name":"currentStatus","type":"enum","required":true,"values":["待补充","部分已提供,待补充","校验失败,需更正"]},{"name":"missingFields","type":"enumList","required":true,"values":["APP名称","首页截图","商品页截图","支付页截图","服务名称","服务描述","服务地址","服务单价","请求示例JSON","应用平台和对应资料","iOS Bundle ID(bundleId)","Android 应用包名(appPackage)","Android 应用签名摘要(appSign)","应用公钥"]},{"name":"paymentPageHint","type":"string","derived":true,"values":["支付页说明:支付页是展示支付宝付款方式,等待用户去支付的页面,不是支付成功页。"]},{"name":"serviceUrlHint","type":"string","derived":true,"values":["请提供有效的 URL 地址(以 http:// 或 https:// 开头)"]},{"name":"servicePricingHint","type":"string","derived":true,"values":["请提供不低于 0.01 元的有效服务单价,可输入 0.03、0.03元或 0.03 元/次。"]}],"requiredPolicyIds":["P-MATERIAL-CATEGORY"],"variants":{"INITIAL":{"templateLines":["当前收集类别:{{categoryName}}","","请在一条回复中提供:{{missingFields}}。","{{paymentPageHint}}"]},"APP_WEB_INITIAL":{"templateLines":["当前收集类别:应用资料","","请在一条回复中提供应用公钥;请勿提供应用私钥。无需另行回复 `新建`。","","填写示例(请替换为实际内容):","```text","应用公钥:<你自行生成的完整应用公钥>","```",""]},"APP_MOBILE_INITIAL":{"templateLines":["当前收集类别:应用资料","","请在一条回复中选择平台并提供以下材料:","","- iOS:`IOS`、iOS Bundle ID(bundleId)、应用公钥。","- Android:`ANDROID`、Android 应用包名(appPackage)、Android 应用签名摘要(appSign,不是应用公钥)、应用公钥。","- iOS + Android:`ALL`、`bundleId`、`appPackage`、`appSign`、应用公钥。","","填写示例(请替换为实际内容):","```text","ANDROID","Android 应用包名(appPackage):com.example.app","Android 应用签名摘要(appSign):<你的 Android 应用签名摘要>","应用公钥:<你自行生成的完整应用公钥>","```","","请勿提供应用私钥。无需另行回复 `新建`。","","鸿蒙系统移动应用暂不支持通过 Skill 创建,请前往支付宝开放平台-控制台手动创建:https://open.alipay.com/"]},"PARTIAL":{"templateLines":["当前收集类别:{{categoryName}}","","还需补充:{{missingFields}}。","{{paymentPageHint}}","已校验字段无需重复提供。"]},"INVALID":{"templateLines":["当前收集类别:{{categoryName}}","","以下内容需要更正:{{missingFields}}。","{{serviceUrlHint}}","{{servicePricingHint}}","{{paymentPageHint}}","已校验字段无需重复提供。"]},"SERVICE_INITIAL":{"templateLines":["当前收集类别:服务资料","","请在一条回复中提供:服务名称、服务描述、服务地址、服务单价、请求示例JSON。","","填写示例(请替换为实际内容):","```text","服务名称:天气查询","服务描述:按城市查询天气","服务地址:以 http:// 或 https:// 开头的实际服务地址","服务单价:0.08 元/次","请求示例 JSON:{\"city\":\"杭州\"}","```"]}}},{"messageId":"service.create.summary","owner":"catalog_owned","trigger":"service.create.ready","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceName","type":"singleLine","required":true},{"name":"serviceDescription","type":"singleLine","required":true},{"name":"serviceUrl","type":"runtimeUrl","required":true},{"name":"servicePricing","type":"singleLine","required":true},{"name":"serviceSchema","type":"string","required":true}],"requiredPolicyIds":["P-SERVICE-WRITE","P-WRITE-UNKNOWN"],"variants":{"DEFAULT":{"templateLines":["将创建以下 AI 按量付费服务:","","服务名称:{{serviceName}}","服务描述:{{serviceDescription}}","服务地址:`{{serviceUrl}}`","服务单价:{{servicePricing}} 元/次","请求示例 JSON:","```json","{{serviceSchema}}","```"]}}},{"messageId":"onboarding.write.confirm","owner":"catalog_owned","trigger":"external_write.ready","blocking":true,"allowedReplySet":"affirmative","inputHintType":"confirm","expiresWithPrompt":true,"variables":[{"name":"sessionSummary","type":"singleLine","required":true},{"name":"subjectSummary","type":"singleLine","required":true},{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"actionTypes","type":"enumList","required":true,"values":["服务修改"]},{"name":"serviceId","type":"singleLine","required":false},{"name":"serviceName","type":"singleLine","required":false},{"name":"serviceDescription","type":"singleLine","required":false},{"name":"serviceUrl","type":"runtimeUrl","required":false},{"name":"servicePricing","type":"singleLine","required":false},{"name":"serviceSchema","type":"string","required":false}],"requiredPolicyIds":["P-SERVICE-WRITE","P-WRITE-UNKNOWN"],"variants":{"SERVICE_UPDATE_ONLY":{"templateLines":["请确认以下支付宝操作:","","- 当前会话:{{sessionSummary}}","- 操作主体:{{subjectSummary}}","- 产品:AI 按量付费","- 动作:服务修改","","服务ID:`{{serviceId}}`","服务名称:{{serviceName}}","服务描述:{{serviceDescription}}","服务地址:`{{serviceUrl}}`","服务单价:{{servicePricing}} 元/次","请求示例 JSON:","```json","{{serviceSchema}}","```","","本次只执行上述服务修改;签约、应用创建、公钥设置和应用提审不包含在本确认中。"]}}},{"messageId":"process.partial_result","owner":"catalog_owned","trigger":"process.current_endpoint","blocking":false,"allowedReplies":[],"variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"processResultTitle","type":"enum","required":true,"values":["支付产品-产品开通已完成","流程进展"]},{"name":"integrationResult","type":"enum","required":true,"values":["不在本轮执行范围","已完成","部分完成,沙箱配置待完成","部分完成,人工待验证","未完成","结果未知"]},{"name":"sandboxConfigState","type":"enum","required":false,"values":["READY","CREATE_PENDING","VERIFY_PENDING"]},{"name":"signingResult","type":"enum","required":true,"values":["未签约","已提交,等待生效","已生效","失败","结果未知"]},{"name":"serviceResult","type":"enum","required":true,"values":["无需处理","已复用","创建成功,状态未取得","修改成功,状态未取得","已完成","失败","结果未知"]},{"name":"applicationResult","type":"enum","required":true,"values":["待选择","已创建,待设置公钥","公钥待确认","HarmonyOS 应用待平台侧创建、配置或上线","已提交审核,等待上线","已上线且配置完整","需人工配置","失败","结果未知"]},{"name":"remainingActions","type":"singleLine","required":true},{"name":"manualVerificationItems","type":"singleLine","required":false},{"name":"applicationOperationAppId","type":"singleLine","required":false},{"name":"applicationOperationActualStatus","type":"singleLine","required":false},{"name":"applicationOperationNextAction","type":"singleLine","required":false},{"name":"applicationOperationAppKeySavePath","type":"singleLine","required":false},{"name":"applicationManualConfigurationNextAction","type":"string","required":false,"derived":true,"values":["前往支付宝 AI 付站点,进入一站式接入 → 密钥配置,按当前 appId 获取对应的支付宝公钥,并手动配置到项目:https://aipay.alipay.com/?from=alipay-aipay-skill"]},{"name":"applicationOperationBlock","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"manualVerificationLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"productionReadinessBlock","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"statusQueryHint","type":"enum","required":false,"derived":true,"values":["。这期间,你也可以试着对 Agent 说:“帮我查询产品签约状态”或“帮我查询应用状态”。"]},{"name":"sandboxRecoveryHint","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"nextFlowReminderLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"nextFlowReminder","type":"enum","required":true,"values":["还需完成支付产品-代码开发,才能在业务系统中实际发起支付。","代码开发已在本轮执行;后续只按上表实际待办继续。"]}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["{{processResultTitle}}:","","| 分支 | 实际结果 |","|---|---|","| 产品 | {{productName}} |","| 代码开发 | {{integrationResult}} |","| 产品开通 | {{signingResult}} |","| 服务市场 | {{serviceResult}} |","| 应用发布 | {{applicationResult}} |","","本轮流程仍需处理:{{remainingActions}}{{statusQueryHint}}","{{manualVerificationLine}}","{{sandboxRecoveryHint}}","{{applicationOperationBlock}}","","{{productionReadinessBlock}}","","{{nextFlowReminderLine}}"]}}},{"messageId":"key_tool.download.result","owner":"catalog_owned","trigger":"key_tool.download.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"downloadPath","type":"existingPath","required":true}],"requiredPolicyIds":["P-KEY-TOOL-DOWNLOAD"],"fallbackMessageId":"key_tool.download.fallback","variants":{"DOWNLOADED":{"templateLines":["支付宝开放平台密钥工具已下载到:`{{downloadPath}}`。","","请打开该安装包并按页面引导完成安装;Agent 不会自动安装、启动工具或生成密钥。生成后只向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。","","如未找到安装包或自动下载未成功,请前往支付宝开放平台自行下载安装:","","https://opendocs.alipay.com/isv/02kipk"]}}},{"messageId":"key_tool.download.fallback","owner":"catalog_owned","trigger":"key_tool.download.fallback","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-KEY-TOOL-DOWNLOAD"],"variants":{"DEFAULT":{"templateLines":["未能完成自动下载,可能是当前环境不支持、无法访问下载源、本地目录不可写或安装包校验未通过。请访问支付宝开放平台手动下载支付宝开放平台密钥工具:","","https://opendocs.alipay.com/isv/02kipk","","仅向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。"]}}},{"messageId":"sandbox.windows.manual_setup","owner":"catalog_owned","trigger":"integration.sandbox.windows.manual_setup","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION","P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["当前 Windows 环境暂不支持自动创建快速沙箱,请前往支付宝 AI 付站点-选择产品-一站式接入-技术集成页面获取沙箱配置:https://aipay.alipay.com/?from=alipay-aipay-skill","","请把沙箱应用的 APPID、支付宝公钥、应用公钥、与当前开发语言(JAVA语言/非JAVA语言)匹配的应用私钥、沙箱账号信息告诉我,我会帮你完成项目配置,并继续进行支付产品代码开发。","","生产环境应用私钥和密码切勿暴露给 Agent。"]}}},{"messageId":"sandbox.environment.summary","owner":"catalog_owned","trigger":"integration.sandbox.persisted","blocking":false,"allowedReplies":[],"variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"configPath","type":"existingPath","required":true},{"name":"environmentRows","type":"sandboxTableRows","required":true}],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION","P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["沙箱环境摘要","","| 项目 | 信息 |","|---|---|","| 产品 | {{productName}} |","| 配置文件目录 | `{{configPath}}` |","{{environmentRows}}","| 密钥字段 | 已写入本地配置文件,默认不在对话中展开 |"]}}},{"messageId":"sandbox.configuration.pending","owner":"catalog_owned","trigger":"integration.sandbox.pending","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"CREATE":{"templateLines":["快速沙箱暂未创建成功,当前沙箱配置尚未完成。","","本轮将继续代码开发。代码开发完成后,请对 Agent 说:“重新创建并配置沙箱”。"]},"VERIFY":{"templateLines":["快速沙箱配置复核未通过,当前沙箱配置尚未完成。","","本轮将继续代码开发。代码开发完成后,请对 Agent 说:“重新创建并配置沙箱”。"]}}},{"messageId":"sandbox.create.failure","owner":"catalog_owned","trigger":"integration.sandbox.failed","blocking":false,"allowedReplies":[],"variables":[{"name":"failureReason","type":"singleLine","required":true},{"name":"recoveryAction","type":"singleLine","required":true}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"WINDOWS":{"templateLines":["Windows 沙箱本地配置未准备完成:{{failureReason}}","","恢复动作:{{recoveryAction}}","","字段缺失、来源不明或本地保护未完成时不能继续,也不能把当前配置表述为可用。"]}}},{"messageId":"sandbox.environment.reminder","owner":"catalog_owned","trigger":"integration.sandbox.persisted.reminder","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-A2M-SANDBOX","P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["快速沙箱环境配置已准备完成,仅用于测试,不涉及真实资金。","","完整配置已写入上述本地文件。"]},"WINDOWS":{"templateLines":["Windows 沙箱本地配置已准备完成,仅用于测试,不涉及真实资金。","","配置已保存至上述本机路径。"]}}},{"messageId":"a2m.test.start","owner":"catalog_owned","trigger":"integration.a2m.test.start","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-A2M-SANDBOX","P-A2M-SUCCESS"],"variants":{"DEFAULT":{"templateLines":["开始执行 AI 按量付费沙箱服务端联调。","","我将连续验证 `402 Payment-Needed`、沙箱收银、`Payment-Proof` 重试和资源交付,完成后输出实际结论;这里不需要额外确认。"]}}},{"messageId":"a2m.test.result","owner":"catalog_owned","trigger":"integration.a2m.test.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"evidenceSummary","type":"singleLine","required":true},{"name":"recoveryAction","type":"singleLine","required":false}],"requiredPolicyIds":["P-A2M-SUCCESS","P-SENSITIVE-STATE"],"variants":{"PASSED":{"templateLines":["AI 按量付费沙箱服务端联调通过。","","通过证据:{{evidenceSummary}}"]},"FAILED":{"templateLines":["AI 按量付费沙箱服务端联调未通过。","","实际证据:{{evidenceSummary}}","","恢复动作:{{recoveryAction}}"]}}},{"messageId":"a2m.payment.experience","owner":"catalog_owned","trigger":"integration.a2m.optional_payment_experience","blocking":false,"allowedReplies":[],"variables":[{"name":"paymentUrl","type":"runtimeUrl","required":true},{"name":"buyerAccount","type":"singleLine","required":true},{"name":"buyerLoginPassword","type":"sandboxCredential","required":true},{"name":"buyerPayPassword","type":"sandboxCredential","required":true}],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION"],"variants":{"FULL":{"templateLines":["可选:体验 AI 按量付费沙箱付款","","付款链接(复制到网页浏览器打开):{{paymentUrl}}","沙箱买家账号:{{buyerAccount}}","登录密码:{{buyerLoginPassword}}","支付密码:{{buyerPayPassword}}"]}}},{"messageId":"webpay.sandbox.experience","owner":"catalog_owned","trigger":"integration.webpay.sandbox_experience","blocking":false,"allowedReplies":[],"variables":[{"name":"startCommand","type":"command","required":true},{"name":"paymentUrl","type":"runtimeUrl","required":true},{"name":"buyerAccount","type":"singleLine","required":true},{"name":"buyerLoginPassword","type":"sandboxCredential","required":true},{"name":"buyerPayPassword","type":"sandboxCredential","required":true},{"name":"resultPageInstruction","type":"enum","required":true,"values":["付款后确认浏览器自动返回商户结果页,页面可正常展示并通过服务端查询呈现订单状态。","付款后不会自动返回商户网站;请手动返回商户订单查询页并刷新或查询订单状态。"]}],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION"],"variants":{"DEFAULT":{"templateLines":["AI 网页应用收款沙箱付款指引","","1. 启动服务:`{{startCommand}}`","2. 在浏览器打开:{{paymentUrl}}","3. 在沙箱收银台二选一:使用沙箱买家账号登录,或仅在 Android 沙箱支付宝中扫描收银台页面二维码。","4. 沙箱买家账号:{{buyerAccount}}","5. 登录密码:{{buyerLoginPassword}}","6. 支付密码:{{buyerPayPassword}}","7. {{resultPageInstruction}}","","沙箱测试环境不稳定,可能出现跳转到支付宝收银台页面后报错,如:504 Gateway Time-out;输入完测试买家账号后展示系统繁忙;输入完测试买家支付密码后展示系统繁忙。您可以回到支付页重新发起支付以完成沙箱测试。","","前台页面和同步回跳参数不是支付成功依据,最终以验签通过的异步通知或交易查询为准。用户暂不付款只记为待体验,不得表述为沙箱测试通过。"]}}},{"messageId":"sandbox.android.client","owner":"catalog_owned","trigger":"integration.sandbox_android_client","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["沙箱支付宝当前仅支持 Android。请复制以下支付宝官方地址到网页浏览器打开,并扫描屏幕二维码下载沙箱版支付宝安装包:","","https://mdn.alipayobjects.com/sandboxsys/afts/img/_itHRrdOD9oAAAAAAAAAAAAADgSLAQBr/original","","如果直链或页面二维码无法打开,请前往支付宝开放平台-沙箱工具页下载:","","https://open.alipay.com/develop/sandbox/tool"]}}},{"messageId":"webpay.sandbox.experience.windows","owner":"catalog_owned","trigger":"integration.webpay.sandbox_experience.windows","blocking":false,"allowedReplies":[],"variables":[{"name":"startCommand","type":"command","required":true},{"name":"paymentUrl","type":"runtimeUrl","required":true},{"name":"resultPageInstruction","type":"enum","required":true,"values":["付款后确认浏览器自动返回商户结果页,页面可正常展示并通过服务端查询呈现订单状态。","付款后不会自动返回商户网站;请手动返回商户订单查询页并刷新或查询订单状态。"]}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["AI 网页应用收款沙箱付款指引","","1. 启动服务:`{{startCommand}}`","2. 在浏览器打开:{{paymentUrl}}","3. 在沙箱收银台使用支付宝开放平台控制台中的沙箱买家账号登录,或仅在 Android 沙箱支付宝中扫描收银台页面二维码。","4. 登录密码和支付密码请直接从本机保存的信息或支付宝开放平台控制台取得,无需再次提供给 Agent。","5. {{resultPageInstruction}}","","沙箱测试环境不稳定,可能出现跳转到支付宝收银台页面后报错,如:504 Gateway Time-out;输入完测试买家账号后展示系统繁忙;输入完测试买家支付密码后展示系统繁忙。您可以回到支付页重新发起支付以完成沙箱测试。","","前台页面和同步回跳参数不是支付成功依据,最终以验签通过的异步通知或交易查询为准。用户暂不付款只记为待体验,不得表述为沙箱测试通过。"]}}},{"messageId":"integration.safety.closeout","owner":"catalog_owned","trigger":"integration.step7.safety","blocking":false,"allowedReplies":[],"variables":[{"name":"acceptanceSummary","type":"singleLine","required":true}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"AIPAY":{"templateLines":["代码开发安全与上线提醒","","- 上线前必须完成人工代码审查;私钥只保存在商家服务端,禁止写入客户端、日志或公共仓库。Java 使用 `PKCS#8` 私钥,非 Java 使用 `PKCS#1` 私钥,格式不匹配时只用支付宝官方密钥工具转换。","- `Payment-Proof` 必须调用 `alipay.aipay.agent.payment.verify` 验证;无效或过期凭证拒绝服务,结果不明时不得要求用户重复付款。","- 资源交付后必须调用 `alipay.aipay.agent.fulfillment.confirm`;履约确认失败必须可重试且保持幂等。","- 沙箱配置仅用于开发调试;正式上线前必须替换为同一套生产 `appId`、应用公钥、应用私钥和支付宝公钥,并将 `api_mock_service_id` 替换为真实 `serviceId`。`serviceId` 获取方式:支付宝扫码登录支付宝 AI 付站点 → 控制台 → 服务管理 → 复制审核已通过的服务 ID:https://aipay.alipay.com/?from=alipay-aipay-skill","- 收款商户 PID/2088 用于 AI 按量付费 `seller_id` 和 `seller_unique_id`,不由 Agent 猜测。获取方式:支付宝扫码登录支付宝商家平台 → 点击头像 → 复制账户名下方 2088 开头的商家 ID:https://b.alipay.com/page/portal/home","- 生产环境必须严格校验本地订单、金额与资源关系;正式收款必须完成 `Payment-Proof` 验付和异步履约回执确认。","","当前验收口径:{{acceptanceSummary}}"]},"WEBPAY":{"templateLines":["代码开发安全与上线提醒","","- 上线前必须完成人工代码审查;私钥只保存在商家服务端,禁止写入客户端、日志或公共仓库。Java 使用 `PKCS#8` 私钥,非 Java 使用 `PKCS#1` 私钥,格式不匹配时只用支付宝官方密钥工具转换。","- 同步回跳和前台结果不作为支付成功依据;必须以验签通过的异步通知或交易查询为准。","- 正式上线前必须替换为同一套生产 `appId`、应用公钥、应用私钥和支付宝公钥。","- AI 网页应用收款生产上线必须配置并联调公网 HTTPS `notify_url`;异步通知必须验签、校验关键字段、幂等处理并返回 `success`,同时配置交易查询补偿。若当前仅完成本地生产参数验收,该项仍需在上线前补齐;localhost、局域网地址或其他不可公网访问的地址不能用于生产异步通知。支付结果不明时不得要求用户重复付款。","","当前验收口径:{{acceptanceSummary}}"]},"APPPAY":{"templateLines":["代码开发安全与上线提醒","","- 上线前必须完成人工代码审查;私钥只保存在商家服务端,禁止写入 APP 客户端、日志或公共仓库。Java 使用 `PKCS#8` 私钥,非 Java 使用 `PKCS#1` 私钥,格式不匹配时只用支付宝官方密钥工具转换。","- 客户端支付结果不作为成功依据;必须以验签通过的异步通知或服务端交易查询为准。","- 正式上线前必须替换为同一套生产 `appId`、应用公钥、应用私钥和支付宝公钥。","- AI 移动应用收款生产上线必须配置并联调公网 HTTPS `notify_url`;异步通知必须验签、校验关键字段、幂等处理并返回 `success`,同时配置交易查询补偿。若当前仅完成本地生产参数验收,该项仍需在上线前补齐;localhost、局域网地址或其他不可公网访问的地址不能用于生产异步通知。支付结果不明时不得要求用户重复付款。","- 本轮代码开发只覆盖商家服务端;APP 客户端仍需接入支付宝客户端 SDK,使用服务端返回的 `orderStr` 调起支付,并与服务端异步通知或交易查询完成联调。","","当前验收口径:{{acceptanceSummary}}"]}}},{"messageId":"integration.checklist.result","owner":"catalog_owned","trigger":"integration.checklist.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"overallResult","type":"enum","required":true,"values":["通过","部分通过","未通过"]},{"name":"failedItems","type":"singleLine","required":true},{"name":"manualItems","type":"singleLine","required":true},{"name":"sandboxResult","type":"enum","required":false,"values":["AI 按量付费沙箱服务端联调通过","AI 按量付费沙箱服务端联调未通过"]},{"name":"webpayExperienceResult","type":"enum","required":false,"values":["已提供浏览器付款入口和操作指引,实际付款及结果验证仍以用户完成情况为准","未提供浏览器付款入口或完整操作指引,需先补齐","已提供浏览器付款入口和操作指引;用户已完成一笔沙箱付款,结果只按实际核验证据记录"]},{"name":"sandboxConfigState","type":"enum","required":true,"values":["READY","CREATE_PENDING","VERIFY_PENDING"]},{"name":"blockingDefectState","type":"enum","required":true,"values":["NONE","PRESENT"]},{"name":"executionMode","type":"enum","required":true,"values":["仅代码开发","完整接入"]},{"name":"nextFlowReminder","type":"enum","required":true,"values":["正式上线前还需完成支付产品-产品开通。","代码开发校验通过后将自动进入支付产品-产品开通;未通过时停留在代码开发。","沙箱配置尚未完成,但不阻塞本轮继续支付产品-产品开通;完成配置后再进行沙箱测试。","代码开发自动校验已完成,仍有人工待验证项;本轮继续产品开通。"]}],"requiredPolicyIds":[],"variants":{"AIPAY_PASSED":{"templateLines":["AI 按量付费代码开发校验通过。","","{{nextFlowReminder}}"]},"AIPAY_INCOMPLETE":{"templateLines":["AI 按量付费代码开发校验:{{overallResult}}。","","未完成项:{{failedItems}}","人工待验证:{{manualItems}}","","{{nextFlowReminder}}"]},"WEBPAY_PASSED":{"templateLines":["AI 网页应用收款代码开发校验通过。","","{{nextFlowReminder}}"]},"WEBPAY_INCOMPLETE":{"templateLines":["AI 网页应用收款代码开发校验:{{overallResult}}。","","未完成项:{{failedItems}}","人工待验证:{{manualItems}}","","{{nextFlowReminder}}"]},"APPPAY_PASSED":{"maintenanceTodo":"TODO: 后续确定 AI 移动应用收款沙箱测试的对客引导动作后,在本变体补充;同步 integration flow、checklist 和测试。","templateLines":["AI 移动应用收款代码开发校验通过。","","{{nextFlowReminder}}"]},"APPPAY_INCOMPLETE":{"maintenanceTodo":"TODO: 后续确定 AI 移动应用收款沙箱测试的对客引导动作后,在本变体补充;同步 integration flow、checklist 和测试。","templateLines":["AI 移动应用收款代码开发校验:{{overallResult}}。","","未完成项:{{failedItems}}","人工待验证:{{manualItems}}","","{{nextFlowReminder}}"]}}},{"messageId":"auth.pending","owner":"catalog_owned","trigger":"AUTH_FLOW:PENDING","blocking":true,"allowedReplySet":"affirmative","inputHintType":"authorizationComplete","variables":[],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"DEFAULT":{"templateLines":["支付宝授权尚未完成,当前流程保持等待,请在已打开的网页二维码页面完成扫码确认后,再回复当前授权提示。"]}}},{"messageId":"auth.expired","owner":"catalog_owned","trigger":"AUTH_FLOW:EXPIRED","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"DEFAULT":{"templateLines":["本次支付宝授权链接已过期,旧链接和旧回复均已失效。正在重新生成授权链接,请使用新的授权页面完成授权。"]}}},{"messageId":"auth.mismatch","owner":"catalog_owned","trigger":"AUTH_FLOW:SCOPE_MISMATCH|MCC_MISMATCH","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"DEFAULT":{"templateLines":["当前授权范围或经营类目不匹配,需要退出当前登录并重新生成授权页面。"]}}},{"messageId":"error.mcp.auth","owner":"catalog_owned","trigger":"error.mcp_auth","blocking":false,"allowedReplies":[],"variables":[{"name":"errorMessage","type":"customerErrorText","required":false}],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING","P-SENSITIVE-STATE"],"variants":{"START":{"templateLines":["🔐 未登录或授权已过期","","当前登录状态已失效,无法继续操作。MCP 调用返回认证错误,正在退出当前登录。"]},"LOGOUT_UNCONFIRMED":{"templateLines":["无法确认退出当前登录结果,已停止重新授权。","","这通常表示当前 Agent 执行环境缺少联网权限、CLI wrapper 混入输出,或 stdout/stderr 无法唯一解析;不代表用户本机 logout 失败,也不能据此判断支付宝业务失败。","","Agent 应申请可联网权限后重试同一动作;不要要求用户手动 logout 代替本轮事实。"]},"LOGOUT_FAILED":{"templateLines":["退出当前登录失败,已停止重新授权。","错误信息:{{errorMessage}}","","请先重试退出登录;确认退出成功后再重新授权。"]},"LOGOUT_SUCCESS":{"templateLines":["已退出登录状态。","","请重新执行登录授权流程:生成授权链接后,使用支付宝扫码授权,授权成功后继续当前操作。","","产品、MCC 和授权范围未变化时,沿用已有确认立即重新生成授权链接;发生变化时先重新确认受影响内容。"]}}},{"messageId":"error.mcp.service","owner":"catalog_owned","trigger":"error.mcp_service","blocking":false,"allowedReplies":[],"variables":[{"name":"errorDetail","type":"customerErrorText","required":false}],"requiredPolicyIds":["P-PARTIAL-RESULT","P-SENSITIVE-STATE"],"variants":{"AGENT_NETWORK":{"templateLines":["MCP 服务暂时不可用。","","当前命令需要访问支付宝服务,但当前 Agent 执行环境可能没有外网权限。Agent 应申请可联网权限后重试同一条命令,不要要求用户排查本机网络,也不要更换业务参数。","","请授权 Agent 联网重试,或稍后重新执行当前命令。"]},"GENERIC":{"templateLines":["MCP 服务暂时不可用。","","无法连接到支付宝服务,请稍后重试。","错误详情:{{errorDetail}}","","当前动作已停止重试;由主流程记录受影响分支,并在不受其依赖的情况下继续其他分支。本轮收口时将一次说明未恢复的动作、受影响分支和后续恢复方式。"]}}},{"messageId":"error.backend","owner":"catalog_owned","trigger":"error.backend_business","blocking":false,"allowedReplies":[],"variables":[{"name":"errorCode","type":"customerErrorText","required":true},{"name":"errorMessage","type":"customerErrorText","required":true},{"name":"errorScene","type":"customerErrorText","required":false},{"name":"errorSpecific","type":"customerErrorText","required":false},{"name":"checkedErrors","type":"customerErrorDetails","required":false},{"name":"bizTips","type":"customerErrorText","required":false},{"name":"appMax","type":"enum","required":true,"values":["YES","NO"]},{"name":"errorSceneLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"checkedErrorsBlock","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"bizTipsLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"appMaxLine","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["业务处理失败。","","错误码:{{errorCode}}","错误信息:{{errorMessage}}","{{errorSceneLine}}","","{{checkedErrorsBlock}}","","{{bizTipsLine}}","","{{appMaxLine}}","","当前业务错误不会自动重试;请先按以上错误信息修正受影响分支的业务条件。","如需帮助,请联系技术支持并提供以上脱敏错误信息。"]}}},{"messageId":"error.service.unstable","owner":"catalog_owned","trigger":"error.service_unstable","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["MCP 服务暂时不稳定。","","当前动作已停止重试;由主流程记录受影响分支,并在不受其依赖的情况下继续其他分支。","本轮收口时将一次说明未恢复的动作、受影响分支和后续恢复方式。"]}}},{"messageId":"error.cli","owner":"catalog_owned","trigger":"error.cli_output","blocking":false,"allowedReplies":[],"variables":[{"name":"errorMessage","type":"customerErrorText","required":true},{"name":"bizTips","type":"customerErrorText","required":false},{"name":"checkedErrors","type":"customerErrorDetails","required":false},{"name":"bizTipsLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"checkedErrorsBlock","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["命令执行失败:{{errorMessage}}","{{bizTipsLine}}","{{checkedErrorsBlock}}"]}}},{"messageId":"integration.service.not_ready","owner":"catalog_owned","trigger":"integration.a2m.service_not_ready","blocking":false,"allowedReplies":[],"variables":[{"name":"recoveryAction","type":"singleLine","required":true}],"requiredPolicyIds":["P-A2M-SUCCESS"],"variants":{"DEFAULT":{"templateLines":["AI 按量付费本地服务尚未达到自动联调前置条件。","","需要处理:{{recoveryAction}}","","该条件未满足前不会运行自动联调,也不会把服务标记为可用。"]}}},{"messageId":"integration.project_path.required","owner":"catalog_owned","trigger":"integration.project_path.unresolved","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["现有项目及文件保持不变。请在一条回复中说明新项目要放在哪里;可以说“在当前目录新建 pay-demo”、提供当前目录下的新子目录名,或提供电脑上的完整路径。若不想指定位置,可以说“新建项目”或“帮我新建默认项目”,我会在用户目录下选择安全的新目录并告知项目地址。路径解析和确认完成前不会创建或修改文件。"]}}},{"messageId":"integration.context.required","owner":"catalog_owned","trigger":"integration.context.unresolved","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"missingItems","type":"enumList","required":true,"values":["项目路径","技术栈"]}],"requiredPolicyIds":["P-PROJECT-PROTECT"],"variants":{"DEFAULT":{"templateLines":["为继续代码开发,请先确定:{{missingItems}}。","","- 要新建项目:可以说“在当前目录新建 pay-demo”,或提供一个新的文件夹位置;不想指定位置时,可以说“新建项目”或“帮我新建默认项目”。","- 要复用已有项目:请告诉我项目文件夹;如果不知道在哪,可以说“帮我在当前目录下找项目”;如果大概知道在哪,可以说“帮我在 server 下找项目”。我会先定位候选目录,再让你选择。","- “当前项目/当前目录”只有在当前目录本身就是可识别项目根时才会使用;否则不会扫描整个大目录。","- 技术栈:例如 Node.js + Express、Java + Spring Boot、Python + Flask、PHP + Laravel、C# + ASP.NET;不确定时可以说“请推荐默认技术栈”。","","项目和技术栈明确前,不会创建或修改文件。"]},"PROJECT_PATH_ONLY":{"templateLines":["为继续代码开发,请先确定:{{missingItems}}。","","- 要新建项目:可以说“在当前目录新建 pay-demo”,或提供一个新的文件夹位置;不想指定位置时,可以说“新建项目”或“帮我新建默认项目”。","- 要复用已有项目:请告诉我项目文件夹;如果不知道在哪,可以说“帮我在当前目录下找项目”;如果大概知道在哪,可以说“帮我在 server 下找项目”。我会先定位候选目录,再让你选择。","- “当前项目/当前目录”只有在当前目录本身就是可识别项目根时才会使用;否则不会扫描整个大目录。","","项目路径明确前,不会创建或修改文件。"]}}},{"messageId":"integration.project_candidates.select","owner":"catalog_owned","trigger":"integration.project_candidates.located","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"searchBasePath","type":"existingPath","required":true},{"name":"candidateRows","type":"string","required":true}],"requiredPolicyIds":["P-PROJECT-PROTECT"],"variants":{"DEFAULT":{"templateLines":["我先在 `{{searchBasePath}}` 下做了轻量项目定位;这里只看项目标记文件,不扫描代码内容。","","{{candidateRows}}","","如果要复用已有项目,请回复候选序号或具体项目文件夹。","如果要新建项目,可以回复“在当前目录新建 pay-demo”,或直接回复“新建项目”使用用户目录下的默认安全目录。","","选定具体项目目录前,不会扫描整个大目录,也不会创建或修改文件。"]}}},{"messageId":"integration.local_acceptance.notice","owner":"catalog_owned","trigger":"integration.local_acceptance.enabled","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["当前使用本地生产参数验收模式:本轮可以暂不发起公网异步通知,但生产上线前必须恢复并验证 `notify_url`。这不是生产最终配置,也不能据此宣称生产就绪。"]}}},{"messageId":"application.reuse.no_key","owner":"catalog_owned","trigger":"FLOW:REUSE_NO_KEY","blocking":false,"allowedReplies":[],"variables":[{"name":"appId","type":"singleLine","required":true}],"requiredPolicyIds":["P-KEY-PUBLIC-USER"],"variants":{"DEFAULT":{"templateLines":["应用 `{{appId}}` 当前为可复用的上线应用,但尚未确认 RSA2 应用公钥,应用分支仍未完成。","","接下来需要为该应用设置应用公钥;如果你已经准备好应用公钥,请直接提供。","","本次不会自动下载支付宝开放平台密钥工具。如需我下载请直接说明,或访问官方地址手动下载:https://opendocs.alipay.com/isv/02kipk","只向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。","","如果不想继续复用这个应用,请说明要重新选择或新建应用。"]}}},{"messageId":"application.candidates.facts","owner":"catalog_owned","trigger":"application.candidates.queried","blocking":false,"allowedReplies":[],"variables":[{"name":"applicationType","type":"enum","required":true,"values":["WEBAPP","MOBILEAPP"]},{"name":"applicationCandidates","type":"applicationCandidates","required":true},{"name":"candidateTable","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-PARTIAL-RESULT","P-KEY-TOOL-DOWNLOAD"],"variants":{"EMPTY":{"templateLines":["📋 暂无 {{applicationType}} 应用。","","支付宝开放平台密钥工具可用于生成应用公私钥对。无论是否需要自动下载,都可以访问官方地址:","https://opendocs.alipay.com/isv/02kipk","","只向 Agent 提供【应用公钥】,请勿提供应用私钥。"]},"PENDING_ONLY":{"templateLines":["📋 当前已有以下尚未上线的 {{applicationType}} 应用:","","{{candidateTable}}","","以上应用当前不可复用。"]},"ONLINE_WITH_OPTIONAL_PENDING":{"templateLines":["📋 发现您已有以下上线 {{applicationType}} 应用:","","{{candidateTable}}"]}}},{"messageId":"application.candidate.invalid","owner":"catalog_owned","trigger":"application.candidates.selection_invalid","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["上一次回复未匹配当前应用候选或支持的选择格式。已重新展示当前候选,请按下方方式重新选择。","序号、非上线、历史或候选外 `appId` 均不会触发应用操作。"]}}},{"messageId":"application.candidate.select","owner":"catalog_owned","trigger":"application.candidates.selection_required","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"ONLINE_WEB_OR_NEW":{"templateLines":["请选择应用分支下一步:","","- 回复上方事实表中状态为“已上线”的完整 `appId`:复用对应应用。","- 新建应用:在同一条回复中提供 `新建` 和应用公钥,材料完整后将创建应用、设置公钥并进入公钥确认。","","新建回复示例(请替换为实际内容):","```text","新建","应用公钥:<你自行生成的完整应用公钥>","```","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:https://opendocs.alipay.com/isv/02kipk","只向 Agent 提供【应用公钥】,请勿提供应用私钥。","","候选、状态或目标变化后旧回复自动失效;不接受序号、历史候选或其他 `appId`。"]},"PENDING_WEB_OR_NEW":{"templateLines":["当前同类型应用均未上线,不能复用。","","- 新建应用:在同一条回复中提供 `新建` 和应用公钥,材料完整后将创建应用、设置公钥并进入公钥确认。","- 回复 `暂不新建`:本轮应用分支保持待办。","","新建回复示例(请替换为实际内容):","```text","新建","应用公钥:<你自行生成的完整应用公钥>","```","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:https://opendocs.alipay.com/isv/02kipk","只向 Agent 提供【应用公钥】,请勿提供应用私钥。"]},"ONLINE_MOBILE_OR_NEW":{"templateLines":["请选择应用分支下一步:","","- 回复上方事实表中状态为“已上线”的完整 `appId`:复用对应应用。","- 新建 `IOS`:回复 `新建 IOS`、iOS Bundle ID(`bundleId`)和应用公钥。","- 新建 `ANDROID`:回复 `新建 ANDROID`、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","- 新建 `ALL`:回复 `新建 ALL`、iOS Bundle ID(`bundleId`)、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:https://opendocs.alipay.com/isv/02kipk","只向 Agent 提供【应用公钥】,请勿提供应用私钥。","","候选、状态或目标变化后旧回复自动失效;不接受序号、历史候选或其他 `appId`。"]},"PENDING_MOBILE_OR_NEW":{"templateLines":["当前同类型应用均未上线,不能复用。","","- 新建 `IOS`:回复 `新建 IOS`、iOS Bundle ID(`bundleId`)和应用公钥。","- 新建 `ANDROID`:回复 `新建 ANDROID`、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","- 新建 `ALL`:回复 `新建 ALL`、iOS Bundle ID(`bundleId`)、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","- 回复 `暂不新建`:本轮应用分支保持待办。","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:https://opendocs.alipay.com/isv/02kipk","只向 Agent 提供【应用公钥】,请勿提供应用私钥。"]}}},{"messageId":"application.operation.result","owner":"catalog_owned","trigger":"application.operation.completed","blocking":false,"allowedReplies":[],"variables":[{"name":"appId","type":"singleLine","required":true},{"name":"actualStatus","type":"singleLine","required":true},{"name":"nextAction","type":"singleLine","required":false},{"name":"appKeySavePath","type":"singleLine","required":false},{"name":"appKeySaveLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"manualConfigurationNextAction","type":"string","required":false,"derived":true,"values":["前往支付宝 AI 付站点,进入一站式接入 → 密钥配置,按当前 appId 获取对应的支付宝公钥,并手动配置到项目:https://aipay.alipay.com/?from=alipay-aipay-skill"]}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["应用 `{{appId}}` 的实际状态:{{actualStatus}}。","{{appKeySaveLine}}","","下一步:{{nextAction}}","","待审核、待设置公钥或待人工配置时不会表述为应用发布完成。"]},"ALIPAY_PUBLIC_KEY_MANUAL_CONFIGURATION":{"templateLines":["应用 `{{appId}}` 的实际状态:需人工配置。","","下一步:{{manualConfigurationNextAction}}","","待人工配置时不会表述为应用发布完成。"]}}},{"messageId":"application.harmony.manual_create","owner":"catalog_owned","trigger":"application.harmony.manual_create","blocking":true,"allowedReplySet":"affirmative","inputHintType":"complete","variables":[],"requiredPolicyIds":["P-MCP-CONTRACT-FROZEN"],"variants":{"DEFAULT":{"templateLines":["当前 Skill 不支持创建 HarmonyOS 移动应用。","","请前往支付宝开放平台,进入“控制台” → “创建移动应用”,完成平台要求的创建、配置和审核:https://open.alipay.com/","","完成后将重新查询移动应用列表。"]}}},{"messageId":"service.operation.result","owner":"catalog_owned","trigger":"service.operation.completed","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceId","type":"singleLine","required":true},{"name":"actualResult","type":"singleLine","required":true}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["服务市场实际结果:{{actualResult}}。","已确认的 `serviceId`:`{{serviceId}}`。","","查看服务状态和服务详情:请前往支付宝 AI 付站点,登录后进入控制台 → 服务管理。","https://aipay.alipay.com/?from=alipay-aipay-skill","","该结果只代表服务分支,不会覆盖签约或应用分支的实际状态。"]}}},{"messageId":"signing.operation.result","owner":"catalog_owned","trigger":"signing.operation.completed","blocking":false,"allowedReplies":[],"variables":[{"name":"actualStatus","type":"singleLine","required":true},{"name":"feeDisplay","type":"singleLine","required":false},{"name":"nextAction","type":"singleLine","required":true}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"WITHOUT_FEE":{"templateLines":["产品当前签约状态:{{actualStatus}}。","","下一步:{{nextAction}}"]},"WITH_FEE":{"templateLines":["产品当前签约状态:{{actualStatus}}。","费率:{{feeDisplay}}","","下一步:{{nextAction}}"]}}},{"messageId":"service.candidates.facts","owner":"catalog_owned","trigger":"service.candidates.queried","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceCandidates","type":"serviceCandidates","required":true},{"name":"candidateTable","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"EMPTY":{"templateLines":["📋 暂无已有服务。"]},"DEFAULT":{"templateLines":["📋 发现您已有以下服务:","","{{candidateTable}}"]}}},{"messageId":"service.candidate.invalid","owner":"catalog_owned","trigger":"service.candidates.selection_invalid","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["上一次回复没有匹配到有效的服务操作。","仅回复序号,或提供不在当前事实表中的 `serviceId`,均不会触发服务操作。"]}}},{"messageId":"service.candidate.select","owner":"catalog_owned","trigger":"service.candidates.selection_required","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["请选择下一步:","","- 回复上方事实表中的完整 `serviceId`:复用对应服务。","- 新建服务:回复 `新建`,并在同一条回复中提供服务名称、服务描述、服务地址、服务单价、请求示例 JSON。","- 回复 `修改:<serviceId>`:修改对应服务。","","- 如果只回复 `新建` 或材料不完整,我会再提示补充缺失项。","","新建回复示例(请替换为实际内容):","```text","新建","服务名称:天气查询","服务描述:按城市查询天气","服务地址:以 http:// 或 https:// 开头的实际服务地址","服务单价:0.08 元/次","请求示例 JSON:{\"city\":\"杭州\"}","```","","如需核对服务状态或服务详情,可前往支付宝 AI 付站点,登录后进入控制台 → 服务管理查看。","https://aipay.alipay.com/?from=alipay-aipay-skill"]}}},{"messageId":"service.id.missing","owner":"catalog_owned","trigger":"service.save.id_missing","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceName","type":"singleLine","required":true}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["服务 `{{serviceName}}` 的创建或修改调用已返回成功,但未解析到 `serviceId`,因此服务分支尚未完成。接下来会重新查询完整服务列表,并使用本次实际提交资料与列表可见字段做唯一匹配;没有唯一结果时保持未知。在取得实际 `serviceId` 前不会宣称 AI 按量付费产品开通完成。","","如需自行核对服务状态或服务详情,可前往支付宝 AI 付站点,登录后进入控制台 → 服务管理查看。","https://aipay.alipay.com/?from=alipay-aipay-skill"]}}}]}
1
+ {"schemaVersion":1,"interactionPrompts":{"confirmInputHint":"如确认,可以回复“继续”“确认”“OK”,也可以输入 1;如需调整,请直接说明。","planAdjustmentHint":"我会继续执行,无需回复;如需调整方案,请中断 Agent 执行并说明。","authorizationCompletionInputHint":"授权完成后可回复“继续”“好了”“OK”或输入 1","publicKeyConfirmationCompletionInputHint":"支付宝扫码确认应用公钥完成后可回复“继续”“好了”“OK”或输入 1","completionInputHint":"完成后可回复“继续”“好了”“已完成”“OK”或输入 1;如需调整,请直接说明。","scanReturnHint":"扫码完成后请回到 Agent 对话页面"},"interactionReplySets":{"affirmative":["1","继续","继续推进","继续执行","继续处理","继续下一步","请继续","请继续推进","继续吧","确认","确认继续","确定","同意","可以","可以继续","可以继续推进","没问题","好","好的","好了","好的继续","已完成","完成","完成了","操作完成","操作好了","已经完成","已经好了","处理好了","确认好了","弄好了","OK","Okay","Yes","Y"]},"messages":[{"messageId":"product.unsupported","owner":"catalog_owned","trigger":"route.unsupported_product","blocking":false,"allowedReplies":[],"variables":[{"name":"productName","type":"singleLine","required":true}],"requiredPolicyIds":["P-MCP-CONTRACT-FROZEN"],"variants":{"DEFAULT":{"templateLines":["当前 Skill 只支持接入 AI 按量付费、AI 网页应用收款和 AI 移动应用收款,不支持 `{{productName}}`。","","- 查看支付宝其他收单产品请前往:[支付宝开放平台](https://open.alipay.com)","- 开通支付宝其他收单产品请前往:[支付宝商家平台](https://b.alipay.com/page/portal/home)"]}}},{"messageId":"onboarding.enterprise.unsupported","owner":"catalog_owned","trigger":"onboarding.enterprise_account","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"ONBOARDING_ONLY":{"templateLines":["暂不支持企业账号通过 Skill 完成产品开通。","","请前往支付宝商家平台开通:https://b.alipay.com/page/portal/home","","如需继续进行代码开发,试试对 Agent 说:为我集成 AI 网页应用收款/AI 移动应用收款/AI 按量付费"]},"FULL_PROCESS":{"templateLines":["暂不支持企业账号通过 Skill 完成产品开通。","","请前往支付宝商家平台开通:https://b.alipay.com/page/portal/home"]}}},{"messageId":"onboarding.windows.redirect","owner":"catalog_owned","trigger":"onboarding.windows_platform","blocking":false,"allowedReplies":[],"variables":[{"name":"officialUrl","type":"officialTemporaryUrl","required":true,"urlKind":"windowsOnboardingRedirect"}],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["当前为 Windows 系统,请您暂时前往支付宝 AI 付站点完成产品开通:","{{officialUrl}}"]}}},{"messageId":"product.clarify","owner":"catalog_owned","trigger":"route.product_unclear","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["请确认您的业务场景:","","1. AI 按量付费:买家通过 Agent 使用支付宝完成支付,适用于 API、MCP、算力资源等按调用付费。","2. AI 网页应用收款:买家在电脑网页或手机浏览器页面使用支付宝付款。","3. AI 移动应用收款:买家在 APP 内调起支付宝完成付款。"]}}},{"messageId":"onboarding.mcc.clarify","owner":"catalog_owned","trigger":"onboarding.mcc_unclear","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]}],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["MCC 与经营类目强相关,无法仅从“{{productName}}”确定。","","请补充本次接入的经营内容,例如:","","- 电商购物(实物商品销售)","- 宠物用品","- 在线工具","- 软件开发服务","","也可以直接提供你已知的 MCC 二级类目名称或编码。"]}}},{"messageId":"onboarding.mcc.no_match","owner":"catalog_owned","trigger":"onboarding.mcc_search.none","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["当前经营描述未能匹配到 MCC 参考表中的二级类目,请调整。"]}}},{"messageId":"onboarding.mcc.candidates","owner":"catalog_owned","trigger":"onboarding.mcc_candidates.selection_required","blocking":true,"allowedReplies":[],"replyMode":"runtime_enum","variables":[{"name":"mccCandidates","type":"mccCandidates","required":true},{"name":"candidateTable","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["我找到了几个可能匹配的经营类目,请选择最接近的一项:","","{{candidateTable}}","","请回复序号、MCC 二级类目名称或编码;如果都不匹配,请补充实际销售的商品或服务类型。"]}}},{"messageId":"integration.start.confirm","owner":"catalog_owned","trigger":"integration.step2.ready","blocking":false,"allowedReplies":[],"postRenderHintType":"planAdjustment","variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"projectPath","type":"path","required":true},{"name":"projectOriginLabel","type":"enum","required":true,"values":["现有项目","本轮新建项目"]},{"name":"integrationStatus","type":"enum","required":true,"values":["TARGET_PARTIAL","OTHER_PRODUCT_ONLY","NO_PAYMENT"]},{"name":"otherProducts","type":"singleLine","required":false},{"name":"language","type":"singleLine","required":true},{"name":"framework","type":"singleLine","required":true},{"name":"nextFlow","type":"enum","required":true,"values":["integration"]}],"requiredPolicyIds":["P-PROJECT-PROTECT","P-SENSITIVE-STATE"],"variants":{"AIPAY":{"templateLines":["代码开发方案:","","| 项目 | 内容 |","|---|---|","| 目标产品 | {{productName}} |","| 项目路径 | `{{projectPath}}` |","| 项目来源 | {{projectOriginLabel}} |","| 代码开发状态 | {{integrationStatus}} |","| 检测到的其他支付产品 | {{otherProducts}} |","| 语言 / 框架 | {{language}} / {{framework}} |","","服务声明:","1. 使用本服务需遵守法律法规、自行审核测试并承担使用责任,我方不对使用效果、正确性担保。","2. 生产环境账号密码、API Keys、应用私钥等敏感信息切勿暴露给 Agent;仅沙箱环境信息可按本 Skill 的沙箱配置流程提供和使用。"]},"WEBPAY":{"templateLines":["代码开发方案:","","| 项目 | 内容 |","|---|---|","| 目标产品 | AI 网页应用收款 |","| 项目路径 | `{{projectPath}}` |","| 项目来源 | {{projectOriginLabel}} |","| 代码开发状态 | {{integrationStatus}} |","| 检测到的其他支付产品 | {{otherProducts}} |","| 语言 / 框架 | {{language}} / {{framework}} |","","服务声明:","1. 使用本服务需遵守法律法规、自行审核测试并承担使用责任,我方不对使用效果、正确性担保。","2. 生产环境账号密码、API Keys、应用私钥等敏感信息切勿暴露给 Agent;仅沙箱环境信息可按本 Skill 的沙箱配置流程提供和使用。"]},"APPPAY":{"templateLines":["代码开发方案:","","| 项目 | 内容 |","|---|---|","| 目标产品 | AI 移动应用收款 |","| 项目路径 | `{{projectPath}}` |","| 项目来源 | {{projectOriginLabel}} |","| 代码开发状态 | {{integrationStatus}} |","| 检测到的其他支付产品 | {{otherProducts}} |","| 语言 / 框架 | {{language}} / {{framework}} |","","【前置提醒】接 AI 移动应用收款需要你有自己的 APP,本轮代码开发主要覆盖商家服务端支付接口的实现,APP 还需接入支付宝客户端 SDK 后才能调起支付。你可以在当前 AI 移动应用收款服务端代码开发完毕后,对 Agent 说:“给我做个 APP /给我的 APP 接支付宝客户端 SDK /把我的 APP 客户端和接了支付宝的服务端联动起来”。","","服务声明:","1. 使用本服务需遵守法律法规、自行审核测试并承担使用责任,我方不对使用效果、正确性担保。","2. 生产环境账号密码、API Keys、应用私钥等敏感信息切勿暴露给 Agent;仅沙箱环境信息可按本 Skill 的沙箱配置流程提供和使用。"]}}},{"messageId":"onboarding.plan.confirm","owner":"catalog_owned","trigger":"onboarding.step2.ready","blocking":false,"allowedReplies":[],"postRenderHintType":"planAdjustment","variables":[{"name":"mccCode","type":"mccCode","required":true},{"name":"mccName","type":"singleLine","required":true},{"name":"mccQualification","type":"singleLine","required":true}],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"AIPAY":{"templateLines":["产品开通方案:","","| 项目 | 内容 |","|---|---|","| 产品 | AI 按量付费 |","| 产品码 | `I1080300001000160457` |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 特殊资质 | {{mccQualification}} |","| 授权范围 | `app:all,machine_pay:write,agmnt:write` |","| 材料预告 | 1、签约申请无需页面截图;2、新建或修改服务时收集服务资料;3、新建应用设置应用公钥时由用户提供 |","","你也可以选择前往支付宝 AI 付站点完成产品开通:","https://aipay.alipay.com/?from=alipay-aipay-skill","","暂不支持企业账号通过 Skill 完成产品开通,企业账号如需开通请前往支付宝商家平台(https://b.alipay.com/page/portal/home)"]},"WEBPAY":{"templateLines":["产品开通方案:","","| 项目 | 内容 |","|---|---|","| 产品 | AI 网页应用收款 |","| 产品码 | `I1080300001000041203` |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 特殊资质 | {{mccQualification}} |","| 授权范围 | `app:all,fast_instant_trade_pay:write` |","| 材料预告 | 1、未签约时收集首页、商品页、支付页 3 张截图;支付页是展示支付宝付款方式,等待用户去支付的页面;2、新建应用设置应用公钥时由用户提供 |","","你也可以选择前往支付宝 AI 付站点完成产品开通:","https://aipay.alipay.com/?from=alipay-aipay-skill","","暂不支持企业账号通过 Skill 完成产品开通,企业账号如需开通请前往支付宝商家平台(https://b.alipay.com/page/portal/home)"]},"APPPAY":{"templateLines":["产品开通方案:","","| 项目 | 内容 |","|---|---|","| 产品 | AI 移动应用收款 |","| 产品码 | `I1080300001000041313` |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 特殊资质 | {{mccQualification}} |","| 授权范围 | `app:all,auth_alipay_apppay:write` |","| 材料预告 | 1、未签约时收集 APP 名称和首页、商品页、支付页 3 张截图;支付页是展示支付宝付款方式,等待用户去支付的页面;2、新建应用支持 iOS、Android 或 ALL(二者同时);3、新建应用设置应用公钥时由用户提供 |","| 特别提醒 | 鸿蒙系统移动应用暂不支持通过 Skill 创建,请前往支付宝开放平台-控制台手动创建:https://open.alipay.com/ |","","你也可以选择前往支付宝 AI 付站点完成产品开通:","https://aipay.alipay.com/?from=alipay-aipay-skill","","暂不支持企业账号通过 Skill 完成产品开通,企业账号如需开通请前往支付宝商家平台(https://b.alipay.com/page/portal/home)"]}}},{"messageId":"auth.page","owner":"catalog_owned","trigger":"AUTH_FLOW:READY_TO_OPEN","blocking":false,"allowedReplies":[],"postRenderHintType":"scanReturn","expiresWithPrompt":true,"variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"deviceCode","type":"singleLine","required":true},{"name":"mccCode","type":"mccCode","required":true},{"name":"mccName","type":"singleLine","required":true},{"name":"verificationCode","type":"singleLine","required":true},{"name":"expiresDisplay","type":"singleLine","required":true},{"name":"officialUrl","type":"officialTemporaryUrl","required":true,"urlKind":"authorization"}],"requiredPolicyIds":["P-AUTH-URL","P-AUTH-URL-AUTO-OPEN"],"variants":{"READY":{"templateLines":["接下来会自动打开支付宝扫码授权页面,请在页面中扫码完成授权。","","| 授权信息 | 内容 |","|---|---|","| 产品类型 | {{productName}} |","| 经营类目 | {{mccName}} (`{{mccCode}}`) |","| 确认码 | {{verificationCode}} |","| 授权链接有效期 | {{expiresDisplay}} |","","安全提示:支付宝扫码后,请核对授权页面显示的确认码是否与上方一致;如不一致,请勿授权并立即停止操作。确认码只用于核对,不需要输入。","","如果自动跳转失败,请复制下方链接到网页浏览器打开。","授权链接:","{{officialUrl}}"]}}},{"messageId":"auth.open.manual","owner":"catalog_owned","trigger":"AUTH_OPEN:OPEN_FAILED|GUI_UNAVAILABLE|LINK_ONLY","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-AUTH-URL-AUTO-OPEN"],"variants":{"DEFAULT":{"templateLines":["未能自动打开支付宝授权页面,请手动打开上一条消息中的授权链接并完成扫码。我会继续检查授权结果,无需回复。"]}}},{"messageId":"application.key.page","owner":"catalog_owned","trigger":"application.key_page.ready","blocking":false,"allowedReplies":[],"postRenderHintType":"scanReturn","expiresWithPrompt":true,"variables":[{"name":"appId","type":"singleLine","required":true},{"name":"officialUrl","type":"officialTemporaryUrl","required":true,"urlKind":"publicKeyConfirmation"}],"requiredPolicyIds":["P-KEY-URL","P-KEY-URL-AUTO-OPEN"],"variants":{"READY":{"templateLines":["接下来会自动打开应用 `{{appId}}` 的公钥确认页面,请打开支付宝扫码确认应用公钥。","","如果自动跳转失败,请复制下方链接到网页浏览器打开。","公钥确认链接:","{{officialUrl}}"]}}},{"messageId":"application.key.pending","owner":"catalog_owned","trigger":"FLOW:KEY_NOT_CONFIRMED","blocking":true,"allowedReplySet":"affirmative","inputHintType":"publicKeyConfirmationComplete","variables":[],"requiredPolicyIds":["P-KEY-PUBLIC-USER"],"variants":{"DEFAULT":{"templateLines":["应用公钥尚未确认,请先完成公钥设置确认。"]}}},{"messageId":"onboarding.discovery.summary","owner":"catalog_owned","trigger":"onboarding.discovery.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"signingStatus","type":"enum","required":true,"values":["未签约","已提交待生效","已生效","其他状态待核验","查询失败"]},{"name":"serviceStatus","type":"enum","required":false,"values":["无已有服务","已有服务候选","查询失败"]},{"name":"applicationStatus","type":"enum","required":true,"values":["无同类型应用","有上线应用可复用","仅有未上线应用","查询失败"]}],"requiredPolicyIds":["P-PARTIAL-RESULT","P-MATERIAL-CATEGORY"],"variants":{"AIPAY":{"templateLines":["当前查询结果:","","| 流程 | 当前状态 |","|---|---|","| 产品签约 | {{signingStatus}} |","| 服务市场 | {{serviceStatus}} |","| 应用发布 | {{applicationStatus}} |"]},"WEBPAY":{"templateLines":["当前查询结果:","","| 流程 | 当前状态 |","|---|---|","| 产品签约 | {{signingStatus}} |","| 服务市场 | 无需处理 |","| 应用发布 | {{applicationStatus}} |"]},"APPPAY":{"templateLines":["当前查询结果:","","| 流程 | 当前状态 |","|---|---|","| 产品签约 | {{signingStatus}} |","| 服务市场 | 无需处理 |","| 应用发布 | {{applicationStatus}} |"]}}},{"messageId":"materials.category.collect","owner":"catalog_owned","trigger":"materials.category.ready","blocking":true,"allowedReplies":[],"replyMode":"freeform","expiresWithPrompt":true,"variables":[{"name":"categoryName","type":"enum","required":true,"values":["签约材料","服务资料","应用资料"]},{"name":"currentStatus","type":"enum","required":true,"values":["待补充","部分已提供,待补充","校验失败,需更正"]},{"name":"missingFields","type":"enumList","required":true,"values":["APP名称","首页截图","商品页截图","支付页截图","服务名称","服务描述","服务地址","服务单价","请求示例JSON","应用平台和对应资料","iOS Bundle ID(bundleId)","Android 应用包名(appPackage)","Android 应用签名摘要(appSign)","应用公钥"]},{"name":"paymentPageHint","type":"string","derived":true,"values":["支付页说明:支付页是展示支付宝付款方式,等待用户去支付的页面,不是支付成功页。"]},{"name":"serviceUrlHint","type":"string","derived":true,"values":["请提供有效的 URL 地址(以 http:// 或 https:// 开头)"]},{"name":"servicePricingHint","type":"string","derived":true,"values":["请提供不低于 0.01 元的有效服务单价,可输入 0.03、0.03元或 0.03 元/次。"]},{"name":"keyToolManual","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-MATERIAL-CATEGORY"],"variants":{"INITIAL":{"templateLines":["当前收集类别:{{categoryName}}","","请在一条回复中提供:{{missingFields}}。","{{paymentPageHint}}"]},"APP_WEB_INITIAL":{"templateLines":["当前收集类别:应用资料","","请在一条回复中提供应用公钥;请勿提供应用私钥。无需另行回复 `新建`。","","填写示例(请替换为实际内容):","```text","应用公钥:<你自行生成的完整应用公钥>","```","需要支付宝开放平台密钥工具时,可从官方地址下载:","{{keyToolManual}}","",""]},"APP_MOBILE_INITIAL":{"templateLines":["当前收集类别:应用资料","","请在一条回复中选择平台并提供以下材料:","","- iOS:`IOS`、iOS Bundle ID(bundleId)、应用公钥。","- Android:`ANDROID`、Android 应用包名(appPackage)、Android 应用签名摘要(appSign,不是应用公钥)、应用公钥。","- iOS + Android:`ALL`、`bundleId`、`appPackage`、`appSign`、应用公钥。","","填写示例(请替换为实际内容):","```text","ANDROID","Android 应用包名(appPackage):com.example.app","Android 应用签名摘要(appSign):<你的 Android 应用签名摘要>","应用公钥:<你自行生成的完整应用公钥>","```","","请勿提供应用私钥。无需另行回复 `新建`。","","需要支付宝开放平台密钥工具时,可从官方地址下载:","{{keyToolManual}}","","鸿蒙系统移动应用暂不支持通过 Skill 创建,请前往支付宝开放平台-控制台手动创建:https://open.alipay.com/"]},"PARTIAL":{"templateLines":["当前收集类别:{{categoryName}}","","还需补充:{{missingFields}}。","{{paymentPageHint}}","已校验字段无需重复提供。"]},"INVALID":{"templateLines":["当前收集类别:{{categoryName}}","","以下内容需要更正:{{missingFields}}。","{{serviceUrlHint}}","{{servicePricingHint}}","{{paymentPageHint}}","已校验字段无需重复提供。"]},"SERVICE_INITIAL":{"templateLines":["当前收集类别:服务资料","","请在一条回复中提供:服务名称、服务描述、服务地址、服务单价、请求示例JSON。","","填写示例(请替换为实际内容):","```text","服务名称:天气查询","服务描述:按城市查询天气","服务地址:以 http:// 或 https:// 开头的实际服务地址","服务单价:0.08 元/次","请求示例 JSON:{\"city\":\"杭州\"}","```"]}}},{"messageId":"service.create.summary","owner":"catalog_owned","trigger":"service.create.ready","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceName","type":"singleLine","required":true},{"name":"serviceDescription","type":"singleLine","required":true},{"name":"serviceUrl","type":"runtimeUrl","required":true},{"name":"servicePricing","type":"singleLine","required":true},{"name":"serviceSchema","type":"string","required":true}],"requiredPolicyIds":["P-SERVICE-WRITE","P-WRITE-UNKNOWN"],"variants":{"DEFAULT":{"templateLines":["将创建以下 AI 按量付费服务:","","服务名称:{{serviceName}}","服务描述:{{serviceDescription}}","服务地址:`{{serviceUrl}}`","服务单价:{{servicePricing}} 元/次","请求示例 JSON:","```json","{{serviceSchema}}","```"]}}},{"messageId":"onboarding.write.confirm","owner":"catalog_owned","trigger":"external_write.ready","blocking":true,"allowedReplySet":"affirmative","inputHintType":"confirm","expiresWithPrompt":true,"variables":[{"name":"sessionSummary","type":"singleLine","required":true},{"name":"subjectSummary","type":"singleLine","required":true},{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"actionTypes","type":"enumList","required":true,"values":["服务修改"]},{"name":"serviceId","type":"singleLine","required":false},{"name":"serviceName","type":"singleLine","required":false},{"name":"serviceDescription","type":"singleLine","required":false},{"name":"serviceUrl","type":"runtimeUrl","required":false},{"name":"servicePricing","type":"singleLine","required":false},{"name":"serviceSchema","type":"string","required":false}],"requiredPolicyIds":["P-SERVICE-WRITE","P-WRITE-UNKNOWN"],"variants":{"SERVICE_UPDATE_ONLY":{"templateLines":["请确认以下支付宝操作:","","- 当前会话:{{sessionSummary}}","- 操作主体:{{subjectSummary}}","- 产品:AI 按量付费","- 动作:服务修改","","服务ID:`{{serviceId}}`","服务名称:{{serviceName}}","服务描述:{{serviceDescription}}","服务地址:`{{serviceUrl}}`","服务单价:{{servicePricing}} 元/次","请求示例 JSON:","```json","{{serviceSchema}}","```","","本次只执行上述服务修改;签约、应用创建、公钥设置和应用提审不包含在本确认中。"]}}},{"messageId":"process.partial_result","owner":"catalog_owned","trigger":"process.current_endpoint","blocking":false,"allowedReplies":[],"variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"processResultTitle","type":"enum","required":true,"values":["支付产品-产品开通已完成","流程进展"]},{"name":"integrationResult","type":"enum","required":true,"values":["不在本轮执行范围","已完成","部分完成,沙箱配置待完成","部分完成,人工待验证","未完成","结果未知"]},{"name":"sandboxConfigState","type":"enum","required":false,"values":["READY","CREATE_PENDING","VERIFY_PENDING"]},{"name":"signingResult","type":"enum","required":true,"values":["未签约","已提交,等待生效","已生效","失败","结果未知"]},{"name":"serviceResult","type":"enum","required":true,"values":["无需处理","已复用","创建成功,状态未取得","修改成功,状态未取得","已完成","失败","结果未知"]},{"name":"applicationResult","type":"enum","required":true,"values":["待选择","已创建,待设置公钥","公钥待确认","HarmonyOS 应用待平台侧创建、配置或上线","已提交审核,等待上线","已上线且配置完整","需人工配置","失败","结果未知"]},{"name":"remainingActions","type":"singleLine","required":true},{"name":"manualVerificationItems","type":"singleLine","required":false},{"name":"applicationOperationAppId","type":"singleLine","required":false},{"name":"applicationOperationActualStatus","type":"singleLine","required":false},{"name":"applicationOperationNextAction","type":"singleLine","required":false},{"name":"applicationOperationAppKeySavePath","type":"singleLine","required":false},{"name":"applicationManualConfigurationNextAction","type":"string","required":false,"derived":true,"values":["前往支付宝 AI 付站点,进入一站式接入 → 密钥配置,按当前 appId 获取对应的支付宝公钥,并手动配置到项目:https://aipay.alipay.com/?from=alipay-aipay-skill"]},{"name":"applicationOperationBlock","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"manualVerificationLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"productionReadinessBlock","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"statusQueryHint","type":"enum","required":false,"derived":true,"values":["。这期间,你也可以试着对 Agent 说:“帮我查询产品签约状态”或“帮我查询应用状态”。"]},{"name":"sandboxRecoveryHint","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"nextFlowReminderLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"nextFlowReminder","type":"enum","required":true,"values":["还需完成支付产品-代码开发,才能在业务系统中实际发起支付。","代码开发已在本轮执行;后续只按上表实际待办继续。"]}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["{{processResultTitle}}:","","| 分支 | 实际结果 |","|---|---|","| 产品 | {{productName}} |","| 代码开发 | {{integrationResult}} |","| 产品开通 | {{signingResult}} |","| 服务市场 | {{serviceResult}} |","| 应用发布 | {{applicationResult}} |","","本轮流程仍需处理:{{remainingActions}}{{statusQueryHint}}","{{manualVerificationLine}}","{{sandboxRecoveryHint}}","{{applicationOperationBlock}}","","{{productionReadinessBlock}}","","{{nextFlowReminderLine}}"]}}},{"messageId":"key_tool.download.result","owner":"catalog_owned","trigger":"key_tool.download.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"downloadPath","type":"existingPath","required":true}],"requiredPolicyIds":["P-KEY-TOOL-DOWNLOAD"],"fallbackMessageId":"key_tool.download.fallback","variants":{"DOWNLOADED":{"templateLines":["支付宝开放平台密钥工具已下载到:`{{downloadPath}}`。","","请打开该安装包并按页面引导完成安装;Agent 不会自动安装、启动工具或生成密钥。生成后只向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。",""]}}},{"messageId":"key_tool.download.fallback","owner":"catalog_owned","trigger":"key_tool.download.fallback","blocking":false,"allowedReplies":[],"variables":[{"name":"keyToolManual","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-KEY-TOOL-DOWNLOAD"],"variants":{"DEFAULT":{"templateLines":["未能完成自动下载,可能是当前环境不支持、无法访问下载源、本地目录不可写或安装包校验未通过。请访问支付宝开放平台手动下载支付宝开放平台密钥工具:","","{{keyToolManual}}","","仅向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。"]}}},{"messageId":"sandbox.windows.manual_setup","owner":"catalog_owned","trigger":"integration.sandbox.windows.manual_setup","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION","P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["当前 Windows 环境暂不支持自动创建快速沙箱,请前往支付宝 AI 付站点-选择产品-一站式接入-技术集成页面获取沙箱配置:https://aipay.alipay.com/?from=alipay-aipay-skill","","请把沙箱应用的 APPID、支付宝公钥、应用公钥、与当前开发语言(JAVA语言/非JAVA语言)匹配的应用私钥、沙箱账号信息告诉我,我会帮你完成项目配置,并继续进行支付产品代码开发。","","生产环境应用私钥和密码切勿暴露给 Agent。"]}}},{"messageId":"sandbox.environment.summary","owner":"catalog_owned","trigger":"integration.sandbox.persisted","blocking":false,"allowedReplies":[],"variables":[{"name":"productName","type":"enum","required":true,"values":["AI 按量付费","AI 网页应用收款","AI 移动应用收款"]},{"name":"configPath","type":"existingPath","required":true},{"name":"environmentRows","type":"sandboxTableRows","required":true}],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION","P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["沙箱环境摘要","","| 项目 | 信息 |","|---|---|","| 产品 | {{productName}} |","| 配置文件目录 | `{{configPath}}` |","{{environmentRows}}","| 密钥字段 | 已写入本地配置文件,默认不在对话中展开 |"]}}},{"messageId":"sandbox.configuration.pending","owner":"catalog_owned","trigger":"integration.sandbox.pending","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"CREATE":{"templateLines":["快速沙箱暂未创建成功,当前沙箱配置尚未完成。","","本轮将继续代码开发。代码开发完成后,请对 Agent 说:“重新创建并配置沙箱”。"]},"VERIFY":{"templateLines":["快速沙箱配置复核未通过,当前沙箱配置尚未完成。","","本轮将继续代码开发。代码开发完成后,请对 Agent 说:“重新创建并配置沙箱”。"]}}},{"messageId":"sandbox.create.failure","owner":"catalog_owned","trigger":"integration.sandbox.failed","blocking":false,"allowedReplies":[],"variables":[{"name":"failureReason","type":"singleLine","required":true},{"name":"recoveryAction","type":"singleLine","required":true}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"WINDOWS":{"templateLines":["Windows 沙箱本地配置未准备完成:{{failureReason}}","","恢复动作:{{recoveryAction}}","","字段缺失、来源不明或本地保护未完成时不能继续,也不能把当前配置表述为可用。"]}}},{"messageId":"sandbox.environment.reminder","owner":"catalog_owned","trigger":"integration.sandbox.persisted.reminder","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-A2M-SANDBOX","P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["快速沙箱环境配置已准备完成,仅用于测试,不涉及真实资金。","","完整配置已写入上述本地文件。"]},"WINDOWS":{"templateLines":["Windows 沙箱本地配置已准备完成,仅用于测试,不涉及真实资金。","","配置已保存至上述本机路径。"]}}},{"messageId":"a2m.test.start","owner":"catalog_owned","trigger":"integration.a2m.test.start","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-A2M-SANDBOX","P-A2M-SUCCESS"],"variants":{"DEFAULT":{"templateLines":["开始执行 AI 按量付费沙箱服务端联调。","","我将连续验证 `402 Payment-Needed`、沙箱收银、`Payment-Proof` 重试和资源交付,完成后输出实际结论;这里不需要额外确认。"]}}},{"messageId":"a2m.test.result","owner":"catalog_owned","trigger":"integration.a2m.test.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"evidenceSummary","type":"singleLine","required":true},{"name":"recoveryAction","type":"singleLine","required":false}],"requiredPolicyIds":["P-A2M-SUCCESS","P-SENSITIVE-STATE"],"variants":{"PASSED":{"templateLines":["AI 按量付费沙箱服务端联调通过。","","通过证据:{{evidenceSummary}}"]},"FAILED":{"templateLines":["AI 按量付费沙箱服务端联调未通过。","","实际证据:{{evidenceSummary}}","","恢复动作:{{recoveryAction}}"]}}},{"messageId":"a2m.payment.experience","owner":"catalog_owned","trigger":"integration.a2m.optional_payment_experience","blocking":false,"allowedReplies":[],"variables":[{"name":"paymentUrl","type":"runtimeUrl","required":true},{"name":"buyerAccount","type":"singleLine","required":true},{"name":"buyerLoginPassword","type":"sandboxCredential","required":true},{"name":"buyerPayPassword","type":"sandboxCredential","required":true}],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION"],"variants":{"FULL":{"templateLines":["可选:体验 AI 按量付费沙箱付款","","付款链接(复制到网页浏览器打开):{{paymentUrl}}","沙箱买家账号:{{buyerAccount}}","登录密码:{{buyerLoginPassword}}","支付密码:{{buyerPayPassword}}"]}}},{"messageId":"webpay.sandbox.experience","owner":"catalog_owned","trigger":"integration.webpay.sandbox_experience","blocking":false,"allowedReplies":[],"variables":[{"name":"startCommand","type":"command","required":true},{"name":"paymentUrl","type":"runtimeUrl","required":true},{"name":"buyerAccount","type":"singleLine","required":true},{"name":"buyerLoginPassword","type":"sandboxCredential","required":true},{"name":"buyerPayPassword","type":"sandboxCredential","required":true},{"name":"resultPageInstruction","type":"enum","required":true,"values":["付款后确认浏览器自动返回商户结果页,页面可正常展示并通过服务端查询呈现订单状态。","付款后不会自动返回商户网站;请手动返回商户订单查询页并刷新或查询订单状态。"]}],"requiredPolicyIds":["P-SANDBOX-CREDENTIAL-EXCEPTION"],"variants":{"DEFAULT":{"templateLines":["AI 网页应用收款沙箱付款指引","","1. 启动服务:`{{startCommand}}`","2. 在浏览器打开:{{paymentUrl}}","3. 在沙箱收银台二选一:使用沙箱买家账号登录,或仅在 Android 沙箱支付宝中扫描收银台页面二维码。","4. 沙箱买家账号:{{buyerAccount}}","5. 登录密码:{{buyerLoginPassword}}","6. 支付密码:{{buyerPayPassword}}","7. {{resultPageInstruction}}","","沙箱测试环境不稳定,可能出现跳转到支付宝收银台页面后报错,如:504 Gateway Time-out;输入完测试买家账号后展示系统繁忙;输入完测试买家支付密码后展示系统繁忙。您可以回到支付页重新发起支付以完成沙箱测试。","","前台页面和同步回跳参数不是支付成功依据,最终以验签通过的异步通知或交易查询为准。用户暂不付款只记为待体验,不得表述为沙箱测试通过。"]}}},{"messageId":"sandbox.android.client","owner":"catalog_owned","trigger":"integration.sandbox_android_client","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["沙箱支付宝当前仅支持 Android。请复制以下支付宝官方地址到网页浏览器打开,并扫描屏幕二维码下载沙箱版支付宝安装包:","","https://mdn.alipayobjects.com/sandboxsys/afts/img/_itHRrdOD9oAAAAAAAAAAAAADgSLAQBr/original","","如果直链或页面二维码无法打开,请前往支付宝开放平台-沙箱工具页下载:","","https://open.alipay.com/develop/sandbox/tool"]}}},{"messageId":"webpay.sandbox.experience.windows","owner":"catalog_owned","trigger":"integration.webpay.sandbox_experience.windows","blocking":false,"allowedReplies":[],"variables":[{"name":"startCommand","type":"command","required":true},{"name":"paymentUrl","type":"runtimeUrl","required":true},{"name":"resultPageInstruction","type":"enum","required":true,"values":["付款后确认浏览器自动返回商户结果页,页面可正常展示并通过服务端查询呈现订单状态。","付款后不会自动返回商户网站;请手动返回商户订单查询页并刷新或查询订单状态。"]}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["AI 网页应用收款沙箱付款指引","","1. 启动服务:`{{startCommand}}`","2. 在浏览器打开:{{paymentUrl}}","3. 在沙箱收银台使用支付宝开放平台控制台中的沙箱买家账号登录,或仅在 Android 沙箱支付宝中扫描收银台页面二维码。","4. 登录密码和支付密码请直接从本机保存的信息或支付宝开放平台控制台取得,无需再次提供给 Agent。","5. {{resultPageInstruction}}","","沙箱测试环境不稳定,可能出现跳转到支付宝收银台页面后报错,如:504 Gateway Time-out;输入完测试买家账号后展示系统繁忙;输入完测试买家支付密码后展示系统繁忙。您可以回到支付页重新发起支付以完成沙箱测试。","","前台页面和同步回跳参数不是支付成功依据,最终以验签通过的异步通知或交易查询为准。用户暂不付款只记为待体验,不得表述为沙箱测试通过。"]}}},{"messageId":"integration.safety.closeout","owner":"catalog_owned","trigger":"integration.step7.safety","blocking":false,"allowedReplies":[],"variables":[{"name":"acceptanceSummary","type":"singleLine","required":true}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"AIPAY":{"templateLines":["代码开发安全与上线提醒","","- 上线前必须完成人工代码审查;私钥只保存在商家服务端,禁止写入客户端、日志或公共仓库。Java 使用 `PKCS#8` 私钥,非 Java 使用 `PKCS#1` 私钥,格式不匹配时只用支付宝官方密钥工具转换。","- `Payment-Proof` 必须调用 `alipay.aipay.agent.payment.verify` 验证;无效或过期凭证拒绝服务,结果不明时不得要求用户重复付款。","- 资源交付后必须调用 `alipay.aipay.agent.fulfillment.confirm`;履约确认失败必须可重试且保持幂等。","- 沙箱配置仅用于开发调试;正式上线前必须替换为同一套生产 `appId`、应用公钥、应用私钥和支付宝公钥,并将 `api_mock_service_id` 替换为真实 `serviceId`。`serviceId` 获取方式:支付宝扫码登录支付宝 AI 付站点 → 控制台 → 服务管理 → 复制审核已通过的服务 ID:https://aipay.alipay.com/?from=alipay-aipay-skill","- 收款商户 PID/2088 用于 AI 按量付费 `seller_id` 和 `seller_unique_id`,不由 Agent 猜测。获取方式:支付宝扫码登录支付宝商家平台 → 点击头像 → 复制账户名下方 2088 开头的商家 ID:https://b.alipay.com/page/portal/home","- 生产环境必须严格校验本地订单、金额与资源关系;正式收款必须完成 `Payment-Proof` 验付和异步履约回执确认。","","当前验收口径:{{acceptanceSummary}}"]},"WEBPAY":{"templateLines":["代码开发安全与上线提醒","","- 上线前必须完成人工代码审查;私钥只保存在商家服务端,禁止写入客户端、日志或公共仓库。Java 使用 `PKCS#8` 私钥,非 Java 使用 `PKCS#1` 私钥,格式不匹配时只用支付宝官方密钥工具转换。","- 同步回跳和前台结果不作为支付成功依据;必须以验签通过的异步通知或交易查询为准。","- 正式上线前必须替换为同一套生产 `appId`、应用公钥、应用私钥和支付宝公钥。","- AI 网页应用收款生产上线必须配置并联调公网 HTTPS `notify_url`;异步通知必须验签、校验关键字段、幂等处理并返回 `success`,同时配置交易查询补偿。若当前仅完成本地生产参数验收,该项仍需在上线前补齐;localhost、局域网地址或其他不可公网访问的地址不能用于生产异步通知。支付结果不明时不得要求用户重复付款。","","当前验收口径:{{acceptanceSummary}}"]},"APPPAY":{"templateLines":["代码开发安全与上线提醒","","- 上线前必须完成人工代码审查;私钥只保存在商家服务端,禁止写入 APP 客户端、日志或公共仓库。Java 使用 `PKCS#8` 私钥,非 Java 使用 `PKCS#1` 私钥,格式不匹配时只用支付宝官方密钥工具转换。","- 客户端支付结果不作为成功依据;必须以验签通过的异步通知或服务端交易查询为准。","- 正式上线前必须替换为同一套生产 `appId`、应用公钥、应用私钥和支付宝公钥。","- AI 移动应用收款生产上线必须配置并联调公网 HTTPS `notify_url`;异步通知必须验签、校验关键字段、幂等处理并返回 `success`,同时配置交易查询补偿。若当前仅完成本地生产参数验收,该项仍需在上线前补齐;localhost、局域网地址或其他不可公网访问的地址不能用于生产异步通知。支付结果不明时不得要求用户重复付款。","- 本轮代码开发只覆盖商家服务端;APP 客户端仍需接入支付宝客户端 SDK,使用服务端返回的 `orderStr` 调起支付,并与服务端异步通知或交易查询完成联调。","","当前验收口径:{{acceptanceSummary}}"]}}},{"messageId":"integration.checklist.result","owner":"catalog_owned","trigger":"integration.checklist.finished","blocking":false,"allowedReplies":[],"variables":[{"name":"overallResult","type":"enum","required":true,"values":["通过","部分通过","未通过"]},{"name":"failedItems","type":"singleLine","required":true},{"name":"manualItems","type":"singleLine","required":true},{"name":"sandboxResult","type":"enum","required":false,"values":["AI 按量付费沙箱服务端联调通过","AI 按量付费沙箱服务端联调未通过"]},{"name":"webpayExperienceResult","type":"enum","required":false,"values":["已提供浏览器付款入口和操作指引,实际付款及结果验证仍以用户完成情况为准","未提供浏览器付款入口或完整操作指引,需先补齐","已提供浏览器付款入口和操作指引;用户已完成一笔沙箱付款,结果只按实际核验证据记录"]},{"name":"sandboxConfigState","type":"enum","required":true,"values":["READY","CREATE_PENDING","VERIFY_PENDING"]},{"name":"blockingDefectState","type":"enum","required":true,"values":["NONE","PRESENT"]},{"name":"executionMode","type":"enum","required":true,"values":["仅代码开发","完整接入"]},{"name":"nextFlowReminder","type":"enum","required":true,"values":["正式上线前还需完成支付产品-产品开通。","代码开发校验通过后将自动进入支付产品-产品开通;未通过时停留在代码开发。","沙箱配置尚未完成,但不阻塞本轮继续支付产品-产品开通;完成配置后再进行沙箱测试。","代码开发自动校验已完成,仍有人工待验证项;本轮继续产品开通。"]}],"requiredPolicyIds":[],"variants":{"AIPAY_PASSED":{"templateLines":["AI 按量付费代码开发校验通过。","","{{nextFlowReminder}}"]},"AIPAY_INCOMPLETE":{"templateLines":["AI 按量付费代码开发校验:{{overallResult}}。","","未完成项:{{failedItems}}","人工待验证:{{manualItems}}","","{{nextFlowReminder}}"]},"WEBPAY_PASSED":{"templateLines":["AI 网页应用收款代码开发校验通过。","","{{nextFlowReminder}}"]},"WEBPAY_INCOMPLETE":{"templateLines":["AI 网页应用收款代码开发校验:{{overallResult}}。","","未完成项:{{failedItems}}","人工待验证:{{manualItems}}","","{{nextFlowReminder}}"]},"APPPAY_PASSED":{"maintenanceTodo":"TODO: 后续确定 AI 移动应用收款沙箱测试的对客引导动作后,在本变体补充;同步 integration flow、checklist 和测试。","templateLines":["AI 移动应用收款代码开发校验通过。","","{{nextFlowReminder}}"]},"APPPAY_INCOMPLETE":{"maintenanceTodo":"TODO: 后续确定 AI 移动应用收款沙箱测试的对客引导动作后,在本变体补充;同步 integration flow、checklist 和测试。","templateLines":["AI 移动应用收款代码开发校验:{{overallResult}}。","","未完成项:{{failedItems}}","人工待验证:{{manualItems}}","","{{nextFlowReminder}}"]}}},{"messageId":"auth.pending","owner":"catalog_owned","trigger":"AUTH_FLOW:PENDING","blocking":true,"allowedReplySet":"affirmative","inputHintType":"authorizationComplete","variables":[],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"DEFAULT":{"templateLines":["支付宝授权尚未完成,当前流程保持等待,请在已打开的网页二维码页面完成扫码确认后,再回复当前授权提示。"]}}},{"messageId":"auth.expired","owner":"catalog_owned","trigger":"AUTH_FLOW:EXPIRED","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"DEFAULT":{"templateLines":["本次支付宝授权链接已过期,旧链接和旧回复均已失效。正在重新生成授权链接,请使用新的授权页面完成授权。"]}}},{"messageId":"auth.mismatch","owner":"catalog_owned","trigger":"AUTH_FLOW:SCOPE_MISMATCH|MCC_MISMATCH","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING"],"variants":{"DEFAULT":{"templateLines":["当前授权范围或经营类目不匹配,需要退出当前登录并重新生成授权页面。"]}}},{"messageId":"error.mcp.auth","owner":"catalog_owned","trigger":"error.mcp_auth","blocking":false,"allowedReplies":[],"variables":[{"name":"errorMessage","type":"customerErrorText","required":false}],"requiredPolicyIds":["P-AUTH-BEFORE-ONBOARDING","P-SENSITIVE-STATE"],"variants":{"START":{"templateLines":["🔐 未登录或授权已过期","","当前登录状态已失效,无法继续操作。MCP 调用返回认证错误,正在退出当前登录。"]},"LOGOUT_UNCONFIRMED":{"templateLines":["无法确认退出当前登录结果,已停止重新授权。","","这通常表示当前 Agent 执行环境缺少联网权限、CLI wrapper 混入输出,或 stdout/stderr 无法唯一解析;不代表用户本机 logout 失败,也不能据此判断支付宝业务失败。","","Agent 应申请可联网权限后重试同一动作;不要要求用户手动 logout 代替本轮事实。"]},"LOGOUT_FAILED":{"templateLines":["退出当前登录失败,已停止重新授权。","错误信息:{{errorMessage}}","","请先重试退出登录;确认退出成功后再重新授权。"]},"LOGOUT_SUCCESS":{"templateLines":["已退出登录状态。","","请重新执行登录授权流程:生成授权链接后,使用支付宝扫码授权,授权成功后继续当前操作。","","产品、MCC 和授权范围未变化时,沿用已有确认立即重新生成授权链接;发生变化时先重新确认受影响内容。"]}}},{"messageId":"error.mcp.service","owner":"catalog_owned","trigger":"error.mcp_service","blocking":false,"allowedReplies":[],"variables":[{"name":"errorDetail","type":"customerErrorText","required":false}],"requiredPolicyIds":["P-PARTIAL-RESULT","P-SENSITIVE-STATE"],"variants":{"AGENT_NETWORK":{"templateLines":["MCP 服务暂时不可用。","","当前命令需要访问支付宝服务,但当前 Agent 执行环境可能没有外网权限。Agent 应申请可联网权限后重试同一条命令,不要要求用户排查本机网络,也不要更换业务参数。","","请授权 Agent 联网重试,或稍后重新执行当前命令。"]},"GENERIC":{"templateLines":["MCP 服务暂时不可用。","","无法连接到支付宝服务,请稍后重试。","错误详情:{{errorDetail}}","","当前动作已停止重试;由主流程记录受影响分支,并在不受其依赖的情况下继续其他分支。本轮收口时将一次说明未恢复的动作、受影响分支和后续恢复方式。"]}}},{"messageId":"error.backend","owner":"catalog_owned","trigger":"error.backend_business","blocking":false,"allowedReplies":[],"variables":[{"name":"errorCode","type":"customerErrorText","required":true},{"name":"errorMessage","type":"customerErrorText","required":true},{"name":"errorScene","type":"customerErrorText","required":false},{"name":"errorSpecific","type":"customerErrorText","required":false},{"name":"checkedErrors","type":"customerErrorDetails","required":false},{"name":"bizTips","type":"customerErrorText","required":false},{"name":"appMax","type":"enum","required":true,"values":["YES","NO"]},{"name":"errorSceneLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"checkedErrorsBlock","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"bizTipsLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"appMaxLine","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["业务处理失败。","","错误码:{{errorCode}}","错误信息:{{errorMessage}}","{{errorSceneLine}}","","{{checkedErrorsBlock}}","","{{bizTipsLine}}","","{{appMaxLine}}","","当前业务错误不会自动重试;请先按以上错误信息修正受影响分支的业务条件。","如需帮助,请联系技术支持并提供以上脱敏错误信息。"]}}},{"messageId":"error.service.unstable","owner":"catalog_owned","trigger":"error.service_unstable","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["MCP 服务暂时不稳定。","","当前动作已停止重试;由主流程记录受影响分支,并在不受其依赖的情况下继续其他分支。","本轮收口时将一次说明未恢复的动作、受影响分支和后续恢复方式。"]}}},{"messageId":"error.cli","owner":"catalog_owned","trigger":"error.cli_output","blocking":false,"allowedReplies":[],"variables":[{"name":"errorMessage","type":"customerErrorText","required":true},{"name":"bizTips","type":"customerErrorText","required":false},{"name":"checkedErrors","type":"customerErrorDetails","required":false},{"name":"bizTipsLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"checkedErrorsBlock","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-SENSITIVE-STATE"],"variants":{"DEFAULT":{"templateLines":["命令执行失败:{{errorMessage}}","{{bizTipsLine}}","{{checkedErrorsBlock}}"]}}},{"messageId":"integration.service.not_ready","owner":"catalog_owned","trigger":"integration.a2m.service_not_ready","blocking":false,"allowedReplies":[],"variables":[{"name":"recoveryAction","type":"singleLine","required":true}],"requiredPolicyIds":["P-A2M-SUCCESS"],"variants":{"DEFAULT":{"templateLines":["AI 按量付费本地服务尚未达到自动联调前置条件。","","需要处理:{{recoveryAction}}","","该条件未满足前不会运行自动联调,也不会把服务标记为可用。"]}}},{"messageId":"integration.project_path.required","owner":"catalog_owned","trigger":"integration.project_path.unresolved","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["现有项目及文件保持不变。请在一条回复中说明新项目要放在哪里;可以说“在当前目录新建 pay-demo”、提供当前目录下的新子目录名,或提供电脑上的完整路径。若不想指定位置,可以说“新建项目”或“帮我新建默认项目”,我会在用户目录下选择安全的新目录并告知项目地址。路径解析和确认完成前不会创建或修改文件。"]}}},{"messageId":"integration.context.required","owner":"catalog_owned","trigger":"integration.context.unresolved","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"missingItems","type":"enumList","required":true,"values":["项目路径","技术栈"]}],"requiredPolicyIds":["P-PROJECT-PROTECT"],"variants":{"DEFAULT":{"templateLines":["为继续代码开发,请先确定:{{missingItems}}。","","- 要新建项目:可以说“在当前目录新建 pay-demo”,或提供一个新的文件夹位置;不想指定位置时,可以说“新建项目”或“帮我新建默认项目”。","- 要复用已有项目:请告诉我项目文件夹;如果不知道在哪,可以说“帮我在当前目录下找项目”;如果大概知道在哪,可以说“帮我在 server 下找项目”。我会先定位候选目录,再让你选择。","- “当前项目/当前目录”只有在当前目录本身就是可识别项目根时才会使用;否则不会扫描整个大目录。","- 技术栈:例如 Node.js + Express、Java + Spring Boot、Python + Flask、PHP + Laravel、C# + ASP.NET;不确定时可以说“请推荐默认技术栈”。","","项目和技术栈明确前,不会创建或修改文件。"]},"PROJECT_PATH_ONLY":{"templateLines":["为继续代码开发,请先确定:{{missingItems}}。","","- 要新建项目:可以说“在当前目录新建 pay-demo”,或提供一个新的文件夹位置;不想指定位置时,可以说“新建项目”或“帮我新建默认项目”。","- 要复用已有项目:请告诉我项目文件夹;如果不知道在哪,可以说“帮我在当前目录下找项目”;如果大概知道在哪,可以说“帮我在 server 下找项目”。我会先定位候选目录,再让你选择。","- “当前项目/当前目录”只有在当前目录本身就是可识别项目根时才会使用;否则不会扫描整个大目录。","","项目路径明确前,不会创建或修改文件。"]}}},{"messageId":"integration.project_candidates.select","owner":"catalog_owned","trigger":"integration.project_candidates.located","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"searchBasePath","type":"existingPath","required":true},{"name":"candidateRows","type":"string","required":true}],"requiredPolicyIds":["P-PROJECT-PROTECT"],"variants":{"DEFAULT":{"templateLines":["我先在 `{{searchBasePath}}` 下做了轻量项目定位;这里只看项目标记文件,不扫描代码内容。","","{{candidateRows}}","","如果要复用已有项目,请回复候选序号或具体项目文件夹。","如果要新建项目,可以回复“在当前目录新建 pay-demo”,或直接回复“新建项目”使用用户目录下的默认安全目录。","","选定具体项目目录前,不会扫描整个大目录,也不会创建或修改文件。"]}}},{"messageId":"integration.local_acceptance.notice","owner":"catalog_owned","trigger":"integration.local_acceptance.enabled","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["当前使用本地生产参数验收模式:本轮可以暂不发起公网异步通知,但生产上线前必须恢复并验证 `notify_url`。这不是生产最终配置,也不能据此宣称生产就绪。"]}}},{"messageId":"application.reuse.no_key","owner":"catalog_owned","trigger":"FLOW:REUSE_NO_KEY","blocking":false,"allowedReplies":[],"variables":[{"name":"appId","type":"singleLine","required":true},{"name":"keyToolManual","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-KEY-PUBLIC-USER"],"variants":{"DEFAULT":{"templateLines":["应用 `{{appId}}` 当前为可复用的上线应用,但尚未确认 RSA2 应用公钥,应用分支仍未完成。","","接下来需要为该应用设置应用公钥;如果你已经准备好应用公钥,请直接提供。","","本次不会自动下载支付宝开放平台密钥工具。如需我下载请直接说明,或访问官方地址手动下载:{{keyToolManual}}","只向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。","","如果不想继续复用这个应用,请说明要重新选择或新建应用。"]}}},{"messageId":"application.candidates.facts","owner":"catalog_owned","trigger":"application.candidates.queried","blocking":false,"allowedReplies":[],"variables":[{"name":"applicationType","type":"enum","required":true,"values":["WEBAPP","MOBILEAPP"]},{"name":"applicationCandidates","type":"applicationCandidates","required":true},{"name":"candidateTable","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"keyToolManual","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-PARTIAL-RESULT","P-KEY-TOOL-DOWNLOAD"],"variants":{"EMPTY":{"templateLines":["📋 暂无 {{applicationType}} 应用。","","支付宝开放平台密钥工具可用于生成应用公私钥对。无论是否需要自动下载,都可以访问官方地址:","{{keyToolManual}}","","只向 Agent 提供【应用公钥】,请勿提供应用私钥。"]},"PENDING_ONLY":{"templateLines":["📋 当前已有以下尚未上线的 {{applicationType}} 应用:","","{{candidateTable}}","","以上应用当前不可复用。"]},"ONLINE_WITH_OPTIONAL_PENDING":{"templateLines":["📋 发现您已有以下上线 {{applicationType}} 应用:","","{{candidateTable}}"]}}},{"messageId":"application.candidate.invalid","owner":"catalog_owned","trigger":"application.candidates.selection_invalid","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["上一次回复未匹配当前应用候选或支持的选择格式。已重新展示当前候选,请按下方方式重新选择。","序号、非上线、历史或候选外 `appId` 均不会触发应用操作。"]}}},{"messageId":"application.candidate.select","owner":"catalog_owned","trigger":"application.candidates.selection_required","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[{"name":"keyToolManual","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":[],"variants":{"ONLINE_WEB_OR_NEW":{"templateLines":["请选择应用分支下一步:","","- 回复上方事实表中状态为“已上线”的完整 `appId`:复用对应应用。","- 新建应用:在同一条回复中提供 `新建` 和应用公钥,材料完整后将创建应用、设置公钥并进入公钥确认。","","新建回复示例(请替换为实际内容):","```text","新建","应用公钥:<你自行生成的完整应用公钥>","```","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:{{keyToolManual}}","只向 Agent 提供【应用公钥】,请勿提供应用私钥。","","候选、状态或目标变化后旧回复自动失效;不接受序号、历史候选或其他 `appId`。"]},"PENDING_WEB_OR_NEW":{"templateLines":["当前同类型应用均未上线,不能复用。","","- 新建应用:在同一条回复中提供 `新建` 和应用公钥,材料完整后将创建应用、设置公钥并进入公钥确认。","- 回复 `暂不新建`:本轮应用分支保持待办。","","新建回复示例(请替换为实际内容):","```text","新建","应用公钥:<你自行生成的完整应用公钥>","```","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:{{keyToolManual}}","只向 Agent 提供【应用公钥】,请勿提供应用私钥。"]},"ONLINE_MOBILE_OR_NEW":{"templateLines":["请选择应用分支下一步:","","- 回复上方事实表中状态为“已上线”的完整 `appId`:复用对应应用。","- 新建 `IOS`:回复 `新建 IOS`、iOS Bundle ID(`bundleId`)和应用公钥。","- 新建 `ANDROID`:回复 `新建 ANDROID`、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","- 新建 `ALL`:回复 `新建 ALL`、iOS Bundle ID(`bundleId`)、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:{{keyToolManual}}","只向 Agent 提供【应用公钥】,请勿提供应用私钥。","","候选、状态或目标变化后旧回复自动失效;不接受序号、历史候选或其他 `appId`。"]},"PENDING_MOBILE_OR_NEW":{"templateLines":["当前同类型应用均未上线,不能复用。","","- 新建 `IOS`:回复 `新建 IOS`、iOS Bundle ID(`bundleId`)和应用公钥。","- 新建 `ANDROID`:回复 `新建 ANDROID`、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","- 新建 `ALL`:回复 `新建 ALL`、iOS Bundle ID(`bundleId`)、Android 应用包名(`appPackage`)、Android 应用签名摘要(`appSign`)和应用公钥。","- 回复 `暂不新建`:本轮应用分支保持待办。","","支付宝开放平台密钥工具可用于生成应用公私钥对;本分支不会自动下载。如需我下载请直接说明,或访问:{{keyToolManual}}","只向 Agent 提供【应用公钥】,请勿提供应用私钥。"]}}},{"messageId":"application.operation.result","owner":"catalog_owned","trigger":"application.operation.completed","blocking":false,"allowedReplies":[],"variables":[{"name":"appId","type":"singleLine","required":true},{"name":"actualStatus","type":"singleLine","required":true},{"name":"nextAction","type":"singleLine","required":false},{"name":"appKeySavePath","type":"singleLine","required":false},{"name":"appKeySaveLine","type":"string","required":false,"derived":true,"values":["renderer"]},{"name":"manualConfigurationNextAction","type":"string","required":false,"derived":true,"values":["前往支付宝 AI 付站点,进入一站式接入 → 密钥配置,按当前 appId 获取对应的支付宝公钥,并手动配置到项目:https://aipay.alipay.com/?from=alipay-aipay-skill"]}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["应用 `{{appId}}` 的实际状态:{{actualStatus}}。","{{appKeySaveLine}}","","下一步:{{nextAction}}","","待审核、待设置公钥或待人工配置时不会表述为应用发布完成。"]},"ALIPAY_PUBLIC_KEY_MANUAL_CONFIGURATION":{"templateLines":["应用 `{{appId}}` 的实际状态:需人工配置。","","下一步:{{manualConfigurationNextAction}}","","待人工配置时不会表述为应用发布完成。"]}}},{"messageId":"application.harmony.manual_create","owner":"catalog_owned","trigger":"application.harmony.manual_create","blocking":true,"allowedReplySet":"affirmative","inputHintType":"complete","variables":[],"requiredPolicyIds":["P-MCP-CONTRACT-FROZEN"],"variants":{"DEFAULT":{"templateLines":["当前 Skill 不支持创建 HarmonyOS 移动应用。","","请前往支付宝开放平台,进入“控制台” → “创建移动应用”,完成平台要求的创建、配置和审核:https://open.alipay.com/","","完成后将重新查询移动应用列表。"]}}},{"messageId":"service.operation.result","owner":"catalog_owned","trigger":"service.operation.completed","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceId","type":"singleLine","required":true},{"name":"actualResult","type":"singleLine","required":true}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["服务市场实际结果:{{actualResult}}。","已确认的 `serviceId`:`{{serviceId}}`。","","查看服务状态和服务详情:请前往支付宝 AI 付站点,登录后进入控制台 → 服务管理。","https://aipay.alipay.com/?from=alipay-aipay-skill","","该结果只代表服务分支,不会覆盖签约或应用分支的实际状态。"]}}},{"messageId":"signing.operation.result","owner":"catalog_owned","trigger":"signing.operation.completed","blocking":false,"allowedReplies":[],"variables":[{"name":"actualStatus","type":"singleLine","required":true},{"name":"feeDisplay","type":"singleLine","required":false},{"name":"nextAction","type":"singleLine","required":true}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"WITHOUT_FEE":{"templateLines":["产品当前签约状态:{{actualStatus}}。","","下一步:{{nextAction}}"]},"WITH_FEE":{"templateLines":["产品当前签约状态:{{actualStatus}}。","费率:{{feeDisplay}}","","下一步:{{nextAction}}"]}}},{"messageId":"service.candidates.facts","owner":"catalog_owned","trigger":"service.candidates.queried","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceCandidates","type":"serviceCandidates","required":true},{"name":"candidateTable","type":"string","required":false,"derived":true,"values":["renderer"]}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"EMPTY":{"templateLines":["📋 暂无已有服务。"]},"DEFAULT":{"templateLines":["📋 发现您已有以下服务:","","{{candidateTable}}"]}}},{"messageId":"service.candidate.invalid","owner":"catalog_owned","trigger":"service.candidates.selection_invalid","blocking":false,"allowedReplies":[],"variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["上一次回复没有匹配到有效的服务操作。","仅回复序号,或提供不在当前事实表中的 `serviceId`,均不会触发服务操作。"]}}},{"messageId":"service.candidate.select","owner":"catalog_owned","trigger":"service.candidates.selection_required","blocking":true,"allowedReplies":[],"replyMode":"freeform","variables":[],"requiredPolicyIds":[],"variants":{"DEFAULT":{"templateLines":["请选择下一步:","","- 回复上方事实表中的完整 `serviceId`:复用对应服务。","- 新建服务:回复 `新建`,并在同一条回复中提供服务名称、服务描述、服务地址、服务单价、请求示例 JSON。","- 回复 `修改:<serviceId>`:修改对应服务。","","- 如果只回复 `新建` 或材料不完整,我会再提示补充缺失项。","","新建回复示例(请替换为实际内容):","```text","新建","服务名称:天气查询","服务描述:按城市查询天气","服务地址:以 http:// 或 https:// 开头的实际服务地址","服务单价:0.08 元/次","请求示例 JSON:{\"city\":\"杭州\"}","```","","如需核对服务状态或服务详情,可前往支付宝 AI 付站点,登录后进入控制台 → 服务管理查看。","https://aipay.alipay.com/?from=alipay-aipay-skill"]}}},{"messageId":"service.id.missing","owner":"catalog_owned","trigger":"service.save.id_missing","blocking":false,"allowedReplies":[],"variables":[{"name":"serviceName","type":"singleLine","required":true}],"requiredPolicyIds":["P-PARTIAL-RESULT"],"variants":{"DEFAULT":{"templateLines":["服务 `{{serviceName}}` 的创建或修改调用已返回成功,但未解析到 `serviceId`,因此服务分支尚未完成。接下来会重新查询完整服务列表,并使用本次实际提交资料与列表可见字段做唯一匹配;没有唯一结果时保持未知。在取得实际 `serviceId` 前不会宣称 AI 按量付费产品开通完成。","","如需自行核对服务状态或服务详情,可前往支付宝 AI 付站点,登录后进入控制台 → 服务管理查看。","https://aipay.alipay.com/?from=alipay-aipay-skill"]}}}]}
@@ -51,6 +51,22 @@ function loadJson(file) {
51
51
  return JSON.parse(fs.readFileSync(file, 'utf8'));
52
52
  }
53
53
 
54
+ function keyToolManualUrl(policy) {
55
+ const value = policy.officialUrls?.keyToolManual;
56
+ let parsed;
57
+ try {
58
+ parsed = new URL(value);
59
+ } catch {
60
+ throw new Error('policy-rules.json 缺少合法 officialUrls.keyToolManual');
61
+ }
62
+ if (parsed.protocol !== 'https:' || parsed.hostname !== 'opendocs.alipay.com'
63
+ || parsed.pathname !== '/isv/02kipk' || parsed.search || parsed.hash
64
+ || parsed.username || parsed.password || parsed.port) {
65
+ throw new Error('policy-rules.json officialUrls.keyToolManual 不符合固定官方地址约束');
66
+ }
67
+ return value;
68
+ }
69
+
54
70
  function allowedRepliesFor(catalog, message) {
55
71
  if (!message.allowedReplySet) return message.allowedReplies || [];
56
72
  const replies = catalog.interactionReplySets?.[message.allowedReplySet];
@@ -910,6 +926,12 @@ export function validateCatalog() {
910
926
  const messages = new Map();
911
927
  const policyIds = new Set(policy.rules.map((rule) => rule.policyId));
912
928
  const officialUrls = new Set(Object.values(policy.officialUrls));
929
+ let manualKeyToolUrl = '';
930
+ try {
931
+ manualKeyToolUrl = keyToolManualUrl(policy);
932
+ } catch (error) {
933
+ errors.push(error.message);
934
+ }
913
935
 
914
936
  const inputHints = catalog.interactionPrompts || {};
915
937
  if (typeof inputHints.confirmInputHint !== 'string' || !inputHints.confirmInputHint) {
@@ -997,6 +1019,9 @@ export function validateCatalog() {
997
1019
  for (const match of template.matchAll(/https:\/\/[^\s)`),。;:]+/g)) {
998
1020
  if (!officialUrls.has(match[0])) errors.push(`${message.messageId}/${variantName}: 静态 URL 未登记 ${match[0]}`);
999
1021
  }
1022
+ if (manualKeyToolUrl && template.includes(manualKeyToolUrl)) {
1023
+ errors.push(`${message.messageId}/${variantName}: 密钥工具手动地址必须使用 {{keyToolManual}},禁止在消息模板内复制 URL`);
1024
+ }
1000
1025
  if (/<INTERNAL_/i.test(template)) errors.push(`${message.messageId}/${variantName}: 模板包含内部标签`);
1001
1026
  if (message.blocking && allowedReplies.length > 0 && /(?:回复|输入)\s*`?1`?/.test(template)) {
1002
1027
  errors.push(`${message.messageId}/${variantName}: 阻塞输入提示必须由 renderer 统一追加`);
@@ -1050,6 +1075,7 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1050
1075
  if (messageId === 'application.candidates.facts') {
1051
1076
  normalized.candidateTable = applicationCandidateTable(variantName, variables.applicationCandidates);
1052
1077
  }
1078
+ if (definitions.has('keyToolManual')) normalized.keyToolManual = keyToolManualUrl(policy);
1053
1079
  if (messageId === 'service.candidates.facts') {
1054
1080
  normalized.candidateTable = serviceCandidateTable(variantName, variables.serviceCandidates);
1055
1081
  }
@@ -23,6 +23,7 @@ const terminalForegroundUploadMaxAttempts = 2;
23
23
  const terminalForegroundUploadRetryDelayMs = 300;
24
24
  const terminalBackgroundRetryDelayMs = 1000;
25
25
  const permissionedForegroundFlushLimit = 5;
26
+ const localWriteMaxAttempts = 2;
26
27
  const terminalCountArgNames = Object.freeze([
27
28
  'user-input-count-total',
28
29
  'user-input-count-after-flow-start',
@@ -141,6 +142,28 @@ const messageStageRules = {
141
142
  'process.partial_result': 'onboarding.closeout.start'
142
143
  };
143
144
 
145
+ const outboxRecordFields = new Set(['schema_ver', 'created_at', 'event']);
146
+ const metricEventFields = new Set([
147
+ 'schema_ver',
148
+ 'event_id',
149
+ 'skill',
150
+ 'skill_version',
151
+ 'run_id',
152
+ 'stage',
153
+ 'timestamp',
154
+ 'flow',
155
+ 'product_type',
156
+ 'root_intent',
157
+ 'ext_info'
158
+ ]);
159
+ const terminalExtInfoFields = new Set([
160
+ 'user_input_count_total',
161
+ 'user_input_count_after_flow_start',
162
+ 'flow_start_observed',
163
+ 'root_intent',
164
+ 'terminal_reason'
165
+ ]);
166
+
144
167
  function safeText(value) {
145
168
  return typeof value === 'string' && /^[A-Za-z0-9_.:-]+$/.test(value) ? value : '';
146
169
  }
@@ -252,10 +275,11 @@ function ensurePrivateDir(dir) {
252
275
  } catch {}
253
276
  }
254
277
 
255
- function writePrivateJson(file, value) {
278
+ function writePrivateJsonOnce(file, value) {
279
+ let tempPath = '';
256
280
  try {
257
281
  ensurePrivateDir(path.dirname(file));
258
- const tempPath = path.join(path.dirname(file), `.${path.basename(file)}.${process.pid}.tmp`);
282
+ tempPath = path.join(path.dirname(file), `.${path.basename(file)}.${process.pid}.tmp`);
259
283
  fs.writeFileSync(tempPath, `${JSON.stringify(value)}\n`, { mode: 0o600 });
260
284
  try {
261
285
  fs.chmodSync(tempPath, 0o600);
@@ -263,10 +287,20 @@ function writePrivateJson(file, value) {
263
287
  fs.renameSync(tempPath, file);
264
288
  return true;
265
289
  } catch {
290
+ try {
291
+ if (tempPath && fs.existsSync(tempPath)) fs.unlinkSync(tempPath);
292
+ } catch {}
266
293
  return false;
267
294
  }
268
295
  }
269
296
 
297
+ function writePrivateJson(file, value) {
298
+ for (let attempt = 0; attempt < localWriteMaxAttempts; attempt += 1) {
299
+ if (writePrivateJsonOnce(file, value)) return true;
300
+ }
301
+ return false;
302
+ }
303
+
270
304
  function readRunState(env = process.env) {
271
305
  try {
272
306
  const statePath = runStatePath(env);
@@ -314,6 +348,14 @@ function writeRunState(state, env = process.env) {
314
348
  return writePrivateJson(runStatePath(env), state);
315
349
  }
316
350
 
351
+ function persistRunState(state, env = process.env) {
352
+ const persisted = writeRunState(state, env);
353
+ if (!persisted && telemetryEnabled(env)) {
354
+ recordLocalTelemetryFailure('LOCAL_RUN_STATE_WRITE_FAILED', 'failed to write local telemetry run state', env);
355
+ }
356
+ return persisted;
357
+ }
358
+
317
359
  function outboxFilename(event) {
318
360
  const timestamp = Number.isFinite(Number(event?.timestamp)) ? String(Number(event.timestamp)) : String(Date.now());
319
361
  const eventID = safeText(event?.event_id) || crypto.randomUUID();
@@ -592,27 +634,68 @@ export function messageMetricEvent(messageId, variantName, variables = {}, conte
592
634
  return stageEvent;
593
635
  }
594
636
 
595
- export function emitMetricEvent(event, { env = process.env, stream = process.stderr, upload = true } = {}) {
596
- if (!telemetryEnabled(env) || !event) return false;
597
- if (stream && typeof stream.write === 'function') {
598
- stream.write(`${internalPrefix}METRIC_EVENT=${JSON.stringify(event)}\n`);
599
- }
600
- if (upload) {
601
- if (telemetryCaptureOnly(env)) {
602
- enqueueMetricEvent(event, env);
637
+ function scheduleQueuedSyncLogUpload(event, queuedFile, env = process.env) {
638
+ if (!queuedFile || !telemetryUploadEnabled(env)) return false;
639
+ if (event?.stage === 'run.terminal') {
640
+ if (foregroundFlushTerminalOutboxFile(queuedFile, env)) {
641
+ if (outboxFiles(env).length > 0) {
642
+ spawnOutboxFlush(env, { delayMs: terminalBackgroundRetryDelayMs });
643
+ }
603
644
  } else {
604
- scheduleSyncLogUpload(event, env);
645
+ spawnOutboxFlush(env, { delayMs: terminalBackgroundRetryDelayMs });
646
+ emitPermissionedFlushNeededMarkers(env);
605
647
  }
648
+ return true;
606
649
  }
650
+ spawnOutboxFlush(env);
607
651
  return true;
608
652
  }
609
653
 
610
- export function emitStageMetric(stage, context = {}, env = process.env) {
611
- try {
612
- return emitMetricEvent(stageMetricEvent(stage, context, Date.now(), env), { env });
613
- } catch {
654
+ function writeMetricEventMarker(event, stream) {
655
+ if (stream && typeof stream.write === 'function') {
656
+ stream.write(`${internalPrefix}METRIC_EVENT=${JSON.stringify(event)}\n`);
657
+ }
658
+ }
659
+
660
+ export function emitMetricEvent(event, { env = process.env, stream = process.stderr, upload = true } = {}) {
661
+ if (!telemetryEnabled(env) || !event) return false;
662
+ writeMetricEventMarker(event, stream);
663
+ if (!upload) return true;
664
+ if (telemetryCaptureOnly(env)) {
665
+ if (writeOutboxRecord(event, env)) return true;
666
+ recordLocalTelemetryFailure('LOCAL_OUTBOX_WRITE_FAILED', 'outbox write failed', env);
614
667
  return false;
615
668
  }
669
+ if (!telemetryUploadEnabled(env)) return true;
670
+ const queuedFile = writeOutboxRecord(event, env);
671
+ if (!queuedFile) {
672
+ recordLocalTelemetryFailure('LOCAL_OUTBOX_WRITE_FAILED', 'outbox write failed', env);
673
+ return false;
674
+ }
675
+ scheduleQueuedSyncLogUpload(event, queuedFile, env);
676
+ return true;
677
+ }
678
+
679
+ function emitTerminalMetricEvent(event, { env = process.env, stream = null } = {}) {
680
+ if (!event || event.stage !== 'run.terminal') return false;
681
+ if (!telemetryEnabled(env)) return updateExistingRunStateFromTerminalEvent(event, env);
682
+ writeMetricEventMarker(event, stream);
683
+
684
+ let queuedFile = '';
685
+ const requiresOutbox = telemetryCaptureOnly(env) || telemetryUploadEnabled(env);
686
+ if (requiresOutbox) {
687
+ queuedFile = writeOutboxRecord(event, env);
688
+ if (!queuedFile) {
689
+ recordLocalTelemetryFailure('LOCAL_OUTBOX_WRITE_FAILED', 'outbox write failed', env);
690
+ return false;
691
+ }
692
+ }
693
+
694
+ const statePersisted = updateExistingRunStateFromTerminalEvent(event, env);
695
+ if (queuedFile && telemetryUploadEnabled(env)) {
696
+ scheduleQueuedSyncLogUpload(event, queuedFile, env);
697
+ }
698
+ return statePersisted;
616
699
  }
617
700
 
618
701
  export function emitStageMetricAsync(stage, context = {}, env = process.env) {
@@ -654,19 +737,19 @@ export function emitStageMetricAsync(stage, context = {}, env = process.env) {
654
737
  export function emitMessageMetric(messageId, variantName, variables = {}, context = {}) {
655
738
  try {
656
739
  const event = messageMetricEvent(messageId, variantName, variables, context);
657
- if (event?.stage === 'run.terminal') updateExistingRunStateFromTerminalEvent(event);
740
+ if (event?.stage === 'run.terminal') {
741
+ return emitTerminalMetricEvent(event, { stream: null });
742
+ }
658
743
  return emitMetricEvent(event, { stream: null });
659
744
  } catch {
660
745
  return false;
661
746
  }
662
747
  }
663
748
 
664
- export function emitTerminalMetric(context = {}) {
749
+ export function emitTerminalMetric(context = {}, env = process.env) {
665
750
  try {
666
- const event = stageMetricEvent('run.terminal', context);
667
- if (!event) return false;
668
- updateExistingRunStateFromTerminalEvent(event);
669
- return emitMetricEvent(event, { stream: null });
751
+ const event = stageMetricEvent('run.terminal', context, Date.now(), env);
752
+ return emitTerminalMetricEvent(event, { env, stream: null });
670
753
  } catch {
671
754
  return false;
672
755
  }
@@ -898,8 +981,7 @@ export function markTelemetryFlowStart(env = process.env, nowMs = Date.now(), pr
898
981
  : existing.product_type,
899
982
  updated_at: nowMs
900
983
  }, nowMs);
901
- writeRunState(next, env);
902
- return next.user_input_counts;
984
+ return persistRunState(next, env) ? next.user_input_counts : null;
903
985
  }
904
986
 
905
987
  export function recordTelemetryUserInput(phase, env = process.env, nowMs = Date.now(), inputId = '') {
@@ -927,8 +1009,7 @@ export function recordTelemetryUserInput(phase, env = process.env, nowMs = Date.
927
1009
  user_input_counts: nextCounts,
928
1010
  updated_at: nowMs
929
1011
  };
930
- writeRunState(next, env);
931
- return nextCounts;
1012
+ return persistRunState(next, env) ? nextCounts : null;
932
1013
  }
933
1014
 
934
1015
  export function recordTelemetryUserInputForCurrentPhase(inputId, env = process.env, nowMs = Date.now()) {
@@ -942,13 +1023,13 @@ export function recordTelemetryUserInputForCurrentPhase(inputId, env = process.e
942
1023
  function updateExistingRunStateFromTerminalEvent(event, env = process.env) {
943
1024
  if (event?.stage !== 'run.terminal') return false;
944
1025
  const existing = readRunState(env);
945
- if (!existing) return false;
946
- if (existing.run_id !== event.run_id) return false;
1026
+ if (!existing) return true;
1027
+ if (existing.run_id !== event.run_id) return true;
947
1028
  if (!runStateCompatibleWithEventContext(existing, {
948
1029
  rootIntent: event.root_intent,
949
1030
  productType: event.product_type
950
- })) return false;
951
- writeRunState({
1031
+ })) return true;
1032
+ return persistRunState({
952
1033
  ...existing,
953
1034
  schema_ver: 1,
954
1035
  run_id: event.run_id,
@@ -961,7 +1042,6 @@ function updateExistingRunStateFromTerminalEvent(event, env = process.env) {
961
1042
  terminal: true,
962
1043
  terminal_at: Number.isFinite(Number(event.timestamp)) ? Number(event.timestamp) : Date.now()
963
1044
  }, env);
964
- return true;
965
1045
  }
966
1046
 
967
1047
  function normalizeOS(platform = process.platform) {
@@ -1098,9 +1178,65 @@ function monitorEnv(env = process.env, skillVersion = skillVersionFromDisk()) {
1098
1178
  return 'DEV';
1099
1179
  }
1100
1180
 
1181
+ function hasOnlyFields(value, allowedFields) {
1182
+ return value && typeof value === 'object' && !Array.isArray(value)
1183
+ && Object.keys(value).every((field) => allowedFields.has(field));
1184
+ }
1185
+
1186
+ function normalizeMetricEvent(event) {
1187
+ if (!hasOnlyFields(event, metricEventFields)) return null;
1188
+ if (event.schema_ver !== 2 || event.skill !== 'alipay-aipay') return null;
1189
+ const eventId = safeText(event.event_id);
1190
+ if (!eventId || eventId.length > 128) return null;
1191
+ const skillVersion = normalizeSkillVersion(event.skill_version);
1192
+ if (!skillVersion && event.skill_version !== 'unknown') return null;
1193
+ const runId = safeRunId(event.run_id);
1194
+ if (!runId || runId !== event.run_id) return null;
1195
+ const stageRule = stageRules.get(event.stage);
1196
+ if (!stageRule || event.flow !== stageRule.flow) return null;
1197
+ if (!Number.isSafeInteger(event.timestamp) || event.timestamp <= 0) return null;
1198
+ const productType = canonicalProductType(event.product_type);
1199
+ if (!productType || productType !== event.product_type) return null;
1200
+ const rootIntent = event.root_intent;
1201
+ if (rootIntent !== undefined && !allowedRootIntents.has(rootIntent)) return null;
1202
+
1203
+ const normalized = {
1204
+ schema_ver: 2,
1205
+ event_id: eventId,
1206
+ skill: 'alipay-aipay',
1207
+ skill_version: skillVersion || 'unknown',
1208
+ run_id: runId,
1209
+ stage: event.stage,
1210
+ timestamp: event.timestamp,
1211
+ flow: event.flow,
1212
+ product_type: productType
1213
+ };
1214
+ if (rootIntent !== undefined) normalized.root_intent = rootIntent;
1215
+
1216
+ if (Object.prototype.hasOwnProperty.call(event, 'ext_info')) {
1217
+ if (event.stage !== 'run.terminal' || typeof event.ext_info !== 'string') return null;
1218
+ let parsedExtInfo;
1219
+ try {
1220
+ parsedExtInfo = JSON.parse(event.ext_info);
1221
+ } catch {
1222
+ return null;
1223
+ }
1224
+ if (!hasOnlyFields(parsedExtInfo, terminalExtInfoFields)) return null;
1225
+ if (rootIntent && parsedExtInfo.root_intent && parsedExtInfo.root_intent !== rootIntent) return null;
1226
+ const extInfo = terminalExtInfoFromPayload({
1227
+ ...parsedExtInfo,
1228
+ rootIntent: rootIntent || parsedExtInfo.root_intent
1229
+ }, {});
1230
+ if (!extInfo) return null;
1231
+ normalized.ext_info = extInfo;
1232
+ }
1233
+ return normalized;
1234
+ }
1235
+
1101
1236
  export function buildSyncLogReport(event, env = process.env) {
1102
- if (!event) return null;
1103
- const skillVersion = skillVersionFromEvent(event);
1237
+ const normalizedEvent = normalizeMetricEvent(event);
1238
+ if (!normalizedEvent) return null;
1239
+ const skillVersion = skillVersionFromEvent(normalizedEvent);
1104
1240
  const item = {
1105
1241
  code: syncLogCode,
1106
1242
  msg: syncLogMsg,
@@ -1108,12 +1244,12 @@ export function buildSyncLogReport(event, env = process.env) {
1108
1244
  d2: platformFromEnv(env),
1109
1245
  d3: modelFromEnv(env),
1110
1246
  d4: skillVersion,
1111
- d5: event.product_type || 'UNKNOWN',
1112
- c1: event.run_id,
1113
- c2: event.stage,
1114
- c3: event.timestamp
1247
+ d5: normalizedEvent.product_type || 'UNKNOWN',
1248
+ c1: normalizedEvent.run_id,
1249
+ c2: normalizedEvent.stage,
1250
+ c3: normalizedEvent.timestamp
1115
1251
  };
1116
- const terminalExtInfo = terminalExtInfoFromEvent(event);
1252
+ const terminalExtInfo = terminalExtInfoFromEvent(normalizedEvent);
1117
1253
  if (terminalExtInfo) item.c4 = terminalExtInfo;
1118
1254
  return {
1119
1255
  item,
@@ -1258,11 +1394,6 @@ export function sendSyncLogReportDetailed(report, { timeoutMs = uploadTimeoutMs
1258
1394
  });
1259
1395
  }
1260
1396
 
1261
- export async function sendSyncLogReport(report, { timeoutMs = uploadTimeoutMs } = {}) {
1262
- const result = await sendSyncLogReportDetailed(report, { timeoutMs });
1263
- return result.ok;
1264
- }
1265
-
1266
1397
  function outboxFiles(env = process.env, { targetFile = '', limit = 0 } = {}) {
1267
1398
  try {
1268
1399
  const dir = outboxDir(env);
@@ -1378,15 +1509,30 @@ function outboxTargetFilePending(file) {
1378
1509
  function readOutboxRecord(file) {
1379
1510
  try {
1380
1511
  const record = JSON.parse(fs.readFileSync(file, 'utf8'));
1381
- if (!record || record.schema_ver !== 1) return null;
1382
- if (record.report?.item && record.report?.options) return record;
1383
- if (record.event?.run_id && record.event?.stage && Number.isFinite(Number(record.event?.timestamp))) return record;
1384
- return null;
1512
+ if (!hasOnlyFields(record, outboxRecordFields) || record.schema_ver !== 1) return null;
1513
+ if (!Number.isSafeInteger(record.created_at) || record.created_at <= 0) return null;
1514
+ const event = normalizeMetricEvent(record.event);
1515
+ if (!event) return null;
1516
+ return { schema_ver: 1, created_at: record.created_at, event };
1385
1517
  } catch {
1386
1518
  return null;
1387
1519
  }
1388
1520
  }
1389
1521
 
1522
+ function hasPendingOutboxRecords(env = process.env) {
1523
+ try {
1524
+ const dir = outboxDir(env);
1525
+ recoverStaleOutboxClaims(env);
1526
+ pruneOutbox(env);
1527
+ return fs.readdirSync(dir).some((name) => {
1528
+ if (name.startsWith('.')) return false;
1529
+ return name.endsWith('.json') || name.includes('.json.sending.');
1530
+ });
1531
+ } catch {
1532
+ return true;
1533
+ }
1534
+ }
1535
+
1390
1536
  function writeUploadStatus(status, env = process.env) {
1391
1537
  return writePrivateJson(uploadStatusPath(env), { schema_ver: 1, updated_at: Date.now(), ...status });
1392
1538
  }
@@ -1460,7 +1606,7 @@ export async function flushOutbox(env = process.env, {
1460
1606
  } catch {}
1461
1607
  continue;
1462
1608
  }
1463
- const report = record.report?.item && record.report?.options ? record.report : buildSyncLogReport(record.event, env);
1609
+ const report = buildSyncLogReport(record.event, env);
1464
1610
  if (!report) {
1465
1611
  result.invalid += 1;
1466
1612
  try {
@@ -1499,7 +1645,7 @@ export async function flushOutbox(env = process.env, {
1499
1645
  result.retained += files.length - result.attempted + 1;
1500
1646
  break;
1501
1647
  }
1502
- if (result.sent > 0 && result.retained === 0) {
1648
+ if (result.sent > 0 && result.retained === 0 && !hasPendingOutboxRecords(env)) {
1503
1649
  writeUploadStatus({
1504
1650
  status: 'success',
1505
1651
  attempted: result.attempted,
@@ -1520,7 +1666,7 @@ function prioritizeTerminalOutboxFiles(files) {
1520
1666
  return files
1521
1667
  .map((file, index) => {
1522
1668
  const record = readOutboxRecord(file);
1523
- const stage = record?.event?.stage || record?.report?.item?.c2 || '';
1669
+ const stage = record?.event?.stage || '';
1524
1670
  return { file, index, terminal: stage === 'run.terminal' };
1525
1671
  })
1526
1672
  .sort((left, right) => {
@@ -1624,27 +1770,6 @@ function foregroundFlushTerminalOutboxFile(file, env = process.env) {
1624
1770
  return !outboxTargetFilePending(file);
1625
1771
  }
1626
1772
 
1627
- function scheduleSyncLogUpload(event, env = process.env) {
1628
- if (!telemetryUploadEnabled(env)) return false;
1629
- const queuedFile = writeOutboxRecord(event, env);
1630
- if (!queuedFile) {
1631
- recordLocalTelemetryFailure('LOCAL_OUTBOX_WRITE_FAILED', 'outbox write failed', env);
1632
- return false;
1633
- }
1634
- if (event?.stage === 'run.terminal') {
1635
- if (foregroundFlushTerminalOutboxFile(queuedFile, env)) {
1636
- if (outboxFiles(env).length > 0) {
1637
- spawnOutboxFlush(env, { delayMs: terminalBackgroundRetryDelayMs });
1638
- }
1639
- } else {
1640
- spawnOutboxFlush(env, { delayMs: terminalBackgroundRetryDelayMs });
1641
- emitPermissionedFlushNeededMarkers(env);
1642
- }
1643
- return true;
1644
- }
1645
- return spawnOutboxFlush(env);
1646
- }
1647
-
1648
1773
  function emitTelemetryError(error) {
1649
1774
  try {
1650
1775
  const message = safeDimension(error instanceof Error ? error.message : String(error), 'unknown', 240);
@@ -1659,10 +1784,7 @@ export async function runTelemetryCli(argv = process.argv) {
1659
1784
  if (command === 'start-run') {
1660
1785
  assertCliArgs(args, new Set(['root-intent', 'product-type', 'run-id', 'input-id']), 0);
1661
1786
  const state = createOrReuseRunState(args);
1662
- if (!writeRunState(state) && telemetryEnabled(process.env)) {
1663
- recordLocalTelemetryFailure('LOCAL_RUN_STATE_WRITE_FAILED', 'failed to write local telemetry run state');
1664
- }
1665
- if (telemetryEnabled(process.env)) {
1787
+ if (persistRunState(state)) {
1666
1788
  const event = stageMetricEvent('run.intent_detected', {
1667
1789
  runId: state.run_id,
1668
1790
  rootIntent: state.root_intent,
@@ -1770,8 +1892,11 @@ export async function runTelemetryCli(argv = process.argv) {
1770
1892
  'flow-start-observed'
1771
1893
  ]), 1);
1772
1894
  const event = stageMetricEvent(args._[0], contextFromCliArgs(args), timestampFromCliArgs(args));
1773
- if (event?.stage === 'run.terminal') updateExistingRunStateFromTerminalEvent(event);
1774
- emitMetricEvent(event);
1895
+ if (event?.stage === 'run.terminal') {
1896
+ emitTerminalMetricEvent(event, { stream: process.stderr });
1897
+ } else {
1898
+ emitMetricEvent(event);
1899
+ }
1775
1900
  return 0;
1776
1901
  } catch (error) {
1777
1902
  emitTelemetryError(error);
@@ -1,4 +1,4 @@
1
1
  - 字段白名单:stage/flow、产品、根意图、时间戳、Skill 版本、宿主/模型、匿名机器哈希、`run_id`、终态计数和终态原因枚举;禁密钥/账号密码/订单/交易号/截图/凭证/用户输入/路径/URL/响应/命令输出/堆栈原文;失败不影响业务,内部行 `ALIPAY_AIPAY_INTERNAL:`。
2
- - run:`start-run` 创建/复用 `run_id`,脚本继承 `PLATFORM_ID=<run_id>`;`root_intent + product_type` 判定复用/新建,`UNKNOWN` 补全产品仍复用同一 `run_id`;换产品/根意图/已终态/重新开始/重新走流程/作废本轮流程才新建。`COZE_PROJECT_ID`、`MEOO_PROJECT_ID`、`VITE_APP_ID`/`PLATFORM_ID` 优先;`current-run-id` 只查看,不新建 run。outbox 2xx 才删;维护/测试/Benchmark 禁上传。
2
+ - run:`start-run` 创建/复用 `run_id`,脚本继承 `PLATFORM_ID=<run_id>`;`root_intent + product_type` 判定复用/新建,`UNKNOWN` 补全产品仍复用同一 `run_id`;换产品/根意图/已终态/重新开始/重新走流程/作废本轮流程才新建。`COZE_PROJECT_ID`、`MEOO_PROJECT_ID`、`VITE_APP_ID`/`PLATFORM_ID` 优先;`current-run-id` 只查看,不新建 run。私有 JSON 原子写失败后无等待重试一次,state 落盘后才返回成功;终态先入 outbox 再标记,失败均不阻塞业务。outbox 仅接受低敏 event 和严格字段/type,拒绝 `report.item/options` 直通,2xx 后才删除;维护/测试/Benchmark 禁上传。
3
3
  - 计数:统计窗口从首次触发本 Skill 的用户消息开始,到当前 `run_id` 的 `run.terminal` 事件生成为止。只计用户在 Agent 对话框发送的消息,不计宿主权限弹窗、系统授权、网页授权、扫码、Skill stage、runner、工具调用或自动轮询;文字、图片/文件上传、空白或短确认消息、材料补充、确认回复和中途插话都按一条用户消息计,同一条消息同时包含文字和图片/文件时仍只计一条。`USER_INPUT_ID` 由 Agent 从首次触发本 Skill 的用户消息开始,在当前对话内给每条新用户消息分配单调序号,同一消息重试复用同一值;禁止包含或派生自用户输入内容、文件名、路径、截图/OCR、业务材料、stage 名或工具调用序号,运行时只保存本地 hash 且不上报。`start-run --input-id "$USER_INPUT_ID"` 自动把触发当前 run 的首条用户输入计为 `before-flow`;若中断/压缩后用新的 `USER_INPUT_ID` 重复进入同一未终态 run,`start-run` 会按当前 phase 幂等补计该用户消息。`reply confirm --reply "$USER_REPLY" --input-id "$USER_INPUT_ID"` 和 onboarding recovery 自动按当前 phase 幂等计数,禁止再为同一条回复手动执行 `count-user-input`。其他用户输入到达当前 run 后,包括用户中途打断、补充材料、只上传图片/文件或只问问题,在继续任何 Skill 动作或对该输入作业务答复前立刻执行 `telemetry count-user-input --phase before-flow|after-flow --input-id "$USER_INPUT_ID"` 写本地 run state,不联网;重复同一 `USER_INPUT_ID` 不加计。`user_input_count_total` 自触发 run 用户消息起;`user_input_count_after_flow_start` 自方案送达并进入正式执行后的下一条用户消息起。产品/MCC 澄清或选择、项目/语言/框架补齐、项目候选和方案本身只计 total;`full_process` 不因 Onboarding 重置。`flow_start_observed`=正式 flow start,由 `integration.user_confirmed|onboarding.user_confirmed` 的 flow loader 前台写入自动标记并在 state 为 `UNKNOWN` 时绑定已确认产品,但不计数;detached stage 只使用父进程固定的 `run_id/root_intent/product_type/timestamp` 投递事件,不读取后续 run 归因、不修改 run state。flow start 前拒绝 `after-flow`,用户 kill 未终态不补报。closeout 默认派生本地计数;状态为空时终态使用首条输入的最小合法计数,状态不可用且已核对时才显式传三项;runner 拒绝缺项、负数、`after > total`、已观测 flow start 但 `after >= total`。`terminal_reason` 只允许 `completed|partial_with_remaining_actions|integration_blocked|unsupported_product|unsupported_platform|enterprise_account_unsupported|unknown`,由终态 runner 依据机器事实派生,禁止自由文本原因。终态只追加计数和原因枚举,不新增确认点、stage 或独立上报。`run.terminal` 入队后以短超时前台 drain,仅当前 terminal 文件,避免流程最后的 detached worker 被宿主回收;当前 terminal 文件成功发送但仍有历史 outbox 积压时挂延迟后台补传;若文件仍在且是网络类错误,短重试一次并挂延迟后台补传,同时输出内部 `PERMISSIONED_FLUSH_NEEDED=true` 供 Agent 当场进入通用补传路径;失败保留 outbox。`c4=ext_info`,计数合法且有 `root_intent` 才写 JSON。
4
- - 补传:不为权限探测新增网络事件;实际低敏上传就是自然探测,宿主已允许访问 collector 时不额外申请权限。任一 telemetry 上传若因 DNS、连接或超时失败导致 outbox 积压,均使用同一套本地判断和补传机制。`upload-status`/`permissioned-flush-status`/`permissioned-flush-needed` 都不联网、不写请求窗口或抑制状态;只要最近错误是 `ENOTFOUND|EAI_AGAIN|ETIMEDOUT` 等 DNS/连接/超时类错误且 outbox 仍有积压,`permissioned-flush-status` 出 `PERMISSIONED_FLUSH_CANDIDATE=true`,`permissioned-flush-needed` 出唯一 `PERMISSIONED_FLUSH_NEEDED=true` 后才按需申请补传权限。`flush-outbox` 前台完成一次有界小批量补传,优先发送积压的 `run.terminal`,再处理其他 outbox;失败、非 2xx 或仍有剩余积压时继续保留 outbox,失败后仍按实时条件继续允许补传,并可挂一个延迟后台 worker 作兜底。目标限定为 POST `collect.alipay.com:443` 的 `/yuyan/` 路径。说明:`是否允许 Agent 上报 Skill 使用过程的统计信息?只含产品类别、时间、Skill 版本、匿名设备标识、人机交互次数等用于帮助改善用户体验的非敏感信息,不会采集包含源代码、用户输入内容等任何敏感信息。` collector 结果非业务条件;无 `inspect-outbox`、`--confirm-reviewed`、`alipay-cli whoami` 兜底。
4
+ - 补传:不为权限探测新增网络事件;实际低敏上传就是自然探测,宿主已允许访问 collector 时不额外申请权限。任一 telemetry 上传若因 DNS、连接或超时失败导致 outbox 积压,均使用同一套本地判断和补传机制。`upload-status`/`permissioned-flush-status`/`permissioned-flush-needed` 都不联网、不写请求窗口或抑制状态;只要最近错误是 `ENOTFOUND|EAI_AGAIN|ETIMEDOUT` 等 DNS/连接/超时类错误且 outbox 仍有积压,`permissioned-flush-status` 出 `PERMISSIONED_FLUSH_CANDIDATE=true`,`permissioned-flush-needed` 出唯一 `PERMISSIONED_FLUSH_NEEDED=true` 后才按需申请补传权限。局部成功仅在无普通 outbox 和 active claim 时写全局 `status=success`。`flush-outbox` 前台完成一次有界小批量补传,优先发送积压的 `run.terminal`,再处理其他 outbox;失败、非 2xx 或仍有剩余积压时继续保留 outbox,失败后仍按实时条件继续允许补传,并可挂一个延迟后台 worker 作兜底。目标限定为 POST `collect.alipay.com:443` 的 `/yuyan/` 路径。说明:`是否允许 Agent 上报 Skill 使用过程的统计信息?只含产品类别、时间、Skill 版本、匿名设备标识、人机交互次数等用于帮助改善用户体验的非敏感信息,不会采集包含源代码、用户输入内容等任何敏感信息。` collector 结果非业务条件;无 `inspect-outbox`、`--confirm-reviewed`、`alipay-cli whoami` 兜底。
@@ -399,7 +399,7 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" service save --service-
399
399
 
400
400
  **应用分支**:按量付费/网站支付用 `WEBAPP`,APP 支付用 `MOBILEAPP`。仅 Step 3.1 查询成功、类型合法且候选为数组时继续;其余阻断。上下文、移动字段、`appSign`、MCP 参数和返回由 `app.sh` 托管。
401
401
 
402
- 候选为空:首次等待或创建前先送达事实消息,其中固定含密钥工具用途、`https://opendocs.alipay.com/isv/02kipk` 和私钥边界;无需回复 `新建`。本会话缺公钥时依次送达 `key-tool`、材料消息;已有公钥则不下载,缺料直接补,材料齐直接重查。公钥只能由本会话用户输入证明,禁默认、占位或猜测。
402
+ 候选为空:首次等待或创建前先送达事实消息,其中固定含密钥工具用途、`https://opendocs.alipay.com/isv/02kipk` 和私钥边界;无需回复 `新建`。本会话缺公钥时依次送达 `key-tool`、材料消息;应用资料首次收集消息继续带同一官方入口,保证恢复或前序消息不可见时仍可下载。已有公钥则不下载,缺料直接补,材料齐直接重查。公钥只能由本会话用户输入证明,禁默认、占位或猜测。
403
403
 
404
404
  候选非空:有 `ON_LINE` 时接受当前完整 `appId` 或 `新建+材料`;仅非上线时另接受 `暂不新建`。候选消息含材料示例和工具地址但不自动下载;只回复 `新建` 或材料有误时保留意图并补缺项,其他输入走 Step 4 `invalid` 且不写。明确要求下载时送达 `key-tool`,再回原等待态。
405
405
 
@@ -55,7 +55,7 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message mate
55
55
  node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message material-collect --category application --state APP_MOBILE_INITIAL --product-type "$PRODUCT_TYPE"
56
56
  ```
57
57
 
58
- Skill 新建 `WEBAPP` 或 `MOBILEAPP IOS|ANDROID|ALL` 时,首次等待或创建写操作前必须展示 `https://opendocs.alipay.com/isv/02kipk`。空候选由事实消息展示,缺公钥再执行 `runtime.mjs key-tool`;非空由选择消息展示,用户要求才下载。只下载,不安装/启动/生成密钥。材料齐且重查允许才创建、设钥和提审。HarmonyOS 保持人工引导,不适用本门禁。
58
+ Skill 新建 `WEBAPP` 或 `MOBILEAPP IOS|ANDROID|ALL` 时,首次等待或创建写操作前必须展示 `https://opendocs.alipay.com/isv/02kipk`。空候选由事实消息展示,缺公钥再执行 `runtime.mjs key-tool`;应用资料首次收集消息也保留同一入口以覆盖恢复场景。非空由选择消息展示,用户要求才下载。只下载,不安装/启动/生成密钥。材料齐且重查允许才创建、设钥和提审。HarmonyOS 保持人工引导,不适用本门禁。
59
59
 
60
60
  ## 公钥边界
61
61
 
@@ -3,15 +3,32 @@
3
3
  set -u
4
4
  umask 077
5
5
 
6
- MANUAL_URL="https://opendocs.alipay.com/isv/02kipk"
7
6
  DEST_DIR="${1:-}"
8
7
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
8
  RENDERER="${SCRIPT_DIR}/../../../normal/scripts/render_customer_message.mjs"
9
+ POLICY="${SCRIPT_DIR}/../../../normal/json/policy-rules.json"
10
+ MANUAL_URL=""
11
+
12
+ if command -v node >/dev/null 2>&1 && [ -f "$POLICY" ]; then
13
+ MANUAL_URL=$(node -e '
14
+ const fs = require("node:fs");
15
+ const [file] = process.argv.slice(1);
16
+ let policy;
17
+ try { policy = JSON.parse(fs.readFileSync(file, "utf8")); } catch { process.exit(1); }
18
+ const value = policy?.officialUrls?.keyToolManual;
19
+ let parsed;
20
+ try { parsed = new URL(value); } catch { process.exit(1); }
21
+ if (parsed.protocol !== "https:" || parsed.hostname !== "opendocs.alipay.com"
22
+ || parsed.pathname !== "/isv/02kipk" || parsed.search || parsed.hash
23
+ || parsed.username || parsed.password || parsed.port) process.exit(1);
24
+ process.stdout.write(value);
25
+ ' "$POLICY" 2>/dev/null) || MANUAL_URL=""
26
+ fi
10
27
 
11
28
  manual_fallback_message() {
12
29
  echo "未能完成自动下载,可能是当前环境不支持、无法访问下载源、本地目录不可写或安装包校验未通过。请访问支付宝开放平台手动下载支付宝开放平台密钥工具:"
13
30
  echo
14
- echo "$MANUAL_URL"
31
+ [ -n "$MANUAL_URL" ] && echo "$MANUAL_URL"
15
32
  echo
16
33
  echo "仅向 Agent 提供【应用公钥】,应用私钥请自行妥善保管。"
17
34
  }