@alipay/alipay-aipay 1.7.2 → 1.7.4

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 (55) hide show
  1. package/README.md +0 -18
  2. package/dist/commands/install.js +24 -17
  3. package/package.json +3 -3
  4. package/skill/SKILL.md +24 -2
  5. package/skill/VERSION +1 -1
  6. package/skill/references/normal/json/customer-messages.json +1 -1
  7. package/skill/references/normal/scripts/channel_offer.mjs +83 -0
  8. package/skill/references/normal/scripts/runtime.mjs +3 -1
  9. package/skill-pre/SKILL.md +27 -5
  10. package/skill-pre/VERSION +1 -1
  11. package/skill-pre/references/integration/flow.md +43 -25
  12. package/skill-pre/references/integration/modules/checklist.md +4 -4
  13. package/skill-pre/references/integration/modules/sandbox/sandbox-setup-guide.md +33 -33
  14. package/skill-pre/references/integration/modules/scripts/local_402_sandbox_pay.py +3 -3
  15. package/skill-pre/references/integration/modules/scripts/sandbox_config.sh +12 -2
  16. package/skill-pre/references/normal/alipay-cli-env.md +3 -1
  17. package/skill-pre/references/normal/conversation-telemetry.md +4 -2
  18. package/skill-pre/references/normal/full-process-routing.md +2 -2
  19. package/skill-pre/references/normal/json/customer-messages.json +1 -1
  20. package/skill-pre/references/normal/json/policy-rules.json +1 -1
  21. package/skill-pre/references/normal/scripts/alipay_cli_env.mjs +9 -0
  22. package/skill-pre/references/normal/scripts/alipay_cli_refresh.mjs +10 -1
  23. package/skill-pre/references/normal/scripts/auth_runtime_runner.mjs +4 -1
  24. package/skill-pre/references/normal/scripts/common.sh +11 -1
  25. package/skill-pre/references/normal/scripts/onboarding_discovery_runner.mjs +4 -1
  26. package/skill-pre/references/normal/scripts/onboarding_message_runner.mjs +10 -1
  27. package/skill-pre/references/normal/scripts/onboarding_recovery_runner.mjs +4 -1
  28. package/skill-pre/references/normal/scripts/open_official_url.sh +10 -2
  29. package/skill-pre/references/normal/scripts/preview_runtime.mjs +32 -2
  30. package/skill-pre/references/normal/scripts/python_script_runner.mjs +9 -4
  31. package/skill-pre/references/normal/scripts/render_customer_message.mjs +4 -2
  32. package/skill-pre/references/normal/scripts/runtime.mjs +50 -6
  33. package/skill-pre/references/normal/scripts/telemetry.mjs +9 -0
  34. package/skill-pre/references/normal/scripts/windows/acl-native.mjs +3 -0
  35. package/skill-pre/references/normal/scripts/windows/acl.mjs +41 -0
  36. package/skill-pre/references/normal/scripts/windows/bin/alipay-cli +4 -0
  37. package/skill-pre/references/normal/scripts/windows/bootstrap-node.ps1 +140 -0
  38. package/skill-pre/references/normal/scripts/windows/cli-install.mjs +51 -0
  39. package/skill-pre/references/normal/scripts/windows/cli-process.mjs +11 -0
  40. package/skill-pre/references/normal/scripts/windows/execution.mjs +51 -0
  41. package/skill-pre/references/normal/scripts/windows/git-discovery.mjs +42 -0
  42. package/skill-pre/references/normal/scripts/windows/policy.json +13 -0
  43. package/skill-pre/references/normal/scripts/windows/preflight.mjs +182 -0
  44. package/skill-pre/references/normal/scripts/windows/prepare.mjs +83 -0
  45. package/skill-pre/references/normal/scripts/windows/probe.sh +14 -0
  46. package/skill-pre/references/normal/scripts/windows/python-execution.mjs +38 -0
  47. package/skill-pre/references/normal/scripts/windows/python-runtime.mjs +85 -0
  48. package/skill-pre/references/normal/scripts/windows/routing.mjs +83 -0
  49. package/skill-pre/references/normal/scripts/windows/shell_helpers.sh +83 -0
  50. package/skill-pre/references/normal/windows-environment.md +82 -0
  51. package/skill-pre/references/onboarding/flow.md +4 -1
  52. package/skill-pre/references/onboarding/modules/scripts/app.sh +1 -0
  53. package/skill-pre/references/onboarding/modules/scripts/ar_sign_apply.sh +10 -6
  54. package/skill-pre/references/onboarding/modules/scripts/auth.sh +1 -0
  55. package/skill-pre/references/runtime-entry.md +13 -4
