@opengeni/worker-bundle 0.16.21 → 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 +145 -32
- 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 +3 -0
- package/dist/activities/documents.d.ts +3 -2
- package/dist/activities/environment.d.ts +11 -7
- package/dist/activities/expiring-material-renewal.d.ts +5 -3
- 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 +2 -2
- 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 +32 -0
- package/dist/activities/retained-screenshots.d.ts +129 -0
- package/dist/activities/rig-verification.d.ts +82 -5
- package/dist/activities/run-credential-renewal.d.ts +2 -2
- package/dist/activities/run-input.d.ts +5 -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 +11 -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 -147
- 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/{chunk-BJUW5LCM.js → chunk-RAMNYSAW.js} +15 -12
- package/dist/chunk-RAMNYSAW.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/host-export.js +1 -1
- package/dist/index.d.ts +176 -10
- package/dist/index.js +675 -16460
- 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 +40 -7
- package/dist/sandbox-routing.d.ts +13 -6
- package/dist/worker-service-lifecycle.d.ts +6 -2
- package/dist/workflow-bundle.js +1044 -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 +1905 -559
- 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 +16 -7
- package/src/activities/codex-image-generation.ts +56 -0
- package/src/activities/codex-rotation.ts +19 -5
- package/src/activities/context-compaction.ts +47 -6
- package/src/activities/documents.ts +14 -4
- package/src/activities/environment.ts +52 -60
- package/src/activities/expiring-material-renewal.ts +16 -7
- 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/git-credential-renewal.ts +3 -3
- 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/recording.ts +4 -5
- package/src/activities/retained-screenshot-reaper.ts +202 -0
- package/src/activities/retained-screenshots.ts +1317 -0
- package/src/activities/rig-verification.ts +567 -77
- package/src/activities/run-credential-renewal.ts +9 -2
- package/src/activities/run-input.ts +40 -10
- package/src/activities/sandbox-images.ts +167 -0
- package/src/activities/sandbox-lease.ts +1065 -483
- package/src/activities/scheduled-tasks.ts +96 -7
- 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 +77 -13
- package/src/activities-control.ts +54 -0
- package/src/activities-turn.ts +40 -0
- package/src/activities.ts +50 -118
- 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/host-export-pump.ts +28 -11
- package/src/http.ts +3 -6
- 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 +202 -7
- package/src/sandbox-reaper-contract.ts +73 -0
- package/src/sandbox-reaper-timeout.ts +79 -0
- package/src/sandbox-resume.ts +331 -157
- package/src/sandbox-routing.ts +49 -39
- package/src/worker-service-lifecycle.ts +82 -12
- package/src/workflows/activities.ts +30 -0
- package/src/workflows/file-upload-reaper.ts +6 -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/redaction.d.ts +0 -1
- package/dist/activities/toolspace-token-renewal.d.ts +0 -23
- package/dist/chunk-BJUW5LCM.js.map +0 -1
- package/src/activities/redaction.ts +0 -9
- package/src/activities/toolspace-token-renewal.ts +0 -57
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GeneratedVideoFacts } from "@opengeni/contracts";
|
|
2
|
+
import type { ObjectStorage } from "@opengeni/storage";
|
|
3
|
+
export type VerifiedTempFile = Readonly<{
|
|
4
|
+
directory: string;
|
|
5
|
+
path: string;
|
|
6
|
+
sizeBytes: number;
|
|
7
|
+
sha256: string;
|
|
8
|
+
contentType: string;
|
|
9
|
+
cleanup: () => Promise<void>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function copyVersionedObjectToVerifiedTemp(input: {
|
|
12
|
+
storage: ObjectStorage;
|
|
13
|
+
key: string;
|
|
14
|
+
expectedSizeBytes: number;
|
|
15
|
+
expectedSha256: string;
|
|
16
|
+
expectedContentType: string;
|
|
17
|
+
maxBytes: number;
|
|
18
|
+
tempRoot: string;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}): Promise<VerifiedTempFile>;
|
|
21
|
+
export declare function validateImageReference(path: string): Promise<{
|
|
22
|
+
contentType: "image/jpeg" | "image/png" | "image/webp";
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function validateGeneratedVideo(input: {
|
|
27
|
+
path: string;
|
|
28
|
+
ffprobePath: string;
|
|
29
|
+
expectedDurationSeconds?: number;
|
|
30
|
+
}): Promise<GeneratedVideoFacts>;
|
|
31
|
+
export declare function validateVideoReference(input: {
|
|
32
|
+
path: string;
|
|
33
|
+
ffprobePath: string;
|
|
34
|
+
}): Promise<GeneratedVideoFacts>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import { type GeneratedVideoFacts } from "@opengeni/contracts";
|
|
3
|
+
import { type FetchLike } from "@opengeni/network";
|
|
4
|
+
import type { ObjectStorage } from "@opengeni/storage";
|
|
5
|
+
import { type VerifiedTempFile } from "./video-media-validation.js";
|
|
6
|
+
export type RetainedGeneratedVideo = Readonly<{
|
|
7
|
+
bucket: string;
|
|
8
|
+
objectKey: string;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
sha256: string;
|
|
11
|
+
facts: GeneratedVideoFacts;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Treat the provider's result URL and bytes as hostile. DNS is pinned, every
|
|
15
|
+
* redirect is revalidated, and the body streams to a private temporary file
|
|
16
|
+
* under hard time/size limits before ffprobe sees it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function downloadGeneratedVideoToVerifiedTemp(input: {
|
|
19
|
+
url: string;
|
|
20
|
+
mediaType: string;
|
|
21
|
+
settings: Settings;
|
|
22
|
+
expectedDurationSeconds: number;
|
|
23
|
+
fetch?: FetchLike;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
temp: VerifiedTempFile;
|
|
27
|
+
facts: GeneratedVideoFacts;
|
|
28
|
+
}>;
|
|
29
|
+
/** Stream verified bytes into an immutable content-addressed object and hash
|
|
30
|
+
* the stored generation back through version-fenced Range reads. */
|
|
31
|
+
export declare function retainVerifiedGeneratedVideo(input: {
|
|
32
|
+
storage: ObjectStorage;
|
|
33
|
+
temp: VerifiedTempFile;
|
|
34
|
+
facts: GeneratedVideoFacts;
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}): Promise<RetainedGeneratedVideo>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type GenerateVideoToolInput } from "@opengeni/contracts";
|
|
2
|
+
import type { SealedVideoReference, SealedVideoReferenceRole } from "@opengeni/core";
|
|
3
|
+
import type { ObjectStorage } from "@opengeni/storage";
|
|
4
|
+
export type SandboxCommandRunner = (input: {
|
|
5
|
+
cmd: string;
|
|
6
|
+
workdir: string;
|
|
7
|
+
maxOutputTokens: number;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
stdout: string;
|
|
10
|
+
stderr: string;
|
|
11
|
+
exitCode: number;
|
|
12
|
+
}>;
|
|
13
|
+
export type InspectedSandboxVideoReference = Readonly<{
|
|
14
|
+
ordinal: number;
|
|
15
|
+
role: SealedVideoReferenceRole;
|
|
16
|
+
path: string;
|
|
17
|
+
contentType: string;
|
|
18
|
+
sizeBytes: number;
|
|
19
|
+
sha256: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function videoReferencePaths(request: GenerateVideoToolInput): Array<{
|
|
22
|
+
role: SealedVideoReferenceRole;
|
|
23
|
+
path: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function inspectSandboxVideoReferences(input: {
|
|
26
|
+
request: GenerateVideoToolInput;
|
|
27
|
+
runCommand: SandboxCommandRunner;
|
|
28
|
+
}): Promise<InspectedSandboxVideoReference[]>;
|
|
29
|
+
export declare function uploadAndVerifyVideoReferences(input: {
|
|
30
|
+
storage: ObjectStorage;
|
|
31
|
+
references: readonly InspectedSandboxVideoReference[];
|
|
32
|
+
stagingKeys: readonly string[];
|
|
33
|
+
runCommand: SandboxCommandRunner;
|
|
34
|
+
tempRoot: string;
|
|
35
|
+
ffprobePath: string;
|
|
36
|
+
uploadTtlSeconds: number;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): Promise<SealedVideoReference[]>;
|
|
39
|
+
export declare function videoReferenceStagingKey(input: {
|
|
40
|
+
workspaceId: string;
|
|
41
|
+
operationId: string;
|
|
42
|
+
ordinal: number;
|
|
43
|
+
sha256: string;
|
|
44
|
+
}): string;
|
|
45
|
+
export declare const VIDEO_REFERENCE_LIMITS: Readonly<{
|
|
46
|
+
imageBytes: number;
|
|
47
|
+
videoBytes: number;
|
|
48
|
+
outputBytes: number;
|
|
49
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ControlActivityServices } from "./types.js";
|
|
2
2
|
export type DispatchSessionWorkflowWakesResult = {
|
|
3
3
|
claimed: number;
|
|
4
4
|
delivered: number;
|
|
@@ -10,6 +10,6 @@ export type DispatchSessionWorkflowWakesResult = {
|
|
|
10
10
|
* acknowledgement path used by immediate delivery. This is a repair path, not
|
|
11
11
|
* an eligibility scan: producers have already decided what must be delivered.
|
|
12
12
|
*/
|
|
13
|
-
export declare function createWorkflowWakeActivities(services: () => Promise<
|
|
13
|
+
export declare function createWorkflowWakeActivities(services: () => Promise<ControlActivityServices>): {
|
|
14
14
|
dispatchSessionWorkflowWakes(): Promise<DispatchSessionWorkflowWakesResult>;
|
|
15
15
|
};
|
|
@@ -3,7 +3,7 @@ import type { Database } from "@opengeni/db";
|
|
|
3
3
|
import type { ObjectStorage } from "@opengeni/storage";
|
|
4
4
|
import type { Observability } from "@opengeni/observability";
|
|
5
5
|
import { SandboxChannelAService, type ChannelASession } from "@opengeni/runtime/sandbox";
|
|
6
|
-
import type { SessionEvent } from "@opengeni/contracts";
|
|
6
|
+
import type { SessionEvent, WorkspaceCaptureFile, WorkspaceCaptureRepo } from "@opengeni/contracts";
|
|
7
7
|
export declare const CAPTURE_TIMEOUT_MS = 120000;
|
|
8
8
|
export declare const PER_FILE_CONTENT_GUARD_BYTES: number;
|
|
9
9
|
export declare const PER_FILE_DIFF_GUARD_BYTES: number;
|
|
@@ -72,6 +72,7 @@ type CaptureRepositoryReadResult = {
|
|
|
72
72
|
complete: true;
|
|
73
73
|
status: Awaited<ReturnType<SandboxChannelAService["gitStatus"]>>;
|
|
74
74
|
diff: Awaited<ReturnType<SandboxChannelAService["gitDiff"]>>;
|
|
75
|
+
branchDiff?: Awaited<ReturnType<SandboxChannelAService["gitDiff"]>> | undefined;
|
|
75
76
|
} | {
|
|
76
77
|
complete: false;
|
|
77
78
|
degradedReason: "repository_read_unavailable";
|
|
@@ -98,6 +99,15 @@ export declare function readCaptureRepository(svc: Pick<SandboxChannelAService,
|
|
|
98
99
|
* to release() regardless.
|
|
99
100
|
*/
|
|
100
101
|
export declare function captureWorkspaceRevision(input: CaptureWorkspaceRevisionInput): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* sha256 over the CHANGE SURFACE only — per-file (path, status, hash, deleted,
|
|
104
|
+
* tooLarge), exact HEAD identity, the working diff summary, and exact committed
|
|
105
|
+
* branch changes.
|
|
106
|
+
* Deliberately excludes the tree index and file mtimes (which drift without a
|
|
107
|
+
* real change) so two turns that leave the workspace in the same state produce
|
|
108
|
+
* the same fingerprint (the empty-turn gate). Order-independent (sorted).
|
|
109
|
+
*/
|
|
110
|
+
export declare function changeFingerprint(repos: WorkspaceCaptureRepo[], files: WorkspaceCaptureFile[]): string;
|
|
101
111
|
/** Join a repo-root-relative path onto its workspace-relative repo root. */
|
|
102
112
|
export declare function joinRepoPath(repoRoot: string, repoRelPath: string): string;
|
|
103
113
|
/** Content-addressed after-image blob key (shared across revisions → GC input). */
|