@opengeni/worker-bundle 0.24.2-canary.0 → 0.26.0-canary.0
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/agent-build.d.ts +3 -10
- package/dist/activities/agent-turn/claim.d.ts +7 -0
- package/dist/activities/agent-turn/credential-leases.d.ts +8 -0
- package/dist/activities/agent-turn/errors.d.ts +1 -1
- package/dist/activities/agent-turn/failure-settlement.d.ts +43 -1
- package/dist/activities/agent-turn/quiescence.d.ts +9 -6
- package/dist/activities/agent-turn/tool-environment.d.ts +2 -13
- package/dist/activities/agent-turn/tool-policy.d.ts +4 -0
- package/dist/activities/agent-turn/turn-context.d.ts +9 -1
- package/dist/activities/codemode-dispatcher.d.ts +10 -1
- package/dist/activities/codex-capacity.d.ts +32 -3
- package/dist/activities/codex-fleet-shadow.d.ts +1 -1
- package/dist/activities/codex-image-generation.d.ts +1 -1
- package/dist/activities/codex-rotation.d.ts +8 -67
- package/dist/activities/goals.d.ts +1 -1
- package/dist/activities/google-drive-publication.d.ts +2 -13
- package/dist/activities/image-generation-operation.d.ts +13 -4
- package/dist/activities/session-state.d.ts +4 -2
- package/dist/activities/types.d.ts +11 -1
- package/dist/{activities-control-ZWH7J4KZ.js → activities-control-CTEMLTHG.js} +45 -18
- package/dist/activities-control-CTEMLTHG.js.map +1 -0
- package/dist/activities-control.d.ts +2 -0
- package/dist/{activities-turn-I4OPLQLS.js → activities-turn-S5IU347A.js} +960 -815
- package/dist/activities-turn-S5IU347A.js.map +1 -0
- package/dist/activities.d.ts +2 -0
- package/dist/{chunk-65JEWP2Q.js → chunk-D4ZEFOYH.js} +1 -1
- package/dist/chunk-D4ZEFOYH.js.map +1 -0
- package/dist/{chunk-RQNH6CGR.js → chunk-TAUE3GYT.js} +117 -95
- package/dist/chunk-TAUE3GYT.js.map +1 -0
- package/dist/github-rest-mcp.d.ts +0 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/observability-metrics.d.ts +1 -1
- package/dist/workflow-bundle.js +71 -8
- package/dist/workflows/activities.d.ts +1 -1
- package/dist/workflows/session.d.ts +3 -0
- package/package.json +17 -17
- package/src/activities/agent-turn/agent-build.ts +20 -26
- package/src/activities/agent-turn/claim.ts +26 -1
- package/src/activities/agent-turn/codex-capacity.ts +311 -234
- package/src/activities/agent-turn/credential-leases.ts +36 -0
- package/src/activities/agent-turn/errors.ts +29 -1
- package/src/activities/agent-turn/failure-settlement.ts +451 -323
- package/src/activities/agent-turn/quiescence.ts +21 -15
- package/src/activities/agent-turn/run.ts +18 -5
- package/src/activities/agent-turn/stream-attempt.ts +15 -1
- package/src/activities/agent-turn/tool-environment.ts +30 -32
- package/src/activities/agent-turn/tool-policy.ts +14 -8
- package/src/activities/agent-turn/turn-context.ts +13 -0
- package/src/activities/codemode-dispatcher.ts +235 -59
- package/src/activities/codex-capacity.ts +89 -10
- package/src/activities/codex-fleet-shadow.ts +8 -1
- package/src/activities/codex-image-generation.ts +19 -2
- package/src/activities/codex-rotation.ts +45 -142
- package/src/activities/goals.ts +9 -9
- package/src/activities/google-drive-publication.ts +4 -81
- package/src/activities/image-generation-operation.ts +28 -3
- package/src/activities/sandbox-lease.ts +29 -12
- package/src/activities/session-state.ts +17 -0
- package/src/activities/types.ts +16 -8
- package/src/activities.ts +1 -0
- package/src/github-rest-mcp.ts +0 -82
- package/src/observability-metrics.ts +4 -0
- package/src/sandbox-routing.ts +71 -16
- package/src/workflows/activities.ts +1 -0
- package/src/workflows/session.ts +85 -7
- package/dist/activities/api-integrations.d.ts +0 -21
- package/dist/activities-control-ZWH7J4KZ.js.map +0 -1
- package/dist/activities-turn-I4OPLQLS.js.map +0 -1
- package/dist/chunk-65JEWP2Q.js.map +0 -1
- package/dist/chunk-RQNH6CGR.js.map +0 -1
- package/src/activities/api-integrations.ts +0 -151
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
scheduledUserMessagePayload,
|
|
33
33
|
withFirstPartyTools,
|
|
34
34
|
workflowIdForSession
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-TAUE3GYT.js";
|
|
36
36
|
import {
|
|
37
37
|
inspectOpenSandboxKubernetesInventory,
|
|
38
38
|
recordCreditBalanceGauges,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
recordTurnsQueuedGauge,
|
|
53
53
|
recordWorkerDeathRecoveryMetrics,
|
|
54
54
|
runtimeMetricsHooksForObservability
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-D4ZEFOYH.js";
|
|
56
56
|
|
|
57
57
|
// src/activities/browser-state-artifact-reaper.ts
|
|
58
58
|
import {
|
|
@@ -5225,6 +5225,7 @@ import {
|
|
|
5225
5225
|
workspaceArchiveCaptureDeadlineElapsed,
|
|
5226
5226
|
retainedProcessReconciliationProof,
|
|
5227
5227
|
retainedProcessSettlementIdentity,
|
|
5228
|
+
settleClaimedConnectedMachineBackgroundCommand,
|
|
5228
5229
|
settleSandboxCheckpointArtifactGc,
|
|
5229
5230
|
rlsContextForWorkspace as rlsContextForWorkspace2,
|
|
5230
5231
|
settleRetainedProcess
|
|
@@ -5232,9 +5233,7 @@ import {
|
|
|
5232
5233
|
import {
|
|
5233
5234
|
claimConnectedMachineSessionBackgroundCommands,
|
|
5234
5235
|
deferConnectedMachineBackgroundCommandReconciliation,
|
|
5235
|
-
recordConnectedMachineBackgroundCommandProof
|
|
5236
|
-
settleClaimedConnectedMachineBackgroundCommand,
|
|
5237
|
-
settleSessionBackgroundCommandForRetainedProcess
|
|
5236
|
+
recordConnectedMachineBackgroundCommandProof
|
|
5238
5237
|
} from "@opengeni/db/session-background-commands";
|
|
5239
5238
|
import { sandboxWarmRateMicrosPerSecond } from "@opengeni/config";
|
|
5240
5239
|
import { sandboxLeaseTelemetryKey } from "@opengeni/observability";
|
|
@@ -5570,7 +5569,8 @@ function createSandboxLeaseActivities(services, options = {}) {
|
|
|
5570
5569
|
settings,
|
|
5571
5570
|
observability,
|
|
5572
5571
|
probeRetainedProcess,
|
|
5573
|
-
options.inspectHistoricalModalSandbox ?? inspectModalSandboxLifecycle
|
|
5572
|
+
options.inspectHistoricalModalSandbox ?? inspectModalSandboxLifecycle,
|
|
5573
|
+
service.bus
|
|
5574
5574
|
);
|
|
5575
5575
|
try {
|
|
5576
5576
|
modalOrphansTerminated = await sweepModalOrphans(settings, db, observability);
|
|
@@ -5876,9 +5876,20 @@ async function reconcileConnectedMachineBackgroundCommands(db, settings, observa
|
|
|
5876
5876
|
}
|
|
5877
5877
|
}
|
|
5878
5878
|
try {
|
|
5879
|
-
|
|
5879
|
+
const settlement = await settleClaimedConnectedMachineBackgroundCommand(db, { claim });
|
|
5880
|
+
if (!settlement.settled) {
|
|
5880
5881
|
throw new Error("Connected command settlement lost its exact claim or proof");
|
|
5881
5882
|
}
|
|
5883
|
+
if (settlement.events.length > 0) {
|
|
5884
|
+
try {
|
|
5885
|
+
await bus.publish(claim.workspaceId, claim.sessionId, settlement.events);
|
|
5886
|
+
} catch (error) {
|
|
5887
|
+
observability.warn("sandbox reaper: connected-command event fanout failed", {
|
|
5888
|
+
commandId: claim.commandId,
|
|
5889
|
+
error: error instanceof Error ? error.message : String(error)
|
|
5890
|
+
});
|
|
5891
|
+
}
|
|
5892
|
+
}
|
|
5882
5893
|
recordConnectedCommandReconciliation(observability, `settled_${proof.outcome}`);
|
|
5883
5894
|
} catch (error) {
|
|
5884
5895
|
recordConnectedCommandReconciliation(observability, "settlement_failed");
|
|
@@ -5957,7 +5968,7 @@ async function deferConnectedCommandClaim(db, settings, observability, claim, ou
|
|
|
5957
5968
|
});
|
|
5958
5969
|
}
|
|
5959
5970
|
}
|
|
5960
|
-
async function reconcileTerminalRetainedProcesses(db, settings, observability, probe, inspectHistoricalModalSandbox) {
|
|
5971
|
+
async function reconcileTerminalRetainedProcesses(db, settings, observability, probe, inspectHistoricalModalSandbox, bus) {
|
|
5961
5972
|
const claimId = crypto.randomUUID();
|
|
5962
5973
|
let claims;
|
|
5963
5974
|
try {
|
|
@@ -6147,15 +6158,20 @@ async function reconcileTerminalRetainedProcesses(db, settings, observability, p
|
|
|
6147
6158
|
if (settlement.process.state === "active") {
|
|
6148
6159
|
throw new Error("Retained-process reconciliation returned an active durable process");
|
|
6149
6160
|
}
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6161
|
+
if (settlement.backgroundCommandEvents.length > 0) {
|
|
6162
|
+
try {
|
|
6163
|
+
await bus.publish(
|
|
6164
|
+
process.workspaceId,
|
|
6165
|
+
process.sessionId,
|
|
6166
|
+
settlement.backgroundCommandEvents
|
|
6167
|
+
);
|
|
6168
|
+
} catch (error) {
|
|
6169
|
+
observability.warn("sandbox reaper: retained-command event fanout failed", {
|
|
6170
|
+
processId: process.id,
|
|
6171
|
+
error: error instanceof Error ? error.message : String(error)
|
|
6172
|
+
});
|
|
6173
|
+
}
|
|
6174
|
+
}
|
|
6159
6175
|
recordRetainedProcessReconciliation(observability, `settled_${proof.outcome}`);
|
|
6160
6176
|
} catch (error) {
|
|
6161
6177
|
recordRetainedProcessReconciliation(observability, "settlement_failed");
|
|
@@ -9592,6 +9608,7 @@ import {
|
|
|
9592
9608
|
recoverSessionDispatch,
|
|
9593
9609
|
reconcileSessionAttemptQuiescence,
|
|
9594
9610
|
peekSessionWork as peekSessionWorkDb,
|
|
9611
|
+
settleSessionInputWait as settleSessionInputWaitDb,
|
|
9595
9612
|
countQueuedTurns as countQueuedTurns2,
|
|
9596
9613
|
getSessionAttemptActivityRef,
|
|
9597
9614
|
getSessionEvent,
|
|
@@ -9613,6 +9630,7 @@ function createSessionStateActivities(services, overrides = {}) {
|
|
|
9613
9630
|
const recoverSessionDispatchFn = overrides.recoverSessionDispatch ?? recoverSessionDispatch;
|
|
9614
9631
|
const reconcileSessionAttemptQuiescenceFn = overrides.reconcileSessionAttemptQuiescence ?? reconcileSessionAttemptQuiescence;
|
|
9615
9632
|
const peekSessionWorkFn = overrides.peekSessionWork ?? peekSessionWorkDb;
|
|
9633
|
+
const settleSessionInputWaitFn = overrides.settleSessionInputWait ?? settleSessionInputWaitDb;
|
|
9616
9634
|
const countQueuedTurnsFn = overrides.countQueuedTurns ?? countQueuedTurns2;
|
|
9617
9635
|
const getSessionAttemptActivityRefFn = overrides.getSessionAttemptActivityRef ?? getSessionAttemptActivityRef;
|
|
9618
9636
|
const getSessionEventFn = overrides.getSessionEvent ?? getSessionEvent;
|
|
@@ -9915,6 +9933,14 @@ function createSessionStateActivities(services, overrides = {}) {
|
|
|
9915
9933
|
await refreshQueuedTurnsGauge(db, observability, countQueuedTurnsFn, recordTurnsQueuedGaugeFn);
|
|
9916
9934
|
return peek;
|
|
9917
9935
|
}
|
|
9936
|
+
async function settleSessionInputWait(input) {
|
|
9937
|
+
const { db, bus } = await services();
|
|
9938
|
+
const result = await settleSessionInputWaitFn(db, input);
|
|
9939
|
+
if (result.events.length > 0) {
|
|
9940
|
+
await publishDurableSessionEventsFn(bus, input.workspaceId, input.sessionId, result.events);
|
|
9941
|
+
}
|
|
9942
|
+
return { action: result.action };
|
|
9943
|
+
}
|
|
9918
9944
|
async function expireSessionHumanInput(input) {
|
|
9919
9945
|
const { db, bus } = await services();
|
|
9920
9946
|
const result = await expireSessionHumanInputRequestFn(db, input);
|
|
@@ -9963,6 +9989,7 @@ function createSessionStateActivities(services, overrides = {}) {
|
|
|
9963
9989
|
recoverDispatch,
|
|
9964
9990
|
recoverEscapedMcpTimeout,
|
|
9965
9991
|
peekSessionWork,
|
|
9992
|
+
settleSessionInputWait,
|
|
9966
9993
|
expireSessionHumanInput,
|
|
9967
9994
|
expireSessionInteractionIntervention,
|
|
9968
9995
|
markSessionIdle
|
|
@@ -10054,4 +10081,4 @@ export {
|
|
|
10054
10081
|
createControlActivities,
|
|
10055
10082
|
createControlActivitiesFromServices
|
|
10056
10083
|
};
|
|
10057
|
-
//# sourceMappingURL=activities-control-
|
|
10084
|
+
//# sourceMappingURL=activities-control-CTEMLTHG.js.map
|