@memberjunction/server 5.41.0 → 5.42.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 (76) hide show
  1. package/dist/agentSessions/index.d.ts +1 -0
  2. package/dist/agentSessions/index.d.ts.map +1 -1
  3. package/dist/agentSessions/index.js +5 -0
  4. package/dist/agentSessions/index.js.map +1 -1
  5. package/dist/agentSessions/remoteBrowserGoalEngine.d.ts +102 -0
  6. package/dist/agentSessions/remoteBrowserGoalEngine.d.ts.map +1 -0
  7. package/dist/agentSessions/remoteBrowserGoalEngine.js +164 -0
  8. package/dist/agentSessions/remoteBrowserGoalEngine.js.map +1 -0
  9. package/dist/agentSessions/remoteBrowserGoalRegistry.d.ts +66 -0
  10. package/dist/agentSessions/remoteBrowserGoalRegistry.d.ts.map +1 -0
  11. package/dist/agentSessions/remoteBrowserGoalRegistry.js +86 -0
  12. package/dist/agentSessions/remoteBrowserGoalRegistry.js.map +1 -0
  13. package/dist/auth/initializeProviders.d.ts.map +1 -1
  14. package/dist/auth/initializeProviders.js +4 -7
  15. package/dist/auth/initializeProviders.js.map +1 -1
  16. package/dist/config.d.ts +7 -0
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/config.js +12 -2
  19. package/dist/config.js.map +1 -1
  20. package/dist/generated/generated.d.ts +591 -0
  21. package/dist/generated/generated.d.ts.map +1 -1
  22. package/dist/generated/generated.js +6832 -3610
  23. package/dist/generated/generated.js.map +1 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +33 -16
  26. package/dist/index.js.map +1 -1
  27. package/dist/integration/CustomColumnPromoter.d.ts +108 -0
  28. package/dist/integration/CustomColumnPromoter.d.ts.map +1 -0
  29. package/dist/integration/CustomColumnPromoter.js +508 -0
  30. package/dist/integration/CustomColumnPromoter.js.map +1 -0
  31. package/dist/logging/StartupLogger.d.ts +57 -1
  32. package/dist/logging/StartupLogger.d.ts.map +1 -1
  33. package/dist/logging/StartupLogger.js +115 -6
  34. package/dist/logging/StartupLogger.js.map +1 -1
  35. package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts +27 -0
  36. package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts.map +1 -0
  37. package/dist/resolvers/ExecuteRemoteOperationResolver.js +136 -0
  38. package/dist/resolvers/ExecuteRemoteOperationResolver.js.map +1 -0
  39. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +101 -1
  40. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  41. package/dist/resolvers/IntegrationDiscoveryResolver.js +544 -42
  42. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  43. package/dist/resolvers/RealtimeBridgeResolver.d.ts +121 -0
  44. package/dist/resolvers/RealtimeBridgeResolver.d.ts.map +1 -0
  45. package/dist/resolvers/RealtimeBridgeResolver.js +533 -0
  46. package/dist/resolvers/RealtimeBridgeResolver.js.map +1 -0
  47. package/dist/resolvers/RemoteBrowserActionResolver.d.ts +78 -5
  48. package/dist/resolvers/RemoteBrowserActionResolver.d.ts.map +1 -1
  49. package/dist/resolvers/RemoteBrowserActionResolver.js +227 -15
  50. package/dist/resolvers/RemoteBrowserActionResolver.js.map +1 -1
  51. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  52. package/dist/resolvers/RunAIAgentResolver.js +0 -7
  53. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  54. package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
  55. package/dist/rest/setupRESTEndpoints.js +5 -3
  56. package/dist/rest/setupRESTEndpoints.js.map +1 -1
  57. package/package.json +83 -78
  58. package/src/__tests__/RealtimeBridgeResolver.test.ts +100 -0
  59. package/src/__tests__/RemoteBrowserAudioStream.test.ts +8 -1
  60. package/src/__tests__/RemoteBrowserGoalEngine.test.ts +144 -0
  61. package/src/__tests__/remoteBrowserGoalRegistry.test.ts +81 -0
  62. package/src/agentSessions/index.ts +5 -0
  63. package/src/agentSessions/remoteBrowserGoalEngine.ts +191 -0
  64. package/src/agentSessions/remoteBrowserGoalRegistry.ts +122 -0
  65. package/src/auth/initializeProviders.ts +4 -7
  66. package/src/config.ts +13 -2
  67. package/src/generated/generated.ts +2444 -205
  68. package/src/index.ts +33 -16
  69. package/src/integration/CustomColumnPromoter.ts +597 -0
  70. package/src/logging/StartupLogger.ts +130 -6
  71. package/src/resolvers/ExecuteRemoteOperationResolver.ts +108 -0
  72. package/src/resolvers/IntegrationDiscoveryResolver.ts +396 -37
  73. package/src/resolvers/RealtimeBridgeResolver.ts +450 -0
  74. package/src/resolvers/RemoteBrowserActionResolver.ts +232 -17
  75. package/src/resolvers/RunAIAgentResolver.ts +1 -9
  76. package/src/rest/setupRESTEndpoints.ts +5 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RealtimeBridgeResolver.js","sourceRoot":"","sources":["../../src/resolvers/RealtimeBridgeResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,QAAQ,EAA+B,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE7H,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3J,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,kBAAk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,GAAG,EAAE,CAAC,qBAAqB,CAAC,CAAA;IACzC,WAAA,GAAG,EAAE,CAAA;;qCAD4C,qBAAqB;;mEAcxE;AAIK;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;IACX,WAAA,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IAAoB,WAAA,GAAG,EAAE,CAAA;;;;kEAYjF;AAnPU,sBAAsB;IADlC,QAAQ,EAAE;GACE,sBAAsB,CAuQlC"}
