@alipay/alipay-aipay 1.7.0 → 1.7.1

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 (169) hide show
  1. package/README.md +30 -0
  2. package/dist/commands/install-current.js +15 -7
  3. package/dist/commands/install.js +20 -16
  4. package/dist/commands/uninstall.js +8 -3
  5. package/dist/commands/update.js +34 -16
  6. package/dist/index.js +10 -4
  7. package/dist/utils/channels.js +67 -0
  8. package/dist/utils/config.js +15 -11
  9. package/dist/utils/file.js +23 -10
  10. package/dist/utils/npm.js +19 -33
  11. package/package.json +8 -3
  12. package/skill/SKILL.md +2 -0
  13. package/skill/references/normal/json/release-channel.json +1 -0
  14. package/skill/references/normal/scripts/self_update.mjs +62 -17
  15. package/skill/references/normal/self-update.md +3 -1
  16. package/skill-pre/SKILL.md +65 -0
  17. package/skill-pre/VERSION +1 -0
  18. package/skill-pre/references/integration/flow.md +602 -0
  19. package/skill-pre/references/integration/modules/alipay-sdk-reminder.md +281 -0
  20. package/skill-pre/references/integration/modules/checklist.md +154 -0
  21. package/skill-pre/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//345/274/202/346/255/245/351/200/232/347/237/245/345/244/204/347/220/206/344/273/243/347/240/201/347/244/272/344/276/213.md +199 -0
  22. package/skill-pre/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +68 -0
  23. package/skill-pre/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +83 -0
  24. package/skill-pre/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +80 -0
  25. package/skill-pre/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +73 -0
  26. 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 +62 -0
  27. 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 +132 -0
  28. package/skill-pre/references/integration/modules/code-examples/csharp/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +640 -0
  29. package/skill-pre/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//345/274/202/346/255/245/351/200/232/347/237/245/345/244/204/347/220/206/344/273/243/347/240/201/347/244/272/344/276/213.md +184 -0
  30. package/skill-pre/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +72 -0
  31. package/skill-pre/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +96 -0
  32. package/skill-pre/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +81 -0
  33. package/skill-pre/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +77 -0
  34. 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 +69 -0
  35. 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 +138 -0
  36. package/skill-pre/references/integration/modules/code-examples/java/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemoController.md +623 -0
  37. package/skill-pre/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//345/274/202/346/255/245/351/200/232/347/237/245/345/244/204/347/220/206/344/273/243/347/240/201/347/244/272/344/276/213.md +135 -0
  38. package/skill-pre/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +51 -0
  39. package/skill-pre/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +63 -0
  40. package/skill-pre/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +59 -0
  41. package/skill-pre/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +54 -0
  42. 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 +84 -0
  43. 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 +71 -0
  44. package/skill-pre/references/integration/modules/code-examples/nodejs/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +498 -0
  45. package/skill-pre/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//345/274/202/346/255/245/351/200/232/347/237/245/345/244/204/347/220/206/344/273/243/347/240/201/347/244/272/344/276/213.md +157 -0
  46. package/skill-pre/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +59 -0
  47. package/skill-pre/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +73 -0
  48. package/skill-pre/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +69 -0
  49. package/skill-pre/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +65 -0
  50. 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 +59 -0
  51. 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 +110 -0
  52. package/skill-pre/references/integration/modules/code-examples/php/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +806 -0
  53. package/skill-pre/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//345/274/202/346/255/245/351/200/232/347/237/245/345/244/204/347/220/206/344/273/243/347/240/201/347/244/272/344/276/213.md +128 -0
  54. package/skill-pre/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +57 -0
  55. package/skill-pre/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +70 -0
  56. package/skill-pre/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +65 -0
  57. package/skill-pre/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +62 -0
  58. 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 +51 -0
  59. 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 +47 -0
  60. package/skill-pre/references/integration/modules/code-examples/python/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.md +541 -0
  61. package/skill-pre/references/integration/modules/interface-contract/aipay-interface-contract.md +52 -0
  62. package/skill-pre/references/integration/modules/interface-contract/apppay-interface-contract.md +45 -0
  63. package/skill-pre/references/integration/modules/interface-contract/common-trade-contract.md +42 -0
  64. package/skill-pre/references/integration/modules/interface-contract/notify-url-contract.md +68 -0
  65. package/skill-pre/references/integration/modules/interface-contract/webpay-interface-contract.md +44 -0
  66. package/skill-pre/references/integration/modules/interface-guide.md +61 -0
  67. package/skill-pre/references/integration/modules/product-decision.md +73 -0
  68. package/skill-pre/references/integration/modules/sandbox/a2m-sandbox-test.md +235 -0
  69. package/skill-pre/references/integration/modules/sandbox/alipay-sandbox-tool.md +142 -0
  70. package/skill-pre/references/integration/modules/sandbox/sandbox-setup-guide.md +239 -0
  71. package/skill-pre/references/integration/modules/scripts/local_402_sandbox_pay.py +900 -0
  72. package/skill-pre/references/integration/modules/scripts/sandbox_config.sh +347 -0
  73. package/skill-pre/references/integration/modules/troubleshooting-flow.md +28 -0
  74. package/skill-pre/references/normal/alipay-cli-env.md +169 -0
  75. package/skill-pre/references/normal/conversation-telemetry.md +101 -0
  76. package/skill-pre/references/normal/full-process-routing.md +92 -0
  77. package/skill-pre/references/normal/integration-worker.md +90 -0
  78. package/skill-pre/references/normal/json/customer-messages.json +1 -0
  79. package/skill-pre/references/normal/json/managed-jq-assets.json +1 -0
  80. package/skill-pre/references/normal/json/policy-rules.json +1 -0
  81. package/skill-pre/references/normal/json/release-channel.json +1 -0
  82. package/skill-pre/references/normal/rejection-guide.md +41 -0
  83. package/skill-pre/references/normal/scripts/agent_platform.mjs +43 -0
  84. package/skill-pre/references/normal/scripts/alipay_cli_env.mjs +34 -0
  85. package/skill-pre/references/normal/scripts/alipay_cli_env.sh +55 -0
  86. package/skill-pre/references/normal/scripts/alipay_cli_refresh.mjs +129 -0
  87. package/skill-pre/references/normal/scripts/auth_runtime_runner.mjs +60 -0
  88. package/skill-pre/references/normal/scripts/checklist_sections.mjs +43 -0
  89. package/skill-pre/references/normal/scripts/common.sh +365 -0
  90. package/skill-pre/references/normal/scripts/conversation_telemetry.mjs +105 -0
  91. package/skill-pre/references/normal/scripts/detect_dev_tool.sh +79 -0
  92. package/skill-pre/references/normal/scripts/flow_loader.mjs +237 -0
  93. package/skill-pre/references/normal/scripts/integration_context_runner.mjs +151 -0
  94. package/skill-pre/references/normal/scripts/integration_message_runner.mjs +1456 -0
  95. package/skill-pre/references/normal/scripts/interaction_reply.mjs +140 -0
  96. package/skill-pre/references/normal/scripts/managed_jq.mjs +215 -0
  97. package/skill-pre/references/normal/scripts/onboarding_discovery_runner.mjs +387 -0
  98. package/skill-pre/references/normal/scripts/onboarding_message_runner.mjs +1425 -0
  99. package/skill-pre/references/normal/scripts/onboarding_recovery_runner.mjs +100 -0
  100. package/skill-pre/references/normal/scripts/open_official_url.sh +205 -0
  101. package/skill-pre/references/normal/scripts/platform_compat.mjs +42 -0
  102. package/skill-pre/references/normal/scripts/preview_runtime.mjs +151 -0
  103. package/skill-pre/references/normal/scripts/project_route_inspector.sh +132 -0
  104. package/skill-pre/references/normal/scripts/python_script_runner.mjs +58 -0
  105. package/skill-pre/references/normal/scripts/render_customer_message.mjs +1792 -0
  106. package/skill-pre/references/normal/scripts/runtime.mjs +271 -0
  107. package/skill-pre/references/normal/scripts/self_update.mjs +376 -0
  108. package/skill-pre/references/normal/scripts/telemetry.mjs +2102 -0
  109. package/skill-pre/references/normal/self-update.md +7 -0
  110. package/skill-pre/references/normal/telemetry.md +70 -0
  111. package/skill-pre/references/onboarding/assets/keygen.html +926 -0
  112. package/skill-pre/references/onboarding/flow.md +595 -0
  113. package/skill-pre/references/onboarding/modules/app-release.md +90 -0
  114. package/skill-pre/references/onboarding/modules/authorization.md +43 -0
  115. package/skill-pre/references/onboarding/modules/error-handling.md +62 -0
  116. package/skill-pre/references/onboarding/modules/product-sign.md +49 -0
  117. package/skill-pre/references/onboarding/modules/scripts/app.sh +1485 -0
  118. package/skill-pre/references/onboarding/modules/scripts/ar_sign_apply.sh +331 -0
  119. package/skill-pre/references/onboarding/modules/scripts/auth.sh +1040 -0
  120. package/skill-pre/references/onboarding/modules/scripts/download_key_tool.sh +4 -0
  121. package/skill-pre/references/onboarding/modules/scripts/error_handler.sh +841 -0
  122. package/skill-pre/references/onboarding/modules/scripts/mcc.sh +1085 -0
  123. package/skill-pre/references/onboarding/modules/scripts/network_retry.sh +135 -0
  124. package/skill-pre/references/onboarding/modules/scripts/query_sign_status.sh +105 -0
  125. package/skill-pre/references/onboarding/modules/scripts/service.sh +528 -0
  126. package/skill-pre/references/onboarding/modules/scripts/sign_status_parser.sh +58 -0
  127. package/skill-pre/references/onboarding/modules/scripts/upload_screenshots.sh +208 -0
  128. package/skill-pre/references/onboarding/modules/scripts/upload_special_license.sh +195 -0
  129. package/skill-pre/references/onboarding/modules/service-registration.md +40 -0
  130. package/skill-pre/references/runtime-entry.md +97 -0
  131. package/dist/commands/install-current.d.ts +0 -4
  132. package/dist/commands/install-current.d.ts.map +0 -1
  133. package/dist/commands/install-current.js.map +0 -1
  134. package/dist/commands/install.d.ts +0 -10
  135. package/dist/commands/install.d.ts.map +0 -1
  136. package/dist/commands/install.js.map +0 -1
  137. package/dist/commands/prepare-tools.d.ts +0 -5
  138. package/dist/commands/prepare-tools.d.ts.map +0 -1
  139. package/dist/commands/prepare-tools.js.map +0 -1
  140. package/dist/commands/uninstall.d.ts +0 -10
  141. package/dist/commands/uninstall.d.ts.map +0 -1
  142. package/dist/commands/uninstall.js.map +0 -1
  143. package/dist/commands/update.d.ts +0 -10
  144. package/dist/commands/update.d.ts.map +0 -1
  145. package/dist/commands/update.js.map +0 -1
  146. package/dist/index.d.ts +0 -2
  147. package/dist/index.d.ts.map +0 -1
  148. package/dist/index.js.map +0 -1
  149. package/dist/types.d.ts +0 -42
  150. package/dist/types.d.ts.map +0 -1
  151. package/dist/types.js.map +0 -1
  152. package/dist/utils/alipay-cli.d.ts +0 -20
  153. package/dist/utils/alipay-cli.d.ts.map +0 -1
  154. package/dist/utils/alipay-cli.js.map +0 -1
  155. package/dist/utils/config.d.ts +0 -52
  156. package/dist/utils/config.d.ts.map +0 -1
  157. package/dist/utils/config.js.map +0 -1
  158. package/dist/utils/file.d.ts +0 -77
  159. package/dist/utils/file.d.ts.map +0 -1
  160. package/dist/utils/file.js.map +0 -1
  161. package/dist/utils/jq.d.ts +0 -17
  162. package/dist/utils/jq.d.ts.map +0 -1
  163. package/dist/utils/jq.js.map +0 -1
  164. package/dist/utils/npm.d.ts +0 -17
  165. package/dist/utils/npm.d.ts.map +0 -1
  166. package/dist/utils/npm.js.map +0 -1
  167. package/dist/utils/shell.d.ts +0 -24
  168. package/dist/utils/shell.d.ts.map +0 -1
  169. package/dist/utils/shell.js.map +0 -1
