@inflowpayai/inflow 0.7.0 → 0.8.0

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 +30 -25
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -11166,7 +11166,7 @@ import {
11166
11166
  decodeReceipt,
11167
11167
  parseChallengeHeader
11168
11168
  } from "@inflowpayai/mpp";
11169
- import { METHOD_INFLOW } from "@inflowpayai/mpp";
11169
+ import { METHOD_INFLOW, METHOD_TEMPO } from "@inflowpayai/mpp";
11170
11170
  import {
11171
11171
  HEADERS as HEADERS4,
11172
11172
  parseChallengeHeaders as parseChallengeHeaders2,
@@ -12449,15 +12449,15 @@ function decodeMppValue(raw) {
12449
12449
  }
12450
12450
  var INVALID_402_CODE2 = "INVALID_402";
12451
12451
  var NO_INFLOW_MATCH_CODE2 = "NO_INFLOW_MATCH";
12452
- var NO_INFLOW_MATCH_MESSAGE2 = "Seller's 402 carries no `inflow`-method MPP challenge; the InFlow buyer cannot fulfil it.";
12452
+ var NO_INFLOW_MATCH_MESSAGE2 = "Seller's 402 carries no InFlow-supported MPP challenge method; the InFlow buyer cannot fulfil it.";
12453
12453
  var NO_FILTERED_MATCH_CODE2 = "NO_FILTERED_MATCH";
12454
12454
  var PAYMENT_NOT_ACCEPTED_CODE2 = "PAYMENT_NOT_ACCEPTED";
12455
12455
  var UNEXPECTED_PROBE_STATUS_CODE2 = "UNEXPECTED_PROBE_STATUS";
12456
12456
  function isSuccessStatus2(status) {
12457
12457
  return status >= 200 && status < 300;
12458
12458
  }
12459
- function filterInflowChallenges(challenges) {
12460
- return challenges.filter((challenge) => challenge.method === METHOD_INFLOW);
12459
+ function filterPayableChallenges(challenges) {
12460
+ return challenges.filter((challenge) => challenge.method === METHOD_INFLOW || challenge.method === METHOD_TEMPO);
12461
12461
  }
12462
12462
  function hasAnyChallengeFilter(filters) {
12463
12463
  return filters.paymentMethod !== void 0 || filters.intent !== void 0 || filters.currency !== void 0 || filters.rail !== void 0;
@@ -12492,7 +12492,7 @@ function buildNoFilteredMatchMessage2(challenges, filters) {
12492
12492
  if (railValue !== void 0 && railValue !== "") parts.push(`rail=${railValue}`);
12493
12493
  return parts.join(" ");
12494
12494
  }).join(", ");
12495
- return `Seller has no \`inflow\` challenge matching ${filterDescription}. Available: ${available || "(none)"}.`;
12495
+ return `Seller has no supported MPP challenge matching ${filterDescription}. Available: ${available || "(none)"}.`;
12496
12496
  }
12497
12497
  function parseMppHeaderFromProbe(probe) {
12498
12498
  const headerValues = readHeaderAll(probe.headers, HEADERS3.WWW_AUTHENTICATE);
@@ -12558,8 +12558,8 @@ async function runMppInspectPipeline(deps, emit) {
12558
12558
  emit({ type: "errored", code: parse.code, message: parse.message });
12559
12559
  return;
12560
12560
  }
12561
- const inflowChallenges = filterInflowChallenges(parse.challenges);
12562
- if (inflowChallenges.length === 0) {
12561
+ const supportedChallenges = filterPayableChallenges(parse.challenges);
12562
+ if (supportedChallenges.length === 0) {
12563
12563
  emit({ type: "errored", code: NO_INFLOW_MATCH_CODE2, message: NO_INFLOW_MATCH_MESSAGE2 });
12564
12564
  return;
12565
12565
  }
@@ -12569,12 +12569,12 @@ async function runMppInspectPipeline(deps, emit) {
12569
12569
  ...deps.currencyFilter !== void 0 ? { currency: deps.currencyFilter } : {},
12570
12570
  ...deps.railFilter !== void 0 ? { rail: deps.railFilter } : {}
12571
12571
  };
12572
- const filtered = filterChallenges(inflowChallenges, filters);
12572
+ const filtered = filterChallenges(supportedChallenges, filters);
12573
12573
  if (hasAnyChallengeFilter(filters) && filtered.length === 0) {
12574
12574
  emit({
12575
12575
  type: "errored",
12576
12576
  code: NO_FILTERED_MATCH_CODE2,
12577
- message: buildNoFilteredMatchMessage2(inflowChallenges, filters)
12577
+ message: buildNoFilteredMatchMessage2(supportedChallenges, filters)
12578
12578
  });
12579
12579
  return;
12580
12580
  }
@@ -12687,8 +12687,8 @@ async function runMppPayPipeline(deps, emit) {
12687
12687
  emit({ type: "errored", code: "DECODE_FAILED", message: err instanceof Error ? err.message : String(err) });
12688
12688
  return;
12689
12689
  }
12690
- const inflowChallenges = filterInflowChallenges(challenges);
12691
- if (inflowChallenges.length === 0) {
12690
+ const supportedChallenges = filterPayableChallenges(challenges);
12691
+ if (supportedChallenges.length === 0) {
12692
12692
  emit({ type: "errored", code: NO_INFLOW_MATCH_CODE2, message: NO_INFLOW_MATCH_MESSAGE2 });
12693
12693
  return;
12694
12694
  }
@@ -12698,12 +12698,12 @@ async function runMppPayPipeline(deps, emit) {
12698
12698
  ...deps.currencyFilter !== void 0 ? { currency: deps.currencyFilter } : {},
12699
12699
  ...deps.railFilter !== void 0 ? { rail: deps.railFilter } : {}
12700
12700
  };
12701
- const selected = filterChallenges(inflowChallenges, filters);
12701
+ const selected = filterChallenges(supportedChallenges, filters);
12702
12702
  if (hasAnyChallengeFilter(filters) && selected.length === 0) {
12703
12703
  emit({
12704
12704
  type: "errored",
12705
12705
  code: NO_FILTERED_MATCH_CODE2,
12706
- message: buildNoFilteredMatchMessage2(inflowChallenges, filters)
12706
+ message: buildNoFilteredMatchMessage2(supportedChallenges, filters)
12707
12707
  });
12708
12708
  return;
12709
12709
  }
@@ -13704,13 +13704,13 @@ function buildMppSection(probe) {
13704
13704
  const parse = parseMppHeaderFromProbe(probe);
13705
13705
  if (parse.kind === "absent") return { kind: "absent" };
13706
13706
  if (parse.kind === "error") return { kind: "error", code: parse.code, message: parse.message };
13707
- const inflowChallenges = filterInflowChallenges(parse.challenges);
13708
- if (inflowChallenges.length === 0) {
13707
+ const supportedChallenges = filterPayableChallenges(parse.challenges);
13708
+ if (supportedChallenges.length === 0) {
13709
13709
  const methods = [...new Set(parse.challenges.map((c) => c.method))].sort((a, b) => a.localeCompare(b));
13710
13710
  return { kind: "none-inflow", methods };
13711
13711
  }
13712
- const realm = inflowChallenges[0]?.realm ?? "";
13713
- return { kind: "challenges", realm, challenges: inflowChallenges.map(summarizeChallenge) };
13712
+ const realm = supportedChallenges[0]?.realm ?? "";
13713
+ return { kind: "challenges", realm, challenges: supportedChallenges.map(summarizeChallenge) };
13714
13714
  }
13715
13715
  function buildX402Section(probe) {
13716
13716
  const parse = parseX402HeaderFromProbe(probe);
@@ -15154,7 +15154,7 @@ var MppSectionView = ({ section }) => {
15154
15154
  return /* @__PURE__ */ jsxs11(Text12, { children: [
15155
15155
  /* @__PURE__ */ jsx14(Text12, { bold: true, children: "\u2500\u2500 MPP \u2500\u2500" }),
15156
15156
  " ",
15157
- /* @__PURE__ */ jsx14(Text12, { dimColor: true, children: `advertised method(s) not payable by InFlow: ${methods} (only \`inflow\` is supported)` })
15157
+ /* @__PURE__ */ jsx14(Text12, { dimColor: true, children: `advertised method(s) not payable by InFlow: ${methods}` })
15158
15158
  ] });
15159
15159
  }
15160
15160
  if (section.kind === "error") {
@@ -15301,7 +15301,7 @@ function buildCombinedFrame(result) {
15301
15301
  warnings.push({
15302
15302
  protocol: "mpp",
15303
15303
  code: "NO_INFLOW_MATCH",
15304
- message: `WWW-Authenticate: Payment present, but no challenge uses the \`inflow\` method (only one the InFlow buyer can pay). Method(s) advertised: ${offered}.`,
15304
+ message: `WWW-Authenticate: Payment present, but no challenge uses a method the InFlow buyer can pay. Method(s) advertised: ${offered}.`,
15305
15305
  methods: result.mpp.methods
15306
15306
  });
15307
15307
  } else if (result.mpp.kind === "error") {
@@ -17330,7 +17330,7 @@ function formatUpdateNotice(info) {
17330
17330
  }
17331
17331
 
17332
17332
  // src/cli.tsx
17333
- var cliVersion = "0.7.0";
17333
+ var cliVersion = "0.8.0";
17334
17334
  var cliName = "@inflowpayai/inflow";
17335
17335
  var bootstrapBody = '# InFlow - Agent Setup\n\n> Served at https://inflowcli.ai/skill.md - the onboarding entry point for AI agents. InFlow gives your agent a wallet\n> to register, access, and pay for services autonomously across fiat and stablecoins, over MPP and x402.\n\nYou are an AI agent whose user asked to get set up with InFlow. Follow these steps.\n\n## 1. Install\n\nRequires Node.js >= 22.\n\nmacOS / Linux:\n\n```bash\ncurl -fsSL https://inflowcli.ai/cli | bash\n```\n\nWindows:\n\n```powershell\niwr -useb https://inflowcli.ai/install.ps1 | iex\n```\n\nOr install with npm directly: `npm install -g @inflowpayai/inflow`. Or skip installing and run every command through\n`npx -y @inflowpayai/inflow`.\n\nRunning as an MCP server? Add an `inflow` server to your MCP client config that runs `npx -y @inflowpayai/inflow --mcp`\n(keep `-y`; without it the host can stall on first run).\n\n## 2. Authenticate\n\nCheck the current state first - the user may already be logged in:\n\n```bash\ninflow auth status\n```\n\nIf the response includes an `update` field, tell the user a newer version is available and how to upgrade\n(`npm install -g @inflowpayai/inflow@latest`), then proceed with the current version.\n\nIf `authenticated` is `false`, start the OAuth device flow:\n\n```bash\ninflow auth login --client-name "<your-agent-name>"\n```\n\nReplace `<your-agent-name>` with a clear, unique, identifiable name for your agent - the user sees it on the approval\npage in their browser. The response includes a `verification_url` (present it to the user), a `phrase`, and a\n`_next.command` - run that command immediately to poll until authenticated; do not wait for the user to respond before\nstarting the poll. If your environment can\'t relay the phrase while a polling command blocks I/O, use inline polling\ninstead:\n\n```bash\ninflow auth login --client-name "<name>" --interval 5 --timeout 300\n```\n\nConfirm with `inflow auth status` before proceeding.\n\n## 3. Load the playbook for your task\n\nSetup alone is not enough. Before performing a task with InFlow, load and follow its playbook:\n\n| Task | Playbook |\n| --------------------------------------------- | ------------------------------------------------------------------------------ |\n| Pay HTTP 402-protected resources (MPP / x402) | run `inflow --skill`, or fetch https://inflowcli.ai/skills/agentic-payments.md |\n\nPrefer `inflow --skill` - it always matches the version you are running. The web copy reflects the latest release;\ncompare its `version:` header against `inflow --version`.\n\nThe CLI is self-describing - prefer querying it over static docs: `inflow --llms` (command index), `inflow --llms-full`\n(parameter detail), `inflow <command> --schema` (JSON Schema for one command).\n\n## Links\n\n- Command index: https://inflowcli.ai/llms.txt (full reference: https://inflowcli.ai/llms-full.txt)\n- Source: https://github.com/inflowpayai/inflow-cli\n- Web app: https://app.inflowpay.ai\n- MPP protocol: https://mpp.dev\n- x402 protocol: https://x402.org\n- Contact: info@inflowpay.ai\n';
17336
17336
  var skillBodies = define_SKILL_BODIES_default;
@@ -17339,13 +17339,18 @@ Help.registerGlobalFlags([
17339
17339
  { flag: "--bootstrap", desc: "Print the agent setup guide (install, authenticate, load a playbook)" },
17340
17340
  { flag: "--skill [name]", desc: `Print a skill playbook (default: ${DEFAULT_SKILL})` }
17341
17341
  ]);
17342
- function printBody(body) {
17343
- process9.stdout.write(body.endsWith("\n") ? body : `${body}
17344
- `);
17342
+ async function printBody(body) {
17343
+ const text = body.endsWith("\n") ? body : `${body}
17344
+ `;
17345
+ await new Promise((resolve) => {
17346
+ process9.stdout.write(text, () => {
17347
+ resolve();
17348
+ });
17349
+ });
17345
17350
  process9.exit(0);
17346
17351
  }
17347
17352
  if (process9.argv.includes("--bootstrap")) {
17348
- printBody(bootstrapBody);
17353
+ await printBody(bootstrapBody);
17349
17354
  }
17350
17355
  var skillFlagIndex = process9.argv.findIndex((arg) => arg === "--skill" || arg.startsWith("--skill="));
17351
17356
  if (skillFlagIndex !== -1) {
@@ -17364,7 +17369,7 @@ if (skillFlagIndex !== -1) {
17364
17369
  `);
17365
17370
  process9.exit(1);
17366
17371
  }
17367
- printBody(body);
17372
+ await printBody(body);
17368
17373
  }
17369
17374
  var CLI_CLIENT_IDS = {
17370
17375
  production: "1f4ccbcbddce500e19b37fa0877ba032",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflowpayai/inflow",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "InFlow - agentic MPP / x402 payments from your machine.",
@@ -31,8 +31,8 @@
31
31
  "url": "https://github.com/inflowpayai/inflow-cli/issues"
32
32
  },
33
33
  "dependencies": {
34
- "@inflowpayai/mpp": "^0.5.1",
35
- "@inflowpayai/mpp-buyer": "^0.5.0",
34
+ "@inflowpayai/mpp": "^0.6.0",
35
+ "@inflowpayai/mpp-buyer": "^0.6.0",
36
36
  "@inflowpayai/x402": "^0.8.0",
37
37
  "@inflowpayai/x402-buyer": "^0.7.0",
38
38
  "@x402/core": "^2.12.0",