@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.
Files changed (31) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -3
  3. package/dist/src/argument-contract.js +1 -1
  4. package/dist/src/automation-contract.generated.d.ts +6 -30
  5. package/dist/src/automation-contract.generated.js +6 -30
  6. package/dist/src/commands/component.js +16 -0
  7. package/dist/src/commands/terminal-browser-human-input.d.ts +28 -0
  8. package/dist/src/commands/terminal-browser-human-input.js +56 -7
  9. package/dist/src/commands/terminal-browser-live-protocol.d.ts +9 -1
  10. package/dist/src/commands/terminal-browser-live-protocol.js +16 -3
  11. package/dist/src/commands/terminal-browser-live-transport.d.ts +2 -0
  12. package/dist/src/commands/terminal-browser-live-transport.js +21 -5
  13. package/dist/src/commands/terminal-browser-live.d.ts +18 -1
  14. package/dist/src/commands/terminal-browser-live.js +190 -14
  15. package/dist/src/commands/terminal-browser-observation.d.ts +1 -1
  16. package/dist/src/commands/terminal-browser-observation.js +10 -1
  17. package/dist/src/commands/terminal-browser-page-input.d.ts +1 -0
  18. package/dist/src/commands/terminal-browser-page-input.js +20 -0
  19. package/dist/src/commands/terminal-browser-profile-sync.d.ts +5 -1
  20. package/dist/src/commands/terminal-browser-profile-sync.js +13 -2
  21. package/dist/src/commands/terminal-browser-profile-sync.protocol.d.ts +2 -0
  22. package/dist/src/commands/terminal-browser.d.ts +17 -0
  23. package/dist/src/commands/terminal-browser.js +310 -104
  24. package/dist/src/commands/terminal.js +104 -24
  25. package/dist/src/endpoint-emulator.js +9 -10
  26. package/dist/src/project.js +1 -0
  27. package/dist/src/request-contract.d.ts +2 -0
  28. package/dist/src/request-contract.js +11 -1
  29. package/dist/src/types.d.ts +0 -3
  30. package/dist/src/ui.js +1 -1
  31. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0 — 2026-11-07
4
+
5
+ ### Upgrade requirements
6
+
7
+ - This major release removes `skipLibs`, `includeLibs` and `excludeLibs` from Endpoint and Job configuration. Remove these fields from current manifests before plan, push, deploy or local preview. Their presence is rejected even when set to `false` or an empty array.
8
+ - Review non-default library selections before removing them; verify the affected workflow on a test instance. Fields with similar names inside ordinary business payloads are unaffected.
9
+ - Use Platform 1.8.0 or later for the updated execution contract and VS Code extension 2.0.0 or later for the matching editor workflow. Update this compatibility set together.
10
+
11
+ ### Debugging and Live Preview
12
+
13
+ - Component debugging accepts `--call-strategy=caller|endpoints|jobs` or `callStrategy` in the debug configuration. Caller remains the default; explicit policies retain account-access and source-approval requirements.
14
+ - Browser Live Preview reports active sessions and tabs, supports pointer gestures and selected-text feedback, and preserves privacy and access-revocation controls.
15
+ - Local endpoint preview retains read-only defaults and redacted request diagnostics. Published endpoint execution uses the selected instance's saved code and execution policy.
16
+
3
17
  ## 1.0.39 — 2026-11-06
4
18
 
5
19
  ### Database Table audit
package/README.md CHANGED
@@ -10,9 +10,11 @@ The CLI has three main capabilities:
10
10
  2. **Project migration** — plan, run, and verify a direct migration between two saved projects with `--from` and `--to`.
11
11
  3. **Resource synchronization** — work with one supported resource family through its dedicated `pull`, `plan`, and `push` commands.
12
12
 
13
- ## Version 1.0.39
13
+ ## Version 2.0.0
14
14
 
15
- Database Table manifests synchronize explicit audit settings. The endpoint emulator defaults to read-only Sandbox preview and also supports published Run execution. Terminal reconnects retain backoff until a healthy resume, and Browser Live Preview can reattach authorized viewers to surviving contexts. See the [1.0.39 changelog](CHANGELOG.md).
15
+ Use this release with Platform 1.8.0 or later and VS Code extension 2.0.0 or later. Update the compatible clients and backend together. Endpoint and Job configurations no longer accept `skipLibs`, `includeLibs` or `excludeLibs`, including `false` and empty arrays. Remove these fields from current manifests; review and test non-default selections first. Ordinary business payload fields are unaffected.
16
+
17
+ Debugger execution defaults to the caller and can explicitly select the global endpoint or job policy. Browser Live Preview supports pointer gestures, selected-text feedback and active-session status while retaining privacy controls. See the [2.0.0 changelog](CHANGELOG.md).
16
18
 
17
19
  Component creation and reviewed source saves can wait up to ten minutes, including cold Sandbox startup. This also extends Node fetch's response-header waiting limit. Upgrade the matching API/Sandbox services to receive the longer server-side validation budget. See the [1.0.35 changelog](CHANGELOG.md). Writes with `--omit` still require the matching API capability `atomicResourceUpdates`.
18
20
 
@@ -683,7 +685,7 @@ Save changes to `endpoint.json`, a component, or a JS/TS library. In local previ
683
685
 
