actorctl 0.3.0-rc.10 → 0.3.0-rc.11
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/actorctl.js +1 -1
- package/dist/worker/models.ts +12 -3
- package/package.json +2 -2
package/dist/actorctl.js
CHANGED
|
@@ -27145,7 +27145,7 @@ var actorctl = make30("actorctl").pipe(withDescription4("Deploy actors, run thre
|
|
|
27145
27145
|
make30("secrets").pipe(withSubcommands([secretsPut, secretsDelete]))
|
|
27146
27146
|
]));
|
|
27147
27147
|
// package.json
|
|
27148
|
-
var version2 = "0.3.0-rc.
|
|
27148
|
+
var version2 = "0.3.0-rc.11";
|
|
27149
27149
|
|
|
27150
27150
|
// src/main.ts
|
|
27151
27151
|
run5(actorctl, { version: version2 }).pipe(provide4(mergeAll2(layer10, layer12)), runMain2);
|
package/dist/worker/models.ts
CHANGED
|
@@ -51,7 +51,9 @@ export interface ModelRequest {
|
|
|
51
51
|
readonly session?: string
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
const errorJsonCodec = Schema.toCodecJson(AiError.AiError)
|
|
55
|
+
const durationJsonCodec = Schema.toCodecJson(Schema.Duration)
|
|
56
|
+
export type EncodedAiError = typeof errorJsonCodec.Encoded
|
|
55
57
|
export type GenerateResult = { readonly parts: ReadonlyArray<Response.PartEncoded> } | { readonly error: EncodedAiError }
|
|
56
58
|
// The stream body is newline-delimited JSON, one StreamFrame per line. An error frame ends the stream.
|
|
57
59
|
export type StreamFrame = { readonly part: Response.StreamPartEncoded } | { readonly error: EncodedAiError }
|
|
@@ -89,8 +91,15 @@ export interface ModelBinding {
|
|
|
89
91
|
readonly stream: (request: ModelRequest) => Promise<ReadableStream<Uint8Array>>
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
export const encodeAiError = (error: AiError.AiError): EncodedAiError =>
|
|
93
|
-
|
|
94
|
+
export const encodeAiError = (error: AiError.AiError): EncodedAiError => {
|
|
95
|
+
const encoded = Schema.encodeSync(AiError.AiError)(error)
|
|
96
|
+
const reason = encoded.reason._tag === "RateLimitError" && encoded.reason.retryAfter !== undefined
|
|
97
|
+
? { ...encoded.reason, retryAfter: Schema.encodeSync(durationJsonCodec)(encoded.reason.retryAfter) }
|
|
98
|
+
: encoded.reason
|
|
99
|
+
// Basic error encoding retains Redacted markers; JSON serialization sanitizes them before transport.
|
|
100
|
+
return JSON.parse(JSON.stringify({ ...encoded, reason })) as EncodedAiError
|
|
101
|
+
}
|
|
102
|
+
export const decodeAiError = (error: EncodedAiError): AiError.AiError => Schema.decodeSync(errorJsonCodec)(error)
|
|
94
103
|
|
|
95
104
|
// --- Actor side ---
|
|
96
105
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actorctl",
|
|
3
|
-
"version": "0.3.0-rc.
|
|
3
|
+
"version": "0.3.0-rc.11",
|
|
4
4
|
"description": "Deploy actors, run threads, and read events on Tardigrade Cloud.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"tardie": "*"
|
|
27
27
|
},
|
|
28
28
|
"tardigrade": {
|
|
29
|
-
"sourceTree": "
|
|
29
|
+
"sourceTree": "8a79ce80c28915522a625e8e3ec1f9d49f1ba63c"
|
|
30
30
|
}
|
|
31
31
|
}
|