@tangle-network/agent-app 0.44.39 → 0.44.41

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/README.md CHANGED
@@ -37,12 +37,12 @@ pnpm add @tangle-network/agent-eval @tangle-network/agent-integrations
37
37
  |---|---|---|
38
38
  | `@tangle-network/agent-eval` | `/eval`, `/eval-campaign`, `/profile`, `/knowledge` | `>=0.135.1` |
39
39
  | `@tangle-network/agent-runtime` | `/runtime`, `/chat-routes` | `>=0.109.0` |
40
- | `@tangle-network/agent-integrations` | `/integrations` | `>=0.44.0` |
40
+ | `@tangle-network/agent-integrations` | `/integrations` | `>=0.51.0` |
41
41
  | `@tangle-network/agent-interface` | `/interactions`, `/chat-store`, `/harness` | `>=0.36.0` |
42
42
  | `@tangle-network/sandbox` | `/sandbox` | `>=0.15.2` |
43
43
  | `@tangle-network/agent-knowledge` | `/knowledge-loop` | `>=6.1.10` |
44
44
  | `@tangle-network/agent-profile-materialize` | `/skills-placement` | `>=0.9.2` |
45
- | `@tangle-network/sandbox-ui` | `/brand`, `/studio-react`, `/work-product-react` | `>=0.90.3` |
45
+ | `@tangle-network/sandbox-ui` | `/brand`, `/studio-react`, `/work-product-react` | `>=0.91.5` |
46
46
 
47
47
  All of these except `agent-eval`, `agent-integrations`, and `agent-interface` are declared **optional** peers, so a product that never imports the subpath installs nothing.
48
48
 
@@ -97,7 +97,7 @@ import {
97
97
  flattenHistory,
98
98
  readSandboxBinaryBytes,
99
99
  statSandboxFileSize
100
- } from "../chunk-JYHMNFFU.js";
100
+ } from "../chunk-HUBACCOP.js";
101
101
  import "../chunk-LWSJK546.js";
102
102
  import "../chunk-CQZSAR77.js";
103
103
  import "../chunk-ICOHEZK6.js";
@@ -1411,6 +1411,7 @@ async function peekWorkspaceSandbox(shell, options) {
1411
1411
  return { status: "running", box: match };
1412
1412
  }
1413
1413
  async function finalizeExistingBox(shell, client, box, stage, name, workspaceId, userId, harness, scope) {
1414
+ await reconcileExistingBoxEgress(box, shell.egressPolicy, stage, name);
1414
1415
  const written = await materializeDeferredFilesForExistingBox(
1415
1416
  shell,
1416
1417
  client,
@@ -1433,6 +1434,40 @@ async function finalizeExistingBox(shell, client, box, stage, name, workspaceId,
1433
1434
  }
1434
1435
  return finalBox;
1435
1436
  }
1437
+ function normalizedEgressPolicy(policy) {
1438
+ if (policy.mode !== "strict") return policy.mode;
1439
+ const allowDomains = [...new Set(
1440
+ (policy.allowDomains ?? []).map((domain) => domain.trim().toLowerCase()).filter(Boolean)
1441
+ )].sort();
1442
+ return JSON.stringify({
1443
+ mode: policy.mode,
1444
+ allowDomains,
1445
+ includeImplicitDomains: policy.includeImplicitDomains !== false
1446
+ });
1447
+ }
1448
+ async function reconcileExistingBoxEgress(box, desired, stage, name) {
1449
+ if (!desired) return;
1450
+ let current;
1451
+ try {
1452
+ current = await box.egress.get();
1453
+ } catch (cause) {
1454
+ const error = cause instanceof Error ? cause : new Error(String(cause));
1455
+ throw new Error(`egress policy read failed on ${stage} box ${name}: ${error.message}`, {
1456
+ cause: error
1457
+ });
1458
+ }
1459
+ const matchingPolicy = normalizedEgressPolicy(current.policy) === normalizedEgressPolicy(desired);
1460
+ const effectiveSource = desired.mode !== "open" || current.source !== "platform";
1461
+ if (matchingPolicy && effectiveSource) return;
1462
+ try {
1463
+ await box.egress.update(desired);
1464
+ } catch (cause) {
1465
+ const error = cause instanceof Error ? cause : new Error(String(cause));
1466
+ throw new Error(`egress policy update failed on ${stage} box ${name}: ${error.message}`, {
1467
+ cause: error
1468
+ });
1469
+ }
1470
+ }
1436
1471
  async function ensureWorkspaceSandbox(shell, options) {
1437
1472
  const { workspaceId, userId, harness, forceNew, onProgress, billingOwnerId } = options;
1438
1473
  const resolved = await resolveWorkspaceSandboxClient(shell, workspaceId, userId);
@@ -1565,6 +1600,7 @@ async function ensureWorkspaceSandbox(shell, options) {
1565
1600
  backend: { type: harness, profile, ...model ? { model } : {} },
1566
1601
  ...storage ? { storage } : {},
1567
1602
  ...restore ? restore : {},
1603
+ ...shell.egressPolicy ? { egressPolicy: shell.egressPolicy } : {},
1568
1604
  ...shell.webTerminalEnabled ? { webTerminalEnabled: true } : {},
1569
1605
  maxLifetimeSeconds: resources.maxLifetimeSeconds,
1570
1606
  idleTimeoutSeconds: resources.idleTimeoutSeconds,
@@ -1978,4 +2014,4 @@ export {
1978
2014
  isTerminalPromptEvent,
1979
2015
  detectInteractiveQuestion
1980
2016
  };
1981
- //# sourceMappingURL=chunk-JYHMNFFU.js.map
2017
+ //# sourceMappingURL=chunk-HUBACCOP.js.map