bedrock-agentcore 0.1.1 → 0.2.2
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/README.md +102 -114
- package/dist/src/_utils/endpoints.d.ts +28 -0
- package/dist/src/_utils/endpoints.d.ts.map +1 -0
- package/dist/src/_utils/endpoints.js +44 -0
- package/dist/src/_utils/endpoints.js.map +1 -0
- package/dist/src/identity/client.d.ts +40 -0
- package/dist/src/identity/client.d.ts.map +1 -0
- package/dist/src/identity/client.js +109 -0
- package/dist/src/identity/client.js.map +1 -0
- package/dist/src/identity/index.d.ts +22 -0
- package/dist/src/identity/index.d.ts.map +1 -0
- package/dist/src/identity/index.js +24 -0
- package/dist/src/identity/index.js.map +1 -0
- package/dist/src/identity/types.d.ts +82 -0
- package/dist/src/identity/types.d.ts.map +1 -0
- package/dist/src/identity/types.js +5 -0
- package/dist/src/identity/types.js.map +1 -0
- package/dist/src/identity/wrappers.d.ts +54 -0
- package/dist/src/identity/wrappers.d.ts.map +1 -0
- package/dist/src/identity/wrappers.js +95 -0
- package/dist/src/identity/wrappers.js.map +1 -0
- package/dist/src/runtime/app.d.ts +144 -0
- package/dist/src/runtime/app.d.ts.map +1 -0
- package/dist/src/runtime/app.js +485 -0
- package/dist/src/runtime/app.js.map +1 -0
- package/dist/src/runtime/client.d.ts +154 -0
- package/dist/src/runtime/client.d.ts.map +1 -0
- package/dist/src/runtime/client.js +319 -0
- package/dist/src/runtime/client.js.map +1 -0
- package/dist/src/runtime/context.d.ts +33 -0
- package/dist/src/runtime/context.d.ts.map +1 -0
- package/dist/src/runtime/context.js +49 -0
- package/dist/src/runtime/context.js.map +1 -0
- package/dist/src/runtime/index.d.ts +8 -0
- package/dist/src/runtime/index.d.ts.map +1 -0
- package/dist/src/runtime/index.js +7 -0
- package/dist/src/runtime/index.js.map +1 -0
- package/dist/src/runtime/types.d.ts +429 -0
- package/dist/src/runtime/types.d.ts.map +1 -0
- package/dist/src/runtime/types.js +26 -0
- package/dist/src/runtime/types.js.map +1 -0
- package/dist/src/tools/browser/client.d.ts +19 -0
- package/dist/src/tools/browser/client.d.ts.map +1 -1
- package/dist/src/tools/browser/client.js +56 -0
- package/dist/src/tools/browser/client.js.map +1 -1
- package/dist/src/tools/browser/index.d.ts +1 -1
- package/dist/src/tools/browser/index.d.ts.map +1 -1
- package/dist/src/tools/browser/index.js.map +1 -1
- package/dist/src/tools/browser/integrations/strands/click-tool.d.ts +20 -0
- package/dist/src/tools/browser/integrations/strands/click-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/click-tool.js +33 -0
- package/dist/src/tools/browser/integrations/strands/click-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/evaluate-tool.d.ts +20 -0
- package/dist/src/tools/browser/integrations/strands/evaluate-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/evaluate-tool.js +34 -0
- package/dist/src/tools/browser/integrations/strands/evaluate-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/get-html-tool.d.ts +19 -0
- package/dist/src/tools/browser/integrations/strands/get-html-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/get-html-tool.js +32 -0
- package/dist/src/tools/browser/integrations/strands/get-html-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/get-text-tool.d.ts +19 -0
- package/dist/src/tools/browser/integrations/strands/get-text-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/get-text-tool.js +32 -0
- package/dist/src/tools/browser/integrations/strands/get-text-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/index.d.ts +25 -0
- package/dist/src/tools/browser/integrations/strands/index.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/index.js +25 -0
- package/dist/src/tools/browser/integrations/strands/index.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/navigate-tool.d.ts +21 -0
- package/dist/src/tools/browser/integrations/strands/navigate-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/navigate-tool.js +41 -0
- package/dist/src/tools/browser/integrations/strands/navigate-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/screenshot-tool.d.ts +29 -0
- package/dist/src/tools/browser/integrations/strands/screenshot-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/screenshot-tool.js +52 -0
- package/dist/src/tools/browser/integrations/strands/screenshot-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/tools.d.ts +119 -0
- package/dist/src/tools/browser/integrations/strands/tools.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/tools.js +141 -0
- package/dist/src/tools/browser/integrations/strands/tools.js.map +1 -0
- package/dist/src/tools/browser/integrations/strands/type-tool.d.ts +22 -0
- package/dist/src/tools/browser/integrations/strands/type-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/strands/type-tool.js +37 -0
- package/dist/src/tools/browser/integrations/strands/type-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/tools.d.ts +1 -1
- package/dist/src/tools/browser/integrations/vercel-ai/tools.js +1 -1
- package/dist/src/tools/browser/live-view/BrowserLiveView.d.ts +10 -0
- package/dist/src/tools/browser/live-view/BrowserLiveView.d.ts.map +1 -0
- package/dist/src/tools/browser/live-view/BrowserLiveView.js +180 -0
- package/dist/src/tools/browser/live-view/BrowserLiveView.js.map +1 -0
- package/dist/src/tools/browser/live-view/index.d.ts +4 -0
- package/dist/src/tools/browser/live-view/index.d.ts.map +1 -0
- package/dist/src/tools/browser/live-view/index.js +3 -0
- package/dist/src/tools/browser/live-view/index.js.map +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/README.md +26 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/EULA.txt +403 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/README.md +57 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/dcv-ui.js +7 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/third-party-licenses.txt +145 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/EULA.txt +403 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/README.md +50 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/broadwayh264decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/jsmpegdecoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/lz4decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/microphoneprocessor.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv.js +33 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/lib/broadway/Decoder.js +850 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/lib/jsmpeg/jsmpeg.min.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/lib/lz4/lz4_decoder.js +12 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/third-party-licenses.txt +1068 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/EULA.txt +403 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/README.md +50 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/broadwayh264decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/jsmpegdecoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/lz4decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/microphoneprocessor.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv.js +33 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/lib/broadway/Decoder.js +850 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/lib/jsmpeg/jsmpeg.min.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/lib/lz4/lz4_decoder.js +12 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/third-party-licenses.txt +1068 -0
- package/dist/src/tools/browser/live-view/scaling.d.ts +9 -0
- package/dist/src/tools/browser/live-view/scaling.d.ts.map +1 -0
- package/dist/src/tools/browser/live-view/scaling.js +13 -0
- package/dist/src/tools/browser/live-view/scaling.js.map +1 -0
- package/dist/src/tools/browser/types.d.ts +152 -0
- package/dist/src/tools/browser/types.d.ts.map +1 -1
- package/dist/src/tools/code-interpreter/client.d.ts +2 -0
- package/dist/src/tools/code-interpreter/client.d.ts.map +1 -1
- package/dist/src/tools/code-interpreter/client.js +31 -25
- package/dist/src/tools/code-interpreter/client.js.map +1 -1
- package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.d.ts +28 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.js +47 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.d.ts +27 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.js +42 -0
- package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.d.ts +33 -0
- package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.js +78 -0
- package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/index.d.ts +32 -0
- package/dist/src/tools/code-interpreter/integrations/strands/index.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/index.js +32 -0
- package/dist/src/tools/code-interpreter/integrations/strands/index.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/tools.d.ts +94 -0
- package/dist/src/tools/code-interpreter/integrations/strands/tools.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/strands/tools.js +112 -0
- package/dist/src/tools/code-interpreter/integrations/strands/tools.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.d.ts +2 -2
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.js +2 -2
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.d.ts +2 -2
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.js +2 -2
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.d.ts +3 -3
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.js +2 -2
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.d.ts +1 -1
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.js +1 -1
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.d.ts +1 -1
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.js +1 -1
- package/package.json +69 -14
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified BrowserTools for Strands SDK
|
|
3
|
+
*
|
|
4
|
+
* Provides browser automation tools and session management in one class.
|
|
5
|
+
* Thin wrapper around PlaywrightBrowser - all logic lives in the Playwright integration.
|
|
6
|
+
*/
|
|
7
|
+
import { PlaywrightBrowser } from '../playwright/client.js';
|
|
8
|
+
import { createNavigateTool } from './navigate-tool.js';
|
|
9
|
+
import { createClickTool } from './click-tool.js';
|
|
10
|
+
import { createTypeTool } from './type-tool.js';
|
|
11
|
+
import { createGetTextTool } from './get-text-tool.js';
|
|
12
|
+
import { createGetHtmlTool } from './get-html-tool.js';
|
|
13
|
+
import { createScreenshotTool } from './screenshot-tool.js';
|
|
14
|
+
import { createEvaluateTool } from './evaluate-tool.js';
|
|
15
|
+
/**
|
|
16
|
+
* BrowserTools - All-in-one browser automation for Strands SDK
|
|
17
|
+
*
|
|
18
|
+
* Provides browser automation tools and session management.
|
|
19
|
+
* All browser logic is in PlaywrightBrowser - this is just a thin wrapper.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { BrowserTools } from 'bedrock-agentcore/experimental/browser/strands'
|
|
24
|
+
* import { Agent, BedrockModel } from '@strands-agents/sdk'
|
|
25
|
+
*
|
|
26
|
+
* // Create tools instance
|
|
27
|
+
* const browser = new BrowserTools({ region: 'us-west-2' })
|
|
28
|
+
*
|
|
29
|
+
* // Start session (optional - automatically started on first use)
|
|
30
|
+
* await browser.startSession()
|
|
31
|
+
*
|
|
32
|
+
* // Create agent with browser tools
|
|
33
|
+
* const agent = new Agent({
|
|
34
|
+
* model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
|
|
35
|
+
* tools: browser.tools,
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* // Or use client directly
|
|
39
|
+
* await browser.getClient().navigate({ url: 'https://example.com' })
|
|
40
|
+
*
|
|
41
|
+
* // Clean up when done
|
|
42
|
+
* await browser.stopSession()
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export class BrowserTools {
|
|
46
|
+
client;
|
|
47
|
+
/**
|
|
48
|
+
* Tool for navigating to URLs
|
|
49
|
+
*/
|
|
50
|
+
navigate;
|
|
51
|
+
/**
|
|
52
|
+
* Tool for clicking elements
|
|
53
|
+
*/
|
|
54
|
+
click;
|
|
55
|
+
/**
|
|
56
|
+
* Tool for typing text
|
|
57
|
+
*/
|
|
58
|
+
type;
|
|
59
|
+
/**
|
|
60
|
+
* Tool for getting text content
|
|
61
|
+
*/
|
|
62
|
+
getText;
|
|
63
|
+
/**
|
|
64
|
+
* Tool for getting HTML
|
|
65
|
+
*/
|
|
66
|
+
getHtml;
|
|
67
|
+
/**
|
|
68
|
+
* Tool for taking screenshots
|
|
69
|
+
*/
|
|
70
|
+
screenshot;
|
|
71
|
+
/**
|
|
72
|
+
* Tool for evaluating JavaScript
|
|
73
|
+
*/
|
|
74
|
+
evaluate;
|
|
75
|
+
/**
|
|
76
|
+
* All tools in an array for easy spreading into agent config
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const agent = new Agent({
|
|
81
|
+
* tools: browser.tools, // spreads all browser tools
|
|
82
|
+
* })
|
|
83
|
+
*
|
|
84
|
+
* // Or combine with other tools
|
|
85
|
+
* const agent = new Agent({
|
|
86
|
+
* tools: [...codeInterpreter.tools, ...browser.tools],
|
|
87
|
+
* })
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
tools;
|
|
91
|
+
constructor(config = {}) {
|
|
92
|
+
this.client = new PlaywrightBrowser(config);
|
|
93
|
+
// Create all tools - each is a thin wrapper around client methods
|
|
94
|
+
this.navigate = createNavigateTool(this.client);
|
|
95
|
+
this.click = createClickTool(this.client);
|
|
96
|
+
this.type = createTypeTool(this.client);
|
|
97
|
+
this.getText = createGetTextTool(this.client);
|
|
98
|
+
this.getHtml = createGetHtmlTool(this.client);
|
|
99
|
+
this.screenshot = createScreenshotTool(this.client);
|
|
100
|
+
this.evaluate = createEvaluateTool(this.client);
|
|
101
|
+
// Create tools array for Strands SDK (uses arrays, not objects)
|
|
102
|
+
this.tools = [this.navigate, this.click, this.type, this.getText, this.getHtml, this.screenshot, this.evaluate];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Start a browser session
|
|
106
|
+
*
|
|
107
|
+
* Sessions are automatically started on first tool use, but you can
|
|
108
|
+
* call this explicitly to start the session upfront.
|
|
109
|
+
*
|
|
110
|
+
* @param sessionName - Optional session name for AWS
|
|
111
|
+
* @param timeout - Optional session timeout in seconds (default: 3600, max: 28800)
|
|
112
|
+
* @returns Session information
|
|
113
|
+
*/
|
|
114
|
+
async startSession(sessionName, timeout) {
|
|
115
|
+
const params = {};
|
|
116
|
+
if (sessionName !== undefined)
|
|
117
|
+
params.sessionName = sessionName;
|
|
118
|
+
if (timeout !== undefined)
|
|
119
|
+
params.timeout = timeout;
|
|
120
|
+
return this.client.startSession(Object.keys(params).length > 0 ? params : undefined);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Stop the current browser session
|
|
124
|
+
*
|
|
125
|
+
* Call this when you're done using the tools to clean up resources.
|
|
126
|
+
*/
|
|
127
|
+
async stopSession() {
|
|
128
|
+
await this.client.stopSession();
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get the underlying PlaywrightBrowser
|
|
132
|
+
*
|
|
133
|
+
* Provides direct access to the client for advanced use cases.
|
|
134
|
+
*
|
|
135
|
+
* @returns The PlaywrightBrowser instance
|
|
136
|
+
*/
|
|
137
|
+
getClient() {
|
|
138
|
+
return this.client;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../../../src/tools/browser/integrations/strands/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,e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AAC,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAE/C,gEAAgE;QAChE,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACjH,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,YAAY,CAAC,WAAoB,EAAE,OAAgB;QACvD,MAAM,MAAM,GAAuB,EAAE,CAAA;QACrC,IAAI,WAAW,KAAK,SAAS;YAAE,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;QAC/D,IAAI,OAAO,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;QACnD,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACtF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAA;IACjC,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PlaywrightBrowser } from '../playwright/client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Strands SDK tool for typing text.
|
|
4
|
+
* Thin wrapper around PlaywrightBrowser.type()
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare function createTypeTool(client: PlaywrightBrowser): import("@strands-agents/sdk").InvokableTool<{
|
|
9
|
+
selector: string;
|
|
10
|
+
text: string;
|
|
11
|
+
delay?: number | undefined;
|
|
12
|
+
timeout?: number | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
success: true;
|
|
15
|
+
message: string;
|
|
16
|
+
error?: never;
|
|
17
|
+
} | {
|
|
18
|
+
success: false;
|
|
19
|
+
error: string;
|
|
20
|
+
message?: never;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=type-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-tool.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/browser/integrations/strands/type-tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAEhE;;;;;GAKG;AAEH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB;;;;;;;;;;;;;GAuBvD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { tool } from '@strands-agents/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a Strands SDK tool for typing text.
|
|
5
|
+
* Thin wrapper around PlaywrightBrowser.type()
|
|
6
|
+
*
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/explicit-module-boundary-types
|
|
10
|
+
export function createTypeTool(client) {
|
|
11
|
+
return tool({
|
|
12
|
+
name: 'type',
|
|
13
|
+
description: 'Type text into an input element',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
selector: z.string().describe('CSS selector for the input element'),
|
|
16
|
+
text: z.string().describe('Text to type'),
|
|
17
|
+
delay: z.number().positive().optional().describe('Time to wait between key presses in milliseconds'),
|
|
18
|
+
timeout: z.number().positive().optional().describe('Maximum time in milliseconds'),
|
|
19
|
+
}),
|
|
20
|
+
callback: async ({ selector, text, delay, timeout }) => {
|
|
21
|
+
try {
|
|
22
|
+
const params = { selector, text };
|
|
23
|
+
if (delay !== undefined)
|
|
24
|
+
params.delay = delay;
|
|
25
|
+
if (timeout !== undefined)
|
|
26
|
+
params.timeout = timeout;
|
|
27
|
+
await client.type(params);
|
|
28
|
+
return { success: true, message: `Typed text into ${selector}` };
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
32
|
+
return { success: false, error: message };
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=type-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-tool.js","sourceRoot":"","sources":["../../../../../../src/tools/browser/integrations/strands/type-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;GAKG;AACH,+HAA+H;AAC/H,MAAM,UAAU,cAAc,CAAC,MAAyB;IACtD,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;YACnE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;YACpG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;SACnF,CAAC;QACF,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;YACrD,IAAI,CAAC;gBACH,MAAM,MAAM,GAAyE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;gBACvG,IAAI,KAAK,KAAK,SAAS;oBAAE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;gBAC7C,IAAI,OAAO,KAAK,SAAS;oBAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;gBACnD,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACzB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,QAAQ,EAAE,EAAE,CAAA;YAClE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAA;gBACxE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;YAC3C,CAAC;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -21,7 +21,7 @@ import { createEvaluateTool } from './evaluate-tool.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```typescript
|
|
24
|
-
* import { BrowserTools } from '
|
|
24
|
+
* import { BrowserTools } from 'bedrock-agentcore/browser/vercel-ai'
|
|
25
25
|
* import { ToolLoopAgent } from 'ai'
|
|
26
26
|
* import { bedrock } from '@ai-sdk/amazon-bedrock'
|
|
27
27
|
*
|
|
@@ -20,7 +20,7 @@ import { createEvaluateTool } from './evaluate-tool.js';
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* import { BrowserTools } from '
|
|
23
|
+
* import { BrowserTools } from 'bedrock-agentcore/browser/vercel-ai'
|
|
24
24
|
* import { ToolLoopAgent } from 'ai'
|
|
25
25
|
* import { bedrock } from '@ai-sdk/amazon-bedrock'
|
|
26
26
|
*
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BrowserLiveViewProps {
|
|
2
|
+
/** Required. SigV4-presigned DCV live-view URL. */
|
|
3
|
+
signedUrl: string;
|
|
4
|
+
/** Remote desktop width — should match viewPort.width from StartSession. Default: 1920. */
|
|
5
|
+
remoteWidth?: number;
|
|
6
|
+
/** Remote desktop height — should match viewPort.height from StartSession. Default: 1080. */
|
|
7
|
+
remoteHeight?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const BrowserLiveView: ({ signedUrl: externalSignedUrl, remoteWidth, remoteHeight, }: BrowserLiveViewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=BrowserLiveView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserLiveView.d.ts","sourceRoot":"","sources":["../../../../../src/tools/browser/live-view/BrowserLiveView.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAA;IACjB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6FAA6F;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAgBD,eAAO,MAAM,eAAe,GAAI,8DAI7B,oBAAoB,mDA6MtB,CAAA"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/// <reference lib="dom" />
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import dcv from 'dcv';
|
|
5
|
+
import { DCVViewer } from 'dcv-ui';
|
|
6
|
+
import { calculateScale } from './scaling.js';
|
|
7
|
+
const authStateMap = new Map();
|
|
8
|
+
const DEFAULT_REMOTE_WIDTH = 1920;
|
|
9
|
+
const DEFAULT_REMOTE_HEIGHT = 1080;
|
|
10
|
+
export const BrowserLiveView = ({ signedUrl: externalSignedUrl, remoteWidth = DEFAULT_REMOTE_WIDTH, remoteHeight = DEFAULT_REMOTE_HEIGHT, }) => {
|
|
11
|
+
const cached = authStateMap.get(externalSignedUrl);
|
|
12
|
+
const [dcvError, setDcvError] = useState(null);
|
|
13
|
+
const [authenticated, setAuthenticated] = useState(() => cached?.authenticated ?? false);
|
|
14
|
+
const [sessionId, setSessionId] = useState(() => cached?.sessionId ?? '');
|
|
15
|
+
const [authToken, setAuthToken] = useState(() => cached?.authToken ?? '');
|
|
16
|
+
const mountedRef = useRef(true);
|
|
17
|
+
const connectionRef = useRef(null);
|
|
18
|
+
const containerRef = useRef(null);
|
|
19
|
+
const resizeObserverRef = useRef(null);
|
|
20
|
+
const mutationObserverRef = useRef(null);
|
|
21
|
+
// Cleanup on unmount — disconnect DCV connection and observers
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
mountedRef.current = true;
|
|
24
|
+
return () => {
|
|
25
|
+
mountedRef.current = false;
|
|
26
|
+
connectionRef.current?.disconnect();
|
|
27
|
+
resizeObserverRef.current?.disconnect();
|
|
28
|
+
mutationObserverRef.current?.disconnect();
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
const onPromptCredentials = useCallback(() => { }, []);
|
|
32
|
+
const httpExtraSearchParamsCb = useCallback((_conn) => {
|
|
33
|
+
if (!externalSignedUrl)
|
|
34
|
+
return new URLSearchParams();
|
|
35
|
+
return new URL(externalSignedUrl).searchParams;
|
|
36
|
+
}, [externalSignedUrl]);
|
|
37
|
+
const onError = useCallback((_authObj, _error) => {
|
|
38
|
+
const state = authStateMap.get(externalSignedUrl);
|
|
39
|
+
if (state)
|
|
40
|
+
state.authenticating = false;
|
|
41
|
+
}, [externalSignedUrl]);
|
|
42
|
+
const onSuccess = useCallback((_, result) => {
|
|
43
|
+
const resultObj = result[0] || {};
|
|
44
|
+
const newSessionId = resultObj.sessionId || '';
|
|
45
|
+
const newAuthToken = resultObj.authToken || '';
|
|
46
|
+
authStateMap.set(externalSignedUrl, {
|
|
47
|
+
authenticated: true,
|
|
48
|
+
sessionId: newSessionId,
|
|
49
|
+
authToken: newAuthToken,
|
|
50
|
+
authenticating: false,
|
|
51
|
+
});
|
|
52
|
+
if (mountedRef.current) {
|
|
53
|
+
setSessionId(newSessionId);
|
|
54
|
+
setAuthToken(newAuthToken);
|
|
55
|
+
setDcvError(null);
|
|
56
|
+
setAuthenticated(true);
|
|
57
|
+
}
|
|
58
|
+
}, [externalSignedUrl]);
|
|
59
|
+
const handleDisconnect = useCallback((_reason) => { }, []);
|
|
60
|
+
const authenticate = useCallback(() => {
|
|
61
|
+
const state = authStateMap.get(externalSignedUrl);
|
|
62
|
+
if (!externalSignedUrl || state?.authenticating || state?.authenticated)
|
|
63
|
+
return;
|
|
64
|
+
authStateMap.set(externalSignedUrl, {
|
|
65
|
+
authenticated: false,
|
|
66
|
+
sessionId: '',
|
|
67
|
+
authToken: '',
|
|
68
|
+
authenticating: true,
|
|
69
|
+
});
|
|
70
|
+
try {
|
|
71
|
+
dcv.setLogLevel(dcv.LogLevel.INFO);
|
|
72
|
+
dcv.authenticate(externalSignedUrl, {
|
|
73
|
+
promptCredentials: onPromptCredentials,
|
|
74
|
+
error: onError,
|
|
75
|
+
success: onSuccess,
|
|
76
|
+
httpExtraSearchParams: httpExtraSearchParamsCb,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
const s = authStateMap.get(externalSignedUrl);
|
|
81
|
+
if (s)
|
|
82
|
+
s.authenticating = false;
|
|
83
|
+
if (mountedRef.current) {
|
|
84
|
+
setDcvError(`Authentication error: ${error instanceof Error ? error.message : 'Unknown'}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, [externalSignedUrl, onError, onSuccess, onPromptCredentials, httpExtraSearchParamsCb]);
|
|
88
|
+
// Trigger authentication when URL is ready
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!authenticated && externalSignedUrl && !dcvError)
|
|
91
|
+
authenticate();
|
|
92
|
+
}, [authenticated, externalSignedUrl, authenticate, dcvError]);
|
|
93
|
+
const onConnectionEstablished = useCallback((conn) => {
|
|
94
|
+
connectionRef.current = conn;
|
|
95
|
+
let lastApplyTime = 0;
|
|
96
|
+
const DEBOUNCE_MS = 100;
|
|
97
|
+
const lockDisplayLayout = () => {
|
|
98
|
+
try {
|
|
99
|
+
conn.requestDisplayLayout?.([
|
|
100
|
+
{
|
|
101
|
+
name: 'Main Display',
|
|
102
|
+
rect: { x: 0, y: 0, width: remoteWidth, height: remoteHeight },
|
|
103
|
+
primary: true,
|
|
104
|
+
},
|
|
105
|
+
]);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// requestDisplayLayout may not be available yet
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const applyScaling = () => {
|
|
112
|
+
const container = containerRef.current;
|
|
113
|
+
if (!container)
|
|
114
|
+
return;
|
|
115
|
+
const { width: w, height: h } = container.getBoundingClientRect();
|
|
116
|
+
const cw = Math.floor(w);
|
|
117
|
+
const ch = Math.floor(h);
|
|
118
|
+
if (cw <= 0 || ch <= 0)
|
|
119
|
+
return;
|
|
120
|
+
lastApplyTime = Date.now();
|
|
121
|
+
const dcvContainer = container.querySelector('#dcv-container');
|
|
122
|
+
if (dcvContainer) {
|
|
123
|
+
Object.assign(dcvContainer.style, { width: `${cw}px`, height: `${ch}px`, overflow: 'hidden' });
|
|
124
|
+
}
|
|
125
|
+
const dcvDisplay = container.querySelector('#dcv-display');
|
|
126
|
+
if (dcvDisplay) {
|
|
127
|
+
const { scale, offsetX } = calculateScale(cw, ch, remoteWidth, remoteHeight);
|
|
128
|
+
Object.assign(dcvDisplay.style, {
|
|
129
|
+
width: `${remoteWidth}px`,
|
|
130
|
+
height: `${remoteHeight}px`,
|
|
131
|
+
transformOrigin: 'top left',
|
|
132
|
+
position: 'absolute',
|
|
133
|
+
top: '0',
|
|
134
|
+
transform: `scale(${scale})`,
|
|
135
|
+
left: `${offsetX}px`,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
lockDisplayLayout();
|
|
139
|
+
};
|
|
140
|
+
const setupMutationObserver = () => {
|
|
141
|
+
const container = containerRef.current;
|
|
142
|
+
const dcvDisplay = container?.querySelector('#dcv-display');
|
|
143
|
+
if (!dcvDisplay)
|
|
144
|
+
return;
|
|
145
|
+
mutationObserverRef.current?.disconnect();
|
|
146
|
+
mutationObserverRef.current = new MutationObserver(() => {
|
|
147
|
+
if (Date.now() - lastApplyTime < DEBOUNCE_MS)
|
|
148
|
+
return;
|
|
149
|
+
applyScaling();
|
|
150
|
+
});
|
|
151
|
+
mutationObserverRef.current.observe(dcvDisplay, { attributes: true, attributeFilter: ['style'] });
|
|
152
|
+
};
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
applyScaling();
|
|
155
|
+
setupMutationObserver();
|
|
156
|
+
}, 200);
|
|
157
|
+
if (containerRef.current && !resizeObserverRef.current) {
|
|
158
|
+
resizeObserverRef.current = new ResizeObserver(applyScaling);
|
|
159
|
+
resizeObserverRef.current.observe(containerRef.current);
|
|
160
|
+
}
|
|
161
|
+
}, [remoteWidth, remoteHeight]);
|
|
162
|
+
if (dcvError) {
|
|
163
|
+
return _jsxs("div", { style: { color: 'red', padding: '20px' }, children: ["DCV Error: ", dcvError] });
|
|
164
|
+
}
|
|
165
|
+
if (!authenticated)
|
|
166
|
+
return null;
|
|
167
|
+
return (_jsx("div", { ref: containerRef, style: { width: '100%', height: '100%', position: 'relative', overflow: 'hidden' }, children: _jsx(DCVViewer, { dcv: {
|
|
168
|
+
sessionId,
|
|
169
|
+
authToken,
|
|
170
|
+
serverUrl: externalSignedUrl,
|
|
171
|
+
baseUrl: '/nice-dcv-web-client-sdk/dcvjs-esm',
|
|
172
|
+
onDisconnect: handleDisconnect,
|
|
173
|
+
onConnectionEstablished,
|
|
174
|
+
logLevel: dcv.LogLevel.INFO,
|
|
175
|
+
observers: { httpExtraSearchParams: httpExtraSearchParamsCb },
|
|
176
|
+
}, uiConfig: {
|
|
177
|
+
toolbar: { visible: false, fullscreenButton: false, multimonitorButton: false },
|
|
178
|
+
} }) }));
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=BrowserLiveView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserLiveView.js","sourceRoot":"","sources":["../../../../../src/tools/browser/live-view/BrowserLiveView.tsx"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAoB7C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAqB,CAAA;AAEjD,MAAM,oBAAoB,GAAG,IAAI,CAAA;AACjC,MAAM,qBAAqB,GAAG,IAAI,CAAA;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EAAE,iBAAiB,EAC5B,WAAW,GAAG,oBAAoB,EAClC,YAAY,GAAG,qBAAqB,GACf,EAAE,EAAE;IACzB,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAClD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IAC7D,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,aAAa,IAAI,KAAK,CAAC,CAAA;IACxF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAA;IACzE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,C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C,EACD,CAAC,WAAW,EAAE,YAAY,CAAC,CAC5B,CAAA;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,eAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,4BAAc,QAAQ,IAAO,CAAA;IACnF,CAAC;IAED,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAE/B,OAAO,CACL,cAAK,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,YACxG,KAAC,SAAS,IACR,GAAG,EAAE;gBACH,SAAS;gBACT,SAAS;gBACT,SAAS,EAAE,iBAAiB;gBAC5B,OAAO,EAAE,oCAAoC;gBAC7C,YAAY,EAAE,gBAAgB;gBAC9B,uBAAuB;gBACvB,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI;gBAC3B,SAAS,EAAE,EAAE,qBAAqB,EAAE,uBAAuB,EAAE;aAC9D,EACD,QAAQ,EAAE;gBACR,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE;aAChF,GACD,GACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tools/browser/live-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tools/browser/live-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Amazon DCV Web SDK
|
|
2
|
+
|
|
3
|
+
## Amazon DCV
|
|
4
|
+
|
|
5
|
+
Amazon DCV is a high-performance remote display protocol. It lets you securely deliver
|
|
6
|
+
remote desktops and application streaming from any cloud or data center to any device,
|
|
7
|
+
over varying network conditions. By using Amazon DCV with Amazon EC2, you can run graphics-intensive
|
|
8
|
+
applications remotely on Amazon EC2 instances. You can then stream the results to
|
|
9
|
+
more modest client machines, which eliminates the need for expensive dedicated workstations.
|
|
10
|
+
|
|
11
|
+
## Amazon DCV Web Client SDK
|
|
12
|
+
|
|
13
|
+
The Amazon DCV Web Client SDK is a JavaScript library that you can use to develop your
|
|
14
|
+
own Amazon DCV web browser client applications. Your end users can use these applications
|
|
15
|
+
to connect to and interact with a running Amazon DCV session.
|
|
16
|
+
|
|
17
|
+
This library is exported in both ESM and UMD formats within the corresponding folders.
|
|
18
|
+
|
|
19
|
+
## Amazon DCV Web UI SDK
|
|
20
|
+
|
|
21
|
+
The Amazon DCV Web UI SDK is a JavaScript library exposing a single React component that
|
|
22
|
+
provides the user interface to interact with the Amazon DCV Web Client in-session experience.
|
|
23
|
+
|
|
24
|
+
Users are still responsible for the authentication against the Amazon DCV Server,
|
|
25
|
+
before connecting to a Amazon DCV session and use the `DCVViewer` React component.
|
|
26
|
+
Hence, users of this library should also import the Amazon DCV Web Client SDK in their React applications.
|