@flashbacktech/tsclient 0.4.66 → 0.4.68

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.cts CHANGED
@@ -498,6 +498,52 @@ interface AdjustOrgCreditsResult {
498
498
  description?: string;
499
499
  };
500
500
  }
501
+ /** Sortable columns on the platform-admin org summary. */
502
+ type AdminOrgSummarySort = 'name' | 'users' | 'projects' | 'sandboxes' | 'billed' | 'purchases' | 'balance';
503
+ /** Query for GET /admin/orgs/summary (platform-admin only). */
504
+ interface AdminOrgSummaryQuery {
505
+ /** Case-insensitive name substring; empty/omitted returns all orgs. */
506
+ q?: string;
507
+ /** Page size (default 25, max 200). */
508
+ limit?: number;
509
+ /** Page offset (default 0). */
510
+ offset?: number;
511
+ sort?: AdminOrgSummarySort;
512
+ order?: 'asc' | 'desc';
513
+ }
514
+ /**
515
+ * One organization's row on the platform-admin summary screen. Counts and
516
+ * billing come from the backend DB; usage7d/30d are stitched in from the
517
+ * cloud-agent usage service (zero when that relay is unavailable). All money
518
+ * fields are USD micros.
519
+ */
520
+ interface AdminOrgSummaryRow {
521
+ orgId: string;
522
+ orgName: string;
523
+ isBusiness: boolean;
524
+ isReseller: boolean;
525
+ userCount: number;
526
+ projectCount: number;
527
+ sandboxCount: number;
528
+ /** Total metered LLM/agent cost (byok+platform+agent), trailing windows. */
529
+ usage7dMicros: number;
530
+ usage30dMicros: number;
531
+ /** Billed-to-balance (credit debits), trailing windows. */
532
+ billed7dMicros: number;
533
+ billed30dMicros: number;
534
+ /** Lifetime COMPLETED payments (subscriptions + credit packs). */
535
+ purchasesMicros: number;
536
+ /** Current standing balance (permanent + subscription buckets). */
537
+ creditBalanceMicros: number;
538
+ }
539
+ /** Paged response for GET /admin/orgs/summary. */
540
+ interface AdminOrgSummaryResponse {
541
+ rows: AdminOrgSummaryRow[];
542
+ /** Total orgs matching the search (for pagination), across all pages. */
543
+ total: number;
544
+ limit: number;
545
+ offset: number;
546
+ }
501
547
 
