@flashbacktech/tsclient 0.4.64 → 0.4.65

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/dist/index.cjs CHANGED
@@ -1453,6 +1453,60 @@ var ResellerClient = class {
1453
1453
  }
1454
1454
  };
1455
1455
 
1456
+ // src/modules/platformAdmin/PlatformAdminClient.ts
1457
+ var PlatformAdminClient = class {
1458
+ constructor(http) {
1459
+ this.http = http;
1460
+ }
1461
+ // --- Global backend settings (open registration + free-tier credits) ---
1462
+ /** Current global settings. */
1463
+ async getPlatformSettings() {
1464
+ const res = await this.http.get("/admin/platform-settings");
1465
+ return unwrapData(res);
1466
+ }
1467
+ /** Update the global settings. */
1468
+ async updatePlatformSettings(body) {
1469
+ const res = await this.http.put("/admin/platform-settings", {
1470
+ body
1471
+ });
1472
+ return unwrapData(res);
1473
+ }
1474
+ // --- Chat-model selection (bridged to cloud-agent) ---
1475
+ /** Current model selection (provider priority + per-provider/role models). */
1476
+ async getModelSelection() {
1477
+ const res = await this.http.get("/admin/model-selection");
1478
+ return unwrapData(res);
1479
+ }
1480
+ /** Full replace of the model selection. Returns the fresh selection. */
1481
+ async putModelSelection(body) {
1482
+ const res = await this.http.put("/admin/model-selection", { body });
1483
+ return unwrapData(res);
1484
+ }
1485
+ /** Upsert a single (provider, role) → model slot. Returns the fresh selection. */
1486
+ async patchModelSelection(body) {
1487
+ const res = await this.http.patch("/admin/model-selection", {
1488
+ body
1489
+ });
1490
+ return unwrapData(res);
1491
+ }
1492
+ // --- Model pricing / surcharge (bridged to cloud-agent) ---
1493
+ /** All model_pricing rows. */
1494
+ async listModelPricing() {
1495
+ const res = await this.http.get(
1496
+ "/admin/model-pricing"
1497
+ );
1498
+ return unwrapData(res).pricing ?? [];
1499
+ }
1500
+ /** Upsert one model_pricing row. Returns the fresh list. */
1501
+ async putModelPricing(row) {
1502
+ const res = await this.http.put(
1503
+ "/admin/model-pricing",
1504
+ { body: row }
1505
+ );
1506
+ return unwrapData(res).pricing ?? [];
1507
+ }
1508
+ };
1509
+
1456
1510
  // src/client.ts
1457
1511
  var AgentEngineFacade = class {
1458
1512
  constructor(templates, scheduledTasks) {
@@ -1488,6 +1542,7 @@ var CloudAgentClient = class {
1488
1542
  this.budgets = new BudgetsClient(this.http);
1489
1543
  this.referrals = new ReferralsClient(this.http);
1490
1544
  this.reseller = new ResellerClient(this.http);
1545
+ this.platformAdmin = new PlatformAdminClient(this.http);
1491
1546
  }
1492
1547
  };
1493
1548
 
@@ -2337,6 +2392,7 @@ exports.MFAType = MFAType;
2337
2392
  exports.NotImplementedError = NotImplementedError;
2338
2393
  exports.OrgRoles = OrgRoles;
2339
2394
  exports.PROVIDER_CATALOG = PROVIDER_CATALOG;
2395
+ exports.PlatformAdminClient = PlatformAdminClient;
2340
2396
  exports.ProviderType = ProviderType;
2341
2397
  exports.ReferralsClient = ReferralsClient;
2342
2398
  exports.ResellerClient = ResellerClient;