@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,262 @@
|
|
|
1
|
+
import type { BoundedImmutableObjectWritePort, BoundedObjectReadPort } from "@opengeni/storage";
|
|
2
|
+
/**
|
|
3
|
+
* The database role allowed to poll the cross-tenant materialization queue.
|
|
4
|
+
* It owns no table privileges; @opengeni/db exposes only fenced SECURITY
|
|
5
|
+
* DEFINER functions to this role.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EDITABLE_ARTIFACT_MATERIALIZER_DATABASE_ROLE: "opengeni_artifact_materializer";
|
|
8
|
+
export declare const EDITABLE_ARTIFACT_MATERIALIZER_MAX_SOURCE_BYTES: number;
|
|
9
|
+
export declare const EDITABLE_ARTIFACT_MATERIALIZER_MAX_OUTPUT_BYTES: number;
|
|
10
|
+
export declare const EDITABLE_ARTIFACT_MATERIALIZER_MAX_OPTIONS_BYTES: number;
|
|
11
|
+
export declare const EDITABLE_ARTIFACT_MATERIALIZER_MAX_ATTEMPTS = 20;
|
|
12
|
+
export type EditableArtifactMaterializationFormat = "xlsx" | "pptx" | "docx" | "pdf" | "png" | "webp";
|
|
13
|
+
export type EditableArtifactMaterializationModality = "spreadsheet" | "presentation" | "document";
|
|
14
|
+
export type EditableArtifactMaterializationMimeType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/pdf" | "image/png" | "image/webp";
|
|
15
|
+
export type EditableArtifactMaterializationScope = Readonly<{
|
|
16
|
+
accountId: string;
|
|
17
|
+
workspaceId: string;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* One immutable, self-contained input manifest returned by the global claim
|
|
21
|
+
* function. The source snapshot covers exactly targetHeadSequence. There is
|
|
22
|
+
* deliberately no "current" lookup after claim and no unbounded DB tail read.
|
|
23
|
+
*/
|
|
24
|
+
export type ClaimedEditableArtifactMaterialization = Readonly<{
|
|
25
|
+
scope: EditableArtifactMaterializationScope;
|
|
26
|
+
artifactId: string;
|
|
27
|
+
jobId: string;
|
|
28
|
+
versionId: string | null;
|
|
29
|
+
modality: EditableArtifactMaterializationModality;
|
|
30
|
+
inputSnapshotId: string;
|
|
31
|
+
targetHeadSequence: number;
|
|
32
|
+
stateHash: string;
|
|
33
|
+
sourceObjectReference: string;
|
|
34
|
+
sourceByteSize: number;
|
|
35
|
+
sourceContentHash: string;
|
|
36
|
+
sourceMimeType: string;
|
|
37
|
+
modelSchemaVersion: number;
|
|
38
|
+
operationProtocolVersion: number;
|
|
39
|
+
snapshotProtocolVersion: number;
|
|
40
|
+
format: EditableArtifactMaterializationFormat;
|
|
41
|
+
codecId: string;
|
|
42
|
+
/** Canonical UTF-8 JSON, bounded and hashed by optionsHash. */
|
|
43
|
+
normalizedOptions: string;
|
|
44
|
+
optionsHash: string;
|
|
45
|
+
codecVersion: string;
|
|
46
|
+
kernelVersion: string;
|
|
47
|
+
fontRegistryHash: string;
|
|
48
|
+
policyHash: string;
|
|
49
|
+
attemptCount: number;
|
|
50
|
+
leaseOwner: string;
|
|
51
|
+
leaseExpiresAt: string;
|
|
52
|
+
}>;
|
|
53
|
+
export type EditableArtifactMaterializationLease = Readonly<{
|
|
54
|
+
scope: EditableArtifactMaterializationScope;
|
|
55
|
+
artifactId: string;
|
|
56
|
+
jobId: string;
|
|
57
|
+
owner: string;
|
|
58
|
+
attemptCount: number;
|
|
59
|
+
}>;
|
|
60
|
+
export interface EditableArtifactMaterializationStorePort {
|
|
61
|
+
claim(input: {
|
|
62
|
+
owner: string;
|
|
63
|
+
leaseDurationMs: number;
|
|
64
|
+
limit: number;
|
|
65
|
+
}): Promise<readonly ClaimedEditableArtifactMaterialization[]>;
|
|
66
|
+
renew(input: EditableArtifactMaterializationLease & {
|
|
67
|
+
leaseDurationMs: number;
|
|
68
|
+
}): Promise<string>;
|
|
69
|
+
succeed(input: EditableArtifactMaterializationLease & {
|
|
70
|
+
resultId: string;
|
|
71
|
+
blobRefId: string;
|
|
72
|
+
objectReference: string;
|
|
73
|
+
byteSize: number;
|
|
74
|
+
contentHash: string;
|
|
75
|
+
mimeType: EditableArtifactMaterializationMimeType;
|
|
76
|
+
verifiedAt: string;
|
|
77
|
+
}): Promise<unknown>;
|
|
78
|
+
fail(input: EditableArtifactMaterializationLease & {
|
|
79
|
+
errorCode: string;
|
|
80
|
+
}): Promise<unknown>;
|
|
81
|
+
}
|
|
82
|
+
export type NativeEditableArtifactMaterializerIdentity = Readonly<{
|
|
83
|
+
kind: "native";
|
|
84
|
+
/** Parent-owned launcher facts, never copied from the codec child. */
|
|
85
|
+
isolation: "subprocess";
|
|
86
|
+
network: "denied" | "host";
|
|
87
|
+
officeAutomation: false;
|
|
88
|
+
processProtocolVersion: 1;
|
|
89
|
+
sandboxEnforced: boolean;
|
|
90
|
+
memoryLimitBytes: number;
|
|
91
|
+
cpuTimeLimitMs: number;
|
|
92
|
+
fileDescriptorLimit: number;
|
|
93
|
+
processLimit: number;
|
|
94
|
+
fileSizeLimitBytes: number;
|
|
95
|
+
maxOutputBytes: number;
|
|
96
|
+
kernelVersion: string;
|
|
97
|
+
codecVersions: Readonly<Record<string, string>>;
|
|
98
|
+
fontRegistryHash: string;
|
|
99
|
+
policyHash: string;
|
|
100
|
+
runtimeTarget: string;
|
|
101
|
+
supportedModelSchemaVersions: readonly number[];
|
|
102
|
+
supportedOperationProtocolVersions: readonly number[];
|
|
103
|
+
supportedSnapshotProtocolVersions: readonly number[];
|
|
104
|
+
}>;
|
|
105
|
+
export type NativeEditableArtifactMaterializationResult = Readonly<{
|
|
106
|
+
headSequence: number;
|
|
107
|
+
stateHash: string;
|
|
108
|
+
format: EditableArtifactMaterializationFormat;
|
|
109
|
+
mimeType: EditableArtifactMaterializationMimeType;
|
|
110
|
+
codecId: string;
|
|
111
|
+
codecVersion: string;
|
|
112
|
+
kernelVersion: string;
|
|
113
|
+
fontRegistryHash: string;
|
|
114
|
+
policyHash: string;
|
|
115
|
+
/** Optional precomputed facts; the independent writer/verifier still checks. */
|
|
116
|
+
byteSize?: number;
|
|
117
|
+
contentHash?: string;
|
|
118
|
+
/** Canonical semantics projected by the authoritative native source kernel. */
|
|
119
|
+
semanticHash: string;
|
|
120
|
+
chunks: AsyncIterable<Uint8Array>;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Production implementations must be a native Rust subprocess adapter. The
|
|
124
|
+
* adapter consumes a version-pinned stream, reconstructs and validates the
|
|
125
|
+
* canonical snapshot, and exports without Office/COM or network access.
|
|
126
|
+
*/
|
|
127
|
+
export interface NativeEditableArtifactMaterializerPort {
|
|
128
|
+
readonly identity: NativeEditableArtifactMaterializerIdentity;
|
|
129
|
+
materialize(input: {
|
|
130
|
+
job: ClaimedEditableArtifactMaterialization;
|
|
131
|
+
normalizedOptions: Uint8Array;
|
|
132
|
+
snapshot: AsyncIterable<Uint8Array>;
|
|
133
|
+
signal: AbortSignal;
|
|
134
|
+
}): Promise<NativeEditableArtifactMaterializationResult>;
|
|
135
|
+
}
|
|
136
|
+
export type VerifiedEditableArtifactMaterialization = Readonly<{
|
|
137
|
+
objectReference: string;
|
|
138
|
+
byteSize: number;
|
|
139
|
+
contentHash: string;
|
|
140
|
+
mimeType: EditableArtifactMaterializationMimeType;
|
|
141
|
+
format: EditableArtifactMaterializationFormat;
|
|
142
|
+
codecId: string;
|
|
143
|
+
codecVersion: string;
|
|
144
|
+
}>;
|
|
145
|
+
/** Independent reader/parser. It must not reuse the exporting codec process. */
|
|
146
|
+
export interface EditableArtifactMaterializationVerifierPort {
|
|
147
|
+
verify(input: {
|
|
148
|
+
objectReference: string;
|
|
149
|
+
expectedByteSize: number;
|
|
150
|
+
expectedContentHash: string;
|
|
151
|
+
expectedMimeType: EditableArtifactMaterializationMimeType;
|
|
152
|
+
format: EditableArtifactMaterializationFormat;
|
|
153
|
+
codecId: string;
|
|
154
|
+
codecVersion: string;
|
|
155
|
+
expectedSemanticHash: string;
|
|
156
|
+
maxBytes: number;
|
|
157
|
+
signal: AbortSignal;
|
|
158
|
+
}): Promise<VerifiedEditableArtifactMaterialization>;
|
|
159
|
+
}
|
|
160
|
+
export interface EditableArtifactMaterializationSemanticVerifierPort {
|
|
161
|
+
verify(input: {
|
|
162
|
+
format: EditableArtifactMaterializationFormat;
|
|
163
|
+
codecId: string;
|
|
164
|
+
codecVersion: string;
|
|
165
|
+
expectedSemanticHash: string;
|
|
166
|
+
byteSize: number;
|
|
167
|
+
chunks: AsyncIterable<Uint8Array>;
|
|
168
|
+
signal: AbortSignal;
|
|
169
|
+
}): Promise<void>;
|
|
170
|
+
}
|
|
171
|
+
export interface EditableArtifactMaterializerSchedulerPort {
|
|
172
|
+
sleep(milliseconds: number, signal: AbortSignal): Promise<void>;
|
|
173
|
+
}
|
|
174
|
+
export interface EditableArtifactMaterializerClockPort {
|
|
175
|
+
now(): Date;
|
|
176
|
+
}
|
|
177
|
+
export interface EditableArtifactMaterializerLoggerPort {
|
|
178
|
+
warn(message: string, attributes: Readonly<Record<string, unknown>>): void;
|
|
179
|
+
}
|
|
180
|
+
export type EditableArtifactMaterializerMetricOutcome = "claimed" | "succeeded" | "dead_lettered" | "retry_deferred" | "lease_lost" | "cancelled" | "claim_failed";
|
|
181
|
+
export interface EditableArtifactMaterializerMetricsPort {
|
|
182
|
+
increment(outcome: EditableArtifactMaterializerMetricOutcome, count?: number): void;
|
|
183
|
+
}
|
|
184
|
+
export type EditableArtifactMaterializerOptions = Readonly<{
|
|
185
|
+
owner: string;
|
|
186
|
+
batchSize?: number;
|
|
187
|
+
concurrency?: number;
|
|
188
|
+
leaseDurationMs?: number;
|
|
189
|
+
leaseRenewIntervalMs?: number;
|
|
190
|
+
pollIntervalMs?: number;
|
|
191
|
+
claimBackoffMs?: number;
|
|
192
|
+
maxAttempts?: number;
|
|
193
|
+
maxSourceBytes?: number;
|
|
194
|
+
maxOutputBytes?: number;
|
|
195
|
+
}>;
|
|
196
|
+
export type EditableArtifactMaterializerDependencies = Readonly<{
|
|
197
|
+
store: EditableArtifactMaterializationStorePort;
|
|
198
|
+
sourceReader: BoundedObjectReadPort;
|
|
199
|
+
outputWriter: BoundedImmutableObjectWritePort;
|
|
200
|
+
outputVerifier: EditableArtifactMaterializationVerifierPort;
|
|
201
|
+
kernel: NativeEditableArtifactMaterializerPort;
|
|
202
|
+
scheduler: EditableArtifactMaterializerSchedulerPort;
|
|
203
|
+
clock: EditableArtifactMaterializerClockPort;
|
|
204
|
+
logger?: EditableArtifactMaterializerLoggerPort;
|
|
205
|
+
metrics?: EditableArtifactMaterializerMetricsPort;
|
|
206
|
+
}>;
|
|
207
|
+
export type EditableArtifactMaterializerPassSummary = Readonly<{
|
|
208
|
+
claimed: number;
|
|
209
|
+
succeeded: number;
|
|
210
|
+
deadLettered: number;
|
|
211
|
+
retryDeferred: number;
|
|
212
|
+
leaseLost: number;
|
|
213
|
+
cancelled: number;
|
|
214
|
+
claimFailed: boolean;
|
|
215
|
+
}>;
|
|
216
|
+
/** Closed, diagnostics-free terminal failure codes persisted in Postgres. */
|
|
217
|
+
export type EditableArtifactMaterializerDeadLetterCode = "invalid_job_manifest" | "source_identity_mismatch" | "source_size_limit" | "kernel_incompatible" | "kernel_result_mismatch" | "unsupported_semantics" | "output_size_limit" | "output_verification_failed" | "retry_exhausted";
|
|
218
|
+
export type EditableArtifactMaterializerFailureDiagnostic = Readonly<{
|
|
219
|
+
stage: "source_reader" | "native";
|
|
220
|
+
subcode: "open" | "content_type" | "stream_identity" | "revalidate" | "input_framing" | "snapshot_open" | "state_mismatch";
|
|
221
|
+
}>;
|
|
222
|
+
export declare class EditableArtifactMaterializerPermanentError extends Error {
|
|
223
|
+
readonly code: EditableArtifactMaterializerDeadLetterCode;
|
|
224
|
+
readonly diagnostic?: EditableArtifactMaterializerFailureDiagnostic | undefined;
|
|
225
|
+
constructor(code: EditableArtifactMaterializerDeadLetterCode, diagnostic?: EditableArtifactMaterializerFailureDiagnostic | undefined);
|
|
226
|
+
}
|
|
227
|
+
export declare class EditableArtifactMaterializerLeaseLostError extends Error {
|
|
228
|
+
constructor();
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* At-least-once materialization loop. Immutable content-addressed output makes
|
|
232
|
+
* recomputation safe; owner + attemptCount fences make DB settlement exact.
|
|
233
|
+
*/
|
|
234
|
+
export declare class EditableArtifactMaterializer {
|
|
235
|
+
#private;
|
|
236
|
+
private readonly dependencies;
|
|
237
|
+
constructor(dependencies: EditableArtifactMaterializerDependencies, options: EditableArtifactMaterializerOptions, securityPolicy?: Readonly<{
|
|
238
|
+
allowUnsandboxedDevelopment?: boolean;
|
|
239
|
+
}>);
|
|
240
|
+
run(signal: AbortSignal): Promise<void>;
|
|
241
|
+
/** Concurrent triggers share one bounded claim pass. */
|
|
242
|
+
dispatchOnce(signal?: AbortSignal): Promise<EditableArtifactMaterializerPassSummary>;
|
|
243
|
+
drain(): Promise<void>;
|
|
244
|
+
}
|
|
245
|
+
export type ConfiguredEditableArtifactMaterializerInput = Readonly<{
|
|
246
|
+
enabled: boolean;
|
|
247
|
+
databaseRole: string | null | undefined;
|
|
248
|
+
objectStorageConfigured: boolean;
|
|
249
|
+
dependencies?: Partial<EditableArtifactMaterializerDependencies>;
|
|
250
|
+
options?: EditableArtifactMaterializerOptions;
|
|
251
|
+
/** Explicit local-development exception; production callers must omit it. */
|
|
252
|
+
allowUnsandboxedDevelopment?: boolean;
|
|
253
|
+
}>;
|
|
254
|
+
/**
|
|
255
|
+
* Production gate. Disabled is the default. Once enabled, every privileged
|
|
256
|
+
* dependency and the dedicated database role are mandatory—there is no
|
|
257
|
+
* reference-kernel, mutable-storage, or tenant-role fallback.
|
|
258
|
+
*/
|
|
259
|
+
export declare function createConfiguredEditableArtifactMaterializer(input: ConfiguredEditableArtifactMaterializerInput): EditableArtifactMaterializer | null;
|
|
260
|
+
export declare const systemEditableArtifactMaterializerScheduler: EditableArtifactMaterializerSchedulerPort;
|
|
261
|
+
export declare const systemEditableArtifactMaterializerClock: EditableArtifactMaterializerClockPort;
|
|
262
|
+
export declare function mimeTypeForFormat(format: EditableArtifactMaterializationFormat): EditableArtifactMaterializationMimeType;
|
|
@@ -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/host-export.js
CHANGED
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>;
|