@alipay/alipay-aipay 1.8.5 → 1.8.7
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/dist/utils/jq.js +3 -1
- package/dist/utils/profile.js +2 -3
- package/package.json +3 -3
- package/skill/VERSION +1 -1
- package/skill/references/normal/alipay-cli-env.md +1 -1
- package/skill/references/normal/json/customer-messages.json +1 -1
- package/skill/references/normal/json/managed-jq-assets.json +1 -1
- package/skill/references/normal/json/policy-rules.json +1 -1
- package/skill/references/normal/scripts/managed_jq.mjs +1 -1
- package/skill/references/normal/scripts/profile.mjs +1 -1
- package/skill/references/normal/scripts/render_customer_message.mjs +0 -1
- package/skill/references/normal/scripts/session_skill.mjs +3 -2
- package/skill/references/onboarding/modules/scripts/mcc.sh +19 -7
- package/skill-pre/VERSION +1 -1
- package/skill-pre/references/normal/alipay-cli-env.md +1 -1
- package/skill-pre/references/normal/json/customer-messages.json +1 -1
- package/skill-pre/references/normal/json/managed-jq-assets.json +1 -1
- package/skill-pre/references/normal/json/policy-rules.json +1 -1
- package/skill-pre/references/normal/scripts/managed_jq.mjs +1 -1
- package/skill-pre/references/normal/scripts/profile.mjs +1 -1
- package/skill-pre/references/normal/scripts/render_customer_message.mjs +0 -1
- package/skill-pre/references/normal/scripts/session_skill.mjs +3 -2
- package/skill-pre/references/normal/scripts/windows/policy.json +0 -1
- package/skill-pre/references/normal/scripts/windows/preflight.mjs +2 -2
- package/skill-pre/references/normal/scripts/windows/prepare.mjs +1 -1
- package/skill-pre/references/normal/scripts/windows/routing.mjs +2 -3
- package/skill-pre/references/normal/windows-environment.md +1 -1
- package/skill-pre/references/onboarding/modules/scripts/mcc.sh +19 -7
|
@@ -63,6 +63,7 @@ export function createSessionSkill({sourceDir, channel, version, packageVersion,
|
|
|
63
63
|
fs.writeFileSync(path.join(skillDir,'PROFILE'),selectedProfile,{flag:'wx',mode:0o600});
|
|
64
64
|
}
|
|
65
65
|
const manifest = filesUnder(skillDir);
|
|
66
|
+
// Older updaters verify this handoff before they can load the new Skill.
|
|
66
67
|
const receipt = {schemaVersion:1, scope:'session', channel, version, packageVersion,
|
|
67
68
|
skillDir:fs.realpathSync(skillDir), targetDir:path.resolve(targetDir)};
|
|
68
69
|
fs.writeFileSync(path.join(skillDir,receiptName),JSON.stringify({...receipt,manifest}),{flag:'wx',mode:0o600});
|
|
@@ -84,7 +85,7 @@ function readProfile(skillDir) {
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export function verifySessionSkill(receipt, {home = os.homedir(), channel, version, packageVersion, targetDir} = {}) {
|
|
87
|
-
if (!receipt || receipt.
|
|
88
|
+
if (!receipt || receipt.scope!=='session' || !['stable','pre'].includes(receipt.channel) || !semver.test(receipt.version||'') || !path.isAbsolute(receipt.skillDir||'') ||
|
|
88
89
|
!path.isAbsolute(receipt.targetDir||'') || !semver.test(receipt.packageVersion||'')) throw Error('Invalid session receipt');
|
|
89
90
|
const root=sessionSkillRoot(home), dir=receipt.skillDir;
|
|
90
91
|
plain(path.dirname(root),true); plain(root,true); plain(dir,true);
|
|
@@ -95,7 +96,7 @@ export function verifySessionSkill(receipt, {home = os.homedir(), channel, versi
|
|
|
95
96
|
}
|
|
96
97
|
plain(path.join(dir,receiptName));
|
|
97
98
|
const saved=JSON.parse(fs.readFileSync(path.join(dir,receiptName),'utf8'));
|
|
98
|
-
for (const key of ['
|
|
99
|
+
for (const key of ['scope','channel','version','packageVersion','skillDir','targetDir']) {
|
|
99
100
|
if (saved[key]!==receipt[key]) throw Error('Session receipt mismatch');
|
|
100
101
|
}
|
|
101
102
|
identity(dir,receipt.channel,receipt.version);
|
|
@@ -190,7 +190,7 @@ export function resultError(error) {
|
|
|
190
190
|
reason==='USER_SCOPE_REQUIRED'?'USE_NON_ELEVATED_SESSION':
|
|
191
191
|
['STORAGE_FAILED','ENVIRONMENT_BUSY','ENVIRONMENT_STATE_INVALID'].includes(reason)?'REPAIR_LOCAL_ENVIRONMENT_THEN_RECHECK':
|
|
192
192
|
'INSPECT_FAILURE_THEN_RECHECK';
|
|
193
|
-
return {
|
|
193
|
+
return {status:needsSetup?'NEEDS_SETUP':'BLOCKED',reason,dependency:error.dependency||'',recovery,validationCoverage:'NOT_VERIFIED'};
|
|
194
194
|
}
|
|
195
195
|
export function report(error) {
|
|
196
196
|
const r=resultError(error);
|
|
@@ -207,6 +207,6 @@ if(process.argv[1]&&path.resolve(process.argv[1])===fileURLToPath(import.meta.ur
|
|
|
207
207
|
const v=k==='PATH'?c.env[k].split(';').map(p=>slash(p).replace(/^([a-zA-Z]):/,(_,d)=>'/'+d.toLowerCase())).join(':'):c.env[k];
|
|
208
208
|
console.log('export '+k+'='+quote(v));
|
|
209
209
|
}
|
|
210
|
-
} else console.error('ALIPAY_AIPAY_INTERNAL:WINDOWS_ENV_RESULT='+JSON.stringify({
|
|
210
|
+
} else console.error('ALIPAY_AIPAY_INTERNAL:WINDOWS_ENV_RESULT='+JSON.stringify({status:'READY',validationCoverage:'NOT_VERIFIED'}));
|
|
211
211
|
}catch(e){report(e);process.exitCode=78;}
|
|
212
212
|
}
|
|
@@ -147,7 +147,7 @@ export function runEnvironment(args) {
|
|
|
147
147
|
else fail('ENVIRONMENT_ARGUMENT_INVALID');
|
|
148
148
|
console.log('CLI_ENV:READY');
|
|
149
149
|
if (recovering) process.stderr.write('ALIPAY_AIPAY_INTERNAL:WINDOWS_ROUTE=' +
|
|
150
|
-
JSON.stringify({
|
|
150
|
+
JSON.stringify({rootIntent:options['--root-intent'],route:'READY'}) + '\n');
|
|
151
151
|
return 0;
|
|
152
152
|
}catch(e){report(e);return 78;}
|
|
153
153
|
}
|
|
@@ -43,9 +43,8 @@ export function selectRoute({rootIntent = '', authorized = false, repair = false
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function emit(result) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return value;
|
|
46
|
+
process.stderr.write(prefix + 'WINDOWS_ROUTE=' + JSON.stringify(result) + '\n');
|
|
47
|
+
return result;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
export function runWindowsEntry(args) {
|
|
@@ -16,7 +16,7 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" windows-entry --root-in
|
|
|
16
16
|
|
|
17
17
|
用户明确要求安装并通过 Skill 完成签约/开通或完整接入时附加 `--prepare-authorized true`;仅代码开发且没有依赖准备授权时先只读检查。用户明确选择站点时附加 `--site-selected true`。准备授权只覆盖用户级依赖,不包含登录、签约或应用写入。
|
|
18
18
|
|
|
19
|
-
退出 0 只表示分流完成。必须取得唯一 `ALIPAY_AIPAY_INTERNAL:WINDOWS_ROUTE=<JSON
|
|
19
|
+
退出 0 只表示分流完成。必须取得唯一 `ALIPAY_AIPAY_INTERNAL:WINDOWS_ROUTE=<JSON>`,校验结果为 JSON 对象、rootIntent 等于当前根意图、route 为 READY、BLOCKED、LEGACY 或 CODE_ONLY;非零、超时、缺失或冲突均按 BLOCKED 停止。READY 才执行本地快速沙箱和签约;BLOCKED 说明内部 `WINDOWS_ENV_RESULT` 的实际 reason/dependency 及恢复动作,等待环境修复,不能输出站点引导;LEGACY 仅用于不支持的执行映射或用户明确选择站点。后续 Windows runtime 命令附加当前 `--windows-route`;BLOCKED 不进入 bootstrap、业务 flow 或项目写入。CODE_ONLY 只放行独立代码开发,根意图和诊断原因沿用本次入口事实。修复可选工具后重新只读复检,取得唯一 READY 才恢复快速沙箱和开通动作。环境故障不关闭遥测,也不改变 SESSION_ID、run_id、计数或会话采集选择。
|
|
20
20
|
|
|
21
21
|
`integration_only/full_process` 遇到已识别的 Git Bash、jq、CLI 或安装辅助工具缺失/运行失败,以及这些工具的有限安装、下载、哈希/签名校验或预算耗尽失败时,返回 `CODE_ONLY`。失败工具不得继续执行,校验失败的安装包不得运行。以唯一 WINDOWS_ROUTE 的 route 决定是否进入开发;WINDOWS_ENV_RESULT 的失败诊断保留实际原因,不能将其误读为业务能力可用。该分流沿用 Integration 的原生 Node 路径,沙箱默认 `VERIFY_PENDING`,跳过快速沙箱;用户主动提供完整有效手工资料并写入、校验项目配置后,可记沙箱 `READY`,无需先将环境分流恢复为 READY。各测试按自身实际依赖执行:缺失工具所依赖的动作仍不能运行;原生 Python 402 联调不依赖 Git Bash,但仍须 Python、curl、服务可访问、沙箱配置等前置就绪。最终如实列出未完成项,不自动引导站点开通。完整接入在代码部分检查后停在 Onboarding 前,待工具恢复且复检 READY 才恢复。Node 版本不足、实际存储故障、状态损坏、回滚失败或未知错误仍为 BLOCKED;项目路径和生产配置保护要求不变。下文“失败保持 BLOCKED”对上述可选工具例外按 CODE_ONLY 处理。
|
|
22
22
|
|
|
@@ -174,7 +174,7 @@ read_mcc_tree_cache() {
|
|
|
174
174
|
--arg salesCode "$sales_code" \
|
|
175
175
|
--argjson now "$now" \
|
|
176
176
|
--argjson ttl "$ttl" '
|
|
177
|
-
if
|
|
177
|
+
if type == "object"
|
|
178
178
|
and .productType == $productType
|
|
179
179
|
and .salesCode == $salesCode
|
|
180
180
|
and ((.createdAtEpoch // null) | type == "number")
|
|
@@ -201,7 +201,6 @@ write_mcc_tree_cache() {
|
|
|
201
201
|
--argjson createdAtEpoch "$now" \
|
|
202
202
|
--argjson tree "$tree" \
|
|
203
203
|
'{
|
|
204
|
-
schemaVersion: 1,
|
|
205
204
|
productType: $productType,
|
|
206
205
|
salesCode: $salesCode,
|
|
207
206
|
createdAtEpoch: $createdAtEpoch,
|
|
@@ -229,7 +228,7 @@ read_mcc_selection_cache() {
|
|
|
229
228
|
--arg receipt "$receipt" \
|
|
230
229
|
--argjson now "$now" \
|
|
231
230
|
--argjson ttl "$ttl" '
|
|
232
|
-
if
|
|
231
|
+
if type == "object"
|
|
233
232
|
and .productType == $productType
|
|
234
233
|
and .salesCode == $salesCode
|
|
235
234
|
and .query == $query
|
|
@@ -283,7 +282,6 @@ write_mcc_selection_cache() {
|
|
|
283
282
|
--argjson candidateRows "$candidate_rows" \
|
|
284
283
|
--argjson details "$details" \
|
|
285
284
|
'{
|
|
286
|
-
schemaVersion: 4,
|
|
287
285
|
productType: $productType,
|
|
288
286
|
salesCode: $salesCode,
|
|
289
287
|
query: $query,
|
|
@@ -358,7 +356,14 @@ claim_mcc_agent_phase() {
|
|
|
358
356
|
--arg inputId "$input_id" \
|
|
359
357
|
--arg phase "$phase" \
|
|
360
358
|
--arg catalogDigest "$catalog_digest" '
|
|
361
|
-
if
|
|
359
|
+
if type != "object" or ((.entries // null) | type != "array")
|
|
360
|
+
or any(.entries[];
|
|
361
|
+
type != "object" or (.query | type) != "string"
|
|
362
|
+
or (.inputId | type) != "string" or .inputId == ""
|
|
363
|
+
or (.phase != "review" and .phase != "repair" and .phase != "result")
|
|
364
|
+
or (.catalogDigest | type) != "string"
|
|
365
|
+
or (.catalogDigest | test("^[0-9a-f]{64}$") | not)
|
|
366
|
+
) then
|
|
362
367
|
error("invalid MCC agent review state")
|
|
363
368
|
elif $phase == "review" and any(.entries[]; .inputId == $inputId) then
|
|
364
369
|
error("MCC agent review already started")
|
|
@@ -383,7 +388,7 @@ claim_mcc_agent_phase() {
|
|
|
383
388
|
--arg inputId "$input_id" \
|
|
384
389
|
--arg phase "$phase" \
|
|
385
390
|
--arg catalogDigest "$catalog_digest" \
|
|
386
|
-
'{
|
|
391
|
+
'{entries: [{query: $query, inputId: $inputId, phase: $phase, catalogDigest: $catalogDigest}]}' \
|
|
387
392
|
>"$tmp" 2>/dev/null; then
|
|
388
393
|
rm -f "$tmp" 2>/dev/null || true
|
|
389
394
|
rmdir "$lock" 2>/dev/null || true
|
|
@@ -430,7 +435,14 @@ bind_mcc_agent_result() {
|
|
|
430
435
|
--arg inputId "$input_id" \
|
|
431
436
|
--arg catalogDigest "$catalog_digest" \
|
|
432
437
|
--argjson candidateCodes "$candidate_codes" '
|
|
433
|
-
if
|
|
438
|
+
if type != "object" or ((.entries // null) | type != "array")
|
|
439
|
+
or any(.entries[];
|
|
440
|
+
type != "object" or (.query | type) != "string"
|
|
441
|
+
or (.inputId | type) != "string" or .inputId == ""
|
|
442
|
+
or (.phase != "review" and .phase != "repair" and .phase != "result")
|
|
443
|
+
or (.catalogDigest | type) != "string"
|
|
444
|
+
or (.catalogDigest | test("^[0-9a-f]{64}$") | not)
|
|
445
|
+
) then
|
|
434
446
|
error("invalid MCC agent review state")
|
|
435
447
|
elif (any(.entries[];
|
|
436
448
|
.query == $query and .inputId == $inputId and .phase == "review" and .catalogDigest == $catalogDigest
|