@opengeni/sdk 0.29.0 → 0.32.1

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/src/types.ts CHANGED
@@ -229,6 +229,7 @@ export type ViewerHeartbeatRequest = { leaseEpoch: number };
229
229
  export type ViewerHeartbeatResponse = { alive: boolean };
230
230
 
231
231
  export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
232
+ export type LatencyMode = "standard" | "priority" | "fast";
232
233
  export type GitCredentialProvider = "github" | "gitlab" | "azure_devops";
233
234
  export type GitCredentialBindingId = string;
234
235
  export type GitRepositoryAccess = "read" | "write";
@@ -418,6 +419,71 @@ export type OpenGeniSlackBotInstallStart = {
418
419
  expiresAt: string;
419
420
  };
420
421
 
422
+ export type GoogleDriveTargetScope = "user" | "workspace" | "organization";
423
+ export type GoogleDriveSyncCadence = "manual" | "hourly" | "daily";
424
+ export type GoogleDriveReadPolicy = "allow" | "ask" | "block";
425
+
426
+ export type GoogleDriveSelectedSource = {
427
+ id: string;
428
+ name: string;
429
+ mimeType: string;
430
+ driveId: string | null;
431
+ targetScope: GoogleDriveTargetScope;
432
+ syncCadence: GoogleDriveSyncCadence;
433
+ readPolicy: GoogleDriveReadPolicy;
434
+ selectedAt: string;
435
+ };
436
+
437
+ export type GoogleDriveConnectionMetadata = {
438
+ credentialRole: "google_drive_metadata";
439
+ credentialLabel: "Google Drive metadata browser";
440
+ googlePermissionId: string;
441
+ googleEmail: string;
442
+ googleDisplayName: string | null;
443
+ verifiedAt: string;
444
+ accessMode: "metadata_readonly" | "readonly";
445
+ selectedSources?: GoogleDriveSelectedSource[] | undefined;
446
+ /** @deprecated Read selectedSources; retained while existing connections migrate. */
447
+ selectedSource?: GoogleDriveSelectedSource | null | undefined;
448
+ [key: string]: unknown;
449
+ };
450
+
451
+ export type GoogleDriveOAuthStartRequest = {
452
+ connectionId?: string | undefined;
453
+ };
454
+
455
+ export type GoogleDriveOAuthStartResponse = {
456
+ authorizationUrl: string;
457
+ expiresAt: string;
458
+ };
459
+
460
+ export type GoogleDriveBrowseItem = {
461
+ id: string;
462
+ name: string;
463
+ mimeType: string;
464
+ kind: "folder" | "file";
465
+ driveId: string | null;
466
+ modifiedTime: string | null;
467
+ size: string | null;
468
+ webViewLink: string | null;
469
+ };
470
+
471
+ export type GoogleDriveBrowseResponse = {
472
+ connection: ConnectionMetadata;
473
+ parentId: string;
474
+ current: GoogleDriveBrowseItem | null;
475
+ items: GoogleDriveBrowseItem[];
476
+ nextPageToken: string | null;
477
+ incompleteSearch: boolean;
478
+ };
479
+
480
+ export type SaveGoogleDriveSourceRequest = {
481
+ sources: Array<Pick<GoogleDriveBrowseItem, "id" | "name" | "mimeType" | "driveId">>;
482
+ targetScope: GoogleDriveTargetScope;
483
+ syncCadence: GoogleDriveSyncCadence;
484
+ readPolicy: GoogleDriveReadPolicy;
485
+ };
486
+
421
487
  export type UpdateConnectionRequest = {
422
488
  providerDomain?: string | undefined;
423
489
  subjectId?: string | null | undefined;
@@ -539,6 +605,11 @@ export type Session = {
539
605
  codexPinnedCredentialId?: string | null;
540
606
  /** Multi-account Codex (P1): the account the most recent turn ran on (the "Running on:" indicator). */
541
607
  codexLastCredentialId?: string | null;
608
+ /**
609
+ * Frozen at create. `remote_v2` ⇒ Codex remote compaction + Codex-only model
610
+ * admission; `portable` ⇒ plaintext compaction and free provider switching.
611
+ */
612
+ codexCompactionMode: "remote_v2" | "portable";
542
613
  /** Personal (authenticated subject) workspace pin state, never workspace-global. */
543
614
  pinned?: boolean;
544
615
  /** Stable pin ordering key; null when this subject has not pinned the session. */
@@ -630,6 +701,7 @@ export type SessionTurn = {
630
701
  toolsProvided?: boolean | undefined;
631
702
  model: string;
632
703
  reasoningEffort: ReasoningEffort;
704
+ latencyMode: LatencyMode;
633
705
  sandboxBackend: SandboxBackend;
634
706
  sandboxOs: SandboxOs | null;
635
707
  metadata: Record<string, unknown>;
@@ -716,6 +788,7 @@ export const SESSION_EVENT_TYPES = [
716
788
  "session.requiresAction",
717
789
  "session.humanInput.requested",
718
790
  "session.context.compaction.requested",
791
+ "session.context.compaction.started",
719
792
  "session.context.compacted",
720
793
  "session.context.compaction.skipped",
721
794
  "session.context.cleared",
@@ -1574,6 +1647,7 @@ export type CreateSessionRequest = {
1574
1647
  metadata?: Record<string, unknown> | undefined;
1575
1648
  model?: string | undefined;
1576
1649
  reasoningEffort?: ReasoningEffort | undefined;
1650
+ latencyMode?: LatencyMode | undefined;
1577
1651
  sandboxBackend?: SandboxBackend | undefined;
1578
1652
  // The enrolled machine (a sandbox id) to run this session on; seeds the
1579
1653
  // active-sandbox pointer at creation so the first turn lands on it.
@@ -1673,6 +1747,8 @@ export type FirstPartyMcpToolName =
1673
1747
  | "memory_search"
1674
1748
  | "memory_save"
1675
1749
  | "memory_correct"
1750
+ | "preference_registry_summary"
1751
+ | "preference_registry_get"
1676
1752
  | "sandboxes_list"
1677
1753
  | "sandbox_attach"
1678
1754
  | "sandbox_swap"
@@ -1713,8 +1789,13 @@ export type FirstPartyMcpToolName =
1713
1789
  | "scheduled_task_runs_list"
1714
1790
  | "slack_bot_list_channels"
1715
1791
  | "slack_bot_channel_history"
1792
+ | "slack_bot_thread_replies"
1716
1793
  | "slack_bot_list_users"
1717
- | "slack_bot_post_message";
1794
+ | "slack_bot_list_files"
1795
+ | "slack_bot_file_info"
1796
+ | "slack_bot_file_content"
1797
+ | "slack_bot_post_message"
1798
+ | "slack_bot_delete_message";
1718
1799
 
1719
1800
  export type ProductAccessMode = "local" | "configured" | "managed";
1720
1801
 
@@ -2102,6 +2183,8 @@ export type ClientConfig = {
2102
2183
  allowedReasoningEfforts: ReasoningEffort[];
2103
2184
  mcpServers: { id: string; name: string }[];
2104
2185
  fileUploads: { enabled: boolean; maxSizeBytes: number };
2186
+ /** Native browser microphone capture + server-side transcription capability. */
2187
+ voiceInput?: ClientVoiceInputConfig | undefined;
2105
2188
  productAccessMode: ProductAccessMode;
2106
2189
  auth: ClientAuthConfig;
2107
2190
  // Server-wide hint: does this deployment support Channel-A structured services
@@ -2115,8 +2198,29 @@ export type ClientConfig = {
2115
2198
  };
2116
2199
  };
2117
2200
 
2201
+ /** Client-safe voice-input capability projection. */
2202
+ export type ClientVoiceInputConfig = {
2203
+ available: boolean;
2204
+ maxDurationSeconds: number;
2205
+ maxSizeBytes: number;
2206
+ acceptedMimeTypes: string[];
2207
+ };
2208
+
2209
+ /** Response from POST /v1/workspaces/:workspaceId/transcriptions. */
2210
+ export type TranscribeAudioResponse = {
2211
+ text: string;
2212
+ languages: string[];
2213
+ };
2214
+
2118
2215
  export type AccountRole = "owner" | "admin" | "member";
2119
2216
 
2217
+ export type AccessPrincipalKind =
2218
+ | "human_session"
2219
+ | "agent_attempt"
2220
+ | "service"
2221
+ | "api_key"
2222
+ | "configured_key";
2223
+
2120
2224
  export type AccountGrant = {
2121
2225
  accountId: string;
2122
2226
  subjectId: string;
@@ -2132,6 +2236,7 @@ export type AccessGrant = {
2132
2236
  subjectId: string;
2133
2237
  subjectLabel?: string | undefined;
2134
2238
  permissions: Permission[];
2239
+ principalKind?: AccessPrincipalKind | undefined;
2135
2240
  metadata?: Record<string, unknown> | undefined;
2136
2241
  serviceInitiator?: ServiceTurnInitiator | undefined;
2137
2242
  serviceInitiatorContext?: ServiceTurnInitiatorContext | undefined;
@@ -2170,15 +2275,24 @@ export type Workspace = {
2170
2275
 
2171
2276
  export type WorkspaceSettings = {
2172
2277
  memoryEnabled?: boolean | undefined;
2278
+ voiceInput?: WorkspaceVoiceInputSettings | undefined;
2173
2279
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2174
2280
  maxNestedAgentDepth?: number | null | undefined;
2281
+ /** Default for new Codex sessions; absent ⇒ remote_v2. */
2282
+ codexCompactionDefault?: "remote_v2" | "portable" | undefined;
2175
2283
  [key: string]: unknown;
2176
2284
  };
2177
2285
 
2286
+ export type WorkspaceVoiceInputSettings = {
2287
+ enabled: boolean;
2288
+ };
2289
+
2178
2290
  export type UpdateWorkspaceSettingsRequest = {
2179
2291
  memoryEnabled?: boolean | undefined;
2292
+ voiceInput?: WorkspaceVoiceInputSettings | undefined;
2180
2293
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2181
2294
  maxNestedAgentDepth?: number | null | undefined;
2295
+ codexCompactionDefault?: "remote_v2" | "portable" | undefined;
2182
2296
  [key: string]: unknown;
2183
2297
  };
2184
2298
 
@@ -2391,6 +2505,7 @@ export type ComposerDraft = {
2391
2505
  resources: ResourceRef[];
2392
2506
  model: string;
2393
2507
  reasoningEffort: ReasoningEffort;
2508
+ latencyMode?: LatencyMode | undefined;
2394
2509
  sourceTurnId: string | null;
2395
2510
  sourceTurnVersion: number | null;
2396
2511
  updatedAt: string | null;
@@ -2416,6 +2531,7 @@ export type NewSessionDraft = {
2416
2531
  toolsProvided: boolean;
2417
2532
  model: string;
2418
2533
  reasoningEffort: ReasoningEffort;
2534
+ latencyMode?: LatencyMode | undefined;
2419
2535
  options: NewSessionDraftOptions;
2420
2536
  updatedAt: string | null;
2421
2537
  };
@@ -3594,6 +3710,142 @@ export type BillingUsageResponse = {
3594
3710
  usage: UsageEvent[];
3595
3711
  };
3596
3712
 
3713
+ export type InsightsRange = "today" | "week" | "month" | "ytd";
3714
+
3715
+ export type InsightsBillingPath = "opengeni_credits" | "external";
3716
+
3717
+ export type InsightsModelUsageRow = {
3718
+ id: string;
3719
+ model: string;
3720
+ provider: string;
3721
+ billing: InsightsBillingPath;
3722
+ calls: number;
3723
+ inputTokens: number;
3724
+ outputTokens: number;
3725
+ cachedTokens: number;
3726
+ cacheWriteTokens: number;
3727
+ reasoningTokens: number;
3728
+ creditUsd: number;
3729
+ };
3730
+
3731
+ export type InsightsSeriesPoint = {
3732
+ label: string;
3733
+ modelCostUsd: number;
3734
+ warmSeconds: number;
3735
+ inputTokens: number;
3736
+ cachedTokens: number;
3737
+ cacheHitPct: number;
3738
+ calls: number;
3739
+ };
3740
+
3741
+ export type InsightsDepthBucket = {
3742
+ depth: number;
3743
+ sessions: number;
3744
+ };
3745
+
3746
+ export type InsightsModelFacet = {
3747
+ provider: string;
3748
+ model: string;
3749
+ };
3750
+
3751
+ export type InsightsSpendDriver = {
3752
+ id: string;
3753
+ groupBy: "root_session" | "schedule";
3754
+ label: string;
3755
+ creditUsd: number;
3756
+ tokens: number;
3757
+ cacheHitPct: number;
3758
+ pctOfCreditUsd: number;
3759
+ deltaUsdVsPrior: number;
3760
+ };
3761
+
3762
+ export type InsightsWarmGroupRow = {
3763
+ id: string;
3764
+ groupId: string;
3765
+ label: string;
3766
+ backend: string | null;
3767
+ warmSeconds: number;
3768
+ sessionsAttached: number;
3769
+ };
3770
+
3771
+ export type InsightsLiveWarmLease = {
3772
+ id: string;
3773
+ groupId: string;
3774
+ backend: string;
3775
+ turnHolders: number;
3776
+ viewerHolders: number;
3777
+ warmForLabel: string;
3778
+ warmSeconds: number;
3779
+ };
3780
+
3781
+ export type InsightsFloorSession = {
3782
+ id: string;
3783
+ title: string;
3784
+ state: "running" | "paused" | "failed" | "idle" | "compacting" | "waiting";
3785
+ depth: number;
3786
+ model: string | null;
3787
+ provider: string | null;
3788
+ ageLabel: string;
3789
+ cacheHitPct: number | null;
3790
+ route: string | null;
3791
+ };
3792
+
3793
+ export type InsightsScheduleRow = {
3794
+ id: string;
3795
+ name: string;
3796
+ fires: number;
3797
+ creditUsd: number | null;
3798
+ tokens: number | null;
3799
+ cacheHitPct: number | null;
3800
+ billing: InsightsBillingPath | null;
3801
+ };
3802
+
3803
+ export type WorkspaceInsightsSnapshot = {
3804
+ range: InsightsRange;
3805
+ rangeLabel: string;
3806
+ priorLabel: string;
3807
+ seriesLabel: string;
3808
+ cacheSeriesLabel: string;
3809
+ timezone: "UTC";
3810
+ models: InsightsModelUsageRow[];
3811
+ facets: InsightsModelFacet[];
3812
+ series: InsightsSeriesPoint[];
3813
+ depth: InsightsDepthBucket[];
3814
+ drivers: InsightsSpendDriver[];
3815
+ schedules: InsightsScheduleRow[];
3816
+ warmSeconds: number;
3817
+ priorWarmSeconds: number;
3818
+ warmGroups: InsightsWarmGroupRow[];
3819
+ liveWarm: InsightsLiveWarmLease[];
3820
+ floor: InsightsFloorSession[];
3821
+ selfhostedEnabled: boolean;
3822
+ machinesOnline: number;
3823
+ workspaceCreditUsd: number;
3824
+ priorWorkspaceCreditUsd: number;
3825
+ creditUsd: number;
3826
+ priorCreditUsd: number;
3827
+ priorInputTokens: number;
3828
+ priorCacheHitPct: number;
3829
+ priorCalls: number;
3830
+ goalsActive: number;
3831
+ goalsCompleted: number;
3832
+ sessionsTouched: number;
3833
+ rootSessions: number;
3834
+ deepestDepth: number;
3835
+ deepestSessionTitle: string;
3836
+ avgDepth: number;
3837
+ warmIdleNow: number;
3838
+ billableTokensUsed: number;
3839
+ billableTokenCap: number | null;
3840
+ agentRunsUsed: number;
3841
+ agentRunCap: number | null;
3842
+ modelFilterActive: boolean;
3843
+ };
3844
+
3845
+ export type WorkspaceInsightsResponse = {
3846
+ snapshot: WorkspaceInsightsSnapshot;
3847
+ };
3848
+
3597
3849
  export type BillingEntitlementsResponse = {
3598
3850
  accountId: string;
3599
3851
  mode: EntitlementsMode;
@@ -3622,6 +3874,7 @@ export type UserMessageEventInput = {
3622
3874
  resources?: ResourceRef[] | undefined;
3623
3875
  model?: string | undefined;
3624
3876
  reasoningEffort?: ReasoningEffort | undefined;
3877
+ latencyMode?: LatencyMode | undefined;
3625
3878
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
3626
3879
  };
3627
3880
  };
@@ -0,0 +1,134 @@
1
+ import type {
2
+ WorkspaceInstructionPolicyKind,
3
+ WorkspaceInstructionPolicyProvenanceSource,
4
+ WorkspaceInstructionPolicyScope,
5
+ } from "./workspace-instruction-policies";
6
+
7
+ export type WorkspaceStateDocumentStatusCounts = {
8
+ queued: number;
9
+ indexing: number;
10
+ ready: number;
11
+ failed: number;
12
+ };
13
+
14
+ export type WorkspaceStateSourceKindCounts = {
15
+ manual_upload: number;
16
+ meeting_transcript: number;
17
+ repository: number;
18
+ email: number;
19
+ chat: number;
20
+ document: number;
21
+ web: number;
22
+ other: number;
23
+ };
24
+
25
+ export type WorkspaceStateMemoryStatusCounts = {
26
+ proposed: number;
27
+ approved: number;
28
+ rejected: number;
29
+ active: number;
30
+ superseded: number;
31
+ archived: number;
32
+ };
33
+
34
+ export type WorkspaceStateMemoryKindCounts = {
35
+ semantic: number;
36
+ episodic: number;
37
+ procedural: number;
38
+ decision: number;
39
+ preference: number;
40
+ };
41
+
42
+ export type WorkspaceStateGapCode =
43
+ | "no_document_bases"
44
+ | "no_visible_documents"
45
+ | "failed_documents"
46
+ | "processing_documents"
47
+ | "missing_topic_coverage"
48
+ | "no_memory_records"
49
+ | "pending_memory_review"
50
+ | "partial_inventory";
51
+
52
+ export type WorkspaceStateResponse = {
53
+ workspaceId: string;
54
+ generatedAt: string;
55
+ truth: {
56
+ current: { source: "read_time_projection"; capturedAt: string };
57
+ policySnapshot: {
58
+ status: "not_captured";
59
+ reason: "workspace_instruction_policy_snapshot_not_implemented";
60
+ };
61
+ };
62
+ policy: {
63
+ authority: "workspace_instruction_policy_heads";
64
+ activeHeads: Array<{
65
+ kind: WorkspaceInstructionPolicyKind;
66
+ scope: WorkspaceInstructionPolicyScope;
67
+ roleKey: string | null;
68
+ revisionId: string;
69
+ revision: number;
70
+ contentHash: string;
71
+ activationVersion: number;
72
+ activatedAt: string;
73
+ }>;
74
+ activeHeadsTruncated: boolean;
75
+ latestRevision: {
76
+ kind: WorkspaceInstructionPolicyKind;
77
+ scope: WorkspaceInstructionPolicyScope;
78
+ roleKey: string | null;
79
+ revisionId: string;
80
+ revision: number;
81
+ contentHash: string;
82
+ provenanceSource: WorkspaceInstructionPolicyProvenanceSource;
83
+ state: "active" | "inactive";
84
+ createdAt: string;
85
+ } | null;
86
+ legacyRuntime: {
87
+ source: "workspace_override" | "deployment_default";
88
+ workspaceOverrideConfigured: boolean;
89
+ };
90
+ runtimeComposition: { status: "not_implemented" };
91
+ };
92
+ knowledge:
93
+ | {
94
+ availability: "unavailable";
95
+ reason: "missing_permission";
96
+ requiredPermission: "documents:search";
97
+ }
98
+ | {
99
+ availability: "available";
100
+ coverage: "complete" | "partial";
101
+ baseCount: number;
102
+ bases: Array<{
103
+ id: string;
104
+ name: string;
105
+ visibleDocumentCount: number;
106
+ statusCounts: WorkspaceStateDocumentStatusCounts;
107
+ latestUpdatedAt: string | null;
108
+ }>;
109
+ basesTruncated: boolean;
110
+ inspectedVisibleDocumentCount: number;
111
+ documentStatusCounts: WorkspaceStateDocumentStatusCounts;
112
+ sourceKindCounts: WorkspaceStateSourceKindCounts;
113
+ topics: Array<{ name: string; documentCount: number }>;
114
+ topicsTruncated: boolean;
115
+ latestDocumentUpdatedAt: string | null;
116
+ memorySample: {
117
+ recordCount: number;
118
+ sampleLimit: 100;
119
+ limitReached: boolean;
120
+ statusCounts: WorkspaceStateMemoryStatusCounts;
121
+ kindCounts: WorkspaceStateMemoryKindCounts;
122
+ preferenceAuthority: {
123
+ kindCountSource: "knowledge_memories_legacy_observations";
124
+ activeAuthority: "structured_preference_registry";
125
+ };
126
+ latestUpdatedAt: string | null;
127
+ };
128
+ gaps: Array<{
129
+ code: WorkspaceStateGapCode;
130
+ severity: "info" | "warning";
131
+ relatedCount: number | null;
132
+ }>;
133
+ };
134
+ };