@memberjunction/ng-conversations 5.41.0 → 5.43.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/dist/__tests__/remote-browser-channel.test.js +163 -1
- package/dist/__tests__/remote-browser-channel.test.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +105 -2
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +1378 -489
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +4 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +13 -8
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +98 -5
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +1102 -401
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +37 -19
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.js +10 -3
- package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.js +1 -1
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +5 -0
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +26 -3
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts +5 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +104 -85
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +22 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +40 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +12 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +97 -19
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +33 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +164 -7
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts +35 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js +67 -4
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js +13 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +4 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +13 -8
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/models/conversation-state.model.d.ts +1 -1
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
- package/dist/lib/models/conversation-state.model.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts +1 -1
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +7 -2
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.d.ts +25 -5
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +86 -18
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/lib/services/realtime-pairing.d.ts +8 -7
- package/dist/lib/services/realtime-pairing.d.ts.map +1 -1
- package/dist/lib/services/realtime-pairing.js +19 -9
- package/dist/lib/services/realtime-pairing.js.map +1 -1
- package/package.json +26 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-browser-tools.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/remote-browser/remote-browser-tools.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,gBAAgB;IACxB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,qBAAqB;IAClC,YAAY,EAAE,sBAAsB;IACpC,aAAa,EAAE,uBAAuB;CAC9B,CAAC;AAwCX,4FAA4F;AAC5F,SAAS,QAAQ,CAAC,KAA+B;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,yFAAyF;AACzF,SAAS,QAAQ,CAAC,KAA+B;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,M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AAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;aAChF;SACF;KACF;IACD;QACE,IAAI,EAAE,yBAAyB,CAAC,WAAW;QAC3C,WAAW,EAAE,mHAAmH;QAChI,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KACrD;IACD;QACE,IAAI,EAAE,yBAAyB,CAAC,YAAY;QAC5C,WAAW,EACT,oJAAoJ;QACtJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KACrD;IACD;QACE,IAAI,EAAE,yBAAyB,CAAC,aAAa;QAC7C,WAAW,EACT,8NAA8N;QAChO,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6EAA6E,EAAE;aAC5H;YACD,QAAQ,EAAE,CAAC,aAAa,CAAC;SAC1B;KACF;CACF,CAAC","sourcesContent":["import { RealtimeToolDefinition } from '@memberjunction/ai';\n\n/**\n * The shared name prefix of every Remote Browser tool — the key the session registers so all\n * `browser_*` tool calls route locally to the channel's {@link RemoteBrowserChannel.ApplyAgentTool}\n * (executed in the browser, which in turn drives the SERVER-hosted browser via the\n * `ExecuteRemoteBrowserAction` GraphQL mutation) instead of the generic server tool relay.\n */\nexport const REMOTE_BROWSER_TOOL_PREFIX = 'browser_';\n\n/** The canonical Remote Browser tool names (one per `browser_*` capability). */\nexport const REMOTE_BROWSER_TOOL_NAMES = {\n OpenUrl: 'browser_OpenUrl',\n Click: 'browser_Click',\n Type: 'browser_Type',\n Key: 'browser_Key',\n Scroll: 'browser_Scroll',\n Back: 'browser_Back',\n Forward: 'browser_Forward',\n Wait: 'browser_Wait',\n GetPageText: 'browser_GetPageText',\n DescribePage: 'browser_DescribePage',\n LocateElement: 'browser_LocateElement',\n} as const;\n\n/**\n * The discriminated `kind` the server's `ExecuteRemoteBrowserAction` mutation switches on.\n * Each Remote Browser tool maps to exactly one of these (see {@link MapToolToAction}).\n */\nexport type RemoteBrowserActionKind = 'navigate' | 'click' | 'type' | 'key' | 'scroll' | 'back' | 'forward' | 'wait' | 'getPageText';\n\n/**\n * A normalized Remote Browser action — the flat field set the `ExecuteRemoteBrowserAction`\n * mutation accepts, derived from a `browser_*` tool call by {@link MapToolToAction}. Only the\n * fields meaningful for the action's {@link Kind} are populated; the rest stay `undefined`\n * (the mutation's optional args).\n */\nexport interface RemoteBrowserAction {\n /** The action discriminator the server switches on. */\n Kind: RemoteBrowserActionKind;\n /** Target URL (openUrl). */\n Url?: string;\n /** CSS selector to target (click / type / scroll / wait). */\n Selector?: string;\n /** Viewport X coordinate for a positional click (click). */\n X?: number;\n /** Viewport Y coordinate for a positional click (click). */\n Y?: number;\n /** Text to type (type). */\n Text?: string;\n /** Key name to press, e.g. `'Enter'` / `'Tab'` (key). */\n Key?: string;\n /** Horizontal scroll delta in px (scroll). */\n DeltaX?: number;\n /** Vertical scroll delta in px (scroll). */\n DeltaY?: number;\n /** Wait duration in ms (wait). */\n Ms?: number;\n}\n\n/** A JSON-serializable value (the building block of a parsed tool-args object). */\ntype ToolArgValue = string | number | boolean | null | ToolArgValue[] | { [key: string]: ToolArgValue };\n\n/** Coerces a parsed arg to a non-empty string, or `undefined` when absent / wrong-typed. */\nfunction asString(value: ToolArgValue | undefined): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\n/** Coerces a parsed arg to a finite number, or `undefined` when absent / wrong-typed. */\nfunction asNumber(value: ToolArgValue | undefined): number | undefined {\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n}\n\n/**\n * Thrown by {@link MapToolToAction} when a tool's REQUIRED argument is missing or invalid\n * (e.g. `browser_OpenUrl` without a `url`, `browser_Type` without `text`). The channel\n * catches it and returns the message to the model as a failed-tool result string — it is\n * never allowed to propagate out of `ApplyAgentTool`.\n */\nexport class RemoteBrowserToolArgError extends Error {}\n\n/**\n * Maps ONE parsed `browser_*` tool-call args object to its normalized\n * {@link RemoteBrowserAction}. Pure + synchronous so it can be unit-tested in isolation from\n * the GraphQL round-trip. Validates required args and throws {@link RemoteBrowserToolArgError}\n * with a model-readable message when they're missing/invalid; unknown tool names also throw.\n *\n * @param toolName One of the `browser_*` names (see {@link REMOTE_BROWSER_TOOL_NAMES}).\n * @param args The parsed tool-call arguments object.\n * @returns The normalized action ready to feed the `ExecuteRemoteBrowserAction` mutation.\n */\nexport function MapToolToAction(toolName: string, args: Record<string, ToolArgValue>): RemoteBrowserAction {\n switch (toolName) {\n case REMOTE_BROWSER_TOOL_NAMES.OpenUrl: {\n const url = asString(args['url']);\n if (!url) {\n throw new RemoteBrowserToolArgError('browser_OpenUrl requires a non-empty \"url\".');\n }\n return { Kind: 'navigate', Url: url };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Click: {\n const selector = asString(args['selector']);\n const x = asNumber(args['x']);\n const y = asNumber(args['y']);\n if (!selector && (x === undefined || y === undefined)) {\n throw new RemoteBrowserToolArgError('browser_Click requires either a \"selector\" or both \"x\" and \"y\" coordinates.');\n }\n return { Kind: 'click', Selector: selector, X: x, Y: y };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Type: {\n // Empty string is a VALID value to type — only a missing / non-string `text` is an error,\n // so check the raw type here rather than via asString (which treats '' as absent).\n const text = args['text'];\n if (typeof text !== 'string') {\n throw new RemoteBrowserToolArgError('browser_Type requires \"text\" to type.');\n }\n return { Kind: 'type', Text: text, Selector: asString(args['selector']) };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Key: {\n const key = asString(args['key']);\n if (!key) {\n throw new RemoteBrowserToolArgError('browser_Key requires a \"key\" name (e.g. \"Enter\", \"Tab\").');\n }\n return { Kind: 'key', Key: key };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Scroll: {\n return {\n Kind: 'scroll',\n DeltaX: asNumber(args['deltaX']),\n DeltaY: asNumber(args['deltaY']),\n Selector: asString(args['selector']),\n };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Back:\n return { Kind: 'back' };\n case REMOTE_BROWSER_TOOL_NAMES.Forward:\n return { Kind: 'forward' };\n case REMOTE_BROWSER_TOOL_NAMES.Wait: {\n return { Kind: 'wait', Ms: asNumber(args['ms']), Selector: asString(args['selector']) };\n }\n case REMOTE_BROWSER_TOOL_NAMES.GetPageText:\n return { Kind: 'getPageText' };\n default:\n throw new RemoteBrowserToolArgError(`Unknown Remote Browser tool \"${toolName}\".`);\n }\n}\n\n/**\n * The Remote Browser channel's CLIENT-EXECUTED tool declarations — registered with the\n * realtime model at session mint and routed back to {@link RemoteBrowserChannel.ApplyAgentTool}\n * by the `browser_` prefix. Each maps 1:1 to a {@link RemoteBrowserActionKind}.\n */\nexport const REMOTE_BROWSER_TOOL_DEFINITIONS: RealtimeToolDefinition[] = [\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.OpenUrl,\n Description: 'Navigate the shared browser to a URL. The user watches the live page in the Browser tab.',\n ParametersSchema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Absolute URL to open (include the scheme, e.g. https://…).' },\n },\n required: ['url'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Click,\n Description:\n 'Click an element in the shared browser, by CSS selector or by viewport x/y coordinates. Provide a selector when you know it; otherwise provide both x and y.',\n ParametersSchema: {\n type: 'object',\n properties: {\n selector: { type: 'string', description: 'CSS selector of the element to click (preferred).' },\n x: { type: 'number', description: 'Viewport X in CSS px (used when no selector is given).' },\n y: { type: 'number', description: 'Viewport Y in CSS px (used when no selector is given).' },\n },\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Type,\n Description: 'Type text into the shared browser. Provide a selector to focus a specific field first; omit it to type into the currently focused element.',\n ParametersSchema: {\n type: 'object',\n properties: {\n text: { type: 'string', description: 'The text to type.' },\n selector: { type: 'string', description: 'Optional CSS selector to focus before typing.' },\n },\n required: ['text'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Key,\n Description: 'Press a single key in the shared browser (e.g. \"Enter\" to submit, \"Tab\" to move focus, \"Escape\" to dismiss).',\n ParametersSchema: {\n type: 'object',\n properties: {\n key: { type: 'string', description: 'Key name, e.g. \"Enter\", \"Tab\", \"Escape\", \"ArrowDown\".' },\n },\n required: ['key'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Scroll,\n Description: 'Scroll the shared browser page (or a scrollable element) by a pixel delta. Positive deltaY scrolls down.',\n ParametersSchema: {\n type: 'object',\n properties: {\n deltaX: { type: 'number', description: 'Horizontal scroll delta in px (positive = right).' },\n deltaY: { type: 'number', description: 'Vertical scroll delta in px (positive = down).' },\n selector: { type: 'string', description: 'Optional CSS selector of a scrollable element; omit to scroll the page.' },\n },\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Back,\n Description: 'Navigate the shared browser back to the previous page in its history.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Forward,\n Description: 'Navigate the shared browser forward to the next page in its history.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Wait,\n Description: 'Wait for the shared browser to settle — for a fixed number of milliseconds, or until an element matching a selector appears.',\n ParametersSchema: {\n type: 'object',\n properties: {\n ms: { type: 'number', description: 'Milliseconds to wait. Omit when waiting on a selector.' },\n selector: { type: 'string', description: 'Optional CSS selector to wait for.' },\n },\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.GetPageText,\n Description: 'Read the visible text content of the current page in the shared browser, so you can understand what is on screen.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.DescribePage,\n Description:\n \"Look at the current page and get a concise text description of what is visible — use this to 'see' the page since you cannot view images directly.\",\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.LocateElement,\n Description:\n \"Find a UI element by visual description (e.g. 'the blue Sign In button', 'the search box') and get its approximate pixel center (x,y) so you can browser_Click it. Returns whether it was found, its label, and coordinates.\",\n ParametersSchema: {\n type: 'object',\n properties: {\n description: { type: 'string', description: \"Visual description of the element to find (e.g. 'the blue Sign In button').\" },\n },\n required: ['description'],\n },\n },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"remote-browser-tools.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/remote-browser/remote-browser-tools.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,gBAAgB;IACxB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,qBAAqB;IAClC,YAAY,EAAE,sBAAsB;IACpC,aAAa,EAAE,uBAAuB;IACtC,WAAW,EAAE,qBAAqB;CAC1B,CAAC;AAwCX,4FAA4F;AAC5F,SAAS,QAAQ,CAAC,KAA+B;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,yFAAyF;AACzF,SAAS,QAAQ,CAAC,KAA+B;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;CAAG;AAEv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,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KACrD;IACD;QACE,IAAI,EAAE,yBAAyB,CAAC,YAAY;QAC5C,WAAW,EACT,oJAAoJ;QACtJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KACrD;IACD;QACE,IAAI,EAAE,yBAAyB,CAAC,aAAa;QAC7C,WAAW,EACT,8NAA8N;QAChO,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6EAA6E,EAAE;aAC5H;YACD,QAAQ,EAAE,CAAC,aAAa,CAAC;SAC1B;KACF;IACD;QACE,IAAI,EAAE,yBAAyB,CAAC,WAAW;QAC3C,WAAW,EACT,2XAA2X;QAC7X,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gEAAgE,EAAE;gBACvG,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gDAAgD,EAAE;aAC5F;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF;CACF,CAAC","sourcesContent":["import { RealtimeToolDefinition } from '@memberjunction/ai';\n\n/**\n * The shared name prefix of every Remote Browser tool — the key the session registers so all\n * `browser_*` tool calls route locally to the channel's {@link RemoteBrowserChannel.ApplyAgentTool}\n * (executed in the browser, which in turn drives the SERVER-hosted browser via the\n * `ExecuteRemoteBrowserAction` GraphQL mutation) instead of the generic server tool relay.\n */\nexport const REMOTE_BROWSER_TOOL_PREFIX = 'browser_';\n\n/** The canonical Remote Browser tool names (one per `browser_*` capability). */\nexport const REMOTE_BROWSER_TOOL_NAMES = {\n OpenUrl: 'browser_OpenUrl',\n Click: 'browser_Click',\n Type: 'browser_Type',\n Key: 'browser_Key',\n Scroll: 'browser_Scroll',\n Back: 'browser_Back',\n Forward: 'browser_Forward',\n Wait: 'browser_Wait',\n GetPageText: 'browser_GetPageText',\n DescribePage: 'browser_DescribePage',\n LocateElement: 'browser_LocateElement',\n AchieveGoal: 'browser_AchieveGoal',\n} as const;\n\n/**\n * The discriminated `kind` the server's `ExecuteRemoteBrowserAction` mutation switches on.\n * Each Remote Browser tool maps to exactly one of these (see {@link MapToolToAction}).\n */\nexport type RemoteBrowserActionKind = 'navigate' | 'click' | 'type' | 'key' | 'scroll' | 'back' | 'forward' | 'wait' | 'getPageText';\n\n/**\n * A normalized Remote Browser action — the flat field set the `ExecuteRemoteBrowserAction`\n * mutation accepts, derived from a `browser_*` tool call by {@link MapToolToAction}. Only the\n * fields meaningful for the action's {@link Kind} are populated; the rest stay `undefined`\n * (the mutation's optional args).\n */\nexport interface RemoteBrowserAction {\n /** The action discriminator the server switches on. */\n Kind: RemoteBrowserActionKind;\n /** Target URL (openUrl). */\n Url?: string;\n /** CSS selector to target (click / type / scroll / wait). */\n Selector?: string;\n /** Viewport X coordinate for a positional click (click). */\n X?: number;\n /** Viewport Y coordinate for a positional click (click). */\n Y?: number;\n /** Text to type (type). */\n Text?: string;\n /** Key name to press, e.g. `'Enter'` / `'Tab'` (key). */\n Key?: string;\n /** Horizontal scroll delta in px (scroll). */\n DeltaX?: number;\n /** Vertical scroll delta in px (scroll). */\n DeltaY?: number;\n /** Wait duration in ms (wait). */\n Ms?: number;\n}\n\n/** A JSON-serializable value (the building block of a parsed tool-args object). */\ntype ToolArgValue = string | number | boolean | null | ToolArgValue[] | { [key: string]: ToolArgValue };\n\n/** Coerces a parsed arg to a non-empty string, or `undefined` when absent / wrong-typed. */\nfunction asString(value: ToolArgValue | undefined): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\n/** Coerces a parsed arg to a finite number, or `undefined` when absent / wrong-typed. */\nfunction asNumber(value: ToolArgValue | undefined): number | undefined {\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n}\n\n/**\n * Thrown by {@link MapToolToAction} when a tool's REQUIRED argument is missing or invalid\n * (e.g. `browser_OpenUrl` without a `url`, `browser_Type` without `text`). The channel\n * catches it and returns the message to the model as a failed-tool result string — it is\n * never allowed to propagate out of `ApplyAgentTool`.\n */\nexport class RemoteBrowserToolArgError extends Error {}\n\n/**\n * Maps ONE parsed `browser_*` tool-call args object to its normalized\n * {@link RemoteBrowserAction}. Pure + synchronous so it can be unit-tested in isolation from\n * the GraphQL round-trip. Validates required args and throws {@link RemoteBrowserToolArgError}\n * with a model-readable message when they're missing/invalid; unknown tool names also throw.\n *\n * @param toolName One of the `browser_*` names (see {@link REMOTE_BROWSER_TOOL_NAMES}).\n * @param args The parsed tool-call arguments object.\n * @returns The normalized action ready to feed the `ExecuteRemoteBrowserAction` mutation.\n */\nexport function MapToolToAction(toolName: string, args: Record<string, ToolArgValue>): RemoteBrowserAction {\n switch (toolName) {\n case REMOTE_BROWSER_TOOL_NAMES.OpenUrl: {\n const url = asString(args['url']);\n if (!url) {\n throw new RemoteBrowserToolArgError('browser_OpenUrl requires a non-empty \"url\".');\n }\n return { Kind: 'navigate', Url: url };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Click: {\n const selector = asString(args['selector']);\n const x = asNumber(args['x']);\n const y = asNumber(args['y']);\n if (!selector && (x === undefined || y === undefined)) {\n throw new RemoteBrowserToolArgError('browser_Click requires either a \"selector\" or both \"x\" and \"y\" coordinates.');\n }\n return { Kind: 'click', Selector: selector, X: x, Y: y };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Type: {\n // Empty string is a VALID value to type — only a missing / non-string `text` is an error,\n // so check the raw type here rather than via asString (which treats '' as absent).\n const text = args['text'];\n if (typeof text !== 'string') {\n throw new RemoteBrowserToolArgError('browser_Type requires \"text\" to type.');\n }\n return { Kind: 'type', Text: text, Selector: asString(args['selector']) };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Key: {\n const key = asString(args['key']);\n if (!key) {\n throw new RemoteBrowserToolArgError('browser_Key requires a \"key\" name (e.g. \"Enter\", \"Tab\").');\n }\n return { Kind: 'key', Key: key };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Scroll: {\n return {\n Kind: 'scroll',\n DeltaX: asNumber(args['deltaX']),\n DeltaY: asNumber(args['deltaY']),\n Selector: asString(args['selector']),\n };\n }\n case REMOTE_BROWSER_TOOL_NAMES.Back:\n return { Kind: 'back' };\n case REMOTE_BROWSER_TOOL_NAMES.Forward:\n return { Kind: 'forward' };\n case REMOTE_BROWSER_TOOL_NAMES.Wait: {\n return { Kind: 'wait', Ms: asNumber(args['ms']), Selector: asString(args['selector']) };\n }\n case REMOTE_BROWSER_TOOL_NAMES.GetPageText:\n return { Kind: 'getPageText' };\n default:\n throw new RemoteBrowserToolArgError(`Unknown Remote Browser tool \"${toolName}\".`);\n }\n}\n\n/**\n * The Remote Browser channel's CLIENT-EXECUTED tool declarations — registered with the\n * realtime model at session mint and routed back to {@link RemoteBrowserChannel.ApplyAgentTool}\n * by the `browser_` prefix. Each maps 1:1 to a {@link RemoteBrowserActionKind}.\n */\nexport const REMOTE_BROWSER_TOOL_DEFINITIONS: RealtimeToolDefinition[] = [\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.OpenUrl,\n Description: 'Navigate the shared browser to a URL. The user watches the live page in the Browser tab.',\n ParametersSchema: {\n type: 'object',\n properties: {\n url: { type: 'string', description: 'Absolute URL to open (include the scheme, e.g. https://…).' },\n },\n required: ['url'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Click,\n Description:\n 'Click an element in the shared browser, by CSS selector or by viewport x/y coordinates. Provide a selector when you know it; otherwise provide both x and y.',\n ParametersSchema: {\n type: 'object',\n properties: {\n selector: { type: 'string', description: 'CSS selector of the element to click (preferred).' },\n x: { type: 'number', description: 'Viewport X in CSS px (used when no selector is given).' },\n y: { type: 'number', description: 'Viewport Y in CSS px (used when no selector is given).' },\n },\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Type,\n Description: 'Type text into the shared browser. Provide a selector to focus a specific field first; omit it to type into the currently focused element.',\n ParametersSchema: {\n type: 'object',\n properties: {\n text: { type: 'string', description: 'The text to type.' },\n selector: { type: 'string', description: 'Optional CSS selector to focus before typing.' },\n },\n required: ['text'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Key,\n Description: 'Press a single key in the shared browser (e.g. \"Enter\" to submit, \"Tab\" to move focus, \"Escape\" to dismiss).',\n ParametersSchema: {\n type: 'object',\n properties: {\n key: { type: 'string', description: 'Key name, e.g. \"Enter\", \"Tab\", \"Escape\", \"ArrowDown\".' },\n },\n required: ['key'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Scroll,\n Description: 'Scroll the shared browser page (or a scrollable element) by a pixel delta. Positive deltaY scrolls down.',\n ParametersSchema: {\n type: 'object',\n properties: {\n deltaX: { type: 'number', description: 'Horizontal scroll delta in px (positive = right).' },\n deltaY: { type: 'number', description: 'Vertical scroll delta in px (positive = down).' },\n selector: { type: 'string', description: 'Optional CSS selector of a scrollable element; omit to scroll the page.' },\n },\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Back,\n Description: 'Navigate the shared browser back to the previous page in its history.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Forward,\n Description: 'Navigate the shared browser forward to the next page in its history.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.Wait,\n Description: 'Wait for the shared browser to settle — for a fixed number of milliseconds, or until an element matching a selector appears.',\n ParametersSchema: {\n type: 'object',\n properties: {\n ms: { type: 'number', description: 'Milliseconds to wait. Omit when waiting on a selector.' },\n selector: { type: 'string', description: 'Optional CSS selector to wait for.' },\n },\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.GetPageText,\n Description: 'Read the visible text content of the current page in the shared browser, so you can understand what is on screen.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.DescribePage,\n Description:\n \"Look at the current page and get a concise text description of what is visible — use this to 'see' the page since you cannot view images directly.\",\n ParametersSchema: { type: 'object', properties: {} },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.LocateElement,\n Description:\n \"Find a UI element by visual description (e.g. 'the blue Sign In button', 'the search box') and get its approximate pixel center (x,y) so you can browser_Click it. Returns whether it was found, its label, and coordinates.\",\n ParametersSchema: {\n type: 'object',\n properties: {\n description: { type: 'string', description: \"Visual description of the element to find (e.g. 'the blue Sign In button').\" },\n },\n required: ['description'],\n },\n },\n {\n Name: REMOTE_BROWSER_TOOL_NAMES.AchieveGoal,\n Description:\n 'Hand a high-level GOAL to the autonomous browser agent (a stronger vision/action model) and let it plan and execute all the steps itself — e.g. \"log in and open the latest invoice\", \"search for X and add the first result to the cart\". Prefer this over issuing many granular browser_* steps when the task is multi-step. Returns when the goal is done (or could not be completed).',\n ParametersSchema: {\n type: 'object',\n properties: {\n goal: { type: 'string', description: 'The natural-language goal to accomplish in the shared browser.' },\n startUrl: { type: 'string', description: 'Optional absolute URL to open before starting.' },\n },\n required: ['goal'],\n },\n },\n];\n"]}
|
|
@@ -112,6 +112,10 @@ export declare class ConversationWorkspaceComponent extends BaseAngularComponent
|
|
|
112
112
|
private previousVersionId;
|
|
113
113
|
private previousIsNewConversation;
|
|
114
114
|
private destroy$;
|
|
115
|
+
private readonly boundOnResizeMove;
|
|
116
|
+
private readonly boundOnResizeEnd;
|
|
117
|
+
private readonly boundOnResizeTouchMove;
|
|
118
|
+
private readonly boundOnResizeTouchEnd;
|
|
115
119
|
private readonly USER_SETTING_SIDEBAR_KEY;
|
|
116
120
|
private saveSettingsTimeout;
|
|
117
121
|
private isLoadingSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-workspace.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/workspace/conversation-workspace.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAIL,YAAY,EACZ,MAAM,EACN,SAAS,EACT,OAAO,EACP,iBAAiB,EAElB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,EAAmF,MAAM,+BAA+B,CAAC;AACtL,OAAO,EAAE,QAAQ,EAAE,YAAY,EAA0B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;;AAExE;;;;;;;;GAQG;AACH,qBAMa,8BAA+B,SAAQ,oBAAqB,YAAW,MAAM,EAAE,SAAS,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"conversation-workspace.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/workspace/conversation-workspace.component.ts"],"names":[],"mappings":"AAAA;;;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E;;OAEG;IACH,yBAAyB,IAAI,IAAI;IAKjC;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAKrD;;;OAGG;IACH,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;yCAvqCxC,8BAA8B;2CAA9B,8BAA8B;CA2qC1C"}
|
|
@@ -267,6 +267,11 @@ export class ConversationWorkspaceComponent extends BaseAngularComponent {
|
|
|
267
267
|
previousVersionId = null; // Used to track version changes in ngDoCheck
|
|
268
268
|
previousIsNewConversation = false; // Track new conversation state changes
|
|
269
269
|
destroy$ = new Subject();
|
|
270
|
+
// Stored bound references so addEventListener and removeEventListener get the same function object.
|
|
271
|
+
boundOnResizeMove = this.onResizeMove.bind(this);
|
|
272
|
+
boundOnResizeEnd = this.onResizeEnd.bind(this);
|
|
273
|
+
boundOnResizeTouchMove = this.onResizeTouchMove.bind(this);
|
|
274
|
+
boundOnResizeTouchEnd = this.onResizeTouchEnd.bind(this);
|
|
270
275
|
// User Settings key for server-side persistence
|
|
271
276
|
USER_SETTING_SIDEBAR_KEY = 'Conversations.SidebarState';
|
|
272
277
|
saveSettingsTimeout = null;
|
|
@@ -464,11 +469,11 @@ export class ConversationWorkspaceComponent extends BaseAngularComponent {
|
|
|
464
469
|
}, 50);
|
|
465
470
|
}
|
|
466
471
|
// Setup resize listeners
|
|
467
|
-
window.addEventListener('mousemove', this.
|
|
468
|
-
window.addEventListener('mouseup', this.
|
|
472
|
+
window.addEventListener('mousemove', this.boundOnResizeMove);
|
|
473
|
+
window.addEventListener('mouseup', this.boundOnResizeEnd);
|
|
469
474
|
// Setup touch listeners for mobile
|
|
470
|
-
window.addEventListener('touchmove', this.
|
|
471
|
-
window.addEventListener('touchend', this.
|
|
475
|
+
window.addEventListener('touchmove', this.boundOnResizeTouchMove);
|
|
476
|
+
window.addEventListener('touchend', this.boundOnResizeTouchEnd);
|
|
472
477
|
// CRITICAL: Initialize engines FIRST before rendering any UI
|
|
473
478
|
// The isWorkspaceReady flag blocks all child components from rendering
|
|
474
479
|
// until engines are fully loaded and ready
|
|
@@ -615,10 +620,10 @@ export class ConversationWorkspaceComponent extends BaseAngularComponent {
|
|
|
615
620
|
clearTimeout(this.saveSettingsTimeout);
|
|
616
621
|
}
|
|
617
622
|
// Remove resize listeners
|
|
618
|
-
window.removeEventListener('mousemove', this.
|
|
619
|
-
window.removeEventListener('mouseup', this.
|
|
620
|
-
window.removeEventListener('touchmove', this.
|
|
621
|
-
window.removeEventListener('touchend', this.
|
|
623
|
+
window.removeEventListener('mousemove', this.boundOnResizeMove);
|
|
624
|
+
window.removeEventListener('mouseup', this.boundOnResizeEnd);
|
|
625
|
+
window.removeEventListener('touchmove', this.boundOnResizeTouchMove);
|
|
626
|
+
window.removeEventListener('touchend', this.boundOnResizeTouchEnd);
|
|
622
627
|
}
|
|
623
628
|
onWindowResize() {
|
|
624
629
|
this.checkMobileView();
|