package/README.md CHANGED
@@ -15,21 +15,3 @@ npx -y @alipay/alipay-aipay@latest install --channel pre
15
15
  ```
16
16
 
17
17
  两份 Skill 可并存:正式版安装到 Agent 的 `skills/alipay-aipay/`,预发版安装到 `skills/alipay-aipay-pre/`。预发版使用独立名称 `alipay-aipay-pre`,在对话中明确点名或选择预发版使用。`--target` 的 Agent 目标选择规则不变。
18
-
19
- ```bash
20
- # 只更新或卸载预发版;省略 --channel pre 则只操作正式版
21
- npx -y @alipay/alipay-aipay@latest update --channel pre
22
- npx -y @alipay/alipay-aipay@latest uninstall --channel pre
23
- ```
24
-
25
- 安装记录、自更新和卸载按渠道隔离;`--target all` 也只操作所选渠道。两份 Skill 共用系统环境中的 alipay-cli 和 jq,卸载 Skill 不卸载这些工具。
26
-
27
- ## 维护与发布
28
-
29
- - `skill/` 是正式版源目录,`skill-pre/` 是可独立修改的预发版源目录,构建不会互相覆盖。
30
- - `package.json.version` 是 npm 分发包版本;`alipayAipayChannels.stable/pre` 分别对应两份 Skill 的 `VERSION`。安装器保留所选 Skill 的版本,不用包版本覆盖。
31
- - 每次发布提升 npm 包版本;只修改预发内容时,只提升预发 Skill 版本和相应元数据。正式版自更新发现自身版本未变时不下载安装。
32
- - 两份常规 Skill 自更新器都查询 npm `latest`,只比较自己的渠道版本,并从查询所得精确 npm 包版本中安装对应目录。元数据缺失、非法或为测试版本时保留本地,不切换渠道。
33
- - 正式版版本从 `1.7.0` 按 `1.7.1`、`1.7.2` 递增;预发版从 `1.7.0-pre` 按 `1.7.1-pre`、`1.7.2-pre` 递增。npm 包版本自此次拆分起独立维护。
34
- - 旧版 updater 首次升级前仍按 npm 包版本触发一次正式版迁移。正式版 VERSION 可保持 `1.7.0`;旧更新器可能在文件已迁移后返回内部 `VERIFY_FAILED`,启动器会继续读取当前可用入口,不阻塞业务。后续使用新渠道规则。
35
- - 本次预发版先复制正式版业务能力,后续定制直接修改 `skill-pre/`。对客消息、业务契约和发布校验仍遵循 `AGENTS.md`。
@@ -29,7 +29,8 @@ export async function installCommand(cwd, options = {}) {
29
29
  const { skillName: SKILL_NAME, displayName } = getChannelConfig(channel);
30
30
  const SKILLS = [{ name: SKILL_NAME, displayName }];
31
31
  const target = options.target ?? 'all';
32
- const skipTools = options.skipTools ?? false;
32
+ const deferWindowsTools = process.platform === 'win32' && !options.skipTools;
33
+ const skipTools = (options.skipTools ?? false) || deferWindowsTools;
33
34
  const jqRequired = isJqRequiredPlatform();
34
35
  const jqPreparationSupported = resolveManagedJqAsset() !== null;
35
36
  const installPlan = resolveInstallPlan(cwd, target, channel);
@@ -38,7 +39,9 @@ export async function installCommand(cwd, options = {}) {
38
39
  const targetDirLabels = contexts.map((ctx) => ctx.targetDirLabel);
39
40
  const targetSkillDirs = contexts.map((ctx) => path.join(ctx.targetDir, SKILL_NAME));
40
41
  console.log(chalk.cyan.bold(`\n🚀 @alipay/alipay-aipay ${channel} v${version}\n`));
41
- console.log(chalk.gray('优先安装 Skill 文件;alipay-cli 和用户级 jq 可在后台准备,不调用系统包管理器\n'));
42
+ console.log(chalk.gray(deferWindowsTools
43
+ ? '优先安装 Skill 文件;Windows 工具在 Skill 启动时按对应渠道检查\n'
44
+ : '优先安装 Skill 文件;alipay-cli 和用户级 jq 可在后台准备,不调用系统包管理器\n'));
42
45
  console.log(chalk.gray(`安装目标: ${targetSkillDirs.join(', ')}`));
43
46
  console.log(chalk.gray(`${describeTargetSelection(os.homedir(), target, targetDirLabels, primaryTargetDir, SKILL_NAME)}\n`));
44
47
  // ========== 阶段 1: 环境检查 ==========
@@ -47,7 +50,9 @@ export async function installCommand(cwd, options = {}) {
47
50
  if (skipTools) {
48
51
  console.log(chalk.cyan('📋 环境检查'));
49
52
  console.log(chalk.gray('─'.repeat(40)));
50
- console.log(chalk.gray(' ○ 已按 --skip-tools 跳过 alipay-cli、jq 检查与安装'));
53
+ console.log(chalk.gray(deferWindowsTools
54
+ ? ' ○ Windows 工具由 Skill 启动时按对应渠道检查'
55
+ : ' ○ 已按 --skip-tools 跳过 alipay-cli、jq 检查与安装'));
51
56
  }
52
57
  else {
53
58
  console.log(chalk.cyan('📋 环境检查'));
@@ -157,7 +162,7 @@ export async function installCommand(cwd, options = {}) {
157
162
  }
158
163
  console.log('');
159
164
  }
160
- printSummary(alipayCliOk, jqOk, true, version, installedSkillDirs, skipTools, jqRequired, jqPreparationSupported, backgroundPreparation);
165
+ printSummary(alipayCliOk, jqOk, true, version, installedSkillDirs, skipTools, deferWindowsTools, jqRequired, jqPreparationSupported, backgroundPreparation);
161
166
  }
162
167
  catch (error) {
163
168
  spinner.fail(chalk.red('Skill 文件安装失败'));
@@ -216,21 +221,23 @@ function startBackgroundToolPreparation(withJq) {
216
221
  /**
217
222
  * 打印安装总结
218
223
  */
219
- function printSummary(alipayCliOk, jqOk, skillInstalled, version, targetSkillDirs, toolsSkipped, jqRequired, jqPreparationSupported, backgroundPreparation) {
224
+ function printSummary(alipayCliOk, jqOk, skillInstalled, version, targetSkillDirs, toolsSkipped, toolsDeferredToSkill, jqRequired, jqPreparationSupported, backgroundPreparation) {
220
225
  console.log(chalk.cyan.bold('📋 安装总结'));
221
226
  console.log(chalk.gray('─'.repeat(40)));
222
- console.log(` alipay-cli: ${toolsSkipped ? chalk.gray('○ 已跳过') : alipayCliOk ? chalk.green('✓ 已就绪') : backgroundPreparation.alipayCli ? chalk.yellow('⏳ 后台准备中') : chalk.red('✗ 未就绪')}`);
223
- const jqStatus = toolsSkipped
224
- ? chalk.gray('○ 已跳过')
225
- : jqOk
226
- ? chalk.green('✓ 已就绪')
227
- : backgroundPreparation.jq
228
- ? chalk.yellow('⏳ 用户目录后台准备中')
229
- : !jqRequired
230
- ? chalk.gray('○ Windows 当前路径无需')
231
- : jqPreparationSupported
232
- ? chalk.gray('○ 后台任务未启动')
233
- : chalk.gray('○ 当前架构不支持自动准备');
227
+ console.log(` alipay-cli: ${toolsDeferredToSkill ? chalk.gray('○ 由 Skill 启动时检查') : toolsSkipped ? chalk.gray('○ 已跳过') : alipayCliOk ? chalk.green('✓ 已就绪') : backgroundPreparation.alipayCli ? chalk.yellow('⏳ 后台准备中') : chalk.red('✗ 未就绪')}`);
228
+ const jqStatus = toolsDeferredToSkill
229
+ ? chalk.gray('○ 由 Skill 按需检查')
230
+ : toolsSkipped
231
+ ? chalk.gray('○ 已跳过')
232
+ : jqOk
233
+ ? chalk.green('✓ 已就绪')
234
+ : backgroundPreparation.jq
235
+ ? chalk.yellow('⏳ 用户目录后台准备中')
236
+ : !jqRequired
237
+ ? chalk.gray('○ Windows 当前路径无需')
238
+ : jqPreparationSupported
239
+ ? chalk.gray('○ 后台任务未启动')
240
+ : chalk.gray('○ 当前架构不支持自动准备');
234
241
  console.log(` jq: ${jqStatus}`);
235
242
  console.log(` Skill 文件: ${skillInstalled ? chalk.green('✓ 已安装') : chalk.gray('○ 未安装')}`);
236
243
  console.log(` 版本: ${version}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/alipay-aipay",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "description": "支付宝 AI 付接入 Skill 安装包 - 优先安装 Agent Skill,并在 macOS/Linux 后台准备用户级 CLI 工具",
