@opengeni/worker-bundle 2.2.1 → 2.3.0-canary.36938443461001
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/credential-restriction.d.ts +3 -0
- package/dist/activities/agent-turn/run-credentials.d.ts +2 -0
- package/dist/activities/scheduled-tasks.d.ts +4 -35
- package/dist/activities/types.d.ts +3 -0
- package/dist/activities/workspace-capture.d.ts +2 -0
- package/dist/{activities-control-55ECL47G.js → activities-control-RDA4E2DM.js} +102 -20
- package/dist/activities-control-RDA4E2DM.js.map +1 -0
- package/dist/{activities-turn-T7Y3BWYO.js → activities-turn-A7LDKRLD.js} +20 -7
- package/dist/activities-turn-A7LDKRLD.js.map +1 -0
- package/dist/{chunk-OWNLATJL.js → chunk-HXPW4HPN.js} +60 -24
- package/dist/chunk-HXPW4HPN.js.map +1 -0
- package/dist/{chunk-IJZU752L.js → chunk-YG27NEMX.js} +34 -1
- package/dist/chunk-YG27NEMX.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/observability-metrics.d.ts +16 -1
- package/dist/workflow-bundle.js +18 -12
- package/dist/workflows/scheduled-tasks.d.ts +4 -0
- package/package.json +21 -21
- package/src/activities/agent-turn/claim.ts +13 -1
- package/src/activities/agent-turn/credential-restriction.ts +14 -0
- package/src/activities/agent-turn/errors.ts +39 -13
- package/src/activities/agent-turn/run-credentials.ts +5 -0
- package/src/activities/agent-turn/run.ts +1 -0
- package/src/activities/agent-turn/tool-environment.ts +4 -0
- package/src/activities/automations.ts +23 -1
- package/src/activities/goals.ts +33 -8
- package/src/activities/sandbox-lease.ts +22 -0
- package/src/activities/scheduled-tasks.ts +89 -25
- package/src/activities/site-auth-maintenance.ts +1 -0
- package/src/activities/types.ts +3 -0
- package/src/activities/workspace-capture.ts +13 -2
- package/src/observability-metrics.ts +55 -1
- package/src/workflows/scheduled-tasks.ts +26 -13
- package/dist/activities-control-55ECL47G.js.map +0 -1
- package/dist/activities-turn-T7Y3BWYO.js.map +0 -1
- package/dist/chunk-IJZU752L.js.map +0 -1
- package/dist/chunk-OWNLATJL.js.map +0 -1
|
@@ -83,6 +83,7 @@ import {
|
|
|
83
83
|
signalPendingCodexCapacityWakeTargets,
|
|
84
84
|
startActivityHeartbeat,
|
|
85
85
|
throwIfTurnOperationCancelled,
|
|
86
|
+
turnCredentialRestriction,
|
|
86
87
|
turnFinalizerCancellationSignal,
|
|
87
88
|
turnInput,
|
|
88
89
|
turnOperationCancellationFailure,
|
|
@@ -94,7 +95,7 @@ import {
|
|
|
94
95
|
withFirstPartyTools,
|
|
95
96
|
wrapLazyTurnBoxWithRouting,
|
|
96
97
|
wrapTurnBoxWithRouting
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-HXPW4HPN.js";
|
|
98
99
|
import {
|
|
99
100
|
StreamTimingMetrics,
|
|
100
101
|
makeMachineOpObserver,
|
|
@@ -126,7 +127,7 @@ import {
|
|
|
126
127
|
runtimeMetricsHooksForObservability,
|
|
127
128
|
sandboxAutomaticRecoveryOutcome,
|
|
128
129
|
turnLifecycleMetricsFor
|
|
129
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-YG27NEMX.js";
|
|
130
131
|
import {
|
|
131
132
|
__export
|
|
132
133
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -4460,13 +4461,16 @@ async function runCapture(input, ctx, startedAt, signal, stage, ownership) {
|
|
|
4460
4461
|
"error.message": gcError instanceof Error ? gcError.message : String(gcError)
|
|
4461
4462
|
});
|
|
4462
4463
|
}
|
|
4463
|
-
|
|
4464
|
+
recordWorkspaceCaptureCompleted(observability, Date.now() - startedAt);
|
|
4465
|
+
}
|
|
4466
|
+
function recordWorkspaceCaptureCompleted(observability, durationMs) {
|
|
4464
4467
|
observability.incrementCounter({
|
|
4465
4468
|
name: "opengeni_workspace_capture_total",
|
|
4466
4469
|
labels: { result: "ok" }
|
|
4467
4470
|
});
|
|
4468
4471
|
observability.observeHistogram({
|
|
4469
|
-
name: "
|
|
4472
|
+
name: "opengeni_workspace_capture_revision_duration_seconds",
|
|
4473
|
+
help: "Turn-end logical workspace revision capture duration for committed revisions.",
|
|
4470
4474
|
value: durationMs / 1e3
|
|
4471
4475
|
});
|
|
4472
4476
|
}
|
|
@@ -10458,7 +10462,9 @@ async function claimTurnAttempt(deps) {
|
|
|
10458
10462
|
claimedPolicy.kind === "valid" ? claimedPolicy.policy.productModelId : turn.model
|
|
10459
10463
|
);
|
|
10460
10464
|
const codexAppsCredentialId = capabilitySettings.codexConnectedAppsEnabled ? await resolveCodexAppsCredentialIdForRun(db, input.workspaceId) : null;
|
|
10461
|
-
const
|
|
10465
|
+
const candidatePolicy = claimedPolicy.kind === "valid" ? claimedPolicy.policy : resolveTurnExecutionPolicyV12(capabilitySettings, legacyTurnExecutionPolicyInput(turn));
|
|
10466
|
+
const credentialRestriction = claimedPolicy.kind === "absent" ? turn.initiatorContext?.credentialRestriction === "developer_setup" ? "developer_setup" : turnCredentialRestriction(candidatePolicy, session.metadata) : void 0;
|
|
10467
|
+
const policyForAbsent = credentialRestriction ? { ...candidatePolicy, credentialRestriction } : candidatePolicy;
|
|
10462
10468
|
const installedPolicy = await installOrReadTurnExecutionPolicyForAttempt(db, {
|
|
10463
10469
|
accountId: input.accountId,
|
|
10464
10470
|
workspaceId: input.workspaceId,
|
|
@@ -15413,6 +15419,7 @@ async function prepareRunCredentials(deps) {
|
|
|
15413
15419
|
sandboxState,
|
|
15414
15420
|
turn,
|
|
15415
15421
|
session,
|
|
15422
|
+
turnExecutionPolicy,
|
|
15416
15423
|
fileAuthoritySubjectId,
|
|
15417
15424
|
runSettings,
|
|
15418
15425
|
workspaceVariableSet,
|
|
@@ -15571,11 +15578,13 @@ async function prepareRunCredentials(deps) {
|
|
|
15571
15578
|
attemptId: input.attemptId,
|
|
15572
15579
|
turn
|
|
15573
15580
|
}) : void 0;
|
|
15581
|
+
const credentialRestriction = turnCredentialRestriction(turnExecutionPolicy, session.metadata);
|
|
15574
15582
|
const codemodeAuthority = {
|
|
15575
15583
|
sessionId: input.sessionId,
|
|
15576
15584
|
turnId: turn.id,
|
|
15577
15585
|
attemptId: input.attemptId,
|
|
15578
|
-
executionGeneration: turn.executionGeneration
|
|
15586
|
+
executionGeneration: turn.executionGeneration,
|
|
15587
|
+
...credentialRestriction ? { credentialRestriction } : {}
|
|
15579
15588
|
};
|
|
15580
15589
|
const sandboxArtifactRuntime = sandboxArtifactRuntimeAdmission(
|
|
15581
15590
|
settings,
|
|
@@ -34227,6 +34236,7 @@ async function prepareTurnToolRuntime(deps) {
|
|
|
34227
34236
|
});
|
|
34228
34237
|
const runSettings = accountRoutes.settings;
|
|
34229
34238
|
const turnTools = accountRoutes.tools;
|
|
34239
|
+
const credentialRestriction = turnCredentialRestriction(turnExecutionPolicy, session.metadata);
|
|
34230
34240
|
const toolContextPreparationStartedAt = performance.now();
|
|
34231
34241
|
throwIfWorkerShuttingDown();
|
|
34232
34242
|
throwIfTurnCancelled();
|
|
@@ -34750,6 +34760,7 @@ async function prepareTurnToolRuntime(deps) {
|
|
|
34750
34760
|
] : [],
|
|
34751
34761
|
...createFirstPartyInteractionAttemptToolDefinitions({
|
|
34752
34762
|
settings: runSettings,
|
|
34763
|
+
...credentialRestriction ? { credentialRestriction } : {},
|
|
34753
34764
|
scope: {
|
|
34754
34765
|
accountId: input.accountId,
|
|
34755
34766
|
workspaceId: input.workspaceId,
|
|
@@ -34836,6 +34847,7 @@ async function prepareTurnToolRuntime(deps) {
|
|
|
34836
34847
|
try {
|
|
34837
34848
|
eventing.preparedTools = await waitForTurnOperation(
|
|
34838
34849
|
runtime.prepareTools(githubRestMcp.settings, githubRestMcp.tools, {
|
|
34850
|
+
...credentialRestriction ? { credentialRestriction } : {},
|
|
34839
34851
|
mcpAccountLabels: accountRoutes.accountLabels,
|
|
34840
34852
|
accountId: input.accountId,
|
|
34841
34853
|
workspaceId: input.workspaceId,
|
|
@@ -37987,6 +37999,7 @@ These are publication receipts for the human's earlier answer. Do not call the r
|
|
|
37987
37999
|
sandboxRuntime,
|
|
37988
38000
|
turn,
|
|
37989
38001
|
session,
|
|
38002
|
+
turnExecutionPolicy,
|
|
37990
38003
|
fileAuthoritySubjectId,
|
|
37991
38004
|
runSettings,
|
|
37992
38005
|
workspaceVariableSet,
|
|
@@ -39739,4 +39752,4 @@ export {
|
|
|
39739
39752
|
createTurnActivities,
|
|
39740
39753
|
createTurnActivitiesFromServices
|
|
39741
39754
|
};
|
|
39742
|
-
//# sourceMappingURL=activities-turn-
|
|
39755
|
+
//# sourceMappingURL=activities-turn-A7LDKRLD.js.map
|