@manturhub/cli 0.10.0 → 0.10.1

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 (3) hide show
  1. package/bin/cli.js +15 -1
  2. package/lib/api.js +1 -0
  3. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -336,6 +336,20 @@ async function main() {
336
336
  console.error(error.message);
337
337
  process.exit(1);
338
338
  }
339
+ if (operator.billing_mode === "internal_free") {
340
+ const free = {
341
+ operator_id: operator.id,
342
+ billing_mode: "internal_free",
343
+ estimated_dumplings: 0,
344
+ formula: "内部管理员只读查询,不扣馒头",
345
+ };
346
+ console.log(
347
+ args.includes("--json")
348
+ ? JSON.stringify(free, null, 2)
349
+ : `${operator.name}: 内部管理员只读查询,不扣馒头`
350
+ );
351
+ break;
352
+ }
339
353
  const r = await apiFetch(`/api/v1/operators/${encodeURIComponent(operator.id)}/quote`, { auth: "optional" });
340
354
  if (!r.ok) {
341
355
  console.error(`查询价格失败(HTTP ${r.status}): ${JSON.stringify(r.json)}`);
@@ -420,7 +434,7 @@ async function main() {
420
434
  process.exit(1);
421
435
  }
422
436
  let quoteId = getFlag("confirm");
423
- if (!quoteId) {
437
+ if (!quoteId && operator.billing_mode !== "internal_free") {
424
438
  const quote = await apiFetch(`/api/v1/operators/${encodeURIComponent(operatorId)}/quote`, {
425
439
  method: "POST",
426
440
  body,
package/lib/api.js CHANGED
@@ -20,6 +20,7 @@ export async function apiFetch(
20
20
  fetch(url, {
21
21
  method,
22
22
  headers: {
23
+ "X-Mantur-Client": "cli",
23
24
  ...(includeKey && apiKey ? { "x-api-key": apiKey } : {}),
24
25
  ...(body ? { "Content-Type": "application/json" } : {}),
25
26
  ...headers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manturhub/cli",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "ManturHub 算子广场 CLI:通过 REST 发现和调用 AI 算子、浏览配方,并安装 Skill 与 Agent 套件",
5
5
  "type": "module",
6
6
  "bin": {