@opengeni/worker-bundle 0.16.29 → 0.17.2
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/activities/agent-turn.d.ts +85 -19
- package/dist/activities/api-integrations.d.ts +21 -0
- package/dist/activities/codemode-dispatcher.d.ts +35 -0
- package/dist/activities/codemode-token-renewal.d.ts +23 -0
- package/dist/activities/codex-capacity.d.ts +5 -5
- package/dist/activities/codex-image-generation.d.ts +21 -0
- package/dist/activities/context-compaction.d.ts +1 -0
- package/dist/activities/documents.d.ts +3 -2
- package/dist/activities/environment.d.ts +11 -8
- package/dist/activities/expiring-material-renewal.d.ts +1 -1
- package/dist/activities/file-upload-reaper.d.ts +7 -2
- package/dist/activities/gateway-image-generation.d.ts +39 -0
- package/dist/activities/gateway-video-generation.d.ts +53 -0
- package/dist/activities/generated-images.d.ts +112 -0
- package/dist/activities/git-credential-renewal.d.ts +1 -1
- package/dist/activities/goals.d.ts +2 -2
- package/dist/activities/google-drive-changes.d.ts +99 -0
- package/dist/activities/image-generation-operation.d.ts +74 -0
- package/dist/activities/image-generation-references.d.ts +25 -0
- package/dist/activities/knowledge-source-sync-driver.d.ts +23 -0
- package/dist/activities/knowledge-source-sync.d.ts +75 -0
- package/dist/activities/packs.d.ts +13 -26
- package/dist/activities/parent-wake.d.ts +1 -1
- package/dist/activities/retained-screenshot-reaper.d.ts +2 -2
- package/dist/activities/retained-screenshots.d.ts +36 -0
- package/dist/activities/rig-verification.d.ts +82 -5
- package/dist/activities/run-credential-renewal.d.ts +1 -1
- package/dist/activities/run-input.d.ts +3 -1
- package/dist/activities/sandbox-images.d.ts +14 -0
- package/dist/activities/sandbox-lease.d.ts +47 -9
- package/dist/activities/scheduled-tasks.d.ts +2 -2
- package/dist/activities/session-state.d.ts +4 -4
- package/dist/activities/streaming.d.ts +1 -1
- package/dist/activities/types.d.ts +71 -5
- package/dist/activities/video-generation-admission.d.ts +38 -0
- package/dist/activities/video-generation-credential.d.ts +7 -0
- package/dist/activities/video-generation-reconciliation.d.ts +13 -0
- package/dist/activities/video-media-validation.d.ts +34 -0
- package/dist/activities/video-output-retention.d.ts +36 -0
- package/dist/activities/video-reference-staging.d.ts +49 -0
- package/dist/activities/workflow-wake.d.ts +2 -2
- package/dist/activities/workspace-capture.d.ts +10 -1
- package/dist/activities-control-44KBWLSM.js +6885 -0
- package/dist/activities-control-44KBWLSM.js.map +1 -0
- package/dist/activities-control.d.ts +289 -0
- package/dist/activities-turn-K4CEDEGJ.js +14675 -0
- package/dist/activities-turn-K4CEDEGJ.js.map +1 -0
- package/dist/activities-turn.d.ts +17 -0
- package/dist/activities.d.ts +130 -150
- package/dist/activity-services.d.ts +10 -0
- package/dist/artifact-materializer-entry.d.ts +6 -0
- package/dist/artifact-materializer-entry.js +2662 -0
- package/dist/artifact-materializer-entry.js.map +1 -0
- package/dist/artifact-outbox-entry.d.ts +2 -0
- package/dist/artifact-outbox-entry.js +681 -0
- package/dist/artifact-outbox-entry.js.map +1 -0
- package/dist/chunk-E3RI3I33.js +828 -0
- package/dist/chunk-E3RI3I33.js.map +1 -0
- package/dist/chunk-GRFQTTSQ.js +448 -0
- package/dist/chunk-GRFQTTSQ.js.map +1 -0
- package/dist/chunk-KKCRGAGZ.js +3091 -0
- package/dist/chunk-KKCRGAGZ.js.map +1 -0
- package/dist/concurrency.d.ts +108 -5
- package/dist/editable-artifact-hint-broker.d.ts +49 -0
- package/dist/editable-artifact-materializer-launcher.d.ts +49 -0
- package/dist/editable-artifact-materializer-service.d.ts +108 -0
- package/dist/editable-artifact-materializer-storage.d.ts +12 -0
- package/dist/editable-artifact-materializer-subprocess.d.ts +50 -0
- package/dist/editable-artifact-materializer.d.ts +262 -0
- package/dist/editable-artifact-outbox-dispatcher.d.ts +44 -0
- package/dist/editable-artifact-outbox-service.d.ts +70 -0
- package/dist/host-export.d.ts +1 -1
- package/dist/index.d.ts +176 -10
- package/dist/index.js +662 -17374
- package/dist/index.js.map +1 -1
- package/dist/memory-pressure-guard.d.ts +57 -0
- package/dist/model-checkpoint-memory-collector.d.ts +22 -0
- package/dist/observability-metrics.d.ts +33 -0
- package/dist/sandbox-reaper-contract.d.ts +40 -0
- package/dist/sandbox-reaper-timeout.d.ts +14 -0
- package/dist/sandbox-resume.d.ts +34 -7
- package/dist/sandbox-routing.d.ts +2 -0
- package/dist/worker-service-lifecycle.d.ts +6 -2
- package/dist/workflow-bundle.js +1043 -363
- package/dist/workflows/activities.d.ts +7 -1
- package/dist/workflows/document-index.d.ts +1 -1
- package/dist/workflows/knowledge-source-sync.d.ts +13 -0
- package/dist/workflows/rig-verification.d.ts +1 -1
- package/dist/workflows/sandbox-reaper.d.ts +8 -0
- package/dist/workflows/scheduled-tasks.d.ts +1 -1
- package/dist/workflows/session.d.ts +2 -2
- package/dist/workflows/video-generation.d.ts +10 -0
- package/dist/workflows/workflow-wake.d.ts +1 -1
- package/dist/workflows.d.ts +9 -7
- package/package.json +34 -15
- package/src/activities/agent-turn.ts +1470 -246
- package/src/activities/api-integrations.ts +138 -0
- package/src/activities/codemode-dispatcher.ts +335 -0
- package/src/activities/codemode-token-renewal.ts +64 -0
- package/src/activities/codex-capacity.ts +6 -6
- package/src/activities/codex-image-generation.ts +56 -0
- package/src/activities/context-compaction.ts +38 -3
- package/src/activities/documents.ts +14 -4
- package/src/activities/environment.ts +45 -42
- package/src/activities/expiring-material-renewal.ts +1 -1
- package/src/activities/file-upload-reaper.ts +34 -3
- package/src/activities/gateway-image-generation.ts +146 -0
- package/src/activities/gateway-video-generation.ts +298 -0
- package/src/activities/generated-images.ts +860 -0
- package/src/activities/goals.ts +6 -2
- package/src/activities/google-drive-changes.ts +454 -0
- package/src/activities/image-generation-operation.ts +333 -0
- package/src/activities/image-generation-references.ts +118 -0
- package/src/activities/knowledge-source-sync-driver.ts +27 -0
- package/src/activities/knowledge-source-sync.ts +2840 -0
- package/src/activities/mcp-credentials.ts +1 -0
- package/src/activities/packs.ts +55 -55
- package/src/activities/retained-screenshot-reaper.ts +2 -2
- package/src/activities/retained-screenshots.ts +453 -28
- package/src/activities/rig-verification.ts +554 -43
- package/src/activities/run-input.ts +22 -6
- package/src/activities/sandbox-images.ts +167 -0
- package/src/activities/sandbox-lease.ts +1065 -483
- package/src/activities/scheduled-tasks.ts +77 -4
- package/src/activities/session-state.ts +4 -4
- package/src/activities/streaming.ts +42 -3
- package/src/activities/types.ts +87 -5
- package/src/activities/video-generation-admission.ts +270 -0
- package/src/activities/video-generation-credential.ts +34 -0
- package/src/activities/video-generation-reconciliation.ts +578 -0
- package/src/activities/video-media-validation.ts +326 -0
- package/src/activities/video-output-retention.ts +314 -0
- package/src/activities/video-reference-staging.ts +263 -0
- package/src/activities/workflow-wake.ts +2 -2
- package/src/activities/workspace-capture.ts +44 -10
- package/src/activities-control.ts +54 -0
- package/src/activities-turn.ts +40 -0
- package/src/activities.ts +48 -124
- package/src/activity-services.ts +62 -0
- package/src/artifact-materializer-entry.ts +35 -0
- package/src/artifact-outbox-entry.ts +29 -0
- package/src/concurrency.ts +484 -6
- package/src/editable-artifact-hint-broker.ts +235 -0
- package/src/editable-artifact-materializer-launcher.ts +515 -0
- package/src/editable-artifact-materializer-service.ts +787 -0
- package/src/editable-artifact-materializer-storage.ts +413 -0
- package/src/editable-artifact-materializer-subprocess.ts +956 -0
- package/src/editable-artifact-materializer.ts +1289 -0
- package/src/editable-artifact-outbox-dispatcher.ts +244 -0
- package/src/editable-artifact-outbox-service.ts +438 -0
- package/src/index.ts +277 -72
- package/src/memory-pressure-guard.ts +489 -0
- package/src/model-checkpoint-memory-collector.ts +116 -0
- package/src/observability-metrics.ts +199 -4
- package/src/sandbox-reaper-contract.ts +73 -0
- package/src/sandbox-reaper-timeout.ts +79 -0
- package/src/sandbox-resume.ts +294 -153
- package/src/sandbox-routing.ts +19 -24
- package/src/worker-service-lifecycle.ts +80 -14
- package/src/workflows/activities.ts +30 -0
- package/src/workflows/file-upload-reaper.ts +3 -1
- package/src/workflows/knowledge-source-sync.ts +83 -0
- package/src/workflows/sandbox-reaper.ts +183 -21
- package/src/workflows/scheduled-tasks.ts +42 -6
- package/src/workflows/video-generation.ts +36 -0
- package/src/workflows.ts +17 -1
- package/dist/activities/toolspace-token-renewal.d.ts +0 -23
- package/src/activities/toolspace-token-renewal.ts +0 -64
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { GoogleDriveSelectedSource } from "@opengeni/contracts/google-drive";
|
|
2
|
+
import { type GoogleDriveInventoryEntry, type GoogleDriveInventoryProviderItem } from "@opengeni/documents/google-drive";
|
|
3
|
+
export type GoogleDriveSyncBudget = {
|
|
4
|
+
examinedItems: number;
|
|
5
|
+
providerRequests: number;
|
|
6
|
+
elapsedMs: number;
|
|
7
|
+
};
|
|
8
|
+
export type GoogleDriveChangesCursor = {
|
|
9
|
+
version: 1;
|
|
10
|
+
kind: "google_drive_changes";
|
|
11
|
+
connectionId: string;
|
|
12
|
+
googlePermissionId: string;
|
|
13
|
+
sourceId: string;
|
|
14
|
+
driveId: string | null;
|
|
15
|
+
boundaryId: string;
|
|
16
|
+
pageToken: string;
|
|
17
|
+
cursorGeneration: number;
|
|
18
|
+
lastFullReconciliationAt: string;
|
|
19
|
+
nextFullReconciliationAt: string;
|
|
20
|
+
};
|
|
21
|
+
export type GoogleDriveChangesCheckpoint = {
|
|
22
|
+
version: 2;
|
|
23
|
+
pageToken: string;
|
|
24
|
+
requiresFullReconciliation: boolean;
|
|
25
|
+
seenPageTokenHashes: string[];
|
|
26
|
+
budget: GoogleDriveSyncBudget;
|
|
27
|
+
};
|
|
28
|
+
export type GoogleDriveChange = {
|
|
29
|
+
fileId: string;
|
|
30
|
+
removed: boolean;
|
|
31
|
+
file: GoogleDriveInventoryProviderItem | null;
|
|
32
|
+
};
|
|
33
|
+
export type GoogleDriveChangesPage = {
|
|
34
|
+
changes: GoogleDriveChange[];
|
|
35
|
+
nextPageToken: string | null;
|
|
36
|
+
newStartPageToken: string | null;
|
|
37
|
+
};
|
|
38
|
+
export type GoogleDriveChangesStopReason = "item_limit" | "api_request_limit" | "elapsed_time_limit";
|
|
39
|
+
export type GoogleDriveChangesDrainResult = {
|
|
40
|
+
status: "complete" | "paused";
|
|
41
|
+
stopReason: GoogleDriveChangesStopReason | null;
|
|
42
|
+
entries: GoogleDriveInventoryEntry[];
|
|
43
|
+
checkpoint: GoogleDriveChangesCheckpoint | null;
|
|
44
|
+
newStartPageToken: string | null;
|
|
45
|
+
requiresFullReconciliation: boolean;
|
|
46
|
+
providerRequests: number;
|
|
47
|
+
elapsedMs: number;
|
|
48
|
+
budget: GoogleDriveSyncBudget;
|
|
49
|
+
hardLimitReached: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare function parseGoogleDriveChangesCursor(value: Record<string, unknown> | null, expected: {
|
|
52
|
+
connectionId: string;
|
|
53
|
+
googlePermissionId: string;
|
|
54
|
+
sourceId: string;
|
|
55
|
+
driveId: string | null;
|
|
56
|
+
}): GoogleDriveChangesCursor | null;
|
|
57
|
+
export declare function buildGoogleDriveChangesCursor(input: {
|
|
58
|
+
connectionId: string;
|
|
59
|
+
googlePermissionId: string;
|
|
60
|
+
sourceId: string;
|
|
61
|
+
driveId: string | null;
|
|
62
|
+
boundaryId: string;
|
|
63
|
+
pageToken: string;
|
|
64
|
+
previousGeneration: number;
|
|
65
|
+
reconciledAt: Date;
|
|
66
|
+
fullReconciliationIntervalMs: number;
|
|
67
|
+
}): GoogleDriveChangesCursor;
|
|
68
|
+
export declare function advanceGoogleDriveChangesCursor(cursor: GoogleDriveChangesCursor, pageToken: string): GoogleDriveChangesCursor;
|
|
69
|
+
export declare function googleDriveFullReconciliationDue(cursor: GoogleDriveChangesCursor, now: Date): boolean;
|
|
70
|
+
export declare function resolveGoogleDriveChangesBoundaryId(input: {
|
|
71
|
+
source: GoogleDriveSelectedSource;
|
|
72
|
+
getFile: (fileId: string) => Promise<GoogleDriveInventoryProviderItem | null>;
|
|
73
|
+
}): Promise<string>;
|
|
74
|
+
export declare function parseGoogleDriveChangesCheckpoint(value: unknown, limits: {
|
|
75
|
+
maxItems: number;
|
|
76
|
+
maxProviderRequests: number;
|
|
77
|
+
maxElapsedMs: number;
|
|
78
|
+
}): GoogleDriveChangesCheckpoint | null;
|
|
79
|
+
export declare function drainGoogleDriveChanges(input: {
|
|
80
|
+
source: GoogleDriveSelectedSource;
|
|
81
|
+
cursor: GoogleDriveChangesCursor;
|
|
82
|
+
checkpoint: GoogleDriveChangesCheckpoint | null;
|
|
83
|
+
maxItems: number;
|
|
84
|
+
maxProviderRequests: number;
|
|
85
|
+
maxElapsedMs: number;
|
|
86
|
+
maxInvocationElapsedMs: number;
|
|
87
|
+
maxFileBytes: number;
|
|
88
|
+
listChanges: (pageToken: string, pageSize: number) => Promise<GoogleDriveChangesPage>;
|
|
89
|
+
getFile: (fileId: string) => Promise<GoogleDriveInventoryProviderItem | null>;
|
|
90
|
+
observedExternalObjectIds: (ids: string[]) => Promise<Set<string>>;
|
|
91
|
+
now?: () => number;
|
|
92
|
+
}): Promise<GoogleDriveChangesDrainResult>;
|
|
93
|
+
export declare class GoogleDriveCursorInvalidError extends Error {
|
|
94
|
+
budget: GoogleDriveSyncBudget | null;
|
|
95
|
+
constructor();
|
|
96
|
+
}
|
|
97
|
+
export declare class GoogleDriveChangesProtocolError extends Error {
|
|
98
|
+
constructor(message: string);
|
|
99
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { beginImageGenerationOperation, completeImageGenerationOperation, markImageGenerationOperationOutcomeUnknown, markImageGenerationOperationRetentionFailed, prepareImageGenerationOperation, type Database } from "@opengeni/db";
|
|
2
|
+
import type { ObjectStorage } from "@opengeni/storage";
|
|
3
|
+
import { retainGeneratedImage, type GeneratedImageOutput, type GeneratedImageReceipt } from "./generated-images.js";
|
|
4
|
+
export declare class ImageGenerationOutcomeUnknownError extends Error {
|
|
5
|
+
readonly operationId: string;
|
|
6
|
+
constructor(operationId: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class ImageGenerationRetentionFailedError extends Error {
|
|
9
|
+
readonly operationId: string;
|
|
10
|
+
constructor(operationId: string, cause?: unknown);
|
|
11
|
+
}
|
|
12
|
+
export type ImageGenerationOperationPorts = {
|
|
13
|
+
prepare: typeof prepareImageGenerationOperation;
|
|
14
|
+
begin: typeof beginImageGenerationOperation;
|
|
15
|
+
retain: typeof retainGeneratedImage;
|
|
16
|
+
complete: typeof completeImageGenerationOperation;
|
|
17
|
+
markOutcomeUnknown: typeof markImageGenerationOperationOutcomeUnknown;
|
|
18
|
+
markRetentionFailed: typeof markImageGenerationOperationRetentionFailed;
|
|
19
|
+
recover: typeof recoverCompletedImage;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Durable admission fence shared by every client-executed image provider.
|
|
23
|
+
* Provider execution is permitted at most once after the prepared ->
|
|
24
|
+
* provider_started transition. A crash at that boundary may conservatively
|
|
25
|
+
* leave the outcome unknown; a retry may recover a ready artifact, but never
|
|
26
|
+
* blindly replays the paid operation.
|
|
27
|
+
*/
|
|
28
|
+
export type ExecuteImageGenerationOperationInput = {
|
|
29
|
+
db: Database;
|
|
30
|
+
objectStorage: ObjectStorage | null;
|
|
31
|
+
accountId: string;
|
|
32
|
+
workspaceId: string;
|
|
33
|
+
sessionId: string;
|
|
34
|
+
turnId: string;
|
|
35
|
+
attemptId: string;
|
|
36
|
+
toolCallId: string;
|
|
37
|
+
providerId: string;
|
|
38
|
+
providerBindingHash: string;
|
|
39
|
+
modelId: string;
|
|
40
|
+
prompt: string;
|
|
41
|
+
referenceDigests?: readonly Readonly<{
|
|
42
|
+
mediaType: string;
|
|
43
|
+
sha256: string;
|
|
44
|
+
}>[];
|
|
45
|
+
generate: () => Promise<GeneratedImageOutput>;
|
|
46
|
+
};
|
|
47
|
+
export declare function executeImageGenerationOperation(input: ExecuteImageGenerationOperationInput, ports?: ImageGenerationOperationPorts): Promise<GeneratedImageReceipt>;
|
|
48
|
+
export declare function imageProviderBindingHash(providerId: string, credentialIdentity: string): string;
|
|
49
|
+
/** Stable across worker/Temporal attempt retries; the attempt id is provenance, not identity. */
|
|
50
|
+
export declare function imageGenerationOperationIdentity(input: {
|
|
51
|
+
workspaceId: string;
|
|
52
|
+
sessionId: string;
|
|
53
|
+
turnId: string;
|
|
54
|
+
toolCallId: string;
|
|
55
|
+
providerId: string;
|
|
56
|
+
providerBindingHash: string;
|
|
57
|
+
modelId: string;
|
|
58
|
+
prompt: string;
|
|
59
|
+
referenceDigests?: readonly Readonly<{
|
|
60
|
+
mediaType: string;
|
|
61
|
+
sha256: string;
|
|
62
|
+
}>[];
|
|
63
|
+
}): {
|
|
64
|
+
operationId: string;
|
|
65
|
+
operationKey: string;
|
|
66
|
+
requestDigest: string;
|
|
67
|
+
artifactId: string;
|
|
68
|
+
};
|
|
69
|
+
declare function recoverCompletedImage(input: Pick<Parameters<typeof executeImageGenerationOperation>[0], "db" | "objectStorage" | "accountId" | "workspaceId" | "sessionId" | "turnId" | "toolCallId" | "providerId" | "providerBindingHash">, identity: {
|
|
70
|
+
artifactId: string;
|
|
71
|
+
operationId: string;
|
|
72
|
+
operationKey: string;
|
|
73
|
+
}): Promise<GeneratedImageReceipt | null>;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ImageGenerationReference } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "@opengeni/db";
|
|
3
|
+
import type { ObjectStorage } from "@opengeni/storage";
|
|
4
|
+
import { type GeneratedImageMediaType } from "./generated-images.js";
|
|
5
|
+
export declare const IMAGE_GENERATION_REFERENCE_MAX_BYTES: number;
|
|
6
|
+
export declare const IMAGE_GENERATION_REFERENCES_MAX_TOTAL_BYTES: number;
|
|
7
|
+
export type ResolvedImageGenerationReference = Readonly<{
|
|
8
|
+
mediaType: GeneratedImageMediaType;
|
|
9
|
+
bytes: Uint8Array;
|
|
10
|
+
sizeBytes: number;
|
|
11
|
+
sha256: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type SandboxImageReferenceReader = (path: string, maxBytes: number) => Promise<Uint8Array>;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve ordered model-facing references without accepting arbitrary URLs.
|
|
16
|
+
* Stored files remain workspace-RLS scoped; sandbox reads stay rooted beneath
|
|
17
|
+
* /workspace. Provider adapters receive only validated immutable bytes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveImageGenerationReferences(input: {
|
|
20
|
+
db: Database;
|
|
21
|
+
objectStorage: ObjectStorage;
|
|
22
|
+
workspaceId: string;
|
|
23
|
+
references: readonly ImageGenerationReference[];
|
|
24
|
+
readSandboxFile?: SandboxImageReferenceReader;
|
|
25
|
+
}): Promise<ResolvedImageGenerationReference[]>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type KnowledgeSourceSyncDriverInventory<Entry, StopReason extends string> = {
|
|
2
|
+
status: "complete" | "paused";
|
|
3
|
+
stopReason: StopReason | null;
|
|
4
|
+
entries: Entry[];
|
|
5
|
+
checkpoint: Record<string, unknown> | null;
|
|
6
|
+
providerCursor: Record<string, unknown> | null;
|
|
7
|
+
authoritativeFullScan: boolean;
|
|
8
|
+
cursorInvalidated: boolean;
|
|
9
|
+
providerRequests: number;
|
|
10
|
+
elapsedMs: number;
|
|
11
|
+
hardLimitReached: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Provider port for deterministic knowledge ingestion. Implementations own
|
|
14
|
+
* provider JSON and byte transfer; the shared activity owns authority,
|
|
15
|
+
* persistence, indexing obligations, telemetry, and checkpoint settlement. */
|
|
16
|
+
export type KnowledgeSourceSyncDriver<Entry, StopReason extends string> = {
|
|
17
|
+
providerKey: string;
|
|
18
|
+
providerDomain: string;
|
|
19
|
+
providerCoordinationKey: string;
|
|
20
|
+
inventory: (executionCheckpoint: Record<string, unknown> | null, providerCursor: Record<string, unknown> | null) => Promise<KnowledgeSourceSyncDriverInventory<Entry, StopReason>>;
|
|
21
|
+
fetchContent: (entry: Entry, maxBytes: number) => Promise<Uint8Array>;
|
|
22
|
+
citationLocator: (entry: Entry) => Record<string, unknown>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { GoogleDriveConnectionMetadata, type GoogleDriveSelectedSource } from "@opengeni/contracts/google-drive";
|
|
2
|
+
import { type GoogleDriveInventoryEntry, type GoogleDriveInventoryPage, type GoogleDriveInventoryProviderItem, type GoogleDriveInventoryStopReason } from "@opengeni/documents/google-drive";
|
|
3
|
+
import { deauthorizeKnowledgeSourceRetrieval, settleKnowledgeSourceSyncLease, type Database, type KnowledgeSourceSyncObjectObservationResult, type KnowledgeSourceSyncObservationFloor } from "@opengeni/db";
|
|
4
|
+
import type { ControlActivityServices, RunKnowledgeSourceSyncBatchInput, RunKnowledgeSourceSyncBatchResult } from "./types.js";
|
|
5
|
+
import type { KnowledgeSourceSyncDriver } from "./knowledge-source-sync-driver.js";
|
|
6
|
+
import { type GoogleDriveChangesPage } from "./google-drive-changes.js";
|
|
7
|
+
export declare function knowledgeSyncObservationPolicy(kind: "google_drive" | "atlassian"): {
|
|
8
|
+
revisionOrdering: "canonical_decimal";
|
|
9
|
+
filterWithDriveDurability: boolean;
|
|
10
|
+
} | {
|
|
11
|
+
revisionOrdering: "first_observation";
|
|
12
|
+
filterWithDriveDurability: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function createKnowledgeSourceSyncActivities(services: () => Promise<ControlActivityServices>, resolveDocumentServices?: () => Promise<import("@opengeni/documents").DocumentServices>): {
|
|
15
|
+
runKnowledgeSourceSyncBatch: (input: RunKnowledgeSourceSyncBatchInput) => Promise<RunKnowledgeSourceSyncBatchResult>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Permission loss must fail closed, while the exact source lease must never be
|
|
19
|
+
* stranded by a deauthorization error. If deauthorization fails, release the
|
|
20
|
+
* lease without settling the wake/run and surface the error so Temporal retries
|
|
21
|
+
* this DB-only safety obligation. Terminal settlement is allowed only after
|
|
22
|
+
* deauthorization succeeds.
|
|
23
|
+
*/
|
|
24
|
+
export declare function deauthorizeAndSettleKnowledgeSourceSyncFailure(db: Database, input: {
|
|
25
|
+
deauthorization: Parameters<typeof deauthorizeKnowledgeSourceRetrieval>[1];
|
|
26
|
+
settlement: Parameters<typeof settleKnowledgeSourceSyncLease>[1];
|
|
27
|
+
}): Promise<Awaited<ReturnType<typeof settleKnowledgeSourceSyncLease>>>;
|
|
28
|
+
export type GoogleDriveSyncProviderPort = {
|
|
29
|
+
now?: () => number;
|
|
30
|
+
getStartPageToken: (driveId: string | null) => Promise<string>;
|
|
31
|
+
listChanges: (pageToken: string, driveId: string | null, pageSize: number) => Promise<GoogleDriveChangesPage>;
|
|
32
|
+
getFile: (fileId: string) => Promise<GoogleDriveInventoryProviderItem | null>;
|
|
33
|
+
listChildren: (input: {
|
|
34
|
+
folderId: string;
|
|
35
|
+
driveId: string | null;
|
|
36
|
+
pageToken: string | null;
|
|
37
|
+
pageSize: number;
|
|
38
|
+
}) => Promise<GoogleDriveInventoryPage>;
|
|
39
|
+
};
|
|
40
|
+
export declare function googleDriveSyncDriver(input: {
|
|
41
|
+
actionProviderCoordinationKey: string;
|
|
42
|
+
metadata: ReturnType<typeof GoogleDriveConnectionMetadata.parse>;
|
|
43
|
+
selectedSource: GoogleDriveSelectedSource;
|
|
44
|
+
connectionId: string;
|
|
45
|
+
accountId: string;
|
|
46
|
+
workspaceId: string;
|
|
47
|
+
initiatingSubjectId: string;
|
|
48
|
+
authorization: string | undefined;
|
|
49
|
+
fullReconciliationIntervalMs: number;
|
|
50
|
+
observedExternalObjectIds: (ids: string[]) => Promise<Set<string>>;
|
|
51
|
+
provider?: GoogleDriveSyncProviderPort;
|
|
52
|
+
limits: {
|
|
53
|
+
maxItems: number;
|
|
54
|
+
maxBytes: number;
|
|
55
|
+
maxFileBytes: number;
|
|
56
|
+
maxProviderRequests: number;
|
|
57
|
+
maxElapsedSeconds: number;
|
|
58
|
+
};
|
|
59
|
+
}): KnowledgeSourceSyncDriver<GoogleDriveInventoryEntry, GoogleDriveInventoryStopReason>;
|
|
60
|
+
export declare function shouldProcessGoogleDriveDurableObservation(input: {
|
|
61
|
+
entry: Pick<GoogleDriveInventoryEntry, "externalObjectId">;
|
|
62
|
+
observation: KnowledgeSourceSyncObjectObservationResult;
|
|
63
|
+
sourceLifecycleGeneration: number;
|
|
64
|
+
aclGeneration: number;
|
|
65
|
+
}): boolean;
|
|
66
|
+
export declare function mergeGoogleDriveDurableObservationFloors(checkpoint: Record<string, unknown> | null, observations: KnowledgeSourceSyncObservationFloor[], maxItems: number): Record<string, unknown> | null;
|
|
67
|
+
export declare function googleDriveSyncProviderAccessAllowed(input: {
|
|
68
|
+
connectionVersion: number;
|
|
69
|
+
resolvedConnectionVersion: number | undefined;
|
|
70
|
+
connectionStatus: string;
|
|
71
|
+
lifecycleState: string | undefined;
|
|
72
|
+
grantedScopes: string[];
|
|
73
|
+
}): boolean;
|
|
74
|
+
export declare function confluenceCursor(value: unknown): string | null;
|
|
75
|
+
export declare function adfToMarkdown(value: unknown): string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { CapabilityPack } from "@opengeni/contracts";
|
|
1
|
+
import { CapabilityPack, type PackInstallation } from "@opengeni/contracts";
|
|
3
2
|
import { type Database } from "@opengeni/db";
|
|
4
3
|
import { type EffectiveSkillSelection, type PackSkill } from "@opengeni/runtime";
|
|
4
|
+
export { resolveRigProviderImageSelection, rigProviderImageSourceImage, settingsWithPackSandboxImage, settingsWithRigImage, settingsWithRigProviderImage, } from "./sandbox-images.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* sandbox skill index.
|
|
6
|
+
* Legacy pack-scoped runtime compatibility. V2 Pack installations own ordinary
|
|
7
|
+
* Skill components and select an explicit Rig; they contribute nothing here.
|
|
9
8
|
*/
|
|
10
9
|
export type WorkspacePackRuntime = {
|
|
11
10
|
sandboxImage: string | null;
|
|
@@ -17,13 +16,14 @@ export type WorkspaceSkillLibraryRuntime = {
|
|
|
17
16
|
skillLibrarySelections: EffectiveSkillSelection[];
|
|
18
17
|
};
|
|
19
18
|
/**
|
|
20
|
-
* Resolves
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
19
|
+
* Resolves only pre-V2 active Pack installations. A frozen manifest/digest is
|
|
20
|
+
* the protocol marker for V2: inline Skills were migrated into the ordinary
|
|
21
|
+
* Skill ledger and sandboxImage was resolved to selectedRigId during install,
|
|
22
|
+
* so reading either field directly here would duplicate ownership and silently
|
|
23
|
+
* override session compute.
|
|
25
24
|
*/
|
|
26
25
|
export declare function resolveWorkspacePackRuntime(db: Database, workspaceId: string): Promise<WorkspacePackRuntime>;
|
|
26
|
+
export declare function packInstallationUsesLegacyRuntime(installation: Pick<PackInstallation, "manifestSnapshot" | "manifestDigest">): boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Resolves active immutable curated skills separately from pack skills. The
|
|
29
29
|
* capability installation is the workspace selection boundary; it carries
|
|
@@ -32,10 +32,9 @@ export declare function resolveWorkspacePackRuntime(db: Database, workspaceId: s
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function resolveWorkspaceSkillLibraryRuntime(db: Database, workspaceId: string): Promise<WorkspaceSkillLibraryRuntime>;
|
|
34
34
|
/**
|
|
35
|
-
* Pure
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* packs. Violations fail the turn with a plain error instead of guessing.
|
|
35
|
+
* Pure pre-V2 compatibility rule for enabled Pack manifests. At most one
|
|
36
|
+
* legacy Pack may declare a sandbox image, and legacy Skill names must be
|
|
37
|
+
* unique. V2 rows never reach this function through runtime resolution.
|
|
39
38
|
*/
|
|
40
39
|
export declare function workspacePackRuntimeFromPacks(packs: CapabilityPack[]): WorkspacePackRuntime;
|
|
41
40
|
/**
|
|
@@ -55,18 +54,6 @@ export declare function resolveWorkspaceAgentInstructions(db: Database, workspac
|
|
|
55
54
|
* the settings pass through untouched, so deployments without packs keep the
|
|
56
55
|
* global OPENGENI_DOCKER_IMAGE / OPENGENI_MODAL_IMAGE_REF behavior exactly.
|
|
57
56
|
*/
|
|
58
|
-
export declare function settingsWithPackSandboxImage(settings: Settings, sandboxImage: string | null, sandboxProviderImages?: CapabilityPack["sandboxProviderImages"] | null): Settings;
|
|
59
|
-
/**
|
|
60
|
-
* Applies the session's frozen rig-version image to run settings. Rig image is
|
|
61
|
-
* the TOP of the image precedence chain (rig > pack > deployment default): when
|
|
62
|
-
* the rig version pins an image it OVERRIDES both the deployment
|
|
63
|
-
* dockerImage/modalImageRef AND any pack-declared sandboxImage. When the rig
|
|
64
|
-
* pins no image (`null`), the settings pass through untouched so the pack /
|
|
65
|
-
* deployment chain below still resolves exactly as today. Applied AFTER
|
|
66
|
-
* settingsWithPackSandboxImage so it wins the collision; identical mechanics to
|
|
67
|
-
* the pack equivalent (write both image fields so docker and modal agree).
|
|
68
|
-
*/
|
|
69
|
-
export declare function settingsWithRigImage(settings: Settings, rigImage: string | null): Settings;
|
|
70
57
|
/**
|
|
71
58
|
* Layers the rig version's default variable sets BELOW the session's own set:
|
|
72
59
|
* the session's values WIN on any key collision (explicit precedence). Both maps
|
|
@@ -2,7 +2,7 @@ import type { Settings } from "@opengeni/config";
|
|
|
2
2
|
import type { Session, SessionGoal } from "@opengeni/contracts";
|
|
3
3
|
import { claimPendingSessionSystemUpdateOutbox, claimPendingSessionWorkflowWakes, type Database } from "@opengeni/db";
|
|
4
4
|
import type { EventBus } from "@opengeni/events";
|
|
5
|
-
import type { ActivityServices, WakeSessionWorkflowSignal } from "./types";
|
|
5
|
+
import type { ActivityServices, WakeSessionWorkflowSignal } from "./types.js";
|
|
6
6
|
export type NotifyServices = {
|
|
7
7
|
db: Database;
|
|
8
8
|
bus: EventBus;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FileAsset } from "@opengeni/contracts";
|
|
2
2
|
import type { ObjectHead, ObjectStorage } from "@opengeni/storage";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ControlActivityServices } from "./types.js";
|
|
4
4
|
export declare const RETAINED_SCREENSHOT_PENDING_GRACE_MS: number;
|
|
5
5
|
export declare const RETAINED_SCREENSHOT_CLAIM_TIMEOUT_MS: number;
|
|
6
6
|
export declare const RETAINED_SCREENSHOT_MAINTENANCE_BATCH_SIZE = 100;
|
|
@@ -27,6 +27,6 @@ export type RetainedScreenshotMaintenanceActivityOptions = {
|
|
|
27
27
|
* completion happens only after exact metadata verification or an idempotent
|
|
28
28
|
* object delete.
|
|
29
29
|
*/
|
|
30
|
-
export declare function createRetainedScreenshotMaintenanceActivities(services: () => Promise<
|
|
30
|
+
export declare function createRetainedScreenshotMaintenanceActivities(services: () => Promise<ControlActivityServices>, options?: RetainedScreenshotMaintenanceActivityOptions): {
|
|
31
31
|
maintainRetainedScreenshots: () => Promise<MaintainRetainedScreenshotsResult>;
|
|
32
32
|
};
|
|
@@ -15,6 +15,16 @@ export type ValidatedScreenshot = {
|
|
|
15
15
|
width: number;
|
|
16
16
|
height: number;
|
|
17
17
|
};
|
|
18
|
+
export type RetainableSessionImageMediaType = "image/png" | "image/jpeg" | "image/webp";
|
|
19
|
+
export type ValidatedSessionImage = {
|
|
20
|
+
bytes: Uint8Array;
|
|
21
|
+
mediaType: RetainableSessionImageMediaType;
|
|
22
|
+
extension: "png" | "jpg" | "webp";
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
sha256: string;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
18
28
|
export declare class ScreenshotValidationError extends Error {
|
|
19
29
|
readonly reason: "invalid_content" | "oversized" | "unsupported";
|
|
20
30
|
constructor(reason: "invalid_content" | "oversized" | "unsupported", message: string);
|
|
@@ -24,8 +34,16 @@ export declare class RetainedScreenshotUnavailableError extends Error {
|
|
|
24
34
|
readonly reason: RetainedOutputUnavailableReason;
|
|
25
35
|
constructor(artifactId: string, reason: RetainedOutputUnavailableReason);
|
|
26
36
|
}
|
|
37
|
+
/** Read an intentional image directly at the tool execution boundary. */
|
|
38
|
+
export declare function typedScreenshotFromToolOutput(input: {
|
|
39
|
+
callId: string;
|
|
40
|
+
output: unknown;
|
|
41
|
+
}): TypedScreenshotToolOutput | null;
|
|
27
42
|
/** Read the SDK's trusted typed image before event/history serialization. */
|
|
28
43
|
export declare function typedScreenshotFromSdkEvent(event: unknown): TypedScreenshotToolOutput | null;
|
|
44
|
+
/** Does this SDK result still contain inline bytes that persistence must replace? */
|
|
45
|
+
export declare function sdkEventContainsInlineImage(event: unknown): boolean;
|
|
46
|
+
export declare function toolOutputContainsInlineImage(output: unknown): boolean;
|
|
29
47
|
/** Validate the complete canonical PNG and derive exact integrity metadata. */
|
|
30
48
|
export declare function validateComputerScreenshot(input: {
|
|
31
49
|
bytes: Uint8Array;
|
|
@@ -35,6 +53,15 @@ export declare function validateComputerScreenshot(input: {
|
|
|
35
53
|
maxDimension?: number;
|
|
36
54
|
maxPixels?: number;
|
|
37
55
|
}): ValidatedScreenshot;
|
|
56
|
+
/** Validate a durable view_image/computer image from bytes, never from its claimed MIME alone. */
|
|
57
|
+
export declare function validateRetainableSessionImage(input: {
|
|
58
|
+
bytes: Uint8Array;
|
|
59
|
+
declaredMediaType?: string;
|
|
60
|
+
}, limits?: {
|
|
61
|
+
maxBytes?: number;
|
|
62
|
+
maxDimension?: number;
|
|
63
|
+
maxPixels?: number;
|
|
64
|
+
}): ValidatedSessionImage;
|
|
38
65
|
export declare function retainedScreenshotIdentity(input: {
|
|
39
66
|
sessionId: string;
|
|
40
67
|
turnId: string;
|
|
@@ -45,6 +72,15 @@ export declare function retainedScreenshotIdentity(input: {
|
|
|
45
72
|
artifactId: string;
|
|
46
73
|
settlementKey: string;
|
|
47
74
|
};
|
|
75
|
+
/** Deterministic fail-closed receipt installed before retention can perform I/O. */
|
|
76
|
+
export declare function unavailableRetainedSessionImage(input: {
|
|
77
|
+
sessionId: string;
|
|
78
|
+
turnId: string;
|
|
79
|
+
attemptId: string;
|
|
80
|
+
toolCallId: string;
|
|
81
|
+
toolOutputId: string;
|
|
82
|
+
reason: RetainedOutputUnavailableReason;
|
|
83
|
+
}): RetainedArtifactMetadata;
|
|
48
84
|
export declare function retainComputerScreenshot(input: {
|
|
49
85
|
db: Database;
|
|
50
86
|
objectStorage: ObjectStorage | null;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { RigProviderImage } from "@opengeni/contracts";
|
|
2
|
+
import { type RigProviderImageDefinition } from "@opengeni/core";
|
|
1
3
|
import { acquireLease, commitWarmingToWarm, failWarmingToCold, markWarmLeaseInstanceLost, recordWarmingSandboxCreated, releaseLeaseHolder, touchLeaseHolder, type Database } from "@opengeni/db";
|
|
2
|
-
import { createTurnToolCancellationController, establishSandboxSessionFromEnvelope, serializeEstablishedSandboxEnvelope, tagModalSandbox, type EstablishedSandboxSession, type
|
|
4
|
+
import { createTurnToolCancellationController, establishSandboxSessionFromEnvelope, serializeEstablishedSandboxEnvelope, tagModalSandbox, type EstablishedSandboxSession, type TurnSandboxCommandArgs, type TurnSandboxCommandSession } from "@opengeni/runtime/sandbox";
|
|
3
5
|
import type { Context } from "@temporalio/activity";
|
|
4
|
-
import type {
|
|
6
|
+
import type { ControlActivityServices } from "./types.js";
|
|
7
|
+
import { type WorkspacePackRuntime } from "./packs.js";
|
|
8
|
+
type SandboxLifecycleCommandRunner = (session: TurnSandboxCommandSession, args: TurnSandboxCommandArgs) => Promise<unknown>;
|
|
5
9
|
export type RigVerificationWorkflowInput = {
|
|
6
10
|
workspaceId: string;
|
|
7
11
|
changeId: string;
|
|
@@ -54,6 +58,12 @@ export type RigVerificationOwnershipDependencies = {
|
|
|
54
58
|
export type RigVerificationSandboxRunContext = {
|
|
55
59
|
signal: AbortSignal;
|
|
56
60
|
commandRunner: SandboxLifecycleCommandRunner;
|
|
61
|
+
ownership: {
|
|
62
|
+
leaseId: string;
|
|
63
|
+
leaseEpoch: number;
|
|
64
|
+
workspaceGeneration: number;
|
|
65
|
+
instanceId: string;
|
|
66
|
+
};
|
|
57
67
|
};
|
|
58
68
|
export declare class RigVerificationLeaseUnavailableError extends Error {
|
|
59
69
|
readonly sandboxGroupId: string;
|
|
@@ -76,9 +86,9 @@ export declare class RigVerificationLeaseUnavailableError extends Error {
|
|
|
76
86
|
* lease expiry and the provider reaper remain the hard-worker-loss backstops.
|
|
77
87
|
*/
|
|
78
88
|
export declare function runWithOwnedRigVerificationSandbox<T>(input: {
|
|
79
|
-
settings:
|
|
89
|
+
settings: ControlActivityServices["settings"];
|
|
80
90
|
db: Database;
|
|
81
|
-
observability:
|
|
91
|
+
observability: ControlActivityServices["observability"];
|
|
82
92
|
accountId: string;
|
|
83
93
|
workspaceId: string;
|
|
84
94
|
sandboxGroupId: string;
|
|
@@ -86,7 +96,45 @@ export declare function runWithOwnedRigVerificationSandbox<T>(input: {
|
|
|
86
96
|
sessionIdPrefix: string;
|
|
87
97
|
lifecycle?: RigVerificationActivityLifecycle;
|
|
88
98
|
}, run: (established: EstablishedSandboxSession, context: RigVerificationSandboxRunContext) => Promise<T>, dependencies?: RigVerificationOwnershipDependencies): Promise<T>;
|
|
89
|
-
export declare function
|
|
99
|
+
export declare function rigProviderImageContentMarkerCommand(contentHash: string, markerRoot?: string): string;
|
|
100
|
+
export type RigProviderImageColdBootDependencies = {
|
|
101
|
+
runOwnedSandbox: typeof runWithOwnedRigVerificationSandbox;
|
|
102
|
+
now: () => Date;
|
|
103
|
+
};
|
|
104
|
+
/** Prove a provider image from a second clean sandbox before runtime selection. */
|
|
105
|
+
export declare function verifyRigProviderImageColdBoot(input: {
|
|
106
|
+
settings: ControlActivityServices["settings"];
|
|
107
|
+
db: Database;
|
|
108
|
+
observability: ControlActivityServices["observability"];
|
|
109
|
+
accountId: string;
|
|
110
|
+
workspaceId: string;
|
|
111
|
+
buildRequestId: string;
|
|
112
|
+
rigVersionId: string;
|
|
113
|
+
sessionIdPrefix: string;
|
|
114
|
+
imageId: string;
|
|
115
|
+
contentHash: string;
|
|
116
|
+
checks: RigProviderImageDefinition["checks"];
|
|
117
|
+
lifecycle: RigVerificationActivityLifecycle;
|
|
118
|
+
}, dependencies?: RigProviderImageColdBootDependencies): Promise<string>;
|
|
119
|
+
export declare function buildVerifiedRigProviderImage(input: {
|
|
120
|
+
settings: ControlActivityServices["settings"];
|
|
121
|
+
db: Database;
|
|
122
|
+
observability: ControlActivityServices["observability"];
|
|
123
|
+
accountId: string;
|
|
124
|
+
workspaceId: string;
|
|
125
|
+
existingVersionId?: string;
|
|
126
|
+
definition: RigProviderImageDefinition;
|
|
127
|
+
target: {
|
|
128
|
+
kind: "change" | "version";
|
|
129
|
+
id: string;
|
|
130
|
+
};
|
|
131
|
+
established: EstablishedSandboxSession;
|
|
132
|
+
ownership: RigVerificationSandboxRunContext["ownership"];
|
|
133
|
+
lifecycle: RigVerificationActivityLifecycle;
|
|
134
|
+
signal: AbortSignal;
|
|
135
|
+
}): Promise<RigProviderImage>;
|
|
136
|
+
export declare function settingsForRigVerification(settings: ControlActivityServices["settings"], packRuntime: WorkspacePackRuntime, rigImage: string | null): ControlActivityServices["settings"];
|
|
137
|
+
export declare function createRigVerificationActivities(services: () => Promise<ControlActivityServices>): {
|
|
90
138
|
verifyRigChange: (input: {
|
|
91
139
|
workspaceId: string;
|
|
92
140
|
changeId: string;
|
|
@@ -126,6 +174,35 @@ export declare function createRigVerificationActivities(services: () => Promise<
|
|
|
126
174
|
name: string;
|
|
127
175
|
command: string;
|
|
128
176
|
}[];
|
|
177
|
+
providerImage: {
|
|
178
|
+
backend: "blaxel" | "cloudflare" | "daytona" | "docker" | "e2b" | "local" | "modal" | "none" | "runloop" | "selfhosted" | "vercel";
|
|
179
|
+
provider: string;
|
|
180
|
+
status: "building" | "failed" | "ready" | "unsupported";
|
|
181
|
+
contentHash: string;
|
|
182
|
+
setupHash: string;
|
|
183
|
+
sourceImage: string | null;
|
|
184
|
+
buildRequestId: string;
|
|
185
|
+
imageId: string | null;
|
|
186
|
+
imageDigest: string | null;
|
|
187
|
+
artifactId: string | null;
|
|
188
|
+
providerBindingKeyHash: string | null;
|
|
189
|
+
coldBootValidation?: {
|
|
190
|
+
version: 1;
|
|
191
|
+
checkedAt: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
provenance: {
|
|
194
|
+
kind: "rig_verification";
|
|
195
|
+
targetKind: "change" | "version";
|
|
196
|
+
targetId: string;
|
|
197
|
+
};
|
|
198
|
+
startedAt: string;
|
|
199
|
+
finishedAt: string | null;
|
|
200
|
+
error: {
|
|
201
|
+
code: string;
|
|
202
|
+
message: string;
|
|
203
|
+
retryable: boolean;
|
|
204
|
+
} | null;
|
|
205
|
+
} | null;
|
|
129
206
|
}>;
|
|
130
207
|
};
|
|
131
208
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NormalizedRunCredentialMaterial } from "@opengeni/runtime";
|
|
2
|
-
import { type ExpiringMaterialRenewalController } from "./expiring-material-renewal";
|
|
2
|
+
import { type ExpiringMaterialRenewalController } from "./expiring-material-renewal.js";
|
|
3
3
|
export declare const RUN_CREDENTIAL_DEFAULT_REFRESH_MS: number;
|
|
4
4
|
export declare const RUN_CREDENTIAL_EXPIRY_LEAD_MS: number;
|
|
5
5
|
export declare const RUN_CREDENTIAL_MIN_REFRESH_MS = 5000;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileResourceRef, type FileAsset, type ResourceRef } from "@opengeni/contracts";
|
|
2
|
-
import { getSessionEvent, type Database } from "@opengeni/db";
|
|
2
|
+
import { getActiveSessionHistoryItemsPaged, getSessionEvent, type Database } from "@opengeni/db";
|
|
3
3
|
import { type HistoryProviderApi, type OpenGeniRuntime } from "@opengeni/runtime";
|
|
4
4
|
/** Project only artifacts explicitly rejected by the provider out of its next view. */
|
|
5
5
|
export declare function projectRejectedProviderArtifacts(rows: ReadonlyArray<{
|
|
@@ -27,9 +27,11 @@ export type TurnInputOptions = {
|
|
|
27
27
|
unavailableSandboxFilesNote?: string;
|
|
28
28
|
runCredentialsNote?: string;
|
|
29
29
|
providerApi: HistoryProviderApi;
|
|
30
|
+
projectCanonicalHistory?: ModelHistoryAttachmentProjector;
|
|
30
31
|
materializeModelHistory?: ModelHistoryAttachmentProjector;
|
|
31
32
|
materializeSerializedRunState?: (serialized: string) => Promise<string>;
|
|
32
33
|
projectModelHistory?: ModelHistoryAttachmentProjector;
|
|
34
|
+
loadActiveHistory?: typeof getActiveSessionHistoryItemsPaged;
|
|
33
35
|
};
|
|
34
36
|
export declare const MAX_INLINE_MODEL_ATTACHMENT_BYTES: number;
|
|
35
37
|
export type ModelAttachmentContent = {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import type { CapabilityPack, RigVersion, SandboxBackend } from "@opengeni/contracts";
|
|
3
|
+
import { resolveModalCheckpointProviderBinding } from "@opengeni/runtime/sandbox";
|
|
4
|
+
export declare function settingsWithPackSandboxImage(settings: Settings, sandboxImage: string | null, sandboxProviderImages?: CapabilityPack["sandboxProviderImages"] | null): Settings;
|
|
5
|
+
export declare function settingsWithRigImage(settings: Settings, rigImage: string | null): Settings;
|
|
6
|
+
export declare function rigProviderImageSourceImage(settings: Settings, backend: SandboxBackend): string | null;
|
|
7
|
+
export type RigProviderImageSelectionReason = "selected" | "missing" | "provider_unsupported" | "not_ready" | "not_cold_boot_validated" | "content_mismatch" | "provider_binding_unavailable" | "provider_binding_mismatch";
|
|
8
|
+
export declare function resolveRigProviderImageSelection(settings: Settings, version: RigVersion | null, backend: SandboxBackend, currentProviderBindingKeyHash: string | null): {
|
|
9
|
+
settings: Settings;
|
|
10
|
+
reason: RigProviderImageSelectionReason;
|
|
11
|
+
contentHash: string | null;
|
|
12
|
+
imageId: string | null;
|
|
13
|
+
};
|
|
14
|
+
export declare function settingsWithRigProviderImage(settings: Settings, version: RigVersion | null, backend: SandboxBackend, resolveBinding?: typeof resolveModalCheckpointProviderBinding): Promise<Settings>;
|