sst 3.12.2 → 3.12.5
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/opencontrol.d.ts +9 -9
- package/dist/opencontrol.js +25 -10
- package/package.json +6 -6
package/dist/opencontrol.d.ts
CHANGED
|
@@ -21,17 +21,17 @@ import { z } from "zod";
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export declare const tools: (import("opencontrol/tool").Tool<z.ZodObject<{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
service: z.ZodString;
|
|
25
|
+
method: z.ZodString;
|
|
26
|
+
params: z.ZodString;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
method: string;
|
|
29
|
+
params: string;
|
|
30
|
+
service: string;
|
|
31
31
|
}, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
method: string;
|
|
33
|
+
params: string;
|
|
34
|
+
service: string;
|
|
35
35
|
}>> | import("opencontrol/tool").Tool<z.ZodObject<{
|
|
36
36
|
client: z.ZodString;
|
|
37
37
|
command: z.ZodString;
|
package/dist/opencontrol.js
CHANGED
|
@@ -91,19 +91,34 @@ export const tools = [
|
|
|
91
91
|
*/
|
|
92
92
|
tool({
|
|
93
93
|
name: "aws",
|
|
94
|
-
description:
|
|
94
|
+
description: `This uses aws sdk v2 in javascript to execute aws commands
|
|
95
|
+
this is roughly how it works
|
|
96
|
+
\`\`\`js
|
|
97
|
+
import aws from "aws-sdk";
|
|
98
|
+
aws[service][method](params)
|
|
99
|
+
\`\`\`
|
|
100
|
+
`,
|
|
95
101
|
args: z.object({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.
|
|
101
|
-
.describe("
|
|
102
|
+
service: z
|
|
103
|
+
.string()
|
|
104
|
+
.describe("name of the aws service in the format aws sdk v2 uses, like S3 or EC2"),
|
|
105
|
+
method: z
|
|
106
|
+
.string()
|
|
107
|
+
.describe("name of the aws method in the format aws sdk v2 uses"),
|
|
108
|
+
params: z.string().describe("params for the aws method in json format"),
|
|
102
109
|
}),
|
|
103
110
|
async run(input) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
const aws = await import("aws-sdk");
|
|
112
|
+
/* @ts-expect-error */
|
|
113
|
+
const service = aws.default[input.service];
|
|
114
|
+
if (!service) {
|
|
115
|
+
throw new Error(`service aws[${input.service}] not found`);
|
|
116
|
+
}
|
|
117
|
+
const instance = new service();
|
|
118
|
+
if (!instance[input.method]) {
|
|
119
|
+
throw new Error(`method aws.${input.service}.${input.method} not found`);
|
|
120
|
+
}
|
|
121
|
+
return await instance[input.method](JSON.parse(input.params)).promise();
|
|
107
122
|
},
|
|
108
123
|
}),
|
|
109
124
|
tool({
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "sst",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"version": "3.12.
|
|
6
|
+
"version": "3.12.5",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"sst": "./bin/sst.mjs"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"sst-linux-x64": "3.12.
|
|
45
|
-
"sst-linux-x86": "3.12.
|
|
46
|
-
"sst-
|
|
47
|
-
"sst-
|
|
48
|
-
"sst-darwin-arm64": "3.12.
|
|
44
|
+
"sst-linux-x64": "3.12.5",
|
|
45
|
+
"sst-linux-x86": "3.12.5",
|
|
46
|
+
"sst-darwin-x64": "3.12.5",
|
|
47
|
+
"sst-linux-arm64": "3.12.5",
|
|
48
|
+
"sst-darwin-arm64": "3.12.5"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"aws-sdk": "2.1692.0",
|