@aexhq/cli 0.26.0 → 0.27.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/index.js +9 -7
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { Aex, AexError } from "@aexhq/sdk";
|
|
7
7
|
import * as z from "zod";
|
|
8
|
-
const HELP = `
|
|
8
|
+
const HELP = `Aex — the session backend for AI apps
|
|
9
9
|
|
|
10
10
|
Usage:
|
|
11
11
|
aex login
|
|
@@ -13,7 +13,7 @@ Usage:
|
|
|
13
13
|
aex session list
|
|
14
14
|
aex session get <session-id>
|
|
15
15
|
aex session send <session-id> <message>
|
|
16
|
-
aex session output <session-id> --schema <schema.json>
|
|
16
|
+
aex session output <session-id> --schema <schema.json> <message>
|
|
17
17
|
aex session events <session-id>
|
|
18
18
|
aex session cancel <session-id>
|
|
19
19
|
aex session delete <session-id>
|
|
@@ -32,7 +32,7 @@ async function main(argv) {
|
|
|
32
32
|
const aex = await client();
|
|
33
33
|
if (command === "doctor") {
|
|
34
34
|
await aex.sessions.list({ limit: 1 });
|
|
35
|
-
process.stdout.write("
|
|
35
|
+
process.stdout.write("Aex API: ok\n");
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
if (command !== "session")
|
|
@@ -73,8 +73,10 @@ async function sessionCommand(aex, argv) {
|
|
|
73
73
|
const document = JSON.parse(await readFile(resolve(schemaPath), "utf8"));
|
|
74
74
|
const schema = z.fromJSONSchema(document);
|
|
75
75
|
const input = rest.join(" ").trim();
|
|
76
|
+
if (input === "")
|
|
77
|
+
usage("session output requires a message");
|
|
76
78
|
const session = await aex.sessions.get(id);
|
|
77
|
-
const result = await session.
|
|
79
|
+
const result = await session.send(input, { output: schema });
|
|
78
80
|
print(result);
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
@@ -124,7 +126,7 @@ function summary(session) {
|
|
|
124
126
|
async function client() {
|
|
125
127
|
const apiKey = process.env.AEX_API_KEY ?? (await readConfig())?.apiKey;
|
|
126
128
|
if (apiKey === undefined || apiKey === "") {
|
|
127
|
-
throw new Error("No
|
|
129
|
+
throw new Error("No Aex API key. Run `aex login` first.");
|
|
128
130
|
}
|
|
129
131
|
return new Aex({
|
|
130
132
|
apiKey,
|
|
@@ -132,9 +134,9 @@ async function client() {
|
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
136
|
async function login() {
|
|
135
|
-
const apiKey = (await readSecret("Paste
|
|
137
|
+
const apiKey = (await readSecret("Paste Aex API key: ")).trim();
|
|
136
138
|
if (!/^aex_sk_[A-Za-z0-9]{40,64}$/.test(apiKey)) {
|
|
137
|
-
throw new Error("That does not look like an
|
|
139
|
+
throw new Error("That does not look like an Aex session API key.");
|
|
138
140
|
}
|
|
139
141
|
const path = configPath();
|
|
140
142
|
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aexhq/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Command-line client for
|
|
3
|
+
"version": "0.27.0",
|
|
4
|
+
"description": "Command-line client for Aex sessions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://aex.dev",
|
|
7
7
|
"repository": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test": "tsc -p tsconfig.json && node --test"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@aexhq/sdk": "0.
|
|
33
|
-
"zod": "
|
|
32
|
+
"@aexhq/sdk": "0.56.0",
|
|
33
|
+
"zod": "4.4.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^24.0.0",
|