@gravity-rail/sdk 0.8.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +45 -8
  2. package/dist/chunk-FSSXKQR5.js +471 -0
  3. package/dist/chunk-FSSXKQR5.js.map +1 -0
  4. package/dist/{chunk-QS6ZRQUZ.js → chunk-V7ZKEH4V.js} +8 -1
  5. package/dist/chunk-V7ZKEH4V.js.map +1 -0
  6. package/dist/{chunk-ML55PVP7.js → chunk-YESHLUL7.js} +1435 -703
  7. package/dist/chunk-YESHLUL7.js.map +1 -0
  8. package/dist/{client-C2aWAalu.d.cts → client-BCgXtr8p.d.cts} +3684 -1291
  9. package/dist/{client-CLGovEox.d.ts → client-Dh1l20Ue.d.ts} +3684 -1291
  10. package/dist/helpers.cjs +177 -13
  11. package/dist/helpers.cjs.map +1 -1
  12. package/dist/helpers.d.cts +82 -3
  13. package/dist/helpers.d.ts +82 -3
  14. package/dist/helpers.js +155 -12
  15. package/dist/helpers.js.map +1 -1
  16. package/dist/index.cjs +1679 -420
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +32 -24
  19. package/dist/index.d.ts +32 -24
  20. package/dist/index.js +193 -113
  21. package/dist/index.js.map +1 -1
  22. package/dist/internal.cjs +1742 -413
  23. package/dist/internal.cjs.map +1 -1
  24. package/dist/internal.d.cts +634 -29
  25. package/dist/internal.d.ts +634 -29
  26. package/dist/internal.js +140 -7
  27. package/dist/internal.js.map +1 -1
  28. package/dist/realtime.cjs +43 -0
  29. package/dist/realtime.cjs.map +1 -1
  30. package/dist/realtime.d.cts +26 -0
  31. package/dist/realtime.d.ts +26 -0
  32. package/dist/realtime.js +43 -0
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/{scopes-D6a_Mvqr.d.ts → revision-state-BTF-MnbW.d.cts} +270 -23
  35. package/dist/{scopes-CDaJBQVT.d.cts → revision-state-DOH1NMGb.d.ts} +270 -23
  36. package/dist/schemas.cjs +56 -117
  37. package/dist/schemas.cjs.map +1 -1
  38. package/dist/schemas.d.cts +121 -484
  39. package/dist/schemas.d.ts +121 -484
  40. package/dist/schemas.js +55 -114
  41. package/dist/schemas.js.map +1 -1
  42. package/dist/{inquiries-CmECZnkl.d.cts → tasks-C4aYbWVv.d.cts} +944 -148
  43. package/dist/{inquiries-CmECZnkl.d.ts → tasks-C4aYbWVv.d.ts} +944 -148
  44. package/package.json +5 -5
  45. package/dist/chunk-ML55PVP7.js.map +0 -1
  46. package/dist/chunk-QS6ZRQUZ.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { dA as SortOrder } from './inquiries-CmECZnkl.cjs';
2
- import { k_ as WorkspaceFeature, h0 as Resource$1, gA as ProductType } from './client-C2aWAalu.cjs';
1
+ import { ev as SortOrder } from './tasks-C4aYbWVv.js';
2
+ import { mz as WorkspaceFeature, hS as Resource$1, hk as ProductType } from './client-Dh1l20Ue.js';
3
3
 