684
686
  Pass `--skip-validate` to skip low-code source analysis for the component and libraries in Sandbox preview. Endpoint input schemas and runtime checks still apply.
685
687
 
686
- The emulator authenticates upstream as the CLI user. Browser authorization headers and cookies are stripped. Local preview supports JSON bodies, flat query parameters, and ordinary HTTP responses. Application SSE is unavailable. Local preview also excludes `skipLibs` and non-low-code components. The sandbox applies debugger logging, which can capture inputs and outputs even when the Run manifest sets `hideRequest` or `hideResponse`. Use development data.
688
+ The emulator authenticates upstream as the CLI user. Browser authorization headers and cookies are stripped. Local preview supports JSON bodies, flat query parameters, and ordinary HTTP responses. Application SSE is unavailable. Local preview excludes non-low-code components. Retired library-selection fields are rejected during configuration validation. The sandbox applies debugger logging, which can capture inputs and outputs even when the Run manifest sets `hideRequest` or `hideResponse`. Use development data.
687
689
 
688
690
  ## Other commands
689
691
 
@@ -705,6 +707,8 @@ revo component debug <componentId> --read-only=true --stream
705
707
  revo component debug <componentId> --read-only=false
706
708
  ```
707
709
 
710
+ Component debugging accepts `--call-strategy=caller|endpoints|jobs` or `callStrategy` in `.revoengine/debug.json`. The flag takes precedence; the default is `caller`. `endpoints` and `jobs` select the corresponding global execution policy, subject to account delegation and source approval. An inherited execution authority cannot be changed.
711
+
708
712
  Use low-level `request` carefully; it bypasses the higher-level migration planner.
709
713
 
710
714
  ## Command arguments and local workspace safety
@@ -187,7 +187,7 @@ function actionContract(args) {
187
187
  if (!action)
188
188
  return {};
189
189
  if (component && action === 'debug')
190
- return { ...v('id i body d timeout t memory m'), ...b('read-only stream extra-libs no-extra-libs raw-debug debug-raw debug-payload') };
190
+ return { ...v('id i body d timeout t memory m call-strategy'), ...b('read-only stream extra-libs no-extra-libs raw-debug debug-raw debug-payload') };
191
191
  const result = { ...all, ...output, ...omit,
192
192
  ...(action === 'plan' ? plan : force),
193
193
  ...(['push', 'push-all'].includes(action) ? yes : {}),
@@ -142,10 +142,6 @@ export declare const requestContracts: {
142
142
  readonly EndpointOptionsDto: {
143
143
  readonly type: "object";
144
144
  readonly properties: {
145
- readonly skipLibs: {
146
- readonly nullable: true;
147
- readonly type: "boolean";
148
- };
149
145
  readonly legacyResults: {
150
146
  readonly nullable: true;
151
147
  readonly type: "boolean";
@@ -209,20 +205,6 @@ export declare const requestContracts: {
209
205
  readonly nullable: true;
210
206
  readonly type: "boolean";
211
207
  };
212
- readonly includeLibs: {
213
- readonly nullable: true;
214
- readonly type: "array";
215
- readonly items: {
216
- readonly type: "string";
217
- };
218
- };
219
- readonly excludeLibs: {
220
- readonly nullable: true;
221
- readonly type: "array";
222
- readonly items: {
223
- readonly type: "string";
224
- };
225
- };
226
208
  readonly componentSchemaId: {
227
209
  readonly nullable: true;
228
210
  readonly type: "string";
@@ -412,10 +394,6 @@ export declare const requestContracts: {
412
394
  readonly nullable: true;
413
395
  readonly type: "object";
414
396
  };
415
- readonly skipLibs: {
416
- readonly nullable: true;
417
- readonly type: "boolean";
418
- };
419
397
  readonly legacyResults: {
420
398
  readonly nullable: true;
421
399
  readonly type: "boolean";
@@ -680,7 +658,6 @@ export declare const requestContractDefaults: {
680
658
  readonly hideRequest: false;
681
659
  readonly hideResponse: false;
682
660
  readonly legacyResults: false;
683
- readonly skipLibs: false;
684
661
  readonly memory: 256;
685
662
  readonly concurrency: {
686
663
  readonly key: null;
@@ -724,7 +701,6 @@ export declare const requestContractDefaults: {
724
701
  readonly hideRequest: false;
725
702
  readonly hideResponse: false;
726
703
  readonly legacyResults: false;
727
- readonly skipLibs: false;
728
704
  readonly memory: 32;
729
705
  };
730
706
  };
@@ -739,10 +715,10 @@ export declare const requestContractSemanticSources: {
739
715
  readonly "packages/domain/src/dto/components/component.validator.ts#validateEndpointGuardSemantics": "fd885b48c2990e47d1f05965af044aef8e2256da5fa4a86d1248967b04a3fd1e";
740
716
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#create": "cb10fc198892423088d396acd09618d8c64504a57fac0df3a892d57993913067";
741
717
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1";
742
- readonly "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "07401218669a87a9488b0aeb59f15b8d51341a172fb346ff83d38ed563a2988f";
743
- readonly "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "990c27ae925b613215601c215a6e38f6ecb4e2b34b77d6e2819f0921d4e56230";
744
- readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "1513bad8634fdf6abcca52f0041044512b3e53b3e7451f1b443f7e79fc026b01";
745
- readonly "apps/api/src/modules/automation/jobs.service.ts#update": "950fad34e7ac3ffdfce9114ba213c11e113aea036a44569b126a8c1e5e589228";
718
+ readonly "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "64686ee1c1e2611aa00847b771de637797a3007062b95e303046ad2cba69e729";
719
+ readonly "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "9da1bdfd83a3142b7f44d4ce5ee2aac6cf4ed70bef790f979c412c411fe2790d";
720
+ readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "e5230697a846e6a20f4cfe5f16eccdf27ba409f309d0e101b225cd4302c0cc48";
721
+ readonly "apps/api/src/modules/automation/jobs.service.ts#update": "448412c945a9fef3792359df48fa7d27e5afa254e7c43c6cea64e518381e41a0";
746
722
  readonly "packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f";
747
723
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da";
748
724
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48";
@@ -756,11 +732,11 @@ export declare const requestContractSourceProvenance: {
756
732
  readonly main: {
757
733
  readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointRequestDto": "45a1a84e200b2cdf9b44051fe36cb7bda1b577a0f5bbcc88942764336a6d7302";
758
734
  readonly "packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567";
759
- readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "acb07cc1e2c80d1721150691ea185eb3fa2f255a0833749973bf8175d85d9a32";
735
+ readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "1ade11735627613a81b5cfaa796dfdc49d4c7e0db01ae6467da6a99a9f3af683";
760
736
  readonly "packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc";
761
737
  readonly "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "c47123206c187f0e16b08d7033ed9c455932f2e78e34455577663eb09410559d";
762
738
  readonly "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "0f79fefc76e749a331b5c848b9dcd6061e7dc247c2094dd975d7d2fe9a101c08";
763
- readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "6e8f3f4b7aa6d8f38bc9227ced3158e4697031e68c78be9ea0e24e5af29e37d3";
739
+ readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "a4ee900b8610f7edbabf8d07738f99b33a288327ea0d66e67c0f8c28260215c8";
764
740
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "529600772a878c5d26d55a70f5e562031169967051f5d0485ab4659a480d4a8d";
765
741
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1";
766
742
  readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474";
@@ -194,10 +194,6 @@ export const requestContracts = {
194
194
  "EndpointOptionsDto": {
195
195
  "type": "object",
196
196
  "properties": {
197
- "skipLibs": {
198
- "nullable": true,
199
- "type": "boolean"
200
- },
201
197
  "legacyResults": {
202
198
  "nullable": true,
203
199
  "type": "boolean"
@@ -264,20 +260,6 @@ export const requestContracts = {
264
260
  "nullable": true,
265
261
  "type": "boolean"
266
262
  },
267
- "includeLibs": {
268
- "nullable": true,
269
- "type": "array",
270
- "items": {
271
- "type": "string"
272
- }
273
- },
274
- "excludeLibs": {
275
- "nullable": true,
276
- "type": "array",
277
- "items": {
278
- "type": "string"
279
- }
280
- },
281
263
  "componentSchemaId": {
282
264
  "nullable": true,
283
265
  "type": "string",
@@ -484,10 +466,6 @@ export const requestContracts = {
484
466
  "nullable": true,
485
467
  "type": "object"
486
468
  },
487
- "skipLibs": {
488
- "nullable": true,
489
- "type": "boolean"
490
- },
491
469
  "legacyResults": {
492
470
  "nullable": true,
493
471
  "type": "boolean"
@@ -786,7 +764,6 @@ export const requestContractDefaults = {
786
764
  "hideRequest": false,
787
765
  "hideResponse": false,
788
766
  "legacyResults": false,
789
- "skipLibs": false,
790
767
  "memory": 256,
791
768
  "concurrency": {
792
769
  "key": null,
@@ -1011,7 +988,6 @@ export const requestContractDefaults = {
1011
988
  "hideRequest": false,
1012
989
  "hideResponse": false,
1013
990
  "legacyResults": false,
1014
- "skipLibs": false,
1015
991
  "memory": 32
1016
992
  }
1017
993
  }
@@ -1026,10 +1002,10 @@ export const requestContractSemanticSources = {
1026
1002
  "packages/domain/src/dto/components/component.validator.ts#validateEndpointGuardSemantics": "fd885b48c2990e47d1f05965af044aef8e2256da5fa4a86d1248967b04a3fd1e",
1027
1003
  "apps/api/src/modules/endpoints/endpoint.service.ts#create": "cb10fc198892423088d396acd09618d8c64504a57fac0df3a892d57993913067",
1028
1004
  "apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1",
1029
- "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "07401218669a87a9488b0aeb59f15b8d51341a172fb346ff83d38ed563a2988f",
1030
- "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "990c27ae925b613215601c215a6e38f6ecb4e2b34b77d6e2819f0921d4e56230",
1031
- "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "1513bad8634fdf6abcca52f0041044512b3e53b3e7451f1b443f7e79fc026b01",
1032
- "apps/api/src/modules/automation/jobs.service.ts#update": "950fad34e7ac3ffdfce9114ba213c11e113aea036a44569b126a8c1e5e589228",
1005
+ "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "64686ee1c1e2611aa00847b771de637797a3007062b95e303046ad2cba69e729",
1006
+ "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "9da1bdfd83a3142b7f44d4ce5ee2aac6cf4ed70bef790f979c412c411fe2790d",
1007
+ "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "e5230697a846e6a20f4cfe5f16eccdf27ba409f309d0e101b225cd4302c0cc48",
1008
+ "apps/api/src/modules/automation/jobs.service.ts#update": "448412c945a9fef3792359df48fa7d27e5afa254e7c43c6cea64e518381e41a0",
1033
1009
  "packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f",
1034
1010
  "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da",
1035
1011
  "packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48",
@@ -1043,11 +1019,11 @@ export const requestContractSourceProvenance = {
1043
1019
  "main": {
1044
1020
  "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointRequestDto": "45a1a84e200b2cdf9b44051fe36cb7bda1b577a0f5bbcc88942764336a6d7302",
1045
1021
  "packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567",
1046
- "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "acb07cc1e2c80d1721150691ea185eb3fa2f255a0833749973bf8175d85d9a32",
1022
+ "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "1ade11735627613a81b5cfaa796dfdc49d4c7e0db01ae6467da6a99a9f3af683",
1047
1023
  "packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc",
1048
1024
  "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "c47123206c187f0e16b08d7033ed9c455932f2e78e34455577663eb09410559d",
1049
1025
  "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "0f79fefc76e749a331b5c848b9dcd6061e7dc247c2094dd975d7d2fe9a101c08",
1050
- "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "6e8f3f4b7aa6d8f38bc9227ced3158e4697031e68c78be9ea0e24e5af29e37d3",
1026
+ "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "a4ee900b8610f7edbabf8d07738f99b33a288327ea0d66e67c0f8c28260215c8",
1051
1027
  "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "529600772a878c5d26d55a70f5e562031169967051f5d0485ab4659a480d4a8d",
1052
1028
  "packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1",
1053
1029
  "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474",
@@ -1,3 +1,4 @@
1
+ import { retiredLibraryOptionErrors } from "../request-contract.js";
1
2
  import { buildDebugElements, normalizeComponentType, readDebugElementKey, readDebugElementOrder, sortDebugElements } from "../component-debug-source.js";
2
3
  import { withCommandSyncOmit } from "../sync-omit-command.js";
3
4
  import { preserveOmittedProperties, syncBaselineHash, syncSourceBaselineHash, withoutSyncOmit, assertOmittedPropertiesPreserved, omitPaths } from "../sync-omit.js";
@@ -1920,7 +1921,19 @@ function resolveDebugReadOnly(cwd, flag) {
1920
1921
  }
1921
1922
  return true;
1922
1923
  }
1924
+ function resolveDebugCallStrategy(cwd, flag) {
1925
+ const configPath = path.join(getProjectRoot(cwd) || cwd, '.revoengine', 'debug.json');
1926
+ const config = fs.existsSync(configPath) ? JSON.parse(fs.readFileSync(configPath, 'utf8')) : {};
1927
+ const strategy = flag ?? config.callStrategy ?? 'caller';
1928
+ if (strategy !== 'caller' && strategy !== 'endpoints' && strategy !== 'jobs') {
1929
+ throw new Error('callStrategy / --call-strategy must be caller, endpoints or jobs.');
1930
+ }
1931
+ return strategy;
1932
+ }
1923
1933
  function buildDebugPayload(cwd, component, input) {
1934
+ const retired = retiredLibraryOptionErrors(input.inputs, 'inputs');
1935
+ if (retired.length)
1936
+ throw new Error(retired.join('\n'));
1924
1937
  const type = normalizeComponentType(component);
1925
1938
  const base = {
1926
1939
  type,
@@ -1928,6 +1941,7 @@ function buildDebugPayload(cwd, component, input) {
1928
1941
  timeout: input.timeout,
1929
1942
  memory: input.memory,
1930
1943
  readOnly: input.readOnly,
1944
+ callStrategy: input.callStrategy,
1931
1945
  ...(input.extraLibs?.length ? { extraLibs: input.extraLibs } : {}),
1932
1946
  };
1933
1947
  if (!isDebugLibraryType(type)) {
@@ -2044,6 +2058,7 @@ async function debugSingleComponent(context, componentId) {
2044
2058
  const timeout = parseDebugNumber(context.args, ['timeout', 't'], 10, 600, 'Timeout');
2045
2059
  const memory = parseDebugNumber(context.args, ['memory', 'm'], 128, 1024, 'Memory');
2046
2060
  const readOnly = resolveDebugReadOnly(context.cwd, context.args['read-only']);
2061
+ const callStrategy = resolveDebugCallStrategy(context.cwd, context.args['call-strategy']);
2047
2062
  const stream = readBoolFlag(context.args, ['stream']);
2048
2063
  const includeExtraLibs = context.args['extra-libs'] !== false
2049
2064
  && !readBoolFlag(context.args, ['no-extra-libs']);
@@ -2059,6 +2074,7 @@ async function debugSingleComponent(context, componentId) {
2059
2074
  timeout,
2060
2075
  memory,
2061
2076
  readOnly,
2077
+ callStrategy,
2062
2078
  extraLibs: extraLibs.map((entry) => entry.payload),
2063
2079
  });
2064
2080
  const endpoint = stream ? buildSandboxDebugStreamUrl(sandboxEndpoint) : buildSandboxDebugUrl(sandboxEndpoint);
@@ -11,3 +11,31 @@ export type HumanInputScope = {
11
11
  export declare function decryptBrowserHumanInput(frame: BrowserLiveControl, scope: HumanInputScope, identity: SecureBrowserIdentity): BrowserInteraction & {
12
12
  focusId?: string;
13
13
  };
14
+ type Point = {
15
+ x: number;
16
+ y: number;
17
+ };
18
+ export type BrowserPointer = {
19
+ observationId: string;
20
+ gestureId: string;
21
+ sequence: number;
22
+ } & ({
23
+ phase: 'down';
24
+ button: 'left' | 'right' | 'middle';
25
+ modifiers?: BrowserInteraction['modifiers'];
26
+ } & Point | {
27
+ phase: 'move' | 'up';
28
+ } & Point | {
29
+ phase: 'cancel';
30
+ });
31
+ export declare function decryptBrowserPointer(frame: BrowserLiveControl, scope: HumanInputScope, identity: SecureBrowserIdentity): BrowserPointer;
32
+ export declare function decryptClipboardRequest(frame: BrowserLiveControl, scope: HumanInputScope, identity: SecureBrowserIdentity): {
33
+ observationId: string;
34
+ key: Buffer<ArrayBufferLike>;
35
+ };
36
+ export declare function encryptBrowserSelection(frame: BrowserLiveControl, key: Buffer, text: string): {
37
+ iv: string;
38
+ ciphertext: string;
39
+ tag: string;
40
+ } | undefined;
41
+ export {};
@@ -1,5 +1,5 @@
1
- import { createDecipheriv, createPublicKey, diffieHellman, hkdfSync } from 'node:crypto';
2
- import { browserLiveInputAad, BROWSER_LIVE_INPUT_INFO } from "./terminal-browser-live-protocol.js";
1
+ import { createCipheriv, createDecipheriv, createPublicKey, diffieHellman, hkdfSync, randomBytes } from 'node:crypto';
2
+ import { browserClipboardAad, browserLiveInputAad, BROWSER_LIVE_INPUT_INFO } from "./terminal-browser-live-protocol.js";
3
3
  import { validBrowserInteraction } from "./terminal-browser-interaction.js";
4
4
  function bytes(value, size) {
5
5
  const data = Buffer.from(value, 'base64');
@@ -7,7 +7,7 @@ function bytes(value, size) {
7
7
  throw new Error('browser_private_input_invalid');
8
8
  return data;
9
9
  }
10
- export function decryptBrowserHumanInput(frame, scope, identity) {
10
+ function decryptPayload(frame, scope, identity, validate) {
11
11
  const input = frame.privateInput;
12
12
  if (!input || input.keyId !== identity.keyId || !Number.isSafeInteger(input.expiresAt)
13
13
  || input.expiresAt <= Date.now() || input.expiresAt > Date.now() + 60_000)
@@ -29,11 +29,9 @@ export function decryptBrowserHumanInput(frame, scope, identity) {
29
29
  throw new Error();
30
30
  plaintext = Buffer.concat([cipher.update(ciphertext), cipher.final()]);
31
31
  const interaction = JSON.parse(plaintext.toString('utf8'));
32
- const { focusId, ...ordinary } = interaction;
33
- if (!validBrowserInteraction(ordinary) || ordinary.observationId !== input.observationId
34
- || focusId !== undefined && (ordinary.kind !== 'text' || typeof focusId !== 'string' || !/^[a-f0-9-]{36}$/iu.test(focusId)))
32
+ if (interaction?.observationId !== input.observationId)
35
33
  throw new Error();
36
- return interaction;
34
+ return validate(interaction);
37
35
  }
38
36
  catch {
39
37
  throw new Error('browser_private_input_invalid');
@@ -44,3 +42,54 @@ export function decryptBrowserHumanInput(frame, scope, identity) {
44
42
  plaintext?.fill(0);
45
43
  }
46
44
  }
45
+ export function decryptBrowserHumanInput(frame, scope, identity) {
46
+ return decryptPayload(frame, scope, identity, interaction => {
47
+ const { focusId, ...ordinary } = interaction;
48
+ if (!validBrowserInteraction(ordinary)
49
+ || focusId !== undefined && (ordinary.kind !== 'text' || typeof focusId !== 'string' || !/^[a-f0-9-]{36}$/iu.test(focusId)))
50
+ throw new Error();
51
+ return interaction;
52
+ });
53
+ }
54
+ export function decryptBrowserPointer(frame, scope, identity) {
55
+ return decryptPayload(frame, scope, identity, pointer => {
56
+ const { phase, gestureId, sequence, ...point } = pointer;
57
+ if (typeof gestureId !== 'string' || !/^[a-f0-9-]{36}$/iu.test(gestureId)
58
+ || !Number.isSafeInteger(sequence) || sequence < 0)
59
+ throw new Error();
60
+ if (phase === 'cancel') {
61
+ if (Object.keys(point).length !== 1)
62
+ throw new Error();
63
+ }
64
+ else {
65
+ if (!['down', 'move', 'up'].includes(phase)
66
+ || !validBrowserInteraction({ ...point, kind: phase === 'down' ? 'click' : 'move' })
67
+ || phase === 'down' && (sequence !== 0 || !point.button))
68
+ throw new Error();
69
+ }
70
+ return pointer;
71
+ });
72
+ }
73
+ export function decryptClipboardRequest(frame, scope, identity) {
74
+ return decryptPayload(frame, scope, identity, payload => {
75
+ if (payload.kind !== 'copy_selection' || typeof payload.replyKey !== 'string'
76
+ || Object.keys(payload).some(key => !['kind', 'observationId', 'replyKey'].includes(key)))
77
+ throw new Error();
78
+ return { observationId: payload.observationId, key: bytes(payload.replyKey, 32) };
79
+ });
80
+ }
81
+ export function encryptBrowserSelection(frame, key, text) {
82
+ const plaintext = Buffer.from(text, 'utf8');
83
+ try {
84
+ if (!plaintext.length || plaintext.length > 4096)
85
+ return undefined;
86
+ const iv = randomBytes(12);
87
+ const cipher = createCipheriv('aes-256-gcm', key, iv);
88
+ cipher.setAAD(browserClipboardAad(frame));
89
+ return { iv: iv.toString('base64'), ciphertext: Buffer.concat([cipher.update(plaintext), cipher.final()]).toString('base64'),
90
+ tag: cipher.getAuthTag().toString('base64') };
91
+ }
92
+ finally {
93
+ plaintext.fill(0);
94
+ }
95
+ }
@@ -39,7 +39,7 @@ export type BrowserLiveControl = {
39
39
  requestId: string;
40
40
  liveSessionId: string;
41
41
  controlEpoch: number;
42
- action: 'start' | 'stop' | 'takeover' | 'release' | 'input' | 'refresh' | 'profile' | 'recording' | 'recording_save' | 'select_tab' | 'settings' | 'navigate';
42
+ action: 'start' | 'stop' | 'takeover' | 'release' | 'input' | 'pointer' | 'copy_selection' | 'refresh' | 'profile' | 'recording' | 'recording_save' | 'select_tab' | 'new_tab' | 'close_tab' | 'close_session' | 'settings' | 'navigate';
43
43
  settings?: {
44
44
  fps: number;
45
45
  width: number;
@@ -115,8 +115,16 @@ export type BrowserLiveReady = BrowserLiveTarget & {
115
115
  };
116
116
  export declare const validLiveId: (value: unknown) => value is string;
117
117
  export declare const validBrowserSessionId: (value: unknown) => value is string;
118
+ /** Session-wide operations stay fenced during private tab control. */
119
+ export declare function canUseOtherBrowserTab(controlledTabId: unknown, tabId: unknown, action: string): boolean;
118
120
  export declare function validBrowserLiveOpen(value: any): value is BrowserLiveOpen;
119
121
  export declare function validBrowserLiveControl(value: any): value is BrowserLiveControl;
122
+ export declare function validBrowserClipboard(value: any): value is {
123
+ iv: string;
124
+ ciphertext: string;
125
+ tag: string;
126
+ };
127
+ export declare function browserClipboardAad(input: Pick<BrowserLiveControl, 'liveSessionId' | 'controlEpoch' | 'requestId'>): Buffer;
120
128
  export declare function browserLiveInputAad(input: {
121
129
  liveSessionId: string;
122
130
  browserSessionId: string;
@@ -13,6 +13,11 @@ const integer = (value, min, max) => Number.isSafeInteger(value) && Number(value
13
13
  const base64 = (value, min, max) => typeof value === 'string'
14
14
  && value.length <= Math.ceil(max / 3) * 4 && /^[a-z0-9+/]+={0,2}$/iu.test(value)
15
15
  && Buffer.from(value, 'base64').length >= min && Buffer.from(value, 'base64').length <= max;
16
+ /** Session-wide operations stay fenced during private tab control. */
17
+ export function canUseOtherBrowserTab(controlledTabId, tabId, action) {
18
+ return validLiveId(controlledTabId) && validLiveId(tabId) && controlledTabId !== tabId
19
+ && ['navigate', 'dom', 'screenshot', 'click', 'fill', 'check', 'select', 'press', 'scroll', 'wait_for', 'interact'].includes(action);
20
+ }
16
21
  export function validBrowserLiveOpen(value) {
17
22
  return value?.type === 'open' && value.protocol === 1 && validLiveId(value.threadId)
18
23
  && validLiveId(value.agentTerminalId) && validLiveId(value.agentTerminalWorkspaceId)
@@ -22,14 +27,15 @@ export function validBrowserLiveOpen(value) {
22
27
  export function validBrowserLiveControl(value) {
23
28
  if (value?.type !== 'browser_live_control' || value.protocol !== 1 || !validLiveId(value.requestId)
24
29
  || !validLiveId(value.liveSessionId) || !integer(value.controlEpoch, 0, Number.MAX_SAFE_INTEGER)
25
- || !['start', 'stop', 'takeover', 'release', 'input', 'refresh', 'profile', 'recording', 'recording_save', 'select_tab', 'settings', 'navigate'].includes(value.action)
30
+ || !['start', 'stop', 'takeover', 'release', 'input', 'pointer', 'copy_selection', 'refresh', 'profile', 'recording', 'recording_save', 'select_tab', 'new_tab', 'close_tab', 'close_session', 'settings', 'navigate'].includes(value.action)
26
31
  || Object.keys(value).some(key => !['type', 'protocol', 'requestId', 'liveSessionId', 'controlEpoch', 'action', 'tabId', 'private', 'privateInput', 'profile', 'recording', 'settings', 'navigation'].includes(key)))
27
32
  return false;
28
- if (value.action === 'select_tab' ? !validLiveId(value.tabId) : value.tabId !== undefined)
33
+ if (['select_tab', 'close_tab'].includes(value.action) && !validLiveId(value.tabId)
34
+ || value.tabId !== undefined && (!['select_tab', 'close_tab', 'takeover'].includes(value.action) || !validLiveId(value.tabId)))
29
35
  return false;
30
36
  if (value.private !== undefined && (value.action !== 'takeover' || typeof value.private !== 'boolean'))
31
37
  return false;
32
- if (value.action === 'input') {
38
+ if (['input', 'pointer', 'copy_selection'].includes(value.action)) {
33
39
  const input = value.privateInput;
34
40
  if (!input || !/^[a-f0-9]{64}$/u.test(input.keyId) || !base64(input.ephemeralPublicKey, 40, 128)
35
41
  || !base64(input.iv, 12, 12) || !base64(input.tag, 16, 16) || !base64(input.ciphertext, 1, 16384)
@@ -70,6 +76,13 @@ export function validBrowserLiveControl(value) {
70
76
  return false;
71
77
  return true;
72
78
  }
79
+ export function validBrowserClipboard(value) {
80
+ return !!value && base64(value.iv, 12, 12) && base64(value.ciphertext, 1, 4096) && base64(value.tag, 16, 16)
81
+ && Object.keys(value).every(key => ['iv', 'ciphertext', 'tag'].includes(key));
82
+ }
83
+ export function browserClipboardAad(input) {
84
+ return Buffer.from(JSON.stringify(['revo-browser-clipboard-v1', input.liveSessionId, input.controlEpoch, input.requestId]), 'utf8');
85
+ }
73
86
  export function browserLiveInputAad(input) {
74
87
  return Buffer.from(JSON.stringify([input.liveSessionId, input.browserSessionId, input.actorUserId,
75
88
  input.threadId, input.agentTerminalWorkspaceId ?? null, input.connectionId, input.controlEpoch,
@@ -17,6 +17,7 @@ export type BrowserLiveAttachment = {
17
17
  controlEpoch: number;
18
18
  mode: 'observe' | 'human' | 'blocked';
19
19
  private: boolean;
20
+ controlledTabId?: string;
20
21
  networkAccess: 'local' | 'full';
21
22
  browserSettings?: BrowserLiveOptions['browserSettings'];
22
23
  };
@@ -30,6 +31,7 @@ type Options = {
30
31
  socket?: (url: string, options: WebSocket.ClientOptions) => WebSocket;
31
32
  attach?: typeof attachBrowserLive;
32
33
  transfer?: typeof transferWorkspaceFile;
34
+ onInventoryChanged?: () => void;
33
35
  };
34
36
  /** Media has its own socket and buffer. No attachment token, input or signed URL is logged. */
35
37
  export declare class TerminalBrowserLiveTransport {
@@ -21,6 +21,7 @@ export function validBrowserLiveAttachment(frame) {
21
21
  && /^[a-f0-9]{64}$/u.test(item.browserSessionId) && /^[A-Za-z0-9_-]{43}$/u.test(item.attachmentToken)
22
22
  && Number.isSafeInteger(item.revision) && item.revision >= 0 && Number.isSafeInteger(item.controlEpoch) && item.controlEpoch >= 0
23
23
  && ['observe', 'human', 'blocked'].includes(item.mode) && typeof item.private === 'boolean'
24
+ && (item.controlledTabId === undefined || typeof item.controlledTabId === 'string' && UUID.test(item.controlledTabId))
24
25
  && ['local', 'full'].includes(item.networkAccess)
25
26
  && (item.browserSettings === undefined || !!item.browserSettings && Number.isInteger(item.browserSettings.fps) && item.browserSettings.fps >= 5 && item.browserSettings.fps <= 60
26
27
  && Number.isInteger(item.browserSettings.width) && item.browserSettings.width >= 320 && item.browserSettings.width <= 3840
@@ -120,13 +121,29 @@ export class TerminalBrowserLiveTransport {
120
121
  return;
121
122
  }
122
123
  if (message.type === 'browser_live_control') {
123
- if (message.action !== 'recording_save')
124
- mediaReady = false;
125
- controlInFlight = true;
126
124
  if (message.connectionId !== frame.connectionId || message.browserSessionId !== frame.browserSessionId
127
125
  || message.actorUserId !== frame.actorUserId || message.threadId !== frame.threadId
128
126
  || message.agentTerminalWorkspaceId !== frame.agentTerminalWorkspaceId)
129
127
  throw new Error('browser_live_scope_invalid');
128
+ const control = Object.fromEntries(Object.entries(message).filter(([key]) => ['type', 'protocol', 'requestId',
129
+ 'liveSessionId', 'controlEpoch', 'action', 'private', 'privateInput', 'profile', 'recording', 'tabId', 'settings', 'navigation'].includes(key)));
130
+ if (message.action === 'pointer') {
131
+ if (!handle)
132
+ throw new Error('browser_live_scope_invalid');
133
+ await handle.pointerInput(control);
134
+ return;
135
+ }
136
+ if (message.action === 'copy_selection') {
137
+ if (!handle)
138
+ throw new Error('browser_live_scope_invalid');
139
+ const encrypted = await handle.copySelection(control);
140
+ send({ type: 'browser.clipboard', protocol: 1, liveSessionId: frame.liveSessionId,
141
+ controlEpoch: message.controlEpoch, requestId: message.requestId, ...(encrypted ? { encrypted } : {}) });
142
+ return;
143
+ }
144
+ if (message.action !== 'recording_save')
145
+ mediaReady = false;
146
+ controlInFlight = true;
130
147
  if (!handle) {
131
148
  if (message.action !== 'start' || message.controlEpoch !== frame.controlEpoch)
132
149
  throw new Error('browser_live_scope_invalid');
@@ -156,10 +173,9 @@ export class TerminalBrowserLiveTransport {
156
173
  return;
157
174
  }
158
175
  }
159
- const control = Object.fromEntries(Object.entries(message).filter(([key]) => ['type', 'protocol', 'requestId',
160
- 'liveSessionId', 'controlEpoch', 'action', 'private', 'privateInput', 'profile', 'recording', 'tabId', 'settings', 'navigation'].includes(key)));
161
176
  send(await handle.control(control));
162
177
  controlInFlight = false;
178
+ this.options.onInventoryChanged?.();
163
179
  return;
164
180
  }
165
181
  if (message.type === 'browser_recording_upload') {
@@ -33,6 +33,7 @@ export type BrowserLiveOptions = HumanInputScope & {
33
33
  controlEpoch: number;
34
34
  mode: BrowserLiveMode;
35
35
  private: boolean;
36
+ tabId?: string;
36
37
  };
37
38
  recordingDirectory: string;
38
39
  isAuthorized: () => boolean;
@@ -52,6 +53,7 @@ export type BrowserLivePort = {
52
53
  mode: BrowserLiveMode;
53
54
  private: boolean;
54
55
  connected: boolean;
56
+ tabId?: string;
55
57
  };
56
58
  observations: BrowserObservations;
57
59
  active: () => {
@@ -59,11 +61,14 @@ export type BrowserLivePort = {
59
61
  tabId: string;
60
62
  };
61
63
  pages: () => Page[];
62
- queue: <T>(work: () => Promise<T>) => Promise<T>;
64
+ queue: <T>(work: () => Promise<T>, tabInput?: boolean) => Promise<T>;
63
65
  state: () => Promise<Record<string, unknown>>;
64
66
  authorized: () => boolean;
65
67
  fullNetwork: () => boolean;
66
68
  selectTab: (tabId: string) => Promise<void>;
69
+ newTab: () => Promise<void>;
70
+ closeTab: (tabId: string) => Promise<boolean>;
71
+ closeSession: () => Promise<void>;
67
72
  release: () => Promise<void>;
68
73
  profile: (profile: NonNullable<BrowserLiveControl['profile']>, options: BrowserLiveOptions) => Promise<void>;
69
74
  };
@@ -76,6 +81,7 @@ export type BrowserLiveAck = {
76
81
  ok: boolean;
77
82
  error?: string;
78
83
  state?: Record<string, unknown>;
84
+ closed?: true;
79
85
  };
80
86
  /** Reads SOF JPEG dimensions without decoding or allocating an image. */
81
87
  export declare function jpegDimensions(jpeg: Buffer): {
@@ -84,6 +90,9 @@ export declare function jpegDimensions(jpeg: Buffer): {
84
90
  };
85
91
  export declare function browserAuthPage(value: string): boolean;
86
92
  export declare class BrowserLiveHandle {
93
+ private pointer?;
94
+ private pointerExpiry?;
95
+ private readonly pointerStarts;
87
96
  private baseOptions;
88
97
  private viewerOptions?;
89
98
  private get options();
@@ -144,9 +153,17 @@ export declare class BrowserLiveHandle {
144
153
  private scheduleTrailingFrame;
145
154
  private emitFrame;
146
155
  private refreshFrame;
156
+ private stopPointer;
157
+ pointerInput(frame: BrowserLiveControl): Promise<void>;
158
+ copySelection(frame: BrowserLiveControl): Promise<{
159
+ iv: string;
160
+ ciphertext: string;
161
+ tag: string;
162
+ } | undefined>;
147
163
  control(frame: BrowserLiveControl): Promise<BrowserLiveAck>;
148
164
  private requestRecordingSave;
149
165
  block(epoch?: number): void;
166
+ private controlledPages;
150
167
  settled(): Promise<void>;
151
168
  disconnect(): void;
152
169
  close(): void;