agentmall 0.1.5 → 0.1.6

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 (2) hide show
  1. package/dist/cli.js +21 -13
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -596,11 +596,15 @@ async function getBuyerToken(purchaseId) {
596
596
 
597
597
  // src/cli/index.ts
598
598
  var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
599
- async function runCommandCapture(command2, args2) {
599
+ async function runCommandCapture(command2, args2, envOverrides) {
600
600
  return await new Promise((resolve, reject) => {
601
601
  const child = spawn(command2, args2, {
602
602
  stdio: ["ignore", "pipe", "pipe"],
603
- shell: process.platform === "win32"
603
+ shell: process.platform === "win32",
604
+ env: {
605
+ ...process.env,
606
+ ...envOverrides
607
+ }
604
608
  });
605
609
  let stdout = "";
606
610
  let stderr = "";
@@ -670,17 +674,21 @@ function formatUsdAmount(cents) {
670
674
  }
671
675
  async function createPurchaseWithTempo(body) {
672
676
  const totalChargeCents = body.max_budget + SERVICE_FEE_CENTS;
673
- const result = await runCommandCapture("tempo", [
674
- "request",
675
- "-s",
676
- "--max-spend",
677
- formatUsdAmount(totalChargeCents),
678
- "-X",
679
- "POST",
680
- "--json",
681
- JSON.stringify(body),
682
- `${BASE_URL}/api/purchases`
683
- ]);
677
+ const result = await runCommandCapture(
678
+ "tempo",
679
+ [
680
+ "request",
681
+ "-s",
682
+ "-X",
683
+ "POST",
684
+ "--json",
685
+ JSON.stringify(body),
686
+ `${BASE_URL}/api/purchases`
687
+ ],
688
+ {
689
+ TEMPO_MAX_SPEND: formatUsdAmount(totalChargeCents)
690
+ }
691
+ );
684
692
  if (result.code !== 0) {
685
693
  const message = result.stderr.trim() || result.stdout.trim() || "Tempo request failed";
686
694
  throw new Error(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmall",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "SDK and CLI for the AgentMall API — let AI agents buy physical products from US retailers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",