agental-sdk 0.7.0 → 0.9.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.
package/README.md CHANGED
@@ -348,9 +348,10 @@ An account starts on the free plan: nothing a month, and what it runs is paid fr
348
348
  const page = await agental.invoices({ limit: 10 });
349
349
  for await (const invoice of agental.allInvoices()) console.log(invoice.number, invoice.status, invoice.totalMicros);
350
350
  const { card } = await agental.card();
351
+ const { details } = await agental.billingDetails();
351
352
  ```
352
353
 
353
- `invoices()` gives the account's invoices from the payment provider, newest first, 25 to a page unless `limit` says otherwise: a plan's months, top-ups and auto-reloads, each with its number, state, what it was for, what it came to in millionths, and its page and PDF (`null` for an admin). Pass a page's `next` as `startingAfter` for the page after it, or let `allInvoices()` read them all. `card()` gives the card the account pays with now: brand, last four, expiry and wallet, or `null` where none is saved.
354
+ `invoices()` gives the account's invoices from the payment provider, newest first, 25 to a page unless `limit` says otherwise: a plan's months, top-ups and auto-reloads, each with its number, state, what it was for, what it came to in millionths, and its page and PDF (`null` for an admin). Pass a page's `next` as `startingAfter` for the page after it, or let `allInvoices()` read them all. `card()` gives the card the account pays with now: brand, last four, expiry and wallet, or `null` where none is saved. `billingDetails()` gives who the invoices are made out to: the email they go to, the name and address on them and the tax ids, or `null` before the account has bought anything. It is the owner's to read: an admin's call is refused with 403.
354
355
 
355
356
  The free plan makes tiny and small sandboxes, the $100 plan medium ones too, and the $500 and $2000 plans every size: `prices.tiers` lists the plans, and each plan's `sizes` says which. A create, fork or template start of a size the plan does not make throws an `ApiError` with the status 402 and the code `size_not_on_plan`, whose message names the plan that makes it. A sandbox made before a change of plan still starts at its own size.
356
357
 
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Http, type AgentalOptions } from "./http.js";
2
2
  import { Email, Sandbox, type CreateOptions } from "./sandbox.js";
3
3
  import { Templates } from "./template.js";
4
- import type { AccountEmail, AccountExport, ApiKey, ApiKeyUsage, Billing, Headroom, HeadroomNow, HeadroomRange, Catalog, HostRoute, Invite, Me, Member, Organization, Region, AutoReload, BillingCard, BillingInvoice, BillingInvoices, Checkout, DataRetention, CreateApiKey, CreatedApiKey, MetricsAtMoment, Policy, Prices, RunningOverTime, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, Snapshot, Team, TeamRole, Telemetry, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, Usage, Webhook, EgressAccount } from "./types.js";
4
+ import type { AccountEmail, AccountExport, ApiKey, ApiKeyUsage, Billing, Headroom, HeadroomNow, HeadroomRange, Catalog, HostRoute, Invite, Me, Member, Organization, Region, AutoReload, BillingCard, BillingDetails, BillingInvoice, BillingInvoices, Checkout, DataRetention, CreateApiKey, CreatedApiKey, MetricsAtMoment, Policy, Prices, RunningOverTime, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, Snapshot, Team, TeamRole, Telemetry, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, Usage, Webhook, EgressAccount } from "./types.js";
5
5
  /** What a list of sandboxes is narrowed to. Each field left out narrows nothing; a list of values is any of them. */
6
6
  export interface SandboxFilter {
7
7
  /** Tags every sandbox has. */
@@ -27,7 +27,7 @@ export interface SandboxFilter {
27
27
  memoryKept?: boolean;
28
28
  /** open, blocked or allowlist. */
29
29
  outbound?: string | readonly string[];
30
- /** What they are doing: low-cpu, disk-full, memory-full or not-read. Any of them. */
30
+ /** What they are doing: low-cpu, disk-full, memory-full, agent-silent or not-read. Any of them. */
31
31
  activity?: string | readonly string[];
32
32
  /** None of these. */
33
33
  notActivity?: string | readonly string[];
@@ -325,6 +325,8 @@ export declare class Agental {
325
325
  }): AsyncGenerator<BillingInvoice, void, void>;
326
326
  /** The card the account pays with now, the one an auto-reload charges: its brand, last four, expiry and wallet, or null where none is saved. */
327
327
  card(): Promise<BillingCard>;
328
+ /** Who the account's invoices are made out to: the email they go to, the name and address on them, and its tax ids. Null before it has bought anything. An owner's to read: an admin is refused with 403. */
329
+ billingDetails(): Promise<BillingDetails>;
328
330
  /** The account's mail: the handle every address of its sandboxes carries, what its plan allows, and what it has had of that today. */
329
331
  email(): Promise<AccountEmail>;
330
332
  /**
package/dist/client.js CHANGED
@@ -451,6 +451,10 @@ export class Agental {
451
451
  async card() {
452
452
  return (await this.http.json({ method: "GET", path: "/v1/billing/card", replay: true })).body;
453
453
  }
454
+ /** Who the account's invoices are made out to: the email they go to, the name and address on them, and its tax ids. Null before it has bought anything. An owner's to read: an admin is refused with 403. */
455
+ async billingDetails() {
456
+ return (await this.http.json({ method: "GET", path: "/v1/billing/details", replay: true })).body;
457
+ }
454
458
  /** The account's mail: the handle every address of its sandboxes carries, what its plan allows, and what it has had of that today. */
455
459
  async email() {
456
460
  return (await this.http.json({ method: "GET", path: "/v1/email", replay: true })).body;
package/dist/index.d.ts CHANGED
@@ -8,5 +8,5 @@ export { Terminal, TERMINAL_CLOSE, TERMINAL_PROTOCOL } from "./terminal.js";
8
8
  export type { TerminalExit, TerminalOptions, WebSocketConstructor, WebSocketLike } from "./terminal.js";
9
9
  export type { TemplateChanges } from "./template.js";
10
10
  export type { BurstOptions, CommandLine, CreateOptions, DesktopButton, ExecEvent, ExecOptions, SandboxChanges, ScreenshotOptions, SendEmailOptions, StartOptions, StopOptions, WaitOptions } from "./sandbox.js";
11
- export type { AccountEmail, ApiKey, ApiKeyAction, ApiKeyPreset, ApiKeyUsage, Billing, BrowserState, BurstFee, BurstQuote, Headroom, HeadroomNow, HeadroomRange, HeadroomStep, Catalog, Region, AutoReload, BillingCard, BillingInvoice, BillingInvoices, Checkout, Command, CreateSchedule, CreateApiKey, CreatedApiKey, DesktopLink, DesktopScreenshot, DesktopState, Egress, EgressAccount, EgressInput, EmailMessage, EmailMessageList, EmailMessageSummary, ExecResult, HiddenVariable, HostRoute, Invite, Me, Member, Organization, MetricsAtMoment, MetricsReading, NetworkRule, Operation, PlainVariable, Plan, Policy, Prices, RunningOverTime, SandboxAutoStop, SandboxEmail, SandboxInfo, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, SandboxMetrics, SandboxNetwork, SandboxNetworkDetail, SandboxOwnNetwork, SandboxStatus, SandboxTemplate, SandboxUsage, Schedule, ScheduleRun, SecretVariable, SendEmail, SetAutoStop, Size, Snapshot, SshKey, SshState, UpdateSchedule, Team, TeamRole, Telemetry, DataRetention, AccountExport, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, TemplateApplied, TemplateInfo, TemplateNetwork, TemplateSandbox, TemplateStart, TemplateSsh, Usage, Webhook, WebhookDelivery, } from "./types.js";
11
+ export type { AccountEmail, ApiKey, ApiKeyAction, ApiKeyPreset, ApiKeyUsage, Billing, BrowserState, BurstFee, BurstQuote, Headroom, HeadroomNow, HeadroomRange, HeadroomStep, Catalog, Region, AutoReload, BillingCard, BillingDetails, BillingInvoice, BillingInvoices, Checkout, Command, CreateSchedule, CreateApiKey, CreatedApiKey, DesktopLink, DesktopScreenshot, DesktopState, Egress, EgressAccount, EgressInput, EmailMessage, EmailMessageList, EmailMessageSummary, ExecResult, HiddenVariable, HostRoute, Invite, Me, Member, Organization, MetricsAtMoment, MetricsReading, NetworkRule, Operation, PlainVariable, Plan, Policy, Prices, RunningOverTime, SandboxAutoStop, SandboxEmail, SandboxInfo, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, SandboxMetrics, SandboxNetwork, SandboxNetworkDetail, SandboxOwnNetwork, SandboxStatus, SandboxTemplate, SandboxUsage, Schedule, ScheduleRun, SecretVariable, SendEmail, SetAutoStop, Size, Snapshot, SshKey, SshState, UpdateSchedule, Team, TeamRole, Telemetry, DataRetention, AccountExport, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, TemplateApplied, TemplateInfo, TemplateNetwork, TemplateSandbox, TemplateStart, TemplateSsh, Usage, Webhook, WebhookDelivery, } from "./types.js";
12
12
  export { verifyWebhook } from "./webhooks.js";
package/dist/openapi.d.ts CHANGED
@@ -2336,6 +2336,22 @@ export interface paths {
2336
2336
  patch?: never;
2337
2337
  trace?: never;
2338
2338
  };
2339
+ "/v1/billing/details": {
2340
+ parameters: {
2341
+ query?: never;
2342
+ header?: never;
2343
+ path?: never;
2344
+ cookie?: never;
2345
+ };
2346
+ get: operations["getBillingDetails"];
2347
+ put?: never;
2348
+ post?: never;
2349
+ delete?: never;
2350
+ options?: never;
2351
+ head?: never;
2352
+ patch?: never;
2353
+ trace?: never;
2354
+ };
2339
2355
  "/v1/cli-sign-ins": {
2340
2356
  parameters: {
2341
2357
  query?: never;
@@ -3108,8 +3124,8 @@ export interface components {
3108
3124
  network: components["schemas"]["SandboxNetwork"];
3109
3125
  /** @description What it is doing, as last read: null when it is not running, not read yet, or where GET /v1/policy says metrics is false. */
3110
3126
  activity: {
3111
- /** @description low-cpu: for the last hour, observed with enough coverage, its CPU at its busiest stayed under the line (5% of its vCPUs unless the deployment sets another). A heuristic: an agent waiting on a model or a download is busy with almost no CPU, and nothing acts on it by itself. disk-full, memory-full: at or over the line (90%). not-read: its server has not answered for 3 minutes, and none of the others is said. */
3112
- states: ("low-cpu" | "disk-full" | "memory-full" | "not-read")[];
3127
+ /** @description low-cpu: for the last hour, observed with enough coverage, its CPU at its busiest stayed under the line (5% of its vCPUs unless the deployment sets another). A heuristic: an agent waiting on a model or a download is busy with almost no CPU, and nothing acts on it by itself. disk-full, memory-full: at or over the line (90%). agent-silent: the agent in its machine that runs commands, reads and writes files and serves the terminal has not answered for 15 seconds or more, so those fail until it does; it was stopped or killed from inside the sandbox, or the machine is hung. A restart of the sandbox starts it again. not-read: its server has not answered for 3 minutes, and none of the others is said. */
3128
+ states: ("low-cpu" | "disk-full" | "memory-full" | "agent-silent" | "not-read")[];
3113
3129
  /** @description Its CPU now, 0 to 1 of its vCPUs. */
3114
3130
  cpuNow: number | null;
3115
3131
  /** @description Its CPU at its busiest in the last hour, 0 to 1 of its vCPUs. */
@@ -5288,6 +5304,35 @@ export interface components {
5288
5304
  wallet: string | null;
5289
5305
  } | null;
5290
5306
  };
5307
+ BillingDetails: {
5308
+ /** @description Null where the account has bought nothing and saved no card yet, or the payment provider has no customer for it. */
5309
+ details: {
5310
+ /** @description Where invoices and receipts are sent. */
5311
+ email: string | null;
5312
+ /** @description The name on invoices: a company's, or a person's. */
5313
+ name: string | null;
5314
+ address: {
5315
+ line1: string | null;
5316
+ line2: string | null;
5317
+ city: string | null;
5318
+ postalCode: string | null;
5319
+ state: string | null;
5320
+ /**
5321
+ * @description Two letters, as BG.
5322
+ * @example BG
5323
+ */
5324
+ country: string | null;
5325
+ } | null;
5326
+ taxIds: {
5327
+ /** @example eu_vat */
5328
+ type: string;
5329
+ /** @example BG123456789 */
5330
+ value: string;
5331
+ /** @description verified, pending or unverified, as the tax authority answered; null where it is not checked. */
5332
+ verification: string | null;
5333
+ }[];
5334
+ } | null;
5335
+ };
5291
5336
  CliSignIn: {
5292
5337
  /** @example cli_5d0f3c9a7e214b86a0c1d2e3f4a5b6c7 */
5293
5338
  id: string;
@@ -6089,7 +6134,7 @@ export interface operations {
6089
6134
  memoryKept?: string;
6090
6135
  /** @description An outbound rule: open, blocked or allowlist. Sent more than once, or with commas, any of them. */
6091
6136
  outbound?: string | string[];
6092
- /** @description What they are doing: low-cpu, disk-full, memory-full or not-read. Sent more than once, or with commas, any of them. Only where GET /v1/policy says metrics. */
6137
+ /** @description What they are doing: low-cpu, disk-full, memory-full, agent-silent or not-read. Sent more than once, or with commas, any of them. Only where GET /v1/policy says metrics. */
6093
6138
  activity?: string | string[];
6094
6139
  /** @description What they are not doing: none of these states. */
6095
6140
  notActivity?: string | string[];
@@ -6309,7 +6354,7 @@ export interface operations {
6309
6354
  memoryKept?: string;
6310
6355
  /** @description An outbound rule: open, blocked or allowlist. Sent more than once, or with commas, any of them. */
6311
6356
  outbound?: string | string[];
6312
- /** @description What they are doing: low-cpu, disk-full, memory-full or not-read. Sent more than once, or with commas, any of them. Only where GET /v1/policy says metrics. */
6357
+ /** @description What they are doing: low-cpu, disk-full, memory-full, agent-silent or not-read. Sent more than once, or with commas, any of them. Only where GET /v1/policy says metrics. */
6313
6358
  activity?: string | string[];
6314
6359
  /** @description What they are not doing: none of these states. */
6315
6360
  notActivity?: string | string[];
@@ -16607,6 +16652,44 @@ export interface operations {
16607
16652
  };
16608
16653
  };
16609
16654
  };
16655
+ getBillingDetails: {
16656
+ parameters: {
16657
+ query?: never;
16658
+ header?: never;
16659
+ path?: never;
16660
+ cookie?: never;
16661
+ };
16662
+ requestBody?: never;
16663
+ responses: {
16664
+ /** @description Who the account's invoices are made out to: the email they go to, the name and address on them, and its tax ids, as an EU VAT number. Read from the payment provider each time, and changed on its page, POST /v1/billing/portal; the next invoice carries them. */
16665
+ 200: {
16666
+ headers: {
16667
+ [name: string]: unknown;
16668
+ };
16669
+ content: {
16670
+ "application/json": components["schemas"]["BillingDetails"];
16671
+ };
16672
+ };
16673
+ /** @description forbidden: only an owner of a team sees who its invoices are made out to. */
16674
+ 403: {
16675
+ headers: {
16676
+ [name: string]: unknown;
16677
+ };
16678
+ content: {
16679
+ "application/json": components["schemas"]["Error"];
16680
+ };
16681
+ };
16682
+ /** @description billing_not_configured: nothing is sold here. */
16683
+ 409: {
16684
+ headers: {
16685
+ [name: string]: unknown;
16686
+ };
16687
+ content: {
16688
+ "application/json": components["schemas"]["Error"];
16689
+ };
16690
+ };
16691
+ };
16692
+ };
16610
16693
  createCliSignIn: {
16611
16694
  parameters: {
16612
16695
  query?: never;
package/dist/types.d.ts CHANGED
@@ -176,6 +176,7 @@ export type BillingInvoices = Schemas["BillingInvoices"];
176
176
  export type BillingInvoice = Schemas["BillingInvoices"]["invoices"][number];
177
177
  /** The card the account pays with now, or null where it has none: brand, last four, expiry and wallet only. */
178
178
  export type BillingCard = Schemas["BillingCard"];
179
+ export type BillingDetails = Schemas["BillingDetails"];
179
180
  /** Whether mail is on for a sandbox, and the domain its addresses end in. */
180
181
  export type SandboxEmail = Schemas["SandboxEmail"];
181
182
  /** A message as a list gives it: who it is from and for, what was made of its sender, and where a sent one has got to. */
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** This package's version, as package.json says it. A test holds the two to the same. */
2
- export declare const VERSION = "0.7.0";
2
+ export declare const VERSION = "0.9.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** This package's version, as package.json says it. A test holds the two to the same. */
2
- export const VERSION = "0.7.0";
2
+ export const VERSION = "0.9.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agental-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "TypeScript SDK for agental.io: Linux sandboxes for your agents. The agental command is the package agental.",
5
5
  "license": "MIT",
6
6
  "author": "VERTIXER LTD",