@tangle-network/agent-provider-cli-bridge 2.0.7 → 2.0.9

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.
@@ -40,6 +40,14 @@ export function createBridgeSandboxProvider(options) {
40
40
  async function create(input, restore) {
41
41
  input.signal?.throwIfAborted();
42
42
  refuseUnsupportedCreateInput(input, vendor.support);
43
+ // A caller's requested lifetime can only shorten the configured one; the vendor still enforces the wall clock.
44
+ let lifetimeRequested = lifetimeMs;
45
+ if (input.maxLifetimeMs !== undefined) {
46
+ if (!Number.isSafeInteger(input.maxLifetimeMs) || input.maxLifetimeMs < 1) {
47
+ throw new EnvironmentProviderError("invalid_input", "maxLifetimeMs must be a positive safe integer of milliseconds", { path: "maxLifetimeMs" });
48
+ }
49
+ lifetimeRequested = Math.min(lifetimeMs, input.maxLifetimeMs);
50
+ }
43
51
  if (restore !== undefined && input.workspace?.environment !== undefined) {
44
52
  throw new EnvironmentProviderError("refused", "a fork restores its checkpoint; workspace.environment names a different one", { path: "workspace.environment" });
45
53
  }
@@ -60,7 +68,7 @@ export function createBridgeSandboxProvider(options) {
60
68
  ...(input.name === undefined ? {} : { name: input.name }),
61
69
  metadata: { ...stringMetadata(input.metadata), [BRIDGE_RUN_TAG]: runTag },
62
70
  env: input.env ?? {},
63
- lifetimeMs,
71
+ lifetimeMs: lifetimeRequested,
64
72
  ...(input.workspace?.environment === undefined ? {} : { environment: input.workspace.environment }),
65
73
  ...(restore === undefined ? {} : { snapshot: restore.snapshot }),
66
74
  ...(input.workspace?.image === undefined ? {} : { image: input.workspace.image }),
@@ -107,6 +107,12 @@ export function refuseUnsupportedCreateInput(input, support) {
107
107
  refuse("idempotencyKey", "durable keyed create is not implemented");
108
108
  if (input.billingOwner !== undefined)
109
109
  refuse("billingOwner", "billing owners are not supported");
110
+ if (input.deleteAfterStoppedMs !== undefined)
111
+ refuse("deleteAfterStoppedMs", "stopped-generation retirement is not supported");
112
+ if (input.retain !== undefined)
113
+ refuse("retain", "stopped-generation retention is not supported");
114
+ if (input.idleTimeoutMs !== undefined)
115
+ refuse("idleTimeoutMs", "these sandboxes enforce a lifetime, not an idle timeout");
110
116
  if (input.secrets !== undefined)
111
117
  refuse("secrets", "secrets are not supported; pass env");
112
118
  if (input.proxySecrets !== undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-provider-cli-bridge",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "AgentEnvironmentProvider adapter for cli-bridge retained sessions and one-shot turns",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@tangle-network/agent-core": "^1.0.2",
40
- "@tangle-network/agent-interface": "^5.10.12",
40
+ "@tangle-network/agent-interface": "^5.10.19",
41
41
  "@tangle-network/agent-profile-materialize": "1.1.4",
42
42
  "@tangle-network/cli-agent-registry": "^0.14.0",
43
43
  "undici": "8.12.3"