@@ -33,6 +33,30 @@ export declare class RemoteBrowserActionResult {
33
33
  /** Human-readable detail — an error message on failure, a note on success. Null when none. */
34
34
  Detail?: string;
35
35
  }
36
+ /**
37
+ * Result of {@link RemoteBrowserActionResolver.ExecuteRemoteBrowserGoal} — the outcome of an autonomous,
38
+ * goal-driven browser run (computer-use loop or backend native AI).
39
+ */
40
+ export declare class RemoteBrowserGoalResultType {
41
+ /** Whether the goal was achieved. */
42
+ Success: boolean;
43
+ /**
44
+ * Handle for the async goal run. `ExecuteRemoteBrowserGoal` STARTS the goal and returns this with
45
+ * `Status: 'Running'`; the client polls {@link RemoteBrowserActionResolver.GetRemoteBrowserGoalResult}
46
+ * with it until the run reports a terminal status.
47
+ */
48
+ GoalRunID?: string;
49
+ /** Which control strategy executed the goal (`ComputerUse` / `NativeAI`). */
50
+ Strategy?: string;
51
+ /** The page URL when the run ended, when known. */
52
+ CurrentUrl?: string;
53
+ /** Terminal status label (`Completed` / `MaxStepsReached` / `Impossible` / `Error` / …). */
54
+ Status?: string;
55
+ /** Number of perceive-act steps executed (computer-use strategy). */
56
+ StepCount?: number;
57
+ /** Human-readable detail (judge feedback / error message). */
58
+ Detail?: string;
59
+ }
36
60
  /**
37
61
  * Result of {@link RemoteBrowserActionResolver.RemoteBrowserSnapshot} — the current viewport screenshot +
38
62
  * URL for the client's live view. Both fields are null when the session holds no live browser.
@@ -63,6 +87,15 @@ export declare class RemoteBrowserAudioStreamResult {
63
87
  /** Whether the server-pushed tab-audio stream is now running for this session. */
64
88
  Streaming: boolean;
65
89
  }
90
+ /**
91
+ * Result of {@link RemoteBrowserActionResolver.GetRemoteBrowserSelection} — the remote page's current text
92
+ * selection, the copy-out half of human clipboard support. `Text` is `''` when nothing is selected, no live
93
+ * browser exists, or the backend can't read the selection (the client then writes nothing to the clipboard).
94
+ */
95
+ export declare class RemoteBrowserSelection {
96
+ /** The remote page's current selection text, or `''` when nothing is selected / unavailable. */
97
+ Text: string;
98
+ }
66
99
  /**
67
100
  * One UI element the visual interpreter localized in the screenshot — a label plus the pixel centroid the
68
101
  * voice agent can feed straight into `browser_Click(x, y)`. Coordinates are in the SCREENSHOT's own pixel
@@ -130,6 +163,30 @@ export declare class RemoteBrowserActionResolver extends ResolverBase {
130
163
  * @returns The action result (success + resulting URL + detail).
131
164
  */
132
165
  ExecuteRemoteBrowserAction(agentSessionID: string, kind: string, { userPayload, providers }: AppContext, url?: string, selector?: string, x?: number, y?: number, text?: string, key?: string, deltaX?: number, deltaY?: number, ms?: number): Promise<RemoteBrowserActionResult>;
