drizzle-cube 0.4.20 → 0.4.22
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/adapters/anthropic-BTkjgFpT.cjs +1 -0
- package/dist/adapters/anthropic-CTu9E801.js +126 -0
- package/dist/adapters/express/index.cjs +6 -6
- package/dist/adapters/express/index.js +119 -116
- package/dist/adapters/fastify/index.cjs +6 -6
- package/dist/adapters/fastify/index.js +113 -110
- package/dist/adapters/google-BAK9pnQf.cjs +2 -0
- package/dist/adapters/google-DficVAsJ.js +146 -0
- package/dist/adapters/{handler-CbDMdSY5.js → handler-9Rdn7zM2.js} +534 -461
- package/dist/adapters/handler-B-tEntiU.cjs +39 -0
- package/dist/adapters/hono/index.cjs +6 -6
- package/dist/adapters/hono/index.js +199 -196
- package/dist/adapters/index-BIMhF5KZ.cjs +23 -0
- package/dist/adapters/index-BgCeQBuN.cjs +2 -0
- package/dist/adapters/index-C45_meK_.js +719 -0
- package/dist/adapters/index-CFEJ62GJ.js +5337 -0
- package/dist/adapters/nextjs/index.cjs +5 -5
- package/dist/adapters/nextjs/index.js +245 -242
- package/dist/adapters/openai-CUSRuKTk.js +131 -0
- package/dist/adapters/openai-mLo2MCat.cjs +1 -0
- package/dist/client/charts.js +12 -12
- package/dist/client/chunks/{RetentionCombinedChart-CLq89aOJ.js → RetentionCombinedChart-BK3NPsHP.js} +2 -2
- package/dist/client/chunks/{RetentionCombinedChart-CLq89aOJ.js.map → RetentionCombinedChart-BK3NPsHP.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-3z9fHE2F.js → analysis-builder-DVrv9Q4n.js} +9 -9
- package/dist/client/chunks/{analysis-builder-3z9fHE2F.js.map → analysis-builder-DVrv9Q4n.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-Da-vlQa_.js → analysis-builder-shared-CrENEvEk.js} +6 -6
- package/dist/client/chunks/{analysis-builder-shared-Da-vlQa_.js.map → analysis-builder-shared-CrENEvEk.js.map} +1 -1
- package/dist/client/chunks/{chart-activity-grid-CPGcTSuh.js → chart-activity-grid-OG6he4YS.js} +2 -2
- package/dist/client/chunks/{chart-activity-grid-CPGcTSuh.js.map → chart-activity-grid-OG6he4YS.js.map} +1 -1
- package/dist/client/chunks/{chart-area-ByJQ7NZd.js → chart-area-TawAd2k9.js} +3 -3
- package/dist/client/chunks/{chart-area-ByJQ7NZd.js.map → chart-area-TawAd2k9.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-dj14frMt.js → chart-bar-D3vtCNQG.js} +2 -2
- package/dist/client/chunks/{chart-bar-dj14frMt.js.map → chart-bar-D3vtCNQG.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-ZatBpatq.js → chart-box-plot-BXwN2rO5.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-ZatBpatq.js.map → chart-box-plot-BXwN2rO5.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-CemotLx-.js → chart-bubble-ZfNe8t5k.js} +2 -2
- package/dist/client/chunks/{chart-bubble-CemotLx-.js.map → chart-bubble-ZfNe8t5k.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-BIR4uGGt.js → chart-candlestick-DmF3haFu.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-BIR4uGGt.js.map → chart-candlestick-DmF3haFu.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-BsAjHe7o.js → chart-data-table-DJZPkArt.js} +4 -4
- package/dist/client/chunks/{chart-data-table-BsAjHe7o.js.map → chart-data-table-DJZPkArt.js.map} +1 -1
- package/dist/client/chunks/{chart-funnel-dofnhD24.js → chart-funnel-CE9x0Io9.js} +2 -2
- package/dist/client/chunks/{chart-funnel-dofnhD24.js.map → chart-funnel-CE9x0Io9.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-CKJJ8m3b.js → chart-gauge-Djs5FWxB.js} +2 -2
- package/dist/client/chunks/{chart-gauge-CKJJ8m3b.js.map → chart-gauge-Djs5FWxB.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-BVuPUKHT.js → chart-heat-map-CqtMkdxd.js} +2 -2
- package/dist/client/chunks/{chart-heat-map-BVuPUKHT.js.map → chart-heat-map-CqtMkdxd.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-DUD3f8vL.js → chart-kpi-delta-DEzA74cL.js} +4 -4
- package/dist/client/chunks/{chart-kpi-delta-DUD3f8vL.js.map → chart-kpi-delta-DEzA74cL.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-iJh-PzsM.js → chart-kpi-number-Bab-BZtX.js} +3 -3
- package/dist/client/chunks/{chart-kpi-number-iJh-PzsM.js.map → chart-kpi-number-Bab-BZtX.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-x6pV9v9Q.js → chart-kpi-text-BkTgckDJ.js} +3 -3
- package/dist/client/chunks/{chart-kpi-text-x6pV9v9Q.js.map → chart-kpi-text-BkTgckDJ.js.map} +1 -1
- package/dist/client/chunks/{chart-line-DzyZkugh.js → chart-line-DhM-Hvu0.js} +3 -3
- package/dist/client/chunks/{chart-line-DzyZkugh.js.map → chart-line-DhM-Hvu0.js.map} +1 -1
- package/dist/client/chunks/{chart-measure-profile-C2IkBG3V.js → chart-measure-profile-4vQxFm69.js} +3 -3
- package/dist/client/chunks/{chart-measure-profile-C2IkBG3V.js.map → chart-measure-profile-4vQxFm69.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-akbfRfb9.js → chart-pie-B86KRcHI.js} +2 -2
- package/dist/client/chunks/{chart-pie-akbfRfb9.js.map → chart-pie-B86KRcHI.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-BaN-Kjww.js → chart-radar-BhDBmJRh.js} +2 -2
- package/dist/client/chunks/{chart-radar-BaN-Kjww.js.map → chart-radar-BhDBmJRh.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-DpptEL3s.js → chart-radial-bar-Brugya8X.js} +2 -2
- package/dist/client/chunks/{chart-radial-bar-DpptEL3s.js.map → chart-radial-bar-Brugya8X.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-CG-3hHmX.js → chart-sankey-D2L8ympI.js} +2 -2
- package/dist/client/chunks/{chart-sankey-CG-3hHmX.js.map → chart-sankey-D2L8ympI.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-l_yTVxF3.js → chart-scatter-CAkbBDkK.js} +2 -2
- package/dist/client/chunks/{chart-scatter-l_yTVxF3.js.map → chart-scatter-CAkbBDkK.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-KhDcKhmZ.js → chart-sunburst-DaxJ-cob.js} +2 -2
- package/dist/client/chunks/{chart-sunburst-KhDcKhmZ.js.map → chart-sunburst-DaxJ-cob.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-CBbiaBXV.js → chart-tree-map-CrDJAvZU.js} +2 -2
- package/dist/client/chunks/{chart-tree-map-CBbiaBXV.js.map → chart-tree-map-CrDJAvZU.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-CX3vx_lI.js → chart-waterfall-BBwSfEKT.js} +3 -3
- package/dist/client/chunks/{chart-waterfall-CX3vx_lI.js.map → chart-waterfall-BBwSfEKT.js.map} +1 -1
- package/dist/client/chunks/{charts-core-CU9u_HtL.js → charts-core-B4Rbfdcn.js} +2 -2
- package/dist/client/chunks/{charts-core-CU9u_HtL.js.map → charts-core-B4Rbfdcn.js.map} +1 -1
- package/dist/client/chunks/{charts-loader-B3tt5oKG.js → charts-loader-DbrwgvCK.js} +25 -25
- package/dist/client/chunks/{charts-loader-B3tt5oKG.js.map → charts-loader-DbrwgvCK.js.map} +1 -1
- package/dist/client/chunks/{components-CMGGxqOB.js → components-GzooQM5J.js} +9 -9
- package/dist/client/chunks/{components-CMGGxqOB.js.map → components-GzooQM5J.js.map} +1 -1
- package/dist/client/chunks/{core-D_8mkGpQ.js → core-Y9e-sNfb.js} +2 -2
- package/dist/client/chunks/{core-D_8mkGpQ.js.map → core-Y9e-sNfb.js.map} +1 -1
- package/dist/client/chunks/{icons-M7shurcH.js → icons-DFJw-2HU.js} +6 -6
- package/dist/client/chunks/{icons-M7shurcH.js.map → icons-DFJw-2HU.js.map} +1 -1
- package/dist/client/chunks/{providers-CgxXm6Ll.js → providers-CCw8Kjlc.js} +2 -2
- package/dist/client/chunks/{providers-CgxXm6Ll.js.map → providers-CCw8Kjlc.js.map} +1 -1
- package/dist/client/chunks/{syntaxHighlighting-BQfjio-i.js → syntaxHighlighting-DAMSW_A6.js} +2 -2
- package/dist/client/chunks/{syntaxHighlighting-BQfjio-i.js.map → syntaxHighlighting-DAMSW_A6.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-Cu1HSjmo.js → useDirtyStateTracking-CjhwBXRw.js} +20 -20
- package/dist/client/chunks/{useDirtyStateTracking-Cu1HSjmo.js.map → useDirtyStateTracking-CjhwBXRw.js.map} +1 -1
- package/dist/client/chunks/useExplainAI-IiW55BaQ.js +182 -0
- package/dist/client/chunks/useExplainAI-IiW55BaQ.js.map +1 -0
- package/dist/client/chunks/{vendor-AVsJ2ni0.js → vendor-B2EH3V58.js} +7 -7
- package/dist/client/chunks/{vendor-AVsJ2ni0.js.map → vendor-B2EH3V58.js.map} +1 -1
- package/dist/client/components/AgenticNotebook/AgentChatPanel.d.ts +3 -0
- package/dist/client/components/AgenticNotebook/index.d.ts +6 -0
- package/dist/client/components.js +1 -1
- package/dist/client/hooks/useAgentChat.d.ts +6 -0
- package/dist/client/hooks/useNotebookLayout.d.ts +8 -0
- package/dist/client/hooks.d.ts +2 -0
- package/dist/client/hooks.js +51 -190
- package/dist/client/hooks.js.map +1 -1
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +926 -764
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.js +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client/utils.js +7 -7
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/anthropic-BTkjgFpT.cjs +1 -0
- package/dist/server/anthropic-CTu9E801.js +126 -0
- package/dist/server/google-BAK9pnQf.cjs +2 -0
- package/dist/server/google-DficVAsJ.js +146 -0
- package/dist/server/index-BIMhF5KZ.cjs +23 -0
- package/dist/server/index-BgCeQBuN.cjs +2 -0
- package/dist/server/index-C45_meK_.js +719 -0
- package/dist/server/index-CFEJ62GJ.js +5337 -0
- package/dist/server/index.cjs +48 -46
- package/dist/server/index.d.ts +37 -10
- package/dist/server/index.js +1974 -1901
- package/dist/server/openai-CUSRuKTk.js +131 -0
- package/dist/server/openai-mLo2MCat.cjs +1 -0
- package/package.json +12 -2
- package/dist/adapters/handler-DtdjM1Vx.cjs +0 -37
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
function l(u) {
|
|
2
|
+
const t = {};
|
|
3
|
+
for (const [e, s] of Object.entries(u))
|
|
4
|
+
if (e === "type" && typeof s == "string")
|
|
5
|
+
t[e] = s.toUpperCase();
|
|
6
|
+
else if (e === "properties" && typeof s == "object" && s !== null) {
|
|
7
|
+
const n = {};
|
|
8
|
+
for (const [a, o] of Object.entries(s))
|
|
9
|
+
typeof o == "object" && o !== null ? n[a] = l(o) : n[a] = o;
|
|
10
|
+
t[e] = n;
|
|
11
|
+
} else e === "items" && typeof s == "object" && s !== null ? t[e] = l(s) : t[e] = s;
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
class p {
|
|
15
|
+
apiKey;
|
|
16
|
+
sdk;
|
|
17
|
+
initialized = !1;
|
|
18
|
+
constructor(t) {
|
|
19
|
+
this.apiKey = t;
|
|
20
|
+
}
|
|
21
|
+
async ensureSDK() {
|
|
22
|
+
if (!this.initialized) {
|
|
23
|
+
try {
|
|
24
|
+
this.sdk = await import(
|
|
25
|
+
/* webpackIgnore: true */
|
|
26
|
+
"./index-C45_meK_.js"
|
|
27
|
+
);
|
|
28
|
+
} catch {
|
|
29
|
+
throw new Error("@google/generative-ai is required for the Google provider. Install it with: npm install @google/generative-ai");
|
|
30
|
+
}
|
|
31
|
+
this.initialized = !0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async createStream(t) {
|
|
35
|
+
await this.ensureSDK();
|
|
36
|
+
const { GoogleGenerativeAI: e } = this.sdk, n = new e(this.apiKey).getGenerativeModel({
|
|
37
|
+
model: t.model,
|
|
38
|
+
systemInstruction: t.system,
|
|
39
|
+
generationConfig: {
|
|
40
|
+
maxOutputTokens: t.maxTokens
|
|
41
|
+
}
|
|
42
|
+
}), { messages: a } = this.formatMessages(t.messages, t.system), o = this.formatTools(t.tools);
|
|
43
|
+
return (await n.generateContentStream({
|
|
44
|
+
contents: a,
|
|
45
|
+
tools: o.length > 0 ? [{ functionDeclarations: o }] : void 0
|
|
46
|
+
})).stream;
|
|
47
|
+
}
|
|
48
|
+
async *parseStreamEvents(t) {
|
|
49
|
+
let e = "stop", s = !1;
|
|
50
|
+
for await (const n of t) {
|
|
51
|
+
const a = n;
|
|
52
|
+
a.usageMetadata && (yield {
|
|
53
|
+
type: "message_meta",
|
|
54
|
+
inputTokens: a.usageMetadata.promptTokenCount,
|
|
55
|
+
outputTokens: a.usageMetadata.candidatesTokenCount,
|
|
56
|
+
stopReason: ""
|
|
57
|
+
});
|
|
58
|
+
const o = a.candidates?.[0];
|
|
59
|
+
if (!o) continue;
|
|
60
|
+
o.finishReason && (o.finishReason === "STOP" ? e = "stop" : o.finishReason === "MAX_TOKENS" ? e = "max_tokens" : e = o.finishReason);
|
|
61
|
+
const i = o.content?.parts;
|
|
62
|
+
if (i) {
|
|
63
|
+
for (const r of i)
|
|
64
|
+
if (r.text && !r.thought && (yield { type: "text_delta", text: r.text }), r.functionCall) {
|
|
65
|
+
s = !0;
|
|
66
|
+
const f = `gemini-tc-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, c = r.thoughtSignature ? { thoughtSignature: r.thoughtSignature } : void 0;
|
|
67
|
+
yield { type: "tool_use_start", id: f, name: r.functionCall.name, ...c ? { metadata: c } : {} }, yield { type: "tool_input_delta", json: JSON.stringify(r.functionCall.args || {}) }, yield { type: "tool_use_end" };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
yield {
|
|
72
|
+
type: "message_meta",
|
|
73
|
+
stopReason: s ? "tool_use" : e
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
formatTools(t) {
|
|
77
|
+
return t.map((e) => ({
|
|
78
|
+
name: e.name,
|
|
79
|
+
description: e.description,
|
|
80
|
+
parameters: l(e.parameters)
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
formatMessages(t, e) {
|
|
84
|
+
const s = [];
|
|
85
|
+
for (const n of t)
|
|
86
|
+
if (n.role === "tool_result") {
|
|
87
|
+
const a = n._toolResults;
|
|
88
|
+
if (a && a.length > 0)
|
|
89
|
+
s.push({
|
|
90
|
+
role: "user",
|
|
91
|
+
parts: a.map((o) => ({
|
|
92
|
+
functionResponse: {
|
|
93
|
+
name: o.toolName || o.toolUseId,
|
|
94
|
+
response: { content: o.content, isError: o.isError || !1 }
|
|
95
|
+
}
|
|
96
|
+
}))
|
|
97
|
+
});
|
|
98
|
+
else {
|
|
99
|
+
const o = typeof n.content == "string" ? n.content : JSON.stringify(n.content);
|
|
100
|
+
o && s.push({ role: "user", parts: [{ text: o }] });
|
|
101
|
+
}
|
|
102
|
+
} else if (n.role === "user") {
|
|
103
|
+
const a = typeof n.content == "string" ? n.content : JSON.stringify(n.content);
|
|
104
|
+
s.push({ role: "user", parts: [{ text: a }] });
|
|
105
|
+
} else if (n.role === "assistant")
|
|
106
|
+
if (typeof n.content == "string")
|
|
107
|
+
s.push({ role: "model", parts: [{ text: n.content }] });
|
|
108
|
+
else {
|
|
109
|
+
const a = n.content, o = [];
|
|
110
|
+
for (const i of a)
|
|
111
|
+
if (i.type === "text" && i.text)
|
|
112
|
+
o.push({ text: i.text });
|
|
113
|
+
else if (i.type === "tool_use") {
|
|
114
|
+
const r = {
|
|
115
|
+
functionCall: {
|
|
116
|
+
name: i.name,
|
|
117
|
+
args: i.input || {}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
i.metadata?.thoughtSignature && (r.thoughtSignature = i.metadata.thoughtSignature), o.push(r);
|
|
121
|
+
}
|
|
122
|
+
o.length > 0 && s.push({ role: "model", parts: o });
|
|
123
|
+
}
|
|
124
|
+
return { messages: s };
|
|
125
|
+
}
|
|
126
|
+
formatToolResults(t) {
|
|
127
|
+
return {
|
|
128
|
+
role: "tool_result",
|
|
129
|
+
content: t.map((e) => `${e.toolName || e.toolUseId}: ${e.content}`).join(`
|
|
130
|
+
`),
|
|
131
|
+
_toolResults: t
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
shouldContinue(t) {
|
|
135
|
+
return t === "tool_use";
|
|
136
|
+
}
|
|
137
|
+
formatError(t) {
|
|
138
|
+
if (!t || !(t instanceof Error))
|
|
139
|
+
return "Something went wrong. Please try again.";
|
|
140
|
+
const e = t.message || "", s = t;
|
|
141
|
+
return s.status === 429 ? "Too many requests. Please wait a moment and try again." : s.status === 403 || s.status === 401 ? "Authentication failed. Please check your API key configuration." : s.status === 503 || s.status === 500 ? "The AI service is temporarily unavailable. Please try again in a moment." : e.includes("SAFETY") ? "The request was blocked by safety filters. Please rephrase your request." : e.includes("RECITATION") ? "The response was blocked due to recitation concerns. Please try a different query." : e.startsWith("{") || e.startsWith("[") ? "The AI service encountered an error. Please try again." : e;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
p as GoogleProvider
|
|
146
|
+
};
|