@alipay/alipay-aipay 1.6.8-beta1 → 1.6.8-beta2
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/package.json
CHANGED
package/skill/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.6.8-
|
|
1
|
+
1.6.8-beta2
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
+
# Sensitive sandbox fields are held in shell variables below; never inherit
|
|
4
|
+
# caller tracing into the parsing and persistence path.
|
|
5
|
+
set +x
|
|
3
6
|
set -u
|
|
4
7
|
|
|
5
8
|
MODE="${1:-}"
|
|
@@ -237,6 +240,19 @@ render_summary() {
|
|
|
237
240
|
printf '%s' '{}' | node "$RENDERER" sandbox.environment.reminder --variant DEFAULT || return 1
|
|
238
241
|
}
|
|
239
242
|
|
|
243
|
+
render_create_failure() {
|
|
244
|
+
local error_code trace_id
|
|
245
|
+
error_code=$(printf '%s' "$business" | jq -r '
|
|
246
|
+
if (.errorCode? | type) == "string" and (.errorCode | test("^[A-Za-z0-9_.:-]{1,80}$"))
|
|
247
|
+
then .errorCode else "UNKNOWN" end
|
|
248
|
+
' 2>/dev/null) || error_code="UNKNOWN"
|
|
249
|
+
trace_id=$(printf '%s' "$business" | jq -r '
|
|
250
|
+
if (.traceId? | type) == "string" and (.traceId | test("^[A-Za-z0-9_.:-]{1,128}$"))
|
|
251
|
+
then .traceId else "未返回" end
|
|
252
|
+
' 2>/dev/null) || trace_id="未返回"
|
|
253
|
+
printf 'SANDBOX_ERROR:%s traceId=%s\n' "$error_code" "$trace_id" >&2
|
|
254
|
+
}
|
|
255
|
+
|
|
240
256
|
if [ "$MODE" = "create" ]; then
|
|
241
257
|
command -v alipay-cli >/dev/null 2>&1 || { echo "SANDBOX_ERROR:缺少 alipay-cli" >&2; exit 1; }
|
|
242
258
|
{ [ ! -e "$CONFIG_PATH" ] && [ ! -L "$CONFIG_PATH" ]; } || { echo "SANDBOX_ERROR:配置文件已存在或为不安全符号链接,禁止重复创建或覆盖" >&2; exit 1; }
|
|
@@ -289,7 +305,7 @@ if [ "$MODE" = "create" ]; then
|
|
|
289
305
|
if [ -n "$text" ]; then business=$(printf '%s' "$text" | jq -c . 2>/dev/null) || { echo "SANDBOX_ERROR:重试 content[0].text 非法" >&2; exit 1; }; else business="$outer"; fi
|
|
290
306
|
fi
|
|
291
307
|
[ "$(echo "$business" | jq -r '.success // false')" = "true" ] || {
|
|
292
|
-
|
|
308
|
+
render_create_failure
|
|
293
309
|
exit 1
|
|
294
310
|
}
|
|
295
311
|
data=$(echo "$business" | jq -c '.data // null') || exit 1
|
|
@@ -247,7 +247,9 @@ const mccSelectionReceiptPrefix = 'AIPAY_MCC_SELECTION_V1.';
|
|
|
247
247
|
const ignoredMccQueryTokens = new Set([
|
|
248
248
|
'服务', '企业', '个人', '提供', '适用', '用于', '平台', '项目', '申请', '商家', '公司',
|
|
249
249
|
'互联', '联网', '互联网', '在线', '用品', '收费', '缴费', '费用', '适用于', '经营',
|
|
250
|
-
'业务', '相关', '主体', '从事'
|
|
250
|
+
'业务', '相关', '主体', '从事', '网站', '网页', '购买', '买票', '购票', '票务', '售票',
|
|
251
|
+
'预约', '预定', '退票', '支付', '付款', '收款', '下单', '订单', '交易', '销售', '售卖',
|
|
252
|
+
'商品', '产品'
|
|
251
253
|
]);
|
|
252
254
|
|
|
253
255
|
function activeMccRunId(env = process.env) {
|
|
@@ -833,10 +833,16 @@ run_resolve_plan() {
|
|
|
833
833
|
if [ "$match_type" = "NONE" ] \
|
|
834
834
|
&& [ "$semantic_status" != "DYNAMIC_CATALOG_CODE_NOT_FOUND" ] \
|
|
835
835
|
&& [ "$semantic_status" != "DYNAMIC_CATALOG_CODE_AMBIGUOUS" ]; then
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
"$
|
|
839
|
-
|
|
836
|
+
if [ -n "$input_id" ]; then
|
|
837
|
+
retry_input_id="$input_id"
|
|
838
|
+
next_retry_count="$(claim_mcc_semantic_retry \
|
|
839
|
+
"$product_type" "$sales_code" "$query" "$retry_input_id" "$resolved_semantic_terms" 2>/dev/null)"
|
|
840
|
+
retry_rc=$?
|
|
841
|
+
else
|
|
842
|
+
# A retry without a message identity cannot be bound to one user input.
|
|
843
|
+
# Keep the bounded retry contract closed instead of sharing a placeholder.
|
|
844
|
+
retry_rc=2
|
|
845
|
+
fi
|
|
840
846
|
if [ "$retry_rc" -eq 0 ]; then
|
|
841
847
|
if [ "$semantic_terms_json" = "[]" ]; then
|
|
842
848
|
retry_reason="MISSING_SEMANTIC_TERMS"
|