166
+ /**
167
+ * Execute a high-level GOAL against the session's browser — the agent sets an intent ("log in and open
168
+ * the latest invoice") and the resolved control strategy (computer-use loop or backend native AI) plans
169
+ * + executes it autonomously, instead of relaying granular actions. Ownership-gated; lazily starts the
170
+ * browser. Returns the terminal outcome (this is a request/response mutation — for live progress
171
+ * narration in a server-bridged realtime session the broker calls {@link RemoteBrowserEngine.AchieveGoal}
172
+ * in-process with an `OnProgress` callback).
173
+ *
174
+ * @param agentSessionID The `AIAgentSession` id the browser is bound to.
175
+ * @param goal The natural-language goal.
176
+ * @returns The goal outcome (success, strategy, status, step count, url, detail).
177
+ */
178
+ ExecuteRemoteBrowserGoal(agentSessionID: string, goal: string, { userPayload, providers }: AppContext, startUrl?: string, maxSteps?: number, preferredStrategy?: string): Promise<RemoteBrowserGoalResultType>;
179
+ /**
180
+ * Poll the outcome of a goal STARTED by {@link RemoteBrowserActionResolver.ExecuteRemoteBrowserGoal}.
181
+ * Returns `Status: 'Running'` while the loop is in flight, then the terminal outcome (success,
182
+ * strategy, status, step count, url, detail) once it finishes. Ownership-gated. A `Status: 'Unknown'`
183
+ * result means the run id is unrecognized — it expired (results are retained briefly) or never existed.
184
+ *
185
+ * @param agentSessionID The `AIAgentSession` id the goal runs against.
186
+ * @param goalRunID The handle returned by `ExecuteRemoteBrowserGoal`.
187
+ * @returns The current/terminal goal outcome.
188
+ */
189
+ GetRemoteBrowserGoalResult(agentSessionID: string, goalRunID: string, { userPayload, providers }: AppContext): Promise<RemoteBrowserGoalResultType>;
133
190
  /**
134
191
  * Return the current viewport screenshot + URL for the session's live browser — the client's live view.
135
192
  * Ownership-gated. When the session holds no live browser (never started, or already torn down), the
@@ -227,12 +284,28 @@ export declare class RemoteBrowserActionResolver extends ResolverBase {
227
284
  * agent⇄human floor, so we just relay. Finer floor / `AgentOnly` gating is a follow-up.
228
285
  *
229
286
  * @param agentSessionID The `AIAgentSession` id the browser is bound to.
230
- * @param kind The input kind (`'pointer-move' | 'pointer-click' | 'pointer-down' | 'pointer-up' | 'key' | 'scroll'`).
287
+ * @param kind The input kind (`'pointer-move' | 'pointer-click' | 'pointer-down' | 'pointer-up' | 'key' | 'text' | 'scroll'`).
288
+ * @param text The pasted text (the `'text'` paste-in kind only) — inserted into the page's focused element.
231
289
  * @param modifiers Optional comma-separated modifier keys held during the input (`'Shift'`, `'Control'`,
232
290
  * `'Alt'`, `'Meta'`) — carries Shift-click selection and Ctrl/Cmd+key chords faithfully.
233
291
  * @returns `true` when the input was routed, else `false`.
234
292
  */
235
- RelayRemoteBrowserHumanInput(agentSessionID: string, kind: string, { userPayload, providers }: AppContext, x?: number, y?: number, button?: string, key?: string, deltaX?: number, deltaY?: number, modifiers?: string): Promise<boolean>;
293
+ RelayRemoteBrowserHumanInput(agentSessionID: string, kind: string, { userPayload, providers }: AppContext, x?: number, y?: number, button?: string, key?: string, text?: string, deltaX?: number, deltaY?: number, modifiers?: string): Promise<boolean>;
294
+ /**
295
+ * Returns the remote page's CURRENT text selection — the copy-out half of human clipboard support. The
296
+ * viewer captures a local `copy` / Cmd+C, calls this to read what the human selected on the live page, and
297
+ * writes the result to the LOCAL clipboard (sidestepping the isolated remote clipboard, the mirror of the
298
+ * `'text'` paste-in path). Ownership-gated.
299
+ *
300
+ * Gracefully best-effort, never throws past the ownership gate (mirrors {@link RemoteBrowserSnapshot}):
301
+ * - No live browser for the session → `{ Text: '' }`.
302
+ * - Backend lacks `HumanTakeover` ({@link RemoteBrowserCapabilityNotSupportedError}) → `{ Text: '' }`.
303
+ * - Nothing selected / any other read failure → `{ Text: '' }` (logged).
304
+ *
305
+ * @param agentSessionID The `AIAgentSession` id the browser is bound to.
306
+ * @returns The selection text, or `{ Text: '' }` when none is readable.
307
+ */
308
+ GetRemoteBrowserSelection(agentSessionID: string, { userPayload, providers }: AppContext): Promise<RemoteBrowserSelection>;
236
309
  /**
237
310
  * Publishes one encoded screencast frame to the calling user's push-status topic, in the same envelope
238
311
  * shape the conversations client already routes (mirrors `RealtimeClientSessionResolver`'s delegation
@@ -335,9 +408,9 @@ export declare class RemoteBrowserActionResolver extends ResolverBase {
335
408
  /**
336
409
  * Builds a strongly-typed {@link RemoteBrowserHumanInput} from the relayed `kind` + fields, validating
337
410
  * each kind's required field(s). Returns `null` for an unknown kind or a kind missing its required
338
- * field(s): pointer-move/click/down/up need finite `x`,`y`; key needs a non-empty `key`; scroll needs
339
- * finite `x`,`y`,`deltaX`,`deltaY`. The `button` is clamped to the allowed union
340
- * (`'left' | 'middle' | 'right'`), defaulting unknown/absent values to `'left'`. Held `modifiers`
411
+ * field(s): pointer-move/click/down/up need finite `x`,`y`; key needs a non-empty `key`; text needs a
412
+ * non-empty `text`; scroll needs finite `x`,`y`,`deltaX`,`deltaY`. The `button` is clamped to the allowed
413
+ * union (`'left' | 'middle' | 'right'`), defaulting unknown/absent values to `'left'`. Held `modifiers`
341
414
  * (e.g. Shift-click, Ctrl/Cmd+key) ride on pointer clicks/presses and key presses.
342
415
  *
343
416
  * @param input The relayed input kind + all optional fields.
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteBrowserActionResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/RemoteBrowserActionResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAyE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnH,OAAO,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAY,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAmB,MAAM,+BAA+B,CAAC;AAGxF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AA8B1D;;;GAGG;AACH,qBACa,yBAAyB;IACpC,yDAAyD;IAEzD,OAAO,EAAE,OAAO,CAAC;IAEjB,uFAAuF;IAEvF,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,8FAA8F;IAE9F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBACa,qBAAqB;IAChC,yGAAyG;IAEzG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,mFAAmF;IAEnF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,qBACa,6BAA6B;IACxC,4EAA4E;IAE5E,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBACa,8BAA8B;IACzC,kFAAkF;IAElF,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,qBACa,+BAA+B;IAC1C,4EAA4E;IAE5E,KAAK,EAAE,MAAM,CAAC;IAEd,8EAA8E;IAE9E,CAAC,EAAE,MAAM,CAAC;IAEV,8EAA8E;IAE9E,CAAC,EAAE,MAAM,CAAC;IAEV,0EAA0E;IAE1E,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,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S,EAAE,EAAE,UAAU,GAC5C,OAAO,CAAC,sBAAsB,CAAC;IAwBlC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,YAAY;IAoBpB;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAgBzB;;;;;;;;;;OAUG;YACW,oBAAoB;IAqClC;;;;;;;OAOG;IACH,OAAO,CAAC,2BAA2B;IAYnC;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IAkC5B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAMvB,iGAAiG;IACjG,SAAS,CAAC,sBAAsB,CAC9B,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,EACtC,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,GACjC;QAAE,WAAW,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,iBAAiB,CAAA;KAAE;IAQzD;;;;;;OAMG;cACa,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAW7I;;;;;;;;OAQG;cACa,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAqBrJ;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IA2CnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,eAAe;IA4DvB,yFAAyF;IACzF,OAAO,CAAC,WAAW;IAInB;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;CAUvB"}
@@ -28,11 +28,14 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
28
28
  *
29
29
  * @module @memberjunction/server
30
30
  */
