runbios-sdk 0.2.1-dev.133 → 0.2.1-dev.134

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.d.ts CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export declare const VERSION = "0.2.1-dev.133";
39
+ export declare const VERSION = "0.2.1-dev.134";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export const VERSION = '0.2.1-dev.133';
39
+ export const VERSION = '0.2.1-dev.134';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -411,8 +411,17 @@ export declare class Loop {
411
411
  * Turn the agent on: mints the workspace's managed serverless key. After
412
412
  * this, automatic judges and sample runs make model calls billed to the
413
413
  * workspace. Idempotent.
414
+ *
415
+ * `monthly_spend_cap_cents` caps what that key may spend on model calls in
416
+ * a calendar month. Omitted = no cap on a fresh key, and an existing cap is
417
+ * left as it is; sent while the agent is already on, it moves the cap on
418
+ * the existing key without minting a new one. When the cap is reached the
419
+ * agent's model calls are refused until next month and its runs pause with
420
+ * that reason.
414
421
  */
415
- enableAgent(): Promise<LoopAgentCredential>;
422
+ enableAgent(opts?: {
423
+ monthly_spend_cap_cents?: number;
424
+ }): Promise<LoopAgentCredential>;
416
425
  /**
417
426
  * Turn the agent off: revokes its key and sets every automatic judge back to
418
427
  * manual. Open runs stop where they are and continue if it is turned back
@@ -582,9 +582,19 @@ export class Loop {
582
582
  * Turn the agent on: mints the workspace's managed serverless key. After
583
583
  * this, automatic judges and sample runs make model calls billed to the
584
584
  * workspace. Idempotent.
585
+ *
586
+ * `monthly_spend_cap_cents` caps what that key may spend on model calls in
587
+ * a calendar month. Omitted = no cap on a fresh key, and an existing cap is
588
+ * left as it is; sent while the agent is already on, it moves the cap on
589
+ * the existing key without minting a new one. When the cap is reached the
590
+ * agent's model calls are refused until next month and its runs pause with
591
+ * that reason.
585
592
  */
586
- async enableAgent() {
587
- const res = await this._http.fetchPost('/api/loop/agent', {});
593
+ async enableAgent(opts = {}) {
594
+ const body = {};
595
+ if (opts.monthly_spend_cap_cents != null)
596
+ body.monthly_spend_cap_cents = opts.monthly_spend_cap_cents;
597
+ const res = await this._http.fetchPost('/api/loop/agent', body);
588
598
  return res.credential;
589
599
  }
590
600
  /**
package/dist/types.d.ts CHANGED
@@ -2527,6 +2527,13 @@ export interface LoopAgentCredential {
2527
2527
  last_used_at: string | null;
2528
2528
  last_error: string | null;
2529
2529
  revoked_at: string | null;
2530
+ /**
2531
+ * The most the agent's key may spend on model calls in a calendar month,
2532
+ * in cents. `null` = no cap (the default): the agent can spend up to the
2533
+ * workspace's serverless balance. Once reached, the agent's model calls
2534
+ * are refused until next month and its runs pause with that reason.
2535
+ */
2536
+ monthly_spend_cap_cents: number | null;
2530
2537
  }
2531
2538
  export interface LoopAgentStatus {
2532
2539
  /** An agent can exist in this environment at all. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.1-dev.133",
3
+ "version": "0.2.1-dev.134",
4
4
  "description": "Official TypeScript SDK for the Run BiOS training and deployment platform API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",