@voltro/ai 0.86.0 → 0.88.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/CHANGELOG.md +5484 -0
- package/THIRD-PARTY-NOTICES.md +5352 -524
- package/dist/agent.js +1 -2
- package/dist/agentConstants.js +1 -2
- package/dist/agentExecutor.js +43 -40
- package/dist/aiSettings.js +10 -0
- package/dist/api.js +1 -2
- package/dist/appTools.js +1 -2
- package/dist/budget.js +1 -2
- package/dist/callEvidence.js +1 -2
- package/dist/copilot.js +1 -2
- package/dist/cost.js +1 -2
- package/dist/embed.js +1 -2
- package/dist/embeddingProvider.js +40 -23
- package/dist/eval.js +1 -2
- package/dist/events.js +1 -2
- package/dist/executableModalities.js +1 -2
- package/dist/gateway.js +1 -2
- package/dist/gatewayCatalog.js +1 -2
- package/dist/gatewayMedia.js +1 -2
- package/dist/index.d.ts +49 -2
- package/dist/index.js +41 -41
- package/dist/inferenceDispatch.js +1 -2
- package/dist/inferenceQueue.js +1 -2
- package/dist/jsonOutputValidation.js +1 -2
- package/dist/mcpClient.js +1 -2
- package/dist/mcpTools.js +1 -2
- package/dist/media.js +1 -2
- package/dist/mediaBytes.js +1 -2
- package/dist/mediaCall.js +1 -2
- package/dist/mediaTaskProvider.js +1 -2
- package/dist/middleware.js +1 -2
- package/dist/observe.js +1 -2
- package/dist/prompts.js +1 -2
- package/dist/provider.js +85 -70
- package/dist/realtimeEvent.js +1 -2
- package/dist/realtimeSession.js +1 -2
- package/dist/rerank.js +1 -2
- package/dist/resumableStream.js +2 -3
- package/dist/retrieveReranked.js +1 -2
- package/dist/runAndPersist.js +47 -49
- package/dist/semanticCache.js +1 -2
- package/dist/speechProvider.js +1 -2
- package/dist/streamRegistry.js +1 -2
- package/dist/streamText.js +1 -2
- package/dist/streamTranscribe.js +1 -2
- package/dist/streamWakeups.js +1 -2
- package/dist/structuredEvidence.js +1 -2
- package/dist/test.js +1 -2
- package/dist/threads.js +1 -2
- package/dist/tools.js +1 -2
- package/dist/transcribe.js +1 -2
- package/dist/transcriptionEvent.js +1 -2
- package/dist/workflow.js +1 -2
- package/package.json +13 -12
package/dist/realtimeEvent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/realtimeEvent.ts
|
|
3
3
|
var t = e.String.pipe(e.check(e.isPattern(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/))), n = e.Number.pipe(e.check(e.isFinite()), e.check(e.isGreaterThanOrEqualTo(0))), r = e.Union([
|
|
4
4
|
e.Struct({
|
|
5
5
|
type: e.Literal("input-audio-append"),
|
|
@@ -93,5 +93,4 @@ var t = e.String.pipe(e.check(e.isPattern(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/
|
|
|
93
93
|
transcript: e.optional(e.String)
|
|
94
94
|
})
|
|
95
95
|
]);
|
|
96
|
-
//#endregion
|
|
97
96
|
export { r as RealtimeClientEvent, o as RealtimeServerEvent };
|
package/dist/realtimeSession.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createGateway as r } from "@ai-sdk/gateway";
|
|
|
4
4
|
import { Effect as i, Queue as a, Result as o, Schema as s } from "effect";
|
|
5
5
|
import { defineWebSocket as c } from "@voltro/protocol";
|
|
6
6
|
import { WebSocket as l } from "ws";
|
|
7
|
-
|
|
7
|
+
// src/realtimeSession.ts
|
|
8
8
|
var u = (e) => {
|
|
9
9
|
if (e.name !== "gateway" && e.name !== "openai") throw TypeError(`Provider '${e.name}' does not support realtime sessions. Use 'gateway' or 'openai'.`);
|
|
10
10
|
let t = {
|
|
@@ -150,5 +150,4 @@ var u = (e) => {
|
|
|
150
150
|
let i = JSON.stringify(t);
|
|
151
151
|
return i === void 0 || Buffer.byteLength(i) > n.maxMessageBytes || e.bufferedAmount + Buffer.byteLength(i) > n.maxPendingBytes ? Promise.reject(new p(4409, "Realtime buffer limit exceeded")) : new Promise((t, n) => e.send(i, (e) => e ? n(new p(4502, "Realtime provider failed")) : t()));
|
|
152
152
|
};
|
|
153
|
-
//#endregion
|
|
154
153
|
export { h as defineRealtimeSession, u as resolveRealtimeModel };
|
package/dist/rerank.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { aiGenerationError as e } from "./api.js";
|
|
2
2
|
import { rerank as t } from "ai";
|
|
3
3
|
import { Effect as n } from "effect";
|
|
4
|
-
|
|
4
|
+
// src/rerank.ts
|
|
5
5
|
var r = (t) => n.tryPromise({
|
|
6
6
|
try: async () => {
|
|
7
7
|
let e = t.getText ?? ((e) => String(e)), n = t.provider ?? "mock", r = [...typeof n == "string" ? n === "mock" ? i(t.query, t.documents, e) : await o(n, t.query, t.documents, e, t.model) : await s(n, t.query, t.documents, e, t.model)].sort((e, t) => t.score - e.score);
|
|
@@ -57,5 +57,4 @@ var r = (t) => n.tryPromise({
|
|
|
57
57
|
score: e.score
|
|
58
58
|
}));
|
|
59
59
|
};
|
|
60
|
-
//#endregion
|
|
61
60
|
export { r as rerank };
|
package/dist/resumableStream.js
CHANGED
|
@@ -2,7 +2,7 @@ import { streamText as e } from "./streamText.js";
|
|
|
2
2
|
import { awaitStreamChange as t, hasStreamReaders as n, watchStream as r, withStreamWakeups as i } from "./streamWakeups.js";
|
|
3
3
|
import { Cause as a, Clock as o, Duration as s, Effect as c, Exit as l, Option as u, Stream as d } from "effect";
|
|
4
4
|
import { and as f, boolean as p, eq as m, generateId as h, gt as g, id as _, inSet as v, integer as y, json as b, lt as x, registerRetention as S, retentionTtlMsFromEnv as C, table as w, text as T, timestamp as E } from "@voltro/database";
|
|
5
|
-
|
|
5
|
+
// src/resumableStream.ts
|
|
6
6
|
var D = (e) => e._tag === "done" || e._tag === "error", O = (e, n, i = {}) => {
|
|
7
7
|
let a = i.pollMs ?? 50, l = Math.max(a, i.maxPollMs ?? 1e3);
|
|
8
8
|
if (!Number.isFinite(a) || a <= 0 || !Number.isFinite(l)) throw RangeError("Stream poll intervals must be finite positive milliseconds");
|
|
@@ -227,7 +227,7 @@ var D = (e) => e._tag === "done" || e._tag === "error", O = (e, n, i = {}) => {
|
|
|
227
227
|
seq: e.seq,
|
|
228
228
|
event: e.event,
|
|
229
229
|
createdAt: r
|
|
230
|
-
})));
|
|
230
|
+
})), { returning: "none" });
|
|
231
231
|
}),
|
|
232
232
|
read: (t, n, r) => c.promise(async () => (await e.query({
|
|
233
233
|
table: N,
|
|
@@ -317,5 +317,4 @@ var D = (e) => e._tag === "done" || e._tag === "error", O = (e, n, i = {}) => {
|
|
|
317
317
|
isDone: (t) => c.promise(() => e.exists(s(t)))
|
|
318
318
|
});
|
|
319
319
|
};
|
|
320
|
-
//#endregion
|
|
321
320
|
export { L as DEFAULT_STREAM_LOG_RETENTION_HOURS, N as STREAM_EVENTS_TABLE, P as STREAM_STATE_TABLE, O as consumeResumableStream, V as dataStoreResumableStreamStore, H as gcResumableStreams, M as memoryResumableStreamStore, U as redisResumableStreamStore, A as resumableStream, j as resumableStreamText, k as startResumableProducer, F as streamEventsTable, I as streamStateTable };
|
package/dist/retrieveReranked.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rerank as e } from "./rerank.js";
|
|
2
2
|
import { Effect as t } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/retrieveReranked.ts
|
|
4
4
|
var n = (n) => t.gen(function* () {
|
|
5
5
|
let t = n.candidates ?? 50, r = n.topN ?? 8, i = yield* n.search(t);
|
|
6
6
|
return i.length === 0 ? i : (yield* e({
|
|
@@ -12,5 +12,4 @@ var n = (n) => t.gen(function* () {
|
|
|
12
12
|
...n.model === void 0 ? {} : { model: n.model }
|
|
13
13
|
})).map((e) => e.document);
|
|
14
14
|
});
|
|
15
|
-
//#endregion
|
|
16
15
|
export { n as retrieveReranked };
|
package/dist/runAndPersist.js
CHANGED
|
@@ -3,7 +3,7 @@ import { recordAiUsageBestEffort as t } from "./cost.js";
|
|
|
3
3
|
import { streamText as n } from "./streamText.js";
|
|
4
4
|
import { AGENT_MESSAGES_TABLE as r, AGENT_THREADS_TABLE as i } from "./agentConstants.js";
|
|
5
5
|
import { Effect as a, Stream as o } from "effect";
|
|
6
|
-
|
|
6
|
+
// src/runAndPersist.ts
|
|
7
7
|
var s = (e) => [...e].sort((e, t) => e.order - t.order || e.stepOrder - t.stepOrder).filter((e) => !e.streaming && e.content.length > 0 && (e.role === "user" || e.role === "assistant")).map((e) => e.role === "user" ? {
|
|
8
8
|
role: "user",
|
|
9
9
|
content: e.content
|
|
@@ -29,55 +29,58 @@ var s = (e) => [...e].sort((e, t) => e.order - t.order || e.stepOrder - t.stepOr
|
|
|
29
29
|
content: u(n)
|
|
30
30
|
});
|
|
31
31
|
}), u = (e) => e.filter((e) => e.type === "text").map((e) => e.text).join(""), d = (i, s) => a.gen(function* () {
|
|
32
|
-
let d = yield*
|
|
32
|
+
let d = s.provider ?? (yield* a.try({
|
|
33
|
+
try: () => e(),
|
|
34
|
+
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
35
|
+
})), f = yield* c(i, {
|
|
33
36
|
threadId: s.threadId,
|
|
34
37
|
tenantId: s.tenantId ?? null,
|
|
35
38
|
order: s.order
|
|
36
|
-
}),
|
|
39
|
+
}), p = "", m = "", h = /* @__PURE__ */ new Map(), g = [], _ = [], v = [], y = 0, b = null, x, S = s.throttleMs ?? 100, C = () => {
|
|
37
40
|
let e = [];
|
|
38
|
-
|
|
41
|
+
p.length > 0 && e.push({
|
|
39
42
|
type: "reasoning",
|
|
40
|
-
text: f
|
|
41
|
-
}), p.length > 0 && e.push({
|
|
42
|
-
type: "text",
|
|
43
43
|
text: p
|
|
44
|
+
}), m.length > 0 && e.push({
|
|
45
|
+
type: "text",
|
|
46
|
+
text: m
|
|
44
47
|
});
|
|
45
|
-
for (let t of
|
|
46
|
-
for (let t of h) e.push(t);
|
|
48
|
+
for (let t of h.values()) e.push(t);
|
|
47
49
|
for (let t of g) e.push(t);
|
|
48
50
|
for (let t of _) e.push(t);
|
|
51
|
+
for (let t of v) e.push(t);
|
|
49
52
|
return e;
|
|
50
|
-
},
|
|
53
|
+
}, w = (e) => {
|
|
51
54
|
let t = Date.now();
|
|
52
|
-
return !e && t -
|
|
55
|
+
return !e && t - y < S ? a.void : (y = t, l(i, f, C()));
|
|
53
56
|
};
|
|
54
57
|
yield* n({
|
|
55
58
|
prompt: s.prompt,
|
|
56
59
|
...s.messages === void 0 ? {} : { messages: s.messages },
|
|
57
60
|
...s.system === void 0 ? {} : { system: s.system },
|
|
58
61
|
...s.tools === void 0 ? {} : { tools: s.tools },
|
|
59
|
-
|
|
62
|
+
provider: d,
|
|
60
63
|
...s.maxSteps === void 0 ? {} : { maxSteps: s.maxSteps },
|
|
61
64
|
...s.toolContext === void 0 ? {} : { toolContext: s.toolContext },
|
|
62
65
|
...s.providerOptions === void 0 ? {} : { providerOptions: s.providerOptions }
|
|
63
66
|
}).pipe(o.runForEach((e) => a.gen(function* () {
|
|
64
67
|
switch (e._tag) {
|
|
65
68
|
case "token":
|
|
66
|
-
|
|
69
|
+
m += e.text, yield* w(!1);
|
|
67
70
|
break;
|
|
68
71
|
case "toolCall":
|
|
69
|
-
|
|
72
|
+
h.set(e.id, {
|
|
70
73
|
type: "tool",
|
|
71
74
|
toolCallId: e.id,
|
|
72
75
|
toolName: e.name,
|
|
73
76
|
state: "input-available",
|
|
74
77
|
input: e.input,
|
|
75
78
|
...e.execution === void 0 ? {} : { execution: e.execution }
|
|
76
|
-
}), yield*
|
|
79
|
+
}), yield* w(!0);
|
|
77
80
|
break;
|
|
78
81
|
case "toolResult": {
|
|
79
|
-
let t =
|
|
80
|
-
|
|
82
|
+
let t = h.get(e.id);
|
|
83
|
+
h.set(e.id, {
|
|
81
84
|
type: "tool",
|
|
82
85
|
toolCallId: e.id,
|
|
83
86
|
toolName: e.name,
|
|
@@ -85,64 +88,59 @@ var s = (e) => [...e].sort((e, t) => e.order - t.order || e.stepOrder - t.stepOr
|
|
|
85
88
|
input: t?.input,
|
|
86
89
|
output: e.output,
|
|
87
90
|
...e.error ? { errorText: e.error } : {}
|
|
88
|
-
}), yield*
|
|
91
|
+
}), yield* w(!0);
|
|
89
92
|
break;
|
|
90
93
|
}
|
|
91
94
|
case "reasoning":
|
|
92
|
-
|
|
95
|
+
p += e.text, yield* w(!1);
|
|
93
96
|
break;
|
|
94
97
|
case "source": {
|
|
95
98
|
let { _tag: t, ...n } = e;
|
|
96
|
-
|
|
99
|
+
g.push({
|
|
97
100
|
type: t,
|
|
98
101
|
...n
|
|
99
|
-
}), yield*
|
|
102
|
+
}), yield* w(!0);
|
|
100
103
|
break;
|
|
101
104
|
}
|
|
102
105
|
case "file": {
|
|
103
106
|
let { _tag: t, ...n } = e;
|
|
104
|
-
|
|
107
|
+
_.push({
|
|
105
108
|
type: t,
|
|
106
109
|
...n
|
|
107
|
-
}), yield*
|
|
110
|
+
}), yield* w(!0);
|
|
108
111
|
break;
|
|
109
112
|
}
|
|
110
113
|
case "stepMetadata": {
|
|
111
114
|
let { _tag: t, ...n } = e;
|
|
112
|
-
|
|
115
|
+
v.push({
|
|
113
116
|
type: t,
|
|
114
117
|
...n
|
|
115
|
-
}), yield*
|
|
118
|
+
}), yield* w(!0);
|
|
116
119
|
break;
|
|
117
120
|
}
|
|
118
121
|
case "error":
|
|
119
|
-
|
|
122
|
+
b = e.message;
|
|
120
123
|
break;
|
|
121
|
-
case "done":
|
|
124
|
+
case "done": x = e.usage;
|
|
122
125
|
}
|
|
123
126
|
})));
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
parts:
|
|
127
|
-
content: u(
|
|
127
|
+
let T = C();
|
|
128
|
+
return yield* a.promise(() => i.update(r, f, {
|
|
129
|
+
parts: T,
|
|
130
|
+
content: u(T),
|
|
128
131
|
streaming: !1
|
|
129
|
-
})), s.recordUsage !== !1 &&
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
return y ? yield* a.fail(Error(y)) : u(w);
|
|
132
|
+
})), s.recordUsage !== !1 && x !== void 0 && (yield* t(i, {
|
|
133
|
+
tenantId: s.tenantId ?? null,
|
|
134
|
+
provider: d.name,
|
|
135
|
+
model: d.model ?? "unknown",
|
|
136
|
+
operation: "agent.turn",
|
|
137
|
+
agent: s.agent ?? null,
|
|
138
|
+
requestId: f,
|
|
139
|
+
usage: {
|
|
140
|
+
inputTokens: x.inputTokens,
|
|
141
|
+
outputTokens: x.outputTokens,
|
|
142
|
+
...x.totalTokens === void 0 ? {} : { totalTokens: x.totalTokens }
|
|
143
|
+
}
|
|
144
|
+
})), b ? yield* a.fail(Error(b)) : u(T);
|
|
146
145
|
});
|
|
147
|
-
//#endregion
|
|
148
146
|
export { c as appendStreamingMessage, s as historyToModelMessages, l as patchStreamingMessage, d as runAssistant };
|
package/dist/semanticCache.js
CHANGED
|
@@ -2,7 +2,7 @@ import { generateObject as e, generateText as t } from "./api.js";
|
|
|
2
2
|
import { embed as n } from "./embed.js";
|
|
3
3
|
import { Effect as r, Option as i } from "effect";
|
|
4
4
|
import { rowDep as a, tableDep as o } from "@voltro/cache";
|
|
5
|
-
|
|
5
|
+
// src/semanticCache.ts
|
|
6
6
|
var s = {
|
|
7
7
|
inputTokens: 0,
|
|
8
8
|
outputTokens: 0,
|
|
@@ -62,5 +62,4 @@ var s = {
|
|
|
62
62
|
reset: () => t.clear()
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
//#endregion
|
|
66
65
|
export { m as recordReads, p as semanticGenerateObject, f as semanticGenerateText };
|
package/dist/speechProvider.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/speechProvider.ts
|
|
2
2
|
var e = Symbol.for("@voltro/ai/speechProviders"), t = globalThis, n = () => t[e] ?? (t[e] = /* @__PURE__ */ new Map()), r = [
|
|
3
3
|
"mock",
|
|
4
4
|
"openai",
|
|
@@ -12,5 +12,4 @@ var e = Symbol.for("@voltro/ai/speechProviders"), t = globalThis, n = () => t[e]
|
|
|
12
12
|
}, a = (e) => r.includes(e) && n().has(e), o = (e) => n().get(e), s = () => [...n().keys()].sort(), c = () => {
|
|
13
13
|
n().clear();
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { r as BUILTIN_SPEECH_PROVIDERS, c as clearSpeechProviders, i as registerSpeechProvider, s as registeredSpeechProviders, a as replacesBuiltinSpeechProvider, o as speechProvider };
|
package/dist/streamRegistry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/streamRegistry.ts
|
|
2
2
|
var e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
3
3
|
let n = e.get(t);
|
|
4
4
|
if (n) return n;
|
|
@@ -10,5 +10,4 @@ var e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
|
10
10
|
}, r = (t) => e.has(t), i = (t) => {
|
|
11
11
|
e.delete(t);
|
|
12
12
|
}, a = () => e.size;
|
|
13
|
-
//#endregion
|
|
14
13
|
export { a as activeStreamCount, n as cancelStream, r as isStreamActive, t as registerStream, i as unregisterStream };
|
package/dist/streamText.js
CHANGED
|
@@ -4,7 +4,7 @@ import { aiCallAttributes as r, observeStream as i } from "./observe.js";
|
|
|
4
4
|
import { registerStream as a, unregisterStream as o } from "./streamRegistry.js";
|
|
5
5
|
import { smoothStream as s, stepCountIs as c, streamText as l } from "ai";
|
|
6
6
|
import { Duration as u, Effect as d, Stream as f } from "effect";
|
|
7
|
-
|
|
7
|
+
// src/streamText.ts
|
|
8
8
|
var p = (e) => {
|
|
9
9
|
let t = e?.name, n = String(e?.message ?? e ?? "");
|
|
10
10
|
return t === "AbortError" || t === "TimeoutError" || /\babort(ed)?\b/i.test(n);
|
|
@@ -166,5 +166,4 @@ var p = (e) => {
|
|
|
166
166
|
};
|
|
167
167
|
return n(0);
|
|
168
168
|
};
|
|
169
|
-
//#endregion
|
|
170
169
|
export { _ as streamText, x as streamTextWithFallback, b as streamTextWithRetry };
|
package/dist/streamTranscribe.js
CHANGED
|
@@ -2,7 +2,7 @@ import { providerFromEnv as e, resolveTranscriptionModel as t } from "./provider
|
|
|
2
2
|
import { TranscriptionStreamError as n, TranscriptionStreamEvent as r } from "./transcriptionEvent.js";
|
|
3
3
|
import { experimental_streamTranscribe as i } from "ai";
|
|
4
4
|
import { Effect as a, Schema as o, Stream as s } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/streamTranscribe.ts
|
|
6
6
|
var c = (c) => s.unwrap(a.gen(function* () {
|
|
7
7
|
let l = yield* a.acquireRelease(a.sync(() => new AbortController()), (e) => a.promise(async () => {
|
|
8
8
|
e.abort(), c.audio.locked || await c.audio.cancel().catch(() => {});
|
|
@@ -70,5 +70,4 @@ var c = (c) => s.unwrap(a.gen(function* () {
|
|
|
70
70
|
}));
|
|
71
71
|
return s.concat(h, g);
|
|
72
72
|
}));
|
|
73
|
-
//#endregion
|
|
74
73
|
export { n as TranscriptionStreamError, r as TranscriptionStreamEvent, c as streamTranscribe };
|
package/dist/streamWakeups.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/streamWakeups.ts
|
|
3
3
|
var t = /* @__PURE__ */ new WeakMap(), n = (e, n) => (t.get(e)?.get(n)?.readers ?? 0) > 0, r = (n, r) => e.acquireRelease(e.sync(() => {
|
|
4
4
|
let e = t.get(n);
|
|
5
5
|
e === void 0 && (e = /* @__PURE__ */ new Map(), t.set(n, e));
|
|
@@ -40,5 +40,4 @@ var t = /* @__PURE__ */ new WeakMap(), n = (e, n) => (t.get(e)?.get(n)?.readers
|
|
|
40
40
|
};
|
|
41
41
|
return i;
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { i as awaitStreamChange, n as hasStreamReaders, r as watchStream, a as withStreamWakeups };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeAiCallEvidence as e } from "./callEvidence.js";
|
|
2
2
|
import { wrapLanguageModel as t } from "ai";
|
|
3
|
-
|
|
3
|
+
// src/structuredEvidence.ts
|
|
4
4
|
var n = (n, r) => {
|
|
5
5
|
let i = [];
|
|
6
6
|
return {
|
|
@@ -44,5 +44,4 @@ var n = (n, r) => {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { n as captureStructuredEvidence };
|
package/dist/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MockScript as e, setProviderOverride as t } from "./provider.js";
|
|
2
|
-
|
|
2
|
+
// src/test/index.ts
|
|
3
3
|
var n = (e) => e.turns && e.turns.length > 0 ? e.turns : e.stream && e.stream.length > 0 ? [{ text: e.stream.join("") }] : e.generate ? [{ text: e.generate.text }] : [{ text: "" }], r = (t) => {
|
|
4
4
|
let r = new e(n(t));
|
|
5
5
|
return {
|
|
@@ -36,5 +36,4 @@ var n = (e) => e.turns && e.turns.length > 0 ? e.turns : e.stream && e.stream.le
|
|
|
36
36
|
return t;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
export { a as mockAi, o as throwNTimes, i as useMockAi };
|
package/dist/threads.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AGENT_MESSAGES_TABLE as e, AGENT_THREADS_TABLE as t } from "./agentCons
|
|
|
2
2
|
import { AgentThreadAccessDenied as n } from "./agent.js";
|
|
3
3
|
import { Effect as r } from "effect";
|
|
4
4
|
import { boolean as i, id as a, integer as o, json as s, table as c, text as l, timestamp as u } from "@voltro/database";
|
|
5
|
-
|
|
5
|
+
// src/threads.ts
|
|
6
6
|
var d = c(t, {
|
|
7
7
|
id: a({ prefix: "thread" }),
|
|
8
8
|
tenantId: l().nullable(),
|
|
@@ -88,5 +88,4 @@ var d = c(t, {
|
|
|
88
88
|
skip: void 0,
|
|
89
89
|
projection: void 0
|
|
90
90
|
}))[0] ?? null);
|
|
91
|
-
//#endregion
|
|
92
91
|
export { e as AGENT_MESSAGES_TABLE, t as AGENT_THREADS_TABLE, f as agentMessagesTable, d as agentThreadsTable, h as appendMessage, p as createThread, m as ensureThreadOwned, g as getMessages, _ as getThread };
|
package/dist/tools.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsonSchema as e, tool as t } from "ai";
|
|
2
2
|
import { Context as n, Effect as r, Schema as i } from "effect";
|
|
3
3
|
import { jsonSchemaOf as a } from "@voltro/protocol";
|
|
4
|
-
|
|
4
|
+
// src/tools.ts
|
|
5
5
|
var o = (e, t) => e(t), s = Symbol.for("@voltro/ai/Tool"), c = (e) => ({
|
|
6
6
|
...e,
|
|
7
7
|
[s]: !0
|
|
@@ -64,5 +64,4 @@ var o = (e, t) => e(t), s = Symbol.for("@voltro/ai/Tool"), c = (e) => ({
|
|
|
64
64
|
}
|
|
65
65
|
return o;
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { g as buildSdkTools, c as defineTool, l as isTool, u as resolveToolModuleHandlers };
|
package/dist/transcribe.js
CHANGED
|
@@ -3,7 +3,7 @@ import { aiCallAttributes as n, withAiCallSpan as r } from "./observe.js";
|
|
|
3
3
|
import { aiGenerationError as i } from "./api.js";
|
|
4
4
|
import { experimental_transcribe as a } from "ai";
|
|
5
5
|
import { Effect as o } from "effect";
|
|
6
|
-
|
|
6
|
+
// src/transcribe.ts
|
|
7
7
|
var s = async (e, t) => {
|
|
8
8
|
if ("bytes" in e) return {
|
|
9
9
|
audio: e.bytes,
|
|
@@ -60,5 +60,4 @@ var s = async (e, t) => {
|
|
|
60
60
|
catch: (e) => i(e)
|
|
61
61
|
}));
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
export { l as transcribe };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/transcriptionEvent.ts
|
|
3
3
|
var t = class extends e.TaggedError()("TranscriptionStreamError", {
|
|
4
4
|
reason: e.Literals([
|
|
5
5
|
"input",
|
|
@@ -42,5 +42,4 @@ var t = class extends e.TaggedError()("TranscriptionStreamError", {
|
|
|
42
42
|
durationSec: e.optional(e.Number)
|
|
43
43
|
})
|
|
44
44
|
]);
|
|
45
|
-
//#endregion
|
|
46
45
|
export { t as TranscriptionStreamError, i as TranscriptionStreamEvent };
|
package/dist/workflow.js
CHANGED
|
@@ -8,7 +8,7 @@ import { AI_INFERENCES_TABLE as f, inferenceSignalName as p, offloadedInferenceI
|
|
|
8
8
|
import { Effect as h, Schema as g } from "effect";
|
|
9
9
|
import { eq as _ } from "@voltro/database";
|
|
10
10
|
import { BudgetHoldExpired as v, CurrentWorkflowExecutionId as y, SuspensionUnavailable as b, WorkflowCannotPark as x, awaitSignalSuspending as S, step as C, suspendForBudget as w } from "@voltro/workflow";
|
|
11
|
-
|
|
11
|
+
// src/inferStep.ts
|
|
12
12
|
var T = {
|
|
13
13
|
maxAttempts: 4,
|
|
14
14
|
strategy: "exponential",
|
|
@@ -307,5 +307,4 @@ var T = {
|
|
|
307
307
|
})).pipe(h.tap((e) => j(t, n, "generateObject", e, r.rendered)), h.tap(() => M(t, r.rendered)), h.map((e) => e.object))
|
|
308
308
|
}));
|
|
309
309
|
};
|
|
310
|
-
//#endregion
|
|
311
310
|
export { T as AI_STEP_RETRY, z as AiBudgetMisuseError, F as AiOffloadError, I as AiOffloadMisuseError, D as DEFAULT_AI_BUDGET_NAME, E as DEFAULT_OFFLOAD_TIMEOUT_MS, U as TranscriptionStepResult, K as aiObjectStep, H as aiStep, G as mediaStep, u as promptDigest, O as promptRecordFor, k as resolveStepPrompt, W as transcribeStep };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "Effect-native AI primitives — generateText / generateObject / streamText, tools, agents, media generation, cost tracking + budgets, and provider fallback.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -53,21 +53,22 @@
|
|
|
53
53
|
"node": ">=24.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@ai-sdk/anthropic": "^4.0.
|
|
57
|
-
"@ai-sdk/openai": "^4.0.
|
|
58
|
-
"@voltro/cache": "0.
|
|
59
|
-
"@voltro/database": "0.
|
|
60
|
-
"@voltro/
|
|
61
|
-
"@voltro/
|
|
56
|
+
"@ai-sdk/anthropic": "^4.0.91",
|
|
57
|
+
"@ai-sdk/openai": "^4.0.104",
|
|
58
|
+
"@voltro/cache": "0.88.0",
|
|
59
|
+
"@voltro/database": "0.88.0",
|
|
60
|
+
"@voltro/env": "0.88.0",
|
|
61
|
+
"@voltro/protocol": "0.88.0",
|
|
62
|
+
"@voltro/workflow": "0.88.0",
|
|
62
63
|
"ajv": "^8.20.0",
|
|
63
64
|
"ajv-formats": "^3.0.1",
|
|
64
|
-
"ws": "^8.
|
|
65
|
+
"ws": "^8.22.0"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
|
-
"@ai-sdk/gateway": "^4.0.
|
|
68
|
-
"@ai-sdk/provider": "^4.0.
|
|
69
|
-
"ai": "^7.0.
|
|
70
|
-
"effect": "4.0
|
|
68
|
+
"@ai-sdk/gateway": "^4.0.85",
|
|
69
|
+
"@ai-sdk/provider": "^4.0.17",
|
|
70
|
+
"ai": "^7.0.105",
|
|
71
|
+
"effect": "4.1.0"
|
|
71
72
|
},
|
|
72
73
|
"publishConfig": {
|
|
73
74
|
"access": "public"
|