@opengeni/api-router 3.0.2-canary.38894290271001 → 3.1.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/app.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  withDefaultEnabledCapabilityMcpTools,
29
29
  workflowIdForSession,
30
30
  workspaceActorContextExempt
31
- } from "./chunk-GBUJ2DYZ.js";
31
+ } from "./chunk-OT56OY4V.js";
32
32
  import "./chunk-OGQDXVXY.js";
33
33
  export {
34
34
  API_MAX_REQUEST_BODY_BYTES,
@@ -16036,9 +16036,6 @@ async function withChannelAOperation(services, ctx, readOnly, fn) {
16036
16036
  const onSandboxOperation = services.observability ? sandboxOperationMetricObserver(services.observability) : void 0;
16037
16037
  const onSandboxCaptureWait = services.observability ? sandboxCaptureWaitMetricObserver(services.observability) : void 0;
16038
16038
  const { accountId, workspaceId, session } = ctx;
16039
- if (session.sandboxBackend === "none") {
16040
- throw new HTTPException21(409, { message: "sandbox not available" });
16041
- }
16042
16039
  const sandboxGroupId = session.sandboxGroupId;
16043
16040
  const requestId = crypto.randomUUID();
16044
16041
  const holderId = `direct:${requestId}`;
@@ -16047,7 +16044,12 @@ async function withChannelAOperation(services, ctx, readOnly, fn) {
16047
16044
  const leaseTtlMs = settings.sandboxLeaseTtlMs;
16048
16045
  let machineAuthorityResult;
16049
16046
  const machineAuthority = () => machineAuthorityResult ??= channelAMachineAuthority(db, ctx);
16050
- const settingsForSession = session.sandboxBackend !== settings.sandboxBackend ? { ...settings, sandboxBackend: session.sandboxBackend } : settings;
16047
+ const machineOnlyHome = session.sandboxBackend === "none";
16048
+ if (machineOnlyHome && !(await readActiveSandbox(db, workspaceId, session.id))?.activeSandboxId) {
16049
+ throw new HTTPException21(409, { message: "sandbox not available" });
16050
+ }
16051
+ const effectiveBackend = machineOnlyHome ? "selfhosted" : session.sandboxBackend;
16052
+ const settingsForSession = effectiveBackend !== settings.sandboxBackend ? { ...settings, sandboxBackend: effectiveBackend } : settings;
16051
16053
  const environment = stableSandboxEnvironmentForRun(settingsForSession, { workspaceId });
16052
16054
  if (hasGitCredentialRepositorySelection(session.resources)) {
16053
16055
  applyGitAuthPointerEnvironment(
@@ -16091,12 +16093,15 @@ async function withChannelAOperation(services, ctx, readOnly, fn) {
16091
16093
  await routingSession.finalizeOpStreamOps().catch(() => void 0);
16092
16094
  return result2;
16093
16095
  };
16094
- if (session.sandboxBackend === "selfhosted") {
16096
+ if (effectiveBackend === "selfhosted") {
16095
16097
  let established2;
16096
16098
  try {
16097
16099
  ctx.waitSignal?.throwIfAborted();
16098
16100
  const pointer = await readActiveSandbox(db, workspaceId, session.id);
16099
16101
  if (!pointer?.activeSandboxId) {
16102
+ if (machineOnlyHome) {
16103
+ throw new HTTPException21(409, { message: "sandbox not available" });
16104
+ }
16100
16105
  const groupBackend = managedSessionGroupBackend(
16101
16106
  settings.sandboxBackend,
16102
16107
  session.sandboxBackend
@@ -146324,4 +146329,4 @@ export {
146324
146329
  withDefaultEnabledCapabilityMcpTools,
146325
146330
  workflowIdForSession4 as workflowIdForSession
146326
146331
  };
146327
- //# sourceMappingURL=chunk-GBUJ2DYZ.js.map
146332
+ //# sourceMappingURL=chunk-OT56OY4V.js.map