31
- import { Resolver, Mutation, Query, Arg, Ctx, Float, ObjectType, Field, PubSub, PubSubEngine } from 'type-graphql';
31
+ import { Resolver, Mutation, Query, Arg, Ctx, Float, Int, ObjectType, Field, PubSub, PubSubEngine } from 'type-graphql';
32
32
  import { LogError } from '@memberjunction/core';
33
33
  import { UUIDsEqual } from '@memberjunction/global';
34
34
  import { RemoteBrowserEngine } from '@memberjunction/remote-browser-server';
35
- import { RemoteBrowserCapabilityNotSupportedError } from '@memberjunction/remote-browser-base';
35
+ import { beginBrowserGoalStep, finalizeBrowserGoalStep, extractCoAgentRunID } from '../agentSessions/remoteBrowserGoalEngine.js';
36
+ import { RemoteBrowserGoalRegistry } from '../agentSessions/remoteBrowserGoalRegistry.js';
37
+ import { randomUUID } from 'node:crypto';
38
+ import { RemoteBrowserCapabilityNotSupportedError, } from '@memberjunction/remote-browser-base';
36
39
  import { ResolverBase } from '../generic/ResolverBase.js';
37
40
  import { GetReadWriteProvider } from '../util.js';
38
41
  import { PUSH_STATUS_UPDATES_TOPIC } from '../generic/PushStatusResolver.js';
@@ -72,6 +75,44 @@ RemoteBrowserActionResult = __decorate([
72
75
  ObjectType()
73
76
  ], RemoteBrowserActionResult);
74
77
  export { RemoteBrowserActionResult };
