@opengeni/db 0.31.1 → 0.36.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/dist/browser-auth.d.ts +209 -1
- package/dist/browser-downloads.d.ts +51 -0
- package/dist/browser-identities.d.ts +11 -2
- package/dist/browser-sessions.d.ts +83 -1
- package/dist/browser-state-artifacts.d.ts +75 -1
- package/dist/canonical-human-identities.d.ts +48 -0
- package/dist/canonical-human-identities.js +28 -0
- package/dist/canonical-human-identities.js.map +1 -0
- package/dist/capability-integrations.d.ts +8 -6
- package/dist/{chunk-MWDVXQOL.js → chunk-5KTIEDX7.js} +5773 -4212
- package/dist/chunk-5KTIEDX7.js.map +1 -0
- package/dist/{chunk-NBE6CHRI.js → chunk-CQZ4QSP5.js} +49 -9
- package/dist/chunk-CQZ4QSP5.js.map +1 -0
- package/dist/chunk-F32YT7MP.js +117 -0
- package/dist/chunk-F32YT7MP.js.map +1 -0
- package/dist/{chunk-ISI2TIUG.js → chunk-JC5QPLUM.js} +30 -3
- package/dist/chunk-JC5QPLUM.js.map +1 -0
- package/dist/{chunk-F5FT7BEZ.js → chunk-P3RE4D2B.js} +2 -2
- package/dist/chunk-TAUTWOS5.js +259 -0
- package/dist/chunk-TAUTWOS5.js.map +1 -0
- package/dist/{chunk-YHZXQ7HP.js → chunk-VKLB2ZGI.js} +446 -19
- package/dist/chunk-VKLB2ZGI.js.map +1 -0
- package/dist/database.d.ts +5 -0
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +438 -29
- package/dist/index.js +35640 -28969
- package/dist/index.js.map +1 -1
- package/dist/insights.d.ts +23 -7
- package/dist/integration-bindings.d.ts +24 -24
- package/dist/integration-facets.d.ts +99 -0
- package/dist/interaction-revisions.d.ts +11 -0
- package/dist/interaction-schema.d.ts +698 -34
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +8 -7
- package/dist/schema.d.ts +9464 -5412
- package/dist/schema.js +51 -9
- package/dist/session-control.d.ts +29 -3
- package/dist/session-tenancy.d.ts +44 -0
- package/dist/session-tenancy.js +16 -0
- package/dist/session-tenancy.js.map +1 -0
- package/dist/slack-task-policy-schema.d.ts +847 -0
- package/dist/slack-task-policy.d.ts +65 -0
- package/dist/task-notes-schema.d.ts +924 -0
- package/dist/task-notes.d.ts +85 -0
- package/dist/video-generation.d.ts +9 -0
- package/dist/video-generation.js +5 -3
- package/dist/xai-subscription.d.ts +326 -0
- package/drizzle/0212_browser_state_transfer_hardening.sql +560 -0
- package/drizzle/0213_browser_interaction_authority.sql +67 -0
- package/drizzle/0214_browser_download_saves.sql +34 -0
- package/drizzle/0215_browser_controller_host.sql +385 -0
- package/drizzle/0216_browser_auth_health_evidence.sql +137 -0
- package/drizzle/0217_external_browser_auth_operations.sql +22 -0
- package/drizzle/0218_organization_tenancy_foundation.sql +299 -0
- package/drizzle/0219_organization_tenancy_managed_human_provisioning.sql +317 -0
- package/drizzle/0219_site_auth_maintenance_sessions.sql +234 -0
- package/drizzle/0220_memory_slack_append_only_cascade.sql +38 -0
- package/drizzle/0220_session_channels.sql +54 -0
- package/drizzle/0221_sessions_channel_index.sql +5 -0
- package/drizzle/0222_session_visibility_authority_epochs.sql +158 -0
- package/drizzle/0222_sessions_channel_fk.sql +89 -0
- package/drizzle/0223_pending_tool_event_output.sql +55 -0
- package/drizzle/0223_sessions_channel_fk_validate.sql +118 -0
- package/drizzle/0224_slack_post_outcome_reconciliation.sql +123 -0
- package/drizzle/0225_session_visibility_fork_activation.sql +1363 -0
- package/drizzle/0226_personal_codex_authority_foundation.sql +365 -0
- package/drizzle/0227_slack_native_actions.sql +145 -0
- package/drizzle/0228_interaction_controller_data_plane.sql +14 -0
- package/drizzle/0228_slack_task_policy.sql +400 -0
- package/drizzle/0229_slack_inbox_file_fact.sql +10 -0
- package/drizzle/0230_user_scoped_variable_sets_rigs.sql +84 -0
- package/drizzle/0231_integration_definition_identity_cutover.sql +271 -0
- package/drizzle/0232_integration_facet_authority_cutover.sql +610 -0
- package/drizzle/0233_skill_and_integration_authority_cutover.sql +1162 -0
- package/drizzle/0234_xai_subscription_authority.sql +1139 -0
- package/drizzle/0235_canonical_human_login_bindings.sql +920 -0
- package/drizzle/0236_browser_identity_lifecycle.sql +39 -0
- package/drizzle/0236_session_visibility_slack_policy.sql +72 -0
- package/drizzle/0237_interaction_transition_reaper.sql +263 -0
- package/drizzle/0238_goal_persistence_policy.sql +471 -0
- package/drizzle/0238_supergrok_realtime_model.sql +29 -0
- package/drizzle/0239_supergrok_video_funding.sql +50 -0
- package/drizzle/0239_task_tree_notes.sql +990 -0
- package/package.json +13 -5
- package/src/browser-auth.ts +2600 -123
- package/src/browser-downloads.ts +517 -0
- package/src/browser-identities.ts +220 -3
- package/src/browser-sessions.ts +334 -45
- package/src/browser-state-artifacts.ts +402 -12
- package/src/canonical-human-identities.ts +317 -0
- package/src/capability-integrations.ts +121 -213
- package/src/database.ts +41 -1
- package/src/index.ts +4157 -394
- package/src/insights.ts +109 -28
- package/src/integration-bindings.ts +101 -101
- package/src/{integration-features.ts → integration-facets.ts} +187 -184
- package/src/interaction-revisions.ts +33 -3
- package/src/interaction-schema.ts +311 -8
- package/src/pack-components.ts +43 -43
- package/src/pack-installations.ts +0 -43
- package/src/plugin-packages.ts +9 -9
- package/src/provision-roles.ts +232 -0
- package/src/runtime-posture.ts +227 -14
- package/src/schema.ts +1188 -75
- package/src/session-control.ts +122 -37
- package/src/session-queue-commands.ts +78 -1
- package/src/session-tenancy.ts +188 -0
- package/src/session-tool-call-settlement.ts +9 -3
- package/src/slack-task-policy-schema.ts +130 -0
- package/src/slack-task-policy.ts +341 -0
- package/src/task-notes-schema.ts +135 -0
- package/src/task-notes.ts +178 -0
- package/src/video-generation.ts +90 -12
- package/src/workspace-artifacts.ts +1 -1
- package/src/xai-subscription.ts +1887 -0
- package/dist/chunk-ISI2TIUG.js.map +0 -1
- package/dist/chunk-MWDVXQOL.js.map +0 -1
- package/dist/chunk-NBE6CHRI.js.map +0 -1
- package/dist/chunk-YHZXQ7HP.js.map +0 -1
- package/dist/integration-features.d.ts +0 -99
- /package/dist/{chunk-F5FT7BEZ.js.map → chunk-P3RE4D2B.js.map} +0 -0
package/dist/browser-auth.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { type AuthRun as AuthRunValue, type AuthRunListResponse as AuthRunListResponseValue, type AuthRunMutationResponse as AuthRunMutationResponseValue, type CreateInteractionInterventionRequest as CreateInteractionInterventionRequestValue, type CreateNetworkRouteRequest as CreateNetworkRouteRequestValue, type CreateSiteAuthConnectionRequest as CreateSiteAuthConnectionRequestValue, type InteractionIntervention as InteractionInterventionValue, type InteractionInterventionListResponse as InteractionInterventionListResponseValue, type InteractionInterventionMutationResponse as InteractionInterventionMutationResponseValue, type NetworkRoute as NetworkRouteValue, type NetworkRouteListResponse as NetworkRouteListResponseValue, type NetworkRouteMutationResponse as NetworkRouteMutationResponseValue, type ReportAuthRunRequest as ReportAuthRunRequestValue, type ResolveInteractionInterventionRequest as ResolveInteractionInterventionRequestValue, type SiteAuthConnection as SiteAuthConnectionValue, type SiteAuthConnectionListResponse as SiteAuthConnectionListResponseValue, type SiteAuthConnectionMutationResponse as SiteAuthConnectionMutationResponseValue, type StartAuthRunRequest as StartAuthRunRequestValue, type UpdateNetworkRouteRequest as UpdateNetworkRouteRequestValue, type UpdateSiteAuthConnectionRequest as UpdateSiteAuthConnectionRequestValue } from "@opengeni/contracts";
|
|
1
|
+
import { type AuthRun as AuthRunValue, type AuthRunListResponse as AuthRunListResponseValue, type AuthRunMutationResponse as AuthRunMutationResponseValue, type CreateInteractionInterventionRequest as CreateInteractionInterventionRequestValue, type CreateNetworkRouteRequest as CreateNetworkRouteRequestValue, type CreateSiteAuthConnectionRequest as CreateSiteAuthConnectionRequestValue, type BrowserExternalAuthResult as BrowserExternalAuthResultValue, type ExternalAuthInteractiveRequest as ExternalAuthInteractiveRequestValue, type ExternalAuthRunRequest as ExternalAuthRunRequestValue, type ExternalAuthRunResponse as ExternalAuthRunResponseValue, type InteractionIntervention as InteractionInterventionValue, type InteractionInterventionListResponse as InteractionInterventionListResponseValue, type InteractionInterventionMutationResponse as InteractionInterventionMutationResponseValue, type NetworkRoute as NetworkRouteValue, type NetworkRouteListResponse as NetworkRouteListResponseValue, type NetworkRouteMutationResponse as NetworkRouteMutationResponseValue, type ProtectedAuthFillRequest as ProtectedAuthFillRequestValue, type ProtectedAuthFillResponse as ProtectedAuthFillResponseValue, type ReportAuthRunRequest as ReportAuthRunRequestValue, type ResolveInteractionInterventionRequest as ResolveInteractionInterventionRequestValue, type RequestHumanInteractionToolInput as RequestHumanInteractionToolInputValue, type SessionEvent, type SiteAuthAuthority as SiteAuthAuthorityValue, type SiteAuthConnection as SiteAuthConnectionValue, type SiteAuthConnectionListResponse as SiteAuthConnectionListResponseValue, type SiteAuthConnectionMutationResponse as SiteAuthConnectionMutationResponseValue, type StartAuthRunRequest as StartAuthRunRequestValue, type UpdateNetworkRouteRequest as UpdateNetworkRouteRequestValue, type UpdateSiteAuthConnectionRequest as UpdateSiteAuthConnectionRequestValue, type VerifyAuthRunRequest as VerifyAuthRunRequestValue } from "@opengeni/contracts";
|
|
2
2
|
import { type Database } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
4
|
+
type ResourceOperationRow = typeof schema.interactionResourceOperations.$inferSelect;
|
|
3
5
|
type InteractionMutationScope = {
|
|
4
6
|
accountId: string;
|
|
5
7
|
workspaceId: string;
|
|
@@ -14,6 +16,53 @@ export declare class InteractionResourceConflictError extends Error {
|
|
|
14
16
|
export declare class InteractionResourceStateError extends Error {
|
|
15
17
|
readonly name = "InteractionResourceStateError";
|
|
16
18
|
}
|
|
19
|
+
export type SiteAuthMaintenanceClaim = {
|
|
20
|
+
operationId: string;
|
|
21
|
+
sessionId: string;
|
|
22
|
+
accountId: string;
|
|
23
|
+
workspaceId: string;
|
|
24
|
+
siteAuthConnectionId: string;
|
|
25
|
+
connectionVersion: number;
|
|
26
|
+
action: "health_check" | "repair";
|
|
27
|
+
dueAt: Date;
|
|
28
|
+
claimedAt: Date;
|
|
29
|
+
name: string;
|
|
30
|
+
accountLabel: string;
|
|
31
|
+
loginUrl: string | null;
|
|
32
|
+
verificationUrlPrefixes: string[];
|
|
33
|
+
preferredIdentityId: string | null;
|
|
34
|
+
preferredPlacement: SiteAuthConnectionValue["preferredPlacement"];
|
|
35
|
+
preferredNetworkRouteId: string | null;
|
|
36
|
+
healthPolicy: SiteAuthConnectionValue["healthPolicy"];
|
|
37
|
+
verificationState: SiteAuthConnectionValue["verificationState"];
|
|
38
|
+
};
|
|
39
|
+
/** Claim a bounded cross-workspace batch. Stale pre-start claims keep the same
|
|
40
|
+
* operation/session ids, so worker loss repairs one durable dispatch. */
|
|
41
|
+
export declare function claimSiteAuthMaintenance(db: Database, input: {
|
|
42
|
+
claimTimeoutMs: number;
|
|
43
|
+
limit: number;
|
|
44
|
+
}): Promise<SiteAuthMaintenanceClaim[]>;
|
|
45
|
+
/** Link the exact hidden maintenance claim to its service-created session in
|
|
46
|
+
* the caller's create transaction. A false result must abort that transaction. */
|
|
47
|
+
export declare function confirmSiteAuthMaintenanceSessionInTransaction(tx: Database, input: {
|
|
48
|
+
accountId: string;
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
siteAuthConnectionId: string;
|
|
51
|
+
operationId: string;
|
|
52
|
+
sessionId: string;
|
|
53
|
+
}): Promise<boolean>;
|
|
54
|
+
/** Standalone wrapper retained for exact DB callers and tests. Session creation
|
|
55
|
+
* uses the in-transaction form so a changed claim cannot leave an empty shell. */
|
|
56
|
+
export declare function confirmSiteAuthMaintenanceSession(db: Database, input: Parameters<typeof confirmSiteAuthMaintenanceSessionInTransaction>[1]): Promise<boolean>;
|
|
57
|
+
/** Release an exact claim that failed before a maintenance session started. */
|
|
58
|
+
export declare function deferSiteAuthMaintenance(db: Database, input: {
|
|
59
|
+
accountId: string;
|
|
60
|
+
workspaceId: string;
|
|
61
|
+
siteAuthConnectionId: string;
|
|
62
|
+
operationId: string;
|
|
63
|
+
sessionId: string;
|
|
64
|
+
retryAt: Date;
|
|
65
|
+
}): Promise<boolean>;
|
|
17
66
|
export declare function listNetworkRoutes(db: Database, input: {
|
|
18
67
|
accountId: string;
|
|
19
68
|
workspaceId: string;
|
|
@@ -42,6 +91,32 @@ export declare function createSiteAuthConnection(db: Database, input: Interactio
|
|
|
42
91
|
export declare function updateSiteAuthConnection(db: Database, input: InteractionMutationScope & {
|
|
43
92
|
siteAuthConnectionId: string;
|
|
44
93
|
} & UpdateSiteAuthConnectionRequestValue): Promise<SiteAuthConnectionMutationResponseValue>;
|
|
94
|
+
type ExternalAuthOperationMetadata = {
|
|
95
|
+
schemaVersion: 1;
|
|
96
|
+
authRunVersion: number;
|
|
97
|
+
authority: Extract<SiteAuthAuthorityValue, {
|
|
98
|
+
kind: "external_provider";
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
export type ExternalAuthPreparation = {
|
|
102
|
+
run: AuthRunValue;
|
|
103
|
+
authority: ExternalAuthOperationMetadata["authority"];
|
|
104
|
+
operationState: ResourceOperationRow["state"];
|
|
105
|
+
response: ExternalAuthRunResponseValue | null;
|
|
106
|
+
replayed: boolean;
|
|
107
|
+
};
|
|
108
|
+
export type ProtectedAuthFillPreparation = {
|
|
109
|
+
run: AuthRunValue;
|
|
110
|
+
authority: SiteAuthAuthorityValue;
|
|
111
|
+
origins: string[];
|
|
112
|
+
credentialVersion: number | null;
|
|
113
|
+
operationState: ResourceOperationRow["state"];
|
|
114
|
+
response: ProtectedAuthFillResponseValue | null;
|
|
115
|
+
replayed: boolean;
|
|
116
|
+
};
|
|
117
|
+
export declare function getProtectedAuthFillPreparation(db: Database, input: InteractionMutationScope & {
|
|
118
|
+
authRunId: string;
|
|
119
|
+
} & ProtectedAuthFillRequestValue): Promise<ProtectedAuthFillPreparation | null>;
|
|
45
120
|
export declare function listAuthRuns(db: Database, input: {
|
|
46
121
|
accountId: string;
|
|
47
122
|
workspaceId: string;
|
|
@@ -54,13 +129,103 @@ export declare function getAuthRun(db: Database, input: {
|
|
|
54
129
|
workspaceId: string;
|
|
55
130
|
authRunId: string;
|
|
56
131
|
}): Promise<AuthRunValue>;
|
|
132
|
+
export type ExternalAuthInteractiveContext = {
|
|
133
|
+
run: AuthRunValue;
|
|
134
|
+
authority: Extract<SiteAuthAuthorityValue, {
|
|
135
|
+
kind: "external_provider";
|
|
136
|
+
}>;
|
|
137
|
+
};
|
|
138
|
+
/** Resolve only the durable authority needed to reveal an external provider's
|
|
139
|
+
* hosted login UI. The hosted URL itself is deliberately never persisted. */
|
|
140
|
+
export declare function getExternalAuthInteractiveContext(db: Database, input: InteractionMutationScope & {
|
|
141
|
+
authRunId: string;
|
|
142
|
+
} & ExternalAuthInteractiveRequestValue): Promise<ExternalAuthInteractiveContext>;
|
|
57
143
|
export declare function startAuthRun(db: Database, input: InteractionMutationScope & {
|
|
58
144
|
browserSessionId: string;
|
|
145
|
+
controllerGeneration: string;
|
|
146
|
+
/** Trusted attempt provenance supplied by the API grant. */
|
|
147
|
+
originatingSessionId?: string | null;
|
|
59
148
|
} & StartAuthRunRequestValue): Promise<AuthRunMutationResponseValue>;
|
|
149
|
+
export type SettleSessionMaintenanceResult = {
|
|
150
|
+
cancelledAuthRuns: number;
|
|
151
|
+
releasedClaim: boolean;
|
|
152
|
+
};
|
|
153
|
+
/** A terminal-for-now maintenance session cannot leave an AuthRun or its claim
|
|
154
|
+
* pinned. Interventions settle linked runs first; this covers every other path. */
|
|
155
|
+
export declare function settleSessionMaintenanceInTransaction(db: Database, input: {
|
|
156
|
+
accountId: string;
|
|
157
|
+
workspaceId: string;
|
|
158
|
+
sessionId: string;
|
|
159
|
+
}): Promise<SettleSessionMaintenanceResult>;
|
|
60
160
|
export declare function reportAuthRun(db: Database, input: InteractionMutationScope & {
|
|
61
161
|
authRunId: string;
|
|
62
162
|
controllerGeneration: string;
|
|
63
163
|
} & ReportAuthRunRequestValue): Promise<AuthRunMutationResponseValue>;
|
|
164
|
+
export declare function getExternalAuthPreparation(db: Database, input: InteractionMutationScope & {
|
|
165
|
+
authRunId: string;
|
|
166
|
+
} & ExternalAuthRunRequestValue): Promise<ExternalAuthPreparation | null>;
|
|
167
|
+
export declare function prepareExternalAuth(db: Database, input: InteractionMutationScope & {
|
|
168
|
+
authRunId: string;
|
|
169
|
+
} & ExternalAuthRunRequestValue): Promise<ExternalAuthPreparation>;
|
|
170
|
+
export declare function dispatchExternalAuth(db: Database, input: InteractionMutationScope & {
|
|
171
|
+
authRunId: string;
|
|
172
|
+
operationId: string;
|
|
173
|
+
}): Promise<ResourceOperationRow["state"]>;
|
|
174
|
+
export declare function completeExternalAuth(db: Database, input: InteractionMutationScope & {
|
|
175
|
+
authRunId: string;
|
|
176
|
+
operationId: string;
|
|
177
|
+
result: BrowserExternalAuthResultValue;
|
|
178
|
+
target?: {
|
|
179
|
+
id: string;
|
|
180
|
+
targetGeneration: string;
|
|
181
|
+
documentGeneration: string | null;
|
|
182
|
+
};
|
|
183
|
+
intervention?: {
|
|
184
|
+
originatingSessionId: string;
|
|
185
|
+
originatingTurnId?: string | null;
|
|
186
|
+
originatingAttemptId?: string | null;
|
|
187
|
+
originatingToolOperationId?: string | null;
|
|
188
|
+
expiresInSeconds: number;
|
|
189
|
+
};
|
|
190
|
+
}): Promise<ExternalAuthRunResponseValue>;
|
|
191
|
+
export declare function prepareProtectedAuthFill(db: Database, input: InteractionMutationScope & {
|
|
192
|
+
authRunId: string;
|
|
193
|
+
credentialVersion: number | null;
|
|
194
|
+
} & ProtectedAuthFillRequestValue): Promise<ProtectedAuthFillPreparation>;
|
|
195
|
+
export declare function dispatchProtectedAuthFill(db: Database, input: InteractionMutationScope & {
|
|
196
|
+
authRunId: string;
|
|
197
|
+
operationId: string;
|
|
198
|
+
}): Promise<ResourceOperationRow["state"]>;
|
|
199
|
+
export declare function completeProtectedAuthFill(db: Database, input: InteractionMutationScope & {
|
|
200
|
+
authRunId: string;
|
|
201
|
+
operationId: string;
|
|
202
|
+
status: ProtectedAuthFillResponseValue["status"];
|
|
203
|
+
targetGeneration?: string;
|
|
204
|
+
documentGeneration?: string | null;
|
|
205
|
+
failureCode?: string;
|
|
206
|
+
intervention?: {
|
|
207
|
+
originatingSessionId: string;
|
|
208
|
+
originatingTurnId?: string | null;
|
|
209
|
+
originatingAttemptId?: string | null;
|
|
210
|
+
originatingToolOperationId?: string | null;
|
|
211
|
+
kind: "manual_login" | "mfa" | "external_action" | "confirmation" | "other";
|
|
212
|
+
reason: string;
|
|
213
|
+
expiresInSeconds: number;
|
|
214
|
+
};
|
|
215
|
+
}): Promise<ProtectedAuthFillResponseValue>;
|
|
216
|
+
export declare function markProtectedAuthFillOutcomeUnknown(db: Database, input: InteractionMutationScope & {
|
|
217
|
+
authRunId: string;
|
|
218
|
+
operationId: string;
|
|
219
|
+
errorCode: string;
|
|
220
|
+
}): Promise<void>;
|
|
221
|
+
export declare function verifyAuthRun(db: Database, input: InteractionMutationScope & {
|
|
222
|
+
authRunId: string;
|
|
223
|
+
controllerGeneration: string;
|
|
224
|
+
targetId: string;
|
|
225
|
+
targetGeneration: string;
|
|
226
|
+
documentGeneration: string | null;
|
|
227
|
+
url: string;
|
|
228
|
+
} & VerifyAuthRunRequestValue): Promise<AuthRunMutationResponseValue>;
|
|
64
229
|
export declare function listInteractionInterventions(db: Database, input: {
|
|
65
230
|
accountId: string;
|
|
66
231
|
workspaceId: string;
|
|
@@ -73,15 +238,58 @@ export declare function getInteractionIntervention(db: Database, input: {
|
|
|
73
238
|
workspaceId: string;
|
|
74
239
|
interventionId: string;
|
|
75
240
|
}): Promise<InteractionInterventionValue>;
|
|
241
|
+
export type AttemptInteractionInterventionRequest = {
|
|
242
|
+
id: string;
|
|
243
|
+
operationId: string;
|
|
244
|
+
accountId: string;
|
|
245
|
+
workspaceId: string;
|
|
246
|
+
originatingSessionId: string;
|
|
247
|
+
originatingTurnId: string;
|
|
248
|
+
originatingAttemptId: string;
|
|
249
|
+
toolCallId: string;
|
|
250
|
+
input: RequestHumanInteractionToolInputValue;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Persist one interaction interruption inside the same transaction as its
|
|
254
|
+
* frozen Agent RunState. This is deliberately transaction-local: callers must
|
|
255
|
+
* already hold the session/turn/attempt settlement locks and RLS context.
|
|
256
|
+
*/
|
|
257
|
+
export declare function persistAttemptInteractionInterventionInTransaction(db: Database, raw: AttemptInteractionInterventionRequest): Promise<InteractionInterventionValue>;
|
|
258
|
+
export declare function getInteractionInterventionApprovalTarget(db: Database, input: {
|
|
259
|
+
accountId: string;
|
|
260
|
+
workspaceId: string;
|
|
261
|
+
interventionId: string;
|
|
262
|
+
}): Promise<{
|
|
263
|
+
sessionId: string;
|
|
264
|
+
toolCallId: string;
|
|
265
|
+
} | null>;
|
|
266
|
+
export declare function getInteractionInterventionResumeForEvent(db: Database, workspaceId: string, sessionId: string, event: Pick<SessionEvent, "type" | "payload">): Promise<{
|
|
267
|
+
toolCallId: string;
|
|
268
|
+
intervention: InteractionInterventionValue;
|
|
269
|
+
} | null>;
|
|
76
270
|
export declare function createInteractionIntervention(db: Database, input: InteractionMutationScope & CreateInteractionInterventionRequestValue & {
|
|
77
271
|
originatingSessionId: string;
|
|
78
272
|
originatingTurnId?: string | null;
|
|
79
273
|
originatingAttemptId?: string | null;
|
|
80
274
|
originatingToolOperationId?: string | null;
|
|
81
275
|
}): Promise<InteractionInterventionMutationResponseValue>;
|
|
276
|
+
export declare function resolveInteractionInterventionInTransaction(db: Database, input: InteractionMutationScope & {
|
|
277
|
+
interventionId: string;
|
|
278
|
+
} & ResolveInteractionInterventionRequestValue): Promise<InteractionInterventionMutationResponseValue>;
|
|
82
279
|
export declare function resolveInteractionIntervention(db: Database, input: InteractionMutationScope & {
|
|
83
280
|
interventionId: string;
|
|
84
281
|
} & ResolveInteractionInterventionRequestValue): Promise<InteractionInterventionMutationResponseValue>;
|
|
282
|
+
/**
|
|
283
|
+
* Cancel every still-open intervention created by a logical agent turn when
|
|
284
|
+
* that turn becomes terminal. The caller already owns the turn-settlement
|
|
285
|
+
* transaction, so no resource can outlive the terminal session truth.
|
|
286
|
+
*/
|
|
287
|
+
export declare function cancelTurnInteractionInterventionsInTransaction(db: Database, input: {
|
|
288
|
+
accountId: string;
|
|
289
|
+
workspaceId: string;
|
|
290
|
+
sessionId: string;
|
|
291
|
+
turnId: string;
|
|
292
|
+
}): Promise<number>;
|
|
85
293
|
export declare function cancelOpenInteractionInterventions(db: Database, input: {
|
|
86
294
|
accountId: string;
|
|
87
295
|
workspaceId: string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type BrowserDownload as BrowserDownloadValue, type BrowserDownloadSaveRequest as BrowserDownloadSaveRequestValue, type BrowserDownloadSaveResponse as BrowserDownloadSaveResponseValue } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
4
|
+
type OperationRow = typeof schema.interactionResourceOperations.$inferSelect;
|
|
5
|
+
type SaveMetadata = {
|
|
6
|
+
browserSessionId: string;
|
|
7
|
+
controllerGeneration: string;
|
|
8
|
+
sourceSessionId: string;
|
|
9
|
+
destinationPath: string;
|
|
10
|
+
overwrite: boolean;
|
|
11
|
+
fileId: string;
|
|
12
|
+
uploadId: string;
|
|
13
|
+
objectKey: string;
|
|
14
|
+
safeFilename: string;
|
|
15
|
+
contentType: string;
|
|
16
|
+
download: BrowserDownloadValue;
|
|
17
|
+
};
|
|
18
|
+
export type BrowserDownloadSavePreparation = SaveMetadata & {
|
|
19
|
+
operationId: string;
|
|
20
|
+
state: OperationRow["state"];
|
|
21
|
+
errorCode: string | null;
|
|
22
|
+
replayed: boolean;
|
|
23
|
+
dispatchedNow: boolean;
|
|
24
|
+
response: BrowserDownloadSaveResponseValue | null;
|
|
25
|
+
};
|
|
26
|
+
type SaveIdentity = {
|
|
27
|
+
accountId: string;
|
|
28
|
+
workspaceId: string;
|
|
29
|
+
actorSubjectId: string;
|
|
30
|
+
browserSessionId: string;
|
|
31
|
+
downloadId: string;
|
|
32
|
+
request: BrowserDownloadSaveRequestValue;
|
|
33
|
+
};
|
|
34
|
+
export declare function findBrowserDownloadSave(db: Database, inputValue: SaveIdentity): Promise<BrowserDownloadSavePreparation | null>;
|
|
35
|
+
export declare function prepareBrowserDownloadSave(db: Database, inputValue: SaveIdentity & {
|
|
36
|
+
sourceSessionId: string;
|
|
37
|
+
download: BrowserDownloadValue;
|
|
38
|
+
fileId: string;
|
|
39
|
+
safeFilename: string;
|
|
40
|
+
contentType: string;
|
|
41
|
+
bucket: string;
|
|
42
|
+
objectKey: string;
|
|
43
|
+
uploadExpiresAt: Date;
|
|
44
|
+
}): Promise<BrowserDownloadSavePreparation>;
|
|
45
|
+
export declare function dispatchBrowserDownloadSave(db: Database, inputValue: SaveIdentity): Promise<BrowserDownloadSavePreparation>;
|
|
46
|
+
export declare function completeBrowserDownloadSave(db: Database, inputValue: SaveIdentity): Promise<BrowserDownloadSaveResponseValue>;
|
|
47
|
+
export declare function settleBrowserDownloadSaveFailure(db: Database, inputValue: SaveIdentity & {
|
|
48
|
+
state: "failed" | "outcome_unknown";
|
|
49
|
+
errorCode: string;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BrowserIdentity as BrowserIdentityValue, type BrowserIdentityListResponse as BrowserIdentityListResponseValue, type BrowserIdentityMutationResponse as BrowserIdentityMutationResponseValue, type BrowserRevision as BrowserRevisionValue, type BrowserRevisionListResponse as BrowserRevisionListResponseValue, type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue, type InteractionError as InteractionErrorValue, type PublishBrowserRevisionResponse as PublishBrowserRevisionResponseValue } from "@opengeni/contracts";
|
|
1
|
+
import { type BrowserIdentity as BrowserIdentityValue, type BrowserIdentityListResponse as BrowserIdentityListResponseValue, type BrowserIdentityMutationResponse as BrowserIdentityMutationResponseValue, type BrowserRevision as BrowserRevisionValue, type BrowserRevisionListResponse as BrowserRevisionListResponseValue, type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue, type InteractionError as InteractionErrorValue, type PublishBrowserRevisionResponse as PublishBrowserRevisionResponseValue, type UpdateBrowserIdentityRequest as UpdateBrowserIdentityRequestValue } from "@opengeni/contracts";
|
|
2
2
|
import { type Database } from "./database.js";
|
|
3
3
|
import { type BrowserStateArtifactCommitInput } from "./browser-state-artifacts.js";
|
|
4
4
|
export declare class BrowserIdentityNotFoundError extends Error {
|
|
@@ -10,7 +10,6 @@ export declare class BrowserIdentityConflictError extends Error {
|
|
|
10
10
|
export declare class BrowserIdentityStateError extends Error {
|
|
11
11
|
readonly name = "BrowserIdentityStateError";
|
|
12
12
|
}
|
|
13
|
-
export type { BrowserStateArtifactCommitInput } from "./browser-state-artifacts.js";
|
|
14
13
|
export type BrowserRevisionPublicationPreparation = {
|
|
15
14
|
kind: "completed";
|
|
16
15
|
response: PublishBrowserRevisionResponseValue;
|
|
@@ -68,6 +67,12 @@ export declare function createBrowserIdentity(db: Database, input: {
|
|
|
68
67
|
name: string;
|
|
69
68
|
actorSubjectId: string;
|
|
70
69
|
}): Promise<BrowserIdentityMutationResponseValue>;
|
|
70
|
+
export declare function updateBrowserIdentity(db: Database, input: {
|
|
71
|
+
accountId: string;
|
|
72
|
+
workspaceId: string;
|
|
73
|
+
identityId: string;
|
|
74
|
+
actorSubjectId: string;
|
|
75
|
+
} & UpdateBrowserIdentityRequestValue): Promise<BrowserIdentityMutationResponseValue>;
|
|
71
76
|
export declare function browserRevisionPublicationRequestDigest(input: {
|
|
72
77
|
browserSessionId: string;
|
|
73
78
|
identityId: string;
|
|
@@ -95,6 +100,10 @@ export declare function dispatchBrowserRevisionPublication(db: Database, input:
|
|
|
95
100
|
expectedHeadGeneration: number;
|
|
96
101
|
advanceDefault: boolean;
|
|
97
102
|
actorSubjectId: string;
|
|
103
|
+
stateUpload?: {
|
|
104
|
+
objectKey: string;
|
|
105
|
+
cleanupAfter: Date;
|
|
106
|
+
};
|
|
98
107
|
}): Promise<BrowserRevisionPublicationDispatch>;
|
|
99
108
|
export declare function commitBrowserRevisionPublication(db: Database, input: {
|
|
100
109
|
accountId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BrowserSession, InteractionControllerBinding, type BrowserSessionCapabilities as BrowserSessionCapabilitiesValue, type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue, type BrowserSessionListResponse as BrowserSessionListResponseValue, type BrowserSessionMutationResponse as BrowserSessionMutationResponseValue, type InteractionError as InteractionErrorValue, type InteractionLifecycleOperationKind, type InteractionLifecycleOperationReceipt as InteractionLifecycleOperationReceiptValue, type InteractionPlacement } from "@opengeni/contracts";
|
|
1
|
+
import { BrowserSession, InteractionControllerBinding, type BrowserSessionCapabilities as BrowserSessionCapabilitiesValue, type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue, type BrowserSessionListResponse as BrowserSessionListResponseValue, type BrowserSessionMutationResponse as BrowserSessionMutationResponseValue, type InteractionError as InteractionErrorValue, type InteractionLifecycleOperationKind, type InteractionLifecycleOperationReceipt as InteractionLifecycleOperationReceiptValue, type InteractionPlacement, type NetworkRouteConfiguration as NetworkRouteConfigurationValue, type NetworkRouteConsistency as NetworkRouteConsistencyValue } from "@opengeni/contracts";
|
|
2
2
|
import { type Database } from "./database.js";
|
|
3
3
|
import { type BrowserStateArtifactCommitInput } from "./browser-state-artifacts.js";
|
|
4
4
|
import * as schema from "./schema.js";
|
|
@@ -13,6 +13,7 @@ export declare const MANAGED_BROWSER_SESSION_CAPABILITIES: {
|
|
|
13
13
|
downloads: boolean;
|
|
14
14
|
uploads: boolean;
|
|
15
15
|
clipboard: boolean;
|
|
16
|
+
permissions: boolean;
|
|
16
17
|
diagnostics: boolean;
|
|
17
18
|
rawCdp: boolean;
|
|
18
19
|
linkedComputer: boolean;
|
|
@@ -29,6 +30,45 @@ export declare const ATTACHED_BROWSER_SESSION_CAPABILITIES: {
|
|
|
29
30
|
downloads: boolean;
|
|
30
31
|
uploads: boolean;
|
|
31
32
|
clipboard: boolean;
|
|
33
|
+
permissions: boolean;
|
|
34
|
+
diagnostics: boolean;
|
|
35
|
+
rawCdp: boolean;
|
|
36
|
+
linkedComputer: boolean;
|
|
37
|
+
privateCheckpoint: boolean;
|
|
38
|
+
identityPublication: boolean;
|
|
39
|
+
parallelTargets: boolean;
|
|
40
|
+
};
|
|
41
|
+
/** Remote Chromium controlled through the same native CDP driver. Files and
|
|
42
|
+
* portable profile state remain false because their bytes live on another host. */
|
|
43
|
+
export declare const EXTERNAL_BROWSER_SESSION_CAPABILITIES: {
|
|
44
|
+
semanticObservation: boolean;
|
|
45
|
+
screenshots: boolean;
|
|
46
|
+
liveFrames: boolean;
|
|
47
|
+
humanInput: boolean;
|
|
48
|
+
tabs: boolean;
|
|
49
|
+
downloads: boolean;
|
|
50
|
+
uploads: boolean;
|
|
51
|
+
clipboard: boolean;
|
|
52
|
+
permissions: boolean;
|
|
53
|
+
diagnostics: boolean;
|
|
54
|
+
rawCdp: boolean;
|
|
55
|
+
linkedComputer: boolean;
|
|
56
|
+
privateCheckpoint: boolean;
|
|
57
|
+
identityPublication: boolean;
|
|
58
|
+
parallelTargets: boolean;
|
|
59
|
+
};
|
|
60
|
+
/** Measured against Lightpanda 0.3.5. Unsupported Chromium-only affordances
|
|
61
|
+
* remain false instead of being emulated or silently routed elsewhere. */
|
|
62
|
+
export declare const LIGHTPANDA_BROWSER_SESSION_CAPABILITIES: {
|
|
63
|
+
semanticObservation: boolean;
|
|
64
|
+
screenshots: boolean;
|
|
65
|
+
liveFrames: boolean;
|
|
66
|
+
humanInput: boolean;
|
|
67
|
+
tabs: boolean;
|
|
68
|
+
downloads: boolean;
|
|
69
|
+
uploads: boolean;
|
|
70
|
+
clipboard: boolean;
|
|
71
|
+
permissions: boolean;
|
|
32
72
|
diagnostics: boolean;
|
|
33
73
|
rawCdp: boolean;
|
|
34
74
|
linkedComputer: boolean;
|
|
@@ -91,7 +131,11 @@ export type BrowserSessionControlRecord = {
|
|
|
91
131
|
session: BrowserSession;
|
|
92
132
|
tokenGeneration: number;
|
|
93
133
|
sourceSessionId: string;
|
|
134
|
+
/** Placement hosting browserd. It equals the logical sandbox placement for
|
|
135
|
+
* managed browsers and remains the source home sandbox for remote browsers. */
|
|
136
|
+
controllerHostSandboxGroupId: string | null;
|
|
94
137
|
createOperationId: string;
|
|
138
|
+
networkRouteAuthority: BrowserSessionNetworkRouteAuthority | null;
|
|
95
139
|
operation: null | {
|
|
96
140
|
operationId: string;
|
|
97
141
|
kind: InteractionLifecycleOperationKind;
|
|
@@ -100,6 +144,14 @@ export type BrowserSessionControlRecord = {
|
|
|
100
144
|
actorSubjectId: string;
|
|
101
145
|
};
|
|
102
146
|
};
|
|
147
|
+
export type BrowserSessionNetworkRouteAuthority = {
|
|
148
|
+
routeId: string;
|
|
149
|
+
routeVersion: number;
|
|
150
|
+
credentialVersion: number | null;
|
|
151
|
+
authorityDigest: string | null;
|
|
152
|
+
configuration: NetworkRouteConfigurationValue;
|
|
153
|
+
consistency: NetworkRouteConsistencyValue;
|
|
154
|
+
};
|
|
103
155
|
export declare function browserSessionCreateRequestDigest(input: PrepareBrowserSessionCreateInput): string;
|
|
104
156
|
export declare function listBrowserSessions(db: Database, input: {
|
|
105
157
|
accountId: string;
|
|
@@ -151,6 +203,7 @@ export declare function getBrowserSession(db: Database, input: {
|
|
|
151
203
|
downloads: boolean;
|
|
152
204
|
uploads: boolean;
|
|
153
205
|
clipboard: boolean;
|
|
206
|
+
permissions: boolean;
|
|
154
207
|
diagnostics: boolean;
|
|
155
208
|
rawCdp: boolean;
|
|
156
209
|
linkedComputer: boolean;
|
|
@@ -191,6 +244,20 @@ export declare function findBrowserSessionControlRecordByOperation(db: Database,
|
|
|
191
244
|
operationId: string;
|
|
192
245
|
}): Promise<BrowserSessionControlRecord | null>;
|
|
193
246
|
export declare function prepareBrowserSessionCreate(db: Database, input: PrepareBrowserSessionCreateInput): Promise<BrowserSessionMutationResponseValue>;
|
|
247
|
+
/**
|
|
248
|
+
* Bind the broker-resolved, secret-free launch authority before controller
|
|
249
|
+
* dispatch. A prepared operation may refresh this binding while no physical
|
|
250
|
+
* controller owns it; after dispatch it is immutable and replay-fenced.
|
|
251
|
+
*/
|
|
252
|
+
export declare function bindBrowserSessionNetworkRouteAuthority(db: Database, input: {
|
|
253
|
+
accountId: string;
|
|
254
|
+
workspaceId: string;
|
|
255
|
+
browserSessionId: string;
|
|
256
|
+
operationId: string;
|
|
257
|
+
routeVersion: number;
|
|
258
|
+
credentialVersion: number | null;
|
|
259
|
+
authorityDigest: string;
|
|
260
|
+
}): Promise<BrowserSessionNetworkRouteAuthority>;
|
|
194
261
|
export declare function dispatchBrowserSessionOperation(db: Database, input: {
|
|
195
262
|
accountId: string;
|
|
196
263
|
workspaceId: string;
|
|
@@ -198,7 +265,22 @@ export declare function dispatchBrowserSessionOperation(db: Database, input: {
|
|
|
198
265
|
browserSessionId: string;
|
|
199
266
|
controllerGeneration: string;
|
|
200
267
|
controller?: InteractionControllerBinding;
|
|
268
|
+
stateUpload?: {
|
|
269
|
+
objectKey: string;
|
|
270
|
+
cleanupAfter: Date;
|
|
271
|
+
};
|
|
201
272
|
}): Promise<InteractionLifecycleOperationReceiptValue>;
|
|
273
|
+
/** Pulse one exact dispatched lifecycle operation while its controller mutation
|
|
274
|
+
* is still in flight. This is not viewer or resource activity: it exists only
|
|
275
|
+
* so the global reaper can distinguish a long profile transfer from an API
|
|
276
|
+
* caller that disappeared after dispatch. */
|
|
277
|
+
export declare function touchInteractionOperation(db: Database, input: {
|
|
278
|
+
accountId: string;
|
|
279
|
+
workspaceId: string;
|
|
280
|
+
operationId: string;
|
|
281
|
+
resourceId: string;
|
|
282
|
+
controllerGeneration: string;
|
|
283
|
+
}): Promise<boolean>;
|
|
202
284
|
export declare function activateBrowserSession(db: Database, input: {
|
|
203
285
|
accountId: string;
|
|
204
286
|
workspaceId: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue } from "@opengeni/contracts";
|
|
2
|
-
import type
|
|
2
|
+
import { type Database } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
3
4
|
type BrowserStateArtifactRow = typeof schema.browserStateArtifacts.$inferSelect;
|
|
5
|
+
type BrowserStateUploadRow = typeof schema.browserStateUploads.$inferSelect;
|
|
4
6
|
export type BrowserStateArtifactCommitInput = {
|
|
5
7
|
kind: BrowserStateArtifactRow["kind"];
|
|
6
8
|
format: string;
|
|
@@ -12,6 +14,78 @@ export type BrowserStateArtifactCommitInput = {
|
|
|
12
14
|
sizeBytes: number;
|
|
13
15
|
materialization: BrowserRevisionMaterializationValue;
|
|
14
16
|
};
|
|
17
|
+
export type BrowserStateArtifactCleanupClaim = {
|
|
18
|
+
claimId: string;
|
|
19
|
+
artifactId: string;
|
|
20
|
+
accountId: string;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
objectKey: string;
|
|
23
|
+
};
|
|
24
|
+
export type BrowserStateUploadPurpose = BrowserStateUploadRow["purpose"];
|
|
25
|
+
export type BrowserStateUploadCleanupClaim = {
|
|
26
|
+
claimId: string;
|
|
27
|
+
uploadId: string;
|
|
28
|
+
accountId: string;
|
|
29
|
+
workspaceId: string;
|
|
30
|
+
objectKey: string;
|
|
31
|
+
};
|
|
32
|
+
export declare class BrowserStateUploadStateError extends Error {
|
|
33
|
+
readonly name = "BrowserStateUploadStateError";
|
|
34
|
+
}
|
|
35
|
+
export type BrowserStateUploadPreparationInput = {
|
|
36
|
+
accountId: string;
|
|
37
|
+
workspaceId: string;
|
|
38
|
+
operationId: string;
|
|
39
|
+
sourceBrowserSessionId: string;
|
|
40
|
+
purpose: BrowserStateUploadPurpose;
|
|
41
|
+
objectKey: string;
|
|
42
|
+
cleanupAfter: Date;
|
|
43
|
+
};
|
|
15
44
|
/** Validate storage authority before it can become durable state. */
|
|
16
45
|
export declare function validateBrowserStateArtifactCommitInput(workspaceId: string, value: BrowserStateArtifactCommitInput): BrowserStateArtifactCommitInput;
|
|
46
|
+
/** Establish durable cleanup authority before a controller receives a PUT URL. */
|
|
47
|
+
export declare function prepareBrowserStateUpload(db: Database, input: BrowserStateUploadPreparationInput): Promise<{
|
|
48
|
+
uploadId: string;
|
|
49
|
+
state: BrowserStateUploadRow["state"];
|
|
50
|
+
}>;
|
|
51
|
+
/** Compose upload authority with operation dispatch in one transaction. */
|
|
52
|
+
export declare function prepareBrowserStateUploadInTransaction(db: Database, input: BrowserStateUploadPreparationInput): Promise<{
|
|
53
|
+
uploadId: string;
|
|
54
|
+
state: BrowserStateUploadRow["state"];
|
|
55
|
+
}>;
|
|
56
|
+
/** Queue every uncommitted object owned by a terminal capture operation. */
|
|
57
|
+
export declare function markBrowserStateUploadsDeletePendingInTransaction(db: Database, input: {
|
|
58
|
+
workspaceId: string;
|
|
59
|
+
operationId: string;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
/** Atomically turn one pre-upload authority into the exact artifact root. */
|
|
62
|
+
export declare function commitBrowserStateUploadInTransaction(db: Database, input: {
|
|
63
|
+
workspaceId: string;
|
|
64
|
+
operationId: string;
|
|
65
|
+
sourceBrowserSessionId: string;
|
|
66
|
+
purpose: BrowserStateUploadPurpose;
|
|
67
|
+
objectKey: string;
|
|
68
|
+
artifactId: string;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Claim a bounded cross-workspace batch of retired private checkpoints. The
|
|
72
|
+
* privileged SQL function is the only FORCE-RLS bypass; stale claims are
|
|
73
|
+
* reclaimable and published revision components are structurally ineligible.
|
|
74
|
+
*/
|
|
75
|
+
export declare function claimBrowserStateArtifactCleanup(db: Database, input: {
|
|
76
|
+
claimTimeoutMs: number;
|
|
77
|
+
limit: number;
|
|
78
|
+
}): Promise<BrowserStateArtifactCleanupClaim[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Settle one exact claim only after its provider object was deleted. Completion
|
|
81
|
+
* is idempotent after a lost response and erases the wrapped data key.
|
|
82
|
+
*/
|
|
83
|
+
export declare function completeBrowserStateArtifactCleanup(db: Database, input: BrowserStateArtifactCleanupClaim): Promise<boolean>;
|
|
84
|
+
/** Claim orphan/failed upload objects after their safety horizon. */
|
|
85
|
+
export declare function claimBrowserStateUploadCleanup(db: Database, input: {
|
|
86
|
+
claimTimeoutMs: number;
|
|
87
|
+
limit: number;
|
|
88
|
+
}): Promise<BrowserStateUploadCleanupClaim[]>;
|
|
89
|
+
/** Tombstone one exact orphan upload after its provider object is absent. */
|
|
90
|
+
export declare function completeBrowserStateUploadCleanup(db: Database, input: BrowserStateUploadCleanupClaim): Promise<boolean>;
|
|
17
91
|
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type CanonicalHumanIdentityMutationResponse as CanonicalHumanIdentityMutationResponseType, type CanonicalHumanIdentityProjection as CanonicalHumanIdentityProjectionType } from "@opengeni/contracts/canonical-human-identities";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
|
+
export type CanonicalHumanSessionAuthority = {
|
|
4
|
+
identityId: string;
|
|
5
|
+
identityRevision: number;
|
|
6
|
+
authRevision: number;
|
|
7
|
+
identityStatus: "active" | "recovery_required" | "disputed" | "disabled";
|
|
8
|
+
};
|
|
9
|
+
export declare class CanonicalHumanIdentityConflictError extends Error {
|
|
10
|
+
readonly name = "CanonicalHumanIdentityConflictError";
|
|
11
|
+
readonly code = "CANONICAL_HUMAN_IDENTITY_CONFLICT";
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
export declare class CanonicalHumanIdentityOperationReuseError extends Error {
|
|
15
|
+
readonly name = "CanonicalHumanIdentityOperationReuseError";
|
|
16
|
+
readonly code = "CANONICAL_HUMAN_IDENTITY_OPERATION_REUSED";
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
export declare class CanonicalHumanIdentityNotFoundError extends Error {
|
|
20
|
+
readonly name = "CanonicalHumanIdentityNotFoundError";
|
|
21
|
+
constructor(message?: string);
|
|
22
|
+
}
|
|
23
|
+
export declare class CanonicalHumanIdentityAuthorityError extends Error {
|
|
24
|
+
readonly name = "CanonicalHumanIdentityAuthorityError";
|
|
25
|
+
}
|
|
26
|
+
export declare function ensureCanonicalHumanIdentity(db: Database, input: {
|
|
27
|
+
authUserId: string;
|
|
28
|
+
displayName: string;
|
|
29
|
+
}): Promise<CanonicalHumanSessionAuthority>;
|
|
30
|
+
export declare function ensureCanonicalHumanIdentityForAuthUser(db: Database, authUserId: string): Promise<CanonicalHumanSessionAuthority>;
|
|
31
|
+
export declare function synchronizeCanonicalHumanLoginBindings(db: Database, authUserId: string): Promise<CanonicalHumanSessionAuthority>;
|
|
32
|
+
export declare function validateCanonicalHumanSession(db: Database, input: {
|
|
33
|
+
authSessionId: string;
|
|
34
|
+
authUserId: string;
|
|
35
|
+
allowRecovery?: boolean;
|
|
36
|
+
}): Promise<boolean>;
|
|
37
|
+
export declare function getCanonicalHumanIdentityProjection(db: Database, authUserId: string): Promise<CanonicalHumanIdentityProjectionType>;
|
|
38
|
+
export type ApplyCanonicalHumanIdentityOperationInput = {
|
|
39
|
+
operationId: string;
|
|
40
|
+
authUserId: string;
|
|
41
|
+
expectedIdentityRevision: number;
|
|
42
|
+
operationType: "link" | "unlink" | "begin_recovery" | "recover";
|
|
43
|
+
bindingId?: string | null;
|
|
44
|
+
providerId?: string | null;
|
|
45
|
+
providerAccountId?: string | null;
|
|
46
|
+
reason: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function applyCanonicalHumanIdentityOperation(db: Database, input: ApplyCanonicalHumanIdentityOperationInput): Promise<CanonicalHumanIdentityMutationResponseType>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CanonicalHumanIdentityAuthorityError,
|
|
3
|
+
CanonicalHumanIdentityConflictError,
|
|
4
|
+
CanonicalHumanIdentityNotFoundError,
|
|
5
|
+
CanonicalHumanIdentityOperationReuseError,
|
|
6
|
+
applyCanonicalHumanIdentityOperation,
|
|
7
|
+
ensureCanonicalHumanIdentity,
|
|
8
|
+
ensureCanonicalHumanIdentityForAuthUser,
|
|
9
|
+
getCanonicalHumanIdentityProjection,
|
|
10
|
+
synchronizeCanonicalHumanLoginBindings,
|
|
11
|
+
validateCanonicalHumanSession
|
|
12
|
+
} from "./chunk-TAUTWOS5.js";
|
|
13
|
+
import "./chunk-JC5QPLUM.js";
|
|
14
|
+
import "./chunk-5KTIEDX7.js";
|
|
15
|
+
import "./chunk-PZ5AY32C.js";
|
|
16
|
+
export {
|
|
17
|
+
CanonicalHumanIdentityAuthorityError,
|
|
18
|
+
CanonicalHumanIdentityConflictError,
|
|
19
|
+
CanonicalHumanIdentityNotFoundError,
|
|
20
|
+
CanonicalHumanIdentityOperationReuseError,
|
|
21
|
+
applyCanonicalHumanIdentityOperation,
|
|
22
|
+
ensureCanonicalHumanIdentity,
|
|
23
|
+
ensureCanonicalHumanIdentityForAuthUser,
|
|
24
|
+
getCanonicalHumanIdentityProjection,
|
|
25
|
+
synchronizeCanonicalHumanLoginBindings,
|
|
26
|
+
validateCanonicalHumanSession
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=canonical-human-identities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|