@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,44 @@
|
|
|
1
|
+
import { EditableArtifactLiveOutboxDispatcher, type EditableArtifactOutboxDispatcherOptions, type EditableArtifactOutboxLoggerPort, type EditableArtifactOutboxMetricsPort } from "@opengeni/core";
|
|
2
|
+
import { type Database, type DbClient } from "@opengeni/db";
|
|
3
|
+
import { type ConfirmedNatsEditableArtifactHintBroker, type EditableArtifactHintNatsAuth } from "./editable-artifact-hint-broker.js";
|
|
4
|
+
export declare const EDITABLE_ARTIFACT_OUTBOX_DISPATCHER_DATABASE_ROLE = "opengeni_artifact_outbox_dispatcher";
|
|
5
|
+
export declare const EDITABLE_ARTIFACT_OUTBOX_DATABASE_URL_ENV = "OPENGENI_ARTIFACT_OUTBOX_DATABASE_URL";
|
|
6
|
+
export type EditableArtifactOutboxWorkerOptions = Readonly<{
|
|
7
|
+
/** Must authenticate as the dedicated dispatcher role, never the generic app role. */
|
|
8
|
+
dispatcherDatabaseUrl: string;
|
|
9
|
+
databaseSearchPath?: string;
|
|
10
|
+
databasePoolSize?: number;
|
|
11
|
+
natsUrl: string;
|
|
12
|
+
natsAuth: EditableArtifactHintNatsAuth;
|
|
13
|
+
owner?: string;
|
|
14
|
+
dispatcher?: Omit<EditableArtifactOutboxDispatcherOptions, "owner">;
|
|
15
|
+
metrics?: EditableArtifactOutboxMetricsPort;
|
|
16
|
+
logger?: EditableArtifactOutboxLoggerPort;
|
|
17
|
+
}>;
|
|
18
|
+
/** Explicit lifecycle handle; hosts supervise `start()` and await `stop()` on drain. */
|
|
19
|
+
export declare class EditableArtifactOutboxWorkerRuntime {
|
|
20
|
+
readonly dispatcher: EditableArtifactLiveOutboxDispatcher;
|
|
21
|
+
private readonly broker;
|
|
22
|
+
private readonly database;
|
|
23
|
+
private readonly abort;
|
|
24
|
+
private running;
|
|
25
|
+
private closing;
|
|
26
|
+
constructor(dispatcher: EditableArtifactLiveOutboxDispatcher, broker: ConfirmedNatsEditableArtifactHintBroker, database: DbClient);
|
|
27
|
+
start(): Promise<void>;
|
|
28
|
+
drain(): boolean;
|
|
29
|
+
check(signal?: AbortSignal): Promise<void>;
|
|
30
|
+
stop(): Promise<void>;
|
|
31
|
+
private stopOnce;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Production composition. DB grants make the role a narrow capability: it can
|
|
35
|
+
* execute only lease-fenced dispatcher functions and cannot read artifact rows.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createEditableArtifactOutboxWorker(options: EditableArtifactOutboxWorkerOptions): Promise<EditableArtifactOutboxWorkerRuntime>;
|
|
38
|
+
/**
|
|
39
|
+
* Verify the database identity and its negative capability at runtime. A DSN
|
|
40
|
+
* username check alone is insufficient because PostgreSQL role inheritance,
|
|
41
|
+
* SET ROLE, or a mis-provisioned grant could otherwise widen this worker.
|
|
42
|
+
*/
|
|
43
|
+
export declare function assertDedicatedOutboxDispatcherDatabaseRole(db: Database): Promise<void>;
|
|
44
|
+
export declare function dedicatedDispatcherDatabaseUrl(raw: string): string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import type { EditableArtifactOutboxDispatchSummary } from "@opengeni/core";
|
|
3
|
+
import { type Observability } from "@opengeni/observability";
|
|
4
|
+
import type { EditableArtifactHintNatsAuth } from "./editable-artifact-hint-broker.js";
|
|
5
|
+
export type EditableArtifactOutboxServiceState = "starting" | "ready" | "draining" | "stopped" | "failed";
|
|
6
|
+
export interface EditableArtifactOutboxRuntimePort {
|
|
7
|
+
start(): Promise<void>;
|
|
8
|
+
drain(): boolean;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
check(signal?: AbortSignal): Promise<void>;
|
|
11
|
+
readonly dispatcher: Readonly<{
|
|
12
|
+
dispatchOnce(): Promise<EditableArtifactOutboxDispatchSummary>;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export type EditableArtifactOutboxService = Readonly<{
|
|
16
|
+
state(): EditableArtifactOutboxServiceState;
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
drain(reason?: string): boolean;
|
|
19
|
+
close(): Promise<void>;
|
|
20
|
+
dispatchOnce(): Promise<EditableArtifactOutboxDispatchSummary>;
|
|
21
|
+
fetch(request: Request): Promise<Response>;
|
|
22
|
+
}>;
|
|
23
|
+
export type CreateEditableArtifactOutboxServiceInput = Readonly<{
|
|
24
|
+
runtime: EditableArtifactOutboxRuntimePort;
|
|
25
|
+
observability: Observability;
|
|
26
|
+
serviceName: string;
|
|
27
|
+
environment: string;
|
|
28
|
+
deploymentRevision?: string;
|
|
29
|
+
readinessTimeoutMs?: number;
|
|
30
|
+
}>;
|
|
31
|
+
export type ProductionEditableArtifactOutboxServiceOptions = Readonly<{
|
|
32
|
+
settings: Settings;
|
|
33
|
+
databaseUrl: string;
|
|
34
|
+
declaredDatabaseRole: string;
|
|
35
|
+
natsUrl: string;
|
|
36
|
+
natsAuth: EditableArtifactHintNatsAuth;
|
|
37
|
+
owner: string;
|
|
38
|
+
databasePoolSize?: number;
|
|
39
|
+
batchSize?: number;
|
|
40
|
+
concurrency?: number;
|
|
41
|
+
leaseDurationMs?: number;
|
|
42
|
+
leaseRenewIntervalMs?: number;
|
|
43
|
+
pollIntervalMs?: number;
|
|
44
|
+
publishTimeoutMs?: number;
|
|
45
|
+
retryBaseMs?: number;
|
|
46
|
+
retryMaxMs?: number;
|
|
47
|
+
}>;
|
|
48
|
+
/** Compose the independently supervised production outbox dispatcher. */
|
|
49
|
+
export declare function createProductionEditableArtifactOutboxService(options: ProductionEditableArtifactOutboxServiceOptions): Promise<EditableArtifactOutboxService>;
|
|
50
|
+
export declare function createEditableArtifactOutboxService(input: CreateEditableArtifactOutboxServiceInput): EditableArtifactOutboxService;
|
|
51
|
+
export type EditableArtifactOutboxSidecarEnvironment = Readonly<{
|
|
52
|
+
databaseUrl: string;
|
|
53
|
+
declaredDatabaseRole: string;
|
|
54
|
+
owner: string;
|
|
55
|
+
httpPort: number;
|
|
56
|
+
databasePoolSize: number;
|
|
57
|
+
batchSize: number;
|
|
58
|
+
concurrency: number;
|
|
59
|
+
leaseDurationMs: number;
|
|
60
|
+
leaseRenewIntervalMs: number;
|
|
61
|
+
pollIntervalMs: number;
|
|
62
|
+
publishTimeoutMs: number;
|
|
63
|
+
retryBaseMs: number;
|
|
64
|
+
retryMaxMs: number;
|
|
65
|
+
}>;
|
|
66
|
+
export declare function readEditableArtifactOutboxSidecarEnvironment(environment?: NodeJS.ProcessEnv): EditableArtifactOutboxSidecarEnvironment | null;
|
|
67
|
+
export declare function createOutboxSidecarFromEnvironment(environment?: NodeJS.ProcessEnv): Promise<Readonly<{
|
|
68
|
+
service: EditableArtifactOutboxService;
|
|
69
|
+
httpPort: number;
|
|
70
|
+
}> | null>;
|
package/dist/host-export.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* dependency graph. Host applications that only project durable OpenGeni
|
|
6
6
|
* events or usage must not need that native runtime (or its libc contract).
|
|
7
7
|
*/
|
|
8
|
-
export { createHostExportPump, type HostExportDrainResult, type HostExportPump, type HostExportPumpOptions, } from "./host-export-pump";
|
|
8
|
+
export { createHostExportPump, type HostExportDrainResult, type HostExportPump, type HostExportPumpOptions, } from "./host-export-pump.js";
|
|
9
9
|
export type { HostEventExport, HostEventExportBatch, HostEventSink, HostUsageExport, HostUsageExportBatch, HostUsageSink, } from "@opengeni/contracts";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,15 @@ import { type Settings } from "@opengeni/config";
|
|
|
2
2
|
import { type Database, type RuntimeDatabasePostureOptions } from "@opengeni/db";
|
|
3
3
|
import { type EventBus } from "@opengeni/events";
|
|
4
4
|
import { type Observability } from "@opengeni/observability";
|
|
5
|
-
import { NativeConnection,
|
|
6
|
-
import { createControlActivities
|
|
7
|
-
import type {
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import { NativeConnection, type WorkflowBundleOption } from "@temporalio/worker";
|
|
6
|
+
import type { createControlActivities } from "./activities-control.js";
|
|
7
|
+
import type { createTurnActivities } from "./activities-turn.js";
|
|
8
|
+
import type { ActivityDependencies } from "./activities/types.js";
|
|
9
|
+
import type { InspectSessionAttemptActivity, SignalCodexCapacityWorkflow, SignalSessionAttemptQuiesced, StartSandboxReaperWorkflow, StartVideoGenerationWorkflow, WakeSessionWorkflowSignal } from "./activities/types.js";
|
|
10
|
+
import { type WorkerLifecycleState } from "./http.js";
|
|
11
|
+
import { type TurnTaskQueueStats } from "./observability-metrics.js";
|
|
12
|
+
import { type WorkerRunTarget } from "./worker-service-lifecycle.js";
|
|
13
|
+
export { createHostExportPump, type HostExportDrainResult, type HostExportPump, type HostExportPumpOptions, type HostEventExport, type HostEventExportBatch, type HostEventSink, type HostUsageExport, type HostUsageExportBatch, type HostUsageSink, } from "./host-export.js";
|
|
10
14
|
export declare const FILE_UPLOAD_REAPER_SCHEDULE_ID = "opengeni-file-upload-reaper";
|
|
11
15
|
export declare const FILE_UPLOAD_REAPER_PERIOD_MS: number;
|
|
12
16
|
export type OpenGeniWorkerRole = "control" | "turn";
|
|
@@ -37,6 +41,160 @@ type TemporalActivityLease = {
|
|
|
37
41
|
export declare function temporalActivityLeaseSettled(pending: TemporalActivityLease | null | undefined, nowMs?: number): boolean;
|
|
38
42
|
/** The exact Temporal workflow run is absent, so it cannot retain an activity. */
|
|
39
43
|
export declare function temporalWorkflowExecutionNotFound(error: unknown): boolean;
|
|
44
|
+
/** Load exactly one role's activity graph. Exported for embedded hosts and the
|
|
45
|
+
* process-RSS conformance benchmark; construction remains side-effect free
|
|
46
|
+
* until an activity first resolves its injected services. */
|
|
47
|
+
export declare function createDefaultWorkerActivities(role: OpenGeniWorkerRole, dependencies?: ActivityDependencies): Promise<{
|
|
48
|
+
getCodexCapacityWait: (input: import("./activities.js").GetCodexCapacityWaitInput) => Promise<{
|
|
49
|
+
waiterId: string;
|
|
50
|
+
generation: number;
|
|
51
|
+
nextCheckAt: string;
|
|
52
|
+
wakeRevision: number;
|
|
53
|
+
} | null>;
|
|
54
|
+
reconcileCodexCapacityWait: (input: import("./activities.js").ReconcileCodexCapacityWaitInput) => Promise<import("./activities.js").ReconcileCodexCapacityWaitResult>;
|
|
55
|
+
indexDocument: (input: import("./activities.js").IndexDocumentInput) => Promise<{
|
|
56
|
+
id: string;
|
|
57
|
+
workspaceId: string;
|
|
58
|
+
baseId: string;
|
|
59
|
+
fileId: string;
|
|
60
|
+
status: "failed" | "indexing" | "queued" | "ready";
|
|
61
|
+
title: string;
|
|
62
|
+
parser: string;
|
|
63
|
+
chunkCount: number;
|
|
64
|
+
error: string | null;
|
|
65
|
+
sourceKind: "chat" | "document" | "email" | "manual_upload" | "meeting_transcript" | "other" | "repository" | "web";
|
|
66
|
+
sourceUri: string | null;
|
|
67
|
+
sourceExternalId: string | null;
|
|
68
|
+
sourceTitle: string | null;
|
|
69
|
+
sourceAuthor: string | null;
|
|
70
|
+
sourceCreatedAt: string | null;
|
|
71
|
+
sourceUpdatedAt: string | null;
|
|
72
|
+
sourceVersion: string | null;
|
|
73
|
+
aclTags: string[];
|
|
74
|
+
authorityKind: "organization" | "personal" | "workspace";
|
|
75
|
+
authorityWorkspaceId: string | null;
|
|
76
|
+
authoritySubjectId: string | null;
|
|
77
|
+
visibility: "private" | "workspace";
|
|
78
|
+
createdBy: string | null;
|
|
79
|
+
agentAccess: boolean;
|
|
80
|
+
summary: string | null;
|
|
81
|
+
topics: string[];
|
|
82
|
+
curationStatus: "auto_filed" | "failed" | "none" | "pending" | "suggested";
|
|
83
|
+
curation: {
|
|
84
|
+
suggestedBaseId: string | null;
|
|
85
|
+
suggestedBaseName: string | null;
|
|
86
|
+
confidence: number;
|
|
87
|
+
reason: string | null;
|
|
88
|
+
originalTitle: string | null;
|
|
89
|
+
model: string | null;
|
|
90
|
+
} | null;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
}>;
|
|
94
|
+
reapExpiredFileUploads: () => Promise<import("./activities/file-upload-reaper.js").ReapExpiredFileUploadsResult>;
|
|
95
|
+
recoverVideoGenerationWorkflows: () => Promise<{
|
|
96
|
+
claimed: number;
|
|
97
|
+
started: number;
|
|
98
|
+
failed: number;
|
|
99
|
+
}>;
|
|
100
|
+
enqueueGoalRetryWake: (input: import("./activities.js").MaybeContinueGoalInput) => Promise<void>;
|
|
101
|
+
maybeContinueGoal: (input: import("./activities.js").MaybeContinueGoalInput) => Promise<import("./activities.js").MaybeContinueGoalResult>;
|
|
102
|
+
runKnowledgeSourceSyncBatch: (input: import("./activities.js").RunKnowledgeSourceSyncBatchInput) => Promise<import("./activities.js").RunKnowledgeSourceSyncBatchResult>;
|
|
103
|
+
maintainRetainedScreenshots: () => Promise<import("./activities/retained-screenshot-reaper.js").MaintainRetainedScreenshotsResult>;
|
|
104
|
+
verifyRigChange: (input: {
|
|
105
|
+
workspaceId: string;
|
|
106
|
+
changeId: string;
|
|
107
|
+
}) => Promise<{
|
|
108
|
+
id: string;
|
|
109
|
+
rigId: string;
|
|
110
|
+
baseVersionId: string | null;
|
|
111
|
+
kind: "definition_edit" | "setup_append";
|
|
112
|
+
payload: Record<string, unknown>;
|
|
113
|
+
status: "failed" | "merged" | "proposed" | "rejected" | "verifying";
|
|
114
|
+
proposedBy: string | null;
|
|
115
|
+
verification: {
|
|
116
|
+
[x: string]: unknown;
|
|
117
|
+
startedAt?: string | undefined;
|
|
118
|
+
finishedAt?: string | undefined;
|
|
119
|
+
log?: string | undefined;
|
|
120
|
+
checkResults?: {
|
|
121
|
+
name: string;
|
|
122
|
+
command: string;
|
|
123
|
+
exitCode: number | null;
|
|
124
|
+
output?: string | undefined;
|
|
125
|
+
}[] | undefined;
|
|
126
|
+
} | null;
|
|
127
|
+
resultVersionId: string | null;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
}>;
|
|
131
|
+
verifyRigVersion: (input: {
|
|
132
|
+
workspaceId: string;
|
|
133
|
+
versionId: string;
|
|
134
|
+
}) => Promise<{
|
|
135
|
+
versionId: string;
|
|
136
|
+
passed: boolean;
|
|
137
|
+
checkResults: {
|
|
138
|
+
exitCode: number | null;
|
|
139
|
+
output: string;
|
|
140
|
+
name: string;
|
|
141
|
+
command: string;
|
|
142
|
+
}[];
|
|
143
|
+
providerImage: {
|
|
144
|
+
backend: "blaxel" | "cloudflare" | "daytona" | "docker" | "e2b" | "local" | "modal" | "none" | "runloop" | "selfhosted" | "vercel";
|
|
145
|
+
provider: string;
|
|
146
|
+
status: "building" | "failed" | "ready" | "unsupported";
|
|
147
|
+
contentHash: string;
|
|
148
|
+
setupHash: string;
|
|
149
|
+
sourceImage: string | null;
|
|
150
|
+
buildRequestId: string;
|
|
151
|
+
imageId: string | null;
|
|
152
|
+
imageDigest: string | null;
|
|
153
|
+
artifactId: string | null;
|
|
154
|
+
providerBindingKeyHash: string | null;
|
|
155
|
+
coldBootValidation?: {
|
|
156
|
+
version: 1;
|
|
157
|
+
checkedAt: string;
|
|
158
|
+
} | undefined;
|
|
159
|
+
provenance: {
|
|
160
|
+
kind: "rig_verification";
|
|
161
|
+
targetKind: "change" | "version";
|
|
162
|
+
targetId: string;
|
|
163
|
+
};
|
|
164
|
+
startedAt: string;
|
|
165
|
+
finishedAt: string | null;
|
|
166
|
+
error: {
|
|
167
|
+
code: string;
|
|
168
|
+
message: string;
|
|
169
|
+
retryable: boolean;
|
|
170
|
+
} | null;
|
|
171
|
+
} | null;
|
|
172
|
+
}>;
|
|
173
|
+
prepareSandboxLeaseSweep: () => Promise<import("./activities/sandbox-lease.js").SandboxLeaseSweepPlan>;
|
|
174
|
+
drainSandboxLease: (input: import("./sandbox-reaper-contract.js").SandboxDrainActivityInput) => Promise<import("./activities/sandbox-lease.js").SandboxDrainActivityResult>;
|
|
175
|
+
maintainSandboxLeaseSweep: (input: import("./sandbox-reaper-contract.js").SandboxLeaseSweepMaintenanceInput) => Promise<import("./activities/sandbox-lease.js").SandboxLeaseSweepMaintenanceResult>;
|
|
176
|
+
reapSandboxLeases: () => Promise<import("./activities/sandbox-lease.js").ReapSandboxLeasesResult>;
|
|
177
|
+
dispatchScheduledTaskRun: (input: import("./activities.js").DispatchScheduledTaskRunInput) => Promise<import("./activities.js").DispatchScheduledTaskRunResult>;
|
|
178
|
+
failSessionAttempt: (input: import("./activities/types.js").FailSessionAttemptInput) => Promise<void>;
|
|
179
|
+
settleSessionInterruptions: (input: import("./activities/types.js").SettleSessionInterruptionsInput) => Promise<{
|
|
180
|
+
action: "paused" | "continue" | "stale";
|
|
181
|
+
}>;
|
|
182
|
+
persistSessionAttemptQuiescence: (input: import("./activities.js").PersistSessionAttemptQuiescenceInput) => Promise<void>;
|
|
183
|
+
reconcileSessionAttemptQuiescence: (input: import("./activities.js").ReconcileSessionAttemptQuiescenceInput) => Promise<import("./activities.js").ReconcileSessionAttemptQuiescenceResult>;
|
|
184
|
+
recoverDispatch: (input: import("./activities.js").RecoverDispatchInput) => Promise<import("./activities.js").RecoverDispatchResult>;
|
|
185
|
+
recoverEscapedMcpTimeout: (input: import("./activities.js").RecoverEscapedMcpTimeoutInput) => Promise<import("./activities.js").RecoverEscapedMcpTimeoutResult>;
|
|
186
|
+
peekSessionWork: (input: import("./activities/types.js").PeekSessionWorkInput) => Promise<import("@opengeni/db").SessionWorkPeek>;
|
|
187
|
+
expireSessionHumanInput: (input: import("./activities.js").ExpireSessionHumanInputInput) => Promise<import("./activities.js").ExpireSessionHumanInputResult>;
|
|
188
|
+
markSessionIdle: (input: import("./activities/types.js").MarkSessionIdleInput) => Promise<void>;
|
|
189
|
+
dispatchSessionWorkflowWakes(): Promise<import("./activities/workflow-wake.js").DispatchSessionWorkflowWakesResult>;
|
|
190
|
+
} | {
|
|
191
|
+
reconcileVideoGenerationOperation: (input: {
|
|
192
|
+
accountId: string;
|
|
193
|
+
workspaceId: string;
|
|
194
|
+
operationId: string;
|
|
195
|
+
}) => Promise<import("./activities.js").VideoGenerationReconcileResult>;
|
|
196
|
+
runAgentTurn: (input: import("./activities.js").RunAgentTurnInput) => Promise<import("./activities.js").RunAgentTurnResult>;
|
|
197
|
+
}>;
|
|
40
198
|
type WorkerWorkflowDefinition = {
|
|
41
199
|
workflowBundle: WorkflowBundleOption;
|
|
42
200
|
} | {
|
|
@@ -49,8 +207,12 @@ type WorkerWorkflowDefinition = {
|
|
|
49
207
|
* fails closed unless the build-generated sibling artifact is present.
|
|
50
208
|
*/
|
|
51
209
|
export declare function resolveOpenGeniWorkflowDefinition(moduleUrl?: string): WorkerWorkflowDefinition;
|
|
210
|
+
export declare function turnCancellationHeartbeatThrottleOptions(): {
|
|
211
|
+
readonly maxHeartbeatThrottleInterval: 500;
|
|
212
|
+
readonly defaultHeartbeatThrottleInterval: 500;
|
|
213
|
+
};
|
|
52
214
|
export declare function createOpenGeniWorker(options: WorkerOptions): Promise<{
|
|
53
|
-
worker:
|
|
215
|
+
worker: WorkerRunTarget;
|
|
54
216
|
connection: NativeConnection;
|
|
55
217
|
}>;
|
|
56
218
|
export declare function createWorkerWorkflowSignaler(settings: Settings, db: Database): Promise<{
|
|
@@ -58,6 +220,9 @@ export declare function createWorkerWorkflowSignaler(settings: Settings, db: Dat
|
|
|
58
220
|
signalSessionAttemptQuiesced: SignalSessionAttemptQuiesced;
|
|
59
221
|
inspectSessionAttemptActivity: InspectSessionAttemptActivity;
|
|
60
222
|
signalCodexCapacityWorkflow: SignalCodexCapacityWorkflow;
|
|
223
|
+
getTurnTaskQueueStats: () => Promise<TurnTaskQueueStats>;
|
|
224
|
+
startSandboxReaperWorkflow: StartSandboxReaperWorkflow;
|
|
225
|
+
startVideoGenerationWorkflow: StartVideoGenerationWorkflow;
|
|
61
226
|
check: () => Promise<void>;
|
|
62
227
|
close: () => Promise<void>;
|
|
63
228
|
}>;
|
|
@@ -67,13 +232,14 @@ export declare function createWorkerWorkflowSignaler(settings: Settings, db: Dat
|
|
|
67
232
|
* sandbox ownership off the activity performs bounded DB outbox repair and
|
|
68
233
|
* read-only observability projections; it never mutates or terminates sandbox leases.
|
|
69
234
|
*
|
|
70
|
-
* The Schedule fires sandboxReaperWorkflow on the
|
|
235
|
+
* The Schedule permanently fires sandboxReaperWorkflow on the legacy/base queue
|
|
71
236
|
* every settings.sandboxLeaseReaperPeriodMs (the SAME cadence the boot invariant
|
|
72
237
|
* `reaperPeriod < viewerHolderTTL` and `reaperPeriod + idleGrace < providerLifetime`
|
|
73
238
|
* validates in packages/config — wiring the schedule period to it). SKIP overlap means a slow
|
|
74
239
|
* sweep never overlaps itself. Idempotent: a duplicate scheduleId across the
|
|
75
|
-
* worker pool collides on ScheduleAlreadyRunning and
|
|
76
|
-
*
|
|
240
|
+
* worker pool collides on ScheduleAlreadyRunning and reconciles the same
|
|
241
|
+
* definition. New workers route onto the versioned lifecycle queue; old workers
|
|
242
|
+
* can still run the legacy action during rollout or a full binary rollback.
|
|
77
243
|
*
|
|
78
244
|
* Returns a `close()` for the dedicated client connection (separate from the
|
|
79
245
|
* worker's NativeConnection — the Schedule client is a @temporalio/client).
|
|
@@ -125,7 +291,7 @@ export type OpenGeniWorkerServiceOptions = Omit<WorkerOptions, "activityDependen
|
|
|
125
291
|
};
|
|
126
292
|
export type OpenGeniWorkerService = {
|
|
127
293
|
readonly role: OpenGeniWorkerRole;
|
|
128
|
-
readonly worker:
|
|
294
|
+
readonly worker: WorkerRunTarget;
|
|
129
295
|
readonly connection: NativeConnection;
|
|
130
296
|
state(): WorkerLifecycleState;
|
|
131
297
|
run(): Promise<void>;
|