@flashbacktech/tsclient 0.4.64 → 0.4.66

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
@@ -2659,6 +2659,86 @@ declare class ResellerClient {
2659
2659
  updatePayout(payoutId: string, body: UpdatePayoutRequest): Promise<ResellerPayout>;
2660
2660
  }
2661
2661
 
2662
+ /** Global settings managed by a platform admin (backend PlatformSettings row). */
2663
+ interface PlatformSettings {
2664
+ openRegistration: boolean;
2665
+ freeTierCreditsOrgMicros: number;
2666
+ freeTierCreditsIndividualMicros: number;
2667
+ updatedAt: string;
2668
+ updatedBy?: string | null;
2669
+ /** Display name of the updater (resolved server-side from updatedBy). */
2670
+ updatedByName?: string | null;
2671
+ }
2672
+ /** Models the aigateway currently exposes — used to validate selection/pricing. */
2673
+ interface AvailableModels {
2674
+ /** Flat, de-duplicated, sorted list of every reachable model id. */
2675
+ models: string[];
2676
+ /** Same models grouped by provider (OPENAI/ANTHROPIC/GEMINI/BEDROCK/…). */
2677
+ byProvider: Record<string, string[]>;
2678
+ }
2679
+ /** Body for PUT /admin/platform-settings. */
2680
+ interface UpdatePlatformSettingsRequest {
2681
+ openRegistration: boolean;
2682
+ freeTierCreditsOrgMicros: number;
2683
+ freeTierCreditsIndividualMicros: number;
2684
+ }
2685
+ /**
2686
+ * Chat-model selection: the ordered provider priority plus the per-provider,
2687
+ * per-role model id map. Mirrors the agent's chat_models.json shape.
2688
+ * Roles: CHAT_LOOP_MODEL | SUMMARY_MODEL | SAFETY_CLASSIFIER_MODEL.
2689
+ * Providers: OPENAI | ANTHROPIC | GEMINI | BEDROCK.
2690
+ */
2691
+ interface ModelSelection {
2692
+ priority: string[];
2693
+ modelsByProvider: Record<string, Record<string, string>>;
2694
+ }
2695
+ /** Body for PATCH /admin/model-selection — upsert a single slot. */
2696
+ interface PatchModelSelectionRequest {
2697
+ provider: string;
2698
+ role: string;
2699
+ modelId: string;
2700
+ }
2701
+ /** One row of the agent's model_pricing table (USD micros per 1M tokens). */
2702
+ interface ModelPricingRow {
2703
+ model: string;
2704
+ input_usd_micros_per_million: number;
2705
+ output_usd_micros_per_million: number;
2706
+ cached_input_discount_bps: number;
2707
+ counts_toward_budget: boolean;
2708
+ /** Platform-key markup in bps; 10000 = 1.00x (no markup). */
2709
+ surcharge_coefficient_bps: number;
2710
+ notes?: string;
2711
+ updated_at?: string;
2712
+ }
2713
+
2714
+ /**
2715
+ * Platform-admin global config. All endpoints are gated server-side on the
2716
+ * caller's home org being a platform-admin org. The model-selection / pricing
2717
+ * methods are proxied through the backend to the cloud-agent service.
2718
+ */
2719
+ declare class PlatformAdminClient {
2720
+ private readonly http;
2721
+ constructor(http: BaseClient);
2722
+ /** Current global settings. */
2723
+ getPlatformSettings(): Promise<PlatformSettings>;
2724
+ /** Update the global settings. */
2725
+ updatePlatformSettings(body: UpdatePlatformSettingsRequest): Promise<PlatformSettings>;
2726
+ /** Models the aigateway currently exposes (for validating selection/pricing). */
2727
+ listAvailableModels(): Promise<AvailableModels>;
2728
+ /** Current model selection (provider priority + per-provider/role models). */
2729
+ getModelSelection(): Promise<ModelSelection>;
2730
+ /** Full replace of the model selection. Returns the fresh selection. */
2731
+ putModelSelection(body: ModelSelection): Promise<ModelSelection>;
2732
+ /** Upsert a single (provider, role) → model slot. Returns the fresh selection. */
2733
+ patchModelSelection(body: PatchModelSelectionRequest): Promise<ModelSelection>;
2734
+ /** All model_pricing rows. */
2735
+ listModelPricing(): Promise<ModelPricingRow[]>;
2736
+ /** Upsert one model_pricing row (also used to add a new row). Returns the fresh list. */
2737
+ putModelPricing(row: ModelPricingRow): Promise<ModelPricingRow[]>;
2738
+ /** Delete a model_pricing row by model id. Returns the fresh list. */
2739
+ deleteModelPricing(model: string): Promise<ModelPricingRow[]>;
2740
+ }
2741
+
2662
2742
  type CloudAgentClientOptions = BaseClientOptions;
