bedrock-agentcore 0.0.1 → 0.2.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/LICENSE +202 -0
- package/README.md +131 -9
- 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 +125 -0
- package/dist/src/tools/browser/client.d.ts.map +1 -0
- package/dist/src/tools/browser/client.js +320 -0
- package/dist/src/tools/browser/client.js.map +1 -0
- package/dist/src/tools/browser/index.d.ts +4 -0
- package/dist/src/tools/browser/index.d.ts.map +1 -0
- package/dist/src/tools/browser/index.js +3 -0
- package/dist/src/tools/browser/index.js.map +1 -0
- package/dist/src/tools/browser/integrations/playwright/client.d.ts +147 -0
- package/dist/src/tools/browser/integrations/playwright/client.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/playwright/client.js +324 -0
- package/dist/src/tools/browser/integrations/playwright/client.js.map +1 -0
- package/dist/src/tools/browser/integrations/playwright/index.d.ts +20 -0
- package/dist/src/tools/browser/integrations/playwright/index.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/playwright/index.js +19 -0
- package/dist/src/tools/browser/integrations/playwright/index.js.map +1 -0
- package/dist/src/tools/browser/integrations/playwright/types.d.ts +169 -0
- package/dist/src/tools/browser/integrations/playwright/types.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/playwright/types.js +2 -0
- package/dist/src/tools/browser/integrations/playwright/types.js.map +1 -0
- 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/click-tool.d.ts +18 -0
- package/dist/src/tools/browser/integrations/vercel-ai/click-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/click-tool.js +31 -0
- package/dist/src/tools/browser/integrations/vercel-ai/click-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/evaluate-tool.d.ts +18 -0
- package/dist/src/tools/browser/integrations/vercel-ai/evaluate-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/evaluate-tool.js +32 -0
- package/dist/src/tools/browser/integrations/vercel-ai/evaluate-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-html-tool.d.ts +17 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-html-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-html-tool.js +30 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-html-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-text-tool.d.ts +17 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-text-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-text-tool.js +30 -0
- package/dist/src/tools/browser/integrations/vercel-ai/get-text-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/index.d.ts +19 -0
- package/dist/src/tools/browser/integrations/vercel-ai/index.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/index.js +19 -0
- package/dist/src/tools/browser/integrations/vercel-ai/index.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/navigate-tool.d.ts +19 -0
- package/dist/src/tools/browser/integrations/vercel-ai/navigate-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/navigate-tool.js +39 -0
- package/dist/src/tools/browser/integrations/vercel-ai/navigate-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/screenshot-tool.d.ts +22 -0
- package/dist/src/tools/browser/integrations/vercel-ai/screenshot-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/screenshot-tool.js +44 -0
- package/dist/src/tools/browser/integrations/vercel-ai/screenshot-tool.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/tools.d.ts +123 -0
- package/dist/src/tools/browser/integrations/vercel-ai/tools.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/tools.js +145 -0
- package/dist/src/tools/browser/integrations/vercel-ai/tools.js.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/type-tool.d.ts +20 -0
- package/dist/src/tools/browser/integrations/vercel-ai/type-tool.d.ts.map +1 -0
- package/dist/src/tools/browser/integrations/vercel-ai/type-tool.js +35 -0
- package/dist/src/tools/browser/integrations/vercel-ai/type-tool.js.map +1 -0
- package/dist/src/tools/browser/types.d.ts +336 -0
- package/dist/src/tools/browser/types.d.ts.map +1 -0
- package/dist/src/tools/browser/types.js +17 -0
- package/dist/src/tools/browser/types.js.map +1 -0
- package/dist/src/tools/code-interpreter/client.d.ts +214 -0
- package/dist/src/tools/code-interpreter/client.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/client.js +518 -0
- package/dist/src/tools/code-interpreter/client.js.map +1 -0
- package/dist/src/tools/code-interpreter/index.d.ts +4 -0
- package/dist/src/tools/code-interpreter/index.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/index.js +5 -0
- package/dist/src/tools/code-interpreter/index.js.map +1 -0
- 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 +27 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.js +46 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.d.ts +26 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.js +41 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.d.ts +32 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.js +77 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.d.ts +26 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.js +26 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.js.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.d.ts +94 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.js +112 -0
- package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.js.map +1 -0
- package/dist/src/tools/code-interpreter/types.d.ts +473 -0
- package/dist/src/tools/code-interpreter/types.d.ts.map +1 -0
- package/dist/src/tools/code-interpreter/types.js +52 -0
- package/dist/src/tools/code-interpreter/types.js.map +1 -0
- package/package.json +134 -12
- package/index.js +0 -4
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BedrockAgentCoreClientConfig } from '@aws-sdk/client-bedrock-agentcore';
|
|
3
|
+
import type { AwsCredentialIdentityProvider } from '@aws-sdk/types';
|
|
4
|
+
/**
|
|
5
|
+
* Default AWS region.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_REGION = "us-west-2";
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for the CodeInterpreter client.
|
|
10
|
+
*/
|
|
11
|
+
export interface CodeInterpreterConfig {
|
|
12
|
+
/**
|
|
13
|
+
* AWS region where the code interpreter service is available.
|
|
14
|
+
* Defaults to process.env.AWS_REGION or 'us-west-2'.
|
|
15
|
+
*/
|
|
16
|
+
region?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Code interpreter identifier.
|
|
19
|
+
* Defaults to 'aws.codeinterpreter.v1'
|
|
20
|
+
*/
|
|
21
|
+
identifier?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional AWS credentials provider.
|
|
24
|
+
* When omitted, the SDK uses the default Node.js credential provider chain.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* Using Vercel OIDC credentials:
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { vercelOidcAwsCredentials } from '\@vercel/oidc-aws-credentials-provider'
|
|
30
|
+
*
|
|
31
|
+
* const interpreter = new CodeInterpreter(\{
|
|
32
|
+
* region: process.env.AWS_REGION || 'us-west-2',
|
|
33
|
+
* credentialsProvider: vercelOidcAwsCredentials()
|
|
34
|
+
* \})
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
credentialsProvider?: AwsCredentialIdentityProvider;
|
|
38
|
+
/**
|
|
39
|
+
* Optional AWS SDK client configuration for advanced use cases.
|
|
40
|
+
*/
|
|
41
|
+
clientConfig?: Partial<BedrockAgentCoreClientConfig>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parameters for starting a code interpreter session.
|
|
45
|
+
*/
|
|
46
|
+
export interface StartSessionParams {
|
|
47
|
+
/**
|
|
48
|
+
* Name for the session. Auto-generated if omitted.
|
|
49
|
+
*/
|
|
50
|
+
sessionName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Human-readable description of the session purpose.
|
|
53
|
+
*/
|
|
54
|
+
description?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Session timeout in seconds.
|
|
57
|
+
* Defaults to 900
|
|
58
|
+
*/
|
|
59
|
+
timeout?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Information about an active code interpreter session.
|
|
63
|
+
*/
|
|
64
|
+
export interface SessionInfo {
|
|
65
|
+
/**
|
|
66
|
+
* Local name for the session.
|
|
67
|
+
*/
|
|
68
|
+
sessionName: string;
|
|
69
|
+
/**
|
|
70
|
+
* AWS-assigned session identifier.
|
|
71
|
+
*/
|
|
72
|
+
sessionId: string;
|
|
73
|
+
/**
|
|
74
|
+
* Session description.
|
|
75
|
+
*/
|
|
76
|
+
description?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Timestamp when session was created.
|
|
79
|
+
*/
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Parameters for getting session details.
|
|
84
|
+
*/
|
|
85
|
+
export interface GetSessionParams {
|
|
86
|
+
/**
|
|
87
|
+
* Code interpreter identifier.
|
|
88
|
+
* Uses current instance identifier if not provided.
|
|
89
|
+
*/
|
|
90
|
+
interpreterId?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Session ID to query.
|
|
93
|
+
* Uses current active session ID if not provided.
|
|
94
|
+
*/
|
|
95
|
+
sessionId?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Detailed session information returned by getSession.
|
|
99
|
+
*/
|
|
100
|
+
export interface GetSessionResponse {
|
|
101
|
+
/**
|
|
102
|
+
* AWS-assigned session identifier.
|
|
103
|
+
*/
|
|
104
|
+
sessionId: string;
|
|
105
|
+
/**
|
|
106
|
+
* Code interpreter identifier.
|
|
107
|
+
*/
|
|
108
|
+
codeInterpreterIdentifier: string;
|
|
109
|
+
/**
|
|
110
|
+
* Session name.
|
|
111
|
+
*/
|
|
112
|
+
name: string;
|
|
113
|
+
/**
|
|
114
|
+
* Session status.
|
|
115
|
+
* Common values: 'READY', 'TERMINATED'
|
|
116
|
+
*/
|
|
117
|
+
status: string;
|
|
118
|
+
/**
|
|
119
|
+
* Timestamp when session was created.
|
|
120
|
+
*/
|
|
121
|
+
createdAt: Date;
|
|
122
|
+
/**
|
|
123
|
+
* Timestamp when session was last updated.
|
|
124
|
+
*/
|
|
125
|
+
lastUpdatedAt: Date;
|
|
126
|
+
/**
|
|
127
|
+
* Session timeout in seconds.
|
|
128
|
+
*/
|
|
129
|
+
sessionTimeoutSeconds: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Parameters for listing sessions.
|
|
133
|
+
*/
|
|
134
|
+
export interface ListSessionsParams {
|
|
135
|
+
/**
|
|
136
|
+
* Code interpreter identifier.
|
|
137
|
+
* Uses current instance identifier if not provided.
|
|
138
|
+
*/
|
|
139
|
+
interpreterId?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Filter by session status.
|
|
142
|
+
* Common values: 'READY', 'TERMINATED'
|
|
143
|
+
*/
|
|
144
|
+
status?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Maximum number of results to return (1-100).
|
|
147
|
+
* Defaults to 10
|
|
148
|
+
*/
|
|
149
|
+
maxResults?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Pagination token for fetching next page of results.
|
|
152
|
+
*/
|
|
153
|
+
nextToken?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Summary information for a session in list results.
|
|
157
|
+
*/
|
|
158
|
+
export interface SessionSummary {
|
|
159
|
+
/**
|
|
160
|
+
* AWS-assigned session identifier.
|
|
161
|
+
*/
|
|
162
|
+
sessionId: string;
|
|
163
|
+
/**
|
|
164
|
+
* Session name.
|
|
165
|
+
*/
|
|
166
|
+
name: string;
|
|
167
|
+
/**
|
|
168
|
+
* Session status.
|
|
169
|
+
* Common values: 'READY', 'TERMINATED'
|
|
170
|
+
*/
|
|
171
|
+
status: string;
|
|
172
|
+
/**
|
|
173
|
+
* Timestamp when session was created.
|
|
174
|
+
*/
|
|
175
|
+
createdAt: Date;
|
|
176
|
+
/**
|
|
177
|
+
* Timestamp when session was last updated.
|
|
178
|
+
*/
|
|
179
|
+
lastUpdatedAt: Date;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Response from listing sessions.
|
|
183
|
+
*/
|
|
184
|
+
export interface ListSessionsResponse {
|
|
185
|
+
/**
|
|
186
|
+
* List of session summaries.
|
|
187
|
+
*/
|
|
188
|
+
items: SessionSummary[];
|
|
189
|
+
/**
|
|
190
|
+
* Token for fetching next page of results.
|
|
191
|
+
* Present if there are more results available.
|
|
192
|
+
*/
|
|
193
|
+
nextToken?: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Supported programming languages for code execution.
|
|
197
|
+
*/
|
|
198
|
+
export type CodeLanguage = 'python' | 'javascript' | 'typescript';
|
|
199
|
+
/**
|
|
200
|
+
* Parameters for executing code in a session.
|
|
201
|
+
*/
|
|
202
|
+
export interface ExecuteCodeParams {
|
|
203
|
+
/**
|
|
204
|
+
* Code to execute.
|
|
205
|
+
*/
|
|
206
|
+
code: string;
|
|
207
|
+
/**
|
|
208
|
+
* Programming language.
|
|
209
|
+
* Defaults to 'python'
|
|
210
|
+
*/
|
|
211
|
+
language?: CodeLanguage;
|
|
212
|
+
/**
|
|
213
|
+
* Clear the execution context before running.
|
|
214
|
+
* Defaults to false
|
|
215
|
+
*/
|
|
216
|
+
clearContext?: boolean;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Result of code execution.
|
|
220
|
+
*/
|
|
221
|
+
export interface ExecuteCodeResult {
|
|
222
|
+
/**
|
|
223
|
+
* Execution status.
|
|
224
|
+
*/
|
|
225
|
+
status: 'success' | 'error';
|
|
226
|
+
/**
|
|
227
|
+
* Standard output from execution.
|
|
228
|
+
*/
|
|
229
|
+
output?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Error message if execution failed.
|
|
232
|
+
*/
|
|
233
|
+
error?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Process exit code.
|
|
236
|
+
*/
|
|
237
|
+
exitCode?: number;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Parameters for executing shell commands.
|
|
241
|
+
*/
|
|
242
|
+
export interface ExecuteCommandParams {
|
|
243
|
+
/**
|
|
244
|
+
* Shell command to execute.
|
|
245
|
+
*/
|
|
246
|
+
command: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Result of command execution.
|
|
250
|
+
*/
|
|
251
|
+
export interface ExecuteCommandResult {
|
|
252
|
+
/**
|
|
253
|
+
* Execution status.
|
|
254
|
+
*/
|
|
255
|
+
status: 'success' | 'error';
|
|
256
|
+
/**
|
|
257
|
+
* Standard output from command.
|
|
258
|
+
*/
|
|
259
|
+
output?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Error message if command failed.
|
|
262
|
+
*/
|
|
263
|
+
error?: string;
|
|
264
|
+
/**
|
|
265
|
+
* Command exit code.
|
|
266
|
+
*/
|
|
267
|
+
exitCode?: number;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Parameters for reading files from sandbox.
|
|
271
|
+
*/
|
|
272
|
+
export interface ReadFilesParams {
|
|
273
|
+
/**
|
|
274
|
+
* Array of file paths to read.
|
|
275
|
+
*/
|
|
276
|
+
paths: string[];
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Content of a file read from sandbox.
|
|
280
|
+
*/
|
|
281
|
+
export interface FileContent {
|
|
282
|
+
/**
|
|
283
|
+
* File path.
|
|
284
|
+
*/
|
|
285
|
+
path: string;
|
|
286
|
+
/**
|
|
287
|
+
* File content as string.
|
|
288
|
+
*/
|
|
289
|
+
content: string;
|
|
290
|
+
/**
|
|
291
|
+
* File size in bytes.
|
|
292
|
+
*/
|
|
293
|
+
size: number;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Result of reading files.
|
|
297
|
+
*/
|
|
298
|
+
export interface ReadFilesResult {
|
|
299
|
+
/**
|
|
300
|
+
* Operation status.
|
|
301
|
+
*/
|
|
302
|
+
status: 'success' | 'error';
|
|
303
|
+
/**
|
|
304
|
+
* Successfully read files.
|
|
305
|
+
*/
|
|
306
|
+
files: FileContent[];
|
|
307
|
+
/**
|
|
308
|
+
* Errors encountered for specific files.
|
|
309
|
+
*/
|
|
310
|
+
errors?: Array<{
|
|
311
|
+
path: string;
|
|
312
|
+
error: string;
|
|
313
|
+
}>;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Parameters for writing files to sandbox.
|
|
317
|
+
*/
|
|
318
|
+
export interface WriteFilesParams {
|
|
319
|
+
/**
|
|
320
|
+
* Array of files to write.
|
|
321
|
+
*/
|
|
322
|
+
files: Array<{
|
|
323
|
+
/**
|
|
324
|
+
* File path.
|
|
325
|
+
*/
|
|
326
|
+
path: string;
|
|
327
|
+
/**
|
|
328
|
+
* File content.
|
|
329
|
+
*/
|
|
330
|
+
content: string;
|
|
331
|
+
}>;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Result of writing files.
|
|
335
|
+
*/
|
|
336
|
+
export interface WriteFilesResult {
|
|
337
|
+
/**
|
|
338
|
+
* Operation status.
|
|
339
|
+
*/
|
|
340
|
+
status: 'success' | 'error';
|
|
341
|
+
/**
|
|
342
|
+
* Paths of successfully written files.
|
|
343
|
+
*/
|
|
344
|
+
written: string[];
|
|
345
|
+
/**
|
|
346
|
+
* Errors encountered for specific files.
|
|
347
|
+
*/
|
|
348
|
+
errors?: Array<{
|
|
349
|
+
path: string;
|
|
350
|
+
error: string;
|
|
351
|
+
}>;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Parameters for listing files in sandbox.
|
|
355
|
+
*/
|
|
356
|
+
export interface ListFilesParams {
|
|
357
|
+
/**
|
|
358
|
+
* Directory path to list.
|
|
359
|
+
* Defaults to '.'
|
|
360
|
+
*/
|
|
361
|
+
path?: string;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Information about a file or directory.
|
|
365
|
+
*/
|
|
366
|
+
export interface FileInfo {
|
|
367
|
+
/**
|
|
368
|
+
* File or directory path.
|
|
369
|
+
*/
|
|
370
|
+
path: string;
|
|
371
|
+
/**
|
|
372
|
+
* Type of entry.
|
|
373
|
+
*/
|
|
374
|
+
type: 'file' | 'directory';
|
|
375
|
+
/**
|
|
376
|
+
* File size in bytes (files only).
|
|
377
|
+
*/
|
|
378
|
+
size?: number;
|
|
379
|
+
/**
|
|
380
|
+
* Last modified timestamp.
|
|
381
|
+
*/
|
|
382
|
+
modified?: Date;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Result of listing files.
|
|
386
|
+
*/
|
|
387
|
+
export interface ListFilesResult {
|
|
388
|
+
/**
|
|
389
|
+
* Operation status.
|
|
390
|
+
*/
|
|
391
|
+
status: 'success' | 'error';
|
|
392
|
+
/**
|
|
393
|
+
* List of files and directories.
|
|
394
|
+
*/
|
|
395
|
+
files: FileInfo[];
|
|
396
|
+
/**
|
|
397
|
+
* Error message if operation failed.
|
|
398
|
+
*/
|
|
399
|
+
error?: string;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Parameters for removing files from sandbox.
|
|
403
|
+
*/
|
|
404
|
+
export interface RemoveFilesParams {
|
|
405
|
+
/**
|
|
406
|
+
* Array of file paths to remove.
|
|
407
|
+
*/
|
|
408
|
+
paths: string[];
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Result of removing files.
|
|
412
|
+
*/
|
|
413
|
+
export interface RemoveFilesResult {
|
|
414
|
+
/**
|
|
415
|
+
* Operation status.
|
|
416
|
+
*/
|
|
417
|
+
status: 'success' | 'error';
|
|
418
|
+
/**
|
|
419
|
+
* Paths of successfully removed files.
|
|
420
|
+
*/
|
|
421
|
+
removed: string[];
|
|
422
|
+
/**
|
|
423
|
+
* Errors encountered for specific files.
|
|
424
|
+
*/
|
|
425
|
+
errors?: Array<{
|
|
426
|
+
path: string;
|
|
427
|
+
error: string;
|
|
428
|
+
}>;
|
|
429
|
+
}
|
|
430
|
+
export declare const CodeLanguageSchema: z.ZodEnum<{
|
|
431
|
+
python: "python";
|
|
432
|
+
javascript: "javascript";
|
|
433
|
+
typescript: "typescript";
|
|
434
|
+
}>;
|
|
435
|
+
export declare const ExecuteCodeParamsSchema: z.ZodObject<{
|
|
436
|
+
code: z.ZodString;
|
|
437
|
+
language: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
438
|
+
python: "python";
|
|
439
|
+
javascript: "javascript";
|
|
440
|
+
typescript: "typescript";
|
|
441
|
+
}>>>;
|
|
442
|
+
}, z.core.$strip>;
|
|
443
|
+
export declare const ExecuteCommandParamsSchema: z.ZodObject<{
|
|
444
|
+
command: z.ZodString;
|
|
445
|
+
}, z.core.$strip>;
|
|
446
|
+
export declare const ReadFilesParamsSchema: z.ZodObject<{
|
|
447
|
+
paths: z.ZodArray<z.ZodString>;
|
|
448
|
+
}, z.core.$strip>;
|
|
449
|
+
export declare const WriteFilesParamsSchema: z.ZodObject<{
|
|
450
|
+
files: z.ZodArray<z.ZodObject<{
|
|
451
|
+
path: z.ZodString;
|
|
452
|
+
content: z.ZodString;
|
|
453
|
+
}, z.core.$strip>>;
|
|
454
|
+
}, z.core.$strip>;
|
|
455
|
+
export declare const ListFilesParamsSchema: z.ZodObject<{
|
|
456
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
457
|
+
}, z.core.$strip>;
|
|
458
|
+
export declare const RemoveFilesParamsSchema: z.ZodObject<{
|
|
459
|
+
paths: z.ZodArray<z.ZodString>;
|
|
460
|
+
}, z.core.$strip>;
|
|
461
|
+
/**
|
|
462
|
+
* Default code interpreter identifier.
|
|
463
|
+
*/
|
|
464
|
+
export declare const DEFAULT_IDENTIFIER = "aws.codeinterpreter.v1";
|
|
465
|
+
/**
|
|
466
|
+
* Default session timeout in seconds.
|
|
467
|
+
*/
|
|
468
|
+
export declare const DEFAULT_TIMEOUT = 900;
|
|
469
|
+
/**
|
|
470
|
+
* Default session name.
|
|
471
|
+
*/
|
|
472
|
+
export declare const DEFAULT_SESSION_NAME = "default";
|
|
473
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/code-interpreter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AACrF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AAMnE;;GAEG;AACH,eAAO,MAAM,cAAc,cAAc,CAAA;AAEz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,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,oBAAoB,YAAY,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// ===========================
|
|
3
|
+
// Configuration
|
|
4
|
+
// ===========================
|
|
5
|
+
/**
|
|
6
|
+
* Default AWS region.
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_REGION = 'us-west-2';
|
|
9
|
+
// ===========================
|
|
10
|
+
// Zod Schemas for Validation
|
|
11
|
+
// ===========================
|
|
12
|
+
export const CodeLanguageSchema = z.enum(['python', 'javascript', 'typescript']);
|
|
13
|
+
export const ExecuteCodeParamsSchema = z.object({
|
|
14
|
+
code: z.string().min(1, 'Code cannot be empty'),
|
|
15
|
+
language: CodeLanguageSchema.optional().default('python'),
|
|
16
|
+
});
|
|
17
|
+
export const ExecuteCommandParamsSchema = z.object({
|
|
18
|
+
command: z.string().min(1, 'Command cannot be empty'),
|
|
19
|
+
});
|
|
20
|
+
export const ReadFilesParamsSchema = z.object({
|
|
21
|
+
paths: z.array(z.string()).min(1, 'At least one path required'),
|
|
22
|
+
});
|
|
23
|
+
export const WriteFilesParamsSchema = z.object({
|
|
24
|
+
files: z
|
|
25
|
+
.array(z.object({
|
|
26
|
+
path: z.string().min(1, 'File path cannot be empty'),
|
|
27
|
+
content: z.string(),
|
|
28
|
+
}))
|
|
29
|
+
.min(1, 'At least one file required'),
|
|
30
|
+
});
|
|
31
|
+
export const ListFilesParamsSchema = z.object({
|
|
32
|
+
path: z.string().optional().default('.'),
|
|
33
|
+
});
|
|
34
|
+
export const RemoveFilesParamsSchema = z.object({
|
|
35
|
+
paths: z.array(z.string()).min(1, 'At least one path required'),
|
|
36
|
+
});
|
|
37
|
+
// ===========================
|
|
38
|
+
// Constants
|
|
39
|
+
// ===========================
|
|
40
|
+
/**
|
|
41
|
+
* Default code interpreter identifier.
|
|
42
|
+
*/
|
|
43
|
+
export const DEFAULT_IDENTIFIER = 'aws.codeinterpreter.v1';
|
|
44
|
+
/**
|
|
45
|
+
* Default session timeout in seconds.
|
|
46
|
+
*/
|
|
47
|
+
export const DEFAULT_TIMEOUT = 900;
|
|
48
|
+
/**
|
|
49
|
+
* Default session name.
|
|
50
|
+
*/
|
|
51
|
+
export const DEFAULT_SESSION_NAME = 'default';
|
|
52
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/code-interpreter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,8BAA8B;AAC9B,gBAAgB;AAChB,8BAA8B;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAA;AAkfzC,8BAA8B;AAC9B,6BAA6B;AAC7B,8BAA8B;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;IAC/C,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;CAC1D,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;CACtD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC;CAChE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC;SACL,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC;QACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;SACA,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC;CACxC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;CACzC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC;CAChE,CAAC,CAAA;AAEF,8BAA8B;AAC9B,YAAY;AACZ,8BAA8B;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,150 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bedrock-agentcore",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "TypeScript SDK for AWS Bedrock AgentCore",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"module": "dist/src/index.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/src/index.js",
|
|
15
|
+
"types": "./dist/src/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./browser": {
|
|
18
|
+
"import": "./dist/src/tools/browser/index.js",
|
|
19
|
+
"types": "./dist/src/tools/browser/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./browser/playwright": {
|
|
22
|
+
"import": "./dist/src/tools/browser/integrations/playwright/index.js",
|
|
23
|
+
"types": "./dist/src/tools/browser/integrations/playwright/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./browser/vercel-ai": {
|
|
26
|
+
"import": "./dist/src/tools/browser/integrations/vercel-ai/index.js",
|
|
27
|
+
"types": "./dist/src/tools/browser/integrations/vercel-ai/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./experimental/browser/strands": {
|
|
30
|
+
"import": "./dist/src/tools/browser/integrations/strands/index.js",
|
|
31
|
+
"types": "./dist/src/tools/browser/integrations/strands/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./code-interpreter": {
|
|
34
|
+
"import": "./dist/src/tools/code-interpreter/index.js",
|
|
35
|
+
"types": "./dist/src/tools/code-interpreter/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./code-interpreter/vercel-ai": {
|
|
38
|
+
"import": "./dist/src/tools/code-interpreter/integrations/vercel-ai/index.js",
|
|
39
|
+
"types": "./dist/src/tools/code-interpreter/integrations/vercel-ai/index.d.ts"
|
|
40
|
+
},
|
|
41
|
+
"./experimental/code-interpreter/strands": {
|
|
42
|
+
"import": "./dist/src/tools/code-interpreter/integrations/strands/index.js",
|
|
43
|
+
"types": "./dist/src/tools/code-interpreter/integrations/strands/index.d.ts"
|
|
44
|
+
},
|
|
45
|
+
"./runtime": {
|
|
46
|
+
"import": "./dist/src/runtime/index.js",
|
|
47
|
+
"types": "./dist/src/runtime/index.d.ts"
|
|
48
|
+
},
|
|
49
|
+
"./identity": {
|
|
50
|
+
"import": "./dist/src/identity/index.js",
|
|
51
|
+
"types": "./dist/src/identity/index.d.ts"
|
|
52
|
+
}
|
|
8
53
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsc",
|
|
56
|
+
"check": "npm run lint && npm run format && npm run type-check:all && npm run test:coverage",
|
|
57
|
+
"clean": "rm -rf node_modules dist package-lock.json",
|
|
58
|
+
"test": "vitest run --project unit-node",
|
|
59
|
+
"test:all": "vitest run --project unit-node && vitest run --project integ",
|
|
60
|
+
"ci": "npm run lint && npm run format:check && npm run type-check:all && npm run build && npm run test:all",
|
|
61
|
+
"test:watch": "vitest --project unit-node",
|
|
62
|
+
"test:coverage": "vitest run --coverage --project unit-node",
|
|
63
|
+
"test:integ": "vitest run --project integ",
|
|
64
|
+
"lint": "eslint src tests_integ",
|
|
65
|
+
"lint:fix": "eslint src tests_integ --fix",
|
|
66
|
+
"format": "prettier --write src tests_integ",
|
|
67
|
+
"format:check": "prettier --check src tests_integ",
|
|
68
|
+
"type-check": "tsc --noEmit",
|
|
69
|
+
"type-check:tests": "tsc --noEmit -p tsconfig.test.json",
|
|
70
|
+
"type-check:all": "npm run type-check && npm run type-check:tests",
|
|
71
|
+
"type-check:watch": "tsc --noEmit --watch",
|
|
72
|
+
"prepare": "npm run build && husky || true"
|
|
12
73
|
},
|
|
13
74
|
"keywords": [
|
|
75
|
+
"aws",
|
|
14
76
|
"bedrock",
|
|
15
77
|
"agentcore",
|
|
16
|
-
"aws",
|
|
17
|
-
"ai",
|
|
18
78
|
"agents",
|
|
79
|
+
"ai",
|
|
19
80
|
"typescript",
|
|
20
81
|
"sdk"
|
|
21
82
|
],
|
|
22
|
-
"author": "
|
|
83
|
+
"author": "Amazon Web Services",
|
|
23
84
|
"license": "Apache-2.0",
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@ai-sdk/amazon-bedrock": "^4.0.0-beta.67",
|
|
87
|
+
"@aws-sdk/client-cognito-identity-provider": "^3.957.0",
|
|
88
|
+
"@strands-agents/sdk": "^0.1.4",
|
|
89
|
+
"@types/express": "^4.17.0",
|
|
90
|
+
"@types/node": "^24.10.4",
|
|
91
|
+
"@types/supertest": "^6.0.3",
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
93
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
94
|
+
"@vitest/coverage-v8": "^4.0.13",
|
|
95
|
+
"ai": "^6.0.0-beta.114",
|
|
96
|
+
"eslint": "^9.0.0",
|
|
97
|
+
"eslint-plugin-tsdoc": "^0.5.0",
|
|
98
|
+
"husky": "^9.1.7",
|
|
99
|
+
"playwright": "^1.56.1",
|
|
100
|
+
"prettier": "^3.0.0",
|
|
101
|
+
"supertest": "^7.1.4",
|
|
102
|
+
"tsx": "^4.19.4",
|
|
103
|
+
"typescript": "^5.5.0",
|
|
104
|
+
"vitest": "^4.0.8"
|
|
105
|
+
},
|
|
106
|
+
"engines": {
|
|
107
|
+
"node": ">=20.0.0"
|
|
108
|
+
},
|
|
109
|
+
"repository": {
|
|
110
|
+
"type": "git",
|
|
111
|
+
"url": "https://github.com/aws/bedrock-agentcore-sdk-typescript.git"
|
|
112
|
+
},
|
|
24
113
|
"bugs": {
|
|
25
114
|
"url": "https://github.com/aws/bedrock-agentcore-sdk-typescript/issues"
|
|
26
115
|
},
|
|
27
|
-
"homepage": "https://github.com/aws/bedrock-agentcore-sdk-typescript#readme"
|
|
116
|
+
"homepage": "https://github.com/aws/bedrock-agentcore-sdk-typescript#readme",
|
|
117
|
+
"dependencies": {
|
|
118
|
+
"@aws-crypto/sha256-js": "^5.2.0",
|
|
119
|
+
"@aws-sdk/client-bedrock-agentcore": "^3.948.0",
|
|
120
|
+
"@aws-sdk/client-bedrock-agentcore-control": "^3.948.0",
|
|
121
|
+
"@aws-sdk/credential-providers": "^3.939.0",
|
|
122
|
+
"@aws-sdk/protocol-http": "^3.370.0",
|
|
123
|
+
"@aws-sdk/signature-v4": "^3.370.0",
|
|
124
|
+
"@fastify/sse": "^0.4.0",
|
|
125
|
+
"@fastify/websocket": "^11.0.1",
|
|
126
|
+
"@smithy/protocol-http": "^5.3.5",
|
|
127
|
+
"@smithy/signature-v4": "^5.3.5",
|
|
128
|
+
"@smithy/util-utf8": "^4.2.0",
|
|
129
|
+
"@types/ws": "^8.18.1",
|
|
130
|
+
"fastify": "^5.7.1",
|
|
131
|
+
"ws": "^8.18.3",
|
|
132
|
+
"zod": "^4.1.13"
|
|
133
|
+
},
|
|
134
|
+
"peerDependencies": {
|
|
135
|
+
"@strands-agents/sdk": ">=0.1.0",
|
|
136
|
+
"ai": ">=6.0.0-beta",
|
|
137
|
+
"playwright": ">=1.56.0"
|
|
138
|
+
},
|
|
139
|
+
"peerDependenciesMeta": {
|
|
140
|
+
"ai": {
|
|
141
|
+
"optional": true
|
|
142
|
+
},
|
|
143
|
+
"playwright": {
|
|
144
|
+
"optional": true
|
|
145
|
+
},
|
|
146
|
+
"@strands-agents/sdk": {
|
|
147
|
+
"optional": true
|
|
148
|
+
}
|
|
149
|
+
}
|
|
28
150
|
}
|