@aithos/sdk 0.1.0-alpha.58 → 0.1.0-alpha.59
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/src/endpoints.d.ts +18 -0
- package/dist/src/endpoints.js +16 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/sdk.js +5 -0
- package/dist/test/endpoints.test.js +10 -0
- package/package.json +5 -5
package/dist/src/endpoints.d.ts
CHANGED
|
@@ -33,9 +33,27 @@ export interface AithosSdkEndpoints {
|
|
|
33
33
|
* `createAssetsClient`. Override for self-hosting or staging.
|
|
34
34
|
*/
|
|
35
35
|
readonly assets: string;
|
|
36
|
+
/**
|
|
37
|
+
* Protocol API base URL (ethos reads/writes — `get_ethos_manifest`,
|
|
38
|
+
* `get_ethos_section`, `publish_ethos_edition`). Default `https://api.aithos.be`.
|
|
39
|
+
* Reached through `@aithos/protocol-client`; the SDK propagates this to the
|
|
40
|
+
* client via `configureEndpoints` on construction.
|
|
41
|
+
*/
|
|
42
|
+
readonly api: string;
|
|
43
|
+
/**
|
|
44
|
+
* CDN base URL for immutable signed editions / DID documents. Default
|
|
45
|
+
* `https://cdn.aithos.be`. Also propagated to protocol-client.
|
|
46
|
+
*/
|
|
47
|
+
readonly cdn: string;
|
|
36
48
|
}
|
|
37
49
|
/** Production defaults. */
|
|
38
50
|
export declare const DEFAULT_SDK_ENDPOINTS: AithosSdkEndpoints;
|
|
51
|
+
/**
|
|
52
|
+
* Dev-account preset — every endpoint on the isolated `*.dev.aithos.be` infra.
|
|
53
|
+
* Pass to the SDK as `new AithosSDK({ ..., endpoints: DEV_SDK_ENDPOINTS })` to
|
|
54
|
+
* point an app at the dev account (api/cdn flow to protocol-client too).
|
|
55
|
+
*/
|
|
56
|
+
export declare const DEV_SDK_ENDPOINTS: AithosSdkEndpoints;
|
|
39
57
|
/** Compose the full compute-invoke URL: `${compute}/v1/invoke`. */
|
|
40
58
|
export declare function computeInvokeUrl(endpoints: AithosSdkEndpoints): string;
|
|
41
59
|
/** Compose the full web-extract URL: `${web}/v1/invoke`. */
|
package/dist/src/endpoints.js
CHANGED
|
@@ -7,6 +7,22 @@ export const DEFAULT_SDK_ENDPOINTS = {
|
|
|
7
7
|
web: "https://extract.aithos.be",
|
|
8
8
|
pds: "https://pds.aithos.be",
|
|
9
9
|
assets: "https://assets.aithos.be",
|
|
10
|
+
api: "https://api.aithos.be",
|
|
11
|
+
cdn: "https://cdn.aithos.be",
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Dev-account preset — every endpoint on the isolated `*.dev.aithos.be` infra.
|
|
15
|
+
* Pass to the SDK as `new AithosSDK({ ..., endpoints: DEV_SDK_ENDPOINTS })` to
|
|
16
|
+
* point an app at the dev account (api/cdn flow to protocol-client too).
|
|
17
|
+
*/
|
|
18
|
+
export const DEV_SDK_ENDPOINTS = {
|
|
19
|
+
compute: "https://compute.dev.aithos.be",
|
|
20
|
+
wallet: "https://wallet.dev.aithos.be",
|
|
21
|
+
web: "https://extract.dev.aithos.be",
|
|
22
|
+
pds: "https://pds.dev.aithos.be",
|
|
23
|
+
assets: "https://assets.dev.aithos.be",
|
|
24
|
+
api: "https://api.dev.aithos.be",
|
|
25
|
+
cdn: "https://cdn.dev.aithos.be",
|
|
10
26
|
};
|
|
11
27
|
/** Compose the full compute-invoke URL: `${compute}/v1/invoke`. */
|
|
12
28
|
export function computeInvokeUrl(endpoints) {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { AithosSDKConfig } from "./types.js";
|
|
|
4
4
|
export { AithosSDKError } from "./types.js";
|
|
5
5
|
export { AithosRpcError } from "@aithos/protocol-client";
|
|
6
6
|
export type { AithosSdkEndpoints } from "./endpoints.js";
|
|
7
|
-
export { DEFAULT_SDK_ENDPOINTS } from "./endpoints.js";
|
|
7
|
+
export { DEFAULT_SDK_ENDPOINTS, DEV_SDK_ENDPOINTS } from "./endpoints.js";
|
|
8
8
|
export type { ComputeMessage, ImageAspectRatio, ImageModelId, InvokeBedrockArgs, InvokeBedrockResult, InvokeBedrockVisionArgs, InvokeBedrockVisionResult, InvokeImageArgs, InvokeImageImage, InvokeImageResult, InvokeSegmentationArgs, InvokeSegmentationResult, SegmentPolygon, StopReason, RunConversationArgs, RunConversationResult, ComputeWorkingSet, WorkingSetSection, ConverseToolCall, ConverseStopReason, InvokeTurnArgs, InvokeTurnResult, RunConversationLocalArgs, RunConversationLocalResult, TranscribeModelId, TranscribeProgressState, TranscribeSegment, TranscribeWord, InvokeTranscribeArgs, InvokeTranscribeResult, PrepareTranscribeArgs, PrepareTranscribeResult, StartTranscribeArgs, StartTranscribeResult, TranscribeStatusResult, TranscribeJobSummary, } from "./compute.js";
|
|
9
9
|
export { ComputeNamespace } from "./compute.js";
|
|
10
10
|
export type { AgentMessage, AgentToolSpec, AgentTurnResult, ContentBlock, ToolCallTrace, LoopStopReason, DispatchOutcome, } from "./agent-loop.js";
|
package/dist/src/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export { AithosSDKError } from "./types.js";
|
|
|
24
24
|
// `instanceof`-check server-side errors and inspect the JSON-RPC code
|
|
25
25
|
// without taking a direct dependency on @aithos/protocol-client.
|
|
26
26
|
export { AithosRpcError } from "@aithos/protocol-client";
|
|
27
|
-
export { DEFAULT_SDK_ENDPOINTS } from "./endpoints.js";
|
|
27
|
+
export { DEFAULT_SDK_ENDPOINTS, DEV_SDK_ENDPOINTS } from "./endpoints.js";
|
|
28
28
|
export { ComputeNamespace } from "./compute.js";
|
|
29
29
|
export { runAgenticLoopLocal } from "./agent-loop.js";
|
|
30
30
|
export { AITHOS_AGENT_TOOLS, AITHOS_AGENT_READ_TOOLS, AITHOS_AGENT_WRITE_TOOLS, selectAgentTools, isWriteTool, } from "./agent-tools.js";
|
package/dist/src/sdk.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { AppsNamespace } from "./apps.js";
|
|
4
4
|
import { ComputeNamespace, } from "./compute.js";
|
|
5
5
|
import { resolveEndpoints } from "./endpoints.js";
|
|
6
|
+
import { configureEndpoints as configureProtocolClientEndpoints } from "@aithos/protocol-client";
|
|
6
7
|
import { EthosNamespace } from "./ethos.js";
|
|
7
8
|
import { MandatesNamespace } from "./mandates.js";
|
|
8
9
|
import { AithosSDKError } from "./types.js";
|
|
@@ -41,6 +42,10 @@ export class AithosSDK {
|
|
|
41
42
|
this.endpoints = resolveEndpoints(config.endpoints);
|
|
42
43
|
this.appDid = config.appDid;
|
|
43
44
|
this.auth = config.auth;
|
|
45
|
+
// Ethos reads/writes flow through @aithos/protocol-client, which keeps its
|
|
46
|
+
// own (module-scoped) api/cdn config. Propagate ours so that pointing the
|
|
47
|
+
// SDK at a dev account (endpoints.api/cdn) also redirects the ethos calls.
|
|
48
|
+
configureProtocolClientEndpoints({ api: this.endpoints.api, cdn: this.endpoints.cdn });
|
|
44
49
|
const fetchImpl = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
45
50
|
this.compute = new ComputeNamespace({
|
|
46
51
|
auth: config.auth,
|
|
@@ -26,6 +26,8 @@ describe("computeInvokeUrl", () => {
|
|
|
26
26
|
web: "https://extract.aithos.be",
|
|
27
27
|
pds: "https://pds.aithos.be",
|
|
28
28
|
assets: "https://assets.aithos.be",
|
|
29
|
+
api: "https://api.aithos.be",
|
|
30
|
+
cdn: "https://cdn.aithos.be",
|
|
29
31
|
}), "https://compute.aithos.be/v1/invoke");
|
|
30
32
|
});
|
|
31
33
|
it("trims a trailing slash on the compute base", () => {
|
|
@@ -35,6 +37,8 @@ describe("computeInvokeUrl", () => {
|
|
|
35
37
|
web: "https://extract.aithos.be",
|
|
36
38
|
pds: "https://pds.aithos.be",
|
|
37
39
|
assets: "https://assets.aithos.be",
|
|
40
|
+
api: "https://api.aithos.be",
|
|
41
|
+
cdn: "https://cdn.aithos.be",
|
|
38
42
|
}), "https://compute.aithos.be/v1/invoke");
|
|
39
43
|
});
|
|
40
44
|
});
|
|
@@ -46,6 +50,8 @@ describe("walletTopupCheckoutUrl", () => {
|
|
|
46
50
|
web: "https://extract.aithos.be",
|
|
47
51
|
pds: "https://pds.aithos.be",
|
|
48
52
|
assets: "https://assets.aithos.be",
|
|
53
|
+
api: "https://api.aithos.be",
|
|
54
|
+
cdn: "https://cdn.aithos.be",
|
|
49
55
|
}), "https://wallet.aithos.be/v1/wallet/topup/checkout");
|
|
50
56
|
});
|
|
51
57
|
});
|
|
@@ -57,6 +63,8 @@ describe("webInvokeUrl", () => {
|
|
|
57
63
|
web: "https://extract.aithos.be",
|
|
58
64
|
pds: "https://pds.aithos.be",
|
|
59
65
|
assets: "https://assets.aithos.be",
|
|
66
|
+
api: "https://api.aithos.be",
|
|
67
|
+
cdn: "https://cdn.aithos.be",
|
|
60
68
|
}), "https://extract.aithos.be/v1/invoke");
|
|
61
69
|
});
|
|
62
70
|
it("trims a trailing slash on the web base", () => {
|
|
@@ -66,6 +74,8 @@ describe("webInvokeUrl", () => {
|
|
|
66
74
|
web: "https://extract.aithos.be/",
|
|
67
75
|
pds: "https://pds.aithos.be",
|
|
68
76
|
assets: "https://assets.aithos.be",
|
|
77
|
+
api: "https://api.aithos.be",
|
|
78
|
+
cdn: "https://cdn.aithos.be",
|
|
69
79
|
}), "https://extract.aithos.be/v1/invoke");
|
|
70
80
|
});
|
|
71
81
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aithos/sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.59",
|
|
4
4
|
"description": "Aithos SDK — high-level TypeScript developer kit for building agentic apps on the Aithos protocol. Wraps @aithos/protocol-client and exposes the Aithos compute proxy and wallet (Stripe top-up) endpoints.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aithos",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@aithos/assets-crypto": ">=0.1.0-alpha.1 <0.2.0",
|
|
60
|
-
"@aithos/protocol-client": "^0.1.0-alpha.
|
|
61
|
-
"@aithos/protocol-core": ">=0.
|
|
60
|
+
"@aithos/protocol-client": "^0.1.0-alpha.20",
|
|
61
|
+
"@aithos/protocol-core": ">=0.8.0 <0.9.0",
|
|
62
62
|
"react": "^18.0.0 || ^19.0.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@aithos/assets-crypto": "^0.1.0-alpha.1",
|
|
74
|
-
"@aithos/protocol-client": "^0.1.0-alpha.
|
|
75
|
-
"@aithos/protocol-core": ">=0.
|
|
74
|
+
"@aithos/protocol-client": "^0.1.0-alpha.20",
|
|
75
|
+
"@aithos/protocol-core": ">=0.8.0 <0.9.0",
|
|
76
76
|
"@types/node": "^24.12.2",
|
|
77
77
|
"fake-indexeddb": "^6.2.5",
|
|
78
78
|
"typescript": "^5.9.2"
|