2663
2743
  declare class AgentEngineFacade {
2664
2744
  readonly templates: TemplatesClient;
@@ -2688,6 +2768,7 @@ declare class CloudAgentClient {
2688
2768
  readonly budgets: BudgetsClient;
2689
2769
  readonly referrals: ReferralsClient;
2690
2770
  readonly reseller: ResellerClient;
2771
+ readonly platformAdmin: PlatformAdminClient;
2691
2772
  constructor(options: CloudAgentClientOptions);
2692
2773
  }
2693
2774
 
@@ -2702,4 +2783,4 @@ declare class NotImplementedError extends Error {
2702
2783
  constructor(method: string);
2703
2784
  }
2704
2785
 
2705
- 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, 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 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 Payment, type PeekScanLeaseResponse, 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 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -2659,6 +2659,86 @@ declare class ResellerClient {
2659
2659
  updatePayout(payoutId: string, body: UpdatePayoutRequest): Promise<ResellerPayout>;
2660
2660
  }
2661
2661
 
2662
+ /** Global settings managed by a platform admin (backend PlatformSettings row). */
2663
+ interface PlatformSettings {
2664
+ openRegistration: boolean;
2665
+ freeTierCreditsOrgMicros: number;
2666
+ freeTierCreditsIndividualMicros: number;
2667
+ updatedAt: string;
2668
+ updatedBy?: string | null;
2669
+ /** Display name of the updater (resolved server-side from updatedBy). */
2670
+ updatedByName?: string | null;
2671
+ }
2672
+ /** Models the aigateway currently exposes — used to validate selection/pricing. */
2673
+ interface AvailableModels {
2674
+ /** Flat, de-duplicated, sorted list of every reachable model id. */
2675
+ models: string[];
2676
+ /** Same models grouped by provider (OPENAI/ANTHROPIC/GEMINI/BEDROCK/…). */
2677
+ byProvider: Record<string, string[]>;
2678
+ }
2679
+ /** Body for PUT /admin/platform-settings. */
2680
+ interface UpdatePlatformSettingsRequest {
2681
+ openRegistration: boolean;
2682
+ freeTierCreditsOrgMicros: number;
2683
+ freeTierCreditsIndividualMicros: number;
2684
+ }
2685
+ /**
2686
+ * Chat-model selection: the ordered provider priority plus the per-provider,
2687
+ * per-role model id map. Mirrors the agent's chat_models.json shape.
2688
+ * Roles: CHAT_LOOP_MODEL | SUMMARY_MODEL | SAFETY_CLASSIFIER_MODEL.
2689
+ * Providers: OPENAI | ANTHROPIC | GEMINI | BEDROCK.
2690
+ */
2691
+ interface ModelSelection {
2692
+ priority: string[];
2693
+ modelsByProvider: Record<string, Record<string, string>>;
2694
+ }
2695
+ /** Body for PATCH /admin/model-selection — upsert a single slot. */
2696
+ interface PatchModelSelectionRequest {
2697
+ provider: string;
2698
+ role: string;
2699
+ modelId: string;
2700
+ }
2701
+ /** One row of the agent's model_pricing table (USD micros per 1M tokens). */
2702
+ interface ModelPricingRow {
2703
+ model: string;
2704
+ input_usd_micros_per_million: number;
2705
+ output_usd_micros_per_million: number;
2706
+ cached_input_discount_bps: number;
2707
+ counts_toward_budget: boolean;
2708
+ /** Platform-key markup in bps; 10000 = 1.00x (no markup). */
2709
+ surcharge_coefficient_bps: number;
2710
+ notes?: string;
2711
+ updated_at?: string;
2712
+ }
2713
+
2714
+ /**
2715
+ * Platform-admin global config. All endpoints are gated server-side on the
2716
+ * caller's home org being a platform-admin org. The model-selection / pricing
2717
+ * methods are proxied through the backend to the cloud-agent service.
2718
+ */
2719
+ declare class PlatformAdminClient {
2720
+ private readonly http;
2721
+ constructor(http: BaseClient);
2722
+ /** Current global settings. */
2723
+ getPlatformSettings(): Promise<PlatformSettings>;
2724
+ /** Update the global settings. */
2725
+ updatePlatformSettings(body: UpdatePlatformSettingsRequest): Promise<PlatformSettings>;
2726
+ /** Models the aigateway currently exposes (for validating selection/pricing). */
2727
+ listAvailableModels(): Promise<AvailableModels>;
2728
+ /** Current model selection (provider priority + per-provider/role models). */
2729
+ getModelSelection(): Promise<ModelSelection>;
2730
+ /** Full replace of the model selection. Returns the fresh selection. */
2731
+ putModelSelection(body: ModelSelection): Promise<ModelSelection>;
2732
+ /** Upsert a single (provider, role) → model slot. Returns the fresh selection. */
2733
+ patchModelSelection(body: PatchModelSelectionRequest): Promise<ModelSelection>;
2734
+ /** All model_pricing rows. */
2735
+ listModelPricing(): Promise<ModelPricingRow[]>;
2736
+ /** Upsert one model_pricing row (also used to add a new row). Returns the fresh list. */
2737
+ putModelPricing(row: ModelPricingRow): Promise<ModelPricingRow[]>;
2738
+ /** Delete a model_pricing row by model id. Returns the fresh list. */
2739
+ deleteModelPricing(model: string): Promise<ModelPricingRow[]>;
2740
+ }
2741
+
2662
2742
  type CloudAgentClientOptions = BaseClientOptions;
2663
2743
  declare class AgentEngineFacade {
2664
2744
  readonly templates: TemplatesClient;
@@ -2688,6 +2768,7 @@ declare class CloudAgentClient {
2688
2768
  readonly budgets: BudgetsClient;
2689
2769
  readonly referrals: ReferralsClient;
2690
2770
  readonly reseller: ResellerClient;
2771
+ readonly platformAdmin: PlatformAdminClient;
2691
2772
  constructor(options: CloudAgentClientOptions);
2692
2773
  }
2693
2774
 
@@ -2702,4 +2783,4 @@ declare class NotImplementedError extends Error {
2702
2783
  constructor(method: string);
2703
2784
  }
2704
2785
 
2705
- 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, 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 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 Payment, type PeekScanLeaseResponse, 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 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 };
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 };
package/dist/index.js CHANGED
@@ -1451,6 +1451,74 @@ var ResellerClient = class {
1451
1451
  }
