@revoengine/cli 1.0.39 → 2.0.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/CHANGELOG.md +14 -0
- package/README.md +7 -3
- package/dist/src/argument-contract.js +1 -1
- package/dist/src/automation-contract.generated.d.ts +6 -30
- package/dist/src/automation-contract.generated.js +6 -30
- package/dist/src/commands/component.js +16 -0
- package/dist/src/commands/terminal-browser-human-input.d.ts +28 -0
- package/dist/src/commands/terminal-browser-human-input.js +56 -7
- package/dist/src/commands/terminal-browser-live-protocol.d.ts +9 -1
- package/dist/src/commands/terminal-browser-live-protocol.js +16 -3
- package/dist/src/commands/terminal-browser-live-transport.d.ts +2 -0
- package/dist/src/commands/terminal-browser-live-transport.js +21 -5
- package/dist/src/commands/terminal-browser-live.d.ts +18 -1
- package/dist/src/commands/terminal-browser-live.js +190 -14
- package/dist/src/commands/terminal-browser-observation.d.ts +1 -1
- package/dist/src/commands/terminal-browser-observation.js +10 -1
- package/dist/src/commands/terminal-browser-page-input.d.ts +1 -0
- package/dist/src/commands/terminal-browser-page-input.js +20 -0
- package/dist/src/commands/terminal-browser-profile-sync.d.ts +5 -1
- package/dist/src/commands/terminal-browser-profile-sync.js +13 -2
- package/dist/src/commands/terminal-browser-profile-sync.protocol.d.ts +2 -0
- package/dist/src/commands/terminal-browser.d.ts +17 -0
- package/dist/src/commands/terminal-browser.js +310 -104
- package/dist/src/commands/terminal.js +104 -24
- package/dist/src/endpoint-emulator.js +9 -10
- package/dist/src/project.js +1 -0
- package/dist/src/request-contract.d.ts +2 -0
- package/dist/src/request-contract.js +11 -1
- package/dist/src/types.d.ts +0 -3
- package/dist/src/ui.js +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import { getActiveEnvironmentName, getConfigDir, getEnvironmentProfile, loadStor
|
|
|
14
14
|
import { installTerminalService, terminalServiceInstalled, uninstallTerminalService } from "./terminal-service.js";
|
|
15
15
|
import { createSandboxScratchDirectory, isTerminalSandbox, sandboxCommand, shellQuote, requiresElevatedCommand } from "./terminal-sandbox.js";
|
|
16
16
|
import { executionAllowedByGrant, executionPolicyDeadline, remainingPolicyDeadline, validateExecutePolicy } from "./terminal-policy.js";
|
|
17
|
-
import { closeThreadBrowserSession, threadBrowserScopes, browserSessionIds, closeBrowserSessions, fillBrowserSecret, hasBrowserSessions, reconcileBrowserSessions, revokeBrowserProfileSession, runBrowserAction, validateBrowserActionInput } from "./terminal-browser.js";
|
|
17
|
+
import { closeThreadBrowserSession, threadBrowserScopes, browserSessionIds, browserRuntimeInventory, closeBrowserSessions, fillBrowserSecret, hasBrowserSessions, reconcileBrowserSessions, revokeBrowserProfileSession, runBrowserAction, validateBrowserActionInput } from "./terminal-browser.js";
|
|
18
18
|
import { transferWorkspaceFile, validateFileTransfer } from "./terminal-file.js";
|
|
19
19
|
import { uploadWorkspaceImages } from "./terminal-image.js";
|
|
20
20
|
import { ensurePtyHelperExecutable, normalizePtyStartError } from "./terminal-pty.js";
|
|
@@ -805,6 +805,16 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
805
805
|
? device.agentTerminalId : createHash('sha256').update(device.agentTerminalId).digest('hex');
|
|
806
806
|
const operationalLog = new TerminalOperationalLog(path.join(configDir(), 'logs', 'terminal', logDeviceId));
|
|
807
807
|
operationalLog.write('INFO', {}, 'runner.started');
|
|
808
|
+
let lastBrowserInventory = '';
|
|
809
|
+
const reportBrowserInventory = () => {
|
|
810
|
+
const inventory = browserRuntimeInventory();
|
|
811
|
+
const snapshot = JSON.stringify(inventory);
|
|
812
|
+
if (snapshot === lastBrowserInventory)
|
|
813
|
+
return;
|
|
814
|
+
lastBrowserInventory = snapshot;
|
|
815
|
+
console.log([`Browser: ${inventory.browsers} contexts · ${inventory.sessions.length} sessions · ${inventory.tabs} tabs`,
|
|
816
|
+
...inventory.sessions.map(session => ` ${session.id} ${session.profile || 'Temporary profile'} · ${session.tabs} tabs · ${session.mode}${session.restored ? ' · saved state loaded' : ''}`)].join('\n'));
|
|
817
|
+
};
|
|
808
818
|
let backoffMs = 1_000;
|
|
809
819
|
let announcedConnection = false;
|
|
810
820
|
let stopping = false;
|
|
@@ -911,6 +921,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
911
921
|
const live = new TerminalBrowserLiveTransport({ runnerUrl: device.realtimeUrl,
|
|
912
922
|
headers: { Authorization: `Bearer ${profile.token}`, ...(profile.instance ? { instance: profile.instance } : {}) },
|
|
913
923
|
authorized: liveAuthorized,
|
|
924
|
+
onInventoryChanged: reportBrowserInventory,
|
|
914
925
|
options: frame => {
|
|
915
926
|
const scope = browserScopes.get(frame.browserSessionId);
|
|
916
927
|
if (!scope || !liveAuthorized(frame))
|
|
@@ -919,7 +930,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
919
930
|
actorUserId: frame.actorUserId, threadId: frame.threadId,
|
|
920
931
|
agentTerminalWorkspaceId: frame.agentTerminalWorkspaceId, connectionId: frame.connectionId,
|
|
921
932
|
identity: secureIdentity, profileOwner: scope.owner,
|
|
922
|
-
initialControl: { controlEpoch: frame.controlEpoch, mode: frame.mode, private: frame.private },
|
|
933
|
+
initialControl: { controlEpoch: frame.controlEpoch, mode: frame.mode, private: frame.private, tabId: frame.controlledTabId },
|
|
923
934
|
recordingDirectory: path.join(fs.realpathSync(configDir()), 'browser-recordings', device.agentTerminalId),
|
|
924
935
|
isAuthorized: () => liveAuthorized(frame) };
|
|
925
936
|
} });
|
|
@@ -932,6 +943,17 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
932
943
|
activeSocket = socket;
|
|
933
944
|
let connectionId = '';
|
|
934
945
|
let profileRpc;
|
|
946
|
+
const sharedProfileOpens = new Map();
|
|
947
|
+
const revokeProfileMember = async (id, profileId) => {
|
|
948
|
+
revokedProfileSessions.set(id, Date.now() + 60_000);
|
|
949
|
+
const central = centralProfiles.get(id);
|
|
950
|
+
centralProfiles.delete(id);
|
|
951
|
+
await revokeBrowserProfileSession(id, profileId);
|
|
952
|
+
if (central?.shared)
|
|
953
|
+
await central.shared.releaseMember();
|
|
954
|
+
else
|
|
955
|
+
await central?.lease.release();
|
|
956
|
+
};
|
|
935
957
|
let profileImports;
|
|
936
958
|
let defaultWorkspace = device.workspace;
|
|
937
959
|
let heartbeat;
|
|
@@ -946,7 +968,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
946
968
|
'apply_patch_v1', 'stdin_v1', 'pty_v1', 'browser_v1', 'browser_session_v1', 'browser_forms_v1',
|
|
947
969
|
'browser_local_v1', 'browser_once_v1', 'browser_secure_input_v1', 'browser_tabs_v1', 'save_image_v1',
|
|
948
970
|
'browser_timeout_v1', 'browser_public_read_v1', 'terminal_workspaces_v1', 'file_transfer_v1', 'browser_control_v1', 'browser_live_v1', 'browser_interaction_v1', 'browser_controls_v2', 'browser_recording_v1', 'browser_recording_session_v1', 'browser_recording_save_v1',
|
|
949
|
-
'browser_profiles_v2', ...(legacyImportAvailable ? ['browser_profile_import_v1'] : []),
|
|
971
|
+
'browser_profiles_v2', 'browser_shared_profiles_v1', 'browser_live_tab_management_v1', 'browser_live_pointer_v1', 'browser_live_tab_control_v1', ...(legacyImportAvailable ? ['browser_profile_import_v1'] : []),
|
|
950
972
|
...(process.platform === 'darwin' ? ['localhost_shell_v1'] : [])],
|
|
951
973
|
secureBrowserPublicKey: secureIdentity.publicKey, secureBrowserKeyId: secureIdentity.keyId }));
|
|
952
974
|
socket.on('message', raw => {
|
|
@@ -1024,6 +1046,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1024
1046
|
console.log(`Connected ${device.name} (${device.agentTerminalId}).`);
|
|
1025
1047
|
}
|
|
1026
1048
|
operationalLog.write('INFO', {}, 'socket.ready', { resumedExecutions: children.size + completed.size });
|
|
1049
|
+
reportBrowserInventory();
|
|
1027
1050
|
const pendingResumes = new Set([...children.keys(), ...completed.keys()]);
|
|
1028
1051
|
recovery.ready(pendingResumes);
|
|
1029
1052
|
for (const executionId of pendingResumes) {
|
|
@@ -1034,6 +1057,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1034
1057
|
socket.terminate();
|
|
1035
1058
|
return;
|
|
1036
1059
|
}
|
|
1060
|
+
reportBrowserInventory();
|
|
1037
1061
|
send(socket, { type: 'heartbeat', connectionId, threadBrowserScopes: threadBrowserScopes(), browserSessionIds: browserSessionIds() });
|
|
1038
1062
|
}, 15_000);
|
|
1039
1063
|
return;
|
|
@@ -1045,11 +1069,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1045
1069
|
for (const [id, expiresAt] of revokedProfileSessions)
|
|
1046
1070
|
if (expiresAt <= Date.now())
|
|
1047
1071
|
revokedProfileSessions.delete(id);
|
|
1048
|
-
|
|
1049
|
-
const central = centralProfiles.get(frame.browserSessionId);
|
|
1050
|
-
centralProfiles.delete(frame.browserSessionId);
|
|
1051
|
-
await revokeBrowserProfileSession(frame.browserSessionId, frame.browserProfileId);
|
|
1052
|
-
await central?.lease.release();
|
|
1072
|
+
await revokeProfileMember(frame.browserSessionId, frame.browserProfileId);
|
|
1053
1073
|
}
|
|
1054
1074
|
return;
|
|
1055
1075
|
}
|
|
@@ -1357,6 +1377,9 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1357
1377
|
activeChildren.add(child);
|
|
1358
1378
|
send(socket, { type: 'ack', connectionId, executionId: frame.executionId });
|
|
1359
1379
|
void (async () => {
|
|
1380
|
+
for (const [id, expiresAt] of revokedProfileSessions)
|
|
1381
|
+
if (expiresAt <= Date.now())
|
|
1382
|
+
revokedProfileSessions.delete(id);
|
|
1360
1383
|
if (frame.browserSessionId && revokedProfileSessions.has(frame.browserSessionId))
|
|
1361
1384
|
throw new Error('browser_profile_lease_expired');
|
|
1362
1385
|
let central = frame.browserSessionId ? centralProfiles.get(frame.browserSessionId) : undefined;
|
|
@@ -1370,15 +1393,73 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1370
1393
|
|| grant.scope.browserSessionId !== frame.browserSessionId || !Number.isSafeInteger(grant.scope.generation)
|
|
1371
1394
|
|| grant.scope.generation < 1 || !Number.isSafeInteger(grant.revision) || grant.revision < 0)
|
|
1372
1395
|
throw new Error('browser_profile_scope_changed');
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1396
|
+
const id = grant.scope.browserSessionId;
|
|
1397
|
+
const contextId = grant.sharedContextId;
|
|
1398
|
+
const rpc = profileRpc;
|
|
1399
|
+
if (contextId !== undefined) {
|
|
1400
|
+
if (!/^[a-f0-9]{64}$/u.test(contextId) || contextId === id || revokedProfileSessions.has(contextId)
|
|
1401
|
+
|| frame.networkAccessOnce || frame.networkAccessExpiresAt != null)
|
|
1402
|
+
throw new Error('browser_profile_scope_changed');
|
|
1403
|
+
let opening = sharedProfileOpens.get(contextId);
|
|
1404
|
+
const contextScope = ['instanceId', 'browserProfileId', 'actorUserId', 'agentTerminalId',
|
|
1405
|
+
'agentTerminalWorkspaceId', 'connectionId', 'keyId', 'keyVersion', 'generation'];
|
|
1406
|
+
const openScope = opening?.scope;
|
|
1407
|
+
if (openScope && contextScope.some(key => openScope[key] !== grant.scope[key]))
|
|
1408
|
+
throw new Error('browser_profile_scope_changed');
|
|
1409
|
+
if (!opening) {
|
|
1410
|
+
const members = new Set();
|
|
1411
|
+
const forget = () => {
|
|
1412
|
+
sharedProfileOpens.delete(contextId);
|
|
1413
|
+
revokedProfileSessions.set(contextId, Date.now() + 60_000);
|
|
1414
|
+
};
|
|
1415
|
+
const lease = CentralBrowserProfileLease.open({ ...grant, digest: grant.download?.digest }, secureIdentity.privateKey, rpc.transport(grant, {
|
|
1416
|
+
current: () => [...members],
|
|
1417
|
+
revoke: ids => { for (const id of ids)
|
|
1418
|
+
void revokeProfileMember(id, grant.profile.id).catch(() => undefined); },
|
|
1419
|
+
}), async () => {
|
|
1420
|
+
forget();
|
|
1421
|
+
await Promise.all([...members].map(id => revokeProfileMember(id, grant.profile.id)));
|
|
1422
|
+
}).then(lease => ({
|
|
1423
|
+
get state() { return lease.state; },
|
|
1424
|
+
save: state => lease.save(state),
|
|
1425
|
+
release: () => { forget(); return lease.release(); },
|
|
1426
|
+
}), error => { forget(); throw error; });
|
|
1427
|
+
opening = { lease, members, scope: grant.scope };
|
|
1428
|
+
sharedProfileOpens.set(contextId, opening);
|
|
1429
|
+
}
|
|
1430
|
+
const { members, lease: openingLease } = opening;
|
|
1431
|
+
members.add(id);
|
|
1432
|
+
const lease = await openingLease;
|
|
1433
|
+
const authorized = () => activeConnectionId === frame.connectionId && !policyRevisionUnavailable
|
|
1434
|
+
&& minimumPolicyGrantRevision === frame.policyGrantRevision
|
|
1435
|
+
&& !revokedProfileSessions.has(contextId) && !revokedProfileSessions.has(id);
|
|
1436
|
+
const releaseMember = async () => {
|
|
1437
|
+
if (!members.delete(id))
|
|
1438
|
+
return;
|
|
1439
|
+
centralProfiles.delete(id);
|
|
1440
|
+
if (members.size === 0)
|
|
1441
|
+
await lease.release();
|
|
1442
|
+
else
|
|
1443
|
+
await rpc.releaseMember(id).catch(() => undefined);
|
|
1444
|
+
};
|
|
1445
|
+
if (!authorized()) {
|
|
1446
|
+
await releaseMember();
|
|
1447
|
+
throw new Error('browser_profile_lease_expired');
|
|
1448
|
+
}
|
|
1449
|
+
central = { ...grant.profile, lease, shared: { contextId, authorized, releaseMember } };
|
|
1450
|
+
}
|
|
1451
|
+
else {
|
|
1452
|
+
const lease = await CentralBrowserProfileLease.open({ ...grant, digest: grant.download?.digest }, secureIdentity.privateKey, rpc.transport(grant), async () => { await revokeProfileMember(id, grant.profile.id); });
|
|
1453
|
+
if (revokedProfileSessions.has(id)) {
|
|
1454
|
+
await lease.release();
|
|
1455
|
+
throw new Error('browser_profile_lease_expired');
|
|
1456
|
+
}
|
|
1457
|
+
central = { ...grant.profile, lease: {
|
|
1458
|
+
get state() { return lease.state; },
|
|
1459
|
+
save: state => lease.save(state),
|
|
1460
|
+
release: () => { centralProfiles.delete(id); return lease.release(); },
|
|
1461
|
+
} };
|
|
1380
1462
|
}
|
|
1381
|
-
central = { ...grant.profile, lease };
|
|
1382
1463
|
centralProfiles.set(grant.scope.browserSessionId, central);
|
|
1383
1464
|
}
|
|
1384
1465
|
if (frame.browserProfileId && (!central || central.id !== frame.browserProfileId))
|
|
@@ -1468,14 +1549,14 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1468
1549
|
cancelled: cancelledExecutions.delete(frame.executionId) });
|
|
1469
1550
|
operationalLog.write('INFO', trace, 'execution.completed', { operation,
|
|
1470
1551
|
browserAction: frame.browserAction, exitCode: 0, screenshot: frame.browserAction === 'screenshot' });
|
|
1552
|
+
reportBrowserInventory();
|
|
1471
1553
|
if (resumed.has(frame.executionId))
|
|
1472
1554
|
flushExecution(frame.executionId);
|
|
1473
1555
|
}).catch(async (error) => {
|
|
1474
1556
|
if (frame.browserProfileGrant && frame.browserSessionId) {
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
await central?.lease.release();
|
|
1557
|
+
await revokeProfileMember(frame.browserSessionId, frame.browserProfileGrant.profile.id).catch(() => undefined);
|
|
1558
|
+
if (frame.browserProfileGrant.sharedContextId)
|
|
1559
|
+
await profileRpc?.releaseMember(frame.browserSessionId).catch(() => undefined);
|
|
1479
1560
|
}
|
|
1480
1561
|
if (policyTimer)
|
|
1481
1562
|
clearTimeout(policyTimer);
|
|
@@ -1491,6 +1572,7 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1491
1572
|
browserAction: frame.browserAction,
|
|
1492
1573
|
errorCode: actionAttempted ? 'browser_action_outcome_unknown' : operationalErrorCode(error),
|
|
1493
1574
|
executed: actionAttempted });
|
|
1575
|
+
reportBrowserInventory();
|
|
1494
1576
|
if (resumed.has(frame.executionId))
|
|
1495
1577
|
flushExecution(frame.executionId);
|
|
1496
1578
|
});
|
|
@@ -1575,10 +1657,8 @@ async function connect(profile, device, legacyImportAvailable) {
|
|
|
1575
1657
|
socket.on('close', (code, reason) => {
|
|
1576
1658
|
profileImports?.dispose();
|
|
1577
1659
|
profileRpc?.dispose();
|
|
1578
|
-
for (const [sessionId, central] of centralProfiles)
|
|
1579
|
-
|
|
1580
|
-
void revokeBrowserProfileSession(sessionId, central.id).catch(() => undefined);
|
|
1581
|
-
}
|
|
1660
|
+
for (const [sessionId, central] of centralProfiles)
|
|
1661
|
+
void revokeProfileMember(sessionId, central.id).catch(() => undefined);
|
|
1582
1662
|
live.disconnectAll();
|
|
1583
1663
|
securePolicyEpoch++;
|
|
1584
1664
|
const closeReason = reason.toString();
|
|
@@ -7,6 +7,7 @@ import { ApiError, RequestTimeoutError } from "./client.js";
|
|
|
7
7
|
import { componentContentDigest } from "./component-contract.js";
|
|
8
8
|
import { buildDebugElements, normalizeComponentType } from "./component-debug-source.js";
|
|
9
9
|
import { readConfiguredResourceMetadataStableKey } from "./resource-metadata.js";
|
|
10
|
+
import { retiredLibraryOptionErrors } from "./request-contract.js";
|
|
10
11
|
import { ENDPOINT_MANIFEST_FILE, ENDPOINTS_DIRECTORY, validateEndpointManifest, } from "./resource-syncs/endpoint-sync.js";
|
|
11
12
|
import { normalizeEndpointPath } from "./resource-syncs/runtime-definition-validation.js";
|
|
12
13
|
import { isRecord } from "./resource-syncs/util.js";
|
|
@@ -123,6 +124,9 @@ async function matchRoute(options, method, pathname) {
|
|
|
123
124
|
if (matches[1]?.dynamic === match.dynamic) {
|
|
124
125
|
throw new EmulatorError(409, 'AMBIGUOUS_ENDPOINT', 'More than one local route matches with the same specificity.');
|
|
125
126
|
}
|
|
127
|
+
const retired = retiredLibraryOptionErrors(match.value.options);
|
|
128
|
+
if (retired.length)
|
|
129
|
+
throw new EmulatorError(422, 'EXECUTION_LIBRARY_OPTION_REMOVED', retired.join('\n'));
|
|
126
130
|
if (!validateEndpointManifest(match.value, options.stableKeyName)) {
|
|
127
131
|
throw new EmulatorError(422, 'INVALID_ENDPOINT', `Invalid local endpoint: ${path.basename(path.dirname(match.file))}.`);
|
|
128
132
|
}
|
|
@@ -134,8 +138,8 @@ function assertSupportedEndpoint(endpoint) {
|
|
|
134
138
|
if (policy?.currentUser === 'EXECUTION_ACCOUNT' || (policy?.mode === 'SERVICE_ACCOUNT' && policy.currentUser !== 'CALLER')) {
|
|
135
139
|
throw new EmulatorError(501, 'ENDPOINT_EXECUTION_POLICY_UNSUPPORTED', 'Local preview uses the CLI identity. Select Published endpoints for this route.');
|
|
136
140
|
}
|
|
137
|
-
if ((options.responseMode ?? 'http') !== 'http'
|
|
138
|
-
throw new EmulatorError(501, 'ENDPOINT_OPTIONS_UNSUPPORTED', 'Endpoint SSE
|
|
141
|
+
if ((options.responseMode ?? 'http') !== 'http') {
|
|
142
|
+
throw new EmulatorError(501, 'ENDPOINT_OPTIONS_UNSUPPORTED', 'Endpoint SSE is unavailable through component debug.');
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
async function readRequestBody(request) {
|
|
@@ -193,12 +197,9 @@ async function loadComponent({ file, value }) {
|
|
|
193
197
|
const extension = type.includes('_TS') ? 'ts' : type === 'JSON_VALIDATOR' ? 'json' : 'js';
|
|
194
198
|
return readWorkspaceComponentSource(file, value, extension);
|
|
195
199
|
}
|
|
196
|
-
async function loadLibraries(files
|
|
197
|
-
const include = Array.isArray(options.includeLibs) ? options.includeLibs : [];
|
|
198
|
-
const exclude = Array.isArray(options.excludeLibs) ? options.excludeLibs : [];
|
|
200
|
+
async function loadLibraries(files) {
|
|
199
201
|
const libs = files.filter(({ value }) => typeof value.name === 'string' && value.active !== false
|
|
200
|
-
&& LIB_TYPES.has(normalizeComponentType(value))
|
|
201
|
-
&& !exclude.includes(value.name));
|
|
202
|
+
&& LIB_TYPES.has(normalizeComponentType(value)));
|
|
202
203
|
const names = libs.map(({ value }) => value.name);
|
|
203
204
|
if (new Set(names).size !== libs.length || libs.length > 100) {
|
|
204
205
|
throw new EmulatorError(422, 'INVALID_DEBUG_LIBRARIES', 'Selected local libraries have duplicate names or exceed the sandbox limit of 100.');
|
|
@@ -340,7 +341,7 @@ async function executeRequest(emulator, request, signal, onRoute, onExecution) {
|
|
|
340
341
|
if (new Set(elements.map(element => element.key.toLowerCase())).size !== elements.length) {
|
|
341
342
|
throw new EmulatorError(501, 'AMBIGUOUS_DEBUG_RESULT_KEYS', 'Component keys that differ only by case cannot be emulated through legacy debug results.');
|
|
342
343
|
}
|
|
343
|
-
const extraLibs = await loadLibraries(files
|
|
344
|
+
const extraLibs = await loadLibraries(files);
|
|
344
345
|
const timeout = endpoint.timeout ?? 60;
|
|
345
346
|
const payload = {
|
|
346
347
|
...(emulator.skipValidate ? { bypassValidation: true } : {}),
|
|
@@ -349,8 +350,6 @@ async function executeRequest(emulator, request, signal, onRoute, onExecution) {
|
|
|
349
350
|
...validation.input,
|
|
350
351
|
params: Object.values(isRecord(validation.input.parameters) ? validation.input.parameters : parameters),
|
|
351
352
|
path: url.pathname, method, templateInputs: options.input ?? {},
|
|
352
|
-
...(Array.isArray(options.includeLibs) ? { includeLibs: options.includeLibs } : {}),
|
|
353
|
-
...(Array.isArray(options.excludeLibs) ? { excludeLibs: options.excludeLibs } : {}),
|
|
354
353
|
},
|
|
355
354
|
};
|
|
356
355
|
signal.throwIfAborted();
|
package/dist/src/project.js
CHANGED
|
@@ -527,6 +527,7 @@ export function ensureProjectDebugScaffolding(rootDir) {
|
|
|
527
527
|
timeout: 10,
|
|
528
528
|
memory: 128,
|
|
529
529
|
readOnly: true,
|
|
530
|
+
callStrategy: 'caller',
|
|
530
531
|
}, null, 2)}\n`],
|
|
531
532
|
[path.join(rootDir, REVO_PLAYGROUND_JS_FILE), ''],
|
|
532
533
|
[path.join(rootDir, REVO_PLAYGROUND_TS_FILE), ''],
|
|
@@ -37,3 +37,5 @@ export declare function validateRequestContract(name: string, value: unknown, op
|
|
|
37
37
|
partial?: boolean;
|
|
38
38
|
path?: string;
|
|
39
39
|
}): string[];
|
|
40
|
+
/** Only former compiler configuration locations are checked; business values remain unrestricted. */
|
|
41
|
+
export declare function retiredLibraryOptionErrors(value: unknown, path?: string): string[];
|
|
@@ -61,7 +61,10 @@ export function validateRequestContract(name, value, options = {}) {
|
|
|
61
61
|
const schema = requestContracts[name];
|
|
62
62
|
if (!schema)
|
|
63
63
|
return [`Unknown request contract "${name}"`];
|
|
64
|
-
const errors = []
|
|
64
|
+
const errors = ['EndpointOptionsDto', 'RunOptionsDto', 'JobOptionsDto'].includes(name)
|
|
65
|
+
? retiredLibraryOptionErrors(value, options.path || name)
|
|
66
|
+
: ['EndpointRequestDto', 'JobTemplateRequestDto', 'UpdateEndpointRequestDto', 'UpdateJobTemplate'].includes(name) && isObject(value)
|
|
67
|
+
? retiredLibraryOptionErrors(value.options, `${options.path || name}.options`) : [];
|
|
65
68
|
function visit(rule, input, label, parent, partial = false) {
|
|
66
69
|
if (rule.whenEquals && parent?.[rule.whenEquals.field] !== rule.whenEquals.value)
|
|
67
70
|
return;
|
|
@@ -136,3 +139,10 @@ export function validateRequestContract(name, value, options = {}) {
|
|
|
136
139
|
visit(schema, value, options.path || name, undefined, options.partial);
|
|
137
140
|
return errors;
|
|
138
141
|
}
|
|
142
|
+
/** Only former compiler configuration locations are checked; business values remain unrestricted. */
|
|
143
|
+
export function retiredLibraryOptionErrors(value, path = 'options') {
|
|
144
|
+
if (!isObject(value))
|
|
145
|
+
return [];
|
|
146
|
+
return ['skipLibs', 'includeLibs', 'excludeLibs'].filter(key => Object.hasOwn(value, key))
|
|
147
|
+
.map(key => `${path}.${key} is no longer supported. Please update the client and remove this configuration field.`);
|
|
148
|
+
}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -144,9 +144,6 @@ export type EndpointOptions = {
|
|
|
144
144
|
customValidateResponse?: unknown;
|
|
145
145
|
validateResponse?: number;
|
|
146
146
|
validateHideResponse?: boolean;
|
|
147
|
-
includeLibs?: string[];
|
|
148
|
-
excludeLibs?: string[];
|
|
149
|
-
skipLibs?: boolean;
|
|
150
147
|
legacyResults?: boolean;
|
|
151
148
|
hideRequest?: boolean;
|
|
152
149
|
hideResponse?: boolean;
|
package/dist/src/ui.js
CHANGED
|
@@ -136,7 +136,7 @@ function renderCommandCatalog() {
|
|
|
136
136
|
commandRow('revo component pull --all [--project <name>] [--yes] [--force]', 'Pull every available component safely'),
|
|
137
137
|
commandRow('revo component push <identity...> [--project <name>]', 'Push by configured stable key or component ID'),
|
|
138
138
|
commandRow('revo component push --all [--project <name>] [--yes] [--force] [--prune] [--changed --base <ref>]', 'Push local components with lock checks'),
|
|
139
|
-
commandRow('revo component debug <componentId> [BODY] [--read-only=true|false] [--stream]', 'Run one local component in sandbox'),
|
|
139
|
+
commandRow('revo component debug <componentId> [BODY] [--read-only=true|false] [--call-strategy=caller|endpoints|jobs] [--stream]', 'Run one local component in sandbox'),
|
|
140
140
|
'',
|
|
141
141
|
paintHeader('Native tests'),
|
|
142
142
|
commandRow('revo tests list [--workspace <path>] [--search <name>] [--json]', 'Discover native test suites in the local worktree'),
|