@flashbacktech/tsclient 0.4.44 → 0.4.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -2
- package/dist/index.d.ts +107 -2
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -295,6 +295,12 @@ interface Organization {
|
|
|
295
295
|
mfaEnforced: boolean;
|
|
296
296
|
reposDisabled?: boolean;
|
|
297
297
|
allowDebug: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Platform-admin org. Members are platform admins; the org's reference
|
|
300
|
+
* project holds the global AI-key pool. Server-asserted (replaces the old
|
|
301
|
+
* ADMIN_ORGANIZATION env var).
|
|
302
|
+
*/
|
|
303
|
+
isAdmin?: boolean;
|
|
298
304
|
}
|
|
299
305
|
interface UpdateOrganizationRequest {
|
|
300
306
|
name?: string;
|
|
@@ -473,11 +479,24 @@ interface ProjectMember {
|
|
|
473
479
|
role: string;
|
|
474
480
|
user: UserSummary;
|
|
475
481
|
}
|
|
482
|
+
/** AI providers eligible for the per-project platform-keys opt-in. */
|
|
483
|
+
type PreferredAiProvider = 'OPENAI' | 'ANTHROPIC' | 'GEMINI' | 'BEDROCK';
|
|
476
484
|
interface Project {
|
|
477
485
|
id: string;
|
|
478
486
|
name: string;
|
|
479
487
|
orgId: string;
|
|
480
488
|
default: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Marks the admin org's global-AI-key project (its AI credentials form the
|
|
491
|
+
* platform-wide pool). Meaningful only for the platform-admin org.
|
|
492
|
+
*/
|
|
493
|
+
isReferenceProject?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* When set on a project with no BYOK AI credentials, routes that project's
|
|
496
|
+
* LLM calls to the platform ("global") keys for this provider. Mutually
|
|
497
|
+
* exclusive with BYOK AI keys. Null/absent = BYOK.
|
|
498
|
+
*/
|
|
499
|
+
preferredAiProvider?: PreferredAiProvider | null;
|
|
481
500
|
users: ProjectMember[];
|
|
482
501
|
}
|
|
483
502
|
interface CreateProjectRequest {
|
|
@@ -485,6 +504,9 @@ interface CreateProjectRequest {
|
|
|
485
504
|
}
|
|
486
505
|
interface UpdateProjectRequest {
|
|
487
506
|
name?: string;
|
|
507
|
+
isReferenceProject?: boolean;
|
|
508
|
+
/** Empty string clears the platform-keys opt-in (back to BYOK). */
|
|
509
|
+
preferredAiProvider?: PreferredAiProvider | '' | null;
|
|
488
510
|
}
|
|
489
511
|
interface AddMemberRequest {
|
|
490
512
|
userId: string;
|
|
@@ -807,6 +829,36 @@ interface PostChatMessageResponse {
|
|
|
807
829
|
message_id: string;
|
|
808
830
|
turn_id: string;
|
|
809
831
|
}
|
|
832
|
+
/**
|
|
833
|
+
* One user's "Satisfied? Yes/No" rating plus an optional free-text comment on
|
|
834
|
+
* the agent's behaviour (agent_chat_feedback). `turn_id` is null for
|
|
835
|
+
* whole-conversation feedback; non-null scopes it to a single turn. Fields are
|
|
836
|
+
* snake_case to match the wire format.
|
|
837
|
+
*/
|
|
838
|
+
interface ChatFeedback {
|
|
839
|
+
id: string;
|
|
840
|
+
conversation_id: string;
|
|
841
|
+
turn_id?: string | null;
|
|
842
|
+
org_id: string;
|
|
843
|
+
repo_id: string;
|
|
844
|
+
user_id: string;
|
|
845
|
+
satisfied: boolean;
|
|
846
|
+
comment?: string | null;
|
|
847
|
+
created_at: string;
|
|
848
|
+
updated_at: string;
|
|
849
|
+
}
|
|
850
|
+
interface SubmitChatFeedbackRequest {
|
|
851
|
+
satisfied: boolean;
|
|
852
|
+
comment?: string;
|
|
853
|
+
/** Omit (or null) for whole-conversation feedback; set to scope to a turn. */
|
|
854
|
+
turn_id?: string;
|
|
855
|
+
}
|
|
856
|
+
interface ChatFeedbackEnvelope {
|
|
857
|
+
feedback: ChatFeedback;
|
|
858
|
+
}
|
|
859
|
+
interface ListChatFeedbackResponse {
|
|
860
|
+
feedback: ChatFeedback[];
|
|
861
|
+
}
|
|
810
862
|
interface AnswerChatQuestionRequest {
|
|
811
863
|
question_id: string;
|
|
812
864
|
selected_ids?: string[];
|
|
@@ -1281,6 +1333,22 @@ declare class ChatSchedulesScope {
|
|
|
1281
1333
|
*/
|
|
1282
1334
|
listRuns(scope: ChatScope, scheduleId: string): Promise<ListChatScheduleRunsResponse>;
|
|
1283
1335
|
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Feedback scope — a user's "Satisfied? Yes/No" rating + optional comment on a
|
|
1338
|
+
* chat session, and the list of feedback recorded for it (so the UI can
|
|
1339
|
+
* pre-fill and so an org admin can review past ratings). Conversation-scoped;
|
|
1340
|
+
* pass `turn_id` in the body to scope feedback to a single turn.
|
|
1341
|
+
*
|
|
1342
|
+
* Endpoint shape:
|
|
1343
|
+
* POST /v1/agent/chat/sessions/:id/feedback
|
|
1344
|
+
* GET /v1/agent/chat/sessions/:id/feedback
|
|
1345
|
+
*/
|
|
1346
|
+
declare class ChatFeedbackScope {
|
|
1347
|
+
private readonly http;
|
|
1348
|
+
constructor(http: BaseClient);
|
|
1349
|
+
submit(scope: ChatScope, conversationId: string, body: SubmitChatFeedbackRequest): Promise<ChatFeedbackEnvelope>;
|
|
1350
|
+
list(scope: ChatScope, conversationId: string): Promise<ListChatFeedbackResponse>;
|
|
1351
|
+
}
|
|
1284
1352
|
declare class ChatClient {
|
|
1285
1353
|
private readonly http;
|
|
1286
1354
|
private readonly streamDeps;
|
|
@@ -1289,6 +1357,7 @@ declare class ChatClient {
|
|
|
1289
1357
|
readonly questions: ChatQuestionsScope;
|
|
1290
1358
|
readonly debug: ChatDebugScope;
|
|
1291
1359
|
readonly schedules: ChatSchedulesScope;
|
|
1360
|
+
readonly feedback: ChatFeedbackScope;
|
|
1292
1361
|
constructor(http: BaseClient, streamDeps: {
|
|
1293
1362
|
baseUrl: string;
|
|
1294
1363
|
getToken?: TokenProvider;
|
|
@@ -1840,6 +1909,33 @@ interface BuyCustomCreditResponse {
|
|
|
1840
1909
|
error_code?: string;
|
|
1841
1910
|
message?: string;
|
|
1842
1911
|
}
|
|
1912
|
+
/**
|
|
1913
|
+
* A fixed credit pack from the catalog, served by GET /credits/packs.
|
|
1914
|
+
* `creditsMicros` is what lands in the permanent bucket on purchase;
|
|
1915
|
+
* `price` is the dollar amount Stripe charges (may differ — e.g. a pack
|
|
1916
|
+
* can grant a bonus, $50 → 55 of credits).
|
|
1917
|
+
*/
|
|
1918
|
+
interface CreditPack {
|
|
1919
|
+
id: string;
|
|
1920
|
+
name: string;
|
|
1921
|
+
code: string;
|
|
1922
|
+
creditsMicros: number;
|
|
1923
|
+
price: number;
|
|
1924
|
+
}
|
|
1925
|
+
/** Body for POST /credits/packs/buy. */
|
|
1926
|
+
interface BuyCreditPackRequest {
|
|
1927
|
+
packId: string;
|
|
1928
|
+
}
|
|
1929
|
+
/** Response from POST /credits/packs/buy. */
|
|
1930
|
+
interface BuyCreditPackResponse {
|
|
1931
|
+
success: boolean;
|
|
1932
|
+
checkoutUrl?: string;
|
|
1933
|
+
sessionId?: string;
|
|
1934
|
+
error_code?: string;
|
|
1935
|
+
message?: string;
|
|
1936
|
+
/** ISO-8601; set when error_code = PACK_LIMIT_REACHED. */
|
|
1937
|
+
nextAvailableAt?: string;
|
|
1938
|
+
}
|
|
1843
1939
|
/**
|
|
1844
1940
|
* Refusal reasons from POST /v1/agent/chat/sessions/:id/messages when
|
|
1845
1941
|
* the billing preflight rejects a turn (HTTP 402). Frontend maps these
|
|
@@ -1876,8 +1972,17 @@ declare class CreditsClient {
|
|
|
1876
1972
|
constructor(http: BaseClient);
|
|
1877
1973
|
getBalance(): Promise<CreditBalance>;
|
|
1878
1974
|
listTransactions(query?: ListCreditsTransactionsQuery): Promise<ListCreditsTransactionsResponse>;
|
|
1879
|
-
/**
|
|
1975
|
+
/** Per-month credit activity (consumption / purchases / grants). */
|
|
1880
1976
|
getMonthlyStats(): Promise<MonthlyCreditStats[]>;
|
|
1977
|
+
/** Fixed credit-pack catalog. Public endpoint. */
|
|
1978
|
+
listPacks(): Promise<CreditPack[]>;
|
|
1979
|
+
/**
|
|
1980
|
+
* Buy a fixed credit pack. Requires an active paid subscription
|
|
1981
|
+
* (the backend 403s free-tier orgs with SUBSCRIPTION_REQUIRED) and
|
|
1982
|
+
* caps purchases per pack per billing cycle. Returns a Stripe
|
|
1983
|
+
* Checkout URL to redirect to.
|
|
1984
|
+
*/
|
|
1985
|
+
buyPack(body: BuyCreditPackRequest): Promise<BuyCreditPackResponse>;
|
|
1881
1986
|
/**
|
|
1882
1987
|
* "Other amount" PAYG config — bounds + presets for the
|
|
1883
1988
|
* arbitrary-dollar tile. Public endpoint; returns a disabled
|
|
@@ -2168,4 +2273,4 @@ declare class NotImplementedError extends Error {
|
|
|
2168
2273
|
constructor(method: string);
|
|
2169
2274
|
}
|
|
2170
2275
|
|
|
2171
|
-
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 AuthUser, BaseClient, type BaseClientOptions, type BudgetScope, BudgetsClient, 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 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 CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, 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 GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, 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 ModeType, type MonthlyCreditStats, NotImplementedError, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, OrgRoles, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RefreshRequest, type RegisterRequest, type RequestOptions, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, 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 UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, 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 };
|
|
2276
|
+
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 AuthUser, BaseClient, type BaseClientOptions, 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 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 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 ModeType, type MonthlyCreditStats, NotImplementedError, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, OrgRoles, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RefreshRequest, type RegisterRequest, type RequestOptions, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, 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 UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, 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
|
@@ -295,6 +295,12 @@ interface Organization {
|
|
|
295
295
|
mfaEnforced: boolean;
|
|
296
296
|
reposDisabled?: boolean;
|
|
297
297
|
allowDebug: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Platform-admin org. Members are platform admins; the org's reference
|
|
300
|
+
* project holds the global AI-key pool. Server-asserted (replaces the old
|
|
301
|
+
* ADMIN_ORGANIZATION env var).
|
|
302
|
+
*/
|
|
303
|
+
isAdmin?: boolean;
|
|
298
304
|
}
|
|
299
305
|
interface UpdateOrganizationRequest {
|
|
300
306
|
name?: string;
|
|
@@ -473,11 +479,24 @@ interface ProjectMember {
|
|
|
473
479
|
role: string;
|
|
474
480
|
user: UserSummary;
|
|
475
481
|
}
|
|
482
|
+
/** AI providers eligible for the per-project platform-keys opt-in. */
|
|
483
|
+
type PreferredAiProvider = 'OPENAI' | 'ANTHROPIC' | 'GEMINI' | 'BEDROCK';
|
|
476
484
|
interface Project {
|
|
477
485
|
id: string;
|
|
478
486
|
name: string;
|
|
479
487
|
orgId: string;
|
|
480
488
|
default: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Marks the admin org's global-AI-key project (its AI credentials form the
|
|
491
|
+
* platform-wide pool). Meaningful only for the platform-admin org.
|
|
492
|
+
*/
|
|
493
|
+
isReferenceProject?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* When set on a project with no BYOK AI credentials, routes that project's
|
|
496
|
+
* LLM calls to the platform ("global") keys for this provider. Mutually
|
|
497
|
+
* exclusive with BYOK AI keys. Null/absent = BYOK.
|
|
498
|
+
*/
|
|
499
|
+
preferredAiProvider?: PreferredAiProvider | null;
|
|
481
500
|
users: ProjectMember[];
|
|
482
501
|
}
|
|
483
502
|
interface CreateProjectRequest {
|
|
@@ -485,6 +504,9 @@ interface CreateProjectRequest {
|
|
|
485
504
|
}
|
|
486
505
|
interface UpdateProjectRequest {
|
|
487
506
|
name?: string;
|
|
507
|
+
isReferenceProject?: boolean;
|
|
508
|
+
/** Empty string clears the platform-keys opt-in (back to BYOK). */
|
|
509
|
+
preferredAiProvider?: PreferredAiProvider | '' | null;
|
|
488
510
|
}
|
|
489
511
|
interface AddMemberRequest {
|
|
490
512
|
userId: string;
|
|
@@ -807,6 +829,36 @@ interface PostChatMessageResponse {
|
|
|
807
829
|
message_id: string;
|
|
808
830
|
turn_id: string;
|
|
809
831
|
}
|
|
832
|
+
/**
|
|
833
|
+
* One user's "Satisfied? Yes/No" rating plus an optional free-text comment on
|
|
834
|
+
* the agent's behaviour (agent_chat_feedback). `turn_id` is null for
|
|
835
|
+
* whole-conversation feedback; non-null scopes it to a single turn. Fields are
|
|
836
|
+
* snake_case to match the wire format.
|
|
837
|
+
*/
|
|
838
|
+
interface ChatFeedback {
|
|
839
|
+
id: string;
|
|
840
|
+
conversation_id: string;
|
|
841
|
+
turn_id?: string | null;
|
|
842
|
+
org_id: string;
|
|
843
|
+
repo_id: string;
|
|
844
|
+
user_id: string;
|
|
845
|
+
satisfied: boolean;
|
|
846
|
+
comment?: string | null;
|
|
847
|
+
created_at: string;
|
|
848
|
+
updated_at: string;
|
|
849
|
+
}
|
|
850
|
+
interface SubmitChatFeedbackRequest {
|
|
851
|
+
satisfied: boolean;
|
|
852
|
+
comment?: string;
|
|
853
|
+
/** Omit (or null) for whole-conversation feedback; set to scope to a turn. */
|
|
854
|
+
turn_id?: string;
|
|
855
|
+
}
|
|
856
|
+
interface ChatFeedbackEnvelope {
|
|
857
|
+
feedback: ChatFeedback;
|
|
858
|
+
}
|
|
859
|
+
interface ListChatFeedbackResponse {
|
|
860
|
+
feedback: ChatFeedback[];
|
|
861
|
+
}
|
|
810
862
|
interface AnswerChatQuestionRequest {
|
|
811
863
|
question_id: string;
|
|
812
864
|
selected_ids?: string[];
|
|
@@ -1281,6 +1333,22 @@ declare class ChatSchedulesScope {
|
|
|
1281
1333
|
*/
|
|
1282
1334
|
listRuns(scope: ChatScope, scheduleId: string): Promise<ListChatScheduleRunsResponse>;
|
|
1283
1335
|
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Feedback scope — a user's "Satisfied? Yes/No" rating + optional comment on a
|
|
1338
|
+
* chat session, and the list of feedback recorded for it (so the UI can
|
|
1339
|
+
* pre-fill and so an org admin can review past ratings). Conversation-scoped;
|
|
1340
|
+
* pass `turn_id` in the body to scope feedback to a single turn.
|
|
1341
|
+
*
|
|
1342
|
+
* Endpoint shape:
|
|
1343
|
+
* POST /v1/agent/chat/sessions/:id/feedback
|
|
1344
|
+
* GET /v1/agent/chat/sessions/:id/feedback
|
|
1345
|
+
*/
|
|
1346
|
+
declare class ChatFeedbackScope {
|
|
1347
|
+
private readonly http;
|
|
1348
|
+
constructor(http: BaseClient);
|
|
1349
|
+
submit(scope: ChatScope, conversationId: string, body: SubmitChatFeedbackRequest): Promise<ChatFeedbackEnvelope>;
|
|
1350
|
+
list(scope: ChatScope, conversationId: string): Promise<ListChatFeedbackResponse>;
|
|
1351
|
+
}
|
|
1284
1352
|
declare class ChatClient {
|
|
1285
1353
|
private readonly http;
|
|
1286
1354
|
private readonly streamDeps;
|
|
@@ -1289,6 +1357,7 @@ declare class ChatClient {
|
|
|
1289
1357
|
readonly questions: ChatQuestionsScope;
|
|
1290
1358
|
readonly debug: ChatDebugScope;
|
|
1291
1359
|
readonly schedules: ChatSchedulesScope;
|
|
1360
|
+
readonly feedback: ChatFeedbackScope;
|
|
1292
1361
|
constructor(http: BaseClient, streamDeps: {
|
|
1293
1362
|
baseUrl: string;
|
|
1294
1363
|
getToken?: TokenProvider;
|
|
@@ -1840,6 +1909,33 @@ interface BuyCustomCreditResponse {
|
|
|
1840
1909
|
error_code?: string;
|
|
1841
1910
|
message?: string;
|
|
1842
1911
|
}
|
|
1912
|
+
/**
|
|
1913
|
+
* A fixed credit pack from the catalog, served by GET /credits/packs.
|
|
1914
|
+
* `creditsMicros` is what lands in the permanent bucket on purchase;
|
|
1915
|
+
* `price` is the dollar amount Stripe charges (may differ — e.g. a pack
|
|
1916
|
+
* can grant a bonus, $50 → 55 of credits).
|
|
1917
|
+
*/
|
|
1918
|
+
interface CreditPack {
|
|
1919
|
+
id: string;
|
|
1920
|
+
name: string;
|
|
1921
|
+
code: string;
|
|
1922
|
+
creditsMicros: number;
|
|
1923
|
+
price: number;
|
|
1924
|
+
}
|
|
1925
|
+
/** Body for POST /credits/packs/buy. */
|
|
1926
|
+
interface BuyCreditPackRequest {
|
|
1927
|
+
packId: string;
|
|
1928
|
+
}
|
|
1929
|
+
/** Response from POST /credits/packs/buy. */
|
|
1930
|
+
interface BuyCreditPackResponse {
|
|
1931
|
+
success: boolean;
|
|
1932
|
+
checkoutUrl?: string;
|
|
1933
|
+
sessionId?: string;
|
|
1934
|
+
error_code?: string;
|
|
1935
|
+
message?: string;
|
|
1936
|
+
/** ISO-8601; set when error_code = PACK_LIMIT_REACHED. */
|
|
1937
|
+
nextAvailableAt?: string;
|
|
1938
|
+
}
|
|
1843
1939
|
/**
|
|
1844
1940
|
* Refusal reasons from POST /v1/agent/chat/sessions/:id/messages when
|
|
1845
1941
|
* the billing preflight rejects a turn (HTTP 402). Frontend maps these
|
|
@@ -1876,8 +1972,17 @@ declare class CreditsClient {
|
|
|
1876
1972
|
constructor(http: BaseClient);
|
|
1877
1973
|
getBalance(): Promise<CreditBalance>;
|
|
1878
1974
|
listTransactions(query?: ListCreditsTransactionsQuery): Promise<ListCreditsTransactionsResponse>;
|
|
1879
|
-
/**
|
|
1975
|
+
/** Per-month credit activity (consumption / purchases / grants). */
|
|
1880
1976
|
getMonthlyStats(): Promise<MonthlyCreditStats[]>;
|
|
1977
|
+
/** Fixed credit-pack catalog. Public endpoint. */
|
|
1978
|
+
listPacks(): Promise<CreditPack[]>;
|
|
1979
|
+
/**
|
|
1980
|
+
* Buy a fixed credit pack. Requires an active paid subscription
|
|
1981
|
+
* (the backend 403s free-tier orgs with SUBSCRIPTION_REQUIRED) and
|
|
1982
|
+
* caps purchases per pack per billing cycle. Returns a Stripe
|
|
1983
|
+
* Checkout URL to redirect to.
|
|
1984
|
+
*/
|
|
1985
|
+
buyPack(body: BuyCreditPackRequest): Promise<BuyCreditPackResponse>;
|
|
1881
1986
|
/**
|
|
1882
1987
|
* "Other amount" PAYG config — bounds + presets for the
|
|
1883
1988
|
* arbitrary-dollar tile. Public endpoint; returns a disabled
|
|
@@ -2168,4 +2273,4 @@ declare class NotImplementedError extends Error {
|
|
|
2168
2273
|
constructor(method: string);
|
|
2169
2274
|
}
|
|
2170
2275
|
|
|
2171
|
-
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 AuthUser, BaseClient, type BaseClientOptions, type BudgetScope, BudgetsClient, 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 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 CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, 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 GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, 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 ModeType, type MonthlyCreditStats, NotImplementedError, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, OrgRoles, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RefreshRequest, type RegisterRequest, type RequestOptions, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, 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 UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, 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 };
|
|
2276
|
+
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 AuthUser, BaseClient, type BaseClientOptions, 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 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 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 ModeType, type MonthlyCreditStats, NotImplementedError, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, OrgRoles, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RefreshRequest, type RegisterRequest, type RequestOptions, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, 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 UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, 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
|
@@ -814,6 +814,22 @@ var ChatSchedulesScope = class {
|
|
|
814
814
|
);
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
|
+
var ChatFeedbackScope = class {
|
|
818
|
+
constructor(http) {
|
|
819
|
+
this.http = http;
|
|
820
|
+
}
|
|
821
|
+
submit(scope, conversationId, body) {
|
|
822
|
+
return this.http.post(`${BASE_PATH}/${conversationId}/feedback`, {
|
|
823
|
+
body,
|
|
824
|
+
headers: scopeHeaders(scope)
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
list(scope, conversationId) {
|
|
828
|
+
return this.http.get(`${BASE_PATH}/${conversationId}/feedback`, {
|
|
829
|
+
headers: scopeHeaders(scope)
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
};
|
|
817
833
|
var ChatClient = class {
|
|
818
834
|
constructor(http, streamDeps) {
|
|
819
835
|
this.http = http;
|
|
@@ -823,6 +839,7 @@ var ChatClient = class {
|
|
|
823
839
|
this.questions = new ChatQuestionsScope(http);
|
|
824
840
|
this.debug = new ChatDebugScope(http);
|
|
825
841
|
this.schedules = new ChatSchedulesScope(http);
|
|
842
|
+
this.feedback = new ChatFeedbackScope(http);
|
|
826
843
|
}
|
|
827
844
|
openStream(options) {
|
|
828
845
|
return openChatStream(this.streamDeps, options);
|
|
@@ -1016,11 +1033,25 @@ var CreditsClient = class {
|
|
|
1016
1033
|
listTransactions(query = {}) {
|
|
1017
1034
|
return this.http.get("/credits/transactions", { query });
|
|
1018
1035
|
}
|
|
1019
|
-
/**
|
|
1036
|
+
/** Per-month credit activity (consumption / purchases / grants). */
|
|
1020
1037
|
async getMonthlyStats() {
|
|
1021
1038
|
const res = await this.http.get("/credits/stats/monthly");
|
|
1022
1039
|
return res.data ?? [];
|
|
1023
1040
|
}
|
|
1041
|
+
/** Fixed credit-pack catalog. Public endpoint. */
|
|
1042
|
+
async listPacks() {
|
|
1043
|
+
const res = await this.http.get("/credits/packs", { skipAuth: true });
|
|
1044
|
+
return res.data ?? [];
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Buy a fixed credit pack. Requires an active paid subscription
|
|
1048
|
+
* (the backend 403s free-tier orgs with SUBSCRIPTION_REQUIRED) and
|
|
1049
|
+
* caps purchases per pack per billing cycle. Returns a Stripe
|
|
1050
|
+
* Checkout URL to redirect to.
|
|
1051
|
+
*/
|
|
1052
|
+
buyPack(body) {
|
|
1053
|
+
return this.http.post("/credits/packs/buy", { body });
|
|
1054
|
+
}
|
|
1024
1055
|
/**
|
|
1025
1056
|
* "Other amount" PAYG config — bounds + presets for the
|
|
1026
1057
|
* arbitrary-dollar tile. Public endpoint; returns a disabled
|