@opengeni/runtime 2.4.2-canary.1 → 2.4.3-canary.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-D3NTOAWT.js → chunk-P5AEIDAS.js} +6 -6
- package/dist/{chunk-D3NTOAWT.js.map → chunk-P5AEIDAS.js.map} +1 -1
- package/dist/{chunk-7DAVK6Y5.js → chunk-WATBACLT.js} +16 -9
- package/dist/chunk-WATBACLT.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/sandbox/index.js +1 -1
- package/dist/sandbox/providers/modal-command-control.d.ts +3 -2
- package/dist/workspace-tool-gateway.js +2 -2
- package/package.json +11 -11
- package/src/sandbox/providers/modal-command-control.ts +15 -7
- package/src/sandbox/providers/modal.ts +5 -1
- package/dist/chunk-7DAVK6Y5.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -244,7 +244,7 @@ import {
|
|
|
244
244
|
workspaceEnvironmentInstructions,
|
|
245
245
|
wrapAttemptToolDefinitions,
|
|
246
246
|
wrapAttemptToolExecute
|
|
247
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-P5AEIDAS.js";
|
|
248
248
|
import {
|
|
249
249
|
ActiveBackendUnresolvableError,
|
|
250
250
|
BROWSER_CONTROL_ADMIN_TOKEN_FILE,
|
|
@@ -514,7 +514,7 @@ import {
|
|
|
514
514
|
withRunCredentialsClient,
|
|
515
515
|
withRunCredentialsSession,
|
|
516
516
|
withoutSandboxProviderIdentity
|
|
517
|
-
} from "./chunk-
|
|
517
|
+
} from "./chunk-WATBACLT.js";
|
|
518
518
|
import "./chunk-YRKIQK25.js";
|
|
519
519
|
import {
|
|
520
520
|
SKILL_MAX_FILES,
|
package/dist/sandbox/index.js
CHANGED
|
@@ -265,7 +265,7 @@ import {
|
|
|
265
265
|
withRunCredentialsClient,
|
|
266
266
|
withRunCredentialsSession,
|
|
267
267
|
withoutSandboxProviderIdentity
|
|
268
|
-
} from "../chunk-
|
|
268
|
+
} from "../chunk-WATBACLT.js";
|
|
269
269
|
import "../chunk-YRKIQK25.js";
|
|
270
270
|
import "../chunk-ORKCCH5X.js";
|
|
271
271
|
import "../chunk-PZ5AY32C.js";
|
|
@@ -24,11 +24,12 @@ export type ModalProviderOutputPage = {
|
|
|
24
24
|
* returned locator/cursors outside the command's write authority. */
|
|
25
25
|
export declare class ModalCommandControl {
|
|
26
26
|
private readonly client;
|
|
27
|
-
private readonly
|
|
27
|
+
private readonly sandboxIdentity;
|
|
28
28
|
private readonly root;
|
|
29
29
|
private readonly environment;
|
|
30
30
|
private constructor();
|
|
31
|
-
static forSandbox(client: CommandClient, sandboxId: string, root: string, environment?: Record<string, string> | (() => Record<string, string>)): ModalCommandControl;
|
|
31
|
+
static forSandbox(client: CommandClient, sandboxId: string | (() => string), root: string, environment?: Record<string, string> | (() => Record<string, string>)): ModalCommandControl;
|
|
32
|
+
private get sandboxId();
|
|
32
33
|
start(args: ChannelAExecArgs, signal?: AbortSignal): Promise<ModalProviderCommand>;
|
|
33
34
|
read(command: ModalProviderCommand, yieldTimeMs: number, signal?: AbortSignal): Promise<ModalProviderOutputPage>;
|
|
34
35
|
write(command: ModalProviderCommand, chars: string, messageIndex: number): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/runtime",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3-canary.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
"@openai/agents": "0.14.3",
|
|
63
63
|
"@openai/agents-core": "0.14.3",
|
|
64
64
|
"@openai/agents-extensions": "0.14.3",
|
|
65
|
-
"@opengeni/agent-proto": "^0.5.1-canary.
|
|
66
|
-
"@opengeni/capabilities": "^0.3.3-canary.
|
|
67
|
-
"@opengeni/codemode": "^0.5.
|
|
68
|
-
"@opengeni/codex": "^0.2.22-canary.
|
|
69
|
-
"@opengeni/config": "^1.0.
|
|
70
|
-
"@opengeni/contracts": "^2.15.
|
|
71
|
-
"@opengeni/network": "^0.3.1-canary.
|
|
72
|
-
"@opengeni/sdk": "^4.0.
|
|
73
|
-
"@opengeni/tool-gateway": "^0.1.
|
|
74
|
-
"@opengeni/xai-subscription": "^0.1.4-canary.
|
|
65
|
+
"@opengeni/agent-proto": "^0.5.1-canary.23",
|
|
66
|
+
"@opengeni/capabilities": "^0.3.3-canary.5",
|
|
67
|
+
"@opengeni/codemode": "^0.5.3-canary.0",
|
|
68
|
+
"@opengeni/codex": "^0.2.22-canary.5",
|
|
69
|
+
"@opengeni/config": "^1.0.4-canary.0",
|
|
70
|
+
"@opengeni/contracts": "^2.15.2-canary.0",
|
|
71
|
+
"@opengeni/network": "^0.3.1-canary.5",
|
|
72
|
+
"@opengeni/sdk": "^4.0.2-canary.0",
|
|
73
|
+
"@opengeni/tool-gateway": "^0.1.4-canary.0",
|
|
74
|
+
"@opengeni/xai-subscription": "^0.1.4-canary.5",
|
|
75
75
|
"debug": "4.4.3",
|
|
76
76
|
"modal": "0.9.0",
|
|
77
77
|
"openai": "6.47.0",
|
|
@@ -117,14 +117,14 @@ function decodePage(prior: string, input: Uint8Array[], terminal: boolean) {
|
|
|
117
117
|
export class ModalCommandControl {
|
|
118
118
|
private constructor(
|
|
119
119
|
private readonly client: ControlPlane,
|
|
120
|
-
private readonly
|
|
120
|
+
private readonly sandboxIdentity: string | (() => string),
|
|
121
121
|
private readonly root: string,
|
|
122
122
|
private readonly environment: Record<string, string> | (() => Record<string, string>) = {},
|
|
123
123
|
) {}
|
|
124
124
|
|
|
125
125
|
static forSandbox(
|
|
126
126
|
client: CommandClient,
|
|
127
|
-
sandboxId: string,
|
|
127
|
+
sandboxId: string | (() => string),
|
|
128
128
|
root: string,
|
|
129
129
|
environment: Record<string, string> | (() => Record<string, string>) = {},
|
|
130
130
|
): ModalCommandControl {
|
|
@@ -133,16 +133,24 @@ export class ModalCommandControl {
|
|
|
133
133
|
return new ModalCommandControl(commandControlPlane(client), sandboxId, root, environment);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
private get sandboxId(): string {
|
|
137
|
+
return typeof this.sandboxIdentity === "function"
|
|
138
|
+
? this.sandboxIdentity()
|
|
139
|
+
: this.sandboxIdentity;
|
|
140
|
+
}
|
|
141
|
+
|
|
136
142
|
async start(args: ChannelAExecArgs, signal?: AbortSignal): Promise<ModalProviderCommand> {
|
|
137
143
|
signal?.throwIfAborted();
|
|
138
144
|
const workdir = posix.resolve(this.root, args.workdir ?? this.root);
|
|
139
145
|
if (workdir !== this.root && !workdir.startsWith(`${this.root.replace(/\/$/u, "")}/`))
|
|
140
146
|
throw new Error("Command workdir is outside the sandbox workspace");
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
);
|
|
147
|
+
// Hydration replaces the SDK sandbox. Freeze its current identity for this
|
|
148
|
+
// start so an asynchronous replacement cannot relabel the returned locator.
|
|
149
|
+
const sandboxId = this.sandboxId;
|
|
150
|
+
const task = await this.client.sandboxGetTaskId({ sandboxId }, signal ? { signal } : undefined);
|
|
145
151
|
if (!task.taskId || task.taskResult) throw new Error("Modal command task is unavailable");
|
|
152
|
+
if (sandboxId !== this.sandboxId)
|
|
153
|
+
throw new Error("Modal sandbox changed during command preparation");
|
|
146
154
|
const login = args.shell ? (args.login ?? true) : false;
|
|
147
155
|
let command = [args.shell ?? "/bin/sh", login ? "-lc" : "-c", args.cmd];
|
|
148
156
|
if (args.runAs) {
|
|
@@ -194,7 +202,7 @@ export class ModalCommandControl {
|
|
|
194
202
|
if (!result.execId) throw new Error("Modal command start returned no execution identity");
|
|
195
203
|
return {
|
|
196
204
|
kind: "modal-control-v1",
|
|
197
|
-
sandboxId
|
|
205
|
+
sandboxId,
|
|
198
206
|
taskId: task.taskId,
|
|
199
207
|
execId: result.execId,
|
|
200
208
|
...(args.tty ? { pty: true } : {}),
|
|
@@ -562,7 +562,11 @@ export function installOpenGeniModalSnapshotPolicy<T extends object>(session: T)
|
|
|
562
562
|
profile: mutable.modal.profile,
|
|
563
563
|
...(mutable.modal.logger ? { logger: mutable.modal.logger } : {}),
|
|
564
564
|
},
|
|
565
|
-
|
|
565
|
+
() => {
|
|
566
|
+
const sandboxId = mutable.state?.sandboxId;
|
|
567
|
+
if (!sandboxId) throw new Error("Modal session sandbox identity is unavailable");
|
|
568
|
+
return sandboxId;
|
|
569
|
+
},
|
|
566
570
|
mutable.state.manifest.root,
|
|
567
571
|
() => mutable.state?.environment ?? {},
|
|
568
572
|
),
|