@revoengine/cli 1.0.39 → 2.1.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 (41) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +15 -9
  3. package/dist/src/argument-contract.js +1 -1
  4. package/dist/src/automation-contract.generated.d.ts +91 -34
  5. package/dist/src/automation-contract.generated.js +109 -34
  6. package/dist/src/client.d.ts +3 -0
  7. package/dist/src/commands/component.js +16 -0
  8. package/dist/src/commands/terminal-browser-human-input.d.ts +28 -0
  9. package/dist/src/commands/terminal-browser-human-input.js +56 -7
  10. package/dist/src/commands/terminal-browser-live-protocol.d.ts +9 -1
  11. package/dist/src/commands/terminal-browser-live-protocol.js +16 -3
  12. package/dist/src/commands/terminal-browser-live-transport.d.ts +2 -0
  13. package/dist/src/commands/terminal-browser-live-transport.js +21 -5
  14. package/dist/src/commands/terminal-browser-live.d.ts +18 -1
  15. package/dist/src/commands/terminal-browser-live.js +190 -14
  16. package/dist/src/commands/terminal-browser-observation.d.ts +1 -1
  17. package/dist/src/commands/terminal-browser-observation.js +10 -1
  18. package/dist/src/commands/terminal-browser-page-input.d.ts +1 -0
  19. package/dist/src/commands/terminal-browser-page-input.js +20 -0
  20. package/dist/src/commands/terminal-browser-profile-sync.d.ts +5 -1
  21. package/dist/src/commands/terminal-browser-profile-sync.js +13 -2
  22. package/dist/src/commands/terminal-browser-profile-sync.protocol.d.ts +2 -0
  23. package/dist/src/commands/terminal-browser.d.ts +17 -0
  24. package/dist/src/commands/terminal-browser.js +310 -104
  25. package/dist/src/commands/terminal.js +104 -24
  26. package/dist/src/endpoint-emulator.js +9 -10
  27. package/dist/src/project.js +1 -0
  28. package/dist/src/request-contract.d.ts +2 -0
  29. package/dist/src/request-contract.js +11 -1
  30. package/dist/src/resource-syncs/automation-input.d.ts +2 -2
  31. package/dist/src/resource-syncs/automation-input.js +7 -17
  32. package/dist/src/resource-syncs/event-sync.d.ts +2 -0
  33. package/dist/src/resource-syncs/event-sync.js +18 -8
  34. package/dist/src/resource-syncs/job-template-sync.d.ts +2 -0
  35. package/dist/src/resource-syncs/job-template-sync.js +6 -1
  36. package/dist/src/resource-syncs/runtime-definition-validation.js +10 -2
  37. package/dist/src/resource-syncs/schedule-sync.js +0 -1
  38. package/dist/src/sync-omit.js +3 -1
  39. package/dist/src/types.d.ts +12 -5
  40. package/dist/src/ui.js +1 -1
  41. package/package.json +1 -1
@@ -4,6 +4,7 @@ export declare function describeFocusedField(page: Page): Promise<string | undef
4
4
  /** CAPTCHA answers are model-solvable; explicit password/MFA controls remain private. */
5
5
  export declare function secretControlAttributes(attributes: Array<string | null>): boolean;
6
6
  export declare function pageHasSecretFocus(page: Page): Promise<boolean>;
7
+ export declare function readPageSelection(page: Page): Promise<string | undefined>;
7
8
  export declare function clearSecretInputs(page: Page): Promise<void>;
8
9
  export declare function releasePageInput(page: Page): Promise<void>;