5
5
  "type": "module",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  "typescript": "^5.3.3"
56
56
  },
57
57
  "alipayAipayChannels": {
58
- "stable": "1.7.0",
59
- "pre": "1.7.1-pre"
58
+ "stable": "1.7.1",
59
+ "pre": "1.7.3-pre"
60
60
  }
61
61
  }
package/skill/SKILL.md CHANGED
@@ -7,7 +7,7 @@ description: >-
7
7
 
8
8
  # 支付宝 AI 付接入 Skill 启动器
9
9
 
10
- 本文件只负责在加载业务规则前确定本轮实际使用的 Skill 版本,并刷新本机 `alipay-cli`。禁止在完成下列启动协议前读取 `references/runtime-entry.md`、任一 flow、模块、消息目录或业务脚本。
10
+ 本文件只负责在加载业务规则前确定本轮实际使用的 Skill 版本、完成 Windows 渠道选择,并刷新本机 `alipay-cli`。禁止在完成下列启动协议前读取 `references/runtime-entry.md`、任一 flow、模块或业务脚本;Windows 渠道提示仅由下述固定 runtime 入口读取消息目录。
11
11
 
12
12
  ## 前置启动协议
13
13
 
@@ -30,7 +30,29 @@ stderr 只允许出现以下一个内部终态;不得向用户展示 marker
30
30
 
