drizzle-cube 0.4.23 → 0.4.25
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/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/{handler-t7Qd1IYi.js → handler-BV2_dul8.js} +1 -1
- package/dist/adapters/{handler-C3hT7g2W.cjs → handler-LMRPeTNJ.cjs} +1 -1
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/{server/index-CFEJ62GJ.js → adapters/index-C3PskWTr.js} +209 -193
- package/dist/{server/index-BIMhF5KZ.cjs → adapters/index-ht4NPca9.cjs} +11 -11
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/adapters/{openai-mLo2MCat.cjs → openai-BvA6eLs8.cjs} +1 -1
- package/dist/adapters/{openai-CUSRuKTk.js → openai-mcE24du8.js} +1 -1
- package/dist/client/chunks/{analysis-builder-DVrv9Q4n.js → analysis-builder-CcV9kB-E.js} +1785 -1783
- package/dist/client/chunks/analysis-builder-CcV9kB-E.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-CrENEvEk.js → analysis-builder-shared-DVnM536Z.js} +18 -16
- package/dist/client/chunks/analysis-builder-shared-DVnM536Z.js.map +1 -0
- package/dist/client/chunks/{components-GzooQM5J.js → components-DAPlOpfn.js} +49 -49
- package/dist/client/chunks/{components-GzooQM5J.js.map → components-DAPlOpfn.js.map} +1 -1
- package/dist/client/components/AgenticNotebook/NotebookCanvas.d.ts +4 -1
- package/dist/client/components/AgenticNotebook/NotebookPortletBlock.d.ts +2 -0
- package/dist/client/components/AnalysisBuilder/types.d.ts +2 -0
- package/dist/client/components.js +3 -3
- package/dist/client/index.js +678 -672
- package/dist/client/index.js.map +1 -1
- package/dist/client/stores/analysisBuilderStore.d.ts +5 -1
- package/dist/client-bundle-stats.html +1 -1
- package/dist/{adapters/index-CFEJ62GJ.js → server/index-C3PskWTr.js} +209 -193
- package/dist/{adapters/index-BIMhF5KZ.cjs → server/index-ht4NPca9.cjs} +11 -11
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/{openai-mLo2MCat.cjs → openai-BvA6eLs8.cjs} +1 -1
- package/dist/server/{openai-CUSRuKTk.js → openai-mcE24du8.js} +1 -1
- package/package.json +1 -1
- package/dist/client/chunks/analysis-builder-DVrv9Q4n.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-CrENEvEk.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`)),x.enqueue(R.encode(f.serializeSseEvent(H,b))),x.close()}}),E=new Headers({"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive",...j});if(s){const x=h(t,s);Object.entries(x).forEach(([g,P])=>E.set(g,P))}return new r.NextResponse(O,{status:200,headers:E})}return C(H,200,j)}catch(m){if(f.isNotification(p))return process.env.NODE_ENV!=="test"&&console.error("Next.js MCP notification processing error:",m),new r.NextResponse(null,{status:202});process.env.NODE_ENV!=="test"&&console.error("Next.js MCP RPC handler error:",m);const S=m?.code??-32603,j=m?.data,H=m.message||"MCP request failed",R=f.buildJsonRpcError(p.id??null,S,H,j);if(w){const b=new TextEncoder,O=f.primeEventId(),E=new ReadableStream({start(g){g.enqueue(b.encode(`id: ${O}
|
|
4
4
|
|
|
5
|
-
`)),g.enqueue(b.encode(f.serializeSseEvent(R,O))),g.close()}}),x=new Headers({"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"});if(s){const g=h(t,s);Object.entries(g).forEach(([P,I])=>x.set(P,I))}return new r.NextResponse(E,{status:200,headers:x})}return C(R,200)}}}function Q(n){const{extractSecurityContext:o,cors:s,agent:c}=n;if(!c)throw new Error("agent config is required for createAgentChatHandler");const d=v(n);return async function(t,e){try{if(t.method!=="POST")return r.NextResponse.json({error:"Method not allowed - use POST"},{status:405});const{handleAgentChat:l}=await Promise.resolve().then(()=>require("../handler-
|
|
5
|
+
`)),g.enqueue(b.encode(f.serializeSseEvent(R,O))),g.close()}}),x=new Headers({"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"});if(s){const g=h(t,s);Object.entries(g).forEach(([P,I])=>x.set(P,I))}return new r.NextResponse(E,{status:200,headers:x})}return C(R,200)}}}function Q(n){const{extractSecurityContext:o,cors:s,agent:c}=n;if(!c)throw new Error("agent config is required for createAgentChatHandler");const d=v(n);return async function(t,e){try{if(t.method!=="POST")return r.NextResponse.json({error:"Method not allowed - use POST"},{status:405});const{handleAgentChat:l}=await Promise.resolve().then(()=>require("../handler-LMRPeTNJ.cjs")),y=await t.json(),{message:u,sessionId:p,history:w}=y;if(!u||typeof u!="string")return r.NextResponse.json({error:"message is required and must be a string"},{status:400});let N=(c.apiKey||"").trim();if(c.allowClientApiKey){const E=t.headers.get("x-agent-api-key");E&&(N=E.trim())}if(!N)return r.NextResponse.json({error:"No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header."},{status:401});const C=c.allowClientApiKey&&t.headers.get("x-agent-provider")||void 0,m=c.allowClientApiKey&&t.headers.get("x-agent-model")||void 0,S=c.allowClientApiKey&&t.headers.get("x-agent-provider-endpoint")||void 0,j=await o(t,e),H=c.buildSystemContext?.(j),R=new TextEncoder,b=new ReadableStream({async start(E){try{const x=l({message:u,sessionId:p,history:w,semanticLayer:d,securityContext:j,agentConfig:c,apiKey:N,systemContext:H,providerOverride:C,modelOverride:m,baseURLOverride:S});for await(const g of x){const P=`data: ${JSON.stringify(g)}
|
|
6
6
|
|
|
7
7
|
`;E.enqueue(R.encode(P))}}catch(x){const g={type:"error",data:{message:x instanceof Error?x.message:"Stream failed"}};E.enqueue(R.encode(`data: ${JSON.stringify(g)}
|
|
8
8
|
|
|
@@ -519,7 +519,7 @@ function oe(n) {
|
|
|
519
519
|
{ error: "Method not allowed - use POST" },
|
|
520
520
|
{ status: 405 }
|
|
521
521
|
);
|
|
522
|
-
const { handleAgentChat: l } = await import("../handler-
|
|
522
|
+
const { handleAgentChat: l } = await import("../handler-BV2_dul8.js"), y = await t.json(), { message: u, sessionId: f, history: C } = y;
|
|
523
523
|
if (!u || typeof u != "string")
|
|
524
524
|
return r.json(
|
|
525
525
|
{ error: "message is required and must be a string" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class c{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{const s=await Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class c{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{const s=await Promise.resolve().then(()=>require("./index-ht4NPca9.cjs"));e=s.default||s.OpenAI||s}catch{throw new Error("openai is required for the OpenAI provider. Install it with: npm install openai")}const t={apiKey:this.apiKey};this.baseURL&&(t.baseURL=this.baseURL),this.client=new e(t),this.initialized=!0}async createStream(e){await this.ensureClient();const{messages:t}=this.formatMessages(e.messages,e.system);return this.client.chat.completions.create({model:e.model,max_completion_tokens:e.maxTokens,tools:this.formatTools(e.tools),messages:t,stream:!0,stream_options:{include_usage:!0}})}async*parseStreamEvents(e){const t=new Map;for await(const s of e){const n=s;n.usage&&(yield{type:"message_meta",inputTokens:n.usage.prompt_tokens,outputTokens:n.usage.completion_tokens,stopReason:""});const l=n.choices?.[0];if(!l)continue;const r=l.delta;if(r){if(r.content&&(yield{type:"text_delta",text:r.content}),r.tool_calls)for(const i of r.tool_calls){const a=i.index??0;if(i.id&&(t.set(a,{id:i.id,name:i.function?.name||"",arguments:""}),yield{type:"tool_use_start",id:i.id,name:i.function?.name||""}),i.function?.name&&t.has(a)){const o=t.get(a);o.name||(o.name=i.function.name)}if(i.function?.arguments){const o=t.get(a);o&&(o.arguments+=i.function.arguments,yield{type:"tool_input_delta",json:i.function.arguments})}}if(l.finish_reason){for(const[i,a]of t){let o={};try{a.arguments&&(o=JSON.parse(a.arguments))}catch{}yield{type:"tool_use_end",id:a.id,input:o},t.delete(i)}yield{type:"message_meta",stopReason:l.finish_reason}}}}}formatTools(e){return e.map(t=>({type:"function",function:{name:t.name,description:t.description,parameters:t.parameters}}))}formatMessages(e,t){const s=[{role:"system",content:t}];for(const n of e)if(n.role==="user")s.push({role:"user",content:typeof n.content=="string"?n.content:JSON.stringify(n.content)});else if(n.role==="assistant")if(typeof n.content=="string")s.push({role:"assistant",content:n.content});else{const l=n.content,r=l.filter(o=>o.type==="text").map(o=>o.text).join(""),i=l.filter(o=>o.type==="tool_use").map(o=>({id:o.id,type:"function",function:{name:o.name,arguments:JSON.stringify(o.input||{})}})),a={role:"assistant"};r&&(a.content=r),i.length>0&&(a.tool_calls=i),s.push(a)}else n.role==="tool"?s.push(n):n.role==="tool_result"&&s.push({role:"user",content:typeof n.content=="string"?n.content:JSON.stringify(n.content)});return{messages:s}}formatToolResults(e){return e.map(t=>({role:"tool",tool_call_id:t.toolUseId,content:t.content}))}shouldContinue(e){return e==="tool_calls"}formatError(e){if(!e||!(e instanceof Error))return"Something went wrong. Please try again.";const t=e.message||"",s=e;return s.status===429?"Too many requests. Please wait a moment and try again.":s.status===401?"Authentication failed. Please check your API key configuration.":s.status===503||s.status===502?"The AI service is temporarily unavailable. Please try again in a moment.":s.status===400?"There was a problem with the request. Please try again.":t.startsWith("{")||t.startsWith("Error: {")?"The AI service encountered an error. Please try again.":t}}exports.OpenAIProvider=c;
|