@aexhq/sdk 0.80.0 → 0.81.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/README.md +7 -1
- package/dist/generated.d.ts +52 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +15 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ tools, send messages, and read saved conversations without operating a Brain ser
|
|
|
8
8
|
Create a key in the [dashboard](https://aex.dev/dashboard). With Node.js 22 or newer, install:
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
|
-
npm install @aexhq/sdk@0.
|
|
11
|
+
npm install @aexhq/sdk@0.81.0 @aexhq/agentloop-pi@7.1.1 zod@4
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Set `AEX_API_KEY` and `OPENAI_API_KEY` in your server environment. Save as `order.mjs` and
|
|
@@ -85,3 +85,9 @@ bindings and the selected Environment's prepared runtime. `ctx.finish(value, { c
|
|
|
85
85
|
retains the structured result while offering concise model text. `ctx.model({ messages })` runs an
|
|
86
86
|
independent request within the invocation's lifetime and the session's model authority; hosted
|
|
87
87
|
usage and spending controls include those requests. The Agentloop owns the shared conversation.
|
|
88
|
+
|
|
89
|
+
Connect short application functions through an authenticated HTTP route with
|
|
90
|
+
[HTTP tools](https://github.com/aexhq/aex/blob/main/docs/http-tools.md). Submit a turn, close the
|
|
91
|
+
request and read its committed outcome later. Desktop apps can use
|
|
92
|
+
[upload-only grants](https://github.com/aexhq/aex/blob/main/docs/attachments.md#upload-from-a-desktop-without-an-account-key)
|
|
93
|
+
without receiving an account credential.
|
package/dist/generated.d.ts
CHANGED
|
@@ -29,6 +29,58 @@ export type SyncPayment = {
|
|
|
29
29
|
};
|
|
30
30
|
export interface AexContracts {
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* This interface was referenced by `AexContracts`'s JSON-Schema
|
|
34
|
+
* via the `definition` "HttpCatalog".
|
|
35
|
+
*/
|
|
36
|
+
export interface HttpCatalog {
|
|
37
|
+
bindings: {
|
|
38
|
+
[k: string]: number;
|
|
39
|
+
};
|
|
40
|
+
driver_url: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* This interface was referenced by `AexContracts`'s JSON-Schema
|
|
44
|
+
* via the `definition` "HttpSelection".
|
|
45
|
+
*/
|
|
46
|
+
export interface HttpSelection {
|
|
47
|
+
binding: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* This interface was referenced by `AexContracts`'s JSON-Schema
|
|
51
|
+
* via the `definition` "UploadGrantInput".
|
|
52
|
+
*/
|
|
53
|
+
export interface UploadGrantInput {
|
|
54
|
+
bytes: number;
|
|
55
|
+
content_type: string;
|
|
56
|
+
expires_at?: number | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* This interface was referenced by `AexContracts`'s JSON-Schema
|
|
60
|
+
* via the `definition` "UploadGrant".
|
|
61
|
+
*/
|
|
62
|
+
export interface UploadGrant {
|
|
63
|
+
attachment_expires_at: number;
|
|
64
|
+
bytes: number;
|
|
65
|
+
content_type: string;
|
|
66
|
+
expires_at: number;
|
|
67
|
+
id: string;
|
|
68
|
+
token: string;
|
|
69
|
+
upload_url: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* This interface was referenced by `AexContracts`'s JSON-Schema
|
|
73
|
+
* via the `definition` "AttachmentLimits".
|
|
74
|
+
*/
|
|
75
|
+
export interface AttachmentLimits {
|
|
76
|
+
bytes_per_account: number;
|
|
77
|
+
count_per_account: number;
|
|
78
|
+
max_bytes: number;
|
|
79
|
+
region: string;
|
|
80
|
+
session_retention_secs: number;
|
|
81
|
+
ttl_secs: number;
|
|
82
|
+
upload_grant_secs: number;
|
|
83
|
+
}
|
|
32
84
|
/**
|
|
33
85
|
* This interface was referenced by `AexContracts`'s JSON-Schema
|
|
34
86
|
* via the `definition` "Attachment".
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,13 @@ export declare class Aex extends Brain {
|
|
|
22
22
|
request<T>(method: string, path: string, body?: unknown, idempotencyKey?: string, contentType?: string, signal?: AbortSignal, extraHeaders?: HeadersInit): Promise<T>;
|
|
23
23
|
static exchangeLogin(input: LoginExchange, options?: AexConnection): Promise<AccountSession>;
|
|
24
24
|
readonly attachments: {
|
|
25
|
+
limits: () => Promise<import("./generated.js").AttachmentLimits>;
|
|
26
|
+
grant: (sessionId: string, input: import("./generated.js").UploadGrantInput, options: {
|
|
27
|
+
idempotencyKey: string;
|
|
28
|
+
downloadBudgetBytes?: number;
|
|
29
|
+
maxCostMicroUsd?: number;
|
|
30
|
+
}) => Promise<import("./generated.js").UploadGrant>;
|
|
31
|
+
get: (sessionId: string, id: string) => Promise<Attachment>;
|
|
25
32
|
upload: (sessionId: string, bytes: Uint8Array, options: {
|
|
26
33
|
contentType: string;
|
|
27
34
|
expiresAt?: number;
|
|
@@ -50,6 +57,7 @@ export declare class Aex extends Brain {
|
|
|
50
57
|
sync: (input: SyncPayment) => Promise<Wallet>;
|
|
51
58
|
};
|
|
52
59
|
readonly environments: {
|
|
60
|
+
http: () => Promise<import("./generated.js").HttpCatalog>;
|
|
53
61
|
list: () => Promise<EnvironmentCatalog>;
|
|
54
62
|
};
|
|
55
63
|
/** Key management requires an account session; workload API keys cannot create credentials. */
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,20 @@ export class Aex extends Brain {
|
|
|
25
25
|
return new Brain({ baseUrl: "https://api.aex.dev", ...options }).request("POST", "/v1/auth/exchange", input);
|
|
26
26
|
}
|
|
27
27
|
attachments = {
|
|
28
|
+
limits: () => this.request("GET", "/v1/attachments/limits"),
|
|
29
|
+
grant: (sessionId, input, options) => {
|
|
30
|
+
const headers = new Headers();
|
|
31
|
+
if (options.downloadBudgetBytes !== undefined) {
|
|
32
|
+
nonnegativeInteger(options.downloadBudgetBytes, "downloadBudgetBytes");
|
|
33
|
+
headers.set("x-aex-download-budget-bytes", String(options.downloadBudgetBytes));
|
|
34
|
+
}
|
|
35
|
+
if (options.maxCostMicroUsd !== undefined) {
|
|
36
|
+
nonnegativeInteger(options.maxCostMicroUsd, "maxCostMicroUsd");
|
|
37
|
+
headers.set("x-aex-max-cost-micro-usd", String(options.maxCostMicroUsd));
|
|
38
|
+
}
|
|
39
|
+
return this.request("POST", `/v1/sessions/${encodeURIComponent(sessionId)}/attachment-grants`, input, options.idempotencyKey, "application/json", undefined, headers);
|
|
40
|
+
},
|
|
41
|
+
get: (sessionId, id) => this.request("GET", `/v1/sessions/${encodeURIComponent(sessionId)}/attachments/${encodeURIComponent(id)}`),
|
|
28
42
|
upload: (sessionId, bytes, options) => {
|
|
29
43
|
if (options.expiresAt !== undefined && (!Number.isSafeInteger(options.expiresAt) || options.expiresAt <= 0))
|
|
30
44
|
throw new TypeError("expiresAt must be positive Unix seconds");
|
|
@@ -65,6 +79,7 @@ export class Aex extends Brain {
|
|
|
65
79
|
sync: (input) => this.request("POST", "/v1/billing/sync", input),
|
|
66
80
|
};
|
|
67
81
|
environments = {
|
|
82
|
+
http: () => this.request("GET", "/v1/environments/http"),
|
|
68
83
|
list: () => this.request("GET", "/v1/environments"),
|
|
69
84
|
};
|
|
70
85
|
/** Key management requires an account session; workload API keys cannot create credentials. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aexhq/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"description": "Aex accounts and hosted sessions using the Brain SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"tag": "next"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aexhq/brain": "0.
|
|
31
|
+
"@aexhq/brain": "0.31.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"gen": "node ../../tools/sdk-contracts.mjs",
|