@xiashe/sdk 0.1.25 → 0.1.27

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/alipayWallet.mjs CHANGED
@@ -861,7 +861,7 @@ export async function diagnoseAlipay402Resource(input, options = {}) {
861
861
  message: '没有找到本地付款尝试;请不要因此重复付款。'
862
862
  };
863
863
  }
864
- return {
864
+ const result = {
865
865
  ok: state.status !== 'failed' && state.status !== 'wallet_command_failed',
866
866
  status: state.status || 'unknown',
867
867
  provider: 'alipay-agent-payment',
@@ -877,6 +877,24 @@ export async function diagnoseAlipay402Resource(input, options = {}) {
877
877
  } : {}),
878
878
  updatedAt: state.updatedAt || null
879
879
  };
880
+ // TRADE_PROGRESS_FAILED is deliberately generic in the official wallet
881
+ // output. Attach a redacted report to the one diagnose command an Agent is
882
+ // already required to run, rather than relying on it to remember a second
883
+ // optional command after a failed payment.
884
+ if (state.lastFailureCode === 'wallet_trade_progress_failed') {
885
+ const support = await createAlipay402SupportReport({ resourceUrl }, options);
886
+ if (support.ok && support.report) {
887
+ result.supportReport = support.report;
888
+ // Some Agents intentionally present only `userVisible` from a bridge
889
+ // result. Put the already-redacted support text there as well so the
890
+ // only useful evidence from this generic upstream error is not silently
891
+ // dropped by a client-side response mapper.
892
+ result.userVisible = [result.userVisible, '', '支付宝支持诊断:', support.report.text]
893
+ .filter((line) => typeof line === 'string' && line.length > 0)
894
+ .join('\n');
895
+ }
896
+ }
897
+ return result;
880
898
  }
881
899
 
882
900
  /**
package/index.mjs CHANGED
@@ -6,7 +6,7 @@ import path from 'node:path';
6
6
  import { ConvexHttpClient } from 'convex/browser';
7
7
  import { anyApi as api } from 'convex/server';
8
8
 
9
- export const VERSION = '0.1.25';
9
+ export const VERSION = '0.1.27';
10
10
 
11
11
  export const DEFAULTS = {
12
12
  cn: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiashe/sdk",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "type": "module",
5
5
  "main": "index.mjs",
6
6
  "exports": {