@alipay/alipay-aipay 1.2.2 → 1.4.9
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/README.md +5 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +13 -12
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +17 -9
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +5 -5
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +5 -3
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +34 -12
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/file.d.ts +8 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +161 -9
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/jq.d.ts.map +1 -1
- package/dist/utils/jq.js +8 -0
- package/dist/utils/jq.js.map +1 -1
- package/package.json +6 -5
- package/skill/SKILL.md +15 -169
- package/skill/VERSION +1 -1
- package/skill/references/integration/flow.md +321 -292
- package/skill/references/integration/modules/alipay-sdk-reminder.md +5 -3
- package/skill/references/integration/modules/checklist.md +41 -27
- package/skill/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
- 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 +8 -4
- 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 +6 -2
- package/skill/references/integration/modules/code-examples/csharp/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.cs +3 -1
- package/skill/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
- 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 +4 -1
- 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 +5 -2
- package/skill/references/integration/modules/code-examples/java/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemoController.java +3 -1
- package/skill/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
- 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 +16 -10
- 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 +10 -4
- package/skill/references/integration/modules/code-examples/nodejs/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.js +2 -1
- package/skill/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
- 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 +4 -1
- 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 +5 -2
- package/skill/references/integration/modules/code-examples/php/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.php +2 -1
- package/skill/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
- 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 +4 -1
- 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 +5 -1
- package/skill/references/integration/modules/code-examples/python/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.py +4 -2
- package/skill/references/integration/modules/interface-contract/aipay-interface-contract.md +53 -0
- package/skill/references/integration/modules/interface-contract/apppay-interface-contract.md +45 -0
- package/skill/references/integration/modules/interface-contract/common-trade-contract.md +42 -0
- package/skill/references/integration/modules/interface-contract/notify-url-contract.md +68 -0
- package/skill/references/integration/modules/interface-contract/webpay-interface-contract.md +44 -0
- package/skill/references/integration/modules/interface-guide.md +37 -72
- package/skill/references/integration/modules/product-decision.md +10 -27
- package/skill/references/integration/modules/sandbox/a2m-sandbox-test.md +62 -94
- package/skill/references/integration/modules/sandbox/alipay-sandbox-tool.md +43 -40
- package/skill/references/integration/modules/sandbox/sandbox-setup-guide.md +93 -114
- package/skill/references/integration/modules/scripts/local_402_sandbox_pay.py +357 -147
- package/skill/references/integration/modules/scripts/sandbox_config.sh +299 -0
- package/skill/references/integration/modules/troubleshooting-flow.md +28 -0
- package/skill/references/normal/alipay-cli-env.md +15 -5
- package/skill/references/normal/full-process-routing.md +80 -0
- package/skill/references/normal/json/customer-messages.json +937 -0
- package/skill/references/normal/json/policy-rules.json +179 -0
- package/skill/references/normal/rejection-guide.md +11 -6
- package/skill/references/normal/scripts/alipay_cli_env.mjs +29 -0
- package/skill/references/normal/scripts/alipay_cli_env.sh +21 -0
- package/skill/references/normal/scripts/common.sh +87 -0
- package/skill/references/normal/scripts/detect_dev_tool.sh +5 -1
- package/skill/references/normal/scripts/integration_message_runner.mjs +801 -0
- package/skill/references/normal/scripts/onboarding_message_runner.mjs +436 -0
- package/skill/references/normal/scripts/open_official_url.sh +82 -0
- package/skill/references/normal/scripts/platform_compat.mjs +39 -0
- package/skill/references/normal/scripts/project_route_inspector.sh +132 -0
- package/skill/references/normal/scripts/python_script_runner.mjs +56 -0
- package/skill/references/normal/scripts/render_customer_message.mjs +1263 -0
- package/skill/references/normal/scripts/self_update.mjs +160 -0
- package/skill/references/normal/scripts/telemetry.mjs +1278 -0
- package/skill/references/normal/self-update.md +18 -51
- package/skill/references/onboarding/flow.md +381 -283
- package/skill/references/onboarding/modules/app-release.md +132 -179
- package/skill/references/onboarding/modules/authorization.md +53 -64
- package/skill/references/onboarding/modules/error-handling.md +31 -34
- package/skill/references/onboarding/modules/product-sign.md +62 -66
- package/skill/references/onboarding/modules/scripts/app.sh +397 -158
- package/skill/references/onboarding/modules/scripts/ar_sign_apply.sh +38 -22
- package/skill/references/onboarding/modules/scripts/auth.sh +479 -167
- package/skill/references/onboarding/modules/scripts/download_key_tool.sh +157 -0
- package/skill/references/onboarding/modules/scripts/error_handler.sh +100 -130
- package/skill/references/onboarding/modules/scripts/network_retry.sh +96 -0
- package/skill/references/onboarding/modules/scripts/query_sign_status.sh +17 -70
- package/skill/references/onboarding/modules/scripts/service.sh +153 -89
- package/skill/references/onboarding/modules/scripts/sign_status_parser.sh +58 -0
- package/skill/references/onboarding/modules/scripts/upload_screenshots.sh +16 -14
- package/skill/references/onboarding/modules/service-registration.md +67 -72
- package/skill/references/runtime-entry.md +62 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"rules": [
|
|
4
|
+
{
|
|
5
|
+
"policyId": "P-MCP-CONTRACT-FROZEN",
|
|
6
|
+
"scope": "all",
|
|
7
|
+
"severity": "critical",
|
|
8
|
+
"text": "只执行当前 Skill 已验证脚本中的 MCP 方法、参数和解析;禁止推断、改名、替换或尝试近似方法。"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"policyId": "P-AUTH-BEFORE-ONBOARDING",
|
|
12
|
+
"scope": "onboarding",
|
|
13
|
+
"severity": "critical",
|
|
14
|
+
"text": "登录、scope 和 MCC 全部校验通过前,禁止执行任何 onboarding 查询或写操作。"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"policyId": "P-WRITE-CONFIRM",
|
|
18
|
+
"scope": "onboarding.write",
|
|
19
|
+
"severity": "critical",
|
|
20
|
+
"text": "签约材料完整且校验通过后直接执行签约提交,不再增加回复1;材料缺失或校验失败时继续使用受控材料提示,禁止提交。服务创建资料完整且校验通过后展示受控创建摘要并直接执行,不增加回复1;服务修改执行前必须展示当前会话、脱敏主体、产品、动作和目标摘要,并取得绑定当前摘要的明确确认。应用创建由用户针对当前应用候选列表明确选择新建来确认,候选重查未变化且条件字段齐备时不再追加回复1;用户提供应用公钥后生成确认页不重复确认,由用户在官方页面完成公钥确认;新建应用的公钥校验成功后直接提交应用审核,不再增加回复1。"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"policyId": "P-WRITE-UNKNOWN",
|
|
24
|
+
"scope": "onboarding.write",
|
|
25
|
+
"severity": "critical",
|
|
26
|
+
"text": "非幂等写操作结果不明时先用现有只读能力核验;无法确认时进入 UNKNOWN,禁止盲目重试。"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"policyId": "P-PARTIAL-RESULT",
|
|
30
|
+
"scope": "onboarding",
|
|
31
|
+
"severity": "critical",
|
|
32
|
+
"text": "签约、服务和应用分支独立记录结果,不回滚已成功动作,不用整体失败或整体成功覆盖部分结果。"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"policyId": "P-MATERIAL-CATEGORY",
|
|
36
|
+
"scope": "onboarding.materials",
|
|
37
|
+
"severity": "required",
|
|
38
|
+
"text": "每轮只展示一个材料类别,同类一次收齐;提前提供的后续材料直接接收并校验,之后不重复索取。"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"policyId": "P-KEY-NO-PRIVATE",
|
|
42
|
+
"scope": "onboarding.application",
|
|
43
|
+
"severity": "critical",
|
|
44
|
+
"text": "不得请求、读取、处理、保存或输出生产应用私钥;本轮不提供本地命令生成密钥能力。"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"policyId": "P-KEY-PUBLIC-USER",
|
|
48
|
+
"scope": "onboarding.application",
|
|
49
|
+
"severity": "critical",
|
|
50
|
+
"text": "应用公钥只能由用户自行生成并明确提供;缺少公钥时禁止调用 createKeyConfirmPage,不补全、不改写、不加 PEM 头尾。"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"policyId": "P-AUTH-URL",
|
|
54
|
+
"scope": "onboarding.authorization",
|
|
55
|
+
"severity": "critical",
|
|
56
|
+
"text": "授权链接只能由 auth.sh 在固定产品/MCC 上下文校验通过后构造;只允许 https://aipay.alipay.com/cli-auth、deviceCode/productCode/mccCode 和可选 platform,禁止其他域名、路径、参数、重复参数、fragment 或 verification_url。"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"policyId": "P-KEY-URL",
|
|
60
|
+
"scope": "onboarding.application",
|
|
61
|
+
"severity": "critical",
|
|
62
|
+
"text": "公钥确认只展示 createKeyConfirmPage 返回的 confirmPageUrl 裸 URL;禁止展示二维码链接和 alipays:// 深链。"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"policyId": "P-URL-AUTO-OPEN",
|
|
66
|
+
"scope": "official-url",
|
|
67
|
+
"severity": "critical",
|
|
68
|
+
"text": "授权页和公钥确认页在 URL 完整校验通过后默认调用受控 opener;失败、无 GUI 或宿主要求权限时保留同一裸 URL 和复制访问兜底。"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"policyId": "P-KEY-TOOL-DOWNLOAD",
|
|
72
|
+
"scope": "onboarding.application",
|
|
73
|
+
"severity": "critical",
|
|
74
|
+
"text": "缺少应用公钥时按当前操作系统自动下载官方密钥工具并输出实际安装包路径、安装引导和官方文档兜底;只下载,不安装、不启动、不生成密钥,失败或系统不支持时只输出官方文档手动下载引导。"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"policyId": "P-A2M-SANDBOX",
|
|
78
|
+
"scope": "integration.aipay",
|
|
79
|
+
"severity": "critical",
|
|
80
|
+
"text": "按量付费沙箱 serviceId 固定为 api_mock_service_id,SDK 使用沙箱网关;生产网关和真实 serviceId 只用于正式配置。"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"policyId": "P-A2M-SUCCESS",
|
|
84
|
+
"scope": "integration.aipay",
|
|
85
|
+
"severity": "critical",
|
|
86
|
+
"text": "自动联调只有在 HTTP 200、非空可归属资源、无明确业务失败且适用 Payment-Validation 有效时通过。"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"policyId": "P-SANDBOX-CREDENTIAL-EXCEPTION",
|
|
90
|
+
"scope": "integration.sandbox",
|
|
91
|
+
"severity": "critical",
|
|
92
|
+
"text": "Unix/macOS/Linux 只允许快速沙箱实际返回且已校验的买家登录/支付密码在沙箱摘要和付款体验中经 stdin 临时渲染。Windows 手工沙箱允许用户在 sandbox.windows.manual_setup 后提供当前沙箱应用的 APPID、支付宝公钥、应用公钥、与当前开发语言匹配的应用私钥和沙箱账号信息;Agent 只能将其用于已确认目标项目的受保护配置,不得在回复、摘要、普通日志或业务状态中复述或另存原文。两类例外均不得扩展到生产环境账号、应用私钥或密码。"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"policyId": "P-SENSITIVE-STATE",
|
|
96
|
+
"scope": "all",
|
|
97
|
+
"severity": "critical",
|
|
98
|
+
"text": "用户可以为当前应用设钥明确提供应用公钥,但该输入只用于本次 app.sh key/verify-key/verify-key-and-audit 调用;Agent 回复、对话摘要、普通日志、跨会话状态和宽权限临时文件禁止复述或保存公钥原文。除 P-SANDBOX-CREDENTIAL-EXCEPTION 明确允许的 Windows 手工沙箱当前资料输入外,私钥、token、Payment-Proof、签名串、完整支付表单和未脱敏 MCP 响应同样禁止进入这些位置。临时 URL 只有在 flow 明确登记、已由脚本或 renderer 完成白名单及当前上下文校验且当前动作必须对客展示时,才允许进入该动作的唯一对客正文;即使获准展示,也禁止进入对话摘要、普通日志、跨会话状态或宽权限临时文件。"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"policyId": "P-PROJECT-PROTECT",
|
|
102
|
+
"scope": "integration",
|
|
103
|
+
"severity": "critical",
|
|
104
|
+
"text": "不得清空、覆盖或删除用户既有项目;只在已确认目标路径和范围内做必要修改。"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"policyId": "P-CUSTOMER-OUTPUT-EXCLUSIVE",
|
|
108
|
+
"scope": "all",
|
|
109
|
+
"severity": "critical",
|
|
110
|
+
"text": "flow 指定 renderer 或托管脚本时,其 stdout 是该动作唯一对客正文;工具输出记录、折叠面板或日志不等于已对客发送,Agent 必须把 stdout 原文作为当前回复正文发给用户。禁止在前后添加执行说明、消息 ID、控制标记、摘要、转述或近似话术。阻塞消息发出后立即停止本轮并等待用户。"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"policyId": "P-ONBOARDING-CONTROL-CHANNEL",
|
|
114
|
+
"scope": "onboarding",
|
|
115
|
+
"severity": "critical",
|
|
116
|
+
"text": "Onboarding 登记脚本的内部事实行统一以 ALIPAY_AIPAY_INTERNAL: 开头;即使宿主合并 stdout/stderr,也必须整行剔除后再判断对客正文。内部行严禁对客;成功且剔除内部行后正文为空时直接转移,不补写话术。"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"policyId": "P-SCAN-PAGE-DELIVERY-BARRIER",
|
|
120
|
+
"scope": "onboarding",
|
|
121
|
+
"severity": "critical",
|
|
122
|
+
"text": "所有 `postRenderHintType=scanReturn` 的页面消息都是交付屏障,当前包括 `auth.page` 和 `application.key.page`。脚本产生页面 stdout 后,Agent 必须先把剔除内部事实后的 stdout 作为独立对客消息送达,再执行对应 opener 和后续有限轮询;不得把后续 `auth.pending`、`application.key.pending`、`process.partial_result` 或其他 stdout 合并在同一条对客回复中。该屏障不等待用户确认,不新增回复 `1` 或其他用户操作。"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"policyId": "P-DETERMINISTIC-HANDOFF",
|
|
126
|
+
"scope": "all",
|
|
127
|
+
"severity": "critical",
|
|
128
|
+
"text": "flow 已登记脚本或 renderer 时只执行动作发生位置的固定命令;退出码和登记终态标记满足后立即按 flow 转移,禁止追加 jq、cat、grep、curl 或临时脚本重复解析、复核或解释同一结果。失败只走登记恢复分支;项目代码实现和运行验证除外,但不得把沙箱配置或其他敏感文件打印到工具输出。"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"officialUrls": {
|
|
132
|
+
"aipaySite": "https://aipay.alipay.com/",
|
|
133
|
+
"aipaySkillSite": "https://aipay.alipay.com/?from=alipay-aipay-skill",
|
|
134
|
+
"merchantPlatform": "https://b.alipay.com/page/portal/home",
|
|
135
|
+
"openPlatform": "https://open.alipay.com/",
|
|
136
|
+
"openPlatformHome": "https://open.alipay.com",
|
|
137
|
+
"technicalSupport": "https://opensupport.alipay.com/support/intelligent-services?form=payskill",
|
|
138
|
+
"keyToolManual": "https://opendocs.alipay.com/isv/02kipk",
|
|
139
|
+
"keyToolMac": "https://ideservice.alipay.com/ide/getPluginUrl.htm?clientType=assistant&platform=mac&channelType=WEB",
|
|
140
|
+
"keyToolWindows": "https://ideservice.alipay.com/ide/getPluginUrl.htm?clientType=assistant&platform=win&channelType=WEB",
|
|
141
|
+
"androidSandboxAlipay": "https://mdn.alipayobjects.com/sandboxsys/afts/img/_itHRrdOD9oAAAAAAAAAAAAADgSLAQBr/original",
|
|
142
|
+
"sandboxToolFallback": "https://open.alipay.com/develop/sandbox/tool",
|
|
143
|
+
"sandboxGateway": "https://openapi-sandbox.dl.alipaydev.com/gateway.do",
|
|
144
|
+
"productionGateway": "https://openapi.alipay.com/gateway.do",
|
|
145
|
+
"openPlatformPaySkill": "https://open.alipay.com?form=payskill",
|
|
146
|
+
"traditionalPaymentSkill": "https://github.com/alipay/ai/tree/main/skills"
|
|
147
|
+
},
|
|
148
|
+
"authorizationProducts": [
|
|
149
|
+
{
|
|
150
|
+
"productName": "按量付费",
|
|
151
|
+
"salesCode": "I1080300001000160457",
|
|
152
|
+
"scope": "app:all,machine_pay:write,agmnt:write"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"productName": "网站支付",
|
|
156
|
+
"salesCode": "I1080300001000041203",
|
|
157
|
+
"scope": "app:all,fast_instant_trade_pay:write"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"productName": "APP 支付",
|
|
161
|
+
"salesCode": "I1080300001000041313",
|
|
162
|
+
"scope": "app:all,auth_alipay_apppay:write"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"temporaryUrlAllowlist": {
|
|
166
|
+
"authorization": {
|
|
167
|
+
"host": "aipay.alipay.com",
|
|
168
|
+
"path": "/cli-auth",
|
|
169
|
+
"requiredQueryParams": ["deviceCode", "productCode", "mccCode"],
|
|
170
|
+
"optionalQueryParams": ["platform"]
|
|
171
|
+
},
|
|
172
|
+
"publicKeyConfirmation": {
|
|
173
|
+
"host": "aipay.alipay.com",
|
|
174
|
+
"path": "/public-key-confirm",
|
|
175
|
+
"requiredQueryParams": ["keyConfirmToken"],
|
|
176
|
+
"optionalQueryParams": []
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
# 拒绝引导话术
|
|
2
2
|
|
|
3
3
|
> 本文件定义当用户咨询本 Skill 不支持的支付产品时的标准引导话术。
|
|
4
|
+
> 本文件位于 `references/normal/`,文中的 `scripts/...` 路径相对本目录。
|
|
4
5
|
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
## 标准拒绝引导
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
当用户提及以下不支持的产品时,使用 `json/customer-messages.json` 的 `product.unsupported`,传入用户实际产品名。必须执行:
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
```bash
|
|
13
|
+
MESSAGE_INPUT_JSON=$(jq -cn --arg productName "$PRODUCT_NAME" '{productName:$productName}')
|
|
14
|
+
printf '%s' "$MESSAGE_INPUT_JSON" | node scripts/render_customer_message.mjs product.unsupported --variant DEFAULT
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
支持范围、开放平台文档、传统支付集成 Skill 和商家平台链接只在消息目录维护;本文件不复制标准正文。
|
|
14
18
|
|
|
15
19
|
---
|
|
16
20
|
|
|
@@ -22,6 +26,7 @@
|
|
|
22
26
|
| 商家扣款 | 使用标准引导 |
|
|
23
27
|
| 订单码支付 | 使用标准引导 |
|
|
24
28
|
| 当面付 | 使用标准引导 |
|
|
29
|
+
| 付款码 | 使用标准引导 |
|
|
25
30
|
| JSAPI支付 | 使用标准引导 |
|
|
26
31
|
|
|
27
32
|
> “手机网站支付”“H5支付”只是用户对手机浏览器网页场景的叫法,在本 Skill 中统一归为**网站支付**,不作为独立产品处理,也不使用拒绝话术。
|
|
@@ -31,7 +36,7 @@
|
|
|
31
36
|
## 调用位置
|
|
32
37
|
|
|
33
38
|
本话术在以下位置被引用:
|
|
34
|
-
- `SKILL.md` →
|
|
39
|
+
- `SKILL.md` → 支持范围
|
|
35
40
|
- `../integration/modules/product-decision.md` → 不支持的产品
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
**重要**:如需修改对客文字或链接,只修改 `json/customer-messages.json` 与对应 `json/policy-rules.json` 官方 URL;本文件只维护适用语义。
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
|
|
5
|
+
import { checkCliEnvironment, isWindowsPlatform } from './platform_compat.mjs';
|
|
6
|
+
|
|
7
|
+
function main() {
|
|
8
|
+
if (process.argv[2] !== 'check' || process.argv.length !== 3) {
|
|
9
|
+
console.error('用法: node alipay_cli_env.mjs check');
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const windows = isWindowsPlatform();
|
|
15
|
+
const missing = checkCliEnvironment({
|
|
16
|
+
requireJq: !windows,
|
|
17
|
+
requireAlipayCli: !windows
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (missing.length === 0) {
|
|
21
|
+
console.log('CLI_ENV:READY');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
console.log('CLI_ENV:NEEDS_SETUP');
|
|
26
|
+
console.log(`CLI_ENV_MISSING=${missing.join(',')}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -u
|
|
4
|
+
|
|
5
|
+
if [ "${1:-}" != "check" ] || [ "$#" -ne 1 ]; then
|
|
6
|
+
echo "用法: bash alipay_cli_env.sh check" >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
MISSING=()
|
|
11
|
+
command -v node >/dev/null 2>&1 || MISSING+=("node")
|
|
12
|
+
command -v jq >/dev/null 2>&1 || MISSING+=("jq")
|
|
13
|
+
if ! command -v alipay-cli >/dev/null 2>&1 || ! alipay-cli version >/dev/null 2>&1; then
|
|
14
|
+
MISSING+=("alipay-cli")
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ "${#MISSING[@]}" -eq 0 ]; then
|
|
18
|
+
echo "CLI_ENV:READY"
|
|
19
|
+
else
|
|
20
|
+
printf 'CLI_ENV:NEEDS_SETUP\nCLI_ENV_MISSING=%s\n' "$(IFS=,; echo "${MISSING[*]}")"
|
|
21
|
+
fi
|
|
@@ -12,6 +12,24 @@ require_command() {
|
|
|
12
12
|
fi
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
emit_control() {
|
|
16
|
+
printf 'ALIPAY_AIPAY_INTERNAL:%s\n' "$*" >&2
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
validate_control_value() {
|
|
20
|
+
local value="${1:-}"
|
|
21
|
+
[ -n "$value" ] || return 1
|
|
22
|
+
! printf '%s' "$value" | LC_ALL=C grep -q '[[:cntrl:]]'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
emit_control_field() {
|
|
26
|
+
local name="${1:-}"
|
|
27
|
+
local value="${2:-}"
|
|
28
|
+
[[ "$name" =~ ^[A-Z][A-Z0-9_]*$ ]] || return 1
|
|
29
|
+
validate_control_value "$value" || return 1
|
|
30
|
+
printf 'ALIPAY_AIPAY_INTERNAL:%s=%s\n' "$name" "$value" >&2
|
|
31
|
+
}
|
|
32
|
+
|
|
15
33
|
init_dev_tool_name() {
|
|
16
34
|
if [ -n "${DEV_TOOL_NAME:-}" ] && [ "$DEV_TOOL_NAME" != "unknown" ]; then
|
|
17
35
|
export DEV_TOOL_NAME
|
|
@@ -30,3 +48,72 @@ init_dev_tool_name() {
|
|
|
30
48
|
|
|
31
49
|
export DEV_TOOL_NAME="${DEV_TOOL_NAME:-unknown}"
|
|
32
50
|
}
|
|
51
|
+
|
|
52
|
+
platform_project_id() {
|
|
53
|
+
local candidate
|
|
54
|
+
|
|
55
|
+
candidate="${COZE_PROJECT_ID:-${MEOO_PROJECT_ID:-}}"
|
|
56
|
+
if valid_platform_id "$candidate"; then
|
|
57
|
+
printf '%s' "$candidate"
|
|
58
|
+
return 0
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
if [ -n "${MIAODA:-}" ]; then
|
|
62
|
+
candidate="${VITE_APP_ID:-${PLATFORM_ID:-}}"
|
|
63
|
+
if valid_platform_id "$candidate"; then
|
|
64
|
+
printf '%s' "$candidate"
|
|
65
|
+
return 0
|
|
66
|
+
fi
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
return 1
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
valid_platform_id() {
|
|
73
|
+
local value="${1:-}"
|
|
74
|
+
[ -n "$value" ] || return 1
|
|
75
|
+
printf '%s' "$value" | LC_ALL=C grep -q '[^[:space:]]' || return 1
|
|
76
|
+
! printf '%s' "$value" | LC_ALL=C grep -q '[[:cntrl:],^=]'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
init_platform_id() {
|
|
80
|
+
local candidate marker COMMON_DIR TELEMETRY_SCRIPT
|
|
81
|
+
|
|
82
|
+
candidate="$(platform_project_id || true)"
|
|
83
|
+
if valid_platform_id "$candidate"; then
|
|
84
|
+
PLATFORM_ID="$candidate"
|
|
85
|
+
export PLATFORM_ID
|
|
86
|
+
return
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
candidate="${ALIPAY_AIPAY_RUN_ID:-${ALIPAY_AIPAY_FLOW_RUN_ID:-}}"
|
|
90
|
+
if valid_platform_id "$candidate"; then
|
|
91
|
+
PLATFORM_ID="$candidate"
|
|
92
|
+
export PLATFORM_ID
|
|
93
|
+
return
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
COMMON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
97
|
+
TELEMETRY_SCRIPT="${COMMON_DIR}/telemetry.mjs"
|
|
98
|
+
if [ ! -f "$TELEMETRY_SCRIPT" ] || ! command -v node >/dev/null 2>&1; then
|
|
99
|
+
return
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
marker="$(node "$TELEMETRY_SCRIPT" current-run-id 2>&1 >/dev/null || true)"
|
|
103
|
+
candidate="$(printf '%s\n' "$marker" | sed -n 's/^ALIPAY_AIPAY_INTERNAL:RUN_ID=//p' | head -n 1)"
|
|
104
|
+
if valid_platform_id "$candidate"; then
|
|
105
|
+
PLATFORM_ID="$candidate"
|
|
106
|
+
export PLATFORM_ID
|
|
107
|
+
return
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
if valid_platform_id "${PLATFORM_ID:-}"; then
|
|
111
|
+
export PLATFORM_ID
|
|
112
|
+
fi
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
init_alipay_cli_context() {
|
|
116
|
+
init_dev_tool_name
|
|
117
|
+
init_platform_id
|
|
118
|
+
export PLATFORM="${DEV_TOOL_NAME:-unknown}"
|
|
119
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# 功能描述: 智能识别 AI 编程工具,返回工具名称
|
|
5
5
|
# 调用位置: 集成流程和签约流程的环境检查
|
|
6
6
|
# 调用前置: 无
|
|
7
|
-
# 返回值: coze | meoo | claudeCode | codex | traeSolo | cursor | qoder | unknown
|
|
7
|
+
# 返回值: coze | meoo | miaoda | claudeCode | codex | traeSolo | cursor | qoder | unknown
|
|
8
8
|
#=============================================================================
|
|
9
9
|
|
|
10
10
|
detect_dev_tool() {
|
|
@@ -16,6 +16,10 @@ detect_dev_tool() {
|
|
|
16
16
|
echo "meoo"
|
|
17
17
|
return
|
|
18
18
|
fi
|
|
19
|
+
if [ -n "$MIAODA" ]; then
|
|
20
|
+
echo "miaoda"
|
|
21
|
+
return
|
|
22
|
+
fi
|
|
19
23
|
if [ -n "$CLAUDECODE" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then
|
|
20
24
|
echo "claudeCode"
|
|
21
25
|
return
|