78
+ /**
79
+ * Result of {@link RemoteBrowserActionResolver.ExecuteRemoteBrowserGoal} — the outcome of an autonomous,
80
+ * goal-driven browser run (computer-use loop or backend native AI).
81
+ */
82
+ let RemoteBrowserGoalResultType = class RemoteBrowserGoalResultType {
83
+ };
84
+ __decorate([
85
+ Field(() => Boolean),
86
+ __metadata("design:type", Boolean)
87
+ ], RemoteBrowserGoalResultType.prototype, "Success", void 0);
88
+ __decorate([
89
+ Field(() => String, { nullable: true }),
90
+ __metadata("design:type", String)
91
+ ], RemoteBrowserGoalResultType.prototype, "GoalRunID", void 0);
92
+ __decorate([
93
+ Field(() => String, { nullable: true }),
94
+ __metadata("design:type", String)
95
+ ], RemoteBrowserGoalResultType.prototype, "Strategy", void 0);
96
+ __decorate([
97
+ Field(() => String, { nullable: true }),
98
+ __metadata("design:type", String)
99
+ ], RemoteBrowserGoalResultType.prototype, "CurrentUrl", void 0);
100
+ __decorate([
101
+ Field(() => String, { nullable: true }),
102
+ __metadata("design:type", String)
103
+ ], RemoteBrowserGoalResultType.prototype, "Status", void 0);
104
+ __decorate([
105
+ Field(() => Int, { nullable: true }),
106
+ __metadata("design:type", Number)
107
+ ], RemoteBrowserGoalResultType.prototype, "StepCount", void 0);
108
+ __decorate([
109
+ Field(() => String, { nullable: true }),
110
+ __metadata("design:type", String)
111
+ ], RemoteBrowserGoalResultType.prototype, "Detail", void 0);
112
+ RemoteBrowserGoalResultType = __decorate([
113
+ ObjectType()
114
+ ], RemoteBrowserGoalResultType);
115
+ export { RemoteBrowserGoalResultType };
75
116
  /**
76
117
  * Result of {@link RemoteBrowserActionResolver.RemoteBrowserSnapshot} — the current viewport screenshot +
77
118
  * URL for the client's live view. Both fields are null when the session holds no live browser.
@@ -122,6 +163,21 @@ RemoteBrowserAudioStreamResult = __decorate([
122
163
  ObjectType()
123
164
  ], RemoteBrowserAudioStreamResult);
124
165
  export { RemoteBrowserAudioStreamResult };
166
+ /**
167
+ * Result of {@link RemoteBrowserActionResolver.GetRemoteBrowserSelection} — the remote page's current text
168
+ * selection, the copy-out half of human clipboard support. `Text` is `''` when nothing is selected, no live
169
+ * browser exists, or the backend can't read the selection (the client then writes nothing to the clipboard).
170
+ */
171
+ let RemoteBrowserSelection = class RemoteBrowserSelection {
172
+ };
173
+ __decorate([
174
+ Field(() => String),
175
+ __metadata("design:type", String)
176
+ ], RemoteBrowserSelection.prototype, "Text", void 0);
177
+ RemoteBrowserSelection = __decorate([
178
+ ObjectType()
179
+ ], RemoteBrowserSelection);
180
+ export { RemoteBrowserSelection };
125
181
  /**
126
182
  * One UI element the visual interpreter localized in the screenshot — a label plus the pixel centroid the
127
183
  * voice agent can feed straight into `browser_Click(x, y)`. Coordinates are in the SCREENSHOT's own pixel
@@ -234,6 +290,76 @@ let RemoteBrowserActionResolver = class RemoteBrowserActionResolver extends Reso
234
290
  return { Success: false, Detail: `Remote browser error (${providerName}): ${message}` };
235
291
  }
236
292
  }
293
+ /**
294
+ * Execute a high-level GOAL against the session's browser — the agent sets an intent ("log in and open
295
+ * the latest invoice") and the resolved control strategy (computer-use loop or backend native AI) plans
296
+ * + executes it autonomously, instead of relaying granular actions. Ownership-gated; lazily starts the
297
+ * browser. Returns the terminal outcome (this is a request/response mutation — for live progress
298
+ * narration in a server-bridged realtime session the broker calls {@link RemoteBrowserEngine.AchieveGoal}
299
+ * in-process with an `OnProgress` callback).
300
+ *
301
+ * @param agentSessionID The `AIAgentSession` id the browser is bound to.
302
+ * @param goal The natural-language goal.
303
+ * @returns The goal outcome (success, strategy, status, step count, url, detail).
304
+ */
305
+ async ExecuteRemoteBrowserGoal(agentSessionID, goal, { userPayload, providers }, startUrl, maxSteps, preferredStrategy) {
306
+ const { contextUser, provider } = this.requireUserAndProvider(userPayload, providers);
307
+ const session = await this.loadOwnedSession(agentSessionID, contextUser, provider);
308
+ const providerName = await this.resolveProviderName(session, contextUser, provider);
309
+ // Observability: nest this goal's many prompt runs under ONE "Browser goal" step on the realtime
310
+ // co-agent run (when the session has one). Best-effort — a null step just means the goal runs unlinked.
311
+ const coAgentRunID = extractCoAgentRunID(session.Config_);
312
+ const goalStep = await beginBrowserGoalStep(provider, contextUser, coAgentRunID, goal);
313
+ // ASYNC START: a goal loop can run for minutes; do NOT hold this request open for it (browser
314
+ // fetch / proxy / janitor timeouts would kill the request while the loop runs on, and the agent
315
+ // would get "no response from the server" despite a successful run). Register the run, kick the
316
+ // loop off WITHOUT awaiting, and return a GoalRunID the client polls via GetRemoteBrowserGoalResult.
317
+ const goalRunID = randomUUID();
318
+ RemoteBrowserGoalRegistry.Instance.Begin(agentSessionID, goalRunID);
319
+ void RemoteBrowserEngine.Instance.AchieveGoal(agentSessionID, goal, {
320
+ ContextUser: contextUser,
321
+ ProviderName: providerName,
322
+ StartUrl: startUrl,
323
+ MaxSteps: maxSteps,
324
+ PreferredStrategy: preferredStrategy === 'NativeAI' || preferredStrategy === 'ComputerUse' ? preferredStrategy : undefined,
325
+ AgentRunID: coAgentRunID,
326
+ AgentRunStepID: goalStep?.ID,
327
+ })
328
+ .then(async (result) => {
329
+ await finalizeBrowserGoalStep(goalStep, result);
330
+ RemoteBrowserGoalRegistry.Instance.Complete(agentSessionID, goalRunID, result);
331
+ })
332
+ .catch(async (err) => {
333
+ const message = err instanceof Error ? err.message : String(err);
334
+ LogError(`ExecuteRemoteBrowserGoal failed (provider='${providerName}'): ${message}`);
335
+ const failure = { Success: false, Status: 'Error', Detail: `Remote browser error (${providerName}): ${message}` };
336
+ await finalizeBrowserGoalStep(goalStep, failure);
337
+ RemoteBrowserGoalRegistry.Instance.Complete(agentSessionID, goalRunID, failure);
338
+ });
339
+ return { Success: true, Status: 'Running', GoalRunID: goalRunID, Detail: 'Goal started.' };
340
+ }
341
+ /**
342
+ * Poll the outcome of a goal STARTED by {@link RemoteBrowserActionResolver.ExecuteRemoteBrowserGoal}.
343
+ * Returns `Status: 'Running'` while the loop is in flight, then the terminal outcome (success,
344
+ * strategy, status, step count, url, detail) once it finishes. Ownership-gated. A `Status: 'Unknown'`
345
+ * result means the run id is unrecognized — it expired (results are retained briefly) or never existed.
346
+ *
347
+ * @param agentSessionID The `AIAgentSession` id the goal runs against.
348
+ * @param goalRunID The handle returned by `ExecuteRemoteBrowserGoal`.
349
+ * @returns The current/terminal goal outcome.
350
+ */
351
+ async GetRemoteBrowserGoalResult(agentSessionID, goalRunID, { userPayload, providers }) {
352
+ const { contextUser, provider } = this.requireUserAndProvider(userPayload, providers);
353
+ await this.loadOwnedSession(agentSessionID, contextUser, provider);
354
+ const record = RemoteBrowserGoalRegistry.Instance.Get(agentSessionID, goalRunID);
355
+ if (!record) {
356
+ return { Success: false, Status: 'Unknown', GoalRunID: goalRunID, Detail: 'No such goal run (it may have expired).' };
357
+ }
358
+ if (record.Status === 'Running' || !record.Outcome) {
359
+ return { Success: false, Status: 'Running', GoalRunID: goalRunID };
360
+ }
361
+ return { ...record.Outcome, GoalRunID: goalRunID };
362
+ }
237
363
  /**
238
364
  * Return the current viewport screenshot + URL for the session's live browser — the client's live view.
239
365
  * Ownership-gated. When the session holds no live browser (never started, or already torn down), the
@@ -437,19 +563,20 @@ let RemoteBrowserActionResolver = class RemoteBrowserActionResolver extends Reso
437
563
  * agent⇄human floor, so we just relay. Finer floor / `AgentOnly` gating is a follow-up.
438
564
  *
439
565
  * @param agentSessionID The `AIAgentSession` id the browser is bound to.
440
- * @param kind The input kind (`'pointer-move' | 'pointer-click' | 'pointer-down' | 'pointer-up' | 'key' | 'scroll'`).
566
+ * @param kind The input kind (`'pointer-move' | 'pointer-click' | 'pointer-down' | 'pointer-up' | 'key' | 'text' | 'scroll'`).
567
+ * @param text The pasted text (the `'text'` paste-in kind only) — inserted into the page's focused element.
441
568
  * @param modifiers Optional comma-separated modifier keys held during the input (`'Shift'`, `'Control'`,
442
569
  * `'Alt'`, `'Meta'`) — carries Shift-click selection and Ctrl/Cmd+key chords faithfully.
443
570
  * @returns `true` when the input was routed, else `false`.
444
571
  */