502
548
  declare class OrganizationClient {
503
549
  private readonly http;
@@ -549,6 +595,14 @@ declare class OrganizationClient {
549
595
  * can show "N more — refine your search". Returns 403 unless platform admin.
550
596
  */
551
597
  searchOrgs(q?: string, limit?: number): Promise<OrgSearchResult>;
598
+ /**
599
+ * Platform-admin only: one page of the service-wide org summary — per-org
600
+ * user/project/sandbox counts, trailing 7d/30d metered usage, billed-to-
601
+ * balance, lifetime purchases and current credit balance — searchable by
602
+ * name and pageable. Backs the admin Summary screen. Returns 403 unless the
603
+ * caller's home org is the configured ADMIN_ORGANIZATION.
604
+ */
605
+ adminOrgSummary(query?: AdminOrgSummaryQuery): Promise<AdminOrgSummaryResponse>;
552
606
  /**
553
607
  * Platform-admin only: provision a new organization + founding owner and
554
608
  * email the owner an invite link. The invite-only counterpart to public
@@ -752,12 +806,41 @@ interface CreateGatewayTokenResponse {
752
806
  token: GatewayToken;
753
807
  secret: string;
754
808
  }
809
+ interface AgentToken {
810
+ id: string;
811
+ sandboxId: string;
812
+ label: string;
813
+ tokenPrefix: string;
814
+ lastUsedAt?: string;
815
+ createdAt: string;
816
+ }
817
+ interface CreateAgentTokenRequest {
818
+ label: string;
819
+ }
820
+ interface CreateAgentTokenResponse {
821
+ token: AgentToken;
822
+ secret: string;
823
+ }
755
824
  interface SimpleKeysResponse {
756
825
  success: boolean;
757
826
  message?: string;
758
827
  data?: unknown;
759
828
  }
760
829
 
830
+ declare class AgentTokensClient {
831
+ private readonly http;
832
+ constructor(http: BaseClient);
833
+ list(sandboxId: string): Promise<AgentToken[]>;
834
+ /**
835
+ * create returns both the persisted token row and the plaintext bearer
836
+ * (`secret`). The bearer is shown only here; surface it to the user
837
+ * immediately. If they navigate away without copying, they must delete the
838
+ * token and create a new one.
839
+ */
840
+ create(sandboxId: string, body: CreateAgentTokenRequest): Promise<CreateAgentTokenResponse>;
841
+ delete(sandboxId: string, tokenId: string): Promise<SimpleKeysResponse>;
842
+ }
843
+
761
844
  declare class GatewayTokensClient {
762
845
  private readonly http;
763
846
  constructor(http: BaseClient);
@@ -835,6 +918,8 @@ declare class CredentialsClient {
835
918
  private readonly http;
836
919
  readonly sandbox: SandboxCredentialScope;
837
920
  readonly gatewayTokens: GatewayTokensClient;
921
+ /** Sandbox agent access tokens — bearers external agents use against /mcp. */
922
+ readonly agentTokens: AgentTokensClient;
838
923
  constructor(http: BaseClient);
839
924
  list(query: ListCredentialsQuery): Promise<Credential[]>;
840
925
  create(body: CreateCredentialRequest): Promise<Credential>;
@@ -2783,4 +2868,4 @@ declare class NotImplementedError extends Error {
2783
2868
  constructor(method: string);
2784
2869
  }
2785
2870
 
2786
- export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationRequest, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, type PostChatMessageRequest, type PostChatMessageResponse, type PreviewChangeRequest, type PreviewChangeResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledChange, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdatePlatformSettingsRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
2871
+ export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AdminOrgSummaryQuery, type AdminOrgSummaryResponse, type AdminOrgSummaryRow, type AdminOrgSummarySort, type AgentToken, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateAgentTokenRequest, type CreateAgentTokenResponse, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationRequest, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, type PostChatMessageRequest, type PostChatMessageResponse, type PreviewChangeRequest, type PreviewChangeResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledChange, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdatePlatformSettingsRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
package/dist/index.d.ts CHANGED
@@ -498,6 +498,52 @@ interface AdjustOrgCreditsResult {
498
498
  description?: string;
499
499
  };
500
500
  }
501
+ /** Sortable columns on the platform-admin org summary. */
502
+ type AdminOrgSummarySort = 'name' | 'users' | 'projects' | 'sandboxes' | 'billed' | 'purchases' | 'balance';
503
+ /** Query for GET /admin/orgs/summary (platform-admin only). */
504
+ interface AdminOrgSummaryQuery {
505
+ /** Case-insensitive name substring; empty/omitted returns all orgs. */
506
+ q?: string;
507
+ /** Page size (default 25, max 200). */
508
+ limit?: number;
509
+ /** Page offset (default 0). */
510
+ offset?: number;
511
+ sort?: AdminOrgSummarySort;
512
+ order?: 'asc' | 'desc';
513
+ }
514
+ /**
515
+ * One organization's row on the platform-admin summary screen. Counts and
516
+ * billing come from the backend DB; usage7d/30d are stitched in from the
517
+ * cloud-agent usage service (zero when that relay is unavailable). All money
518
+ * fields are USD micros.
519
+ */
520
+ interface AdminOrgSummaryRow {
521
+ orgId: string;
522
+ orgName: string;
523
+ isBusiness: boolean;
524
+ isReseller: boolean;
525
+ userCount: number;
526
+ projectCount: number;
527
+ sandboxCount: number;
528
+ /** Total metered LLM/agent cost (byok+platform+agent), trailing windows. */
529
+ usage7dMicros: number;
530
+ usage30dMicros: number;
531
+ /** Billed-to-balance (credit debits), trailing windows. */
532
+ billed7dMicros: number;
533
+ billed30dMicros: number;
534
+ /** Lifetime COMPLETED payments (subscriptions + credit packs). */
535
+ purchasesMicros: number;
536
+ /** Current standing balance (permanent + subscription buckets). */
537
+ creditBalanceMicros: number;
538
+ }
539
+ /** Paged response for GET /admin/orgs/summary. */
540
+ interface AdminOrgSummaryResponse {
541
+ rows: AdminOrgSummaryRow[];
542
+ /** Total orgs matching the search (for pagination), across all pages. */
543
+ total: number;
544
+ limit: number;
545
+ offset: number;
546
+ }
501
547
 
502
548
  declare class OrganizationClient {
503
549
  private readonly http;
@@ -549,6 +595,14 @@ declare class OrganizationClient {
549
595
  * can show "N more — refine your search". Returns 403 unless platform admin.
550
596
  */
551
597
  searchOrgs(q?: string, limit?: number): Promise<OrgSearchResult>;
598
+ /**
599
+ * Platform-admin only: one page of the service-wide org summary — per-org
600
+ * user/project/sandbox counts, trailing 7d/30d metered usage, billed-to-
601
+ * balance, lifetime purchases and current credit balance — searchable by
602
+ * name and pageable. Backs the admin Summary screen. Returns 403 unless the
603
+ * caller's home org is the configured ADMIN_ORGANIZATION.
604
+ */
605
+ adminOrgSummary(query?: AdminOrgSummaryQuery): Promise<AdminOrgSummaryResponse>;
552
606
  /**
553
607
  * Platform-admin only: provision a new organization + founding owner and
554
608
  * email the owner an invite link. The invite-only counterpart to public
@@ -752,12 +806,41 @@ interface CreateGatewayTokenResponse {
752
806
  token: GatewayToken;
753
807
  secret: string;
754
808
  }
809
+ interface AgentToken {
810
+ id: string;
811
+ sandboxId: string;
812
+ label: string;
813
+ tokenPrefix: string;
814
+ lastUsedAt?: string;
815
+ createdAt: string;
816
+ }
817
+ interface CreateAgentTokenRequest {
818
+ label: string;
819
+ }
820
+ interface CreateAgentTokenResponse {
821
+ token: AgentToken;
822
+ secret: string;
823
+ }
755
824
  interface SimpleKeysResponse {
756
825
  success: boolean;
757
826
  message?: string;
758
827
  data?: unknown;
759
828
  }
760
829
 
830
+ declare class AgentTokensClient {
831
+ private readonly http;
832
+ constructor(http: BaseClient);
833
+ list(sandboxId: string): Promise<AgentToken[]>;
834
+ /**
835
+ * create returns both the persisted token row and the plaintext bearer
836
+ * (`secret`). The bearer is shown only here; surface it to the user
837
+ * immediately. If they navigate away without copying, they must delete the
838
+ * token and create a new one.
839
+ */
840
+ create(sandboxId: string, body: CreateAgentTokenRequest): Promise<CreateAgentTokenResponse>;
841
+ delete(sandboxId: string, tokenId: string): Promise<SimpleKeysResponse>;
842
+ }
843
+
761
844
  declare class GatewayTokensClient {
762
845
  private readonly http;
763
846
  constructor(http: BaseClient);
@@ -835,6 +918,8 @@ declare class CredentialsClient {
835
918
  private readonly http;
836
919
  readonly sandbox: SandboxCredentialScope;
837
920
  readonly gatewayTokens: GatewayTokensClient;
921
+ /** Sandbox agent access tokens — bearers external agents use against /mcp. */
922
+ readonly agentTokens: AgentTokensClient;
838
923
  constructor(http: BaseClient);
839
924
  list(query: ListCredentialsQuery): Promise<Credential[]>;
840
925
  create(body: CreateCredentialRequest): Promise<Credential>;
@@ -2783,4 +2868,4 @@ declare class NotImplementedError extends Error {
2783
2868
  constructor(method: string);
2784
2869
  }
2785
2870
 
2786
- export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationRequest, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, type PostChatMessageRequest, type PostChatMessageResponse, type PreviewChangeRequest, type PreviewChangeResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledChange, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdatePlatformSettingsRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
2871
+ export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AdminOrgSummaryQuery, type AdminOrgSummaryResponse, type AdminOrgSummaryRow, type AdminOrgSummarySort, type AgentToken, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateAgentTokenRequest, type CreateAgentTokenResponse, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationRequest, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, type PostChatMessageRequest, type PostChatMessageResponse, type PreviewChangeRequest, type PreviewChangeResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledChange, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdatePlatformSettingsRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
package/dist/index.js CHANGED
@@ -319,6 +319,20 @@ var OrganizationClient = class {
319
319
  });
320
320
  return unwrapData(res);
321
321
  }
322
+ /**
323
+ * Platform-admin only: one page of the service-wide org summary — per-org
324
+ * user/project/sandbox counts, trailing 7d/30d metered usage, billed-to-
325
+ * balance, lifetime purchases and current credit balance — searchable by
326
+ * name and pageable. Backs the admin Summary screen. Returns 403 unless the
327
+ * caller's home org is the configured ADMIN_ORGANIZATION.
328
+ */
329
+ async adminOrgSummary(query = {}) {
330
+ const res = await this.http.get(
331
+ "/admin/orgs/summary",
332
+ { query }
333
+ );
334
+ return unwrapData(res);
335
+ }
322
336
  /**
323
337
  * Platform-admin only: provision a new organization + founding owner and
324
338
  * email the owner an invite link. The invite-only counterpart to public
@@ -548,6 +562,49 @@ function normalizeGatewayToken(wire) {
548
562
  createdAt: wire.createdAt
549
563
  };
550
564
  }
565
+ function normalizeAgentToken(wire) {
566
+ return {
567
+ id: wire.id,
568
+ sandboxId: wire.sandboxId ?? wire.repoId ?? "",
569
+ label: wire.label,
570
+ tokenPrefix: wire.tokenPrefix,
571
+ lastUsedAt: wire.lastUsedAt ?? void 0,
572
+ createdAt: wire.createdAt
573
+ };
574
+ }
575
+
576
+ // src/modules/credentials/AgentTokensClient.ts
577
+ var AgentTokensClient = class {
578
+ constructor(http) {
579
+ this.http = http;
580
+ }
581
+ async list(sandboxId) {
582
+ const res = await this.http.get(
583
+ `/sandbox/${sandboxId}/agent-token`
584
+ );
585
+ const list = res.tokens ?? res.data ?? [];
586
+ return list.map(normalizeAgentToken);
587
+ }
588
+ /**
589
+ * create returns both the persisted token row and the plaintext bearer
590
+ * (`secret`). The bearer is shown only here; surface it to the user
591
+ * immediately. If they navigate away without copying, they must delete the
592
+ * token and create a new one.
593
+ */
594
+ async create(sandboxId, body) {
595
+ const res = await this.http.post(`/sandbox/${sandboxId}/agent-token`, { body });
596
+ if (!res.token || !res.secret) {
597
+ throw new Error("createAgentToken response missing token or secret.");
598
+ }
599
+ return {
600
+ token: normalizeAgentToken(res.token),
601
+ secret: res.secret
602
+ };
603
+ }
604
+ delete(sandboxId, tokenId) {
605
+ return this.http.delete(`/sandbox/${sandboxId}/agent-token/${tokenId}`);
606
+ }
607
+ };
551
608
 
552
609
  // src/modules/credentials/GatewayTokensClient.ts
553
610
  var GatewayTokensClient = class {
@@ -608,6 +665,7 @@ var CredentialsClient = class {
608
665
  this.http = http;
609
666
  this.sandbox = new SandboxCredentialScope(http);
610
667
  this.gatewayTokens = new GatewayTokensClient(http);
668
+ this.agentTokens = new AgentTokensClient(http);
611
669
  }
612
670
  async list(query) {
613
671
  const res = await this.http.get(