@agent-vm/agent-portal-sdk 0.0.118 → 0.0.120
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/package.json +1 -1
- package/dist/adapter-boundary/index.d.ts +0 -2
- package/dist/adapter-boundary/index.js +0 -2
- package/dist/adapter-boundary-BIagsTUH.js +0 -29
- package/dist/adapter-boundary-BIagsTUH.js.map +0 -1
- package/dist/approval-surface/index.d.ts +0 -2
- package/dist/approval-surface/index.js +0 -2
- package/dist/approval-surface-en5VAY5h.js +0 -20
- package/dist/approval-surface-en5VAY5h.js.map +0 -1
- package/dist/artifact-reference-schema-CiEjxYPd.js +0 -13
- package/dist/artifact-reference-schema-CiEjxYPd.js.map +0 -1
- package/dist/artifact-surface/index.d.ts +0 -2
- package/dist/artifact-surface/index.js +0 -3
- package/dist/artifact-surface-BstQxq6b.js +0 -65
- package/dist/artifact-surface-BstQxq6b.js.map +0 -1
- package/dist/capability-description-surface/index.d.ts +0 -2
- package/dist/capability-description-surface/index.js +0 -3
- package/dist/capability-description-surface-BdzknTKT.js +0 -2
- package/dist/capability-descriptor-schema-zRnfGjBc.js +0 -86
- package/dist/capability-descriptor-schema-zRnfGjBc.js.map +0 -1
- package/dist/cli/tool-portal.d.ts +0 -1
- package/dist/cli/tool-portal.js +0 -207
- package/dist/cli/tool-portal.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -2
- package/dist/contracts/index.js +0 -2
- package/dist/contracts-RgGW0RX2.js +0 -611
- package/dist/contracts-RgGW0RX2.js.map +0 -1
- package/dist/gateway-runtime-client/index.d.ts +0 -385
- package/dist/gateway-runtime-client/index.d.ts.map +0 -1
- package/dist/gateway-runtime-client/index.js +0 -1439
- package/dist/gateway-runtime-client/index.js.map +0 -1
- package/dist/gateway-runtime-local-exec/gateway-runtime-local-exec-helper.d.ts +0 -1
- package/dist/gateway-runtime-local-exec/gateway-runtime-local-exec-helper.js +0 -125
- package/dist/gateway-runtime-local-exec/gateway-runtime-local-exec-helper.js.map +0 -1
- package/dist/gateway-runtime-local-exec/index.d.ts +0 -54
- package/dist/gateway-runtime-local-exec/index.d.ts.map +0 -1
- package/dist/gateway-runtime-local-exec/index.js +0 -2
- package/dist/gateway-runtime-local-exec-transport-B1hy2A3Q.js +0 -427
- package/dist/gateway-runtime-local-exec-transport-B1hy2A3Q.js.map +0 -1
- package/dist/index-B5hgm1KH.d.ts +0 -84
- package/dist/index-B5hgm1KH.d.ts.map +0 -1
- package/dist/index-BWE2_BcN.d.ts +0 -64
- package/dist/index-BWE2_BcN.d.ts.map +0 -1
- package/dist/index-Bdnvj5j3.d.ts +0 -142
- package/dist/index-Bdnvj5j3.d.ts.map +0 -1
- package/dist/index-BmH68K78.d.ts +0 -41
- package/dist/index-BmH68K78.d.ts.map +0 -1
- package/dist/index-C-NPMMvc.d.ts +0 -2396
- package/dist/index-C-NPMMvc.d.ts.map +0 -1
- package/dist/index-CMdPnnNL.d.ts +0 -152
- package/dist/index-CMdPnnNL.d.ts.map +0 -1
- package/dist/index-DKBSYuxW.d.ts +0 -239
- package/dist/index-DKBSYuxW.d.ts.map +0 -1
- package/dist/index-DbBiCdX7.d.ts +0 -69
- package/dist/index-DbBiCdX7.d.ts.map +0 -1
- package/dist/index-Dj4galCJ.d.ts +0 -17
- package/dist/index-Dj4galCJ.d.ts.map +0 -1
- package/dist/index-Dxoz-ORl.d.ts +0 -229
- package/dist/index-Dxoz-ORl.d.ts.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -16
- package/dist/json-value-schema-M87sjwWL.d.ts +0 -18
- package/dist/json-value-schema-M87sjwWL.d.ts.map +0 -1
- package/dist/json-value-schema-hdPkabRZ.js +0 -29
- package/dist/json-value-schema-hdPkabRZ.js.map +0 -1
- package/dist/node-tool-portal-mcp-transport-Cl2VKbLY.js +0 -156
- package/dist/node-tool-portal-mcp-transport-Cl2VKbLY.js.map +0 -1
- package/dist/portable-contracts/index.d.ts +0 -2
- package/dist/portable-contracts/index.js +0 -3
- package/dist/portable-contracts-Bca33zVa.js +0 -326
- package/dist/portable-contracts-Bca33zVa.js.map +0 -1
- package/dist/portable-refinement-authoring-ZSmR-amG.js +0 -196
- package/dist/portable-refinement-authoring-ZSmR-amG.js.map +0 -1
- package/dist/portal-call-request-schema-Cp6CMGs9.js +0 -41
- package/dist/portal-call-request-schema-Cp6CMGs9.js.map +0 -1
- package/dist/portal-call-result-schema-ByxHRCEN.js +0 -158
- package/dist/portal-call-result-schema-ByxHRCEN.js.map +0 -1
- package/dist/portal-call-result-schema-wSCaz3mC.d.ts +0 -1485
- package/dist/portal-call-result-schema-wSCaz3mC.d.ts.map +0 -1
- package/dist/portal-call-surface/index.d.ts +0 -3
- package/dist/portal-call-surface/index.js +0 -5
- package/dist/portal-call-surface-DjZVquFt.js +0 -83
- package/dist/portal-call-surface-DjZVquFt.js.map +0 -1
- package/dist/portal-error-schema-CQHgoFq4.js +0 -71
- package/dist/portal-error-schema-CQHgoFq4.js.map +0 -1
- package/dist/portal-event-surface/index.d.ts +0 -2
- package/dist/portal-event-surface/index.js +0 -3
- package/dist/portal-event-surface-CdScrgoN.js +0 -51
- package/dist/portal-event-surface-CdScrgoN.js.map +0 -1
- package/dist/testing/index.d.ts +0 -19
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -36
- package/dist/testing/index.js.map +0 -1
- package/dist/tool-portal-mcp-client/index.d.ts +0 -2
- package/dist/tool-portal-mcp-client/index.js +0 -2
- package/dist/tool-portal-mcp-client/node-tool-portal-mcp-transport.d.ts +0 -17
- package/dist/tool-portal-mcp-client/node-tool-portal-mcp-transport.d.ts.map +0 -1
- package/dist/tool-portal-mcp-client/node-tool-portal-mcp-transport.js +0 -2
- package/dist/tool-portal-mcp-client-DwJF-48Y.js +0 -90
- package/dist/tool-portal-mcp-client-DwJF-48Y.js.map +0 -1
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import { chmod, mkdtemp, rm } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { createServer } from "node:net";
|
|
4
|
-
import { randomBytes } from "node:crypto";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
//#region src/gateway-runtime-local-exec/gateway-runtime-local-exec-protocol.ts
|
|
7
|
-
const MAXIMUM_LOCAL_EXEC_FRAME_BYTES = 128 * 1024;
|
|
8
|
-
const MAXIMUM_LOCAL_EXEC_STREAM_CHUNK_BYTES = 64 * 1024;
|
|
9
|
-
const MAXIMUM_LOCAL_EXEC_TOKEN_BYTES = 256;
|
|
10
|
-
var GatewayRuntimeLocalExecProtocolError = class extends Error {
|
|
11
|
-
constructor(message) {
|
|
12
|
-
super(message);
|
|
13
|
-
this.name = "GatewayRuntimeLocalExecProtocolError";
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
function isRecord(value) {
|
|
17
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18
|
-
}
|
|
19
|
-
function requireExactKeys(value, keys) {
|
|
20
|
-
const actualKeys = Object.keys(value).toSorted();
|
|
21
|
-
const expectedKeys = keys.toSorted();
|
|
22
|
-
if (actualKeys.length !== expectedKeys.length || actualKeys.some((key, index) => key !== expectedKeys[index])) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame contains unexpected fields.");
|
|
23
|
-
}
|
|
24
|
-
function requireString(value, fieldName) {
|
|
25
|
-
if (typeof value !== "string" || value.length === 0) throw new GatewayRuntimeLocalExecProtocolError(`Local exec frame field '${fieldName}' must be a non-empty string.`);
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
function requireBoundedToken(value) {
|
|
29
|
-
const token = requireString(value, "token");
|
|
30
|
-
if (Buffer.byteLength(token, "utf8") > MAXIMUM_LOCAL_EXEC_TOKEN_BYTES) throw new GatewayRuntimeLocalExecProtocolError("Local exec reservation token exceeds the byte limit.");
|
|
31
|
-
return token;
|
|
32
|
-
}
|
|
33
|
-
function requireCanonicalBase64(value) {
|
|
34
|
-
const encoded = requireString(value, "contentBase64");
|
|
35
|
-
const decoded = Buffer.from(encoded, "base64");
|
|
36
|
-
if (decoded.byteLength > MAXIMUM_LOCAL_EXEC_STREAM_CHUNK_BYTES || decoded.toString("base64") !== encoded) throw new GatewayRuntimeLocalExecProtocolError("Local exec stream content must be canonical bounded base64.");
|
|
37
|
-
return encoded;
|
|
38
|
-
}
|
|
39
|
-
function requireTerminalDimension(value, fieldName) {
|
|
40
|
-
if (!Number.isSafeInteger(value) || value <= 0 || value > 1e3) throw new GatewayRuntimeLocalExecProtocolError(`Local exec frame field '${fieldName}' must be a bounded positive integer.`);
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
|
-
function parseJsonObject(line) {
|
|
44
|
-
if (Buffer.byteLength(line, "utf8") > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame exceeds the byte limit.");
|
|
45
|
-
let value;
|
|
46
|
-
try {
|
|
47
|
-
value = JSON.parse(line);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
throw new GatewayRuntimeLocalExecProtocolError(error instanceof Error ? `Local exec frame is not valid JSON: ${error.message}` : "Local exec frame is not valid JSON.");
|
|
50
|
-
}
|
|
51
|
-
if (!isRecord(value)) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame must be an object.");
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
function encodeGatewayRuntimeLocalExecFrame(frame) {
|
|
55
|
-
return `${JSON.stringify(frame)}\n`;
|
|
56
|
-
}
|
|
57
|
-
function parseGatewayRuntimeLocalExecClientFrame(line) {
|
|
58
|
-
const value = parseJsonObject(line);
|
|
59
|
-
const kind = requireString(value.kind, "kind");
|
|
60
|
-
switch (kind) {
|
|
61
|
-
case "authenticate":
|
|
62
|
-
requireExactKeys(value, ["kind", "token"]);
|
|
63
|
-
return {
|
|
64
|
-
kind,
|
|
65
|
-
token: requireBoundedToken(value.token)
|
|
66
|
-
};
|
|
67
|
-
case "cancel":
|
|
68
|
-
case "stdin-end":
|
|
69
|
-
requireExactKeys(value, ["kind"]);
|
|
70
|
-
return { kind };
|
|
71
|
-
case "stdin-chunk":
|
|
72
|
-
requireExactKeys(value, ["contentBase64", "kind"]);
|
|
73
|
-
return {
|
|
74
|
-
contentBase64: requireCanonicalBase64(value.contentBase64),
|
|
75
|
-
kind
|
|
76
|
-
};
|
|
77
|
-
case "terminal-resize":
|
|
78
|
-
requireExactKeys(value, [
|
|
79
|
-
"columns",
|
|
80
|
-
"kind",
|
|
81
|
-
"rows"
|
|
82
|
-
]);
|
|
83
|
-
return {
|
|
84
|
-
columns: requireTerminalDimension(value.columns, "columns"),
|
|
85
|
-
kind,
|
|
86
|
-
rows: requireTerminalDimension(value.rows, "rows")
|
|
87
|
-
};
|
|
88
|
-
default: throw new GatewayRuntimeLocalExecProtocolError(`Unknown local exec client frame '${kind}'.`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function parseGatewayRuntimeLocalExecServerFrame(line) {
|
|
92
|
-
const value = parseJsonObject(line);
|
|
93
|
-
const kind = requireString(value.kind, "kind");
|
|
94
|
-
switch (kind) {
|
|
95
|
-
case "accepted":
|
|
96
|
-
case "stderr-end":
|
|
97
|
-
case "stdout-end":
|
|
98
|
-
requireExactKeys(value, ["kind"]);
|
|
99
|
-
return { kind };
|
|
100
|
-
case "stderr-chunk":
|
|
101
|
-
case "stdout-chunk":
|
|
102
|
-
requireExactKeys(value, ["contentBase64", "kind"]);
|
|
103
|
-
return {
|
|
104
|
-
contentBase64: requireCanonicalBase64(value.contentBase64),
|
|
105
|
-
kind
|
|
106
|
-
};
|
|
107
|
-
case "exited":
|
|
108
|
-
requireExactKeys(value, ["exitCode", "kind"]);
|
|
109
|
-
if (value.exitCode !== null && (!Number.isSafeInteger(value.exitCode) || value.exitCode < 0 || value.exitCode > 255)) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame field 'exitCode' must be null or an integer from 0 through 255.");
|
|
110
|
-
return {
|
|
111
|
-
exitCode: value.exitCode,
|
|
112
|
-
kind
|
|
113
|
-
};
|
|
114
|
-
case "rejected":
|
|
115
|
-
requireExactKeys(value, ["kind", "message"]);
|
|
116
|
-
return {
|
|
117
|
-
kind,
|
|
118
|
-
message: requireString(value.message, "message")
|
|
119
|
-
};
|
|
120
|
-
default: throw new GatewayRuntimeLocalExecProtocolError(`Unknown local exec server frame '${kind}'.`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
var GatewayRuntimeLocalExecLineDecoder = class {
|
|
124
|
-
#buffer = Buffer.alloc(0);
|
|
125
|
-
push(chunk) {
|
|
126
|
-
if (chunk.byteLength + this.#buffer.byteLength > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame batch exceeds the byte limit.");
|
|
127
|
-
this.#buffer = Buffer.concat([this.#buffer, chunk]);
|
|
128
|
-
const lines = [];
|
|
129
|
-
let newlineIndex = this.#buffer.indexOf(10);
|
|
130
|
-
while (newlineIndex >= 0) {
|
|
131
|
-
const line = this.#buffer.subarray(0, newlineIndex).toString("utf8");
|
|
132
|
-
this.#buffer = this.#buffer.subarray(newlineIndex + 1);
|
|
133
|
-
if (Buffer.byteLength(line, "utf8") > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame exceeds the byte limit.");
|
|
134
|
-
if (line.length > 0) lines.push(line);
|
|
135
|
-
newlineIndex = this.#buffer.indexOf(10);
|
|
136
|
-
}
|
|
137
|
-
if (this.#buffer.byteLength > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) throw new GatewayRuntimeLocalExecProtocolError("Local exec frame exceeds the byte limit.");
|
|
138
|
-
return lines;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region src/gateway-runtime-local-exec/gateway-runtime-local-exec-transport.ts
|
|
143
|
-
const GATEWAY_RUNTIME_LOCAL_EXEC_SOCKET_ENV = "AGENT_VM_LOCAL_EXEC_SOCKET";
|
|
144
|
-
const GATEWAY_RUNTIME_LOCAL_EXEC_TOKEN_ENV = "AGENT_VM_LOCAL_EXEC_TOKEN";
|
|
145
|
-
const DEFAULT_RESERVATION_TIMEOUT_MS = 15e3;
|
|
146
|
-
const DEFAULT_TEMPORARY_DIRECTORY = "/tmp";
|
|
147
|
-
const MAXIMUM_STREAM_CHUNK_BYTES = 64 * 1024;
|
|
148
|
-
const defaultReservationScheduler = { schedule(callback, delayMs) {
|
|
149
|
-
const timeout = setTimeout(callback, delayMs);
|
|
150
|
-
return { cancel: () => clearTimeout(timeout) };
|
|
151
|
-
} };
|
|
152
|
-
function validateReservationTimeout(timeoutMs) {
|
|
153
|
-
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 6e4) throw new RangeError("Local exec reservation timeout must be an integer from 1 through 60000.");
|
|
154
|
-
return timeoutMs;
|
|
155
|
-
}
|
|
156
|
-
async function closeServer(server) {
|
|
157
|
-
if (!server.listening) return;
|
|
158
|
-
await new Promise((resolve, reject) => {
|
|
159
|
-
server.close((error) => error === void 0 ? resolve() : reject(error));
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
async function writeFrame(socket, frame) {
|
|
163
|
-
const encodedFrame = encodeGatewayRuntimeLocalExecFrame(frame);
|
|
164
|
-
if (socket.write(encodedFrame)) return;
|
|
165
|
-
await new Promise((resolve, reject) => {
|
|
166
|
-
const cleanup = () => {
|
|
167
|
-
socket.off("drain", handleDrain);
|
|
168
|
-
socket.off("error", handleError);
|
|
169
|
-
};
|
|
170
|
-
const handleDrain = () => {
|
|
171
|
-
cleanup();
|
|
172
|
-
resolve();
|
|
173
|
-
};
|
|
174
|
-
const handleError = (error) => {
|
|
175
|
-
cleanup();
|
|
176
|
-
reject(error);
|
|
177
|
-
};
|
|
178
|
-
socket.once("drain", handleDrain);
|
|
179
|
-
socket.once("error", handleError);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
var GatewayRuntimeLocalExecFrameWriter = class {
|
|
183
|
-
#pendingWrite = Promise.resolve();
|
|
184
|
-
#socket;
|
|
185
|
-
constructor(socket) {
|
|
186
|
-
this.#socket = socket;
|
|
187
|
-
}
|
|
188
|
-
async write(frame) {
|
|
189
|
-
const write = this.#pendingWrite.then(async () => await writeFrame(this.#socket, frame));
|
|
190
|
-
this.#pendingWrite = write.catch(() => void 0);
|
|
191
|
-
await write;
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
async function endSocket(socket) {
|
|
195
|
-
if (socket.destroyed) return;
|
|
196
|
-
await new Promise((resolve) => socket.end(resolve));
|
|
197
|
-
}
|
|
198
|
-
async function pumpOutput(props) {
|
|
199
|
-
const read = props.kind === "stdout" ? props.operation.readStdout.bind(props.operation) : props.operation.readStderr.bind(props.operation);
|
|
200
|
-
if (props.socket.destroyed) return;
|
|
201
|
-
const result = await read(MAXIMUM_STREAM_CHUNK_BYTES);
|
|
202
|
-
if (result.kind === "end") {
|
|
203
|
-
await props.frameWriter.write({ kind: `${props.kind}-end` });
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
await props.frameWriter.write({
|
|
207
|
-
contentBase64: Buffer.from(result.content).toString("base64"),
|
|
208
|
-
kind: `${props.kind}-chunk`
|
|
209
|
-
});
|
|
210
|
-
await pumpOutput(props);
|
|
211
|
-
}
|
|
212
|
-
var GatewayRuntimeLocalExecTransport = class {
|
|
213
|
-
#helperArgv;
|
|
214
|
-
#reservationScheduler;
|
|
215
|
-
#reservationTimeoutMs;
|
|
216
|
-
#reservations = /* @__PURE__ */ new Map();
|
|
217
|
-
#temporaryDirectory;
|
|
218
|
-
constructor(options = {}) {
|
|
219
|
-
this.#helperArgv = options.helperArgv ?? Object.freeze([process.execPath, fileURLToPath(new URL("./gateway-runtime-local-exec/gateway-runtime-local-exec-helper.js", import.meta.url))]);
|
|
220
|
-
if (this.#helperArgv.length === 0) throw new TypeError("Local exec helper argv cannot be empty.");
|
|
221
|
-
this.#reservationScheduler = options.reservationScheduler ?? defaultReservationScheduler;
|
|
222
|
-
this.#reservationTimeoutMs = validateReservationTimeout(options.reservationTimeoutMs ?? DEFAULT_RESERVATION_TIMEOUT_MS);
|
|
223
|
-
this.#temporaryDirectory = options.temporaryDirectory ?? DEFAULT_TEMPORARY_DIRECTORY;
|
|
224
|
-
}
|
|
225
|
-
async reserve(operation) {
|
|
226
|
-
const reservationId = randomBytes(16).toString("hex");
|
|
227
|
-
const token = randomBytes(32).toString("base64url");
|
|
228
|
-
const reservationDirectory = await mkdtemp(join(this.#temporaryDirectory, "agent-vm-local-exec-"));
|
|
229
|
-
await chmod(reservationDirectory, 448);
|
|
230
|
-
const socketPath = join(reservationDirectory, "relay.sock");
|
|
231
|
-
const server = createServer();
|
|
232
|
-
const reservation = {
|
|
233
|
-
cancelExpiry: this.#reservationScheduler.schedule(() => {
|
|
234
|
-
this.#expireReservation(reservationId).catch(() => void 0);
|
|
235
|
-
}, this.#reservationTimeoutMs).cancel,
|
|
236
|
-
consumed: false,
|
|
237
|
-
finalized: false,
|
|
238
|
-
operation,
|
|
239
|
-
reservationDirectory,
|
|
240
|
-
reservationId,
|
|
241
|
-
server,
|
|
242
|
-
socketPath,
|
|
243
|
-
token
|
|
244
|
-
};
|
|
245
|
-
this.#reservations.set(reservationId, reservation);
|
|
246
|
-
server.on("connection", (socket) => this.#acceptConnection(reservation, socket));
|
|
247
|
-
try {
|
|
248
|
-
await new Promise((resolve, reject) => {
|
|
249
|
-
server.once("error", reject);
|
|
250
|
-
server.listen(socketPath, () => {
|
|
251
|
-
server.off("error", reject);
|
|
252
|
-
resolve();
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
await chmod(socketPath, 384);
|
|
256
|
-
} catch (error) {
|
|
257
|
-
await this.#disposeReservation(reservation, true);
|
|
258
|
-
throw error;
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
argv: [...this.#helperArgv],
|
|
262
|
-
env: {
|
|
263
|
-
[GATEWAY_RUNTIME_LOCAL_EXEC_SOCKET_ENV]: socketPath,
|
|
264
|
-
[GATEWAY_RUNTIME_LOCAL_EXEC_TOKEN_ENV]: token
|
|
265
|
-
},
|
|
266
|
-
finalizeToken: {
|
|
267
|
-
kind: "gateway-runtime-local-exec",
|
|
268
|
-
reservationId
|
|
269
|
-
},
|
|
270
|
-
stdinMode: "pipe-open"
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
async finalize(token) {
|
|
274
|
-
const reservationId = typeof token === "object" && token !== null ? Reflect.get(token, "reservationId") : void 0;
|
|
275
|
-
if (typeof token !== "object" || token === null || Reflect.get(token, "kind") !== "gateway-runtime-local-exec" || typeof reservationId !== "string") return;
|
|
276
|
-
const reservation = this.#reservations.get(reservationId);
|
|
277
|
-
if (reservation === void 0) return;
|
|
278
|
-
await this.#disposeReservation(reservation, !reservation.consumed);
|
|
279
|
-
}
|
|
280
|
-
async close() {
|
|
281
|
-
await Promise.all([...this.#reservations.values()].map(async (reservation) => await this.#disposeReservation(reservation, true)));
|
|
282
|
-
}
|
|
283
|
-
async #expireReservation(reservationId) {
|
|
284
|
-
const reservation = this.#reservations.get(reservationId);
|
|
285
|
-
if (reservation === void 0 || reservation.consumed) return;
|
|
286
|
-
await this.#disposeReservation(reservation, true);
|
|
287
|
-
}
|
|
288
|
-
#acceptConnection(reservation, socket) {
|
|
289
|
-
if (reservation.finalized || reservation.consumed) {
|
|
290
|
-
writeFrame(socket, {
|
|
291
|
-
kind: "rejected",
|
|
292
|
-
message: "Reservation already consumed."
|
|
293
|
-
}).catch(() => void 0).finally(() => socket.destroy());
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
const decoder = new GatewayRuntimeLocalExecLineDecoder();
|
|
297
|
-
const connectionState = { authenticated: false };
|
|
298
|
-
socket.once("close", () => {
|
|
299
|
-
if (connectionState.authenticated && !reservation.finalized) this.#disposeReservation(reservation, true).catch(() => void 0);
|
|
300
|
-
});
|
|
301
|
-
socket.on("data", (chunk) => {
|
|
302
|
-
socket.pause();
|
|
303
|
-
this.#processClientFrames({
|
|
304
|
-
chunk,
|
|
305
|
-
connectionState,
|
|
306
|
-
decoder,
|
|
307
|
-
reservation,
|
|
308
|
-
socket
|
|
309
|
-
}).then(() => {
|
|
310
|
-
if (!socket.destroyed) socket.resume();
|
|
311
|
-
}).catch((error) => {
|
|
312
|
-
writeFrame(socket, {
|
|
313
|
-
kind: "rejected",
|
|
314
|
-
message: error instanceof Error ? error.message : "Invalid local exec frame."
|
|
315
|
-
}).catch(() => void 0).finally(() => socket.destroy());
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
async #processClientFrames(props) {
|
|
320
|
-
for (const line of props.decoder.push(props.chunk)) {
|
|
321
|
-
const frame = parseGatewayRuntimeLocalExecClientFrame(line);
|
|
322
|
-
if (!props.connectionState.authenticated) {
|
|
323
|
-
if (frame.kind !== "authenticate" || frame.token !== props.reservation.token || props.reservation.consumed) {
|
|
324
|
-
await writeFrame(props.socket, {
|
|
325
|
-
kind: "rejected",
|
|
326
|
-
message: frame.kind === "authenticate" && frame.token === props.reservation.token ? "Reservation already consumed." : "Invalid reservation token."
|
|
327
|
-
});
|
|
328
|
-
props.socket.destroy();
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
props.connectionState.authenticated = true;
|
|
332
|
-
props.reservation.consumed = true;
|
|
333
|
-
props.reservation.cancelExpiry();
|
|
334
|
-
props.reservation.socket = props.socket;
|
|
335
|
-
props.reservation.server.close();
|
|
336
|
-
await writeFrame(props.socket, { kind: "accepted" });
|
|
337
|
-
this.#runAuthenticatedOperation(props.reservation, props.socket).catch(() => void 0);
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
switch (frame.kind) {
|
|
341
|
-
case "authenticate": throw new GatewayRuntimeLocalExecProtocolError("Duplicate authentication frame.");
|
|
342
|
-
case "cancel":
|
|
343
|
-
await props.reservation.operation.cancel();
|
|
344
|
-
return;
|
|
345
|
-
case "stdin-chunk":
|
|
346
|
-
await props.reservation.operation.writeStdin(Buffer.from(frame.contentBase64, "base64"));
|
|
347
|
-
continue;
|
|
348
|
-
case "stdin-end":
|
|
349
|
-
await props.reservation.operation.closeStdin();
|
|
350
|
-
continue;
|
|
351
|
-
case "terminal-resize":
|
|
352
|
-
if (props.reservation.operation.resizeTerminal === void 0) throw new GatewayRuntimeLocalExecProtocolError("Terminal resize is unavailable.");
|
|
353
|
-
await props.reservation.operation.resizeTerminal({
|
|
354
|
-
columns: frame.columns,
|
|
355
|
-
rows: frame.rows
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
async #runAuthenticatedOperation(reservation, socket) {
|
|
361
|
-
try {
|
|
362
|
-
const frameWriter = new GatewayRuntimeLocalExecFrameWriter(socket);
|
|
363
|
-
const [waitResult] = await Promise.all([
|
|
364
|
-
reservation.operation.wait(),
|
|
365
|
-
pumpOutput({
|
|
366
|
-
frameWriter,
|
|
367
|
-
kind: "stdout",
|
|
368
|
-
operation: reservation.operation,
|
|
369
|
-
socket
|
|
370
|
-
}),
|
|
371
|
-
pumpOutput({
|
|
372
|
-
frameWriter,
|
|
373
|
-
kind: "stderr",
|
|
374
|
-
operation: reservation.operation,
|
|
375
|
-
socket
|
|
376
|
-
})
|
|
377
|
-
]);
|
|
378
|
-
if (!socket.destroyed) {
|
|
379
|
-
await frameWriter.write({
|
|
380
|
-
exitCode: waitResult.exitCode,
|
|
381
|
-
kind: "exited"
|
|
382
|
-
});
|
|
383
|
-
await endSocket(socket);
|
|
384
|
-
}
|
|
385
|
-
} catch {
|
|
386
|
-
socket.destroy();
|
|
387
|
-
} finally {
|
|
388
|
-
await this.#disposeReservation(reservation, false);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
async #disposeReservation(reservation, cancel) {
|
|
392
|
-
if (reservation.disposal !== void 0) return await reservation.disposal;
|
|
393
|
-
reservation.disposal = this.#disposeReservationOnce(reservation, cancel);
|
|
394
|
-
await reservation.disposal;
|
|
395
|
-
}
|
|
396
|
-
async #disposeReservationOnce(reservation, cancel) {
|
|
397
|
-
if (reservation.finalized) return;
|
|
398
|
-
reservation.finalized = true;
|
|
399
|
-
reservation.cancelExpiry();
|
|
400
|
-
let cancellationError;
|
|
401
|
-
if (cancel) try {
|
|
402
|
-
await reservation.operation.cancel();
|
|
403
|
-
} catch (error) {
|
|
404
|
-
cancellationError = error;
|
|
405
|
-
}
|
|
406
|
-
let cleanupError;
|
|
407
|
-
try {
|
|
408
|
-
reservation.socket?.destroy();
|
|
409
|
-
await closeServer(reservation.server).catch(() => void 0);
|
|
410
|
-
await rm(reservation.reservationDirectory, {
|
|
411
|
-
force: true,
|
|
412
|
-
recursive: true
|
|
413
|
-
});
|
|
414
|
-
} catch (error) {
|
|
415
|
-
cleanupError = error;
|
|
416
|
-
} finally {
|
|
417
|
-
this.#reservations.delete(reservation.reservationId);
|
|
418
|
-
}
|
|
419
|
-
if (cancellationError !== void 0 && cleanupError !== void 0) throw new AggregateError([cancellationError, cleanupError], "Local exec cancellation and cleanup both failed.");
|
|
420
|
-
if (cancellationError !== void 0) throw cancellationError;
|
|
421
|
-
if (cleanupError !== void 0) throw cleanupError;
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
//#endregion
|
|
425
|
-
export { encodeGatewayRuntimeLocalExecFrame as a, GatewayRuntimeLocalExecLineDecoder as i, GATEWAY_RUNTIME_LOCAL_EXEC_TOKEN_ENV as n, parseGatewayRuntimeLocalExecServerFrame as o, GatewayRuntimeLocalExecTransport as r, GATEWAY_RUNTIME_LOCAL_EXEC_SOCKET_ENV as t };
|
|
426
|
-
|
|
427
|
-
//# sourceMappingURL=gateway-runtime-local-exec-transport-B1hy2A3Q.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-runtime-local-exec-transport-B1hy2A3Q.js","names":["#buffer","#socket","#pendingWrite","#helperArgv","#reservationScheduler","#reservationTimeoutMs","#reservations","#temporaryDirectory","#expireReservation","#acceptConnection","#disposeReservation","#processClientFrames","#runAuthenticatedOperation","#disposeReservationOnce"],"sources":["../src/gateway-runtime-local-exec/gateway-runtime-local-exec-protocol.ts","../src/gateway-runtime-local-exec/gateway-runtime-local-exec-transport.ts"],"sourcesContent":["const MAXIMUM_LOCAL_EXEC_FRAME_BYTES = 128 * 1024;\nconst MAXIMUM_LOCAL_EXEC_STREAM_CHUNK_BYTES = 64 * 1024;\nconst MAXIMUM_LOCAL_EXEC_TOKEN_BYTES = 256;\n\nexport type GatewayRuntimeLocalExecClientFrame =\n\t| { readonly kind: 'authenticate'; readonly token: string }\n\t| { readonly kind: 'cancel' }\n\t| { readonly contentBase64: string; readonly kind: 'stdin-chunk' }\n\t| { readonly kind: 'stdin-end' }\n\t| { readonly columns: number; readonly kind: 'terminal-resize'; readonly rows: number };\n\nexport type GatewayRuntimeLocalExecServerFrame =\n\t| { readonly kind: 'accepted' }\n\t| { readonly contentBase64: string; readonly kind: 'stderr-chunk' }\n\t| { readonly kind: 'stderr-end' }\n\t| { readonly exitCode: number | null; readonly kind: 'exited' }\n\t| { readonly message: string; readonly kind: 'rejected' }\n\t| { readonly contentBase64: string; readonly kind: 'stdout-chunk' }\n\t| { readonly kind: 'stdout-end' };\n\nexport class GatewayRuntimeLocalExecProtocolError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = 'GatewayRuntimeLocalExecProtocolError';\n\t}\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction requireExactKeys(value: Readonly<Record<string, unknown>>, keys: readonly string[]): void {\n\tconst actualKeys = Object.keys(value).toSorted();\n\tconst expectedKeys = keys.toSorted();\n\tif (\n\t\tactualKeys.length !== expectedKeys.length ||\n\t\tactualKeys.some((key, index) => key !== expectedKeys[index])\n\t) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError('Local exec frame contains unexpected fields.');\n\t}\n}\n\nfunction requireString(value: unknown, fieldName: string): string {\n\tif (typeof value !== 'string' || value.length === 0) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\t`Local exec frame field '${fieldName}' must be a non-empty string.`,\n\t\t);\n\t}\n\treturn value;\n}\n\nfunction requireBoundedToken(value: unknown): string {\n\tconst token = requireString(value, 'token');\n\tif (Buffer.byteLength(token, 'utf8') > MAXIMUM_LOCAL_EXEC_TOKEN_BYTES) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\t'Local exec reservation token exceeds the byte limit.',\n\t\t);\n\t}\n\treturn token;\n}\n\nfunction requireCanonicalBase64(value: unknown): string {\n\tconst encoded = requireString(value, 'contentBase64');\n\tconst decoded = Buffer.from(encoded, 'base64');\n\tif (\n\t\tdecoded.byteLength > MAXIMUM_LOCAL_EXEC_STREAM_CHUNK_BYTES ||\n\t\tdecoded.toString('base64') !== encoded\n\t) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\t'Local exec stream content must be canonical bounded base64.',\n\t\t);\n\t}\n\treturn encoded;\n}\n\nfunction requireTerminalDimension(value: unknown, fieldName: string): number {\n\tif (!Number.isSafeInteger(value) || (value as number) <= 0 || (value as number) > 1_000) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\t`Local exec frame field '${fieldName}' must be a bounded positive integer.`,\n\t\t);\n\t}\n\treturn value as number;\n}\n\nfunction parseJsonObject(line: string): Readonly<Record<string, unknown>> {\n\tif (Buffer.byteLength(line, 'utf8') > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError('Local exec frame exceeds the byte limit.');\n\t}\n\tlet value: unknown;\n\ttry {\n\t\tvalue = JSON.parse(line);\n\t} catch (error: unknown) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\terror instanceof Error\n\t\t\t\t? `Local exec frame is not valid JSON: ${error.message}`\n\t\t\t\t: 'Local exec frame is not valid JSON.',\n\t\t);\n\t}\n\tif (!isRecord(value)) {\n\t\tthrow new GatewayRuntimeLocalExecProtocolError('Local exec frame must be an object.');\n\t}\n\treturn value;\n}\n\nexport function encodeGatewayRuntimeLocalExecFrame(\n\tframe: GatewayRuntimeLocalExecClientFrame | GatewayRuntimeLocalExecServerFrame,\n): string {\n\treturn `${JSON.stringify(frame)}\\n`;\n}\n\nexport function parseGatewayRuntimeLocalExecClientFrame(\n\tline: string,\n): GatewayRuntimeLocalExecClientFrame {\n\tconst value = parseJsonObject(line);\n\tconst kind = requireString(value.kind, 'kind');\n\tswitch (kind) {\n\t\tcase 'authenticate':\n\t\t\trequireExactKeys(value, ['kind', 'token']);\n\t\t\treturn { kind, token: requireBoundedToken(value.token) };\n\t\tcase 'cancel':\n\t\tcase 'stdin-end':\n\t\t\trequireExactKeys(value, ['kind']);\n\t\t\treturn { kind };\n\t\tcase 'stdin-chunk':\n\t\t\trequireExactKeys(value, ['contentBase64', 'kind']);\n\t\t\treturn { contentBase64: requireCanonicalBase64(value.contentBase64), kind };\n\t\tcase 'terminal-resize':\n\t\t\trequireExactKeys(value, ['columns', 'kind', 'rows']);\n\t\t\treturn {\n\t\t\t\tcolumns: requireTerminalDimension(value.columns, 'columns'),\n\t\t\t\tkind,\n\t\t\t\trows: requireTerminalDimension(value.rows, 'rows'),\n\t\t\t};\n\t\tdefault:\n\t\t\tthrow new GatewayRuntimeLocalExecProtocolError(`Unknown local exec client frame '${kind}'.`);\n\t}\n}\n\nexport function parseGatewayRuntimeLocalExecServerFrame(\n\tline: string,\n): GatewayRuntimeLocalExecServerFrame {\n\tconst value = parseJsonObject(line);\n\tconst kind = requireString(value.kind, 'kind');\n\tswitch (kind) {\n\t\tcase 'accepted':\n\t\tcase 'stderr-end':\n\t\tcase 'stdout-end':\n\t\t\trequireExactKeys(value, ['kind']);\n\t\t\treturn { kind };\n\t\tcase 'stderr-chunk':\n\t\tcase 'stdout-chunk':\n\t\t\trequireExactKeys(value, ['contentBase64', 'kind']);\n\t\t\treturn { contentBase64: requireCanonicalBase64(value.contentBase64), kind };\n\t\tcase 'exited':\n\t\t\trequireExactKeys(value, ['exitCode', 'kind']);\n\t\t\tif (\n\t\t\t\tvalue.exitCode !== null &&\n\t\t\t\t(!Number.isSafeInteger(value.exitCode) ||\n\t\t\t\t\t(value.exitCode as number) < 0 ||\n\t\t\t\t\t(value.exitCode as number) > 255)\n\t\t\t) {\n\t\t\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\t\t\t\"Local exec frame field 'exitCode' must be null or an integer from 0 through 255.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn { exitCode: value.exitCode as number | null, kind };\n\t\tcase 'rejected':\n\t\t\trequireExactKeys(value, ['kind', 'message']);\n\t\t\treturn { kind, message: requireString(value.message, 'message') };\n\t\tdefault:\n\t\t\tthrow new GatewayRuntimeLocalExecProtocolError(`Unknown local exec server frame '${kind}'.`);\n\t}\n}\n\nexport class GatewayRuntimeLocalExecLineDecoder {\n\t#buffer = Buffer.alloc(0);\n\n\tpush(chunk: Uint8Array): readonly string[] {\n\t\tif (chunk.byteLength + this.#buffer.byteLength > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) {\n\t\t\tthrow new GatewayRuntimeLocalExecProtocolError(\n\t\t\t\t'Local exec frame batch exceeds the byte limit.',\n\t\t\t);\n\t\t}\n\t\tthis.#buffer = Buffer.concat([this.#buffer, chunk]);\n\t\tconst lines: string[] = [];\n\t\tlet newlineIndex = this.#buffer.indexOf(0x0a);\n\t\twhile (newlineIndex >= 0) {\n\t\t\tconst line = this.#buffer.subarray(0, newlineIndex).toString('utf8');\n\t\t\tthis.#buffer = this.#buffer.subarray(newlineIndex + 1);\n\t\t\tif (Buffer.byteLength(line, 'utf8') > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) {\n\t\t\t\tthrow new GatewayRuntimeLocalExecProtocolError('Local exec frame exceeds the byte limit.');\n\t\t\t}\n\t\t\tif (line.length > 0) lines.push(line);\n\t\t\tnewlineIndex = this.#buffer.indexOf(0x0a);\n\t\t}\n\t\tif (this.#buffer.byteLength > MAXIMUM_LOCAL_EXEC_FRAME_BYTES) {\n\t\t\tthrow new GatewayRuntimeLocalExecProtocolError('Local exec frame exceeds the byte limit.');\n\t\t}\n\t\treturn lines;\n\t}\n}\n","import { randomBytes } from 'node:crypto';\nimport { chmod, mkdtemp, rm } from 'node:fs/promises';\nimport { createServer, type Server, type Socket } from 'node:net';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport {\n\tGatewayRuntimeLocalExecLineDecoder,\n\tGatewayRuntimeLocalExecProtocolError,\n\tencodeGatewayRuntimeLocalExecFrame,\n\tparseGatewayRuntimeLocalExecClientFrame,\n\ttype GatewayRuntimeLocalExecServerFrame,\n} from './gateway-runtime-local-exec-protocol.js';\n\nexport const GATEWAY_RUNTIME_LOCAL_EXEC_SOCKET_ENV = 'AGENT_VM_LOCAL_EXEC_SOCKET';\nexport const GATEWAY_RUNTIME_LOCAL_EXEC_TOKEN_ENV = 'AGENT_VM_LOCAL_EXEC_TOKEN';\n\nconst DEFAULT_RESERVATION_TIMEOUT_MS = 15_000;\nconst DEFAULT_TEMPORARY_DIRECTORY = '/tmp';\nconst MAXIMUM_STREAM_CHUNK_BYTES = 64 * 1024;\n\nexport type GatewayRuntimeLocalExecReadResult =\n\t| { readonly content: Uint8Array; readonly kind: 'chunk' }\n\t| { readonly kind: 'end' };\n\nexport interface GatewayRuntimeLocalExecOperation {\n\treadonly cancel: () => Promise<void>;\n\treadonly closeStdin: () => Promise<void>;\n\treadonly readStderr: (maximumBytes: number) => Promise<GatewayRuntimeLocalExecReadResult>;\n\treadonly readStdout: (maximumBytes: number) => Promise<GatewayRuntimeLocalExecReadResult>;\n\treadonly resizeTerminal?: (size: {\n\t\treadonly columns: number;\n\t\treadonly rows: number;\n\t}) => Promise<void>;\n\treadonly wait: () => Promise<{ readonly exitCode: number | null }>;\n\treadonly writeStdin: (content: Uint8Array) => Promise<void>;\n}\n\nexport interface GatewayRuntimeLocalExecReservationScheduler {\n\treadonly schedule: (callback: () => void, delayMs: number) => { readonly cancel: () => void };\n}\n\nexport interface GatewayRuntimeLocalExecFinalizeToken {\n\treadonly kind: 'gateway-runtime-local-exec';\n\treadonly reservationId: string;\n}\n\nexport interface GatewayRuntimeLocalExecSpec {\n\treadonly argv: readonly string[];\n\treadonly env: Readonly<Record<string, string>>;\n\treadonly finalizeToken: GatewayRuntimeLocalExecFinalizeToken;\n\treadonly stdinMode: 'pipe-open';\n}\n\nexport interface GatewayRuntimeLocalExecTransportOptions {\n\treadonly helperArgv?: readonly string[];\n\treadonly reservationScheduler?: GatewayRuntimeLocalExecReservationScheduler;\n\treadonly reservationTimeoutMs?: number;\n\treadonly temporaryDirectory?: string;\n}\n\ninterface ReservationRecord {\n\treadonly cancelExpiry: () => void;\n\treadonly operation: GatewayRuntimeLocalExecOperation;\n\treadonly reservationDirectory: string;\n\treadonly reservationId: string;\n\treadonly server: Server;\n\treadonly socketPath: string;\n\treadonly token: string;\n\tconsumed: boolean;\n\tdisposal?: Promise<void>;\n\tfinalized: boolean;\n\tsocket?: Socket;\n}\n\nconst defaultReservationScheduler: GatewayRuntimeLocalExecReservationScheduler = {\n\tschedule(callback, delayMs) {\n\t\tconst timeout = setTimeout(callback, delayMs);\n\t\treturn { cancel: () => clearTimeout(timeout) };\n\t},\n};\n\nfunction validateReservationTimeout(timeoutMs: number): number {\n\tif (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 60_000) {\n\t\tthrow new RangeError('Local exec reservation timeout must be an integer from 1 through 60000.');\n\t}\n\treturn timeoutMs;\n}\n\nasync function closeServer(server: Server): Promise<void> {\n\tif (!server.listening) return;\n\tawait new Promise<void>((resolve, reject) => {\n\t\tserver.close((error?: Error) => (error === undefined ? resolve() : reject(error)));\n\t});\n}\n\nasync function writeFrame(\n\tsocket: Socket,\n\tframe: GatewayRuntimeLocalExecServerFrame,\n): Promise<void> {\n\tconst encodedFrame = encodeGatewayRuntimeLocalExecFrame(frame);\n\tif (socket.write(encodedFrame)) return;\n\tawait new Promise<void>((resolve, reject) => {\n\t\tconst cleanup = (): void => {\n\t\t\tsocket.off('drain', handleDrain);\n\t\t\tsocket.off('error', handleError);\n\t\t};\n\t\tconst handleDrain = (): void => {\n\t\t\tcleanup();\n\t\t\tresolve();\n\t\t};\n\t\tconst handleError = (error: Error): void => {\n\t\t\tcleanup();\n\t\t\treject(error);\n\t\t};\n\t\tsocket.once('drain', handleDrain);\n\t\tsocket.once('error', handleError);\n\t});\n}\n\nclass GatewayRuntimeLocalExecFrameWriter {\n\t#pendingWrite = Promise.resolve();\n\treadonly #socket: Socket;\n\n\tconstructor(socket: Socket) {\n\t\tthis.#socket = socket;\n\t}\n\n\tasync write(frame: GatewayRuntimeLocalExecServerFrame): Promise<void> {\n\t\tconst write = this.#pendingWrite.then(async () => await writeFrame(this.#socket, frame));\n\t\tthis.#pendingWrite = write.catch(() => undefined);\n\t\tawait write;\n\t}\n}\n\nasync function endSocket(socket: Socket): Promise<void> {\n\tif (socket.destroyed) return;\n\tawait new Promise<void>((resolve) => socket.end(resolve));\n}\n\nasync function pumpOutput(props: {\n\treadonly frameWriter: GatewayRuntimeLocalExecFrameWriter;\n\treadonly kind: 'stderr' | 'stdout';\n\treadonly operation: GatewayRuntimeLocalExecOperation;\n\treadonly socket: Socket;\n}): Promise<void> {\n\tconst read =\n\t\tprops.kind === 'stdout'\n\t\t\t? props.operation.readStdout.bind(props.operation)\n\t\t\t: props.operation.readStderr.bind(props.operation);\n\tif (props.socket.destroyed) return;\n\tconst result = await read(MAXIMUM_STREAM_CHUNK_BYTES);\n\tif (result.kind === 'end') {\n\t\tawait props.frameWriter.write({ kind: `${props.kind}-end` });\n\t\treturn;\n\t}\n\tawait props.frameWriter.write({\n\t\tcontentBase64: Buffer.from(result.content).toString('base64'),\n\t\tkind: `${props.kind}-chunk`,\n\t});\n\tawait pumpOutput(props);\n}\n\nexport class GatewayRuntimeLocalExecTransport {\n\treadonly #helperArgv: readonly string[];\n\treadonly #reservationScheduler: GatewayRuntimeLocalExecReservationScheduler;\n\treadonly #reservationTimeoutMs: number;\n\treadonly #reservations = new Map<string, ReservationRecord>();\n\treadonly #temporaryDirectory: string;\n\n\tconstructor(options: GatewayRuntimeLocalExecTransportOptions = {}) {\n\t\tthis.#helperArgv =\n\t\t\toptions.helperArgv ??\n\t\t\tObject.freeze([\n\t\t\t\tprocess.execPath,\n\t\t\t\tfileURLToPath(\n\t\t\t\t\tnew URL(\n\t\t\t\t\t\t'./gateway-runtime-local-exec/gateway-runtime-local-exec-helper.js',\n\t\t\t\t\t\timport.meta.url,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t]);\n\t\tif (this.#helperArgv.length === 0)\n\t\t\tthrow new TypeError('Local exec helper argv cannot be empty.');\n\t\tthis.#reservationScheduler = options.reservationScheduler ?? defaultReservationScheduler;\n\t\tthis.#reservationTimeoutMs = validateReservationTimeout(\n\t\t\toptions.reservationTimeoutMs ?? DEFAULT_RESERVATION_TIMEOUT_MS,\n\t\t);\n\t\tthis.#temporaryDirectory = options.temporaryDirectory ?? DEFAULT_TEMPORARY_DIRECTORY;\n\t}\n\n\tasync reserve(operation: GatewayRuntimeLocalExecOperation): Promise<GatewayRuntimeLocalExecSpec> {\n\t\tconst reservationId = randomBytes(16).toString('hex');\n\t\tconst token = randomBytes(32).toString('base64url');\n\t\tconst reservationDirectory = await mkdtemp(\n\t\t\tjoin(this.#temporaryDirectory, 'agent-vm-local-exec-'),\n\t\t);\n\t\tawait chmod(reservationDirectory, 0o700);\n\t\tconst socketPath = join(reservationDirectory, 'relay.sock');\n\t\tconst server = createServer();\n\t\tconst expiry = this.#reservationScheduler.schedule(() => {\n\t\t\tvoid this.#expireReservation(reservationId).catch(() => undefined);\n\t\t}, this.#reservationTimeoutMs);\n\t\tconst reservation: ReservationRecord = {\n\t\t\tcancelExpiry: expiry.cancel,\n\t\t\tconsumed: false,\n\t\t\tfinalized: false,\n\t\t\toperation,\n\t\t\treservationDirectory,\n\t\t\treservationId,\n\t\t\tserver,\n\t\t\tsocketPath,\n\t\t\ttoken,\n\t\t};\n\t\tthis.#reservations.set(reservationId, reservation);\n\t\tserver.on('connection', (socket) => this.#acceptConnection(reservation, socket));\n\t\ttry {\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\tserver.once('error', reject);\n\t\t\t\tserver.listen(socketPath, () => {\n\t\t\t\t\tserver.off('error', reject);\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t\tawait chmod(socketPath, 0o600);\n\t\t} catch (error: unknown) {\n\t\t\tawait this.#disposeReservation(reservation, true);\n\t\t\tthrow error;\n\t\t}\n\t\treturn {\n\t\t\targv: [...this.#helperArgv],\n\t\t\tenv: {\n\t\t\t\t[GATEWAY_RUNTIME_LOCAL_EXEC_SOCKET_ENV]: socketPath,\n\t\t\t\t[GATEWAY_RUNTIME_LOCAL_EXEC_TOKEN_ENV]: token,\n\t\t\t},\n\t\t\tfinalizeToken: { kind: 'gateway-runtime-local-exec', reservationId },\n\t\t\tstdinMode: 'pipe-open',\n\t\t};\n\t}\n\n\tasync finalize(token: unknown): Promise<void> {\n\t\tconst reservationId =\n\t\t\ttypeof token === 'object' && token !== null ? Reflect.get(token, 'reservationId') : undefined;\n\t\tif (\n\t\t\ttypeof token !== 'object' ||\n\t\t\ttoken === null ||\n\t\t\tReflect.get(token, 'kind') !== 'gateway-runtime-local-exec' ||\n\t\t\ttypeof reservationId !== 'string'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst reservation = this.#reservations.get(reservationId);\n\t\tif (reservation === undefined) return;\n\t\tawait this.#disposeReservation(reservation, !reservation.consumed);\n\t}\n\n\tasync close(): Promise<void> {\n\t\tawait Promise.all(\n\t\t\t[...this.#reservations.values()].map(\n\t\t\t\tasync (reservation) => await this.#disposeReservation(reservation, true),\n\t\t\t),\n\t\t);\n\t}\n\n\tasync #expireReservation(reservationId: string): Promise<void> {\n\t\tconst reservation = this.#reservations.get(reservationId);\n\t\tif (reservation === undefined || reservation.consumed) return;\n\t\tawait this.#disposeReservation(reservation, true);\n\t}\n\n\t#acceptConnection(reservation: ReservationRecord, socket: Socket): void {\n\t\tif (reservation.finalized || reservation.consumed) {\n\t\t\tvoid writeFrame(socket, {\n\t\t\t\tkind: 'rejected',\n\t\t\t\tmessage: 'Reservation already consumed.',\n\t\t\t})\n\t\t\t\t.catch(() => undefined)\n\t\t\t\t.finally(() => socket.destroy());\n\t\t\treturn;\n\t\t}\n\t\tconst decoder = new GatewayRuntimeLocalExecLineDecoder();\n\t\tconst connectionState = { authenticated: false };\n\t\tsocket.once('close', () => {\n\t\t\tif (connectionState.authenticated && !reservation.finalized) {\n\t\t\t\tvoid this.#disposeReservation(reservation, true).catch(() => undefined);\n\t\t\t}\n\t\t});\n\t\tsocket.on('data', (chunk: Buffer) => {\n\t\t\tsocket.pause();\n\t\t\tvoid this.#processClientFrames({\n\t\t\t\tchunk,\n\t\t\t\tconnectionState,\n\t\t\t\tdecoder,\n\t\t\t\treservation,\n\t\t\t\tsocket,\n\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (!socket.destroyed) socket.resume();\n\t\t\t\t})\n\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\tvoid writeFrame(socket, {\n\t\t\t\t\t\tkind: 'rejected',\n\t\t\t\t\t\tmessage: error instanceof Error ? error.message : 'Invalid local exec frame.',\n\t\t\t\t\t})\n\t\t\t\t\t\t.catch(() => undefined)\n\t\t\t\t\t\t.finally(() => socket.destroy());\n\t\t\t\t});\n\t\t});\n\t}\n\n\tasync #processClientFrames(props: {\n\t\treadonly chunk: Buffer;\n\t\treadonly connectionState: { authenticated: boolean };\n\t\treadonly decoder: GatewayRuntimeLocalExecLineDecoder;\n\t\treadonly reservation: ReservationRecord;\n\t\treadonly socket: Socket;\n\t}): Promise<void> {\n\t\t// oxlint-disable no-await-in-loop -- input frames must preserve order and backpressure.\n\t\tfor (const line of props.decoder.push(props.chunk)) {\n\t\t\tconst frame = parseGatewayRuntimeLocalExecClientFrame(line);\n\t\t\tif (!props.connectionState.authenticated) {\n\t\t\t\tif (\n\t\t\t\t\tframe.kind !== 'authenticate' ||\n\t\t\t\t\tframe.token !== props.reservation.token ||\n\t\t\t\t\tprops.reservation.consumed\n\t\t\t\t) {\n\t\t\t\t\tawait writeFrame(props.socket, {\n\t\t\t\t\t\tkind: 'rejected',\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\tframe.kind === 'authenticate' && frame.token === props.reservation.token\n\t\t\t\t\t\t\t\t? 'Reservation already consumed.'\n\t\t\t\t\t\t\t\t: 'Invalid reservation token.',\n\t\t\t\t\t});\n\t\t\t\t\tprops.socket.destroy();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tprops.connectionState.authenticated = true;\n\t\t\t\tprops.reservation.consumed = true;\n\t\t\t\tprops.reservation.cancelExpiry();\n\t\t\t\tprops.reservation.socket = props.socket;\n\t\t\t\tprops.reservation.server.close();\n\t\t\t\tawait writeFrame(props.socket, { kind: 'accepted' });\n\t\t\t\tvoid this.#runAuthenticatedOperation(props.reservation, props.socket).catch(\n\t\t\t\t\t() => undefined,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch (frame.kind) {\n\t\t\t\tcase 'authenticate':\n\t\t\t\t\tthrow new GatewayRuntimeLocalExecProtocolError('Duplicate authentication frame.');\n\t\t\t\tcase 'cancel':\n\t\t\t\t\tawait props.reservation.operation.cancel();\n\t\t\t\t\treturn;\n\t\t\t\tcase 'stdin-chunk':\n\t\t\t\t\tawait props.reservation.operation.writeStdin(Buffer.from(frame.contentBase64, 'base64'));\n\t\t\t\t\tcontinue;\n\t\t\t\tcase 'stdin-end':\n\t\t\t\t\tawait props.reservation.operation.closeStdin();\n\t\t\t\t\tcontinue;\n\t\t\t\tcase 'terminal-resize':\n\t\t\t\t\tif (props.reservation.operation.resizeTerminal === undefined) {\n\t\t\t\t\t\tthrow new GatewayRuntimeLocalExecProtocolError('Terminal resize is unavailable.');\n\t\t\t\t\t}\n\t\t\t\t\tawait props.reservation.operation.resizeTerminal({\n\t\t\t\t\t\tcolumns: frame.columns,\n\t\t\t\t\t\trows: frame.rows,\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t// oxlint-enable no-await-in-loop\n\t}\n\n\tasync #runAuthenticatedOperation(reservation: ReservationRecord, socket: Socket): Promise<void> {\n\t\ttry {\n\t\t\tconst frameWriter = new GatewayRuntimeLocalExecFrameWriter(socket);\n\t\t\tconst [waitResult] = await Promise.all([\n\t\t\t\treservation.operation.wait(),\n\t\t\t\tpumpOutput({ frameWriter, kind: 'stdout', operation: reservation.operation, socket }),\n\t\t\t\tpumpOutput({ frameWriter, kind: 'stderr', operation: reservation.operation, socket }),\n\t\t\t]);\n\t\t\tif (!socket.destroyed) {\n\t\t\t\tawait frameWriter.write({ exitCode: waitResult.exitCode, kind: 'exited' });\n\t\t\t\tawait endSocket(socket);\n\t\t\t}\n\t\t} catch {\n\t\t\tsocket.destroy();\n\t\t} finally {\n\t\t\tawait this.#disposeReservation(reservation, false);\n\t\t}\n\t}\n\n\tasync #disposeReservation(reservation: ReservationRecord, cancel: boolean): Promise<void> {\n\t\tif (reservation.disposal !== undefined) return await reservation.disposal;\n\t\treservation.disposal = this.#disposeReservationOnce(reservation, cancel);\n\t\tawait reservation.disposal;\n\t}\n\n\tasync #disposeReservationOnce(reservation: ReservationRecord, cancel: boolean): Promise<void> {\n\t\tif (reservation.finalized) return;\n\t\treservation.finalized = true;\n\t\treservation.cancelExpiry();\n\t\tlet cancellationError: unknown;\n\t\tif (cancel) {\n\t\t\ttry {\n\t\t\t\tawait reservation.operation.cancel();\n\t\t\t} catch (error: unknown) {\n\t\t\t\tcancellationError = error;\n\t\t\t}\n\t\t}\n\t\tlet cleanupError: unknown;\n\t\ttry {\n\t\t\treservation.socket?.destroy();\n\t\t\tawait closeServer(reservation.server).catch(() => undefined);\n\t\t\tawait rm(reservation.reservationDirectory, { force: true, recursive: true });\n\t\t} catch (error: unknown) {\n\t\t\tcleanupError = error;\n\t\t} finally {\n\t\t\tthis.#reservations.delete(reservation.reservationId);\n\t\t}\n\t\tif (cancellationError !== undefined && cleanupError !== undefined) {\n\t\t\tthrow new AggregateError(\n\t\t\t\t[cancellationError, cleanupError],\n\t\t\t\t'Local exec cancellation and cleanup both failed.',\n\t\t\t);\n\t\t}\n\t\tif (cancellationError !== undefined) throw cancellationError;\n\t\tif (cleanupError !== undefined) throw cleanupError;\n\t}\n}\n"],"mappings":";;;;;;AAAA,MAAM,iCAAiC,MAAM;AAC7C,MAAM,wCAAwC,KAAK;AACnD,MAAM,iCAAiC;AAkBvC,IAAa,uCAAb,cAA0D,MAAM;CAC/D,YAAY,SAAiB;EAC5B,MAAM,QAAQ;EACd,KAAK,OAAO;;;AAId,SAAS,SAAS,OAA4D;CAC7E,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;;AAG5E,SAAS,iBAAiB,OAA0C,MAA+B;CAClG,MAAM,aAAa,OAAO,KAAK,MAAM,CAAC,UAAU;CAChD,MAAM,eAAe,KAAK,UAAU;CACpC,IACC,WAAW,WAAW,aAAa,UACnC,WAAW,MAAM,KAAK,UAAU,QAAQ,aAAa,OAAO,EAE5D,MAAM,IAAI,qCAAqC,+CAA+C;;AAIhG,SAAS,cAAc,OAAgB,WAA2B;CACjE,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,GACjD,MAAM,IAAI,qCACT,2BAA2B,UAAU,+BACrC;CAEF,OAAO;;AAGR,SAAS,oBAAoB,OAAwB;CACpD,MAAM,QAAQ,cAAc,OAAO,QAAQ;CAC3C,IAAI,OAAO,WAAW,OAAO,OAAO,GAAG,gCACtC,MAAM,IAAI,qCACT,uDACA;CAEF,OAAO;;AAGR,S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|
|
|
1
|
-
import { l as JsonValue } from "./json-value-schema-M87sjwWL.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/artifact-surface/models/portal-artifact-contract-schema.d.ts
|
|
5
|
-
declare const PortalArtifactRecordSchema: z.ZodObject<{
|
|
6
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
7
|
-
reference: z.ZodObject<{
|
|
8
|
-
byteLength: z.ZodNumber;
|
|
9
|
-
expiresAt: z.ZodString;
|
|
10
|
-
fingerprint: z.ZodString;
|
|
11
|
-
id: z.ZodString;
|
|
12
|
-
mediaType: z.ZodOptional<z.ZodString>;
|
|
13
|
-
}, z.core.$strict>;
|
|
14
|
-
redactionProfile: z.ZodString;
|
|
15
|
-
}, z.core.$strict>;
|
|
16
|
-
type PortalArtifactRecord = z.infer<typeof PortalArtifactRecordSchema>;
|
|
17
|
-
declare const PortalArtifactReadRequestSchema: z.ZodObject<{
|
|
18
|
-
maxBytes: z.ZodNumber;
|
|
19
|
-
offsetBytes: z.ZodDefault<z.ZodNumber>;
|
|
20
|
-
reference: z.ZodObject<{
|
|
21
|
-
byteLength: z.ZodNumber;
|
|
22
|
-
expiresAt: z.ZodString;
|
|
23
|
-
fingerprint: z.ZodString;
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
mediaType: z.ZodOptional<z.ZodString>;
|
|
26
|
-
}, z.core.$strict>;
|
|
27
|
-
}, z.core.$strict>;
|
|
28
|
-
type PortalArtifactReadRequest = z.infer<typeof PortalArtifactReadRequestSchema>;
|
|
29
|
-
declare const PortalArtifactReadResultSchema: z.ZodObject<{
|
|
30
|
-
contentBase64: z.ZodString;
|
|
31
|
-
mediaType: z.ZodOptional<z.ZodString>;
|
|
32
|
-
offsetBytes: z.ZodNumber;
|
|
33
|
-
reference: z.ZodObject<{
|
|
34
|
-
byteLength: z.ZodNumber;
|
|
35
|
-
expiresAt: z.ZodString;
|
|
36
|
-
fingerprint: z.ZodString;
|
|
37
|
-
id: z.ZodString;
|
|
38
|
-
mediaType: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strict>;
|
|
40
|
-
truncated: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
-
}, z.core.$strict>;
|
|
42
|
-
type PortalArtifactReadResult = z.infer<typeof PortalArtifactReadResultSchema>;
|
|
43
|
-
declare const PortalArtifactRedactorSchema: z.ZodObject<{
|
|
44
|
-
maxModelVisibleBytes: z.ZodNumber;
|
|
45
|
-
profile: z.ZodString;
|
|
46
|
-
}, z.core.$strict>;
|
|
47
|
-
type PortalArtifactRedactor = z.infer<typeof PortalArtifactRedactorSchema>;
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/artifact-surface/artifact-read-resource-uri.d.ts
|
|
50
|
-
declare const PORTAL_ARTIFACT_READ_REQUEST_META_KEY = "agent-vm/artifact-read-request";
|
|
51
|
-
declare const PortalArtifactReadResourceRequestSchema: z.ZodObject<{
|
|
52
|
-
_meta: z.ZodObject<{
|
|
53
|
-
"agent-vm/artifact-read-request": z.ZodObject<{
|
|
54
|
-
maxBytes: z.ZodNumber;
|
|
55
|
-
offsetBytes: z.ZodDefault<z.ZodNumber>;
|
|
56
|
-
reference: z.ZodObject<{
|
|
57
|
-
byteLength: z.ZodNumber;
|
|
58
|
-
expiresAt: z.ZodString;
|
|
59
|
-
fingerprint: z.ZodString;
|
|
60
|
-
id: z.ZodString;
|
|
61
|
-
mediaType: z.ZodOptional<z.ZodString>;
|
|
62
|
-
}, z.core.$strict>;
|
|
63
|
-
}, z.core.$strict>;
|
|
64
|
-
}, z.core.$strict>;
|
|
65
|
-
uri: z.ZodString;
|
|
66
|
-
}, z.core.$strict>;
|
|
67
|
-
type PortalArtifactReadResourceRequest = z.infer<typeof PortalArtifactReadResourceRequestSchema>;
|
|
68
|
-
/** Build one standard MCP read request whose URI exposes only the opaque artifact ID. */
|
|
69
|
-
declare function createPortalArtifactReadResourceRequest(request: PortalArtifactReadRequest): PortalArtifactReadResourceRequest;
|
|
70
|
-
/** Recover and validate the complete public read request from standard MCP params. */
|
|
71
|
-
declare function parsePortalArtifactReadResourceRequest(resourceRequest: unknown): PortalArtifactReadRequest;
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/artifact-surface/models/artifact-reference-schema.d.ts
|
|
74
|
-
declare const ArtifactReferenceSchema: z.ZodObject<{
|
|
75
|
-
byteLength: z.ZodNumber;
|
|
76
|
-
expiresAt: z.ZodString;
|
|
77
|
-
fingerprint: z.ZodString;
|
|
78
|
-
id: z.ZodString;
|
|
79
|
-
mediaType: z.ZodOptional<z.ZodString>;
|
|
80
|
-
}, z.core.$strict>;
|
|
81
|
-
type ArtifactReference = z.infer<typeof ArtifactReferenceSchema>;
|
|
82
|
-
//#endregion
|
|
83
|
-
export { PortalArtifactReadResourceRequestSchema as a, PortalArtifactReadRequest as c, PortalArtifactReadResultSchema as d, PortalArtifactRecord as f, PortalArtifactRedactorSchema as h, PortalArtifactReadResourceRequest as i, PortalArtifactReadRequestSchema as l, PortalArtifactRedactor as m, ArtifactReferenceSchema as n, createPortalArtifactReadResourceRequest as o, PortalArtifactRecordSchema as p, PORTAL_ARTIFACT_READ_REQUEST_META_KEY as r, parsePortalArtifactReadResourceRequest as s, ArtifactReference as t, PortalArtifactReadResult as u };
|
|
84
|
-
//# sourceMappingURL=index-B5hgm1KH.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-B5hgm1KH.d.ts","names":[],"sources":["../src/artifact-surface/models/portal-artifact-contract-schema.ts","../src/artifact-surface/artifact-read-resource-uri.ts","../src/artifact-surface/models/artifact-reference-schema.ts"],"mappings":";;;;cAKa,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;KAQ3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA;AAAA,cAErC,+BAAA,EAA+B,CAAA,CAAA,SAAA;;;;;;;;;;;KAYhC,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,+BAAA;AAAA,cAE1C,8BAAA,EAA8B,CAAA,CAAA,SAAA;;;;;;;;;;;;;KAU/B,wBAAA,GAA2B,CAAA,CAAE,KAAA,QAAa,8BAAA;AAAA,cAEzC,4BAAA,EAA4B,CAAA,CAAA,SAAA;;;;KAO7B,sBAAA,GAAyB,CAAA,CAAE,KAAA,QAAa,4BAAA;;;cCzCvC,qCAAA;AAAA,cAKA,uCAAA,EAAuC,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;KAWxC,iCAAA,GAAoC,CAAA,CAAE,KAAA,QAC1C,uCAAA;;iBA+BQ,uCAAA,CACf,OAAA,EAAS,yBAAA,GACP,iCAAA;;iBASa,sCAAA,CACf,eAAA,YACE,yBAAA;;;cClEU,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;KAUxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA"}
|
package/dist/index-BWE2_BcN.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/approval-surface/models/approval-decision-reference-schema.d.ts
|
|
4
|
-
declare const ApprovalDecisionReferenceSchema: z.ZodObject<{
|
|
5
|
-
approvalId: z.ZodString;
|
|
6
|
-
callId: z.ZodString;
|
|
7
|
-
expiresAt: z.ZodString;
|
|
8
|
-
status: z.ZodEnum<{
|
|
9
|
-
approved: "approved";
|
|
10
|
-
denied: "denied";
|
|
11
|
-
expired: "expired";
|
|
12
|
-
}>;
|
|
13
|
-
}, z.core.$strict>;
|
|
14
|
-
type ApprovalDecisionReference = z.infer<typeof ApprovalDecisionReferenceSchema>;
|
|
15
|
-
declare const ApprovalRequiredResultSchema: z.ZodObject<{
|
|
16
|
-
approvalChallenge: z.ZodObject<{
|
|
17
|
-
challengeId: z.ZodString;
|
|
18
|
-
expiresAt: z.ZodString;
|
|
19
|
-
}, z.core.$strict>;
|
|
20
|
-
error: z.ZodObject<{
|
|
21
|
-
message: z.ZodString;
|
|
22
|
-
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
-
safeDiagnostic: z.ZodOptional<z.ZodObject<{
|
|
24
|
-
code: z.ZodEnum<{
|
|
25
|
-
approval_required: "approval_required";
|
|
26
|
-
capability_denied: "capability_denied";
|
|
27
|
-
validation_failed: "validation_failed";
|
|
28
|
-
provider_unavailable: "provider_unavailable";
|
|
29
|
-
execution_failed: "execution_failed";
|
|
30
|
-
cancelled: "cancelled";
|
|
31
|
-
timeout: "timeout";
|
|
32
|
-
output_truncated: "output_truncated";
|
|
33
|
-
artifact_unavailable: "artifact_unavailable";
|
|
34
|
-
}>;
|
|
35
|
-
level: z.ZodEnum<{
|
|
36
|
-
error: "error";
|
|
37
|
-
debug: "debug";
|
|
38
|
-
info: "info";
|
|
39
|
-
warn: "warn";
|
|
40
|
-
}>;
|
|
41
|
-
safeMessage: z.ZodString;
|
|
42
|
-
safeParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
43
|
-
}, z.core.$strict>>;
|
|
44
|
-
code: z.ZodLiteral<"approval_required">;
|
|
45
|
-
}, z.core.$strict>;
|
|
46
|
-
id: z.ZodString;
|
|
47
|
-
operationId: z.ZodString;
|
|
48
|
-
outcome: z.ZodObject<{
|
|
49
|
-
certainty: z.ZodLiteral<"proven">;
|
|
50
|
-
kind: z.ZodLiteral<"not-dispatched">;
|
|
51
|
-
retryClass: z.ZodLiteral<"safe-before-dispatch">;
|
|
52
|
-
}, z.core.$strict>;
|
|
53
|
-
owningGeneration: z.ZodString;
|
|
54
|
-
status: z.ZodLiteral<"approval_required">;
|
|
55
|
-
}, z.core.$strict>;
|
|
56
|
-
declare const ApprovalChallengeReferenceSchema: z.ZodObject<{
|
|
57
|
-
challengeId: z.ZodString;
|
|
58
|
-
expiresAt: z.ZodString;
|
|
59
|
-
}, z.core.$strict>;
|
|
60
|
-
type ApprovalRequiredResult = z.infer<typeof ApprovalRequiredResultSchema>;
|
|
61
|
-
type ApprovalChallengeReference = z.infer<typeof ApprovalChallengeReferenceSchema>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { ApprovalRequiredResult as a, ApprovalDecisionReferenceSchema as i, ApprovalChallengeReferenceSchema as n, ApprovalRequiredResultSchema as o, ApprovalDecisionReference as r, ApprovalChallengeReference as t };
|
|
64
|
-
//# sourceMappingURL=index-BWE2_BcN.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BWE2_BcN.d.ts","names":[],"sources":["../src/approval-surface/models/approval-decision-reference-schema.ts"],"mappings":";;;cAQa,+BAAA,EAA+B,CAAA,CAAA,SAAA;;;;;;;;;;KAShC,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,+BAAA;AAAA,cAE1C,4BAAA,EAA4B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAE5B,gCAAA,EAAgC,CAAA,CAAA,SAAA;;;;KAEjC,sBAAA,GAAyB,CAAA,CAAE,KAAA,QAAa,4BAAA;AAAA,KACxC,0BAAA,GAA6B,CAAA,CAAE,KAAA,QAAa,gCAAA"}
|