445
- async RelayRemoteBrowserHumanInput(agentSessionID, kind, { userPayload, providers }, x, y, button, key, deltaX, deltaY, modifiers) {
572
+ async RelayRemoteBrowserHumanInput(agentSessionID, kind, { userPayload, providers }, x, y, button, key, text, deltaX, deltaY, modifiers) {
446
573
  const { contextUser, provider } = this.requireUserAndProvider(userPayload, providers);
447
574
  await this.loadOwnedSession(agentSessionID, contextUser, provider);
448
575
  const liveSession = RemoteBrowserEngine.Instance.GetSessionForAgentSession(agentSessionID);
449
576
  if (!liveSession) {
450
577
  return false;
451
578
  }
452
- const input = this.buildHumanInput({ kind, x, y, button, key, deltaX, deltaY, modifiers });
579
+ const input = this.buildHumanInput({ kind, x, y, button, key, text, deltaX, deltaY, modifiers });
453
580
  if (!input) {
454
581
  return false;
455
582
  }
@@ -467,6 +594,40 @@ let RemoteBrowserActionResolver = class RemoteBrowserActionResolver extends Reso
467
594
  return false;
468
595
  }
469
596
  }
597
+ /**
598
+ * Returns the remote page's CURRENT text selection — the copy-out half of human clipboard support. The
599
+ * viewer captures a local `copy` / Cmd+C, calls this to read what the human selected on the live page, and
600
+ * writes the result to the LOCAL clipboard (sidestepping the isolated remote clipboard, the mirror of the
601
+ * `'text'` paste-in path). Ownership-gated.
602
+ *
603
+ * Gracefully best-effort, never throws past the ownership gate (mirrors {@link RemoteBrowserSnapshot}):
604
+ * - No live browser for the session → `{ Text: '' }`.
605
+ * - Backend lacks `HumanTakeover` ({@link RemoteBrowserCapabilityNotSupportedError}) → `{ Text: '' }`.
606
+ * - Nothing selected / any other read failure → `{ Text: '' }` (logged).
607
+ *
608
+ * @param agentSessionID The `AIAgentSession` id the browser is bound to.
609
+ * @returns The selection text, or `{ Text: '' }` when none is readable.
610
+ */
611
+ async GetRemoteBrowserSelection(agentSessionID, { userPayload, providers }) {
612
+ const { contextUser, provider } = this.requireUserAndProvider(userPayload, providers);
613
+ await this.loadOwnedSession(agentSessionID, contextUser, provider);
614
+ const liveSession = RemoteBrowserEngine.Instance.GetSessionForAgentSession(agentSessionID);
615
+ if (!liveSession) {
616
+ return { Text: '' };
617
+ }
618
+ try {
619
+ return { Text: await liveSession.GetSelectionText() };
620
+ }
621
+ catch (err) {
622
+ if (err instanceof RemoteBrowserCapabilityNotSupportedError) {
623
+ // Backend can't read the selection — copy-out is simply unavailable. Not an error condition.
624
+ return { Text: '' };
625
+ }
626
+ const message = err instanceof Error ? err.message : String(err);
627
+ LogError(`GetRemoteBrowserSelection failed for session ${agentSessionID}: ${message}`);
628
+ return { Text: '' };
629
+ }
630
+ }
470
631
  // ----- internals -------------------------------------------------------------------------
