@opengeni/sdk 0.37.0 → 0.41.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.
package/src/types.ts CHANGED
@@ -461,10 +461,13 @@ export type RepositoryResourceRef = {
461
461
  githubRepositoryId?: number | undefined;
462
462
  };
463
463
 
464
+ /** Value mirror of `@opengeni/contracts`; parity-tested without adding an SDK runtime dependency. */
465
+ export const DEFAULT_FILE_RESOURCE_MOUNT_ROOT = ".opengeni/files" as const;
466
+
464
467
  export type FileResourceRef = {
465
468
  kind: "file";
466
469
  fileId: string;
467
- /** Optional workspace-relative override; defaults to `files/<file-id>`. */
470
+ /** Optional workspace-relative override; defaults to `.opengeni/files/<file-id>`. */
468
471
  mountPath?: string | undefined;
469
472
  };
470
473
 
@@ -641,6 +644,22 @@ export type OpenGeniSlackBotInstallStart = {
641
644
  export type GoogleDriveTargetScope = "user" | "workspace" | "organization";
642
645
  export type GoogleDriveSyncCadence = "manual" | "hourly" | "daily";
643
646
  export type GoogleDriveReadPolicy = "allow" | "ask" | "block";
647
+ export type GoogleDriveConnectionLifecycleState =
648
+ | "active"
649
+ | "paused"
650
+ | "token_revoked"
651
+ | "app_removed"
652
+ | "disconnected"
653
+ | "reconnect_required"
654
+ | "reconsent_required";
655
+
656
+ export type GoogleDriveConnectionLifecycle =
657
+ | {
658
+ state: Exclude<GoogleDriveConnectionLifecycleState, "app_removed">;
659
+ recoverable: true;
660
+ observedAt: string;
661
+ }
662
+ | { state: "app_removed"; recoverable: false; observedAt: string };
644
663
 
645
664
  export type GoogleDriveSelectedSource = {
646
665
  id: string;
@@ -661,6 +680,7 @@ export type GoogleDriveConnectionMetadata = {
661
680
  googleDisplayName: string | null;
662
681
  verifiedAt: string;
663
682
  accessMode: "metadata_readonly" | "readonly";
683
+ lifecycle?: GoogleDriveConnectionLifecycle | undefined;
664
684
  selectedSources?: GoogleDriveSelectedSource[] | undefined;
665
685
  /** @deprecated Read selectedSources; retained while existing connections migrate. */
666
686
  selectedSource?: GoogleDriveSelectedSource | null | undefined;
@@ -676,6 +696,16 @@ export type GoogleDriveOAuthStartResponse = {
676
696
  expiresAt: string;
677
697
  };
678
698
 
699
+ export type GoogleDriveLifecycleActionRequest = {
700
+ action: "pause" | "resume";
701
+ expectedVersion: number;
702
+ };
703
+
704
+ export type GoogleDriveDisconnectRequest = {
705
+ expectedVersion: number;
706
+ idempotencyKey: string;
707
+ };
708
+
679
709
  export type GoogleDriveBrowseItem = {
680
710
  id: string;
681
711
  name: string;
@@ -1000,8 +1030,6 @@ export type HumanInputQuestion = {
1000
1030
  allowOther: boolean;
1001
1031
  validation?:
1002
1032
  | {
1003
- minLength?: number | null | undefined;
1004
- maxLength?: number | null | undefined;
1005
1033
  minSelections?: number | null | undefined;
1006
1034
  maxSelections?: number | null | undefined;
1007
1035
  }
@@ -2104,6 +2132,7 @@ export type ModelCapabilitiesV1 = {
2104
2132
  codeExecution: ModelCapabilityStateV1;
2105
2133
  };
2106
2134
  inputModalities: Array<"text" | "image" | "audio">;
2135
+ inputFileMediaTypes?: string[] | undefined;
2107
2136
  outputModalities: Array<"text" | "image" | "audio">;
2108
2137
  transports: {
2109
2138
  sse: ModelCapabilityStateV1;
@@ -3365,6 +3394,8 @@ export type KnowledgeSourceKind =
3365
3394
  | "other";
3366
3395
  export type DocumentSearchMode = "hybrid" | "vector" | "keyword";
3367
3396
 
3397
+ export type DocumentAuthorityKind = "organization" | "workspace" | "personal";
3398
+
3368
3399
  export type DocumentVisibility = "workspace" | "private";
3369
3400
 
3370
3401
  export type DocumentCurationStatus = "none" | "pending" | "suggested" | "auto_filed" | "failed";
@@ -3406,6 +3437,9 @@ export type Document = {
3406
3437
  sourceUpdatedAt: string | null;
3407
3438
  sourceVersion: string | null;
3408
3439
  aclTags: string[];
3440
+ authorityKind: DocumentAuthorityKind;
3441
+ authorityWorkspaceId: string | null;
3442
+ authoritySubjectId: string | null;
3409
3443
  visibility: DocumentVisibility;
3410
3444
  createdBy: string | null;
3411
3445
  agentAccess: boolean;
@@ -3440,6 +3474,9 @@ export type DocumentSearchResult = {
3440
3474
  sourceUpdatedAt: string | null;
3441
3475
  sourceVersion: string | null;
3442
3476
  aclTags: string[];
3477
+ authorityKind: DocumentAuthorityKind;
3478
+ authorityWorkspaceId: string | null;
3479
+ authoritySubjectId: string | null;
3443
3480
  };
3444
3481
 
3445
3482
  export type CreateDocumentBaseRequest = {
@@ -3459,6 +3496,7 @@ export type AddDocumentRequest = {
3459
3496
  sourceUpdatedAt?: string | undefined;
3460
3497
  sourceVersion?: string | undefined;
3461
3498
  aclTags?: string[] | undefined;
3499
+ authorityKind?: DocumentAuthorityKind | undefined;
3462
3500
  visibility?: DocumentVisibility | undefined;
3463
3501
  agentAccess?: boolean | undefined;
3464
3502
  };
@@ -3468,6 +3506,7 @@ export type CreateKnowledgeDropRequest = {
3468
3506
  fileId?: string | undefined;
3469
3507
  filename?: string | undefined;
3470
3508
  title?: string | undefined;
3509
+ authorityKind?: DocumentAuthorityKind | undefined;
3471
3510
  visibility?: DocumentVisibility | undefined;
3472
3511
  agentAccess?: boolean | undefined;
3473
3512
  };
@@ -1,3 +1,5 @@
1
+ export const WORKSPACE_INSTRUCTION_POLICY_CONTENT_MAX_CHARS = 262_144;
2
+
1
3
  export type WorkspaceInstructionPolicyKind = "charter" | "policy";
2
4
  export type WorkspaceInstructionPolicyScope = "global" | "role";
3
5
  export type WorkspaceInstructionPolicyProvenanceSource =
@@ -29,6 +31,7 @@ export type WorkspaceInstructionPolicyRevisionIdentity = {
29
31
 
30
32
  export type WorkspaceInstructionPolicyRevision = WorkspaceInstructionPolicyRevisionIdentity &
31
33
  WorkspaceInstructionPolicyTarget & {
34
+ operationId: string;
32
35
  accountId: string;
33
36
  workspaceId: string;
34
37
  content: string;
@@ -52,6 +55,7 @@ export type WorkspaceInstructionPolicyHead = WorkspaceInstructionPolicyTarget &
52
55
 
53
56
  export type WorkspaceInstructionPolicyActivationEvent = WorkspaceInstructionPolicyTarget & {
54
57
  id: string;
58
+ operationId: string;
55
59
  accountId: string;
56
60
  workspaceId: string;
57
61
  type: WorkspaceInstructionPolicyActivationType;
@@ -64,6 +68,7 @@ export type WorkspaceInstructionPolicyActivationEvent = WorkspaceInstructionPoli
64
68
  };
65
69
 
66
70
  export type CreateWorkspaceInstructionPolicyDraftRequest = WorkspaceInstructionPolicyTarget & {
71
+ operationId?: string;
67
72
  content: string;
68
73
  provenanceSource?: WorkspaceInstructionPolicyDraftProvenanceSource;
69
74
  provenanceSourceId?: string | null;
@@ -71,6 +76,7 @@ export type CreateWorkspaceInstructionPolicyDraftRequest = WorkspaceInstructionP
71
76
  };
72
77
 
73
78
  export type ImportLegacyWorkspaceInstructionPolicyDraftRequest = {
79
+ operationId?: string;
74
80
  supersedesRevisionId?: string | null;
75
81
  };
76
82
 
@@ -102,13 +108,17 @@ export type WorkspaceInstructionPolicyDiffResponse = {
102
108
  };
103
109
 
104
110
  export type ActivateWorkspaceInstructionPolicyRequest = {
111
+ operationId?: string;
105
112
  expectedCurrentRevisionId: string | null;
113
+ expectedActivationVersion?: number;
106
114
  reason: string;
107
115
  };
108
116
 
109
117
  export type RollbackWorkspaceInstructionPolicyRequest = {
118
+ operationId?: string;
110
119
  targetRevisionId: string;
111
120
  expectedCurrentRevisionId: string;
121
+ expectedActivationVersion?: number;
112
122
  reason: string;
113
123
  };
114
124
 
@@ -122,3 +132,68 @@ export type WorkspaceInstructionPolicyConflictResponse = {
122
132
  message: string;
123
133
  currentHead: WorkspaceInstructionPolicyHead | null;
124
134
  };
135
+
136
+ export type WorkspaceInstructionPolicyOperationReuseResponse = {
137
+ code: "WORKSPACE_INSTRUCTION_POLICY_OPERATION_REUSED";
138
+ message: string;
139
+ };
140
+
141
+ export type WorkspaceInstructionPolicyOnboardingProposalSource = {
142
+ id: string;
143
+ version: string;
144
+ confidenceBps: number;
145
+ };
146
+
147
+ export type CreateWorkspaceInstructionPolicyOnboardingProposalRequest =
148
+ WorkspaceInstructionPolicyTarget & {
149
+ operationId?: string;
150
+ content: string;
151
+ sourceId: string;
152
+ sourceVersion: string;
153
+ confidenceBps: number;
154
+ expectedCurrentRevisionId: string | null;
155
+ expectedActivationVersion: number;
156
+ };
157
+
158
+ export type WorkspaceInstructionPolicyOnboardingProposal = WorkspaceInstructionPolicyTarget & {
159
+ id: string;
160
+ operationId: string;
161
+ accountId: string;
162
+ workspaceId: string;
163
+ source: WorkspaceInstructionPolicyOnboardingProposalSource;
164
+ baseline: WorkspaceInstructionPolicyHead | null;
165
+ draft: WorkspaceInstructionPolicyRevision;
166
+ status: "proposed";
167
+ createdBySubjectId: string;
168
+ createdAt: string;
169
+ };
170
+
171
+ export type WorkspaceInstructionPolicyOnboardingProposalListOptions = {
172
+ limit?: number;
173
+ };
174
+
175
+ export type WorkspaceInstructionPolicyOnboardingProposalListResponse = {
176
+ proposals: WorkspaceInstructionPolicyOnboardingProposal[];
177
+ truncated: boolean;
178
+ };
179
+
180
+ export type WorkspaceInstructionPolicyOnboardingProposalContentErrorResponse = {
181
+ code:
182
+ | "WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_EMPTY"
183
+ | "WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_OVERSIZED";
184
+ message: string;
185
+ maxChars: number;
186
+ };
187
+
188
+ export type WorkspaceInstructionPolicyOnboardingProposalStaleResponse = {
189
+ code: "WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_STALE";
190
+ message: string;
191
+ currentHead: WorkspaceInstructionPolicyHead | null;
192
+ };
193
+
194
+ export type WorkspaceInstructionPolicyOnboardingProposalConflictResponse = {
195
+ code: "WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_CONFLICT";
196
+ message: string;
197
+ existingProposalId: string;
198
+ existingDraftRevisionId: string;
199
+ };
@@ -49,15 +49,93 @@ export type WorkspaceStateGapCode =
49
49
  | "pending_memory_review"
50
50
  | "partial_inventory";
51
51
 
52
+ export type WorkspaceStateGovernanceDriftStatus =
53
+ | "identical"
54
+ | "changed"
55
+ | "superseded"
56
+ | "missing"
57
+ | "unavailable"
58
+ | "truncated";
59
+
60
+ export type WorkspaceStateGetOptions = { attemptId?: string };
61
+
62
+ export type WorkspaceStateAttemptGovernance =
63
+ | { status: "not_requested" }
64
+ | {
65
+ status: "unavailable";
66
+ reason: "attempt_not_found_or_not_authorized";
67
+ driftStatus: "unavailable";
68
+ }
69
+ | {
70
+ status: "available";
71
+ attemptId: string;
72
+ executionGeneration: number;
73
+ acceptedAt: string;
74
+ policySnapshot:
75
+ | { status: "missing" }
76
+ | {
77
+ status: "available";
78
+ id: string;
79
+ createdAt: string;
80
+ entryHash: string;
81
+ policyRole: string | null;
82
+ roleSource:
83
+ | "session_binding"
84
+ | "metadata_fallback"
85
+ | "none"
86
+ | "invalid_metadata_fallback";
87
+ entries: Array<{
88
+ kind: WorkspaceInstructionPolicyKind;
89
+ scope: WorkspaceInstructionPolicyScope;
90
+ roleKey: string | null;
91
+ revisionId: string;
92
+ revision: number;
93
+ contentHash: string;
94
+ activationVersion: number;
95
+ activatedAt: string;
96
+ provenance: {
97
+ source: WorkspaceInstructionPolicyProvenanceSource;
98
+ sourceIdHash: string | null;
99
+ };
100
+ }>;
101
+ };
102
+ preferenceSnapshot:
103
+ | { status: "missing" }
104
+ | {
105
+ status: "available";
106
+ id: string;
107
+ createdAt: string;
108
+ descriptorHash: string;
109
+ descriptorCount: number;
110
+ truncated: boolean;
111
+ };
112
+ drift: {
113
+ overall: WorkspaceStateGovernanceDriftStatus;
114
+ policy: {
115
+ status: WorkspaceStateGovernanceDriftStatus;
116
+ snapshotHash: string | null;
117
+ currentHash: string | null;
118
+ snapshotTargetCount: number;
119
+ currentTargetCount: number;
120
+ };
121
+ preferences: {
122
+ status: WorkspaceStateGovernanceDriftStatus;
123
+ snapshotHash: string | null;
124
+ currentHash: string | null;
125
+ snapshotDescriptorCount: number;
126
+ currentDescriptorCount: number;
127
+ snapshotTruncated: boolean;
128
+ currentTruncated: boolean;
129
+ };
130
+ };
131
+ };
132
+
52
133
  export type WorkspaceStateResponse = {
53
134
  workspaceId: string;
54
135
  generatedAt: string;
55
136
  truth: {
56
137
  current: { source: "read_time_projection"; capturedAt: string };
57
- policySnapshot: {
58
- status: "not_captured";
59
- reason: "workspace_instruction_policy_snapshot_not_implemented";
60
- };
138
+ attemptGovernance: WorkspaceStateAttemptGovernance;
61
139
  };
62
140
  policy: {
63
141
  authority: "workspace_instruction_policy_heads";