@opengeni/runtime 0.5.0 → 0.6.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.
- package/dist/{chunk-Q36E4MDM.js → chunk-BHA2SU3H.js} +54 -3
- package/dist/chunk-BHA2SU3H.js.map +1 -0
- package/dist/{index-BrdnxaAW.d.ts → index-otZkoLYq.d.ts} +11 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +3 -1
- package/package.json +2 -2
- package/src/sandbox/index.ts +2 -0
- package/src/sandbox/providers/modal.ts +107 -2
- package/dist/chunk-Q36E4MDM.js.map +0 -1
|
@@ -99,6 +99,16 @@ declare function modalSandboxAttributionEnvironment(input: ModalSandboxAttributi
|
|
|
99
99
|
declare function modalSandboxAttributionTags(input: ModalSandboxAttribution): Record<string, string>;
|
|
100
100
|
type ModalModule = typeof modal;
|
|
101
101
|
type ModalClientLike = InstanceType<ModalModule["ModalClient"]>;
|
|
102
|
+
/** Loader seam so unit tests can inject a fake modal module. */
|
|
103
|
+
type ModalModuleLoader = () => Promise<Pick<ModalModule, "ModalClient" | "Secret">>;
|
|
104
|
+
/**
|
|
105
|
+
* Resolve + cache the private-registry Modal image. No-op unless BOTH
|
|
106
|
+
* `modalImageRef` and `modalImageRegistrySecret` are set. Memoized per
|
|
107
|
+
* (imageRef, secret, environment) so it runs once per worker process. Awaited at
|
|
108
|
+
* worker boot BEFORE the first sandbox is created; `build` then reads the resolved
|
|
109
|
+
* image and otherwise falls back to the public `fromTag` path.
|
|
110
|
+
*/
|
|
111
|
+
declare function ensureModalRegistryImage(settings: Settings, loadModal?: ModalModuleLoader): Promise<void>;
|
|
102
112
|
declare function tagModalSandbox(settings: Settings, sandboxId: string, attribution: ModalSandboxAttribution): Promise<boolean>;
|
|
103
113
|
declare function terminateModalSandboxById(settings: Settings, sandboxId: string): Promise<boolean>;
|
|
104
114
|
declare function sweepModalOrphanSandboxes(settings: Settings, liveLeases: LiveModalSandboxLeaseAttribution[], options?: {
|
|
@@ -1800,4 +1810,4 @@ declare function establishSandboxSessionFromEnvelope(settings: Settings, envelop
|
|
|
1800
1810
|
*/
|
|
1801
1811
|
declare function serializeEstablishedSandboxEnvelope(established: EstablishedSandboxSession): Promise<Record<string, unknown> | null>;
|
|
1802
1812
|
|
|
1803
|
-
export {
|
|
1813
|
+
export { RoutingUnsupportedError as $, type ActiveBackendResolverDeps as A, type ModalSandboxAttribution as B, ChannelAConflictError as C, DEFAULT_DESKTOP_GEOMETRY as D, type EnsureDisplayStackOptions as E, type FinalizeRecordingResult as F, type NatsRequestConnection as G, type NegotiationContext as H, type NumstatEntry as I, type ProviderConstructionContext as J, type ProviderRegistration as K, type LiveModalSandboxLeaseAttribution as L, type MintStreamTokenInput as M, NatsControlRpc as N, type RecordingCodec as O, PROVIDER_REGISTRY as P, type RecordingContentType as Q, type RuntimeMetricsHooks as R, RecordingError as S, type RecordingProcess as T, RecordingUnavailableError as U, type ResolvedActiveBackend as V, type RoutableBackendSession as W, type RoutableSandbox as X, RoutingSandboxSession as Y, type RoutingSandboxSessionDeps as Z, type RoutingTransitionEvent as _, ActiveBackendUnresolvableError as a, negotiateSelfhostedCapabilities as a$, SELFHOSTED_DEFAULT_TIMEOUT_MS as a0, SELFHOSTED_RECONNECT_WINDOW_MS as a1, SELFHOSTED_RELAY_STREAM_PATH as a2, STREAM_PORT as a3, STREAM_TOKEN_DEFAULT_TTL_SECONDS as a4, SandboxChannelAService as a5, type SandboxChannelAServiceOptions as a6, SandboxConfigError as a7, type SandboxCreatedCallback as a8, SandboxProviderUnavailableError as a9, buildDisplayStackScript as aA, buildSelfhostedBackendSession as aB, buildStreamUrl as aC, buildTerminalServerScript as aD, contentTypeForCodec as aE, createSandboxClient as aF, createSandboxClientForBackend as aG, decodeModalSnapshotId as aH, deletePriorPersistedSnapshot as aI, deleteRecordingArtifacts as aJ, deserializeSandboxSessionStateEnvelope as aK, desktopCapableBackend as aL, ensureDisplayStack as aM, ensureModalRegistryImage as aN, ensureTerminalServer as aO, establishSandboxSessionFromEnvelope as aP, exposeStreamPort as aQ, extForCodec as aR, isExecSessionLostBanner as aS, isProviderSandboxNotFoundError as aT, isSelfhostedProviderNotFoundError as aU, isWorkspaceEscapeError as aV, makeActiveBackendResolver as aW, mintStreamToken as aX, modalSandboxAttributionEnvironment as aY, modalSandboxAttributionTags as aZ, negotiateCapabilities as a_, type SelfhostedApplyDiff as aa, SelfhostedControlError as ab, type SelfhostedEditor as ac, type SelfhostedEnrollment as ad, type SelfhostedExecArgs as ae, type SelfhostedExecResult as af, type SelfhostedImageOutput as ag, type SelfhostedLivenessState as ah, type SelfhostedNegotiationInput as ai, type SelfhostedRelayConfig as aj, SelfhostedSandboxClient as ak, SelfhostedSession as al, type SelfhostedSessionBuild as am, type SelfhostedSessionDeps as an, type SelfhostedSessionState as ao, type SelfhostedUnavailableReason as ap, type StartRecordingInput as aq, StreamPortUnavailableError as ar, TERMINAL_SERVER_TIMEOUT_MS as as, TerminalServerError as at, TerminalServerUnsupportedError as au, agentErrorToControlError as av, assertDescriptorRegistryInvariants as aw, assertProviderRegistryInvariants as ax, assertSafeRelPath as ay, backendSupportsOs as az, type ActivePointer as b, offlineAgentError as b0, offlineControlResponse as b1, parseExecBannerSessionId as b2, parseNumstatZ as b3, parsePorcelainV2 as b4, parseUnifiedPatch as b5, readRecordingBytes as b6, readWorkspaceArchiveFromEnvelopeSessionState as b7, recordingStorageKey as b8, restoredSandboxSessionStateFromEntry as b9, sandboxStateEntryFromRunState as ba, selectBackend as bb, selfhostedLiveness as bc, serializeEstablishedSandboxEnvelope as bd, setSelfhostedApplyDiff as be, startRecording as bf, stopRecording as bg, stripExecBanner as bh, subjectFor as bi, sweepModalOrphanSandboxes as bj, tagModalSandbox as bk, tearDownDisplayStack as bl, tearDownTerminalServer as bm, terminateModalSandboxById as bn, timeoutAgentError as bo, timeoutControlResponse as bp, verifyStreamToken as bq, type ChannelAEmitter as c, type ChannelAExecArgs as d, type ChannelAExecResult as e, ChannelANotFoundError as f, type ChannelASession as g, ChannelAUnsupportedError as h, ChannelAValidationError as i, type ControlRpc as j, DISPLAY_STACK_TIMEOUT_MS as k, type DesktopGeometry as l, DisplayStackError as m, DisplayStackUnsupportedError as n, type EnsureDisplayStackResult as o, type EnsureTerminalServerOptions as p, type EnsureTerminalServerResult as q, type EstablishedSandboxSession as r, type ExposeStreamPortInput as s, type ExposeStreamPortResult as t, type ExposedPortEndpoint as u, MockAgentResponder as v, type MockAgentResponderOptions as w, type MockExecHandler as x, type ModalModuleLoader as y, type ModalOrphanSweepResult as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { ReasoningEffort, SessionEventType, ResourceRef, ToolRef, Permission, Mc
|
|
|
7
7
|
export { CAPABILITY_DESCRIPTORS, CapabilityDescriptor, DESKTOP_STREAM_PORT, StreamTokenPayload, StreamTokenPayload as StreamTokenPayloadType, TERMINAL_STREAM_PORT } from '@opengeni/contracts';
|
|
8
8
|
import { Capability, SandboxSessionLike, SandboxSessionState, Manifest, Capabilities, LocalDirLazySkillSource, SandboxClient } from '@openai/agents/sandbox';
|
|
9
9
|
import OpenAI from 'openai';
|
|
10
|
-
import { R as RuntimeMetricsHooks } from './index-
|
|
11
|
-
export { A as ActiveBackendResolverDeps, a as ActiveBackendUnresolvableError, b as ActivePointer, C as ChannelAConflictError, c as ChannelAEmitter, d as ChannelAExecArgs, e as ChannelAExecResult, f as ChannelANotFoundError, g as ChannelASession, h as ChannelAUnsupportedError, i as ChannelAValidationError, j as ControlRpc, D as DEFAULT_DESKTOP_GEOMETRY, k as DISPLAY_STACK_TIMEOUT_MS, l as DesktopGeometry, m as DisplayStackError, n as DisplayStackUnsupportedError, E as EnsureDisplayStackOptions, o as EnsureDisplayStackResult, p as EnsureTerminalServerOptions, q as EnsureTerminalServerResult, r as EstablishedSandboxSession, s as ExposeStreamPortInput, t as ExposeStreamPortResult, u as ExposedPortEndpoint, F as FinalizeRecordingResult, L as LiveModalSandboxLeaseAttribution, M as MintStreamTokenInput, v as MockAgentResponder, w as MockAgentResponderOptions, x as MockExecHandler, y as
|
|
10
|
+
import { R as RuntimeMetricsHooks } from './index-otZkoLYq.js';
|
|
11
|
+
export { A as ActiveBackendResolverDeps, a as ActiveBackendUnresolvableError, b as ActivePointer, C as ChannelAConflictError, c as ChannelAEmitter, d as ChannelAExecArgs, e as ChannelAExecResult, f as ChannelANotFoundError, g as ChannelASession, h as ChannelAUnsupportedError, i as ChannelAValidationError, j as ControlRpc, D as DEFAULT_DESKTOP_GEOMETRY, k as DISPLAY_STACK_TIMEOUT_MS, l as DesktopGeometry, m as DisplayStackError, n as DisplayStackUnsupportedError, E as EnsureDisplayStackOptions, o as EnsureDisplayStackResult, p as EnsureTerminalServerOptions, q as EnsureTerminalServerResult, r as EstablishedSandboxSession, s as ExposeStreamPortInput, t as ExposeStreamPortResult, u as ExposedPortEndpoint, F as FinalizeRecordingResult, L as LiveModalSandboxLeaseAttribution, M as MintStreamTokenInput, v as MockAgentResponder, w as MockAgentResponderOptions, x as MockExecHandler, y as ModalModuleLoader, z as ModalOrphanSweepResult, B as ModalSandboxAttribution, N as NatsControlRpc, G as NatsRequestConnection, H as NegotiationContext, I as NumstatEntry, P as PROVIDER_REGISTRY, J as ProviderConstructionContext, K as ProviderRegistration, O as RecordingCodec, Q as RecordingContentType, S as RecordingError, T as RecordingProcess, U as RecordingUnavailableError, V as ResolvedActiveBackend, W as RoutableBackendSession, X as RoutableSandbox, Y as RoutingSandboxSession, Z as RoutingSandboxSessionDeps, _ as RoutingTransitionEvent, $ as RoutingUnsupportedError, a0 as SELFHOSTED_DEFAULT_TIMEOUT_MS, a1 as SELFHOSTED_RECONNECT_WINDOW_MS, a2 as SELFHOSTED_RELAY_STREAM_PATH, a3 as STREAM_PORT, a4 as STREAM_TOKEN_DEFAULT_TTL_SECONDS, a5 as SandboxChannelAService, a6 as SandboxChannelAServiceOptions, a7 as SandboxConfigError, a8 as SandboxCreatedCallback, a9 as SandboxProviderUnavailableError, aa as SelfhostedApplyDiff, ab as SelfhostedControlError, ac as SelfhostedEditor, ad as SelfhostedEnrollment, ae as SelfhostedExecArgs, af as SelfhostedExecResult, ag as SelfhostedImageOutput, ah as SelfhostedLivenessState, ai as SelfhostedNegotiationInput, aj as SelfhostedRelayConfig, ak as SelfhostedSandboxClient, al as SelfhostedSession, am as SelfhostedSessionBuild, an as SelfhostedSessionDeps, ao as SelfhostedSessionState, ap as SelfhostedUnavailableReason, aq as StartRecordingInput, ar as StreamPortUnavailableError, as as TERMINAL_SERVER_TIMEOUT_MS, at as TerminalServerError, au as TerminalServerUnsupportedError, av as agentErrorToControlError, aw as assertDescriptorRegistryInvariants, ax as assertProviderRegistryInvariants, ay as assertSafeRelPath, az as backendSupportsOs, aA as buildDisplayStackScript, aB as buildSelfhostedBackendSession, aC as buildStreamUrl, aD as buildTerminalServerScript, aE as contentTypeForCodec, aF as createSandboxClient, aG as createSandboxClientForBackend, aH as decodeModalSnapshotId, aI as deletePriorPersistedSnapshot, aJ as deleteRecordingArtifacts, aK as deserializeSandboxSessionStateEnvelope, aL as desktopCapableBackend, aM as ensureDisplayStack, aN as ensureModalRegistryImage, aO as ensureTerminalServer, aP as establishSandboxSessionFromEnvelope, aQ as exposeStreamPort, aR as extForCodec, aS as isExecSessionLostBanner, aT as isProviderSandboxNotFoundError, aU as isSelfhostedProviderNotFoundError, aV as isWorkspaceEscapeError, aW as makeActiveBackendResolver, aX as mintStreamToken, aY as modalSandboxAttributionEnvironment, aZ as modalSandboxAttributionTags, a_ as negotiateCapabilities, a$ as negotiateSelfhostedCapabilities, b0 as offlineAgentError, b1 as offlineControlResponse, b2 as parseExecBannerSessionId, b3 as parseNumstatZ, b4 as parsePorcelainV2, b5 as parseUnifiedPatch, b6 as readRecordingBytes, b7 as readWorkspaceArchiveFromEnvelopeSessionState, b8 as recordingStorageKey, b9 as restoredSandboxSessionStateFromEntry, ba as sandboxStateEntryFromRunState, bb as selectBackend, bc as selfhostedLiveness, bd as serializeEstablishedSandboxEnvelope, be as setSelfhostedApplyDiff, bf as startRecording, bg as stopRecording, bh as stripExecBanner, bi as subjectFor, bj as sweepModalOrphanSandboxes, bk as tagModalSandbox, bl as tearDownDisplayStack, bm as tearDownTerminalServer, bn as terminateModalSandboxById, bo as timeoutAgentError, bp as timeoutControlResponse, bq as verifyStreamToken } from './index-otZkoLYq.js';
|
|
12
12
|
import 'modal';
|
|
13
13
|
import '@opengeni/agent-proto';
|
|
14
14
|
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
deserializeSandboxSessionStateEnvelope,
|
|
54
54
|
desktopCapableBackend,
|
|
55
55
|
ensureDisplayStack,
|
|
56
|
+
ensureModalRegistryImage,
|
|
56
57
|
ensureTerminalServer,
|
|
57
58
|
establishSandboxSessionFromEnvelope,
|
|
58
59
|
exposeStreamPort,
|
|
@@ -95,7 +96,7 @@ import {
|
|
|
95
96
|
timeoutAgentError,
|
|
96
97
|
timeoutControlResponse,
|
|
97
98
|
verifyStreamToken
|
|
98
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-BHA2SU3H.js";
|
|
99
100
|
|
|
100
101
|
// src/index.ts
|
|
101
102
|
import { AGENT_INSTRUCTIONS_CORE_PLACEHOLDER, collectSandboxEnvironment as collectSandboxEnvironment2, contextInputBudgetTokens, contextServerCompactThreshold, firstPartyMcpBaseUrl, resolveContextCompactionMode, resolveModelProvider, sandboxLifecycleHookIds } from "@opengeni/config";
|
|
@@ -4417,6 +4418,7 @@ export {
|
|
|
4417
4418
|
elideStaleScreenshotImages,
|
|
4418
4419
|
enforceInputBudget,
|
|
4419
4420
|
ensureDisplayStack,
|
|
4421
|
+
ensureModalRegistryImage,
|
|
4420
4422
|
ensureReadableStreamFrom,
|
|
4421
4423
|
ensureTerminalServer,
|
|
4422
4424
|
establishSandboxSessionFromEnvelope,
|