471
632
  /**
472
633
  * Publishes one encoded screencast frame to the calling user's push-status topic, in the same envelope
@@ -745,9 +906,9 @@ let RemoteBrowserActionResolver = class RemoteBrowserActionResolver extends Reso
745
906
  /**
746
907
  * Builds a strongly-typed {@link RemoteBrowserHumanInput} from the relayed `kind` + fields, validating
747
908
  * each kind's required field(s). Returns `null` for an unknown kind or a kind missing its required
748
- * field(s): pointer-move/click/down/up need finite `x`,`y`; key needs a non-empty `key`; scroll needs
749
- * finite `x`,`y`,`deltaX`,`deltaY`. The `button` is clamped to the allowed union
750
- * (`'left' | 'middle' | 'right'`), defaulting unknown/absent values to `'left'`. Held `modifiers`
909
+ * field(s): pointer-move/click/down/up need finite `x`,`y`; key needs a non-empty `key`; text needs a
910
+ * non-empty `text`; scroll needs finite `x`,`y`,`deltaX`,`deltaY`. The `button` is clamped to the allowed
911
+ * union (`'left' | 'middle' | 'right'`), defaulting unknown/absent values to `'left'`. Held `modifiers`
751
912
  * (e.g. Shift-click, Ctrl/Cmd+key) ride on pointer clicks/presses and key presses.
752
913
  *
753
914
  * @param input The relayed input kind + all optional fields.
@@ -761,18 +922,39 @@ let RemoteBrowserActionResolver = class RemoteBrowserActionResolver extends Reso
761
922
  return hasXy ? { Kind: 'pointer-move', X: input.x, Y: input.y } : null;
762
923
  case 'pointer-click':
763
924
  return hasXy
764
- ? { Kind: 'pointer-click', X: input.x, Y: input.y, Button: this.clampButton(input.button), ...(modifiers.length ? { Modifiers: modifiers } : {}) }
925
+ ? {
926
+ Kind: 'pointer-click',
927
+ X: input.x,
928
+ Y: input.y,
929
+ Button: this.clampButton(input.button),
930
+ ...(modifiers.length ? { Modifiers: modifiers } : {}),
931
+ }
765
932
  : null;
766
933
  case 'pointer-down':
767
934
  return hasXy
768
- ? { Kind: 'pointer-down', X: input.x, Y: input.y, Button: this.clampButton(input.button), ...(modifiers.length ? { Modifiers: modifiers } : {}) }
935
+ ? {
936
+ Kind: 'pointer-down',
937
+ X: input.x,
938
+ Y: input.y,
939
+ Button: this.clampButton(input.button),
940
+ ...(modifiers.length ? { Modifiers: modifiers } : {}),
941
+ }
769
942
  : null;
770
943
  case 'pointer-up':
771
944
  return hasXy
772
- ? { Kind: 'pointer-up', X: input.x, Y: input.y, Button: this.clampButton(input.button), ...(modifiers.length ? { Modifiers: modifiers } : {}) }
945
+ ? {
946
+ Kind: 'pointer-up',
947
+ X: input.x,
948
+ Y: input.y,
949
+ Button: this.clampButton(input.button),
950
+ ...(modifiers.length ? { Modifiers: modifiers } : {}),
951
+ }
773
952
  : null;
774
953
  case 'key':
775
954
  return input.key && input.key.length > 0 ? { Kind: 'key', Key: input.key, ...(modifiers.length ? { Modifiers: modifiers } : {}) } : null;
955
+ case 'text':
956
+ // Human paste — insert the relayed clipboard text into the focused element. Empty text is a no-op.
957
+ return typeof input.text === 'string' && input.text.length > 0 ? { Kind: 'text', Text: input.text } : null;
776
958
  case 'scroll':
777
959
  return hasXy && Number.isFinite(input.deltaX) && Number.isFinite(input.deltaY)
778
960
  ? { Kind: 'scroll', X: input.x, Y: input.y, DeltaX: input.deltaX, DeltaY: input.deltaY }
@@ -822,6 +1004,27 @@ __decorate([
822
1004
  __metadata("design:paramtypes", [String, String, Object, String, String, Number, Number, String, String, Number, Number, Number]),
823
1005
  __metadata("design:returntype", Promise)
824
1006
  ], RemoteBrowserActionResolver.prototype, "ExecuteRemoteBrowserAction", null);
1007
+ __decorate([
1008
+ Mutation(() => RemoteBrowserGoalResultType),
1009
+ __param(0, Arg('agentSessionID', () => String)),
1010
+ __param(1, Arg('goal', () => String)),
1011
+ __param(2, Ctx()),
1012
+ __param(3, Arg('startUrl', () => String, { nullable: true })),
1013
+ __param(4, Arg('maxSteps', () => Int, { nullable: true })),
1014
+ __param(5, Arg('preferredStrategy', () => String, { nullable: true })),
1015
+ __metadata("design:type", Function),
1016
+ __metadata("design:paramtypes", [String, String, Object, String, Number, String]),
1017
+ __metadata("design:returntype", Promise)
1018
+ ], RemoteBrowserActionResolver.prototype, "ExecuteRemoteBrowserGoal", null);
1019
+ __decorate([
1020
+ Query(() => RemoteBrowserGoalResultType),
1021
+ __param(0, Arg('agentSessionID', () => String)),
1022
+ __param(1, Arg('goalRunID', () => String)),
1023
+ __param(2, Ctx()),
1024
+ __metadata("design:type", Function),
1025
+ __metadata("design:paramtypes", [String, String, Object]),
1026
+ __metadata("design:returntype", Promise)
1027
+ ], RemoteBrowserActionResolver.prototype, "GetRemoteBrowserGoalResult", null);
825
1028
  __decorate([
826
1029
  Query(() => RemoteBrowserSnapshot),
827
1030
  __param(0, Arg('agentSessionID', () => String)),
@@ -882,13 +1085,22 @@ __decorate([
882
1085
  __param(4, Arg('y', () => Float, { nullable: true })),
883
1086
  __param(5, Arg('button', () => String, { nullable: true })),
884
1087
  __param(6, Arg('key', () => String, { nullable: true })),
885
- __param(7, Arg('deltaX', () => Float, { nullable: true })),
886
- __param(8, Arg('deltaY', () => Float, { nullable: true })),
887
- __param(9, Arg('modifiers', () => String, { nullable: true })),
1088
+ __param(7, Arg('text', () => String, { nullable: true })),
1089
+ __param(8, Arg('deltaX', () => Float, { nullable: true })),
1090
+ __param(9, Arg('deltaY', () => Float, { nullable: true })),
1091
+ __param(10, Arg('modifiers', () => String, { nullable: true })),
888
1092
  __metadata("design:type", Function),
889
- __metadata("design:paramtypes", [String, String, Object, Number, Number, String, String, Number, Number, String]),
1093
+ __metadata("design:paramtypes", [String, String, Object, Number, Number, String, String, String, Number, Number, String]),
890
1094
  __metadata("design:returntype", Promise)
891
1095
  ], RemoteBrowserActionResolver.prototype, "RelayRemoteBrowserHumanInput", null);
1096
+ __decorate([
1097
+ Query(() => RemoteBrowserSelection),
1098
+ __param(0, Arg('agentSessionID', () => String)),
1099
+ __param(1, Ctx()),
1100
+ __metadata("design:type", Function),
1101
+ __metadata("design:paramtypes", [String, Object]),
1102
+ __metadata("design:returntype", Promise)
1103
+ ], RemoteBrowserActionResolver.prototype, "GetRemoteBrowserSelection", null);
892
1104
  RemoteBrowserActionResolver = __decorate([
893
1105
  Resolver()
894
1106
  ], RemoteBrowserActionResolver);