@fluxa-pay/planner 0.2.1 → 0.2.2

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/package.json +1 -1
  2. package/planner.mjs +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluxa-pay/planner",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "FluxA Planner CLI. Recommend the right models, APIs and skills for a task, run paid calls via x402, and manage your oneshot APIs.",
5
5
  "type": "module",
6
6
  "bin": {
package/planner.mjs CHANGED
@@ -181,6 +181,18 @@ async function cmdModels(vendor) {
181
181
  }
182
182
  }
183
183
 
184
+ async function cmdVendors() {
185
+ const { data } = await http(`${PLATFORM}/api/llm/vendors`);
186
+ const vendors = data.vendors || [];
187
+ if (!vendors.length) return console.log(c.dim(" no vendors"));
188
+ console.log(" " + c.dim(pad("slug", 22) + pad("name", 22) + pad("models", 9) + pad("bundles", 9) + "price (Units/Mtok)"));
189
+ for (const v of vendors) {
190
+ const pr = v.priceRange;
191
+ const price = pr && Number.isFinite(pr.min) ? (pr.min === pr.max ? `${pr.min}` : `${pr.min}-${pr.max}`) : c.dim("—");
192
+ console.log(` ${c.bold(pad(v.slug, 22))}${c.gray(pad(v.name || "", 22))}${pad(String(v.modelCount ?? 0), 9)}${pad(String(v.bundleCount ?? 0), 9)}${price}`);
193
+ }
194
+ }
195
+
184
196
  async function cmdBalance(vendor) {
185
197
  const url = vendor ? `${PROXY}/llm/wallet/balances/${vendor}` : `${PROXY}/llm/wallet/balances`;
186
198
  const { data } = await http(url, { auth: true });
@@ -770,6 +782,7 @@ ${c.bold("Headline")}
770
782
  ${c.bold("Primitives")} ${c.dim("(all live)")}
771
783
  planner search "<q>" [--type api,skill,model] discover resources
772
784
  planner models [--vendor <slug>] model catalog + Units rates
785
+ planner vendors list fundable merchants (slug, models, price)
773
786
  planner balance [vendor] prepaid Units per merchant
774
787
  planner topup <vendor> [--credits <N>|--bundle <slug>] prepay Units (x402, via wallet)
775
788
  planner ledger <vendor> spend/topup history
@@ -838,6 +851,7 @@ async function main() {
838
851
  });
839
852
  case "search": return cmdSearch(arg, type);
840
853
  case "models": return cmdModels(vendor);
854
+ case "vendors": return cmdVendors();
841
855
  case "balance": case "bal": return cmdBalance(rest[0]);
842
856
  case "topup":
843
857
  return cmdTopup(rest[0], {