@maiaos/sdk 0.1.0-canary.31 → 0.1.0-canary.33
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/node/discovery.d.ts +1 -0
- package/dist/node/discovery.js +12 -4
- package/package.json +2 -2
package/dist/node/discovery.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const LocalNodeTransportError_base: new <A extends Record<string, any> =
|
|
|
9
9
|
readonly _tag: "LocalNodeTransportError";
|
|
10
10
|
} & Readonly<A>;
|
|
11
11
|
declare class LocalNodeTransportError extends LocalNodeTransportError_base<{
|
|
12
|
+
readonly cause?: unknown;
|
|
12
13
|
readonly message: string;
|
|
13
14
|
readonly reason: LocalNodeTransportErrorReason;
|
|
14
15
|
}> {
|
package/dist/node/discovery.js
CHANGED
|
@@ -20,7 +20,11 @@ const utf8Decoder = new TextDecoder("utf-8", { fatal: true });
|
|
|
20
20
|
const decodeJson = Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown));
|
|
21
21
|
class LocalNodeTransportError extends Data.TaggedError("LocalNodeTransportError") {
|
|
22
22
|
}
|
|
23
|
-
const makeTransportError = (reason, message) => new LocalNodeTransportError({
|
|
23
|
+
const makeTransportError = (reason, message, cause) => new LocalNodeTransportError({
|
|
24
|
+
...(cause === undefined ? {} : { cause }),
|
|
25
|
+
message,
|
|
26
|
+
reason,
|
|
27
|
+
});
|
|
24
28
|
const failTransport = (reason, message) => Effect.fail(makeTransportError(reason, message));
|
|
25
29
|
const ownedByCurrentUser = (metadata) => typeof process.getuid !== "function" ||
|
|
26
30
|
metadata.uid === BigInt(process.getuid());
|
|
@@ -277,11 +281,15 @@ const resolveDiscoveryLocation = Effect.fn("LocalNodeDiscovery.resolveLocation")
|
|
|
277
281
|
}),
|
|
278
282
|
});
|
|
279
283
|
});
|
|
284
|
+
const isAdmissionSaturation = (error) => error.code === "saturated" ||
|
|
285
|
+
(error.code === "remote_error" &&
|
|
286
|
+
error.remoteError?.code === "saturated" &&
|
|
287
|
+
error.remoteError.saturation === "admission");
|
|
280
288
|
const transportErrorFromStatusFailure = (error) => {
|
|
289
|
+
if (error instanceof MaiaClientError && isAdmissionSaturation(error))
|
|
290
|
+
return makeTransportError("saturated", error.message, error);
|
|
281
291
|
if (error instanceof MaiaClientError &&
|
|
282
|
-
(error.code === "deadline_exceeded" ||
|
|
283
|
-
error.code === "outcome_unknown" ||
|
|
284
|
-
error.code === "saturated")) {
|
|
292
|
+
(error.code === "deadline_exceeded" || error.code === "outcome_unknown")) {
|
|
285
293
|
return makeTransportError(error.code, error.message);
|
|
286
294
|
}
|
|
287
295
|
return makeTransportError("transport_failed", "The discovered Maia local node is unavailable.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maiaos/sdk",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
3
|
+
"version": "0.1.0-canary.33",
|
|
4
4
|
"description": "TypeScript SDK for Maia Node: typed, validated calls to create and drive AI coding agent Sessions (Claude Code, Codex), wait for turns and read receipts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maia",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@maiaos/protocol": "0.1.0-canary.
|
|
75
|
+
"@maiaos/protocol": "0.1.0-canary.33",
|
|
76
76
|
"effect": "4.0.0"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|