9
10
  export declare function applyPageInteraction(page: Page, interaction: BrowserInteraction & {
@@ -64,6 +64,26 @@ export async function pageHasSecretFocus(page) {
64
64
  }
65
65
  return false;
66
66
  }
67
+ export async function readPageSelection(page) {
68
+ if (await pageHasSecretFocus(page))
69
+ return undefined;
70
+ for (const frame of page.frames()) {
71
+ const selection = await frame.evaluate(() => {
72
+ let active = document.activeElement;
73
+ while (active?.shadowRoot?.activeElement)
74
+ active = active.shadowRoot.activeElement;
75
+ if (active instanceof HTMLInputElement || active instanceof HTMLTextAreaElement) {
76
+ if (active instanceof HTMLInputElement && active.type === 'password')
77
+ return null;
78
+ const attrs = ['type', 'id', 'name', 'autocomplete', 'aria-label', 'placeholder'].map(name => active.getAttribute(name));
79
+ return { attrs, text: active.value.slice(active.selectionStart ?? 0, Math.min(active.selectionEnd ?? 0, (active.selectionStart ?? 0) + 4097)) };
80
+ }
81
+ return { attrs: [], text: document.getSelection()?.toString().slice(0, 4097) ?? '' };
82
+ }).catch(() => null);
83
+ if (selection?.text && !secretControlAttributes(selection.attrs))
84
+ return selection.text;
85
+ }
86
+ }
67
87
  export async function clearSecretInputs(page) {
68
88
  for (const frame of page.frames())
69
89
  await frame.evaluate(() => {
@@ -9,6 +9,10 @@ export declare class BrowserProfileRunnerRpc {
9
9
  constructor(connectionId: string, send: (request: BrowserProfileSyncRequest) => void);
10
10
  accept(value: unknown): void;
11
11
  private request;
12
- transport(grant: BrowserProfileRunnerGrant): CentralBrowserProfileTransport;
12
+ releaseMember(browserSessionId: string): Promise<void>;
13
+ transport(grant: BrowserProfileRunnerGrant, membership?: {
14
+ current(): string[];
15
+ revoke(ids: string[]): void;
16
+ }): CentralBrowserProfileTransport;
13
17
  dispose(): void;
14
18
  }
@@ -54,10 +54,13 @@ export class BrowserProfileRunnerRpc {
54
54
  }
55
55
  });
56
56
  }
57
- transport(grant) {
57
+ async releaseMember(browserSessionId) {
58
+ await this.request(browserSessionId, 'release');
59
+ }
60
+ transport(grant, membership) {
58
61
  if (grant.scope.connectionId !== this.connectionId)
59
62
  throw new Error('browser_profile_lease_expired');
60
- const browserSessionId = grant.scope.browserSessionId;
63
+ const browserSessionId = grant.sharedContextId ?? grant.scope.browserSessionId;
61
64
  return {
62
65
  read: async () => grant.download ? downloadProfile(grant.download) : null,
63
66
  readback: async (expectedRevision) => {
@@ -80,7 +83,15 @@ export class BrowserProfileRunnerRpc {
80
83
  return { revision: result.revision };
81
84
  },
82
85
  renew: async () => {
86
+ const known = membership?.current() || [];
83
87
  const result = await this.request(browserSessionId, 'renew');
88
+ if (membership) {
89
+ const active = result.activeMemberIds;
90
+ if (!Array.isArray(active) || !active.length || active.length > 16
91
+ || active.some(id => typeof id !== 'string' || !/^[a-f0-9]{64}$/u.test(id)))
92
+ throw new Error('browser_profile_sync_invalid');
93
+ membership.revoke(known.filter(id => !active.includes(id)));
94
+ }
84
95
  if (!Number.isSafeInteger(result.leaseRemainingMs) || result.leaseRemainingMs < 1 || result.leaseRemainingMs > 45_000)
85
96
  throw new Error('browser_profile_sync_invalid');
86
97
  return { leaseRemainingMs: result.leaseRemainingMs };
@@ -9,6 +9,7 @@ export type BrowserProfileRunnerGrant = {
9
9
  sealedKey: BrowserProfileSealedKey;
10
10
  revision: number;
11
11
  leaseRemainingMs: number;
12
+ sharedContextId?: string;
12
13
  download: {
13
14
  url: string;
14
15
  size: number;
@@ -35,6 +36,7 @@ export type BrowserProfileSyncResult = {
35
36
  leaseRemainingMs?: number;
36
37
  revision?: number;
37
38
  keyVersion?: string;
39
+ activeMemberIds?: string[];
38
40
  download?: {
39
41
  url: string;
40
42
  size: number;
@@ -46,6 +46,11 @@ export type BrowserActionInput = {
46
46
  id: string;
47
47
  name: string;
48
48
  lease: BrowserProfilePersistenceLease;
49
+ shared?: {
50
+ contextId: string;
51
+ authorized: () => boolean;
52
+ releaseMember: () => Promise<void>;
53
+ };
49
54
  };
50
55
  recording?: {
51
56
  options: BrowserLiveOptions;
@@ -100,6 +105,18 @@ export declare function threadBrowserScopes(): Array<{
100
105
  }>;
101
106
  export declare function closeThreadBrowserSession(browserSessionId: string): Promise<void>;
102
107
  export declare function browserSessionIds(): string[];
108
+ /** Local runner display. Authentication itself is known only to the website. */
109
+ export declare function browserRuntimeInventory(): {
110
+ browsers: number;
111
+ tabs: number;
112
+ sessions: {
113
+ id: string;
114
+ tabs: number;
115
+ mode: "blocked" | "observe" | "human";
116
+ profile: string | null;
117
+ restored: boolean;
118
+ }[];
119
+ };
103
120
  export declare function hasBrowserSessions(): boolean;
104
121
  /** Revocation closes only this central context and never checkpoints its authentication. */
105
122
  export declare function revokeBrowserProfileSession(browserSessionId: string, profileId: string): Promise<void>;