1452
1452
  };
1453
1453
 
1454
+ // src/modules/platformAdmin/PlatformAdminClient.ts
1455
+ var PlatformAdminClient = class {
1456
+ constructor(http) {
1457
+ this.http = http;
1458
+ }
1459
+ // --- Global backend settings (open registration + free-tier credits) ---
1460
+ /** Current global settings. */
1461
+ async getPlatformSettings() {
1462
+ const res = await this.http.get("/admin/platform-settings");
1463
+ return unwrapData(res);
1464
+ }
1465
+ /** Update the global settings. */
1466
+ async updatePlatformSettings(body) {
1467
+ const res = await this.http.put("/admin/platform-settings", {
1468
+ body
1469
+ });
1470
+ return unwrapData(res);
1471
+ }
1472
+ /** Models the aigateway currently exposes (for validating selection/pricing). */
1473
+ async listAvailableModels() {
1474
+ const res = await this.http.get(
1475
+ "/admin/available-models"
1476
+ );
1477
+ return unwrapData(res);
1478
+ }
1479
+ // --- Chat-model selection (bridged to cloud-agent) ---
1480
+ /** Current model selection (provider priority + per-provider/role models). */
1481
+ async getModelSelection() {
1482
+ const res = await this.http.get("/admin/model-selection");
1483
+ return unwrapData(res);
1484
+ }
1485
+ /** Full replace of the model selection. Returns the fresh selection. */
1486
+ async putModelSelection(body) {
1487
+ const res = await this.http.put("/admin/model-selection", { body });
1488
+ return unwrapData(res);
1489
+ }
1490
+ /** Upsert a single (provider, role) → model slot. Returns the fresh selection. */
1491
+ async patchModelSelection(body) {
1492
+ const res = await this.http.patch("/admin/model-selection", {
1493
+ body
1494
+ });
1495
+ return unwrapData(res);
1496
+ }
1497
+ // --- Model pricing / surcharge (bridged to cloud-agent) ---
1498
+ /** All model_pricing rows. */
1499
+ async listModelPricing() {
1500
+ const res = await this.http.get(
1501
+ "/admin/model-pricing"
1502
+ );
1503
+ return unwrapData(res).pricing ?? [];
1504
+ }
1505
+ /** Upsert one model_pricing row (also used to add a new row). Returns the fresh list. */
1506
+ async putModelPricing(row) {
1507
+ const res = await this.http.put(
1508
+ "/admin/model-pricing",
1509
+ { body: row }
1510
+ );
1511
+ return unwrapData(res).pricing ?? [];
1512
+ }
1513
+ /** Delete a model_pricing row by model id. Returns the fresh list. */
1514
+ async deleteModelPricing(model) {
1515
+ const res = await this.http.delete(
1516
+ `/admin/model-pricing?model=${encodeURIComponent(model)}`
1517
+ );
1518
+ return unwrapData(res).pricing ?? [];
1519
+ }
1520
+ };
1521
+
1454
1522
  // src/client.ts
