@firstlovecenter/ai-chat 0.8.1 → 0.9.1
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 +43 -0
- package/dist/drizzle/index.cjs +24 -16
- package/dist/drizzle/index.cjs.map +1 -1
- package/dist/drizzle/index.d.cts +17 -17
- package/dist/drizzle/index.d.ts +17 -17
- package/dist/drizzle/index.js +24 -16
- package/dist/drizzle/index.js.map +1 -1
- package/dist/prisma/index.cjs +20 -4
- package/dist/prisma/index.cjs.map +1 -1
- package/dist/prisma/index.d.cts +19 -10
- package/dist/prisma/index.d.ts +19 -10
- package/dist/prisma/index.js +20 -4
- package/dist/prisma/index.js.map +1 -1
- package/dist/server/index.cjs +5 -5
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +5 -5
- package/dist/server/index.js.map +1 -1
- package/dist/{types-BnwUkqKb.d.cts → types-BOgBJ7CD.d.cts} +14 -8
- package/dist/{types-BnwUkqKb.d.ts → types-BOgBJ7CD.d.ts} +14 -8
- package/dist/ui/index.cjs +14 -12
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +21 -5
- package/dist/ui/index.d.ts +21 -5
- package/dist/ui/index.js +14 -12
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/chat-models.prisma +7 -3
package/dist/server/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SystemBlock, T as ToolSchema, a as ToolContext, b as ToolDefinition, P as PresentPayload, c as PersistencePort, A as AuthPort, d as ScopePort, e as ToolsPort, V as VertexPort, L as LoggerPort } from '../types-
|
|
2
|
-
export { f as AiSettings, g as AiSettingsPatch, h as AppendMessageInput, i as AuthFail, j as AuthOk, k as AuthResult, B as Block, C as ChartSpec, l as ChatMessage, m as ChatMessageRole, n as ChatSession, o as CreateSessionInput, p as ListSessionsOpts, q as TERMINAL_TOOL_NAME, r as ToolResult, s as err, t as ok } from '../types-
|
|
1
|
+
import { S as SystemBlock, T as ToolSchema, a as ToolContext, b as ToolDefinition, P as PresentPayload, c as PersistencePort, A as AuthPort, d as ScopePort, e as ToolsPort, V as VertexPort, L as LoggerPort } from '../types-BOgBJ7CD.cjs';
|
|
2
|
+
export { f as AiSettings, g as AiSettingsPatch, h as AppendMessageInput, i as AuthFail, j as AuthOk, k as AuthResult, B as Block, C as ChartSpec, l as ChatMessage, m as ChatMessageRole, n as ChatSession, o as CreateSessionInput, p as ListSessionsOpts, q as TERMINAL_TOOL_NAME, r as ToolResult, s as err, t as ok } from '../types-BOgBJ7CD.cjs';
|
|
3
3
|
import { GoogleAuth } from 'google-auth-library';
|
|
4
4
|
export { GoogleAuth } from 'google-auth-library';
|
|
5
5
|
import 'zod';
|
|
@@ -272,7 +272,7 @@ type AgentCustomHooks$1<S> = RouteHooks$1<S> & {
|
|
|
272
272
|
generateSessionId?(args: {
|
|
273
273
|
scope: S;
|
|
274
274
|
userId: number;
|
|
275
|
-
chatSessionId:
|
|
275
|
+
chatSessionId: string | null;
|
|
276
276
|
}): string | Promise<string>;
|
|
277
277
|
/**
|
|
278
278
|
* Runs once after the session id is resolved, before the agent loop.
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SystemBlock, T as ToolSchema, a as ToolContext, b as ToolDefinition, P as PresentPayload, c as PersistencePort, A as AuthPort, d as ScopePort, e as ToolsPort, V as VertexPort, L as LoggerPort } from '../types-
|
|
2
|
-
export { f as AiSettings, g as AiSettingsPatch, h as AppendMessageInput, i as AuthFail, j as AuthOk, k as AuthResult, B as Block, C as ChartSpec, l as ChatMessage, m as ChatMessageRole, n as ChatSession, o as CreateSessionInput, p as ListSessionsOpts, q as TERMINAL_TOOL_NAME, r as ToolResult, s as err, t as ok } from '../types-
|
|
1
|
+
import { S as SystemBlock, T as ToolSchema, a as ToolContext, b as ToolDefinition, P as PresentPayload, c as PersistencePort, A as AuthPort, d as ScopePort, e as ToolsPort, V as VertexPort, L as LoggerPort } from '../types-BOgBJ7CD.js';
|
|
2
|
+
export { f as AiSettings, g as AiSettingsPatch, h as AppendMessageInput, i as AuthFail, j as AuthOk, k as AuthResult, B as Block, C as ChartSpec, l as ChatMessage, m as ChatMessageRole, n as ChatSession, o as CreateSessionInput, p as ListSessionsOpts, q as TERMINAL_TOOL_NAME, r as ToolResult, s as err, t as ok } from '../types-BOgBJ7CD.js';
|
|
3
3
|
import { GoogleAuth } from 'google-auth-library';
|
|
4
4
|
export { GoogleAuth } from 'google-auth-library';
|
|
5
5
|
import 'zod';
|
|
@@ -272,7 +272,7 @@ type AgentCustomHooks$1<S> = RouteHooks$1<S> & {
|
|
|
272
272
|
generateSessionId?(args: {
|
|
273
273
|
scope: S;
|
|
274
274
|
userId: number;
|
|
275
|
-
chatSessionId:
|
|
275
|
+
chatSessionId: string | null;
|
|
276
276
|
}): string | Promise<string>;
|
|
277
277
|
/**
|
|
278
278
|
* Runs once after the session id is resolved, before the agent loop.
|
package/dist/server/index.js
CHANGED
|
@@ -1011,7 +1011,7 @@ function createAgentCustomRoutes(ctx) {
|
|
|
1011
1011
|
);
|
|
1012
1012
|
}
|
|
1013
1013
|
const rawChatSessionId = body?.chatSessionId;
|
|
1014
|
-
const incomingChatSessionId = typeof rawChatSessionId === "
|
|
1014
|
+
const incomingChatSessionId = typeof rawChatSessionId === "string" && rawChatSessionId.length > 0 ? rawChatSessionId : null;
|
|
1015
1015
|
const aiSettings = await persistence.getAiSettings();
|
|
1016
1016
|
const effectiveProjectId = aiSettings.gcpProjectId ?? vertex.projectId;
|
|
1017
1017
|
let chatSessionId;
|
|
@@ -1357,7 +1357,7 @@ function createAgentVercelRoutes(ctx) {
|
|
|
1357
1357
|
);
|
|
1358
1358
|
}
|
|
1359
1359
|
const rawChatSessionId = body?.chatSessionId;
|
|
1360
|
-
const incomingChatSessionId = typeof rawChatSessionId === "
|
|
1360
|
+
const incomingChatSessionId = typeof rawChatSessionId === "string" && rawChatSessionId.length > 0 ? rawChatSessionId : null;
|
|
1361
1361
|
const rawModel = body?.model;
|
|
1362
1362
|
const requestedModel = typeof rawModel === "string" && VALID_MODELS.has(rawModel) ? rawModel : null;
|
|
1363
1363
|
const aiSettings = await persistence.getAiSettings();
|
|
@@ -1595,10 +1595,10 @@ function serializeSession(s) {
|
|
|
1595
1595
|
updatedAt: s.updatedAt ? s.updatedAt.toISOString() : null
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
|
+
var SESSION_ID_RE = /^[A-Za-z0-9_-]{1,32}$/;
|
|
1598
1599
|
function parseSessionId(raw) {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
return id;
|
|
1600
|
+
if (!raw || !SESSION_ID_RE.test(raw)) return null;
|
|
1601
|
+
return raw;
|
|
1602
1602
|
}
|
|
1603
1603
|
function createChatSessionsRoutes(ctx) {
|
|
1604
1604
|
const { persistence, auth, logger, hooks } = ctx;
|