package/dist/utils/npm.js CHANGED
@@ -1,38 +1,24 @@
1
1
  import semver from 'semver';
2
- import { getPackageVersion } from './config.js';
3
- import { execCommand } from './shell.js';
4
- const PACKAGE_NAME = '@alipay/alipay-aipay';
5
- /**
6
- * 从 npm registry 获取最新版本
7
- */
8
- export async function getLatestVersion() {
9
- try {
10
- const { stdout } = await execCommand(`npm view ${PACKAGE_NAME} version --json`, 10000);
11
- const version = stdout.trim().replace(/"/g, '');
12
- return semver.valid(version);
13
- }
14
- catch {
15
- // 包可能还不存在,或者是网络问题
16
- return null;
2
+ import { execFile } from 'child_process';
3
+ import { promisify } from 'util';
4
+ import { PACKAGE_ROOT } from './config.js';
5
+ import { getSkillVersion, skillVersionKind } from './channels.js';
6
+ const execFileAsync = promisify(execFile);
7
+ export async function getLatestVersion(channel = 'stable') {
8
+ const args = ['view', '@alipay/alipay-aipay@latest', 'version', 'alipayAipayChannels', '--json'];
9
+ const { stdout } = await execFileAsync(process.platform === 'win32' ? process.env.ComSpec || 'cmd.exe' : 'npm', process.platform === 'win32' ? ['/d', '/s', '/c', `npm.cmd ${args.join(' ')}`] : args, { timeout: 10000, windowsHide: true });
10
+ const metadata = JSON.parse(stdout);
11
+ const version = metadata.alipayAipayChannels?.[channel];
12
+ if (!semver.valid(metadata.version) || skillVersionKind(version, channel) !== 'release') {
13
+ throw new Error(`npm latest 缺少有效的 ${channel} 渠道版本信息`);
17
14
  }
15
+ return version;
18
16
  }
19
- /**
20
- * 检查是否需要更新
21
- */
22
- export async function checkForUpdates() {
23
- const current = getPackageVersion();
24
- const latest = await getLatestVersion();
25
- if (!latest) {
26
- return {
27
- current,
28
- latest: current,
29
- needsUpdate: false,
30
- };
31
- }
32
- return {
33
- current,
34
- latest,
35
- needsUpdate: semver.gt(latest, current),
36
- };
17
+ export async function checkForUpdates(channel = 'stable') {
18
+ const current = getSkillVersion(PACKAGE_ROOT, channel);
19
+ if (skillVersionKind(current, channel) === 'beta')
20
+ return { current, latest: current, needsUpdate: false };
21
+ const latest = await getLatestVersion(channel);
22
+ return { current, latest, needsUpdate: semver.gt(latest, current) };
37
23
  }
38
24
  //# sourceMappingURL=npm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/alipay-aipay",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "支付宝 AI 付接入 Skill 安装包 - 优先安装 Agent Skill,并在 macOS/Linux 后台准备用户级 CLI 工具",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,8 +8,9 @@
8
8
  },
9
9
  "files": [
10
10
  "bin/",
11
- "dist/",
12
- "skill/"
11
+ "dist/**/*.js",
12
+ "skill/",
13
+ "skill-pre/"
13
14
  ],
14
15
  "scripts": {
15
16
  "build": "tsc",
@@ -52,5 +53,9 @@
52
53
  "@types/inquirer": "^9.0.7",
53
54
  "@types/semver": "^7.5.8",
54
55
  "typescript": "^5.3.3"
56
+ },
57
+ "alipayAipayChannels": {
58
+ "stable": "1.7.0",
59
+ "pre": "1.7.0-pre"
55
60
  }
56
61
  }
package/skill/SKILL.md CHANGED
@@ -11,6 +11,8 @@ description: >-
11
11
 
12
12
  ## 前置启动协议
13
13
 
14
+ 本目录的 `references/normal/json/release-channel.json` 固定当前渠道;正式版为 `stable`,预发版为 `pre`。自更新只比较 npm latest 元数据中的本渠道 Skill 版本与本地 `VERSION`,不以 npm 包版本判断是否需要更新,不切换或扫描另一渠道。缺少合法渠道元数据时保留当前版本。 本地 beta 测试版本固定使用当前版本,不查询 npm、不自动升级或转正;常规版本只接收本渠道非 beta 版本。此判断由同一自更新命令完成,Agent 不自行判断或修改 VERSION。
15
+
14
16
  本次 Agent 对话首次使用 `alipay-aipay` 时,先把本文件所在目录解析为规范化绝对路径 `<SKILL_DIR>`,记录一次性事实 `ALIPAY_AIPAY_SELF_UPDATE_CHECKED=true`,再执行以下单条命令。`<SKILL_DIR>` 是执行时替换的路径占位符;禁止用 shell 变量赋值、命令替换或依赖特定 shell:
15
17
 
16
18
  ```text
@@ -0,0 +1 @@
1
+ {"channel":"stable"}
@@ -167,8 +167,13 @@ function parseArgs(argv) {
167
167
  function parseVersion(value) {
168
168
  const raw = value.trim().replace(/^v/u, '');
169
169
  const match = raw.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/u);
170
- if (!match) return null;
171
- return { raw, major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]), prerelease: match[4]?.split('.') || [] };
170
+ if (!match || raw.length > 256) return null;
171
+ const prerelease = match[4]?.split('.') || [];
172
+ const build = raw.includes('+') ? raw.split('+')[1].split('.') : [];
173
+ if (![match[1], match[2], match[3]].every((value) => Number.isSafeInteger(Number(value)))) return null;
174
+ if (prerelease.some((value) => !value || (/^\d+$/u.test(value) && value.length > 1 && value[0] === '0'))) return null;
175
+ if (build.some((value) => !value)) return null;
176
+ return { raw, major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]), prerelease };
172
177
  }
173
178
 
174
179
  function compareIdentifiers(left, right) {
@@ -195,6 +200,25 @@ function compareVersions(left, right) {
195
200
  return 0;
196
201
  }
197
202
 
203
+ export function skillVersionKind(value, channel) {
204
+ if (typeof value !== 'string') return null;
205
+ const parsed = parseVersion(value);
206
+ if (!parsed) return null;
207
+ const suffix = parsed.prerelease.join('.');
208
+ if (suffix === (channel === 'pre' ? 'pre' : '')) return 'release';
209
+ const pattern = channel === 'pre' ? /^pre-beta(?:\d+|\.\d+)?$/u : /^beta(?:\d+|\.\d+)?$/u;
210
+ return pattern.test(suffix) ? 'beta' : null;
211
+ }
212
+
213
+ function readVersionFile(skillDir) {
214
+ try {
215
+ const file = path.join(skillDir, 'VERSION');
216
+ return isRegularFile(file) ? parseVersion(fs.readFileSync(file, 'utf8')) : null;
217
+ } catch {
218
+ return null;
219
+ }
220
+ }
221
+
198
222
  function readLocalVersion(skillDir) {
199
223
  try {
200
224
  const versionFile = path.join(skillDir, 'VERSION');
@@ -225,26 +249,41 @@ function packageManagerFailureKind(result) {
225
249
  return 'check';
226
250
  }
227
251
 
228
- async function npmLatest() {
252
+ function readChannel(skillDir) {
253
+ const source = fs.readFileSync(path.join(skillDir, 'SKILL.md'), 'utf8');
254
+ const declaredName = source.match(/^name:\s*(\S+)\s*$/m)?.[1];
255
+ const identity = declaredName === 'alipay-aipay-pre' ? 'pre' : 'stable';
256
+ const channelFile = path.join(skillDir, 'references', 'normal', 'json', 'release-channel.json');
257
+ if (!fs.existsSync(channelFile) && identity === 'stable') return 'stable';
258
+ if (!isRegularFile(channelFile)) throw new Error('invalid release channel');
259
+ const channel = JSON.parse(fs.readFileSync(channelFile, 'utf8')).channel;
260
+ if (!['stable', 'pre'].includes(channel) || channel !== identity) throw new Error('invalid release channel');
261
+ return channel;
262
+ }
263
+
264
+ async function npmLatest(channel) {
229
265
  if (selfUpdateNetworkRestricted()) return { ok: false, reason: 'skipped-network-restricted' };
230
266
  try {
231
- const result = await spawnPackageManager('npm', ['view', '@alipay/alipay-aipay', 'version', '--json'], {
267
+ const result = await spawnPackageManager('npm', ['view', '@alipay/alipay-aipay@latest', 'version', 'alipayAipayChannels', '--json'], {
232
268
  timeout: npmQueryTimeoutMs,
233
269
  });
234
270
  if (result.status !== 0 || result.error) return { ok: false, reason: packageManagerFailureKind(result) };
235
271
  const decoded = JSON.parse(result.stdout);
236
- const version = typeof decoded === 'string' ? parseVersion(decoded) : null;
237
- return version ? { ok: true, version } : { ok: false, reason: 'check' };
272
+ const packageVersion = typeof decoded?.version === 'string' ? parseVersion(decoded.version) : null;
273
+ const value = decoded?.alipayAipayChannels?.[channel];
274
+ const version = typeof value === 'string' ? parseVersion(value) : null;
275
+ return packageVersion && version && skillVersionKind(version.raw, channel) === 'release' ? { ok: true, version, packageVersion } : { ok: false, reason: 'check' };
238
276
  } catch {
239
277
  return { ok: false, reason: 'check' };
240
278
  }
241
279
  }
242
280
 
243
- function transactionArtifacts(skillDir, transactionId) {
281
+ function transactionArtifacts(skillDir, transactionId, channel) {
244
282
  const parent = path.dirname(skillDir);
283
+ const skillName = channel === 'pre' ? 'alipay-aipay-pre' : 'alipay-aipay';
245
284
  return {
246
- staging: path.join(parent, `.alipay-aipay-install-${transactionId}`),
247
- backup: path.join(parent, `.alipay-aipay-backup-${transactionId}`),
285
+ staging: path.join(parent, `.${skillName}-install-${transactionId}`),
286
+ backup: path.join(parent, `.${skillName}-backup-${transactionId}`),
248
287
  };
249
288
  }
250
289
 
@@ -252,8 +291,8 @@ function removeTransactionPath(target) {
252
291
  try { fs.rmSync(target, { recursive: true, force: true }); } catch {}
253
292
  }
254
293
 
255
- function reconcileInstallTransaction(skillDir, transactionId) {
256
- const artifacts = transactionArtifacts(skillDir, transactionId);
294
+ function reconcileInstallTransaction(skillDir, transactionId, channel) {
295
+ const artifacts = transactionArtifacts(skillDir, transactionId, channel);
257
296
  let current = readLocalVersion(skillDir);
258
297
  if (!current && isRecoverableSkillRoot(artifacts.backup)) {
259
298
  try {
@@ -267,14 +306,14 @@ function reconcileInstallTransaction(skillDir, transactionId) {
267
306
  return current;
268
307
  }
269
308
 
270
- async function installVersion(skillDir, version) {
309
+ async function installVersion(skillDir, packageVersion, channel) {
271
310
  const transactionId = randomUUID();
272
311
  const timeout = installTimeoutBudget();
273
312
  let result;
274
313
  try {
275
314
  result = await spawnPackageManager(
276
315
  'npx',
277
- ['-y', `@alipay/alipay-aipay@${version.raw}`, 'install-current'],
316
+ ['-y', `@alipay/alipay-aipay@${packageVersion.raw}`, 'install-current', '--channel', channel],
278
317
  {
279
318
  timeout,
280
319
  env: {
@@ -290,7 +329,7 @@ async function installVersion(skillDir, version) {
290
329
  return {
291
330
  ok: result.status === 0 && !result.error,
292
331
  reason: result.status === 0 && !result.error ? 'ok' : packageManagerFailureKind(result),
293
- version: reconcileInstallTransaction(skillDir, transactionId),
332
+ version: reconcileInstallTransaction(skillDir, transactionId, channel),
294
333
  };
295
334
  }
296
335
 
@@ -301,8 +340,14 @@ function reportOutcome(outcome) {
301
340
 
302
341
  export async function runSelfUpdateCli(argv = process.argv) {
303
342
  const skillDir = parseArgs(argv);
343
+ const channel = readChannel(skillDir);
304
344
  const local = readLocalVersion(skillDir);
305
- const checked = await npmLatest();
345
+ const installedVersion = readVersionFile(skillDir);
346
+ const kind = skillVersionKind(installedVersion?.raw, channel);
347
+ // A developer-installed beta is pinned, including when its entry is damaged.
348
+ if (kind === 'beta') return local ? { kind: 'CURRENT', version: local } : { kind: 'VERIFY_FAILED' };
349
+ if (installedVersion && !kind) return { kind: 'CHECK_FAILED' };
350
+ const checked = await npmLatest(channel);
306
351
  if (!checked.ok) {
307
352
  const current = readLocalVersion(skillDir);
308
353
  if (current && (!local || compareVersions(current, local) > 0)) return { kind: 'UPDATED', version: current };
@@ -314,9 +359,9 @@ export async function runSelfUpdateCli(argv = process.argv) {
314
359
  const latest = checked.version;
315
360
  if (local && compareVersions(local, latest) >= 0) return { kind: 'CURRENT', version: local };
316
361
 
317
- const installed = await installVersion(skillDir, latest);
362
+ const installed = await installVersion(skillDir, checked.packageVersion, channel);
318
363
  const updated = installed.version || readLocalVersion(skillDir);
319
- if (updated && compareVersions(updated, latest) >= 0) return { kind: 'UPDATED', version: updated };
364
+ if (updated && readChannel(skillDir) === channel && compareVersions(updated, latest) >= 0) return { kind: 'UPDATED', version: updated };
320
365
  if (installed.reason === 'network') return { kind: 'RETRY_WITH_NETWORK' };
321
366
  if (installed.reason === 'local') return { kind: 'CHECK_FAILED' };
322
367
  return { kind: installed.ok ? 'VERIFY_FAILED' : 'INSTALL_FAILED' };
@@ -2,4 +2,6 @@
2
2
 
3
3
  首次使用 `alipay-aipay` 前检查一次版本,记录 `ALIPAY_AIPAY_SELF_UPDATE_CHECKED=true`:`node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" self-update check --skill-dir "<SKILL_DIR>"`。`<SKILL_DIR>` 是当前包含 updater 的 Skill 规范化绝对路径,不得换成启动目录、项目目录、Home、npm 源码根或其他副本;命令不得改成变量赋值、命令替换、相对路径或特定 shell 语法;不透传 npm/npx 原始输出。
4
4
 
5
- 唯一 stderr 终态:`SELF_UPDATE:CURRENT=<合法 SemVer>`、`SELF_UPDATE:UPDATED=<合法 SemVer>`、`SELF_UPDATE:RETRY_WITH_NETWORK`、`SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED`、`SELF_UPDATE:CHECK_FAILED`、`SELF_UPDATE:INSTALL_FAILED`、`SELF_UPDATE:VERIFY_FAILED`。`UPDATED` 用原子替换后的新版,其余用当前可用版;marker 异常读当前入口,不得称最新或更新成功;停止读旧版,读取同一根目录的新版入口。仅 `RETRY_WITH_NETWORK` 可取权后原样重试一次,拒绝、不支持或再次返回时读当前入口;一次网络恢复外,不重查、取权、用 `sudo`、要求用户操作或写更新状态。每次只查一次 npm latest;`VERSION` 缺失、非法、落后或业务入口缺失时只安装精确版本一次。不调用公开 `install --target all`;超时终止同一次调用的进程树并清理。
5
+ 唯一 stderr 终态:`SELF_UPDATE:CURRENT=<合法 SemVer>`、`SELF_UPDATE:UPDATED=<合法 SemVer>`、`SELF_UPDATE:RETRY_WITH_NETWORK`、`SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED`、`SELF_UPDATE:CHECK_FAILED`、`SELF_UPDATE:INSTALL_FAILED`、`SELF_UPDATE:VERIFY_FAILED`。`UPDATED` 用原子替换后的新版,其余用当前可用版;marker 异常读当前入口,不得称最新或更新成功;停止读旧版,读取同一根目录的新版入口。仅 `RETRY_WITH_NETWORK` 可取权后原样重试一次,拒绝、不支持或再次返回时读当前入口;一次网络恢复外,不重查、取权、用 `sudo`、要求用户操作或写更新状态。每次只查一次 npm latest 的 `version` 和 `alipayAipayChannels`;只比较本渠道 Skill 版本,npm 包版本仅用于精确下载;`VERSION` 缺失、非法、落后或业务入口缺失时只从查询所得精确 npm 包版本安装当前渠道一次。渠道由当前目录的 `references/normal/json/release-channel.json` 与 Skill 名称共同校验;旧正式版缺少渠道文件时只兼容 `stable`,预发版禁止回退正式版。缺少或非法的远端渠道元数据返回 `CHECK_FAILED`,不得按 npm 包版本兜底。不调用公开 `install --target all`;超时终止同一次调用的进程树并清理。
6
+
7
+ 本地正式渠道的 `X.Y.Z-beta`、`X.Y.Z-betaN`(兼容 `-beta.N`)和预发渠道的 `X.Y.Z-pre-beta`、`X.Y.Z-pre-betaN` 均为固定测试版本。完整安装直接返回 `CURRENT` 且不查询 npm;业务入口损坏时返回 `VERIFY_FAILED`,仍不下载修复或转正。更换版本必须由测试人员显式执行 npm 安装器的 `install`,普通 `update` 同样不推进 beta。正常版本分别为 `X.Y.Z` 与 `X.Y.Z-pre`,远端对应渠道若为 beta 或名称不匹配,返回 `CHECK_FAILED`,不自动安装。beta 不参与版本排序,无自动追踪和自动转正。
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: alipay-aipay-pre
3
+ description: >-
4
+ 支付宝 AI 付接入 Skill 预发版。仅在用户明确选择预发版或点名 alipay-aipay-pre 时使用,支持 AI 按量付费、AI 网页应用收款、AI 移动应用收款的代码开发、产品开通和完整接入。普通支付宝接入请求使用正式版 alipay-aipay。
5
+ ---
6
+
7
+ # 支付宝 AI 付接入 Skill 启动器
8
+
9
+ 本文件负责确定本轮实际使用的 Skill 版本,展示内测版使用说明并取得用户的服务/采集选择,再刷新本机 `alipay-cli`。禁止在完成下列启动协议前读取 `references/runtime-entry.md`、任一 flow、模块、消息目录或业务脚本。声明展示前和用户选择前不得采集、缓存或上传任何会话正文;不补采同意前的触发消息、声明或其他历史消息。
10
+
11
+ ## 前置启动协议
12
+
13
+ 本目录的 `references/normal/json/release-channel.json` 固定当前渠道;正式版为 `stable`,预发版为 `pre`。自更新只比较 npm latest 元数据中的本渠道 Skill 版本与本地 `VERSION`,不以 npm 包版本判断是否需要更新,不切换或扫描另一渠道。缺少合法渠道元数据时保留当前版本。 本地 beta 测试版本固定使用当前版本,不查询 npm、不自动升级或转正;常规版本只接收本渠道非 beta 版本。此判断由同一自更新命令完成,Agent 不自行判断或修改 VERSION。
14
+
15
+ 本次 Agent 对话首次使用 `alipay-aipay-pre` 时,先把本文件所在目录解析为规范化绝对路径 `<SKILL_DIR>`,记录一次性事实 `ALIPAY_AIPAY_PRE_SELF_UPDATE_CHECKED=true`,再执行以下单条命令。`<SKILL_DIR>` 是执行时替换的路径占位符;禁止用 shell 变量赋值、命令替换或依赖特定 shell:
16
+
17
+ ```text
18
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" self-update check --skill-dir "<SKILL_DIR>"
19
+ ```
20
+
21
+ `SKILL_DIR` 必须绑定刚触发且正在执行本命令的 Skill 规范化绝对路径,不得换成 Agent 启动目录、用户项目目录、用户 Home、npm 包源码根或另一份 Skill 副本。`VERSION` 缺失/非法或 `references/runtime-entry.md` 缺失时由本命令尝试精确修复;命令失败或 marker 无法唯一解析时按 `SELF_UPDATE:CHECK_FAILED`。
22
+
23
+ stderr 只允许出现以下一个内部终态;不得向用户展示 marker 或 npm/npx 原始输出:
24
+
25
+ - `SELF_UPDATE:UPDATED=<合法 SemVer>`:当前 Skill 目录已原子切换到新版。
26
+ - `SELF_UPDATE:CURRENT=<合法 SemVer>`:继续当前版本。
27
+ - `SELF_UPDATE:RETRY_WITH_NETWORK`:registry 或安装阶段网络不可达;可申请联网后原样重试本命令一次。
28
+ - `SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED|CHECK_FAILED|INSTALL_FAILED|VERIFY_FAILED`:静默继续当前可用版本,不重试、不申请权限。
29
+
30
+ `UPDATED` 后先废弃旧 loaded 事实,禁止继续读取更新前版本的任何业务文档,后续命令使用新版同一 `SKILL_DIR`;其他终态继续当前可用版本,其他终态同样不再读取本启动器或 `self-update.md` 补充规则。
31
+
32
+ 版本确定后、任何 CLI 刷新、会话解析或业务入口加载前,必须先执行以下固定声明动作;自更新检查是此前唯一允许的动作:
33
+
34
+ ```text
35
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" preview notice
36
+ ```
37
+
38
+ 命令必须成功、stdout 非空且只有一个 `ALIPAY_AIPAY_INTERNAL:CUSTOMER_MESSAGE_DELIVERY_REQUIRED=preview.notice`。下一 Agent 动作必须把 stdout 按原文完整作为独立可见消息发送给用户;禁止概括、改写、删减、只留工具面板、合并业务方案或在送达前继续工具调用。完整送达后记录当前对话中与规范化 Skill 路径绑定的 `ALIPAY_AIPAY_PRE_NOTICE_DELIVERED=true`,立即结束当前回合并等待用户确认;有效选择前禁止刷新 CLI、读取业务入口、识别根意图或执行任何业务动作。失败或 marker 缺失/重复时停止启动,不能跳过声明。首次加载、切换预发版,或声明已确认事实无法确认时必须重新展示并等待确认。声明送达和确认事实都不落盘。此声明只维护在当前预发版消息目录。
39
+
40
+ 收到声明后的首条用户回复时,先从宿主明确身份确定 `AGENT_PLATFORM`(无法确认时用 `unknown`),执行一次以下只读命令取得稳定 `SESSION_ID`;同一对话已有可靠的该值时直接复用,不重新生成。该身份同时用于采集选择、对话采集和后续业务命令,不使用另一份随机 `CONVERSATION_SESSION_ID`。
41
+
42
+ ```text
43
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" telemetry resolve-session --agent-platform "<AGENT_PLATFORM>"
44
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" preview consent --reply "<USER_REPLY>" --input-id "<USER_INPUT_ID>" --agent-platform "<AGENT_PLATFORM>" --session-id "<SESSION_ID>"
45
+ ```
46
+
47
+ 两条命令分别执行;`USER_REPLY` 为当前回复原文,`USER_INPUT_ID` 为当前宿主对话全程唯一的非内容型幂等键,同一回复重试复用,不同回复使用新键,不随业务 run 重置,不得借用此前业务确认。仅 `确认` 与 `仅使用服务`(允许首尾空白、句末句号/感叹号)是本声明的有效选择,不使用通用业务确认解析器;`1`、`OK`、`继续`、否定、疑问或含糊回复均为 `PREVIEW_DECISION=UNCONFIRMED`,继续等待用户选择。用户未回复或不愿继续时不执行后续业务。
48
+
49
+ - `PREVIEW_DECISION=CONFIRMED` 或 `SERVICE_ONLY`:可记录与当前路径和版本绑定的 `ALIPAY_AIPAY_PRE_NOTICE_CONFIRMED=true` 并继续业务。此声明确认事实仍只保留当前对话上下文。
50
+ - 仅 `CONVERSATION_CONSENT=GRANTED` 且没有本轮采集失败事实时,先读取 `references/normal/conversation-telemetry.md`,以本次同意回复为第一条消息执行其中的 `start-conversation`。不得补采此前内容。已 ACTIVE 时沿用 `CONVERSATION_ID`,不得重复初始化。
51
+ - `CONVERSATION_CONSENT=DENIED|DISABLED|UNAVAILABLE`:当前对话停止传入会话正文,不调用采集或自动补建入口,业务照常继续;状态保存失败也按不采集处理,不宣称已保存选择。运行时的启动和消息入口还会校验持久化授权,未同意或已拒绝均不能采集。
52
+
53
+ `仅使用服务` 的拒绝按宿主会话 hash 独立保存,不随业务 run 结束、再次引用 Skill 或自更新清除。用户之后明确要求重新同意采集时,重新展示本声明并等待新的 `确认` 回复,再执行同一 consent 命令;不得把普通业务确认当成重新授权。用户中途要求停止采集时,立即执行 `node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" telemetry opt-out --input-id "<USER_INPUT_ID>" --session-id "<SESSION_ID>"`(有 ID 时附加 `--conversation-id "<CONVERSATION_ID>"`),停止传入后续正文;只有 `CONVERSATION_CONSENT=DENIED` 才可宣称选择已保存,失败不阻断业务。
54
+
55
+ 同一对话中确认事实、路径和当前预发版本均未变化时,材料回复、恢复、再次引用和子流程衔接不重复展示声明。路径或版本变化、上下文压缩导致确认事实不可用时重新展示并等待选择,但不得清除原有采集拒绝状态。会话身份无法可靠恢复时重新展示声明并取得选择,绝不根据旧确认事实自动授权新的会话身份。
56
+
57
+ 版本确定后,若当前上下文没有与规范化 `SKILL_DIR`、合法 `VERSION` 绑定的 `ALIPAY_AIPAY_PRE_CLI_REFRESHED=true`,必须刷新一次 `alipay-cli`;不得因自更新已检查而跳过。仅唯一终态 `READY` 可在当前对话上下文记录该成功事实、路径和版本,不写缓存或业务状态;三者仍可用且一致时,后续根触发、确认、补材料、候选选择、恢复、中断继续和 Full Process 衔接均不重复刷新。
58
+
59
+ ```text
60
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" env refresh-alipay-cli
61
+ ```
62
+
63
+ stderr 只允许一个 `ALIPAY_AIPAY_INTERNAL:ALIPAY_CLI_REFRESH=<READY|RETRY_WITH_NETWORK|RETRY_WITH_LOCAL_FS_PERMISSION|FAILED|VERIFY_FAILED>`,stdout 必须为空,安装器及版本输出不得对客。前两种重试终态分别只允许取得网络权限或 `~/.local/bin` 写权限后原样重试一次;其他终态静默继续,并以之后环境检查和业务脚本的实际 CLI 可用性为准。路径或版本变化、上下文压缩导致事实不可用、用户明确要求刷新,或环境检查证明 CLI 缺失/损坏时清除旧事实并按同一预算重试;非 `READY` 不得循环。
64
+
65
+ 完成本次所需刷新或命中成功事实后,只完整读取同一 `SKILL_DIR` 的 `references/runtime-entry.md`,在当前上下文记录 `ALIPAY_AIPAY_PRE_RUNTIME_ENTRY_LOADED=true` 和规范化路径,再按原请求路由。同一对话后续确认、补材料、候选选择、恢复、中断继续、重复触发和 Full Process 衔接,入口事实存在、路径未变且入口规则仍在时,跳过版本检查和入口重读。仅 `UPDATED`、路径变化或上下文压缩导致规则不可用时重读;事实不落盘。
@@ -0,0 +1 @@
1
+ 1.7.0-pre