4
4
  interface MemberNotificationPreferences {
5
5
  notifySms?: boolean;
@@ -29,8 +29,8 @@ interface ToolParameter {
29
29
  }
30
30
 
31
31
  /**
32
- * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
33
- * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
32
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
33
+ * (group map from emit_openapi.py). Do not edit manually.
34
34
  * Group: workspace_health
35
35
  */
36
36
  /**
@@ -124,6 +124,48 @@ interface ProvisionPlanRequest {
124
124
  subscriptionId?: number;
125
125
  }
126
126
 
127
+ /**
128
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
129
+ * (group map from emit_openapi.py). Do not edit manually.
130
+ * Group: domain
131
+ */
132
+ /**
133
+ * A registered domain and every capability mapped onto it, org-agnostic.
134
+ */
135
+ interface AdminDomainResponse {
136
+ uuid: string;
137
+ domain: string;
138
+ organizationId: number;
139
+ organizationName: string;
140
+ ownershipStatus: string;
141
+ ownershipVerifiedAt?: string | null;
142
+ emailConfigured: boolean;
143
+ emailStatus?: string | null;
144
+ siteConfigured: boolean;
145
+ siteMappings: AdminDomainSiteMapping[];
146
+ widgetMappings: AdminDomainWidgetMapping[];
147
+ createdAt: string;
148
+ updatedAt: string;
149
+ }
150
+ /**
151
+ * One site a domain routes to (from ``SiteMapping``).
152
+ */
153
+ interface AdminDomainSiteMapping {
154
+ siteSlug?: string | null;
155
+ workspaceName: string;
156
+ workspaceUuid: string;
157
+ }
158
+ /**
159
+ * One workspace's widget enablement on a domain (workspace_widget_domains).
160
+ */
161
+ interface AdminDomainWidgetMapping {
162
+ workspaceName: string;
163
+ workspaceUuid: string;
164
+ widgets: string[];
165
+ allowSubdomains: boolean;
166
+ port?: number | null;
167
+ }
168
+
127
169
  interface TaskCountResponse {
128
170
  taskCount: number;
129
171
  }
@@ -247,8 +289,8 @@ interface SystemStatistics {
247
289
  }
248
290
 
249
291
  /**
250
- * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
251
- * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
292
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
293
+ * (group map from emit_openapi.py). Do not edit manually.
252
294
  * Group: usage
253
295
  */
254
296
  /**
@@ -288,7 +330,7 @@ interface CommunicationDetailsResponse {
288
330
  interface DailyPhoneRowResponse {
289
331
  date: string;
290
332
  phoneNumberId: number;
291
- phoneNumber: string;
333
+ phoneNumber: string | null;
292
334
  phoneName: string | null;
293
335
  inbound: number;
294
336
  outbound: number;
@@ -300,7 +342,7 @@ interface DailyPhoneRowResponse {
300
342
  interface DailySMSRowResponse {
301
343
  date: string;
302
344
  phoneNumberId: number;
303
- phoneNumber: string;
345
+ phoneNumber: string | null;
304
346
  phoneName: string | null;
305
347
  inbound: number;
306
348
  outbound: number;
@@ -327,7 +369,7 @@ interface EmailUsageResponse {
327
369
  */
328
370
  interface PhoneCallPhoneNumberUsageResponse {
329
371
  phoneNumberId: number;
330
- phoneNumber: string;
372
+ phoneNumber: string | null;
331
373
  phoneName: string | null;
332
374
  inbound: number;
333
375
  outbound: number;
@@ -362,11 +404,14 @@ interface ProductOverageConfigResponse {
362
404
  *
363
405
  * Two categories:
364
406
  * - Usage resources: consumed over time, tracked per billing period.
365
- * Each has a credit cost defined in CREDITS_PER_UNIT. Credits are
366
- * the unified billing currency; resources are what you actually consume.
407
+ * AI usage converts to credits via the model multipliers in ai_models.yaml
408
+ * scaled by the plan's AI multiplier (lib/services/ai_multiplier.py); SMS,
409
+ * voice, and email convert via the telephony rate card
410
+ * (lib/services/service_rate_card.py). Credits are the unified billing
411
+ * currency; resources are what you actually consume.
367
412
  * - State resources: current count, not cumulative (members, sites, etc.)
368
413
  */
369
- type Resource = (typeof Resource)[keyof typeof Resource];
414
+ type Resource = typeof Resource[keyof typeof Resource];
370
415
  declare const Resource: {
371
416
  readonly credit: "credit";
372
417
  readonly stt: "stt";
@@ -428,7 +473,7 @@ interface SMSMessageUsageResponse {
428
473
  */
429
474
  interface SMSPhoneNumberUsageResponse {
430
475
  phoneNumberId: number;
431
- phoneNumber: string;
476
+ phoneNumber: string | null;
432
477
  phoneName: string | null;
433
478
  inbound: number;
434
479
  outbound: number;
@@ -488,7 +533,8 @@ interface WorkspaceUsageReportResponse {
488
533
 
489
534
  interface PhoneNumberUsage {
490
535
  phoneNumberId: number;
491
- phoneNumber: string;
536
+ /** Matches PhoneNumber.number (nullable). */
537
+ phoneNumber: string | null;
492
538
  phoneName: string | null;
493
539
  inbound: number;
494
540
  outbound: number;
@@ -508,8 +554,8 @@ interface MemberUsageReport {
508
554
  }
509
555
 
510
556
  /**
511
- * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
512
- * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
557
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
558
+ * (group map from emit_openapi.py). Do not edit manually.
513
559
  * Group: voice_metrics
514
560
  */
515
561
  interface CallEndSection$1 {
@@ -547,7 +593,7 @@ interface MetricSummary$1 {
547
593
  p50?: number;
548
594
  p90?: number;
549
595
  p99?: number;
550
- has_distribution?: boolean;
596
+ hasDistribution?: boolean;
551
597
  }
552
598
  interface RequestsSection$1 {
553
599
  statuses: RequestsStatusEntry$1[];
@@ -626,9 +672,42 @@ type VoiceMetricsResponse = Omit<VoiceMetricsResponse$1, 'voice' | 'chat' | 'cal
626
672
  ttsReconnect: TtsReconnectSection;
627
673
  };
628
674
 
675
+ /** A single prompt-injection finding, as returned by the admin API. */
676
+ interface AdminPidsFindingResponse {
677
+ id: number;
678
+ langfuseTraceId: string;
679
+ workspaceUuid: string;
680
+ chatId: number | null;
681
+ memberId: number | null;
682
+ channel: string;
683
+ /** Per-category combined confidence (0..1). */
684
+ attackCategories: Record<string, number>;
685
+ confidence: number;
686
+ /** Stage-1 rule names that matched (never raw matched text). */
687
+ stage1MatchedPatterns: string[];
688
+ /** Stage-2 LLM judge verdict (per-category quoted spans = PHI). */
689
+ stage2Verdict: Record<string, unknown> | null;
690
+ stage2Status: string;
691
+ detectorVersion: string;
692
+ /** scheduled | backfill | pre_llm. */
693
+ source: PidsSource;
694
+ reviewedAt: string | null;
695
+ reviewedByMemberId: number | null;
696
+ reviewerDisposition: PidsDisposition | null;
697
+ wazuhEmittedAt: string | null;
698
+ createdAt: string;
699
+ }
700
+
701
+ /** Reviewer disposition values (matches the backend `ReviewerDisposition`). */
702
+ declare const PIDS_DISPOSITIONS: readonly ["true_positive", "false_positive", "needs_more_context"];
703
+ type PidsDisposition = (typeof PIDS_DISPOSITIONS)[number];
704
+ /** Finding source values (matches the backend `FindingSource`). */
705
+ declare const PIDS_SOURCES: readonly ["scheduled", "backfill", "pre_llm"];
706
+ type PidsSource = (typeof PIDS_SOURCES)[number];
707
+
629
708
  /**
630
- * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
631
- * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
709
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
710
+ * (group map from emit_openapi.py). Do not edit manually.
632
711
  * Group: health_dashboard
633
712
  */
634
713
  /**
@@ -683,9 +762,10 @@ interface HealthSummary {
683
762
  totalWebhookVolume?: number;
684
763
  totalSmsResponded?: number;
685
764
  totalSmsOutboundChats?: number;
686
- totalMemberChats?: number;
687
765
  totalNeedsResponse?: number;
688
766
  totalAccessGapWarnings?: number;
767
+ totalRoutineWorkflowAccessWarnings?: number;
768
+ totalOpenCriticalActionIncidents?: number;
689
769
  }
690
770
  /**
691
771
  * A workspace that was skipped during metrics collection.
@@ -718,6 +798,47 @@ interface WorkspaceHealthRow {
718
798
  memberChats?: number;
719
799
  needsResponse?: number;
720
800
  accessGapWarnings?: number;
801
+ routineWorkflowAccessWarnings?: number;
802
+ openCriticalActionIncidents?: number;
803
+ }
804
+
805
+ /**
806
+ * A role in a Routine's audience that lacks Workflow USE.
807
+ *
808
+ * IDs + names are safe for admins (who already see role names); logs/breadcrumbs
809
+ * must use IDs only.
810
+ */
811
+ interface RoutineWorkflowAccessMissingRole {
812
+ id: number;
813
+ name: string;
814
+ }
815
+ /**
816
+ * One Routine → Workflow reference whose audience is missing Workflow USE.
817
+ *
818
+ * PHI-safe: Routine / EventRule / Workflow / role IDs and names only — no
819
+ * Member-level data (names, phones, emails). ``actionType`` is either an
820
+ * EventRule action type (e.g. ``"sms:send"``) or ``"routine:workflow"`` for
821
+ * the ``Routine.workflow_id`` background-run path.
822
+ */
823
+ interface RoutineWorkflowAccessWarning {
824
+ routineId: number;
825
+ routineName?: string | null;
826
+ eventRuleId?: number | null;
827
+ actionType: string;
828
+ workflowId: number;
829
+ workflowUuid: string;
830
+ workflowName: string;
831
+ targetKind: string;
832
+ missingRoles: RoutineWorkflowAccessMissingRole[];
833
+ audienceRoleCount: number;
834
+ }
835
+ /**
836
+ * Routine Workflow-access warning detail for a single workspace.
837
+ */
838
+ interface WorkspaceRoutineWorkflowAccessResponse {
839
+ workspaceUuid: string;
840
+ warnings: RoutineWorkflowAccessWarning[];
841
+ totalWarnings: number;
721
842
  }
722
843
 
723
844
  interface HealthMetricsRequest {
@@ -752,6 +873,79 @@ interface HealthDetailRequest {
752
873
  hours?: number;
753
874
  }
754
875
 
876
+ /**
877
+ * Generated by Orval, grouped by scripts/types-codegen/group_generated.ts
878
+ * (group map from emit_openapi.py). Do not edit manually.
879
+ * Group: acquisition_funnel
880
+ */
881
+ /**
882
+ * Signups within the window grouped by first-touch acquisition source.
883
+ *
884
+ * ``source`` matches ``BookOfBusinessAcquisitionDistribution.source``
885
+ * semantics (``utm_source`` or ``"direct"``) so the two rollups join.
886
+ * Only accounts WITH an acquisition record are grouped here; record-less
887
+ * accounts are counted in ``unattributedSignupCount`` instead.
888
+ */
889
+ interface AcquisitionFunnelChannel {
890
+ source: string;
891
+ signupCount: number;
892
+ latestSignupAt: string;
893
+ }
894
+ /**
895
+ * One attributed signup, newest-first — the low-volume legibility core.
896
+ *
897
+ * At a handful of signups a month the per-signup list IS the report. PII-free
898
+ * by construction: account id only (never email/name), and the acquisition
899
+ * fields are the allowlisted, query-stripped marketing values
900
+ * (``lib.services.acquisition.sanitize_acquisition``).
901
+ */
902
+ interface AcquisitionFunnelRecentSignup {
903
+ accountId: number;
904
+ createdAt: string;
905
+ source: string;
906
+ utmMedium?: string | null;
907
+ utmCampaign?: string | null;
908
+ referrer?: string | null;
909
+ landingPage?: string | null;
910
+ }
911
+ /**
912
+ * Channel -> signup rollup of ``Account.acquisition`` (superuser only).
913
+ */
914
+ interface AcquisitionFunnelResponse {
915
+ generatedAt: string;
916
+ queryVersion: string;
917
+ windowDays: number;
918
+ windowStart: string;
919
+ captureLiveSince: string | null;
920
+ signupCount: number;
921
+ attributedSignupCount: number;
922
+ unattributedSignupCount: number;
923
+ channels: AcquisitionFunnelChannel[];
924
+ recentAttributedSignups: AcquisitionFunnelRecentSignup[];
925
+ }
926
+
927
+ /**
928
+ * Widget-domain configuration types.
929
+ *
930
+ * Server response/request shapes are generated from Pydantic via
931
+ * emit_openapi.py → Orval into ./generated/workspace_widget_domain. This thin
932
+ * layer re-exports them under stable public names and adds the client-only
933
+ * widget-slug registry the UI iterates over.
934
+ *
935
+ * The candidate-domain list served by GET /w/{wid}/domains/for-widget reuses
936
+ * `WorkspaceAvailableDomainsResponse` (see ./organization-types).
937
+ */
938
+
939
+ /**
940
+ * Canonical embeddable-widget slugs. Mirrors the backend `WidgetSlug` enum
941
+ * (`lib/models/glb/workspace_widget_domain_models.py`); kept as a client-side
942
+ * const so UI can render one toggle per slug without a round-trip. Keep in sync
943
+ * with the backend registry — it is the source of truth the config API and the
944
+ * origin gate both validate against.
945
+ */
946
+ declare const WIDGET_SLUGS: readonly ["chat", "operator", "operator-tools", "chat-app"];
947
+ type WidgetSlug = (typeof WIDGET_SLUGS)[number];
948
+
755
949
  /**
756
950
  * App context types - shared between client and server
757
951
  *
@@ -927,7 +1121,16 @@ interface XAIRealtimeModelConfig extends BaseRealtimeModelConfig {
927
1121
  }
928
1122
  type RealtimeModelConfig = OpenAIRealtimeModelConfig | GeminiRealtimeModelConfig | CustomRealtimeModelConfig | AWSRealtimeModelConfig | XAIRealtimeModelConfig;
929
1123
  type GeminiThinkingLevel = 'minimal' | 'low' | 'medium' | 'high';
930
- type OpenAIReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
1124
+ /**
1125
+ * OpenAI GPT-5 reasoning effort. The ACCEPTED SUBSET IS MODEL-DEPENDENT — sending
1126
+ * an out-of-set value is a hard 400 at the API. Mirror of the per-family vocab in
1127
+ * lib/ai/chat_model_config.py (see getOpenAIReasoningEfforts):
1128
+ * gpt-5 (5.0): minimal / low / medium / high
1129
+ * gpt-5.1: none / low / medium / high
1130
+ * gpt-5.4: none / low / medium / high / xhigh
1131
+ * This union is the superset; the UI filters it down per selected model.
1132
+ */
1133
+ type OpenAIReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
931
1134
  /**
932
1135
  * xAI (Grok) reasoning levels. Note "none" disables reasoning entirely
933
1136
  * (used by Grok 4.3 to switch into non-reasoning mode); xAI does NOT
@@ -962,7 +1165,7 @@ type ChatModelConfig = GeminiChatModelConfig | ClaudeChatModelConfig | OpenAICha
962
1165
  * Supported TTS preview providers.
963
1166
  * These are the voice providers that support TTS preview in the UI.
964
1167
  */
965
- declare const TTS_PREVIEW_PROVIDERS: readonly ["openai", "elevenlabs", "google", "aws", "pocket", "deepgram", "xai"];
1168
+ declare const TTS_PREVIEW_PROVIDERS: readonly ["openai", "elevenlabs", "google", "aws", "deepgram", "xai"];
966
1169
  type TTSPreviewProvider = (typeof TTS_PREVIEW_PROVIDERS)[number];
967
1170
  /**
968
1171
  * Get the canonical voice model ID from a realtime model config.
@@ -1604,4 +1807,48 @@ declare const SCOPE_PRESETS: {
1604
1807
  ALL: ScopeName[];
1605
1808
  };
1606
1809
 
1607
- export { type MetricDataPoint as $, type AIModelUsageResponse as A, type BaseChatModelConfig as B, type CallEndSection as C, DEFAULT_CHAT_MODEL as D, type EfficiencyMetricsResponse as E, type EmailUsageResponse as F, type EngineTimeSeries as G, type ErrorCodeBucket as H, type EventRuleMetrics as I, type ExportStatistics as J, type FeatureSyncStatus as K, type GeminiChatModelConfig as L, type GeminiRealtimeModelConfig as M, type GeminiThinkingLevel as N, type MetricSummary$1 as O, type HealthCheckStatistics as P, type HealthDetailRequest as Q, type HealthMetricsRequest as R, type HealthMetricsResponse as S, type HealthSummary as T, type ImportStatistics as U, type VoiceMetricsResponse$1 as V, type WorkspaceHealthResponse$1 as W, type InterruptionSound as X, type MemberNotificationPreferences as Y, type MemberNotifyActionParams as Z, type MemberUsageReport as _, type AIUsageDetailsResponse as a, type WorkspaceHealthResponse as a$, type MetricSection as a0, type MetricSummary as a1, type MetricValue as a2, type OpenAIChatModelConfig as a3, type OpenAIRealtimeModelConfig as a4, type OpenAIReasoningEffort as a5, type OpenAISemanticVADEagerness as a6, type OpenAISemanticVADTurnDetection as a7, type OpenAIServerVADTurnDetection as a8, type OpenAITurnDetection as a9, type SkippedWorkspace as aA, type StatisticsSummary as aB, type SystemStatistics as aC, type TTSModel as aD, type TTSPreviewProvider as aE, TTS_PREVIEW_PROVIDERS as aF, type TaskContext as aG, type TaskCountResponse as aH, type ThinkingSound as aI, type TimeSeriesData as aJ, type TimeSeriesDataPoint as aK, type ToolParameter as aL, type ToolkitContext as aM, ToolkitState as aN, type TopOffender as aO, type TopResourceOverageResponse as aP, type TtsReconnectOutcomeEntry as aQ, type TtsReconnectSection as aR, type UsageProductSummaryResponse as aS, type UsageReportResponse as aT, type UsageReportRequest as aU, type UsageStatistics as aV, type VoiceMetricsResponse as aW, type VoiceMetricsTimeRange as aX, type WebhookMetrics as aY, type WorkflowContext as aZ, type WorkspaceHealthDetail as a_, type OpenAITurnDetectionType as aa, type PageContext as ab, type PerformanceMetrics as ac, type PhoneCallPhoneNumberUsageResponse as ad, type PhoneCallUsageResponse as ae, type PhoneCommunicationDetailsResponse as af, type PhoneNumberUsage as ag, type ProductOverageConfigResponse as ah, type ProvisionPlanRequest as ai, type ProvisionPlanResponse as aj, type RealtimeModelConfig as ak, type RequestsSection as al, type RequestsStatusEntry as am, type ResourceMetadata as an, type ResourceOverageResponse as ao, type ResourceScope as ap, type ResourceUsageResponse as aq, SCOPES as ar, SCOPE_PRESETS as as, type SMSCommunicationDetailsResponse as at, type SMSMessageUsageResponse as au, type SMSPhoneNumberUsageResponse as av, ScopeCategory as aw, ScopeManager as ax, type ScopeName as ay, type SiteContext as az, type AWSRealtimeModelConfig as b, type WorkspaceHealthRow as b0, type WorkspaceUsageReportResponse as b1, type XAIChatModelConfig as b2, type XAIRealtimeModelConfig as b3, type XAIReasoningEffort as b4, canPreviewVoice as b5, formatAppContextAsMarkdown as b6, getAllResourceSlugs as b7, getApplicableResourceSlugs as b8, getApplicableResources as b9, getResourceMetadata as ba, getScopeFromProductType as bb, getTTSProvider as bc, getVoiceModelId as bd, type ScopeDefinition as be, type AnalyticsFilter as c, type AnalyticsQuery as d, type AppContext as e, type AttachedAddonInfo as f, type BaseRealtimeModelConfig as g, type BillingStatistics as h, type CallEndStatusEntry as i, type ChangeWorkspaceProductRequest as j, type ChangeWorkspaceProductResponse as k, type ChannelErrorBreakdown as l, type ChannelFailures as m, type ChatModelConfig as n, type ClaudeChatModelConfig as o, type CommunicationDetailsResponse as p, type CurrentPlanInfo as q, type CustomRealtimeModelConfig as r, DEFAULT_CUSTOM_VOICE_MODEL as s, DEFAULT_THINKING_SPEECH_PHRASES as t, DEFAULT_VOICE_INFERENCE_MODEL as u, type DailyPhoneRowResponse as v, type DailySMSRowResponse as w, type DashboardMetrics as x, type DataRecordContext as y, type EmailCountsResponse as z };
1810
+ /**
1811
+ * Derived revision state — the single place derived booleans about a workflow
1812
+ * revision live. The API never puts these on the wire (they can contradict
1813
+ * their inputs; the facts they derive from can't). Every consumer — web app,
1814
+ * CLI, MCP — computes them here from the workflow root's pointer columns plus
1815
+ * the revision's own facts.
1816
+ *
1817
+ * See docs/features/conversations/workflows/versioning/api-shape.md.
1818
+ */
1819
+ /** The two facts a revision derivation needs from the stable workflow root. */
1820
+ interface RevisionStateWorkflow {
1821
+ activeRevisionId: number;
1822
+ draftRevisionId: number;
1823
+ /** Fact behind "has unpublished changes"; null after a fresh clone/publish. */
1824
+ draftModifiedAt?: string | null;
1825
+ }
1826
+ /** The two facts a derivation needs from the revision itself, when one is in hand. */
1827
+ interface RevisionStateRevision {
1828
+ id: number;
1829
+ /** Present on published revisions, null/absent on the draft. */
1830
+ publishedAt?: string | null;
1831
+ }
1832
+ interface RevisionState {
1833
+ /** This revision is the workflow's active (live-traffic) revision. */
1834
+ isActive: boolean;
1835
+ /** This revision is the workflow's mutable draft. */
1836
+ isDraft: boolean;
1837
+ /** active === draft: live traffic reads the editor's mutable draft. */
1838
+ draftIsLive: boolean;
1839
+ /** The draft has been edited since the last publish (or since creation). */
1840
+ hasUnpublishedChanges: boolean;
1841
+ /** 'published' once the revision has a publish timestamp, else 'draft'. */
1842
+ state: 'draft' | 'published';
1843
+ }
1844
+ /**
1845
+ * Derive a revision's state from the workflow root pointers and (optionally)
1846
+ * the revision in hand. Pure — no I/O, no allocation beyond the result.
1847
+ *
1848
+ * When `revision` is omitted, per-revision facts default to false / 'draft'
1849
+ * (there is no revision to compare), while the workflow-level derivations
1850
+ * (`draftIsLive`, `hasUnpublishedChanges`) are still computed.
1851
+ */
1852
+ declare function getRevisionState(workflow: RevisionStateWorkflow, revision?: RevisionStateRevision): RevisionState;
1853
+
1854
+ export { type HealthMetricsResponse as $, type AIModelUsageResponse as A, type BaseChatModelConfig as B, type CallEndSection as C, DEFAULT_CHAT_MODEL as D, DEFAULT_THINKING_SPEECH_PHRASES as E, DEFAULT_VOICE_INFERENCE_MODEL as F, type DailyPhoneRowResponse as G, type DailySMSRowResponse as H, type DashboardMetrics as I, type DataRecordContext as J, type EfficiencyMetricsResponse as K, type EmailCountsResponse as L, type EmailUsageResponse as M, type EngineTimeSeries as N, type ErrorCodeBucket as O, type EventRuleMetrics as P, type ExportStatistics as Q, type FeatureSyncStatus as R, type GeminiChatModelConfig as S, type GeminiRealtimeModelConfig as T, type GeminiThinkingLevel as U, type MetricSummary$1 as V, type VoiceMetricsResponse$1 as W, type WorkspaceHealthResponse$1 as X, type HealthCheckStatistics as Y, type HealthDetailRequest as Z, type HealthMetricsRequest as _, type AIUsageDetailsResponse as a, type ToolParameter as a$, type HealthSummary as a0, type ImportStatistics as a1, type InterruptionSound as a2, type MemberNotificationPreferences as a3, type MemberNotifyActionParams as a4, type MemberUsageReport as a5, type MetricDataPoint as a6, type MetricSection as a7, type MetricSummary as a8, type MetricValue as a9, type ResourceScope as aA, type ResourceUsageResponse as aB, type RevisionState as aC, type RevisionStateRevision as aD, type RevisionStateWorkflow as aE, type RoutineWorkflowAccessMissingRole as aF, type RoutineWorkflowAccessWarning as aG, SCOPES as aH, SCOPE_PRESETS as aI, type SMSCommunicationDetailsResponse as aJ, type SMSMessageUsageResponse as aK, type SMSPhoneNumberUsageResponse as aL, ScopeCategory as aM, ScopeManager as aN, type ScopeName as aO, type SiteContext as aP, type SkippedWorkspace as aQ, type StatisticsSummary as aR, type SystemStatistics as aS, type TTSModel as aT, type TTSPreviewProvider as aU, TTS_PREVIEW_PROVIDERS as aV, type TaskContext as aW, type TaskCountResponse as aX, type ThinkingSound as aY, type TimeSeriesData as aZ, type TimeSeriesDataPoint as a_, type OpenAIChatModelConfig as aa, type OpenAIRealtimeModelConfig as ab, type OpenAIReasoningEffort as ac, type OpenAISemanticVADEagerness as ad, type OpenAISemanticVADTurnDetection as ae, type OpenAIServerVADTurnDetection as af, type OpenAITurnDetection as ag, type OpenAITurnDetectionType as ah, PIDS_DISPOSITIONS as ai, PIDS_SOURCES as aj, type PageContext as ak, type PerformanceMetrics as al, type PhoneCallPhoneNumberUsageResponse as am, type PhoneCallUsageResponse as an, type PhoneCommunicationDetailsResponse as ao, type PhoneNumberUsage as ap, type PidsDisposition as aq, type PidsSource as ar, type ProductOverageConfigResponse as as, type ProvisionPlanRequest as at, type ProvisionPlanResponse as au, type RealtimeModelConfig as av, type RequestsSection as aw, type RequestsStatusEntry as ax, type ResourceMetadata as ay, type ResourceOverageResponse as az, type AWSRealtimeModelConfig as b, type ToolkitContext as b0, ToolkitState as b1, type TopOffender as b2, type TopResourceOverageResponse as b3, type TtsReconnectOutcomeEntry as b4, type TtsReconnectSection as b5, type UsageProductSummaryResponse as b6, type UsageReportResponse as b7, type UsageReportRequest as b8, type UsageStatistics as b9, type VoiceMetricsResponse as ba, type VoiceMetricsTimeRange as bb, WIDGET_SLUGS as bc, type WebhookMetrics as bd, type WidgetSlug as be, type WorkflowContext as bf, type WorkspaceHealthDetail as bg, type WorkspaceHealthResponse as bh, type WorkspaceHealthRow as bi, type WorkspaceRoutineWorkflowAccessResponse as bj, type WorkspaceUsageReportResponse as bk, type XAIChatModelConfig as bl, type XAIRealtimeModelConfig as bm, type XAIReasoningEffort as bn, canPreviewVoice as bo, formatAppContextAsMarkdown as bp, getAllResourceSlugs as bq, getApplicableResourceSlugs as br, getApplicableResources as bs, getResourceMetadata as bt, getRevisionState as bu, getScopeFromProductType as bv, getTTSProvider as bw, getVoiceModelId as bx, type ScopeDefinition as by, type AcquisitionFunnelChannel as c, type AcquisitionFunnelRecentSignup as d, type AcquisitionFunnelResponse as e, type AdminDomainResponse as f, type AdminDomainSiteMapping as g, type AdminDomainWidgetMapping as h, type AdminPidsFindingResponse as i, type AnalyticsFilter as j, type AnalyticsQuery as k, type AppContext as l, type AttachedAddonInfo as m, type BaseRealtimeModelConfig as n, type BillingStatistics as o, type CallEndStatusEntry as p, type ChangeWorkspaceProductRequest as q, type ChangeWorkspaceProductResponse as r, type ChannelErrorBreakdown as s, type ChannelFailures as t, type ChatModelConfig as u, type ClaudeChatModelConfig as v, type CommunicationDetailsResponse as w, type CurrentPlanInfo as x, type CustomRealtimeModelConfig as y, DEFAULT_CUSTOM_VOICE_MODEL as z };