31
31
  `UPDATED` 后先废弃旧 loaded 事实,禁止继续读取更新前版本的任何业务文档,后续命令使用新版同一 `SKILL_DIR`;其他终态继续当前可用版本,其他终态同样不再读取本启动器或 `self-update.md` 补充规则。
32
32
 
33
- 版本确定后,若当前上下文没有与规范化 `SKILL_DIR`、合法 `VERSION` 绑定的 `ALIPAY_AIPAY_CLI_REFRESHED=true`,必须刷新一次 `alipay-cli`;不得因自更新已检查而跳过。仅唯一终态 `READY` 可在当前对话上下文记录该成功事实、路径和版本,不写缓存或业务状态;三者仍可用且一致时,后续根触发、确认、补材料、候选选择、恢复、中断继续和 Full Process 衔接均不重复刷新。
33
+ 版本确定后、首次 CLI 刷新及任何业务入口之前,若当前对话没有绑定该正式版规范化路径的 `ALIPAY_AIPAY_CHANNEL_OFFER_RESOLVED=true`,先执行一次:
34
+
35
+ ```text
36
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" channel-offer show
37
+ ```
38
+
39
+ 非 Windows 只返回唯一 `ALIPAY_AIPAY_INTERNAL:CHANNEL_OFFER=SKIPPED`,不展示正文,记录已处理并继续。Windows 返回唯一 `WAITING` 时,必须先将 stdout 原文作为独立可见消息送达并等待用户回复;在该回复前不得刷新 CLI、加载业务入口、创建遥测 run 或安装内测版。同一对话后续根触发不重复展示。用户本轮原始请求已明确要求安装使用内测版时,该意图可作为当前提示的回复直接判定,无需再索取一次“确认”;其他情况只使用提示送达后的用户原始回复。判断仅使用:
40
+
41
+ ```text
42
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" channel-offer decide --reply "<USER_REPLY>"
43
+ ```
44
+
45
+ 仅唯一 `ALIPAY_AIPAY_INTERNAL:CHANNEL_OFFER=PRE` 可进入内测安装;`STABLE` 表示继续本正式版,记录已处理并按下文刷新 CLI。`UNDECIDED` 表示用户在提问或表达不确定,先回答或澄清,仍等待明确选择;不能把业务催促、泛泛的“继续/OK/1”或通用 `reply confirm` 当作内测授权。任一错误或 marker 不唯一时停止渠道切换,禁止安装。用户以后明确提出切换时,可重新进行这一选择,不受已处理事实限制。
46
+
47
+ `PRE` 后先执行固定只读预检,确认 npm latest 的预发渠道已包含 Windows 改造版;本地当前工作区或尚未发布的版本不能代替线上事实:
48
+
49
+ ```text
50
+ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" channel-offer available
51
+ ```
52
+
53
+ 仅唯一 `ALIPAY_AIPAY_INTERNAL:CHANNEL_OFFER=AVAILABLE` 才在 Windows PowerShell 或 CMD 执行 `npx.cmd -y @alipay/alipay-aipay@latest install --channel pre`。`UNAVAILABLE|CHECK_FAILED` 时说明线上内测版尚不可核实或尚未包含 Windows 能力,保留正式版并停在当前选择,不安装旧内测版;用户可明确要求继续正式版。安装退出码为 0 后,必须从安装器报告的当前 Agent 目标目录核验 `alipay-aipay-pre/SKILL.md`、`VERSION` 和 `references/runtime-entry.md` 均为普通文件,渠道为 `pre`、版本不低于 `1.7.3-pre`,且该目录确实可由当前 Agent 加载;不能从旧预发版路径或当前正式版目录推定安装成功。核验成功后废弃正式版入口及刷新事实,使用实际预发版规范化绝对路径重新读取其 `SKILL.md` 并按预发版启动协议继续原任务。安装失败或核验失败时保持正式版,不宣称切换成功,也不进入预发业务流程。此选择发生在正式版 telemetry 启动前,不为渠道提示或预发安装创建正式版 run。
54
+
55
+ 仅确定继续正式版后,若当前上下文没有与规范化 `SKILL_DIR`、合法 `VERSION` 绑定的 `ALIPAY_AIPAY_CLI_REFRESHED=true`,必须刷新一次 `alipay-cli`;不得因自更新已检查而跳过。仅唯一终态 `READY` 可在当前对话上下文记录该成功事实、路径和版本,不写缓存或业务状态;三者仍可用且一致时,后续根触发、确认、补材料、候选选择、恢复、中断继续和 Full Process 衔接均不重复刷新。
34
56
 
35
57
  ```text
36
58
  node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" env refresh-alipay-cli
package/skill/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.7.1