@alipay/alipay-aipay 1.8.0 → 1.8.2

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.
Files changed (72) hide show
  1. package/package.json +3 -3
  2. package/skill/VERSION +1 -1
  3. package/skill/references/integration/flow.md +21 -15
  4. package/skill/references/integration/modules/checklist.md +10 -8
  5. package/skill/references/integration/modules/code-examples/csharp/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  6. package/skill/references/integration/modules/code-examples/csharp/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  7. package/skill/references/integration/modules/code-examples/csharp/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +3 -1
  8. package/skill/references/integration/modules/code-examples/java/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  9. package/skill/references/integration/modules/code-examples/java/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  10. package/skill/references/integration/modules/code-examples/java/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemoController.md +3 -1
  11. package/skill/references/integration/modules/code-examples/nodejs/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  12. package/skill/references/integration/modules/code-examples/nodejs/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  13. package/skill/references/integration/modules/code-examples/nodejs/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +6 -2
  14. package/skill/references/integration/modules/code-examples/php/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  15. package/skill/references/integration/modules/code-examples/php/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  16. package/skill/references/integration/modules/code-examples/php/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +3 -1
  17. package/skill/references/integration/modules/code-examples/python/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  18. package/skill/references/integration/modules/code-examples/python/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  19. package/skill/references/integration/modules/code-examples/python/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +8 -3
  20. package/skill/references/integration/modules/interface-contract/aipay-interface-contract.md +3 -1
  21. package/skill/references/integration/modules/interface-contract/apppay-interface-contract.md +4 -4
  22. package/skill/references/integration/modules/interface-contract/common-trade-contract.md +8 -8
  23. package/skill/references/integration/modules/interface-contract/notify-url-contract.md +12 -11
  24. package/skill/references/integration/modules/interface-contract/webpay-interface-contract.md +3 -3
  25. package/skill/references/integration/modules/interface-guide.md +1 -1
  26. package/skill/references/integration/modules/sandbox/a2m-sandbox-test.md +4 -4
  27. package/skill/references/integration/modules/sandbox/sandbox-setup-guide.md +10 -8
  28. package/skill/references/normal/conversation-telemetry.md +1 -1
  29. package/skill/references/normal/integration-worker.md +2 -2
  30. package/skill/references/normal/json/customer-messages.json +1 -1
  31. package/skill/references/normal/json/policy-rules.json +1 -1
  32. package/skill/references/normal/scripts/integration_message_runner.mjs +7 -2
  33. package/skill/references/normal/scripts/onboarding_message_runner.mjs +9 -5
  34. package/skill/references/normal/scripts/render_customer_message.mjs +145 -48
  35. package/skill/references/onboarding/flow.md +12 -6
  36. package/skill/references/runtime-entry.md +3 -1
  37. package/skill-pre/VERSION +1 -1
  38. package/skill-pre/references/integration/flow.md +28 -19
  39. package/skill-pre/references/integration/modules/checklist.md +12 -8
  40. package/skill-pre/references/integration/modules/code-examples/csharp/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  41. package/skill-pre/references/integration/modules/code-examples/csharp/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  42. package/skill-pre/references/integration/modules/code-examples/csharp/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +3 -1
  43. package/skill-pre/references/integration/modules/code-examples/java/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  44. package/skill-pre/references/integration/modules/code-examples/java/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  45. package/skill-pre/references/integration/modules/code-examples/java/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemoController.md +3 -1
  46. package/skill-pre/references/integration/modules/code-examples/nodejs/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  47. package/skill-pre/references/integration/modules/code-examples/nodejs/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  48. package/skill-pre/references/integration/modules/code-examples/nodejs/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +6 -2
  49. package/skill-pre/references/integration/modules/code-examples/php/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  50. package/skill-pre/references/integration/modules/code-examples/php/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  51. package/skill-pre/references/integration/modules/code-examples/php/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +3 -1
  52. package/skill-pre/references/integration/modules/code-examples/python/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  53. package/skill-pre/references/integration/modules/code-examples/python/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +1 -1
  54. package/skill-pre/references/integration/modules/code-examples/python/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +8 -3
  55. package/skill-pre/references/integration/modules/interface-contract/aipay-interface-contract.md +3 -1
  56. package/skill-pre/references/integration/modules/interface-contract/apppay-interface-contract.md +4 -4
  57. package/skill-pre/references/integration/modules/interface-contract/common-trade-contract.md +8 -8
  58. package/skill-pre/references/integration/modules/interface-contract/notify-url-contract.md +12 -11
  59. package/skill-pre/references/integration/modules/interface-contract/webpay-interface-contract.md +3 -3
  60. package/skill-pre/references/integration/modules/interface-guide.md +1 -1
  61. package/skill-pre/references/integration/modules/sandbox/a2m-sandbox-test.md +4 -4
  62. package/skill-pre/references/integration/modules/sandbox/sandbox-setup-guide.md +11 -9
  63. package/skill-pre/references/normal/full-process-routing.md +2 -2
  64. package/skill-pre/references/normal/integration-worker.md +2 -2
  65. package/skill-pre/references/normal/json/customer-messages.json +1 -1
  66. package/skill-pre/references/normal/json/policy-rules.json +1 -1
  67. package/skill-pre/references/normal/scripts/integration_message_runner.mjs +7 -2
  68. package/skill-pre/references/normal/scripts/onboarding_message_runner.mjs +9 -5
  69. package/skill-pre/references/normal/scripts/render_customer_message.mjs +150 -48
  70. package/skill-pre/references/normal/windows-environment.md +4 -4
  71. package/skill-pre/references/onboarding/flow.md +12 -6
  72. package/skill-pre/references/runtime-entry.md +5 -3
@@ -1065,14 +1065,17 @@ async function runMaterialCollect(args) {
1065
1065
  }, { productType });
1066
1066
  }
1067
1067
 
