@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/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  startSlackInteractionPump,
15
15
  startTemporalScheduleCleanupPump,
16
16
  withAccessGrantSessionRlsContext
17
- } from "./chunk-GBUJ2DYZ.js";
17
+ } from "./chunk-OT56OY4V.js";
18
18
  import "./chunk-OGQDXVXY.js";
19
19
 
20
20
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/api-router",
3
- "version": "3.0.2-canary.38894290271001",
3
+ "version": "3.1.2",
4
4
  "description": "Opengeni HTTP surface: the Hono adapter/router (createApp), routes, MCP HTTP transport, and HTTP access adapters over @opengeni/core. An engine-distribution surface — its runtime closure includes engine-internal packages.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -44,27 +44,27 @@
44
44
  "@hono/zod-validator": "^0.7.6",
45
45
  "@llamaindex/liteparse": "2.14.2",
46
46
  "@modelcontextprotocol/sdk": "^1.29.0",
47
- "@opengeni/agent-proto": "3.0.2-canary.38894290271001",
48
- "@opengeni/artifact-tool": "3.0.2-canary.38894290271001",
49
- "@opengeni/capabilities": "3.0.2-canary.38894290271001",
50
- "@opengeni/codemode": "3.0.2-canary.38894290271001",
51
- "@opengeni/codex": "3.0.2-canary.38894290271001",
52
- "@opengeni/config": "3.0.2-canary.38894290271001",
53
- "@opengeni/contracts": "3.0.2-canary.38894290271001",
54
- "@opengeni/core": "3.0.2-canary.38894290271001",
55
- "@opengeni/db": "3.0.2-canary.38894290271001",
56
- "@opengeni/documents": "3.0.2-canary.38894290271001",
57
- "@opengeni/events": "3.0.2-canary.38894290271001",
58
- "@opengeni/github": "3.0.2-canary.38894290271001",
59
- "@opengeni/interaction": "3.0.2-canary.38894290271001",
60
- "@opengeni/network": "3.0.2-canary.38894290271001",
61
- "@opengeni/observability": "3.0.2-canary.38894290271001",
62
- "@opengeni/runtime": "3.0.2-canary.38894290271001",
63
- "@opengeni/storage": "3.0.2-canary.38894290271001",
64
- "@opengeni/tool-gateway": "3.0.2-canary.38894290271001",
65
- "@opengeni/vaults": "3.0.2-canary.38894290271001",
66
- "@opengeni/vaults-onepassword": "3.0.2-canary.38894290271001",
67
- "@opengeni/xai-subscription": "3.0.2-canary.38894290271001",
47
+ "@opengeni/agent-proto": "3.1.2",
48
+ "@opengeni/artifact-tool": "3.1.2",
49
+ "@opengeni/capabilities": "3.1.2",
50
+ "@opengeni/codemode": "3.1.2",
51
+ "@opengeni/codex": "3.1.2",
52
+ "@opengeni/config": "3.1.2",
53
+ "@opengeni/contracts": "3.1.2",
54
+ "@opengeni/core": "3.1.2",
55
+ "@opengeni/db": "3.1.2",
56
+ "@opengeni/documents": "3.1.2",
57
+ "@opengeni/events": "3.1.2",
58
+ "@opengeni/github": "3.1.2",
59
+ "@opengeni/interaction": "3.1.2",
60
+ "@opengeni/network": "3.1.2",
61
+ "@opengeni/observability": "3.1.2",
62
+ "@opengeni/runtime": "3.1.2",
63
+ "@opengeni/storage": "3.1.2",
64
+ "@opengeni/tool-gateway": "3.1.2",
65
+ "@opengeni/vaults": "3.1.2",
66
+ "@opengeni/vaults-onepassword": "3.1.2",
67
+ "@opengeni/xai-subscription": "3.1.2",
68
68
  "@temporalio/client": "^1.17.0",
69
69
  "ajv": "^8.20.0",
70
70
  "better-auth": "^1.6.14",
@@ -590,10 +590,6 @@ async function withChannelAOperation<T>(
590
590
  : undefined;
591
591
  const { accountId, workspaceId, session } = ctx;
592
592
 
593
- if (session.sandboxBackend === "none") {
594
- throw new HTTPException(409, { message: "sandbox not available" });
595
- }
596
-
597
593
  const sandboxGroupId = session.sandboxGroupId;
598
594
  const requestId = crypto.randomUUID();
599
595
  const holderId = `direct:${requestId}`;
@@ -607,9 +603,19 @@ async function withChannelAOperation<T>(
607
603
  // The STABLE run-environment used by both a cloud home and a machine home.
608
604
  // It also carries the per-session Codemode pointer selected below. Constants
609
605
  // only: user secrets are resolved per command (W1), never seeded here.
606
+ // `none` describes only the durable home. A session without a home sandbox
607
+ // that attached a Connected Machine runs its turns there (the worker gives
608
+ // such a turn the effective selfhosted backend), so its direct operations,
609
+ // such as opening a computer or browser on that machine, follow the same
610
+ // active pointer.
611
+ const machineOnlyHome = session.sandboxBackend === "none";
612
+ if (machineOnlyHome && !(await readActiveSandbox(db, workspaceId, session.id))?.activeSandboxId) {
613
+ throw new HTTPException(409, { message: "sandbox not available" });
614
+ }
615
+ const effectiveBackend = machineOnlyHome ? "selfhosted" : session.sandboxBackend;
610
616
  const settingsForSession =
611
- session.sandboxBackend !== settings.sandboxBackend
612
- ? { ...settings, sandboxBackend: session.sandboxBackend }
617
+ effectiveBackend !== settings.sandboxBackend
618
+ ? { ...settings, sandboxBackend: effectiveBackend }
613
619
  : settings;
614
620
  const environment = stableSandboxEnvironmentForRun(settingsForSession, { workspaceId });
615
621
  if (hasGitCredentialRepositorySelection(session.resources)) {
@@ -673,12 +679,15 @@ async function withChannelAOperation<T>(
673
679
  // A machine-targeted top-level session has an honest selfhosted HOME label.
674
680
  // It has no cloud provider box and therefore must not acquire or establish a
675
681
  // phantom home lease before following its active machine pointer.
676
- if (session.sandboxBackend === "selfhosted") {
682
+ if (effectiveBackend === "selfhosted") {
677
683
  let established: EstablishedSandboxSession | undefined;
678
684
  try {
679
685
  ctx.waitSignal?.throwIfAborted();
680
686
  const pointer = await readActiveSandbox(db, workspaceId, session.id);
681
687
  if (!pointer?.activeSandboxId) {
688
+ if (machineOnlyHome) {
689
+ throw new HTTPException(409, { message: "sandbox not available" });
690
+ }
682
691
  // A machine-home session with no selected machine uses the deployment's
683
692
  // managed group box, exactly like the worker turn path. Keep the durable
684
693
  // home label honest; only this request's effective backend changes.