@opengeni/worker-bundle 0.27.3-canary.0 → 0.28.1-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.
@@ -1,6 +1,6 @@
1
1
  import type { Settings } from "@opengeni/config";
2
2
  import type { ConnectionCredentialsPort } from "@opengeni/contracts";
3
- import { resolveAcceptedConnectionUse, sessionTenancyProductActivated, type Database, type ResolveConnectionCredentialInput, type ResolveConnectionCredentialResult, type SessionTurnForExecution } from "@opengeni/db";
3
+ import { getSessionTurnForAttempt, resolveAcceptedConnectionUse, sessionTenancyProductActivated, type Database, type ResolveConnectionCredentialInput, type ResolveConnectionCredentialResult, type SessionTurnForExecution } from "@opengeni/db";
4
4
  import { type Observability } from "@opengeni/observability";
5
5
  export declare function connectionTokenResolverForTurn(input: {
6
6
  db: Database;
@@ -13,6 +13,8 @@ export declare function connectionTokenResolverForTurn(input: {
13
13
  attemptId: string;
14
14
  turn: SessionTurnForExecution;
15
15
  authorizeAcceptedUse?: typeof resolveAcceptedConnectionUse;
16
+ /** Test seam; production always reads the canonical active-attempt projection. */
17
+ getHostTurnForAttempt?: typeof getSessionTurnForAttempt;
16
18
  /** Test seam for the activation fence on pre-snapshot workspace refs. */
17
19
  isSessionTenancyProductActivated?: typeof sessionTenancyProductActivated;
18
20
  /** Optional; used only for content-free compatibility-lane counters. */
@@ -92,6 +92,15 @@ export declare function openFreshWorkspaceCaptureSession(input: {
92
92
  /** One discovered repository is all-or-nothing capture authority. A provider
93
93
  * transport failure must never be represented as an authoritative empty diff. */
94
94
  export declare function readCaptureRepository(svc: Pick<SandboxChannelAService, "gitStatus" | "gitDiff">, root: string): Promise<CaptureRepositoryReadResult>;
95
+ /** Review work may use idle time, but must yield to the next turn. Poll durable
96
+ * queue state rather than relying on best-effort event delivery. The capture
97
+ * already fences every continuation on this signal; no replacement writer is
98
+ * admitted until its caller returns. */
99
+ export declare function captureWhileIdle(input: {
100
+ hasPendingWork: () => Promise<boolean>;
101
+ capture: (signal: AbortSignal) => Promise<void>;
102
+ signal?: AbortSignal;
103
+ }): Promise<void>;
95
104
  /**
96
105
  * Turn-end entrypoint. Gates on the flag + configured object storage, races the
97
106
  * whole capture against a 120s cap, and swallows every failure ("turn outcome
@@ -110,6 +119,8 @@ export declare function captureWorkspaceRevision(input: CaptureWorkspaceRevision
110
119
  export declare function changeFingerprint(repos: WorkspaceCaptureRepo[], files: WorkspaceCaptureFile[]): string;
111
120
  /** Join a repo-root-relative path onto its workspace-relative repo root. */
112
121
  export declare function joinRepoPath(repoRoot: string, repoRelPath: string): string;
113
- /** Content-addressed after-image blob key (shared across revisions → GC input). */
122
+ /** Content-addressed after-image blob key, optionally in a unique capture namespace. */
114
123
  export declare function blobKey(workspaceId: string, sessionId: string, sha256Hex: string): string;
124
+ /** Only pass the latest retained revision's keys: older refs may be under deletion. */
125
+ export declare function retainedCaptureBlobRefs(workspaceId: string, sessionId: string, latestKeys: string[]): Map<string, string>;
115
126
  export {};
@@ -33,7 +33,7 @@ import {
33
33
  scheduledUserMessagePayload,
34
34
  withFirstPartyTools,
35
35
  workflowIdForSession
36
- } from "./chunk-C54VDT6I.js";
36
+ } from "./chunk-AKP6BKM2.js";
37
37
  import {
38
38
  inspectOpenSandboxKubernetesInventory,
39
39
  recordCreditBalanceGauges,
@@ -7448,7 +7448,6 @@ import {
7448
7448
  SCHEDULED_TASK_OCCURRENCE_PAYLOAD_MAX_BYTES,
7449
7449
  ScheduledTaskRunAcceptedExecution,
7450
7450
  SessionAgentAccess,
7451
- SessionEndUser,
7452
7451
  SessionMemoryScope,
7453
7452
  normalizeAutomaticSessionTitle,
7454
7453
  scheduledOccurrencePayloadUtf8Bytes,
@@ -9564,11 +9563,12 @@ async function replayScheduledTaskDispatch(input) {
9564
9563
  function scheduledCreatorSessionPolicyInput(policy) {
9565
9564
  if (!policy) return {};
9566
9565
  const agentAccess = SessionAgentAccess.safeParse(policy.agentAccess);
9567
- const endUser = SessionEndUser.safeParse(policy.endUser);
9568
9566
  const memoryScope = SessionMemoryScope.safeParse(policy.memoryScope);
9569
9567
  return {
9570
9568
  ...agentAccess.success ? { agentAccess: agentAccess.data } : {},
9571
- ...endUser.success ? { endUser: endUser.data } : {},
9569
+ // This is a trusted DB admission input, not the public create payload.
9570
+ // Preserve the immutable creator policy through scheduled materialization.
9571
+ ...policy.scopeSubjectId && /^(?:user:|external_user:).+/u.test(policy.scopeSubjectId) ? { scopeSubjectId: policy.scopeSubjectId } : {},
9572
9572
  ...memoryScope.success ? { memoryScope: memoryScope.data } : {}
9573
9573
  };
9574
9574
  }
@@ -10350,4 +10350,4 @@ export {
10350
10350
  createControlActivities,
10351
10351
  createControlActivitiesFromServices
10352
10352
  };
10353
- //# sourceMappingURL=activities-control-WZRFEIJH.js.map
10353
+ //# sourceMappingURL=activities-control-VVK7RA7F.js.map