@asterai/cli 0.6.2 → 1.0.0-alpha.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/bin/asterai +2 -0
- package/lib/index.js +49 -0
- package/package.json +27 -84
- package/README.md +0 -170
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -6
- package/bin/run.cmd +0 -3
- package/bin/run.js +0 -5
- package/dist/commands/auth.d.ts +0 -10
- package/dist/commands/auth.js +0 -17
- package/dist/commands/deploy.d.ts +0 -14
- package/dist/commands/deploy.js +0 -78
- package/dist/commands/init.d.ts +0 -17
- package/dist/commands/init.js +0 -53
- package/dist/commands/pkg.d.ts +0 -27
- package/dist/commands/pkg.js +0 -98
- package/dist/commands/query.d.ts +0 -13
- package/dist/commands/query.js +0 -93
- package/dist/config.d.ts +0 -2
- package/dist/config.js +0 -21
- package/dist/const.d.ts +0 -2
- package/dist/const.js +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/init/rust/Cargo.toml +0 -25
- package/init/rust/build.sh +0 -5
- package/init/rust/deploy.sh +0 -7
- package/init/rust/plugin.wit +0 -10
- package/init/rust/src/bindings.rs +0 -685
- package/init/rust/src/lib.rs +0 -16
- package/init/typescript/package.json +0 -26
- package/init/typescript/plugin.ts +0 -13
- package/init/typescript/plugin.wit +0 -11
- package/init/typescript/tsconfig.json +0 -8
- package/oclif.manifest.json +0 -248
package/init/rust/src/lib.rs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
use crate::bindings::asterai::host::api;
|
|
2
|
-
use crate::bindings::exports::your_username::greeter::greeter::Guest;
|
|
3
|
-
|
|
4
|
-
#[allow(warnings)]
|
|
5
|
-
mod bindings;
|
|
6
|
-
|
|
7
|
-
struct Component;
|
|
8
|
-
|
|
9
|
-
impl Guest for Component {
|
|
10
|
-
fn greet(name: String) {
|
|
11
|
-
let greeting = format!("hello {name}");
|
|
12
|
-
api::send_response_to_agent(&greeting);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
bindings::export!(Component with_types_in bindings);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "plugin",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"author": "",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"auth": "asterai auth",
|
|
10
|
-
"gen:pkg": "mkdirp build && asterai pkg -o build/package.wasm -w build/package.wit",
|
|
11
|
-
"gen:types": "jco guest-types build/package.wit -n plugin -o generated/",
|
|
12
|
-
"compile": "tsc",
|
|
13
|
-
"componentize": "jco componentize build/plugin.js -w build/package.wit -n plugin -o build/plugin.wasm",
|
|
14
|
-
"build": "run-s gen:pkg gen:types compile componentize",
|
|
15
|
-
"deploy": "asterai deploy"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@asterai/cli": "latest",
|
|
19
|
-
"@asterai/sdk": "latest",
|
|
20
|
-
"@bytecodealliance/jco": "^1.10.2",
|
|
21
|
-
"@types/node": "^22.13.4",
|
|
22
|
-
"mkdirp": "^3.0.1",
|
|
23
|
-
"npm-run-all": "^4.1.5",
|
|
24
|
-
"typescript": "^5.7.3"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as asterai from "asterai:host/api@0.1.0";
|
|
2
|
-
import { BinaryOperationResult } from "example:math/plugin@0.1.0";
|
|
3
|
-
|
|
4
|
-
export const mul = (a: number, b: number): BinaryOperationResult => {
|
|
5
|
-
const result = a + b;
|
|
6
|
-
// Send the calculation result to the agent.
|
|
7
|
-
asterai.sendResponseToAgent(`the result is ${result}`);
|
|
8
|
-
// This result is not seen by the agent, but it can be consumed by
|
|
9
|
-
// other plugins calling this function.
|
|
10
|
-
return {
|
|
11
|
-
value: result,
|
|
12
|
-
};
|
|
13
|
-
};
|
package/oclif.manifest.json
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"commands": {
|
|
3
|
-
"auth": {
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"args": {
|
|
6
|
-
"key": {
|
|
7
|
-
"name": "key",
|
|
8
|
-
"required": true
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"description": "authenticate to asterai",
|
|
12
|
-
"examples": [
|
|
13
|
-
"<%= config.bin %> <%= command.id %>"
|
|
14
|
-
],
|
|
15
|
-
"flags": {},
|
|
16
|
-
"hasDynamicHelp": false,
|
|
17
|
-
"hiddenAliases": [],
|
|
18
|
-
"id": "auth",
|
|
19
|
-
"pluginAlias": "@asterai/cli",
|
|
20
|
-
"pluginName": "@asterai/cli",
|
|
21
|
-
"pluginType": "core",
|
|
22
|
-
"strict": true,
|
|
23
|
-
"enableJsonFlag": false,
|
|
24
|
-
"isESM": true,
|
|
25
|
-
"relativePath": [
|
|
26
|
-
"dist",
|
|
27
|
-
"commands",
|
|
28
|
-
"auth.js"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
"deploy": {
|
|
32
|
-
"aliases": [],
|
|
33
|
-
"args": {},
|
|
34
|
-
"description": "uploads a plugin to asterai",
|
|
35
|
-
"examples": [
|
|
36
|
-
"<%= config.bin %> <%= command.id %> --app 66a46b12-b1a7-4b72-a64a-0e4fe21902b6"
|
|
37
|
-
],
|
|
38
|
-
"flags": {
|
|
39
|
-
"agent": {
|
|
40
|
-
"char": "a",
|
|
41
|
-
"description": "agent ID to immediately activate this plugin for",
|
|
42
|
-
"name": "agent",
|
|
43
|
-
"required": false,
|
|
44
|
-
"hasDynamicHelp": false,
|
|
45
|
-
"multiple": false,
|
|
46
|
-
"type": "option"
|
|
47
|
-
},
|
|
48
|
-
"endpoint": {
|
|
49
|
-
"char": "e",
|
|
50
|
-
"name": "endpoint",
|
|
51
|
-
"default": "https://api.asterai.io",
|
|
52
|
-
"hasDynamicHelp": false,
|
|
53
|
-
"multiple": false,
|
|
54
|
-
"type": "option"
|
|
55
|
-
},
|
|
56
|
-
"staging": {
|
|
57
|
-
"char": "s",
|
|
58
|
-
"name": "staging",
|
|
59
|
-
"allowNo": false,
|
|
60
|
-
"type": "boolean"
|
|
61
|
-
},
|
|
62
|
-
"plugin": {
|
|
63
|
-
"description": "plugin WASM path",
|
|
64
|
-
"name": "plugin",
|
|
65
|
-
"default": "plugin.wasm",
|
|
66
|
-
"hasDynamicHelp": false,
|
|
67
|
-
"multiple": false,
|
|
68
|
-
"type": "option"
|
|
69
|
-
},
|
|
70
|
-
"pkg": {
|
|
71
|
-
"description": "package WASM path",
|
|
72
|
-
"name": "pkg",
|
|
73
|
-
"default": "package.wasm",
|
|
74
|
-
"hasDynamicHelp": false,
|
|
75
|
-
"multiple": false,
|
|
76
|
-
"type": "option"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"hasDynamicHelp": false,
|
|
80
|
-
"hiddenAliases": [],
|
|
81
|
-
"id": "deploy",
|
|
82
|
-
"pluginAlias": "@asterai/cli",
|
|
83
|
-
"pluginName": "@asterai/cli",
|
|
84
|
-
"pluginType": "core",
|
|
85
|
-
"strict": true,
|
|
86
|
-
"enableJsonFlag": false,
|
|
87
|
-
"isESM": true,
|
|
88
|
-
"relativePath": [
|
|
89
|
-
"dist",
|
|
90
|
-
"commands",
|
|
91
|
-
"deploy.js"
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"init": {
|
|
95
|
-
"aliases": [],
|
|
96
|
-
"args": {
|
|
97
|
-
"outDir": {
|
|
98
|
-
"default": "plugin",
|
|
99
|
-
"name": "outDir"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"description": "Initialise a new plugin project",
|
|
103
|
-
"examples": [
|
|
104
|
-
"<%= config.bin %> <%= command.id %> project-name"
|
|
105
|
-
],
|
|
106
|
-
"flags": {
|
|
107
|
-
"typescript": {
|
|
108
|
-
"description": "init a the plugin project in typescript",
|
|
109
|
-
"name": "typescript",
|
|
110
|
-
"allowNo": false,
|
|
111
|
-
"type": "boolean"
|
|
112
|
-
},
|
|
113
|
-
"rust": {
|
|
114
|
-
"description": "init a the plugin project in rust",
|
|
115
|
-
"name": "rust",
|
|
116
|
-
"allowNo": false,
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
"hasDynamicHelp": false,
|
|
121
|
-
"hiddenAliases": [],
|
|
122
|
-
"id": "init",
|
|
123
|
-
"pluginAlias": "@asterai/cli",
|
|
124
|
-
"pluginName": "@asterai/cli",
|
|
125
|
-
"pluginType": "core",
|
|
126
|
-
"strict": true,
|
|
127
|
-
"enableJsonFlag": false,
|
|
128
|
-
"isESM": true,
|
|
129
|
-
"relativePath": [
|
|
130
|
-
"dist",
|
|
131
|
-
"commands",
|
|
132
|
-
"init.js"
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
"pkg": {
|
|
136
|
-
"aliases": [],
|
|
137
|
-
"args": {
|
|
138
|
-
"input": {
|
|
139
|
-
"default": "plugin.wit",
|
|
140
|
-
"description": "path to the plugin's WIT file",
|
|
141
|
-
"name": "input"
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
"description": "bundles the WIT into a binary WASM package",
|
|
145
|
-
"examples": [
|
|
146
|
-
"<%= config.bin %> <%= command.id %>"
|
|
147
|
-
],
|
|
148
|
-
"flags": {
|
|
149
|
-
"output": {
|
|
150
|
-
"char": "o",
|
|
151
|
-
"description": "output file name for the binary WASM package",
|
|
152
|
-
"name": "output",
|
|
153
|
-
"default": "package.wasm",
|
|
154
|
-
"hasDynamicHelp": false,
|
|
155
|
-
"multiple": false,
|
|
156
|
-
"type": "option"
|
|
157
|
-
},
|
|
158
|
-
"wit": {
|
|
159
|
-
"char": "w",
|
|
160
|
-
"description": "output package converted to the WIT format",
|
|
161
|
-
"name": "wit",
|
|
162
|
-
"default": "package.wit",
|
|
163
|
-
"hasDynamicHelp": false,
|
|
164
|
-
"multiple": false,
|
|
165
|
-
"type": "option"
|
|
166
|
-
},
|
|
167
|
-
"endpoint": {
|
|
168
|
-
"char": "e",
|
|
169
|
-
"name": "endpoint",
|
|
170
|
-
"default": "https://api.asterai.io",
|
|
171
|
-
"hasDynamicHelp": false,
|
|
172
|
-
"multiple": false,
|
|
173
|
-
"type": "option"
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
"hasDynamicHelp": false,
|
|
177
|
-
"hiddenAliases": [],
|
|
178
|
-
"id": "pkg",
|
|
179
|
-
"pluginAlias": "@asterai/cli",
|
|
180
|
-
"pluginName": "@asterai/cli",
|
|
181
|
-
"pluginType": "core",
|
|
182
|
-
"strict": true,
|
|
183
|
-
"enableJsonFlag": false,
|
|
184
|
-
"isESM": true,
|
|
185
|
-
"relativePath": [
|
|
186
|
-
"dist",
|
|
187
|
-
"commands",
|
|
188
|
-
"pkg.js"
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
"query": {
|
|
192
|
-
"aliases": [],
|
|
193
|
-
"args": {},
|
|
194
|
-
"description": "query an asterai app interactively",
|
|
195
|
-
"examples": [
|
|
196
|
-
"<%= config.bin %> <%= command.id %>"
|
|
197
|
-
],
|
|
198
|
-
"flags": {
|
|
199
|
-
"app": {
|
|
200
|
-
"char": "a",
|
|
201
|
-
"name": "app",
|
|
202
|
-
"required": true,
|
|
203
|
-
"hasDynamicHelp": false,
|
|
204
|
-
"multiple": false,
|
|
205
|
-
"type": "option"
|
|
206
|
-
},
|
|
207
|
-
"key": {
|
|
208
|
-
"char": "k",
|
|
209
|
-
"description": "app query key",
|
|
210
|
-
"name": "key",
|
|
211
|
-
"required": true,
|
|
212
|
-
"hasDynamicHelp": false,
|
|
213
|
-
"multiple": false,
|
|
214
|
-
"type": "option"
|
|
215
|
-
},
|
|
216
|
-
"staging": {
|
|
217
|
-
"char": "s",
|
|
218
|
-
"name": "staging",
|
|
219
|
-
"allowNo": false,
|
|
220
|
-
"type": "boolean"
|
|
221
|
-
},
|
|
222
|
-
"endpoint": {
|
|
223
|
-
"char": "e",
|
|
224
|
-
"name": "endpoint",
|
|
225
|
-
"default": "https://api.asterai.io",
|
|
226
|
-
"hasDynamicHelp": false,
|
|
227
|
-
"multiple": false,
|
|
228
|
-
"type": "option"
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
"hasDynamicHelp": false,
|
|
232
|
-
"hiddenAliases": [],
|
|
233
|
-
"id": "query",
|
|
234
|
-
"pluginAlias": "@asterai/cli",
|
|
235
|
-
"pluginName": "@asterai/cli",
|
|
236
|
-
"pluginType": "core",
|
|
237
|
-
"strict": true,
|
|
238
|
-
"enableJsonFlag": false,
|
|
239
|
-
"isESM": true,
|
|
240
|
-
"relativePath": [
|
|
241
|
-
"dist",
|
|
242
|
-
"commands",
|
|
243
|
-
"query.js"
|
|
244
|
-
]
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
"version": "0.6.2"
|
|
248
|
-
}
|