1455
1523
  var AgentEngineFacade = class {
1456
1524
  constructor(templates, scheduledTasks) {
@@ -1486,6 +1554,7 @@ var CloudAgentClient = class {
1486
1554
  this.budgets = new BudgetsClient(this.http);
1487
1555
  this.referrals = new ReferralsClient(this.http);
1488
1556
  this.reseller = new ResellerClient(this.http);
1557
+ this.platformAdmin = new PlatformAdminClient(this.http);
1489
1558
  }
1490
1559
  };
1491
1560
 
@@ -2320,6 +2389,6 @@ var usdMicros = {
2320
2389
  fromDollars: (dollars) => Math.round(dollars * 1e6)
2321
2390
  };
2322
2391
 
2323
- export { AccessType, BaseClient, BudgetsClient, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, CloudAgentClient, HttpError, MFAType, NotImplementedError, OrgRoles, PROVIDER_CATALOG, ProviderType, ReferralsClient, ResellerClient, ResourcesClient, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
2392
+ export { AccessType, BaseClient, BudgetsClient, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, CloudAgentClient, HttpError, MFAType, NotImplementedError, OrgRoles, PROVIDER_CATALOG, PlatformAdminClient, ProviderType, ReferralsClient, ResellerClient, ResourcesClient, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
2324
2393
  //# sourceMappingURL=index.js.map
2325
2394
  //# sourceMappingURL=index.js.map