@opengeni/worker-bundle 2.3.1 → 2.3.2-canary.37090756480001
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/claude-usage-observer.d.ts +30 -6
- package/dist/activities/agent-turn/credential-leases.d.ts +5 -32
- package/dist/activities/agent-turn/errors.d.ts +3 -0
- package/dist/activities/agent-turn/finalization-monitor.d.ts +1 -1
- package/dist/activities/agent-turn/finalization.d.ts +2 -0
- package/dist/activities/agent-turn/quiescence.d.ts +3 -4
- package/dist/activities/agent-turn/subscription-lease.d.ts +38 -0
- package/dist/activities/agent-turn/turn-context.d.ts +1 -1
- package/dist/activities/model-call-fact-reconciler.d.ts +34 -0
- package/dist/activities/session-state.d.ts +2 -2
- package/dist/activities/types.d.ts +7 -0
- package/dist/{activities-control-3HAH4FMG.js → activities-control-3BY4IJKL.js} +166 -35
- package/dist/activities-control-3BY4IJKL.js.map +1 -0
- package/dist/activities-control.d.ts +6 -4
- package/dist/{activities-turn-KU25J3VQ.js → activities-turn-TTNAVGKN.js} +263 -308
- package/dist/activities-turn-TTNAVGKN.js.map +1 -0
- package/dist/activities.d.ts +6 -4
- package/dist/{chunk-3K3ULWEE.js → chunk-PA7Z55P4.js} +242 -17
- package/dist/chunk-PA7Z55P4.js.map +1 -0
- package/dist/{chunk-YG27NEMX.js → chunk-YOI3Z3GF.js} +9 -1
- package/dist/chunk-YOI3Z3GF.js.map +1 -0
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +82 -16
- package/dist/index.js.map +1 -1
- package/dist/observability-metrics.d.ts +6 -1
- package/dist/sandbox-resume.d.ts +3 -0
- package/dist/session-event-fanout.d.ts +6 -0
- package/dist/worker-service-lifecycle.d.ts +12 -0
- package/dist/workflow-bundle.js +3 -2
- package/package.json +21 -21
- package/src/activities/agent-turn/claim.ts +13 -0
- package/src/activities/agent-turn/claude-usage-observer.ts +99 -8
- package/src/activities/agent-turn/credential-leases.ts +86 -213
- package/src/activities/agent-turn/errors.ts +61 -1
- package/src/activities/agent-turn/failure-settlement.ts +59 -5
- package/src/activities/agent-turn/finalization-monitor.ts +3 -4
- package/src/activities/agent-turn/finalization.ts +8 -3
- package/src/activities/agent-turn/quiescence.ts +3 -4
- package/src/activities/agent-turn/run.ts +24 -20
- package/src/activities/agent-turn/sandbox-establish.ts +2 -0
- package/src/activities/agent-turn/sandbox-runtime.ts +5 -1
- package/src/activities/agent-turn/skill-selection.ts +2 -0
- package/src/activities/agent-turn/subscription-lease.ts +115 -0
- package/src/activities/agent-turn/turn-context.ts +1 -4
- package/src/activities/codex-rotation.ts +2 -12
- package/src/activities/model-call-fact-reconciler.ts +112 -0
- package/src/activities/sandbox-lease.ts +59 -8
- package/src/activities/session-state.ts +29 -4
- package/src/activities/types.ts +7 -0
- package/src/activities-control.ts +2 -0
- package/src/activities-turn.ts +5 -0
- package/src/activities.ts +7 -0
- package/src/http.ts +4 -2
- package/src/index.ts +39 -9
- package/src/observability-metrics.ts +27 -0
- package/src/sandbox-resume.ts +9 -0
- package/src/sandbox-routing.ts +77 -0
- package/src/session-event-fanout.ts +23 -0
- package/src/worker-service-lifecycle.ts +53 -0
- package/src/workflows/file-upload-reaper.ts +2 -0
- package/src/workflows/session.ts +6 -1
- package/dist/activities-control-3HAH4FMG.js.map +0 -1
- package/dist/activities-turn-KU25J3VQ.js.map +0 -1
- package/dist/chunk-3K3ULWEE.js.map +0 -1
- package/dist/chunk-YG27NEMX.js.map +0 -1
|
@@ -216,6 +216,11 @@ export declare function recordSandboxCheckpointArtifactGauges(observability: Obs
|
|
|
216
216
|
export type SandboxCheckpointArtifactOutcome = "legacy_adopted" | "claimed" | "deleted" | "delete_failed" | "tombstone_pruned";
|
|
217
217
|
export declare function recordSandboxCheckpointArtifactOutcome(observability: Observability, outcome: SandboxCheckpointArtifactOutcome, count?: number): void;
|
|
218
218
|
export declare function recordSandboxDeadlineRotationsRequested(observability: Observability, count: number): void;
|
|
219
|
+
/** Fixed outcomes of legacy retained-command containment: per-candidate
|
|
220
|
+
* enrollment inspection, then the enrolled drain's exact cold commit. */
|
|
221
|
+
export declare const SANDBOX_COMMAND_CONTAINMENT_OUTCOMES: readonly ["idle_enrolled", "deadline_enrolled", "resumed_enrolled", "not_eligible", "inspection_failed", "contained", "provider_missing"];
|
|
222
|
+
export type SandboxCommandContainmentOutcome = (typeof SANDBOX_COMMAND_CONTAINMENT_OUTCOMES)[number];
|
|
223
|
+
export declare function recordSandboxCommandContainment(observability: Observability, outcome: SandboxCommandContainmentOutcome): void;
|
|
219
224
|
/** Only call after the exact draining->cold commit reports wentCold. The
|
|
220
225
|
* backend is validated against the closed contract so provider IDs and other
|
|
221
226
|
* per-sandbox values can never become metric labels. */
|
|
@@ -256,7 +261,7 @@ export declare function recordExpiredDrainingSandboxLeaseGauges(observability: O
|
|
|
256
261
|
ageBucket: string;
|
|
257
262
|
count: number;
|
|
258
263
|
}>): void;
|
|
259
|
-
export declare const RETAINED_PROCESS_RECONCILIATION_OUTCOMES: readonly ["claim_failed", "proof_exited", "proof_lost", "proof_checkpoint_failed", "settled_exited", "settled_lost", "settlement_failed", "identity_mismatch", "resume_state_missing", "backend_unsupported", "provider_running", "provider_unknown", "provider_timeout", "provider_error", "provider_binding_missing", "provider_binding_mismatch", "provider_binding_adopted", "process_observation_unavailable", "quarantined_process_observation_unavailable", "quarantined_binding_missing", "quarantined_binding_mismatch", "defer_failed"];
|
|
264
|
+
export declare const RETAINED_PROCESS_RECONCILIATION_OUTCOMES: readonly ["claim_failed", "background_recovered", "proof_exited", "proof_lost", "proof_checkpoint_failed", "settled_exited", "settled_lost", "settlement_failed", "identity_mismatch", "resume_state_missing", "backend_unsupported", "provider_running", "provider_unknown", "provider_timeout", "provider_error", "provider_binding_missing", "provider_binding_mismatch", "provider_binding_adopted", "process_observation_unavailable", "quarantined_process_observation_unavailable", "quarantined_binding_missing", "quarantined_binding_mismatch", "defer_failed"];
|
|
260
265
|
export type RetainedProcessReconciliationOutcome = (typeof RETAINED_PROCESS_RECONCILIATION_OUTCOMES)[number];
|
|
261
266
|
export declare function recordRetainedProcessReconciliation(observability: Observability, outcome: RetainedProcessReconciliationOutcome): void;
|
|
262
267
|
export declare function recordCreditMicros(observability: Observability | undefined, kind: CreditMicrosKind, amountMicros: number): void;
|
package/dist/sandbox-resume.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventBus } from "@opengeni/events";
|
|
1
2
|
import { type Settings } from "@opengeni/config";
|
|
2
3
|
import { readLease, reinstateTurnLeaseHolder, SandboxLeaseSupersededError, type Database, type LeaseHolderKind } from "@opengeni/db";
|
|
3
4
|
import { establishSandboxSessionFromEnvelope, type EstablishedSandboxSession, type RuntimeMetricsHooks } from "@opengeni/runtime";
|
|
@@ -60,6 +61,8 @@ export type SandboxResumeServices = {
|
|
|
60
61
|
* call. Absent, the call gets its own single replacement.
|
|
61
62
|
*/
|
|
62
63
|
freshSandboxReadinessReplacementBudget?: FreshSandboxReadinessReplacementBudget;
|
|
64
|
+
/** Live fanout for background commands a provider loss settled. */
|
|
65
|
+
bus?: EventBus | null;
|
|
63
66
|
/** Called only by the observer that wins the exact warm->cold loss CAS. */
|
|
64
67
|
onSandboxLost?: (input: {
|
|
65
68
|
sandboxGroupId: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SessionEvent } from "@opengeni/contracts";
|
|
2
|
+
import type { EventBus } from "@opengeni/events";
|
|
3
|
+
/** Best-effort live fanout of events that are already durable, grouped by
|
|
4
|
+
* session. Durable catch-up remains the source of truth, so failures are only
|
|
5
|
+
* reported. */
|
|
6
|
+
export declare function publishDurableSessionEvents(bus: EventBus | null | undefined, workspaceId: string, events: readonly SessionEvent[] | undefined, onError?: (error: unknown) => void): Promise<void>;
|
|
@@ -22,3 +22,15 @@ export declare function createWorkerServiceLifecycle(input: {
|
|
|
22
22
|
closeOwnedResources: () => Promise<void>;
|
|
23
23
|
onReady?: () => void;
|
|
24
24
|
}): WorkerServiceLifecycle;
|
|
25
|
+
/** A cleanup stall first drains peers through WORKER_SHUTDOWN. The standalone
|
|
26
|
+
* process owns the final exit, because Temporal cannot kill JavaScript writers.
|
|
27
|
+
* Embedded hosts may supply their own termination policy at this same edge. */
|
|
28
|
+
export declare function createWorkerCleanupContainment(input: {
|
|
29
|
+
drain: () => boolean;
|
|
30
|
+
terminate?: () => void;
|
|
31
|
+
observability: Observability;
|
|
32
|
+
timeoutMs?: number;
|
|
33
|
+
}): {
|
|
34
|
+
request(): void;
|
|
35
|
+
finished(): void;
|
|
36
|
+
};
|