@blod-nm/1kuan-act-01-cli 0.2.3 → 0.2.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.
- package/package.json +1 -1
- package/src/main.js +5 -1
- package/src/mcp.js +3 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -70,6 +70,9 @@ async function readStdinText() {
|
|
|
70
70
|
return Buffer.concat(chunks).toString('utf8').trim()
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/** 领取入口提示:二维码内容是站内 goto 协议,要在我们小程序里扫 */
|
|
74
|
+
const SCAN_TIP = '打开我们的「1010」小程序 →「我的」→「常用」→「扫码支付」,扫上面二维码即可领取'
|
|
75
|
+
|
|
73
76
|
/** 网关可能把 jsonb 当字符串回,统一解析一次 */
|
|
74
77
|
function parseJsonResult(value) {
|
|
75
78
|
if (typeof value !== 'string') return value
|
|
@@ -619,7 +622,7 @@ async function cmdCreate(argv) {
|
|
|
619
622
|
result,
|
|
620
623
|
balanceBefore: balance,
|
|
621
624
|
balanceAfter,
|
|
622
|
-
qr: qrContent ? { content: qrContent, format: qrMode, path: qrPath } : null,
|
|
625
|
+
qr: qrContent ? { content: qrContent, format: qrMode, path: qrPath, tip: SCAN_TIP } : null,
|
|
623
626
|
})
|
|
624
627
|
} else {
|
|
625
628
|
console.log(`红包编号 ${packetNo || '(未返回)'}`)
|
|
@@ -636,6 +639,7 @@ async function cmdCreate(argv) {
|
|
|
636
639
|
process.stderr.write(`${renderAnsi(qr, { color: process.env.NO_COLOR === undefined })}\n`)
|
|
637
640
|
}
|
|
638
641
|
if (qrPath) console.error(`二维码已写入: ${qrPath}`)
|
|
642
|
+
if (qrContent) console.error(`提示: ${SCAN_TIP}`)
|
|
639
643
|
console.error('hint: deducted; recall is not supported — lifecycle is TTL-driven')
|
|
640
644
|
return 0
|
|
641
645
|
}
|
package/src/mcp.js
CHANGED
|
@@ -93,7 +93,9 @@ function withClaimTarget(raw) {
|
|
|
93
93
|
if (!result || typeof result !== 'object') return result
|
|
94
94
|
|
|
95
95
|
const packetNo = String(result.packet?.data?.packet_no || result.packet?.packet_no || '').trim()
|
|
96
|
-
return packetNo
|
|
96
|
+
return packetNo
|
|
97
|
+
? { ...result, qr: { content: claimTarget(packetNo), tip: '打开我们的「1010」小程序 →「我的」→「常用」→「扫码支付」,扫码即可领取' } }
|
|
98
|
+
: result
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
/** 导出仅为测试:mock tcb 后可以直接断言工具返回形状 */
|
package/src/version.js
CHANGED