@opengeni/db 0.28.1 → 0.31.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/dist/attached-browser-devices.d.ts +42 -0
- package/dist/attempt-tool-catalogs.d.ts +16 -0
- package/dist/browser-auth.d.ts +91 -0
- package/dist/browser-identities.d.ts +128 -0
- package/dist/browser-sessions.d.ts +272 -0
- package/dist/browser-state-artifacts.d.ts +17 -0
- package/dist/capability-components.d.ts +37 -0
- package/dist/capability-integrations.d.ts +192 -0
- package/dist/chunk-F5FT7BEZ.js +3535 -0
- package/dist/chunk-F5FT7BEZ.js.map +1 -0
- package/dist/chunk-ISI2TIUG.js +639 -0
- package/dist/chunk-ISI2TIUG.js.map +1 -0
- package/dist/chunk-MWDVXQOL.js +11639 -0
- package/dist/chunk-MWDVXQOL.js.map +1 -0
- package/dist/chunk-NBE6CHRI.js +955 -0
- package/dist/chunk-NBE6CHRI.js.map +1 -0
- package/dist/{chunk-DBS5HPEW.js → chunk-YHZXQ7HP.js} +760 -11
- package/dist/chunk-YHZXQ7HP.js.map +1 -0
- package/dist/codemode-operations.d.ts +117 -0
- package/dist/codex-token-resolver.d.ts +2 -2
- package/dist/company-profile-schema.d.ts +798 -0
- package/dist/company-profile.d.ts +268 -0
- package/dist/computer-sessions.d.ts +109 -0
- package/dist/connection-token-resolver.d.ts +9 -4
- package/dist/database.d.ts +52 -3
- package/dist/editable-artifact-durable-export.d.ts +153 -0
- package/dist/editable-artifact-durable-export.js +788 -0
- package/dist/editable-artifact-durable-export.js.map +1 -0
- package/dist/editable-artifact-materialization.d.ts +123 -0
- package/dist/editable-artifacts-schema.d.ts +4152 -0
- package/dist/editable-artifacts.d.ts +610 -0
- package/dist/editable-artifacts.js +26 -0
- package/dist/editable-artifacts.js.map +1 -0
- package/dist/environment-crypto.d.ts +8 -4
- package/dist/generated-images.d.ts +139 -0
- package/dist/index.d.ts +958 -126
- package/dist/index.js +31204 -12172
- package/dist/index.js.map +1 -1
- package/dist/insights.d.ts +51 -4
- package/dist/integration-bindings.d.ts +70 -0
- package/dist/integration-features.d.ts +99 -0
- package/dist/interaction-revisions.d.ts +3 -0
- package/dist/interaction-schema.d.ts +5372 -0
- package/dist/knowledge-source-sync-schema.d.ts +1679 -0
- package/dist/knowledge-source-sync.d.ts +274 -0
- package/dist/lossless-columns.d.ts +58 -0
- package/dist/lossless-json.d.ts +39 -0
- package/dist/memory-domain.d.ts +3 -6
- package/dist/memory-governance.d.ts +2 -2
- package/dist/memory-slack-delivery.d.ts +101 -0
- package/dist/new-session-drafts.d.ts +2 -2
- package/dist/pack-components.d.ts +76 -0
- package/dist/pack-installations.d.ts +86 -0
- package/dist/persistence-errors.d.ts +7 -14
- package/dist/plugin-packages.d.ts +126 -0
- package/dist/preference-registry.d.ts +1 -1
- package/dist/provision-roles.d.ts +9 -1
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +18 -6
- package/dist/schema.d.ts +19122 -8731
- package/dist/schema.js +173 -1
- package/dist/scoped-knowledge.d.ts +97 -1
- package/dist/session-control.d.ts +4 -4
- package/dist/session-queue-commands.d.ts +19 -11
- package/dist/session-realtime-context.d.ts +2 -2
- package/dist/session-realtime-ledger.d.ts +4 -4
- package/dist/session-realtime-mirror.d.ts +2 -2
- package/dist/session-realtime-state.d.ts +1 -1
- package/dist/session-realtime-terminal.d.ts +8 -1
- package/dist/session-realtime.d.ts +7 -7
- package/dist/session-tool-call-settlement.d.ts +1 -1
- package/dist/slack-user-link-access.d.ts +54 -0
- package/dist/transcription-recordings-schema.d.ts +44 -6
- package/dist/transcription-recordings.d.ts +3 -3
- package/dist/turn-initiator.d.ts +2 -2
- package/dist/video-generation.d.ts +216 -0
- package/dist/video-generation.js +66 -0
- package/dist/video-generation.js.map +1 -0
- package/dist/workspace-artifacts.d.ts +1 -1
- package/dist/workspace-instruction-policies.d.ts +1 -1
- package/dist/workspace-learning-policy-schema.d.ts +932 -0
- package/dist/workspace-learning-policy.d.ts +161 -0
- package/drizzle/0065_enrollment_credential_generation.sql +10 -0
- package/drizzle/0140_retained_screenshot_artifacts.sql +192 -0
- package/drizzle/0176_lossless_canonical_json.sql +975 -0
- package/drizzle/0177_session_events_workspace_turn_type_index.sql +5 -0
- package/drizzle/0178_permissioned_secret_reads.sql +14 -0
- package/drizzle/0179_slack_private_shortcut_delivery_gate.sql +85 -0
- package/drizzle/0180_retained_screenshot_lifecycle_fences.sql +273 -0
- package/drizzle/0181_connected_machine_removal.sql +52 -0
- package/drizzle/0182_connected_machine_remove_session_default.sql +77 -0
- package/drizzle/0183_model_call_provider_cost_estimates.sql +39 -0
- package/drizzle/0184_sandbox_drain_teardown_fence.sql +682 -0
- package/drizzle/0185_temporal_schedule_cleanup_outbox.sql +168 -0
- package/drizzle/0186_sandbox_capture_provider_contract.sql +400 -0
- package/drizzle/0187_generated_image_artifacts.sql +173 -0
- package/drizzle/0188_image_generation_retention_failure.sql +25 -0
- package/drizzle/0189_retained_session_image_formats.sql +13 -0
- package/drizzle/0190_timeline_annotations.sql +31 -0
- package/drizzle/0191_editable_artifact_engine.sql +3853 -0
- package/drizzle/0192_editable_artifact_live_tickets.sql +338 -0
- package/drizzle/0193_editable_artifact_authorization.sql +190 -0
- package/drizzle/0194_editable_artifact_durable_exports.sql +160 -0
- package/drizzle/0195_editable_artifact_import_authorization.sql +203 -0
- package/drizzle/0196_rig_provider_images.sql +152 -0
- package/drizzle/0197_knowledge_source_sync_schedules.sql +523 -0
- package/drizzle/0198_memory_slack_publication_delivery.sql +393 -0
- package/drizzle/0199_workspace_learning_policy.sql +980 -0
- package/drizzle/0201_company_profile_authority.sql +849 -0
- package/drizzle/0202_document_index_checkpoints.sql +85 -0
- package/drizzle/0203_durable_video_generation.sql +353 -0
- package/drizzle/0204_video_generation_funding.sql +44 -0
- package/drizzle/0205_attempt_tool_catalogs.sql +230 -0
- package/drizzle/0206_browser_sessions.sql +646 -0
- package/drizzle/0207_browser_identities.sql +379 -0
- package/drizzle/0208_attached_browser_devices.sql +165 -0
- package/drizzle/0209_computer_sessions.sql +575 -0
- package/drizzle/0210_browser_auth_network_interventions.sql +441 -0
- package/drizzle/0211_editable_artifact_session_links.sql +58 -0
- package/drizzle/0212_slack_installation_bindings.sql +348 -0
- package/drizzle/0213_slack_user_link_access_requests.sql +177 -0
- package/drizzle/0214_session_activity_commit_gate.sql +262 -0
- package/drizzle/0215_capabilities_platform.sql +980 -0
- package/drizzle/0216_pack_component_ownership.sql +235 -0
- package/drizzle/0217_capability_definition_delete_authority.sql +32 -0
- package/package.json +18 -5
- package/src/attached-browser-devices.ts +371 -0
- package/src/attempt-tool-catalogs.ts +131 -0
- package/src/browser-auth.ts +1896 -0
- package/src/browser-identities.ts +1168 -0
- package/src/browser-sessions.ts +2005 -0
- package/src/browser-state-artifacts.ts +59 -0
- package/src/capability-components.ts +166 -0
- package/src/capability-integrations.ts +1663 -0
- package/src/codemode-operations.ts +674 -0
- package/src/company-profile-schema.ts +143 -0
- package/src/company-profile.ts +968 -0
- package/src/computer-sessions.ts +1130 -0
- package/src/connection-token-resolver.ts +270 -25
- package/src/database.ts +434 -24
- package/src/editable-artifact-durable-export.ts +1201 -0
- package/src/editable-artifact-materialization.ts +893 -0
- package/src/editable-artifacts-schema.ts +879 -0
- package/src/editable-artifacts.ts +5404 -0
- package/src/environment-crypto.ts +22 -9
- package/src/generated-images.ts +740 -0
- package/src/index.ts +10117 -2730
- package/src/insights.ts +160 -13
- package/src/integration-bindings.ts +455 -0
- package/src/integration-features.ts +859 -0
- package/src/interaction-revisions.ts +40 -0
- package/src/interaction-schema.ts +1303 -0
- package/src/knowledge-source-sync-schema.ts +192 -0
- package/src/knowledge-source-sync.ts +1922 -0
- package/src/lossless-columns.ts +35 -0
- package/src/lossless-json.ts +322 -0
- package/src/memory-domain.ts +5 -44
- package/src/memory-slack-delivery.ts +801 -0
- package/src/pack-components.ts +954 -0
- package/src/pack-installations.ts +929 -0
- package/src/persistence-errors.ts +26 -34
- package/src/plugin-packages.ts +1186 -0
- package/src/provision-roles.ts +302 -1
- package/src/runtime-posture-cli.ts +9 -0
- package/src/runtime-posture.ts +514 -5
- package/src/schema.ts +5177 -2957
- package/src/scoped-knowledge-schema.ts +1 -1
- package/src/scoped-knowledge.ts +655 -3
- package/src/session-control.ts +133 -81
- package/src/session-queue-commands.ts +511 -247
- package/src/session-realtime-context.ts +20 -7
- package/src/session-realtime-ledger.ts +32 -10
- package/src/session-realtime-mirror.ts +4 -2
- package/src/session-realtime-terminal.ts +89 -21
- package/src/session-realtime.ts +10 -9
- package/src/session-tool-call-settlement.ts +38 -15
- package/src/slack-user-link-access.ts +702 -0
- package/src/transcription-recordings-schema.ts +5 -2
- package/src/transcription-recordings.ts +70 -40
- package/src/video-generation.ts +1452 -0
- package/src/workspace-learning-policy-schema.ts +139 -0
- package/src/workspace-learning-policy.ts +595 -0
- package/dist/chunk-DBS5HPEW.js.map +0 -1
- package/dist/chunk-HT5T62CC.js +0 -6803
- package/dist/chunk-HT5T62CC.js.map +0 -1
- package/dist/event-payload-sanitizer.d.ts +0 -32
- package/src/event-payload-sanitizer.ts +0 -377
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HumanInputQuestion, HumanInputResponse } from "@opengeni/contracts";
|
|
2
|
-
import type { Database } from "./database";
|
|
3
|
-
import * as schema from "./schema";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
4
4
|
export type SessionRealtimeMirrorChannel = "speakable" | "commentary" | null;
|
|
5
5
|
export type MirrorSessionRealtimeContextInput = {
|
|
6
6
|
accountId: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Database } from "./database";
|
|
1
|
+
import type { Database } from "./database.js";
|
|
2
2
|
export declare function sessionRealtimeIsActiveInTransaction(db: Database, workspaceId: string, sessionId: string, now?: Date): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "./database";
|
|
1
|
+
import type { Database } from "./database.js";
|
|
2
2
|
export type ProjectSessionRealtimeDelegationTerminalInput = {
|
|
3
3
|
accountId: string;
|
|
4
4
|
workspaceId: string;
|
|
@@ -6,9 +6,11 @@ export type ProjectSessionRealtimeDelegationTerminalInput = {
|
|
|
6
6
|
turnId: string;
|
|
7
7
|
turnStatus: "completed" | "failed" | "cancelled" | "superseded";
|
|
8
8
|
terminalEvent: {
|
|
9
|
+
id: string | null;
|
|
9
10
|
type: "turn.completed" | "turn.failed" | "turn.cancelled" | "turn.superseded";
|
|
10
11
|
payload: Record<string, unknown>;
|
|
11
12
|
};
|
|
13
|
+
retainedOutputEvidence?: unknown;
|
|
12
14
|
now?: Date;
|
|
13
15
|
};
|
|
14
16
|
export type SessionRealtimeTerminalEntry = {
|
|
@@ -36,5 +38,10 @@ export type ProjectSessionRealtimeDelegationTerminalResult = {
|
|
|
36
38
|
entry: SessionRealtimeTerminalEntry;
|
|
37
39
|
replay: boolean;
|
|
38
40
|
} | null;
|
|
41
|
+
export declare function buildSessionRealtimeDelegationTerminalProjection(input: ProjectSessionRealtimeDelegationTerminalInput): {
|
|
42
|
+
kind: "delegation_result" | "error";
|
|
43
|
+
text: string;
|
|
44
|
+
payload: Record<string, unknown>;
|
|
45
|
+
};
|
|
39
46
|
/** One terminal projection for every realtime-delegated durable turn. */
|
|
40
47
|
export declare function projectSessionRealtimeDelegationTerminalInTransaction(db: Database, input: ProjectSessionRealtimeDelegationTerminalInput): Promise<ProjectSessionRealtimeDelegationTerminalResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SessionRealtimeEndReason, SessionRealtimeMode, SessionRealtimeModel } from "@opengeni/contracts";
|
|
2
|
-
import type { Database } from "./database";
|
|
3
|
-
import * as schema from "./schema";
|
|
4
|
-
export { sessionRealtimeIsActiveInTransaction } from "./session-realtime-state";
|
|
2
|
+
import type { Database, SessionActivityDatabase } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
4
|
+
export { sessionRealtimeIsActiveInTransaction } from "./session-realtime-state.js";
|
|
5
5
|
export declare const SESSION_REALTIME_LEASE_MS = 30000;
|
|
6
6
|
export type SessionRealtimeConflictCode = "SESSION_CANCELLED" | "CONTROL_NOT_ACTIVE" | "REALTIME_ACTIVE" | "REALTIME_NOT_FOUND" | "REALTIME_NOT_ACTIVE" | "REALTIME_OWNER_MISMATCH" | "REALTIME_VERSION_CHANGED" | "REALTIME_CONNECTION_CHANGED" | "REALTIME_CONNECTION_ACTIVE" | "REALTIME_CONNECTION_NOT_FOUND" | "REALTIME_CONNECTION_STATE_CHANGED" | "REALTIME_PROVIDER_NOT_STARTED" | "REALTIME_DELEGATION_CHANGED" | "REALTIME_ENTRY_CHANGED" | "REALTIME_ACK_INVALID";
|
|
7
7
|
export declare class SessionRealtimeConflictError extends Error {
|
|
@@ -46,14 +46,14 @@ export type SessionRealtimeMutationResult = {
|
|
|
46
46
|
export type RenewSessionRealtimeResult = SessionRealtimeMutationResult & {
|
|
47
47
|
expired: boolean;
|
|
48
48
|
};
|
|
49
|
-
export declare function beginSessionRealtimeInTransaction(db:
|
|
49
|
+
export declare function beginSessionRealtimeInTransaction(db: SessionActivityDatabase, input: BeginSessionRealtimeInput): Promise<SessionRealtimeMutationResult>;
|
|
50
50
|
/**
|
|
51
51
|
* Fence a provider connection to the exact active authenticated browser owner.
|
|
52
52
|
* The caller must finish this transaction before contacting the provider; owner
|
|
53
53
|
* proof is authorization material and must never cross that boundary.
|
|
54
54
|
*/
|
|
55
55
|
export declare function assertSessionRealtimeOwnerInTransaction(db: Database, input: AssertSessionRealtimeOwnerInput): Promise<SessionRealtimeMode>;
|
|
56
|
-
export declare function renewSessionRealtimeInTransaction(db:
|
|
57
|
-
export declare function endSessionRealtimeInTransaction(db:
|
|
56
|
+
export declare function renewSessionRealtimeInTransaction(db: SessionActivityDatabase, input: RenewSessionRealtimeInput): Promise<RenewSessionRealtimeResult>;
|
|
57
|
+
export declare function endSessionRealtimeInTransaction(db: SessionActivityDatabase, input: EndSessionRealtimeInput): Promise<SessionRealtimeMutationResult>;
|
|
58
58
|
/** Lazily settle an expired voice lease under the canonical session lock. */
|
|
59
|
-
export declare function settleExpiredSessionRealtimeInTransaction(db:
|
|
59
|
+
export declare function settleExpiredSessionRealtimeInTransaction(db: SessionActivityDatabase, session: SessionRow, now?: Date): Promise<SessionRow>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionEvent } from "@opengeni/contracts";
|
|
2
|
-
import type { Database } from "./database";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
3
|
export declare const TOOL_RESULT_TYPE_BY_CALL_TYPE: Readonly<Record<string, string>>;
|
|
4
4
|
export declare function historyCallId(item: Record<string, unknown>): string | null;
|
|
5
5
|
export declare function historyItemType(item: Record<string, unknown>): string | null;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type Permission, type SlackUserLinkAccessRequest } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "./database.js";
|
|
3
|
+
export declare class SlackUserLinkAccessPersistenceError extends Error {
|
|
4
|
+
readonly code: "not_found" | "subject_mismatch" | "claim_mismatch" | "version_conflict" | "state_conflict" | "idempotency_conflict" | "slack_identity_conflict";
|
|
5
|
+
constructor(code: "not_found" | "subject_mismatch" | "claim_mismatch" | "version_conflict" | "state_conflict" | "idempotency_conflict" | "slack_identity_conflict");
|
|
6
|
+
}
|
|
7
|
+
export type PrepareSlackUserLinkAccessInput = {
|
|
8
|
+
accountId: string;
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
tokenDigest: string;
|
|
11
|
+
connectionId: string;
|
|
12
|
+
slackTeamId: string;
|
|
13
|
+
slackUserId: string;
|
|
14
|
+
subjectId: string;
|
|
15
|
+
subjectLabel?: string | null;
|
|
16
|
+
expiresAt: Date;
|
|
17
|
+
};
|
|
18
|
+
export type SlackUserLinkAccessMutationInput = {
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
requestId: string;
|
|
21
|
+
actorSubjectId: string;
|
|
22
|
+
expectedVersion: number;
|
|
23
|
+
idempotencyKey: string;
|
|
24
|
+
};
|
|
25
|
+
export type ApproveSlackUserLinkAccessInput = SlackUserLinkAccessMutationInput & {
|
|
26
|
+
role?: string;
|
|
27
|
+
permissions: Permission[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Persist one verified Slack bearer as token-free, subject-bound state. A
|
|
31
|
+
* second fresh bearer for the same exact subject/provider principal supersedes
|
|
32
|
+
* only that subject's older active intent; another subject's row is untouched.
|
|
33
|
+
*/
|
|
34
|
+
export declare function prepareSlackUserLinkAccessRequest(db: Database, input: PrepareSlackUserLinkAccessInput, now?: Date): Promise<SlackUserLinkAccessRequest>;
|
|
35
|
+
export declare function getSlackUserLinkAccessRequestForSubject(db: Database, input: {
|
|
36
|
+
workspaceId: string;
|
|
37
|
+
requestId: string;
|
|
38
|
+
subjectId: string;
|
|
39
|
+
}, now?: Date): Promise<SlackUserLinkAccessRequest | null>;
|
|
40
|
+
export declare function requestSlackUserLinkWorkspaceAccess(db: Database, input: SlackUserLinkAccessMutationInput, now?: Date): Promise<SlackUserLinkAccessRequest>;
|
|
41
|
+
export declare function cancelSlackUserLinkAccessRequest(db: Database, input: SlackUserLinkAccessMutationInput, now?: Date): Promise<SlackUserLinkAccessRequest>;
|
|
42
|
+
export declare function denySlackUserLinkAccessRequest(db: Database, input: SlackUserLinkAccessMutationInput, now?: Date): Promise<SlackUserLinkAccessRequest>;
|
|
43
|
+
export declare function approveSlackUserLinkAccessRequest(db: Database, input: ApproveSlackUserLinkAccessInput, now?: Date): Promise<SlackUserLinkAccessRequest>;
|
|
44
|
+
/**
|
|
45
|
+
* Complete a prepared/pending link only when the subject's live membership
|
|
46
|
+
* already grants sessions:create (or workspace:admin). This is used both for
|
|
47
|
+
* ordinary already-authorized links and after a separate canonical member grant.
|
|
48
|
+
*/
|
|
49
|
+
export declare function completeSlackUserLinkAccessIfGranted(db: Database, input: {
|
|
50
|
+
workspaceId: string;
|
|
51
|
+
requestId: string;
|
|
52
|
+
subjectId: string;
|
|
53
|
+
}, now?: Date): Promise<SlackUserLinkAccessRequest | null>;
|
|
54
|
+
export declare function listPendingSlackUserLinkAccessRequests(db: Database, workspaceId: string, now?: Date): Promise<SlackUserLinkAccessRequest[]>;
|
|
@@ -213,8 +213,8 @@ export declare const transcriptionRecordings: import("drizzle-orm/pg-core").PgTa
|
|
|
213
213
|
transcriptText: import("drizzle-orm/pg-core").PgColumn<{
|
|
214
214
|
name: "transcript_text";
|
|
215
215
|
tableName: "transcription_recordings";
|
|
216
|
-
dataType: "
|
|
217
|
-
columnType: "
|
|
216
|
+
dataType: "custom";
|
|
217
|
+
columnType: "PgCustomColumn";
|
|
218
218
|
data: string;
|
|
219
219
|
driverParam: string;
|
|
220
220
|
notNull: false;
|
|
@@ -222,7 +222,26 @@ export declare const transcriptionRecordings: import("drizzle-orm/pg-core").PgTa
|
|
|
222
222
|
isPrimaryKey: false;
|
|
223
223
|
isAutoincrement: false;
|
|
224
224
|
hasRuntimeDefault: false;
|
|
225
|
-
enumValues:
|
|
225
|
+
enumValues: undefined;
|
|
226
|
+
baseColumn: never;
|
|
227
|
+
identity: undefined;
|
|
228
|
+
generated: undefined;
|
|
229
|
+
}, {}, {
|
|
230
|
+
pgColumnBuilderBrand: 'PgCustomColumnBuilderBrand';
|
|
231
|
+
}>;
|
|
232
|
+
transcriptTextCodecVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
233
|
+
name: "transcript_text_codec_version";
|
|
234
|
+
tableName: "transcription_recordings";
|
|
235
|
+
dataType: "number";
|
|
236
|
+
columnType: "PgInteger";
|
|
237
|
+
data: number;
|
|
238
|
+
driverParam: string | number;
|
|
239
|
+
notNull: false;
|
|
240
|
+
hasDefault: false;
|
|
241
|
+
isPrimaryKey: false;
|
|
242
|
+
isAutoincrement: false;
|
|
243
|
+
hasRuntimeDefault: false;
|
|
244
|
+
enumValues: undefined;
|
|
226
245
|
baseColumn: never;
|
|
227
246
|
identity: undefined;
|
|
228
247
|
generated: undefined;
|
|
@@ -1103,8 +1122,8 @@ export declare const transcriptionRecordingSegments: import("drizzle-orm/pg-core
|
|
|
1103
1122
|
transcriptText: import("drizzle-orm/pg-core").PgColumn<{
|
|
1104
1123
|
name: "transcript_text";
|
|
1105
1124
|
tableName: "transcription_recording_segments";
|
|
1106
|
-
dataType: "
|
|
1107
|
-
columnType: "
|
|
1125
|
+
dataType: "custom";
|
|
1126
|
+
columnType: "PgCustomColumn";
|
|
1108
1127
|
data: string;
|
|
1109
1128
|
driverParam: string;
|
|
1110
1129
|
notNull: false;
|
|
@@ -1112,7 +1131,26 @@ export declare const transcriptionRecordingSegments: import("drizzle-orm/pg-core
|
|
|
1112
1131
|
isPrimaryKey: false;
|
|
1113
1132
|
isAutoincrement: false;
|
|
1114
1133
|
hasRuntimeDefault: false;
|
|
1115
|
-
enumValues:
|
|
1134
|
+
enumValues: undefined;
|
|
1135
|
+
baseColumn: never;
|
|
1136
|
+
identity: undefined;
|
|
1137
|
+
generated: undefined;
|
|
1138
|
+
}, {}, {
|
|
1139
|
+
pgColumnBuilderBrand: 'PgCustomColumnBuilderBrand';
|
|
1140
|
+
}>;
|
|
1141
|
+
transcriptTextCodecVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
1142
|
+
name: "transcript_text_codec_version";
|
|
1143
|
+
tableName: "transcription_recording_segments";
|
|
1144
|
+
dataType: "number";
|
|
1145
|
+
columnType: "PgInteger";
|
|
1146
|
+
data: number;
|
|
1147
|
+
driverParam: string | number;
|
|
1148
|
+
notNull: false;
|
|
1149
|
+
hasDefault: false;
|
|
1150
|
+
isPrimaryKey: false;
|
|
1151
|
+
isAutoincrement: false;
|
|
1152
|
+
hasRuntimeDefault: false;
|
|
1153
|
+
enumValues: undefined;
|
|
1116
1154
|
baseColumn: never;
|
|
1117
1155
|
identity: undefined;
|
|
1118
1156
|
generated: undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TranscriptionRecording, TranscriptionRecordingErrorCode, TranscriptionRecordingResponse } from "@opengeni/contracts";
|
|
2
|
-
import type { Database } from "./database";
|
|
3
|
-
import * as schema from "./schema";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
4
4
|
type ChunkRow = typeof schema.transcriptionRecordingChunks.$inferSelect;
|
|
5
5
|
type SegmentRow = typeof schema.transcriptionRecordingSegments.$inferSelect;
|
|
6
6
|
export declare class TranscriptionRecordingNotFoundError extends Error {
|
|
@@ -171,7 +171,7 @@ export declare function startTranscriptionRecordingSegmentProviderCall(db: Datab
|
|
|
171
171
|
providerStartedAt: Date;
|
|
172
172
|
providerDeadlineAt: Date;
|
|
173
173
|
}): Promise<void>;
|
|
174
|
-
export declare function assembleTranscriptionSegments(segments: readonly Pick<SegmentRow, "segmentNumber" | "transcriptText" | "languages">[]): {
|
|
174
|
+
export declare function assembleTranscriptionSegments(segments: readonly (Pick<SegmentRow, "segmentNumber" | "transcriptText" | "languages"> & Partial<Pick<SegmentRow, "transcriptTextCodecVersion">>)[]): {
|
|
175
175
|
text: string;
|
|
176
176
|
languages: string[];
|
|
177
177
|
};
|
package/dist/turn-initiator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TurnInitiator, type TurnInitiatorContext } from "@opengeni/contracts";
|
|
2
|
-
import type { Database } from "./database";
|
|
3
|
-
import type { SessionCommandActor } from "./session-control";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
|
+
import type { SessionCommandActor } from "./session-control.js";
|
|
4
4
|
export declare const UNATTRIBUTED_LEGACY_INITIATOR: TurnInitiator;
|
|
5
5
|
export type FrozenTurnInitiator = {
|
|
6
6
|
initiator: TurnInitiator;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { type GeneratedVideoFacts, type MediaGenerationResult, type VideoGenerationFundingSource, type VideoGenerationPolicy as VideoGenerationPolicyValue } from "@opengeni/contracts";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
|
+
import * as schema from "./schema.js";
|
|
4
|
+
export declare const ACTIVE_VIDEO_GENERATION_STATUSES: readonly ["preparing", "prepared", "accepted", "submission_uncertain", "provider_started", "retaining"];
|
|
5
|
+
export type VideoGenerationOperation = typeof schema.videoGenerationOperations.$inferSelect;
|
|
6
|
+
export type VideoGenerationReference = typeof schema.videoGenerationReferences.$inferSelect;
|
|
7
|
+
export type GeneratedVideoArtifact = typeof schema.generatedVideoArtifacts.$inferSelect;
|
|
8
|
+
export type VideoGenerationOperationWithReferences = VideoGenerationOperation & {
|
|
9
|
+
references: VideoGenerationReference[];
|
|
10
|
+
};
|
|
11
|
+
export declare class VideoGenerationConflictError extends Error {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class VideoGenerationCapacityError extends Error {
|
|
15
|
+
constructor(message: string);
|
|
16
|
+
}
|
|
17
|
+
export declare class VideoGenerationCreditError extends Error {
|
|
18
|
+
constructor(message?: string);
|
|
19
|
+
}
|
|
20
|
+
export declare function getWorkspaceVideoGenerationPolicy(db: Database, workspaceId: string): Promise<VideoGenerationPolicyValue>;
|
|
21
|
+
export declare function updateWorkspaceVideoGenerationPolicy(db: Database, input: {
|
|
22
|
+
accountId: string;
|
|
23
|
+
workspaceId: string;
|
|
24
|
+
subjectId: string;
|
|
25
|
+
expectedRevision: number;
|
|
26
|
+
fundingSource: VideoGenerationFundingSource;
|
|
27
|
+
enabledModelIds: string[];
|
|
28
|
+
defaultModelId: string | null;
|
|
29
|
+
}): Promise<VideoGenerationPolicyValue>;
|
|
30
|
+
export type AdmitVideoGenerationOperationInput = {
|
|
31
|
+
id: string;
|
|
32
|
+
accountId: string;
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
turnId: string;
|
|
36
|
+
attemptId: string;
|
|
37
|
+
toolCallId: string;
|
|
38
|
+
admissionKey: string;
|
|
39
|
+
requestDigest: string;
|
|
40
|
+
promptDigest: string;
|
|
41
|
+
requestEncrypted: string;
|
|
42
|
+
modelId: string;
|
|
43
|
+
sourceMode: string;
|
|
44
|
+
capabilityRevision: string;
|
|
45
|
+
policyRevision: number;
|
|
46
|
+
fundingSource: VideoGenerationFundingSource;
|
|
47
|
+
pricedCostMicros: number;
|
|
48
|
+
connectionId: string | null;
|
|
49
|
+
credentialVersion: number;
|
|
50
|
+
credentialEncrypted: string;
|
|
51
|
+
providerIdempotencyKey: string;
|
|
52
|
+
expectedArtifactId: string;
|
|
53
|
+
expectedFileId: string;
|
|
54
|
+
reservedBytes?: number;
|
|
55
|
+
workspaceQuotaBytes: number;
|
|
56
|
+
maxConcurrentPerWorkspace: number;
|
|
57
|
+
recoveryDeadlineAt: Date;
|
|
58
|
+
references: Array<{
|
|
59
|
+
ordinal: number;
|
|
60
|
+
role: string;
|
|
61
|
+
contentType: string;
|
|
62
|
+
sizeBytes: number;
|
|
63
|
+
sha256: string;
|
|
64
|
+
stagingObjectKey: string;
|
|
65
|
+
grantExpiresAt?: Date | null;
|
|
66
|
+
cleanupAfter: Date;
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
export declare function admitVideoGenerationOperation(db: Database, input: AdmitVideoGenerationOperationInput): Promise<{
|
|
70
|
+
operation: VideoGenerationOperation;
|
|
71
|
+
created: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Seal a reference-bearing operation only after every immutable staging object
|
|
75
|
+
* has been uploaded and independently verified by the worker. The source
|
|
76
|
+
* sandbox path is intentionally not stored, so a failed preparation can only
|
|
77
|
+
* be retried by the same logical tool call while its sandbox still exists.
|
|
78
|
+
*/
|
|
79
|
+
export declare function markVideoGenerationPrepared(db: Database, input: OperationMutationInput): Promise<VideoGenerationOperation>;
|
|
80
|
+
/** Final authorization fence. Call only after the accepted function output is durable. */
|
|
81
|
+
export declare function markVideoGenerationAccepted(db: Database, input: {
|
|
82
|
+
accountId: string;
|
|
83
|
+
workspaceId: string;
|
|
84
|
+
operationId: string;
|
|
85
|
+
requestDigest: string;
|
|
86
|
+
}): Promise<VideoGenerationOperation>;
|
|
87
|
+
/**
|
|
88
|
+
* Transactional half of acceptance. The pending function result and this
|
|
89
|
+
* transition must commit together: the provider reconciler never observes an
|
|
90
|
+
* accepted operation whose model-visible `accepted` receipt was lost.
|
|
91
|
+
*/
|
|
92
|
+
export declare function markVideoGenerationAcceptedInTransaction(tx: Database, input: {
|
|
93
|
+
workspaceId: string;
|
|
94
|
+
operation: VideoGenerationOperation;
|
|
95
|
+
toolCallId?: string;
|
|
96
|
+
}): Promise<VideoGenerationOperation>;
|
|
97
|
+
export declare function cancelVideoGenerationBeforeSubmit(db: Database, input: {
|
|
98
|
+
accountId: string;
|
|
99
|
+
workspaceId: string;
|
|
100
|
+
operationId: string;
|
|
101
|
+
requestDigest: string;
|
|
102
|
+
reason: string;
|
|
103
|
+
}): Promise<VideoGenerationOperation>;
|
|
104
|
+
/**
|
|
105
|
+
* Turn-interruption half of pre-submit cancellation. It runs under the same
|
|
106
|
+
* session/turn transaction that closes unresolved tool calls, so an accepted
|
|
107
|
+
* receipt can never race a cancellation of its operation.
|
|
108
|
+
*/
|
|
109
|
+
export declare function cancelUnacceptedVideoGenerationsForToolCallsInTransaction(tx: Database, input: {
|
|
110
|
+
workspaceId: string;
|
|
111
|
+
sessionId: string;
|
|
112
|
+
turnId: string;
|
|
113
|
+
toolCallIds: readonly string[];
|
|
114
|
+
reason: string;
|
|
115
|
+
now: Date;
|
|
116
|
+
}): Promise<string[]>;
|
|
117
|
+
export declare function claimVideoGenerationOperations(db: Database, input: {
|
|
118
|
+
owner: string;
|
|
119
|
+
leaseSeconds: number;
|
|
120
|
+
limit: number;
|
|
121
|
+
}): Promise<Array<{
|
|
122
|
+
operationId: string;
|
|
123
|
+
accountId: string;
|
|
124
|
+
workspaceId: string;
|
|
125
|
+
}>>;
|
|
126
|
+
export declare function getVideoGenerationOperation(db: Database, workspaceId: string, operationId: string): Promise<VideoGenerationOperationWithReferences | null>;
|
|
127
|
+
export declare function markVideoGenerationSubmissionUncertain(db: Database, input: OperationMutationInput & {
|
|
128
|
+
nextReconcileAt: Date;
|
|
129
|
+
error: string;
|
|
130
|
+
}): Promise<VideoGenerationOperation>;
|
|
131
|
+
/**
|
|
132
|
+
* Freeze the exact provider start body before issuing the request. If the
|
|
133
|
+
* worker disappears after this transaction, recovery replays the same body
|
|
134
|
+
* and idempotency key rather than reminting URLs or changing request bytes.
|
|
135
|
+
*/
|
|
136
|
+
export declare function markVideoGenerationSubmissionIntent(db: Database, input: OperationMutationInput & {
|
|
137
|
+
encryptedProviderRequest: string;
|
|
138
|
+
providerRequestExpiresAt: Date;
|
|
139
|
+
nextReconcileAt: Date;
|
|
140
|
+
}): Promise<VideoGenerationOperation>;
|
|
141
|
+
export declare function markVideoGenerationProviderStarted(db: Database, input: OperationMutationInput & {
|
|
142
|
+
providerJobId: string;
|
|
143
|
+
nextReconcileAt: Date;
|
|
144
|
+
}): Promise<VideoGenerationOperation>;
|
|
145
|
+
export declare function rescheduleVideoGenerationOperation(db: Database, input: OperationMutationInput & {
|
|
146
|
+
owner?: string;
|
|
147
|
+
nextReconcileAt: Date;
|
|
148
|
+
error?: string;
|
|
149
|
+
}): Promise<boolean>;
|
|
150
|
+
export declare function markVideoGenerationRetaining(db: Database, input: OperationMutationInput): Promise<VideoGenerationOperation>;
|
|
151
|
+
export declare function settleVideoGenerationFailure(db: Database, input: OperationMutationInput & {
|
|
152
|
+
status: "provider_failed" | "retention_failed" | "outcome_unknown";
|
|
153
|
+
publicReason: string;
|
|
154
|
+
privateError?: string;
|
|
155
|
+
}): Promise<VideoGenerationOperation>;
|
|
156
|
+
export type SettleVideoGenerationReadyInput = OperationMutationInput & {
|
|
157
|
+
fileId: string;
|
|
158
|
+
bucket: string;
|
|
159
|
+
objectKey: string;
|
|
160
|
+
sizeBytes: number;
|
|
161
|
+
sha256: string;
|
|
162
|
+
facts: GeneratedVideoFacts;
|
|
163
|
+
};
|
|
164
|
+
export declare function settleVideoGenerationReady(db: Database, input: SettleVideoGenerationReadyInput): Promise<{
|
|
165
|
+
operation: VideoGenerationOperation;
|
|
166
|
+
artifact: GeneratedVideoArtifact;
|
|
167
|
+
}>;
|
|
168
|
+
export declare function getGeneratedVideoArtifact(db: Database, workspaceId: string, artifactId: string): Promise<{
|
|
169
|
+
artifact: GeneratedVideoArtifact;
|
|
170
|
+
file: typeof schema.files.$inferSelect;
|
|
171
|
+
} | null>;
|
|
172
|
+
export declare function listSessionGeneratedVideoArtifacts(db: Database, workspaceId: string, sessionId: string): Promise<Array<{
|
|
173
|
+
artifact: GeneratedVideoArtifact;
|
|
174
|
+
file: typeof schema.files.$inferSelect;
|
|
175
|
+
}>>;
|
|
176
|
+
/**
|
|
177
|
+
* Record one staging object as erased only after the object-store delete has
|
|
178
|
+
* succeeded. Deleting first is safe because object deletion is idempotent; a
|
|
179
|
+
* crash before this CAS simply repeats the same delete on recovery.
|
|
180
|
+
*/
|
|
181
|
+
export declare function markVideoGenerationReferenceCleaned(db: Database, input: {
|
|
182
|
+
accountId: string;
|
|
183
|
+
workspaceId: string;
|
|
184
|
+
operationId: string;
|
|
185
|
+
ordinal: number;
|
|
186
|
+
stagingObjectKey: string;
|
|
187
|
+
}): Promise<boolean>;
|
|
188
|
+
export declare function markVideoGenerationTerminalUpdate(db: Database, input: {
|
|
189
|
+
accountId: string;
|
|
190
|
+
workspaceId: string;
|
|
191
|
+
operationId: string;
|
|
192
|
+
state: "leased" | "delivered" | "suppressed";
|
|
193
|
+
updateId?: string;
|
|
194
|
+
}): Promise<boolean>;
|
|
195
|
+
export declare function markVideoGenerationTerminalUpdateInTransaction(tx: Database, input: {
|
|
196
|
+
workspaceId: string;
|
|
197
|
+
operationId: string;
|
|
198
|
+
state: "leased" | "delivered" | "suppressed";
|
|
199
|
+
updateId?: string;
|
|
200
|
+
}): Promise<boolean>;
|
|
201
|
+
export declare function mediaGenerationResultForOperation(input: {
|
|
202
|
+
operation: VideoGenerationOperation;
|
|
203
|
+
readyReceipt?: Extract<MediaGenerationResult, {
|
|
204
|
+
status: "ready";
|
|
205
|
+
}>["receipt"];
|
|
206
|
+
}): MediaGenerationResult;
|
|
207
|
+
/** Build the compact public/model terminal envelope from durable canonical rows. */
|
|
208
|
+
export declare function mediaGenerationResultForStoredOperation(db: Database, operation: VideoGenerationOperation): Promise<MediaGenerationResult>;
|
|
209
|
+
export declare function getVideoGenerationOperationSummary(db: Database, workspaceId: string, operationId: string): Promise<import("@opengeni/contracts").VideoGenerationOperationSummary | null>;
|
|
210
|
+
type OperationMutationInput = {
|
|
211
|
+
accountId: string;
|
|
212
|
+
workspaceId: string;
|
|
213
|
+
operationId: string;
|
|
214
|
+
requestDigest: string;
|
|
215
|
+
};
|
|
216
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ACTIVE_VIDEO_GENERATION_STATUSES,
|
|
3
|
+
VideoGenerationCapacityError,
|
|
4
|
+
VideoGenerationConflictError,
|
|
5
|
+
VideoGenerationCreditError,
|
|
6
|
+
admitVideoGenerationOperation,
|
|
7
|
+
cancelUnacceptedVideoGenerationsForToolCallsInTransaction,
|
|
8
|
+
cancelVideoGenerationBeforeSubmit,
|
|
9
|
+
claimVideoGenerationOperations,
|
|
10
|
+
getGeneratedVideoArtifact,
|
|
11
|
+
getVideoGenerationOperation,
|
|
12
|
+
getVideoGenerationOperationSummary,
|
|
13
|
+
getWorkspaceVideoGenerationPolicy,
|
|
14
|
+
listSessionGeneratedVideoArtifacts,
|
|
15
|
+
markVideoGenerationAccepted,
|
|
16
|
+
markVideoGenerationAcceptedInTransaction,
|
|
17
|
+
markVideoGenerationPrepared,
|
|
18
|
+
markVideoGenerationProviderStarted,
|
|
19
|
+
markVideoGenerationReferenceCleaned,
|
|
20
|
+
markVideoGenerationRetaining,
|
|
21
|
+
markVideoGenerationSubmissionIntent,
|
|
22
|
+
markVideoGenerationSubmissionUncertain,
|
|
23
|
+
markVideoGenerationTerminalUpdate,
|
|
24
|
+
markVideoGenerationTerminalUpdateInTransaction,
|
|
25
|
+
mediaGenerationResultForOperation,
|
|
26
|
+
mediaGenerationResultForStoredOperation,
|
|
27
|
+
rescheduleVideoGenerationOperation,
|
|
28
|
+
settleVideoGenerationFailure,
|
|
29
|
+
settleVideoGenerationReady,
|
|
30
|
+
updateWorkspaceVideoGenerationPolicy
|
|
31
|
+
} from "./chunk-NBE6CHRI.js";
|
|
32
|
+
import "./chunk-ISI2TIUG.js";
|
|
33
|
+
import "./chunk-MWDVXQOL.js";
|
|
34
|
+
import "./chunk-PZ5AY32C.js";
|
|
35
|
+
export {
|
|
36
|
+
ACTIVE_VIDEO_GENERATION_STATUSES,
|
|
37
|
+
VideoGenerationCapacityError,
|
|
38
|
+
VideoGenerationConflictError,
|
|
39
|
+
VideoGenerationCreditError,
|
|
40
|
+
admitVideoGenerationOperation,
|
|
41
|
+
cancelUnacceptedVideoGenerationsForToolCallsInTransaction,
|
|
42
|
+
cancelVideoGenerationBeforeSubmit,
|
|
43
|
+
claimVideoGenerationOperations,
|
|
44
|
+
getGeneratedVideoArtifact,
|
|
45
|
+
getVideoGenerationOperation,
|
|
46
|
+
getVideoGenerationOperationSummary,
|
|
47
|
+
getWorkspaceVideoGenerationPolicy,
|
|
48
|
+
listSessionGeneratedVideoArtifacts,
|
|
49
|
+
markVideoGenerationAccepted,
|
|
50
|
+
markVideoGenerationAcceptedInTransaction,
|
|
51
|
+
markVideoGenerationPrepared,
|
|
52
|
+
markVideoGenerationProviderStarted,
|
|
53
|
+
markVideoGenerationReferenceCleaned,
|
|
54
|
+
markVideoGenerationRetaining,
|
|
55
|
+
markVideoGenerationSubmissionIntent,
|
|
56
|
+
markVideoGenerationSubmissionUncertain,
|
|
57
|
+
markVideoGenerationTerminalUpdate,
|
|
58
|
+
markVideoGenerationTerminalUpdateInTransaction,
|
|
59
|
+
mediaGenerationResultForOperation,
|
|
60
|
+
mediaGenerationResultForStoredOperation,
|
|
61
|
+
rescheduleVideoGenerationOperation,
|
|
62
|
+
settleVideoGenerationFailure,
|
|
63
|
+
settleVideoGenerationReady,
|
|
64
|
+
updateWorkspaceVideoGenerationPolicy
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=video-generation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceArtifact, WorkspaceArtifactDetailResponse, WorkspaceArtifactMutationResponse, WorkspaceArtifactVersion } from "@opengeni/contracts";
|
|
2
|
-
import type { Database } from "./database";
|
|
2
|
+
import type { Database } from "./database.js";
|
|
3
3
|
type ArtifactMutationToolName = "artifacts_create" | "artifacts_publish" | "artifacts_rollback";
|
|
4
4
|
export declare class WorkspaceArtifactNotFoundError extends Error {
|
|
5
5
|
readonly name = "WorkspaceArtifactNotFoundError";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkspaceInstructionPolicySnapshot } from "@opengeni/contracts";
|
|
2
2
|
import type { WorkspaceInstructionPolicyActivationResponse, WorkspaceInstructionPolicyDiffResponse, WorkspaceInstructionPolicyDraftProvenanceSource, WorkspaceInstructionPolicyHead, WorkspaceInstructionPolicyListQuery, WorkspaceInstructionPolicyListResponse, WorkspaceInstructionPolicyOnboardingProposal, WorkspaceInstructionPolicyOnboardingProposalListQuery, WorkspaceInstructionPolicyOnboardingProposalListResponse, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyRevision, WorkspaceInstructionPolicyTarget } from "@opengeni/contracts";
|
|
3
|
-
import type { Database } from "./database";
|
|
3
|
+
import type { Database } from "./database.js";
|
|
4
4
|
type DraftRequestInput = WorkspaceInstructionPolicyTarget & {
|
|
5
5
|
operationId: string;
|
|
6
6
|
accountId: string;
|