1068
- function renderApplicationCandidates(applicationType, applicationCandidates, selectionState = 'initial') {
1068
+ function renderApplicationCandidates(applicationType, applicationCandidates, selectionState = 'initial', includeIntro = selectionState === 'initial') {
1069
1069
  const onlineCount = applicationCandidates.filter((candidate) => candidate?.status === 'ON_LINE').length;
1070
1070
  const variant = applicationCandidates.length === 0
1071
1071
  ? 'EMPTY'
1072
1072
  : onlineCount === 0
1073
1073
  ? 'PENDING_ONLY'
1074
1074
  : 'ONLINE_WITH_OPTIONAL_PENDING';
1075
- const facts = renderMessage('application.candidates.facts', variant, { applicationType, applicationCandidates });
1075
+ const candidateFacts = renderMessage('application.candidates.facts', variant, { applicationType, applicationCandidates });
1076
+ const facts = includeIntro
1077
+ ? `${renderMessage('application.configuration.intro', 'DEFAULT', {})}\n\n${candidateFacts}`
1078
+ : candidateFacts;
1076
1079
  if (applicationCandidates.length === 0) return facts;
1077
1080
  const selectionVariant = `${onlineCount === 0 ? 'PENDING' : 'ONLINE'}_${applicationType === 'WEBAPP' ? 'WEB' : 'MOBILE'}_OR_NEW`;
1078
1081
  const selection = renderMessage('application.candidate.select', selectionVariant, {});
@@ -1168,8 +1171,8 @@ async function runApplicationRecheck(args) {
1168
1171
  const previousCanonical = canonicalCandidates(input.previousCandidates);
1169
1172
  const currentCanonical = canonicalCandidates(input.currentCandidates);
1170
1173
  // Rendering both snapshots applies the same content and sensitivity checks even on the silent path.
1171
- renderApplicationCandidates(applicationType, input.previousCandidates);
1172
- const output = renderApplicationCandidates(applicationType, input.currentCandidates);
1174
+ renderApplicationCandidates(applicationType, input.previousCandidates, 'initial', false);
1175
+ const output = renderApplicationCandidates(applicationType, input.currentCandidates, 'initial', false);
1173
1176
  if (previousCanonical === currentCanonical) {
1174
1177
  process.stderr.write(`${internalPrefix}APPLICATION_RECHECK_RESULT=UNCHANGED\n`);
1175
1178
  return '';
@@ -1237,10 +1240,11 @@ function closeoutInputFromArgs(args) {
1237
1240
  };
1238
1241
  const optionalMapping = {
1239
1242
  'sandbox-config-state': 'sandboxConfigState',
1243
+ 'sandbox-summary': 'sandboxSummary',
1240
1244
  'manual-verification-items': 'manualVerificationItems'
1241
1245
  };
1242
1246
  for (const [argName, fieldName] of Object.entries(optionalMapping)) {
1243
- if (Object.prototype.hasOwnProperty.call(args, argName)) input[fieldName] = required(args, argName);
1247
+ if (Object.prototype.hasOwnProperty.call(args, argName)) input[fieldName] = argName === 'sandbox-summary' ? optional(args, argName) : required(args, argName);
1244
1248
  }
1245
1249
  return input;
1246
1250
  }
@@ -18,7 +18,7 @@ const placeholderPattern = /\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g;
18
18
  const allowedVariableTypes = new Set([
19
19
  'applicationCandidates',
20
20
  'command', 'customerErrorDetails', 'customerErrorText', 'enum', 'enumList', 'existingPath', 'mccCode', 'officialTemporaryUrl', 'path',
21
- 'runtimeUrl', 'sandboxCredential', 'sandboxTableRows', 'serviceCandidates', 'mccCandidates', 'singleLine', 'string'
21
+ 'runtimeUrl', 'sandboxCredential', 'sandboxTableRows', 'sandboxSummary', 'serviceCandidates', 'mccCandidates', 'singleLine', 'string'
22
22
  ]);
23
23
 
24
24
  function allowedVariableNames(definitions) {
@@ -547,6 +547,9 @@ function validateValue(definition, value, policy) {
547
547
  case 'sandboxCredential':
548
548
  if (value.length > 256 || /[\r\n]/.test(value)) throw new Error(`变量 ${definition.name} 不是合法沙箱凭据`);
549
549
  break;
550
+ case 'sandboxSummary':
551
+ if (value.length > 12000 || /[\u0000-\u0009\u000b-\u001f\u007f]/u.test(value)) throw new Error('沙箱摘要包含非法内容');
552
+ break;
550
553
  case 'sandboxTableRows':
551
554
  if (value.length > 4096 || !value.split('\n').every((line) => /^\| [^|]+ \| [^|]+ \|$/.test(line))) {
552
555
  throw new Error(`变量 ${definition.name} 不是合法沙箱摘要行`);
@@ -806,70 +809,137 @@ function validateWriteConfirmation(variantName, variables, normalized) {
806
809
  validateServicePayload(variables, normalized);
807
810
  }
808
811
 
812
+ // Replay only the registered sandbox summary already delivered in this conversation.
813
+ // No config contents, keys, commands or free-form Markdown are accepted here.
814
+ function sandboxReplayBlock(original, productName, sandboxConfigState) {
815
+ // This optional display must never prevent delivery of the actual branch results.
816
+ try {
817
+ if (typeof original !== 'string' || !original || productName !== 'AI 网页应用收款') return '';
818
+ if (sandboxConfigState !== 'READY') return '';
819
+ const lines = original.trim().split('\n');
820
+ const configPath = lines[5]?.match(/^\| 配置文件目录 \| `([^`]+)` \|$/u)?.[1];
821
+ const environmentRows = lines.slice(6, 10).join('\n');
822
+ if (!configPath) throw new Error('必须复用本轮登记的完整沙箱摘要');
823
+ const input = { productName, configPath, environmentRows };
824
+ const summary = renderMessage('sandbox.environment.summary', 'DEFAULT', input);
825
+ const normalize = (text) => text.trim().replace(/\n{2,}/gu, '\n\n');
826
+ const valid = ['DEFAULT', 'WINDOWS'].some((variant) => {
827
+ const reminder = renderMessage('sandbox.environment.reminder', variant, {});
828
+ return normalize(original) === normalize(`${summary}\n\n${reminder}`)
829
+ || normalize(original) === normalize(`${summary}\n${reminder}`);
830
+ });
831
+ if (!valid) throw new Error('沙箱摘要不匹配登记正文,禁止改写或追加内容');
832
+ return renderMessage('sandbox.environment.summary', 'FINAL', input);
833
+ } catch {
834
+ return '';
835
+ }
836
+ }
837
+
838
+ function productionConfigSourceLines() {
839
+ return [
840
+ '1、确认上线条件:',
841
+ '- 前往支付宝 AI 付站点(https://aipay.alipay.com/?from=alipay-aipay-skill)→ 一站式接入,查看产品开通情况。',
842
+ '- 如本次流程新建支付宝应用,进入一站式接入 → 选择产品 → 密钥配置,确认新建的支付宝应用“已上线”;使用其他生产应用时,也需确认该应用已上线。',
843
+ '',
844
+ '2、生产环境的支付宝应用配置替换到项目中:',
845
+ '- 修改项目中的支付宝网关为 https://openapi.alipay.com/gateway.do。',
846
+ '- 把生产环境支付宝应用配置写入业务系统生产环境变量、受保护配置文件或密钥管理系统。',
847
+ '- appId、支付宝公钥、应用私钥需要配到项目中。应用私钥不要泄露、不要暴露给 Agent;应用公钥用于在支付宝侧配置,无需额外配到项目中。',
848
+ '- 确保应用公钥与应用私钥配对,appId、该应用公钥及对应的支付宝公钥与目标生产应用配置一致,不混用沙箱或其他应用的配置。',
849
+ ];
850
+ }
851
+
809
852
  function productionSpecificLines(productName) {
810
853
  if (productName === 'AI 按量付费') {
811
854
  return [
812
- '4. AI 按量付费 `serviceId`:把沙箱 `api_mock_service_id` 替换为真实 `serviceId`,`serviceId` 获取方式是:登录支付宝 AI 付站点(https://aipay.alipay.com/?from=alipay-aipay-skill) → 控制台 → 服务管理 → 复制审核已通过的目标服务 ID。',
813
- '5. AI 按量付费商户标识:`seller_id`/`seller_unique_id` 填收款商户 PID/2088,PID 获取方式是:登录支付宝商家平台(https://b.alipay.com/page/portal/home) → 点击头像 → 复制账户名下方 2088 开头的商家 ID;`seller_app_id` 填生产 `appId`。',
814
- '6. AI 按量付费验收:A2M 不使用 `notify_url`;上线前用生产应用私钥重新签名 402 账单,并验证 `Payment-Proof`、金额/订单/资源一致、`trade_no` 防重复履约和 `alipay.aipay.agent.fulfillment.confirm` 异步回执。'
815
- ];
816
- }
817
- if (productName === 'AI 移动应用收款') {
818
- return [
819
- '4. AI 移动应用收款 `notify_url`:生成生产 `orderStr` 时传入商家已部署的公网 HTTPS `notify_url`;未传不会触发异步通知。',
820
- '5. AI 移动应用收款验收:`notify_url` 完成验签,校验 `app_id`/`out_trade_no`/`total_amount`/`trade_status`,幂等处理并返回 `success`;支付结果以异步通知或 `alipay.trade.query` 补偿查询为准。客户端 SDK 使用服务端 `orderStr` 调起支付,客户端结果只做展示,不能作为付款成功依据。'
855
+ '', '3、AI 按量付费服务配置:',
856
+ '- 把沙箱 `api_mock_service_id` 替换为真实 `serviceId`。获取方式:登录支付宝 AI 付站点(https://aipay.alipay.com/?from=alipay-aipay-skill)→ 控制台 → 服务管理 → 复制审核已通过的目标服务 ID。',
857
+ '- `seller_id`/`seller_unique_id` 填收款商户 PID/2088,`seller_app_id` 填生产 `appId`。PID 获取方式:登录支付宝商家平台(https://b.alipay.com/page/portal/home)→ 点击头像 → 复制账户名下方 2088 开头的商家 ID。',
821
858
  ];
822
859
  }
860
+ const mobile = productName === 'AI 移动应用收款';
823
861
  return [
824
- '4. AI 网页应用收款 `notify_url`:生产下单时传入商家已部署的公网 HTTPS `notify_url`;该地址是商家后端通知地址,不是支付宝生成的 URL。',
825
- '5. AI 网页应用收款验收:`notify_url` 完成验签,校验 `app_id`/`out_trade_no`/`total_amount`/`trade_status`,幂等处理并返回 `success`;支付结果以异步通知或 `alipay.trade.query` 补偿查询为准,同步回跳或前台页面不能作为付款成功依据。',
826
- '6. AI 网页应用收款限制:如需解除 AI 网页应用收款的收款限制,请前往 支付宝商家平台 - 签约管理 补全收款信息:https://b.alipay.com/page/ar-center/ar-manage'
862
+ '', `3、${productName}支付结果确认:`,
863
+ '- `notify_url` 用于商家服务端接收支付宝发来的支付结果异步通知,不是前端页面或支付宝生成的 URL。',
864
+ '- 如使用异步通知,下单时传入 `notify_url`;它应是商家已部署、支付宝服务端可通过公网访问的 HTTPS 通知接口地址。',
865
+ '- 如不配置 `notify_url`,不会触发该地址的异步通知;商家服务端需通过 `alipay.trade.query` 主动查单。',
866
+ mobile
867
+ ? '- 支付结果以验签通过的异步通知或服务端交易查询结果为准;APP 客户端支付结果不能单独作为付款成功依据。'
868
+ : '- 支付结果以验签通过的异步通知或 `alipay.trade.query` 查询结果为准;同步回跳或前台页面不能作为付款成功依据。',
869
+ '- 项目正式对客前,请完成生产环境支付验证。',
870
+ ...(mobile ? [] : ['', '4、AI 网页应用收款限制:', '- 如需解除 AI 网页应用收款的收款限制,请前往支付宝商家平台 → 签约管理补全收款信息:https://b.alipay.com/page/ar-center/ar-manage'])
827
871
  ];
828
872
  }
829
873
 
830
- function productionConfigSourceLines() {
831
- return [
832
- '1. 产品开通确认:前往支付宝 AI 付站点查看产品开通情况(https://aipay.alipay.com/?from=alipay-aipay-skill)。',
833
- '2. 应用上线确认:前往支付宝 AI 付站点“一站式接入 → 选择产品 → 密钥配置”,确认目标支付宝应用“已上线”。',
834
- '3. 替换项目中支付宝应用配置为生产:把生产环境的支付宝应用配置写入业务系统环境变量、受保护配置文件或密钥管理系统。确保 appId、应用私钥、支付宝公钥同属一套生产环境支付宝应用,同时修改项目中的支付宝网关为生产网关:https://openapi.alipay.com/gateway.do。'
835
- ];
874
+ function summaryItems(value) {
875
+ if (!value || value === '无') return [];
876
+ let items = [value];
877
+ if (value.trim().startsWith('[')) {
878
+ try {
879
+ const parsed = JSON.parse(value);
880
+ if (Array.isArray(parsed) && parsed.every((item) => typeof item === 'string')) items = parsed;
881
+ } catch { /* Preserve validated plain text. */ }
882
+ }
883
+ return [...new Set(items.flatMap((item) => item.split(';')).map((item) => item.trim()).filter(Boolean))];
884
+ }
885
+
886
+ // Completion inputs contain actual gaps only; reminders are delivered elsewhere.
887
+ function validateChecklistItemClassification(variables, fields) {
888
+ const notifyReminders = new Set([
889
+ '公网 HTTPS notify_url 联调人工待验证:上线前配置公网通知地址并完成验签联调',
890
+ '公网 HTTPS notify_url 联调待部署后验证'
891
+ ]);
892
+ for (const field of fields) {
893
+ const value = variables[field];
894
+ const items = summaryItems(value);
895
+ if (value && value !== '无' && items.length === 0) {
896
+ throw new Error(`${field} 没有实际缺口时必须传“无”,不能使用空列表影响完成判定`);
897
+ }
898
+ for (const item of items) {
899
+ if (notifyReminders.has(item) || /^沙箱付款待用户体验(?::.*)?$/u.test(item)) {
900
+ throw new Error(`${field} 只能包含实际缺口;通用通知地址提醒和可选沙箱付款体验不计入完成判定。请重新分类并按实际证据填写结果,不重跑已完成检查`);
901
+ }
902
+ }
903
+ }
836
904
  }
837
905
 
838
906
  function productionReadinessBlock(productName, context) {
839
907
  const statusLines = [];
840
- if (!context.productBranchesComplete) {
908
+ if (context.integrationOnly) {
909
+ statusLines.push('- 本轮仅进行代码开发;上线前请确认生产配置并完成验证。');
910
+ } else if (!context.productBranchesComplete) {
841
911
  statusLines.push('- 还不能正式收款,产品签约、服务市场或应用发布仍有上表待办。');
842
912
  }
843
913
  if (context.integrationResult === '不在本轮执行范围') {
844
914
  statusLines.push('- 本轮只完成产品开通流程收口,不代表业务系统已经具备收款代码;先完成支付产品-代码开发、项目部署和生产参数验收。');
845
915
  } else if (context.integrationResult === '部分完成,沙箱配置待完成') {
846
- statusLines.push('- 代码开发仍有沙箱配置缺口;可继续产品开通流程,但不能进入真实生产收款。');
916
+ statusLines.push('- 沙箱配置尚未完成,相关测试未执行;后续上线条件按生产配置和实际验证结果另行确认。');
847
917
  } else if (context.integrationResult === '部分完成,人工待验证') {
848
918
  statusLines.push('- 代码开发还有人工待验证项;完成后才能判断是否可进入真实生产上线。');
919
+ } else if (context.integrationResult === '未通过' && !(context.integrationOnly && context.failedItems && context.failedItems !== '无')) {
920
+ statusLines.push('- 代码开发仍有未完成项,请先按本轮校验结果修复。');
849
921
  }
850
- if (statusLines.length > 0) {
851
- return [
852
- '【当前状态】',
853
- ...statusLines,
854
- '',
855
- '【上线前有以下关键点】',
856
- ...productionConfigSourceLines(),
857
- ...productionSpecificLines(productName),
858
- '',
859
- '【提示】',
860
- '- 如找不到配置替换位置,可以试试对 Agent 说:“我要上线了,帮我找一下项目里支付宝生产配置应该改哪些地方”。让 Agent 定位文件/变量名,但不要把生产应用私钥、账号密码、支付凭证或未脱敏通知内容直接发给 Agent。'
861
- ].join('\n');
922
+ if (context.integrationOnly && context.failedItems && context.failedItems !== '无') {
923
+ statusLines.push(`- ${context.failedItems}`);
924
+ }
925
+ const integrationGapAlreadyShown = context.productBranchesComplete && ['部分完成,人工待验证', '部分完成,沙箱配置待完成'].includes(context.integrationResult);
926
+ if (context.remainingActions && context.remainingActions !== '无' && !integrationGapAlreadyShown) {
927
+ statusLines.push(...summaryItems(context.remainingActions).map((item) => `- 下一步:${item}`));
862
928
  }
929
+ if (statusLines.length === 0) {
930
+ statusLines.push('- 代码开发和产品开通流程已完成,但当前 Agent 没有替你切生产配置,也不会默认发起真实生产交易。');
931
+ }
932
+ const manualItems = summaryItems(context.manualVerificationItems);
933
+ const manualLines = manualItems.length
934
+ ? ['', '上线前请完成本轮尚未验证的项目:', ...manualItems.map((item) => `- ${item}`)]
935
+ : [];
863
936
  return [
864
- '【当前状态】',
865
- '- 代码开发和产品开通流程已完成,但当前 Agent 没有替你切生产配置,也不会默认发起真实生产交易。',
866
- '',
867
- '【上线前有以下关键点】',
868
- ...productionConfigSourceLines(),
869
- ...productionSpecificLines(productName),
870
- '',
937
+ '【当前状态】', ...statusLines, '',
938
+ ...(context.sandboxBlock ? [context.sandboxBlock, ''] : []),
939
+ '【上线前有以下关键点】', '',
940
+ ...productionConfigSourceLines(), ...productionSpecificLines(productName), ...manualLines, '',
871
941
  '【提示】',
872
- '- 如找不到配置替换位置,可以试试对 Agent 说:“我要上线了,帮我找一下项目里支付宝生产配置应该改哪些地方”。让 Agent 定位文件/变量名,但不要把生产应用私钥、账号密码、支付凭证或未脱敏通知内容直接发给 Agent。'
942
+ '- 如找不到项目上线前生产配置的替换位置,可以试试对 Agent 说:“我要上线了,帮我找一下项目里支付宝生产配置要改哪些地方”。让 Agent 帮助您定位文件/变量名,但不要把生产应用私钥、账号密码、支付凭证或未脱敏通知内容直接发给 Agent。'
873
943
  ].join('\n');
874
944
  }
875
945
 
@@ -1355,7 +1425,12 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1355
1425
  }
1356
1426
  validateVariantInputShape(messageId, variantName, variables);
1357
1427
  for (const definition of message.variables) {
1358
- normalized[definition.name] = definition.derived ? '' : validateValue(definition, variables[definition.name], policy);
1428
+ if (definition.name === 'sandboxSummary') {
1429
+ try { normalized.sandboxSummary = validateValue(definition, variables.sandboxSummary, policy); }
1430
+ catch { normalized.sandboxSummary = ''; }
1431
+ } else {
1432
+ normalized[definition.name] = definition.derived ? '' : validateValue(definition, variables[definition.name], policy);
1433
+ }
1359
1434
  }
1360
1435
  } catch (error) {
1361
1436
  throw addManagedEntrypointHint(messageId, error);
@@ -1373,6 +1448,14 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1373
1448
  if (messageId === 'onboarding.mcc.candidates') {
1374
1449
  normalized.candidateTable = mccCandidateTable(variantName, variables.mccCandidates, telemetryContext.productType);
1375
1450
  }
1451
+ if (messageId === 'sandbox.environment.summary' && variantName === 'FINAL') {
1452
+ if (variables.productName !== 'AI 网页应用收款') throw new Error('最终沙箱测试配置仅适用于 AI 网页应用收款');
1453
+ const buyerRows = variables.environmentRows.split('\n').slice(1);
1454
+ if (buyerRows.some((row) => row.includes('已写入本地配置文件,默认不在对话中展开'))) {
1455
+ throw new Error('网页收款最终沙箱测试配置必须展示已校验的买家密码明文');
1456
+ }
1457
+ normalized.sandboxBuyerRows = buyerRows.join('\n');
1458
+ }
1376
1459
  if (messageId === 'application.operation.result') {
1377
1460
  if (variantName === 'ALIPAY_PUBLIC_KEY_MANUAL_CONFIGURATION') {
1378
1461
  if (variables.actualStatus !== '需人工配置') {
@@ -1468,6 +1551,7 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1468
1551
  }[variables.integrationStatus];
1469
1552
  }
1470
1553
  if (messageId === 'integration.checklist.result') {
1554
+ validateChecklistItemClassification(variables, ['failedItems', 'manualItems']);
1471
1555
  const sandboxPending = variables.sandboxConfigState !== 'READY';
1472
1556
  const hasBlockingDefect = variables.blockingDefectState === 'PRESENT';
1473
1557
  if (variantName === 'AIPAY' && !variables.sandboxResult) throw new Error('AI 按量付费 checklist 缺少沙箱联调结果');
@@ -1524,6 +1608,19 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1524
1608
  if (manualOnly) {
1525
1609
  normalized.failedItems = `人工待验证项未完成:${normalized.manualItems}`;
1526
1610
  }
1611
+ normalized.checklistDetails = variables.executionMode === '仅代码开发'
1612
+ ? ''
1613
+ : `未完成项:${normalized.failedItems}\n人工待验证:${normalized.manualItems}`;
1614
+ const productName = { AIPAY: 'AI 按量付费', WEBPAY: 'AI 网页应用收款', APPPAY: 'AI 移动应用收款' }[variantName];
1615
+ normalized.launchGuidance = variables.executionMode === '仅代码开发'
1616
+ ? productionReadinessBlock(productName, {
1617
+ productBranchesComplete: false,
1618
+ integrationOnly: true,
1619
+ failedItems: variables.failedItems,
1620
+ integrationResult: variables.overallResult === '通过' ? '已完成' : sandboxPending ? '部分完成,沙箱配置待完成' : hasBlockingDefect ? '未通过' : '部分完成,人工待验证',
1621
+ manualVerificationItems: variables.manualItems,
1622
+ sandboxBlock: sandboxReplayBlock(normalized.sandboxSummary, productName, variables.sandboxConfigState)
1623
+ }) : '';
1527
1624
  }
1528
1625
  if (messageId === 'materials.category.collect') {
1529
1626
  const expectedStatus = {
@@ -1575,6 +1672,7 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1575
1672
  normalized.specialQualificationHint = variables.specialQualificationHint || '';
1576
1673
  }
1577
1674
  if (messageId === 'process.partial_result') {
1675
+ validateChecklistItemClassification(variables, ['remainingActions', 'manualVerificationItems']);
1578
1676
  const statusQueryHintDefinition = definitions.get('statusQueryHint');
1579
1677
  const statusQueryHint = statusQueryHintDefinition?.values?.[0];
1580
1678
  if (!statusQueryHintDefinition?.derived || !statusQueryHint) {
@@ -1597,12 +1695,10 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1597
1695
  if (onboardingOnly) {
1598
1696
  if (variables.sandboxConfigState !== undefined) throw new Error('onboarding_only 禁止传入代码开发沙箱状态');
1599
1697
  if (hasManualVerificationItems) throw new Error('onboarding_only 禁止传入代码开发人工待验证项');
1600
- normalized.manualVerificationLine = '';
1601
1698
  normalized.sandboxRecoveryHint = '';
1602
1699
  } else if (variables.integrationResult === '已完成') {
1603
1700
  if (variables.sandboxConfigState !== 'READY') throw new Error('完整代码开发结果必须绑定 READY 沙箱状态');
1604
1701
  if (hasManualVerificationItems) throw new Error('代码开发已完成时禁止传入人工待验证项');
1605
- normalized.manualVerificationLine = '';
1606
1702
  normalized.sandboxRecoveryHint = '';
1607
1703
  } else if (variables.integrationResult === '部分完成,沙箱配置待完成') {
1608
1704
  if (hasManualVerificationItems) throw new Error('沙箱待配置结果不通过人工待验证项表达');
@@ -1612,11 +1708,9 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1612
1708
  }[variables.sandboxConfigState];
1613
1709
  if (!normalized.sandboxRecoveryHint) throw new Error('沙箱待配置结果必须绑定 CREATE_PENDING 或 VERIFY_PENDING');
1614
1710
  if (variables.remainingActions === '无') throw new Error('沙箱待配置时必须保留剩余待办');
1615
- normalized.manualVerificationLine = '';
1616
1711
  } else if (variables.integrationResult === '部分完成,人工待验证') {
1617
1712
  if (variables.sandboxConfigState !== 'READY') throw new Error('人工待验证结果必须绑定 READY 沙箱状态');
1618
1713
  if (!hasManualVerificationItems) throw new Error('人工待验证结果必须列出人工待验证项');
1619
- normalized.manualVerificationLine = `人工待验证:${normalized.manualVerificationItems}`;
1620
1714
  normalized.sandboxRecoveryHint = '';
1621
1715
  } else {
1622
1716
  throw new Error('full_process 进入产品开通收口时只允许已完成、沙箱待配置或人工待验证');
@@ -1640,7 +1734,10 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1640
1734
  !hasManualVerificationItems;
1641
1735
  normalized.productionReadinessBlock = productionReadinessBlock(variables.productName, {
1642
1736
  productBranchesComplete,
1643
- integrationResult: variables.integrationResult
1737
+ remainingActions: normalized.remainingActions,
1738
+ integrationResult: variables.integrationResult,
1739
+ manualVerificationItems: variables.manualVerificationItems,
1740
+ sandboxBlock: sandboxReplayBlock(onboardingOnly ? '' : normalized.sandboxSummary, variables.productName, variables.sandboxConfigState)
1644
1741
  });
1645
1742
  const declaresComplete = variables.processResultTitle === '支付产品-产品开通已完成';
1646
1743
  if (branchesComplete !== declaresComplete) {
@@ -1653,7 +1750,7 @@ export function renderMessage(messageId, variantName, variables, telemetryContex
1653
1750
  if (messageId === 'service.create.summary') validateServiceCreateSummary(variantName, variables, normalized);
1654
1751
  if (messageId === 'onboarding.write.confirm') validateWriteConfirmation(variantName, variables, normalized);
1655
1752
  let rendered = variant.templateLines.join('\n').replace(placeholderPattern, (_, name) => normalized[name]);
1656
- if (messageId === 'application.operation.result' || messageId === 'process.partial_result' || messageId === 'error.backend' || messageId === 'error.cli') {
1753
+ if (messageId === 'application.operation.result' || messageId === 'process.partial_result' || messageId === 'integration.checklist.result' || messageId === 'sandbox.environment.summary' || messageId === 'error.backend' || messageId === 'error.cli') {
1657
1754
  rendered = normalizeProcessPartialResultSpacing(rendered);
1658
1755
  }
1659
1756
  if (message.blocking && allowedRepliesFor(catalog, message).length > 0) {
@@ -272,6 +272,8 @@ Step 5 直接使用对应 phase 的完整命令;仅出现脚本异常、需要
272
272
 
273
273
  Step 3.1 通常已在同一次 stdout 展示三分支摘要;网站支付和 APP 支付的服务市场固定为“无需处理”,查询失败显示“查询失败”。本地权限未恢复时没有摘要,只消费最新失败 envelope,禁止补写或重放。进入本阶段后只消费同一 `DISCOVERY_RESULT`,不得再次调用 `discovery-summary`、手写或重复输出摘要。
274
274
 
275
+ 应用配置首次展示时,`application-candidates` 的默认 `initial` 输出先包含 `application.configuration.intro` 科普,再展示同一次查询的应用事实及适用选择提示;无应用、仅未上线和含已上线候选均适用。不得单独手写或重复渲染科普;无效选择的 `invalid` 输出及 `application-recheck` 的候选变化提示不重复科普,补资料、获取公钥和后续写操作也不重复展示。
276
+
275
277
  轮到服务或应用时,只有 `query_status=SUCCESS` 且 `candidates` 为数组,才用以下 runner 基于同一快照生成候选事实和选择提示;stdout 是唯一正文,禁止提前展示、手工拼表、压缩、拆分或改写。应用候选存在上线或未上线记录时,runner 必须产生且仅产生一个 `CUSTOMER_MESSAGE_DELIVERY_REQUIRED=application.candidate.select`;命令后的下一动作先将 stdout 原文送达,不得添加标题、提示、风险说明、前后缀或改写,然后立即等待用户选择:
276
278
 
277
279
  ```bash
@@ -532,25 +534,29 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message appl
532
534
 
533
535
  **完成条件**:当前登录、scope 和 MCC 必须有效;签约必须由实际查询确认为已生效;仅按量付费适用的服务分支必须复用或保存成功并取得实际 `serviceId`;应用必须达到 `ON_LINE`、应用公钥已生效且支付宝公钥已实际导出。存在失败、未知、待生效、待审核或人工配置时不得宣称产品开通完成。不维护人工完成条件数量。
534
536
 
535
- 使用 `../normal/json/customer-messages.json` 的 `process.partial_result` 逐分支收口,必须通过 `onboarding_message_runner.mjs closeout` 托管输出并原文发送 stdout。禁止 Agent 手写短摘要、删减 `productionReadinessBlock`、删减 AI 网页应用收款限制引导或改写后续衔接;AI 网页应用收款收口缺少“【上线前有以下关键点】”和“AI 网页应用收款限制”时视为标准收口未送达,必须重发同一次 stdout。自动重试耗尽、业务错误或查询失败且仍未恢复的动作,统一写入分支结果和 `remainingActions`,只说明一次,不在收口后追问是否重试。必须执行:
537
+ 使用 `../normal/json/customer-messages.json` 的 `process.partial_result` 逐分支收口,必须通过 `onboarding_message_runner.mjs closeout` 托管输出并原文发送 stdout。禁止 Agent 手写短摘要、删减 `productionReadinessBlock`、删减 AI 网页应用收款限制引导或改写后续衔接;AI 网页应用收款收口缺少“【上线前有以下关键点】”和“AI 网页应用收款限制”时视为标准收口未送达,必须重发同一次 stdout。自动重试耗尽、业务错误或查询失败且仍未恢复的动作,保留在分支结果及内部 `remainingActions`,未解决业务分支的必要恢复动作由 `remainingActions` 放入【当前状态】的“下一步”,不能只依赖前序消息;产品开通各分支已完成且仅剩代码人工验证或沙箱待配置时,分别沿用上线关键点或独立恢复口令,不重复内部汇总待办;仅保留本轮尚未解决分支的具体恢复指引,不重复通用上线提醒或已在上线关键点列出的人工验证项。UNKNOWN 仍先核对事实,禁止自动重放写操作,不在收口后追问是否重试。必须执行:
536
538
 
537
539
  `SIGNING_RESULT`、`SERVICE_RESULT`、`APPLICATION_RESULT` 和 `INTEGRATION_RESULT` 必须使用消息目录允许的状态枚举原文,禁止拼接 `appId`、公钥文件路径、错误码、截图证据或其他自由文本;本轮 `ALIPAY_PUBLIC_KEY_EXPORT_STATUS=EXPORTED` 时,`APP_KEY_SAVE_PATH` 必须传入前一步独立应用结果 runner。这些证据不能污染分支结果枚举。
538
540
 
539
541
  进入本步骤前,应用分支已按前一步的交付规则独立输出 `application.operation.result`(无实际 appId 的例外沿用前一步),runner 必须输出唯一 `ALIPAY_AIPAY_INTERNAL:CUSTOMER_MESSAGE_DELIVERY_REQUIRED=application.operation.result`。命令后的下一个 Agent 动作必须先将该次 stdout 原文作为独立用户可见消息送达,送达前禁止 closeout、合并或继续工具调用;总收口不能替代这条应用结果消息。该约束只强化消息交付编排,不新增用户确认点;marker 缺失或不唯一时停止并重跑同一登记命令。
540
542
 
541
543
  ```bash
542
- node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message closeout --product-type "$PRODUCT_TYPE" --root-intent "$ROOT_INTENT" --signing-result "$SIGNING_RESULT" --application-result "$APPLICATION_RESULT" --remaining-actions "$REMAINING_ACTIONS" [--integration-result "$INTEGRATION_RESULT"] [--service-result "$SERVICE_RESULT"] [--sandbox-config-state "$SANDBOX_CONFIG_STATE"] [--manual-verification-items "$MANUAL_VERIFICATION_ITEMS"] --telemetry-run-id "$RUN_ID" --telemetry-history-count "$HISTORY_COUNT" --agent-platform "<AGENT_PLATFORM>" --session-id "<SESSION_ID>"
544
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message closeout --product-type "$PRODUCT_TYPE" --root-intent "$ROOT_INTENT" --signing-result "$SIGNING_RESULT" --application-result "$APPLICATION_RESULT" --remaining-actions "$REMAINING_ACTIONS" [--integration-result "$INTEGRATION_RESULT"] [--service-result "$SERVICE_RESULT"] [--sandbox-config-state "$SANDBOX_CONFIG_STATE"] [--manual-verification-items "$MANUAL_VERIFICATION_ITEMS"] [--sandbox-summary "$SANDBOX_SUMMARY"] --telemetry-run-id "$RUN_ID" --telemetry-history-count "$HISTORY_COUNT" --agent-platform "<AGENT_PLATFORM>" --session-id "<SESSION_ID>"
543
545
  ```
544
546
 
545
547
  用户输入计数严格继承 `runtime-entry.md`:active run 内每条聊天框用户消息先执行唯一 `count-user-input --run-id "$RUN_ID" --input-id "$USER_INPUT_ID"`,不按 Skill 相关性筛选;runner、recovery、renderer 和 closeout 不做隐式计数。closeout 生成最终 summary 前使用当前 `HISTORY_COUNT` 快照,正式值始终由 runtime counter 写入,禁止传入或覆盖 `user_input_after_clarify_intent`。
546
548
 
547
- runner 从 `PRODUCT_TYPE` 派生产品名,网站支付/APP 支付派生服务结果“无需处理”,从 `ROOT_INTENT` 派生代码开发栏和后续衔接;标题只按完成条件派生。`onboarding_only` 省略 `--integration-result`、`--sandbox-config-state` 和 `--manual-verification-items`。`full_process`:代码开发通过填“已完成”并传 `READY`;仅沙箱待配置且其余代码与安全检查通过填“部分完成,沙箱配置待完成”并传 `CREATE_PENDING|VERIFY_PENDING`;沙箱 `READY` 且只剩非阻塞人工待验证项时填“部分完成,人工待验证”,传 `READY`,把 checklist `manualItems` 原样作为 `MANUAL_VERIFICATION_ITEMS`,并在 `REMAINING_ACTIONS` 写明实际待办,禁止传“无”。runner 拒绝旧完整参数、stdin JSON、`--input-json`、可派生字段和空字符串伪值。renderer 校验结果与沙箱状态/人工待验证项一致,并派生恢复口令或人工待验证展示;不增加确认点。不得在 stdout 前后追加衔接提醒,不伪造本轮代码修改、沙箱创建或测试结果,也不重复进入 integration。
549
+ runner 从 `PRODUCT_TYPE` 派生产品名,网站支付/APP 支付派生服务结果“无需处理”,从 `ROOT_INTENT` 派生代码开发栏和后续衔接;标题只按完成条件派生。`onboarding_only` 省略 `--integration-result`、`--sandbox-config-state` 和 `--manual-verification-items`。`full_process`:代码开发通过填“已完成”并传 `READY`;仅沙箱待配置且其余代码与安全检查通过填“部分完成,沙箱配置待完成”并传 `CREATE_PENDING|VERIFY_PENDING`;沙箱 `READY` 且只剩非阻塞人工待验证项时填“部分完成,人工待验证”,传 `READY`,把 checklist 已分类的实际 `manualItems` 原样作为 `MANUAL_VERIFICATION_ITEMS`,并在 `REMAINING_ACTIONS` 写明实际待办,禁止传“无”。runner 拒绝旧完整参数、stdin JSON、`--input-json`、可派生字段和空字符串伪值。renderer 校验结果与沙箱状态/人工待验证项一致,并派生恢复口令;`remainingActions` 和 `manualVerificationItems` 仍用于完成条件校验,最终总收口不再单列“本轮流程仍需处理”和“人工待验证”,保留分支状态表、【当前状态】及沙箱恢复提示,不增加确认点。不得在 stdout 前后追加衔接提醒,不伪造本轮代码修改、沙箱创建或测试结果,也不重复进入 integration。
550
+
551
+ 三个产品的总收口只保留分支状态表中的应用发布结果,不再重复输出应用结果详情、appId、支付宝公钥保存路径或应用结果专属下一步。应用详情仅由前一步 `application.operation.result` 独立交付;`closeout` 拒绝旧 `--application-operation-*` 参数,禁止把详情改塞入 `remainingActions` 或其他字段。应用创建、提审、复用和人工配置的事实判据保持不变。
552
+
553
+ 当且仅当签约结果为“已提交,等待生效”且应用结果为“已提交审核,等待上线”时,renderer 从消息目录自动在分支状态表后独立展示状态查询提示;该提示不是 flow 入参,Agent 禁止自行传入、拼接或在模板外重复输出。其他结果组合不展示该提示。
548
554
 
549
- 三个产品的总收口只保留分支状态表中的应用发布结果和实际待办,不再重复输出应用结果详情、appId、支付宝公钥保存路径或应用结果专属下一步。应用详情仅由前一步 `application.operation.result` 独立交付;`closeout` 拒绝旧 `--application-operation-*` 参数,禁止把详情改塞入 `remainingActions` 或其他字段。应用创建、提审、复用和人工配置的事实判据保持不变。
555
+ renderer 按产品和实际结果自动派生【当前状态】、可选【沙箱测试配置】、【上线前有以下关键点】和【提示】。`onboarding_only` 禁止传 `--sandbox-summary`,不展示沙箱信息;`full_process` 仅 AI 网页应用收款在沙箱 READY、代码配置后置校验通过且原摘要有效时,传 Integration 本轮已交付的完整 `SANDBOX_SUMMARY`,包括 Worker 返回的原登记正文。不得重读配置、重建沙箱、摘出凭据或手写表格;无有效原摘要时省略,不展示占位信息。原摘要缺失、过期、格式异常或回放校验失败时,renderer 只省略该可选区块,严禁因此阻塞整个 summary;不输出未校验凭据,也不因省略展示改变或证明业务状态。区块只保留沙箱买家测试账号、沙箱买家登录密码、沙箱买家支付密码,两个密码明文展示(含 Windows);不展示配置路径、appId、产品或密钥行。按量付费与 APP 支付禁止传该参数,最终 summary 不展示沙箱配置。沙箱区块用于用户后续测试,不宣称测试通过。
550
556
 
551
- 当且仅当签约结果为“已提交,等待生效”且应用结果为“已提交审核,等待上线”时,renderer 从消息目录自动在 `remainingActions` 后追加状态查询提示;该提示不是 flow 入参,Agent 禁止自行传入、拼接或在模板外重复输出。其他结果组合不展示该提示。
557
+ 上线关键点按“确认上线条件 → 生产配置替换 → 产品专属支付结果确认/服务配置 → 适用收款限制”组织。生产配置包括 appId、应用私钥、对应支付宝公钥及生产网关;应用公钥与应用私钥必须配对,在支付宝侧配置,无需额外配到项目中。应用上线提醒覆盖本轮新建和用户自行准备的其他生产应用。网页/移动收款必须同时实现通知处理和交易查询;缺少 `notify_url` 时省略该字段并由服务端查单兜底,不会仅因缺少该地址而报错。允许省略 `notify_url`,但商家服务端必须可靠主动查单并完成响应验签、订单/金额/状态/归属校验、持久化幂等、后台重试及未决订单恢复;使用通知时需公网 HTTPS、验签、关键字段校验、幂等、`success` 回写和补偿查询。仅没有公网通知地址不应判为不能上线。按量付费 summary 仅保留真实 serviceId、商户 PID/2088 等生产服务配置,不再单列 402 验付和履约回执验证提醒。最终 summary 不重复私钥格式,也不逐字段解释通知校验;这些实现和检查要求仍由原契约、代码开发 flow 及 checklist 执行,不改变自动测试脚本。
552
558
 
553
- renderer 还会按 `productName` 和分支完成条件自动派生上线前检查块。Agent 不传入、不改写该字段,也不得在模板外补第二份生产上线清单。该检查使用“【当前状态】/【上线前有以下关键点】/【提示】”结构,不单列“相关站点”,也不在模板尾部追加第二个查询入口;必要 URL 只放在具体操作步骤中。完成态只能表述为代码开发和产品开通流程已完成,不得替用户确认生产配置已替换、产品真实可收款或应用页面状态;通用上线提醒固定分为三点:前往支付宝 AI 付站点查看产品开通情况;进入一站式接入 → 选择产品 → 密钥配置确认目标支付宝应用已上线;将项目中的支付宝应用配置替换为生产配置,确保 appId、应用私钥、支付宝公钥同属一套生产环境支付宝应用并使用生产网关。三个产品的专属提醒从第 4 点开始;AI 网页应用收款和 AI 移动应用收款必须完成公网 HTTPS `notify_url` 的验签、关键字段校验、幂等、`success` 回写和补偿查询;AI 按量付费必须把沙箱 `api_mock_service_id` 替换为服务市场真实 `serviceId`,A2M 示例中的 `sellerId` 来自商户 PID/2088,由商家自行在支付宝平台确认,不由 Agent 猜测、生成或代填。生产环境应用私钥、账号密码、支付凭证和未脱敏通知内容仍禁止提供给 Agent。分支未完成时,该派生块必须明确上表待办完成前不能正式收款。该提示只在消息目录维护,不增加用户确认点,Agent 不得在模板外重复输出或改写。
559
+ 通用通知地址提醒和用户可选沙箱付款体验不属于缺口,不得写入 `remainingActions`/`manualVerificationItems` 影响完成判定;仅剩这些提醒时按其余适用检查实际证据确定代码结果。实际待验证项必须与部分完成状态对应,不能在 renderer 中隐藏;上游分类有误时只纠正参数,不重测项目。本轮实际尚未验证的项目在上线关键点中列出,不单列“人工待验证”段落,不把尚未验证改成已通过。应用结果与支付宝公钥保存路径仍在前一步独立交付。禁止 Agent 在模板外补第二份生产上线清单或删掉网页收款限制;生产应用私钥、账号密码、支付凭证和未脱敏通知内容不得提供给 Agent。完成态不代表已切生产配置或已可真实收款,不新增确认点。
554
560
 
555
561
  签约、服务和应用分别按本轮脚本实际结果表达:签约提交成功但未生效时,`signingResult` 固定使用“已提交,等待生效”;服务创建或修改成功且取得 `serviceId`、但未取得服务状态时,`serviceResult` 分别固定使用“创建成功,状态未取得”或“修改成功,状态未取得”。任一分支失败或结果未知不清除其他分支成功,也不能概括为“全部失败”。`APPLICATION_RESULT` 沿用应用阶段上述唯一状态映射和本轮实际 marker,字面值必须与消息目录逐字一致。
556
562
 
@@ -14,7 +14,7 @@ AI 网页应用收款覆盖 PC 网页和手机浏览器/H5,接口固定 `alipa
14
14
  5. **用户文件**:只改已确认项目和范围,不清空或删除既有项目;“新建/重做/换一个”不是删除授权。具体删除仍遵守 Integration flow 的清单、二次确认和禁删边界。
15
15
  6. **敏感信息**:应用公钥仅由用户生成并明确提供;禁止请求/处理生产私钥、生成密钥对、补全/改写公钥或添加 PEM 头尾。敏感值、临时 URL 和沙箱资料遵守对应 flow/script 的白名单、权限和输出边界。
16
16
  7. **沙箱结论**:真实快速沙箱配置不得用占位值,唯一例外是 AI 按量付费沙箱 `service_id=api_mock_service_id`,且生产禁用。`CREATE_PENDING|VERIFY_PENDING` 只允许继续代码实现,阻止字段使用、摘要、后置校验、联调和付款体验。字段校验不等于支付测试;仅完整 402 链路满足 flow 才可称沙箱测试通过。
17
- 8. **异步通知**:AI 网页应用收款/AI 移动应用收款必须实现通知。本地无公网 HTTPS `notify_url` 时可不传并以交易查询验收,公网通知联调列为人工待验证;生产上线前须恢复通知并完成验签、幂等、关键字段校验、`success` 回写和补偿查询,否则不宣称生产就绪。
17
+ 8. **异步通知**:AI 网页应用收款/AI 移动应用收款必须实现通知处理和交易查询。`notify_url` 是可选参数;生产也允许省略。未配置时不触发该地址的异步通知,必须由商家服务端通过 `alipay.trade.query` 主动确认支付结果,校验订单、金额、支付状态及归属,幂等更新订单;即使用户关闭页面,仍须继续处理查询重试和未决订单。如使用异步通知,配置商家已部署、支付宝服务端可公网访问的 HTTPS 地址并完成验签、关键字段校验、幂等、`success` 回写和补偿查询。不能只因没有公网通知地址阻止流程或判定不能上线;通知处理代码仍须实现,实际代码或支付结果确认链路缺陷仍是阻断项。
18
18
  9. **受控页面**:授权链接仅由 `auth.sh` 按固定产品/MCC 生成,只允许 `https://aipay.alipay.com/cli-auth` 及登记参数,禁用 CLI `verification_url`;公钥页和系统 opener 只走登记脚本。失败后宿主内置浏览器只可打开已交付的同一 URL 一次;仍失败才提示手动打开,再有限轮询。禁止搜索、改写或自动操作;opener/config 写失败不算业务失败。
19
19
  10. **对客输出**:指定 runner/renderer/脚本时,stdout 是唯一对客正文,须原文回复且不加旁白;工具输出记录、折叠面板或日志不等于已对客发送。展示命令只执行登记单条命令,禁 `2>&1`、管道、`grep/sed/awk/tee`、临时包装或拆回 `jq/printf/renderer`。除 `self_update.mjs` 的 `SELF_UPDATE:*` stderr 终态外,内部事实行均以 `ALIPAY_AIPAY_INTERNAL:` 开头;宿主合并输出时仍整行剔除,严禁对客。`integration.start.confirm`、`onboarding.plan.confirm`、`sandbox.configuration.pending`、`sandbox.environment.summary`、`integration.safety.closeout` 和 `integration.checklist.result` 成功渲染时必须各自产生唯一 `ALIPAY_AIPAY_INTERNAL:CUSTOMER_MESSAGE_DELIVERY_REQUIRED=<messageId>`;下一动作先将剔除内部行后的 stdout 原文作为独立可见消息送达,不得以工具面板、折叠输出、进度话术或最终答复代替,也不得在送达前继续调用工具。送达后同回合按 flow 继续,不等待回复。成功沙箱准备 `READY` 时 stdout 仍按 flow 静默,不构成交付消息;只有待配置正文和后置摘要需要交付。所有 `postRenderHintType=scanReturn` 的页面消息都是交付屏障(当前为 `auth.page`、`application.key.page`):先独立送达页面 stdout,再执行受控 opener 和有限轮询,不合并 pending/收口;不要求确认。阻塞正文后等待;剔除内部行后正文为空则直接转移。
20
20
  11. **确定性转移**:固定脚本终态后立即转移;只执行动作处登记命令,禁止追加 `jq/cat/grep/curl` 或临时脚本重复解析。失败只走登记恢复;项目自检不绕过 Skill 脚本或打印敏感配置。
@@ -92,4 +92,6 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" telemetry resolve-sessi
92
92
 
93
93
  `full_process` 代码开发方案送达前只准备项目、语言、系统分支环境和沙箱;Windows 未明确要求当前配置时记 `VERIFY_PENDING`,不收资料。方案送达后直接进入 Integration 步骤 3,满足条件自动进 Onboarding;仅沙箱待配置,或 READY 且只剩非阻塞人工验证时可部分通过,其他缺口停在 Integration;收口保留全部待办。用户中断后重新确认当前项目和服务端语言,从实际项目扫描恢复,不恢复旧方案状态。
94
94
 
95
+ checklist 的有限修复、禁止循环检测及局部修复后的定向复检只按 Integration flow 步骤 8 执行,不能因阶段重入重新运行全部测试。
96
+
95
97
  仅代码开发结束时提醒仍需产品开通;仅产品开通结束时提醒仍需代码开发。机器规则、消息目录、fixture 和测试不作为默认必读内容。
package/skill-pre/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.9-pre
1
+ 1.8.1-pre