@meistrari/chat-nuxt 1.2.2 → 1.3.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/README.md +71 -48
- package/dist/module.d.mts +24 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +37 -19
- package/dist/runtime/components/MeistrariChatEmbed.d.vue.ts +3 -1
- package/dist/runtime/components/MeistrariChatEmbed.vue +5 -3
- package/dist/runtime/components/MeistrariChatEmbed.vue.d.ts +3 -1
- package/dist/runtime/components/chat/thinking-indicator.vue +28 -17
- package/dist/runtime/composables/useEmbedConfig.d.ts +5 -0
- package/dist/runtime/composables/useEmbedConfig.js +11 -3
- package/dist/runtime/embed/components/ChatConfigurationModal.vue +8 -6
- package/dist/runtime/embed/components/ChatEmbed.d.vue.ts +3 -1
- package/dist/runtime/embed/components/ChatEmbed.vue +13 -12
- package/dist/runtime/embed/components/ChatEmbed.vue.d.ts +3 -1
- package/dist/runtime/embed/components/ChatEmbedInner.vue +5 -1
- package/dist/runtime/plugins/markstream.d.ts +2 -0
- package/dist/runtime/plugins/markstream.js +5 -0
- package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.js +7 -4
- package/dist/runtime/server/api/conversations/[id]/messages/index.post.js +7 -4
- package/dist/runtime/server/api/conversations/[id]/usage.get.js +1 -1
- package/dist/runtime/server/api/conversations/generate-title.post.js +18 -5
- package/dist/runtime/server/api/workspace/usage.get.js +1 -1
- package/dist/runtime/server/db/index.d.ts +20 -3
- package/dist/runtime/server/db/index.js +87 -10
- package/dist/runtime/server/db/schema/_schema.d.ts +2 -0
- package/dist/runtime/server/db/schema/_schema.js +3 -0
- package/dist/runtime/server/db/schema/conversation-usage.d.ts +1 -1
- package/dist/runtime/server/db/schema/conversation-usage.js +3 -2
- package/dist/runtime/server/db/schema/conversations.d.ts +1 -1
- package/dist/runtime/server/db/schema/conversations.js +3 -2
- package/dist/runtime/server/db/schema/external-skills.d.ts +1 -1
- package/dist/runtime/server/db/schema/external-skills.js +3 -2
- package/dist/runtime/server/db/schema/index.d.ts +1 -0
- package/dist/runtime/server/db/schema/index.js +1 -0
- package/dist/runtime/server/db/schema/messages.d.ts +1 -1
- package/dist/runtime/server/db/schema/messages.js +3 -2
- package/dist/runtime/server/db/schema/workspace-settings.d.ts +1 -1
- package/dist/runtime/server/db/schema/workspace-settings.js +3 -2
- package/dist/runtime/server/plugins/init-db.d.ts +2 -0
- package/dist/runtime/server/plugins/init-db.js +11 -0
- package/dist/runtime/server/utils/billing.d.ts +26 -4
- package/dist/runtime/server/utils/billing.js +52 -13
- package/dist/runtime/server/utils/chat-workspace-settings.js +1 -1
- package/dist/runtime/utils/chat-loading-messages.d.ts +12 -0
- package/dist/runtime/utils/chat-loading-messages.js +40 -0
- package/dist/runtime/utils/features.d.ts +6 -0
- package/dist/runtime/utils/features.js +15 -0
- package/dist/types.d.mts +1 -1
- package/drizzle/0000_material_hiroim.sql +28 -0
- package/drizzle/0001_famous_scalphunter.sql +1 -0
- package/drizzle/0002_gorgeous_big_bertha.sql +1 -0
- package/drizzle/0003_massive_forge.sql +2 -0
- package/drizzle/0004_absent_black_tom.sql +2 -0
- package/drizzle/0005_first_kid_colt.sql +1 -0
- package/drizzle/0006_sloppy_mauler.sql +13 -0
- package/drizzle/0007_grey_rhino.sql +1 -0
- package/drizzle/0008_chilly_blue_blade.sql +27 -0
- package/drizzle/0009_cultured_maddog.sql +16 -0
- package/drizzle/0010_small_barracuda.sql +1 -0
- package/drizzle/0011_fat_lady_mastermind.sql +6 -0
- package/drizzle/0012_puzzling_rick_jones.sql +1 -0
- package/drizzle/0013_blue_gwen_stacy.sql +11 -0
- package/drizzle/meta/0000_snapshot.json +239 -0
- package/drizzle/meta/0001_snapshot.json +245 -0
- package/drizzle/meta/0002_snapshot.json +251 -0
- package/drizzle/meta/0003_snapshot.json +263 -0
- package/drizzle/meta/0004_snapshot.json +275 -0
- package/drizzle/meta/0005_snapshot.json +281 -0
- package/drizzle/meta/0006_snapshot.json +320 -0
- package/drizzle/meta/0007_snapshot.json +326 -0
- package/drizzle/meta/0008_snapshot.json +539 -0
- package/drizzle/meta/0009_snapshot.json +646 -0
- package/drizzle/meta/0010_snapshot.json +653 -0
- package/drizzle/meta/0011_snapshot.json +689 -0
- package/drizzle/meta/0012_snapshot.json +695 -0
- package/drizzle/meta/0013_snapshot.json +699 -0
- package/drizzle/meta/_journal.json +104 -0
- package/package.json +5 -3
- package/dist/runtime/server/tasks/send-daily-usage-report.d.ts +0 -2
- package/dist/runtime/server/tasks/send-daily-usage-report.js +0 -74
- package/dist/runtime/server/utils/auth-api.d.ts +0 -1
- package/dist/runtime/server/utils/auth-api.js +0 -27
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DEFAULT_CHAT_LOADING_MESSAGES: readonly ["Analisando sua pergunta", "Processando informações", "Consultando base de conhecimento", "Organizando ideias", "Elaborando resposta", "Refinando detalhes", "Verificando contexto", "Conectando conceitos", "Preparando resultado", "Quase lá", "Finalizando análise", "Estruturando resposta"];
|
|
2
|
+
export type ChatLoadingMessageMode = 'ordered' | 'random';
|
|
3
|
+
export type ChatLoadingMessagesInput = {
|
|
4
|
+
loadingMessages?: readonly string[] | null;
|
|
5
|
+
loadingMessagesMode?: ChatLoadingMessageMode | null;
|
|
6
|
+
};
|
|
7
|
+
export type ResolvedChatLoadingMessages = {
|
|
8
|
+
mode: ChatLoadingMessageMode;
|
|
9
|
+
messages: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function resolveChatLoadingMessages(input?: ChatLoadingMessagesInput | null): ResolvedChatLoadingMessages;
|
|
12
|
+
export declare function getNextChatLoadingMessageIndex(mode: ChatLoadingMessageMode, messageCount: number, currentIndex: number, random?: () => number): number;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const DEFAULT_CHAT_LOADING_MESSAGES = [
|
|
2
|
+
"Analisando sua pergunta",
|
|
3
|
+
"Processando informa\xE7\xF5es",
|
|
4
|
+
"Consultando base de conhecimento",
|
|
5
|
+
"Organizando ideias",
|
|
6
|
+
"Elaborando resposta",
|
|
7
|
+
"Refinando detalhes",
|
|
8
|
+
"Verificando contexto",
|
|
9
|
+
"Conectando conceitos",
|
|
10
|
+
"Preparando resultado",
|
|
11
|
+
"Quase l\xE1",
|
|
12
|
+
"Finalizando an\xE1lise",
|
|
13
|
+
"Estruturando resposta"
|
|
14
|
+
];
|
|
15
|
+
function normalizeMessages(messages) {
|
|
16
|
+
if (!messages?.length)
|
|
17
|
+
return [];
|
|
18
|
+
return messages.map((message) => message.trim()).filter((message) => message.length > 0);
|
|
19
|
+
}
|
|
20
|
+
export function resolveChatLoadingMessages(input) {
|
|
21
|
+
const loadingMessages = normalizeMessages(input?.loadingMessages);
|
|
22
|
+
if (loadingMessages.length > 0) {
|
|
23
|
+
return {
|
|
24
|
+
mode: input?.loadingMessagesMode === "random" ? "random" : "ordered",
|
|
25
|
+
messages: loadingMessages
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
mode: "ordered",
|
|
30
|
+
messages: DEFAULT_CHAT_LOADING_MESSAGES
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function getNextChatLoadingMessageIndex(mode, messageCount, currentIndex, random = Math.random) {
|
|
34
|
+
if (messageCount <= 1)
|
|
35
|
+
return 0;
|
|
36
|
+
if (mode === "ordered")
|
|
37
|
+
return (currentIndex + 1) % messageCount;
|
|
38
|
+
const nextIndex = Math.floor(random() * (messageCount - 1));
|
|
39
|
+
return nextIndex >= currentIndex ? nextIndex + 1 : nextIndex;
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
const DEFAULTS = {
|
|
3
|
+
usage: true,
|
|
4
|
+
generateTitle: false,
|
|
5
|
+
credentials: false
|
|
6
|
+
};
|
|
7
|
+
export function useChatNuxtFeatures() {
|
|
8
|
+
const config = useRuntimeConfig();
|
|
9
|
+
const features = config.public.chatNuxtFeatures;
|
|
10
|
+
return {
|
|
11
|
+
usage: features?.usage ?? DEFAULTS.usage,
|
|
12
|
+
generateTitle: features?.generateTitle ?? DEFAULTS.generateTitle,
|
|
13
|
+
credentials: features?.credentials ?? DEFAULTS.credentials
|
|
14
|
+
};
|
|
15
|
+
}
|
package/dist/types.d.mts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
CREATE TABLE "conversations" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"workspace_id" text NOT NULL,
|
|
4
|
+
"user_id" text NOT NULL,
|
|
5
|
+
"title" text DEFAULT 'Nova conversa' NOT NULL,
|
|
6
|
+
"thread_session_id" text,
|
|
7
|
+
"canvas_tools" jsonb,
|
|
8
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
9
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE TABLE "messages" (
|
|
13
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
14
|
+
"conversation_id" uuid NOT NULL,
|
|
15
|
+
"role" text NOT NULL,
|
|
16
|
+
"content" text NOT NULL,
|
|
17
|
+
"status" text DEFAULT 'completed',
|
|
18
|
+
"reasoning_data" jsonb,
|
|
19
|
+
"files" jsonb,
|
|
20
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
21
|
+
);
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
ALTER TABLE "messages" ADD CONSTRAINT "messages_conversation_id_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
24
|
+
CREATE INDEX "idx_conversations_workspace" ON "conversations" USING btree ("workspace_id");--> statement-breakpoint
|
|
25
|
+
CREATE INDEX "idx_conversations_user" ON "conversations" USING btree ("user_id");--> statement-breakpoint
|
|
26
|
+
CREATE INDEX "idx_conversations_updated" ON "conversations" USING btree ("updated_at");--> statement-breakpoint
|
|
27
|
+
CREATE INDEX "idx_messages_conversation" ON "messages" USING btree ("conversation_id");--> statement-breakpoint
|
|
28
|
+
CREATE INDEX "idx_messages_created" ON "messages" USING btree ("created_at");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "messages" ADD COLUMN "external_uuid" text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "messages" ADD COLUMN "ttft" text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "messages" ADD COLUMN "updated_at" timestamp with time zone;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS "workspace_settings" (
|
|
2
|
+
"workspace_id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"system_message" text,
|
|
4
|
+
"context_files" jsonb,
|
|
5
|
+
"canvas_tools" jsonb,
|
|
6
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
7
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
8
|
+
);
|
|
9
|
+
--> statement-breakpoint
|
|
10
|
+
ALTER TABLE "conversations" ADD COLUMN IF NOT EXISTS "applied_settings_at" timestamp with time zone;--> statement-breakpoint
|
|
11
|
+
ALTER TABLE "conversations" DROP COLUMN IF EXISTS "canvas_tools";--> statement-breakpoint
|
|
12
|
+
ALTER TABLE "conversations" DROP COLUMN IF EXISTS "system_message";--> statement-breakpoint
|
|
13
|
+
ALTER TABLE "conversations" DROP COLUMN IF EXISTS "context_files";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "workspace_settings" ADD COLUMN IF NOT EXISTS "knowledge_sources" jsonb;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
CREATE TABLE "conversation_usage" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"workspace_id" text NOT NULL,
|
|
4
|
+
"conversation_id" uuid NOT NULL,
|
|
5
|
+
"prompt_tokens" integer NOT NULL,
|
|
6
|
+
"completion_tokens" integer NOT NULL,
|
|
7
|
+
"total_tokens" integer NOT NULL,
|
|
8
|
+
"prompt_cost" numeric(12, 8) NOT NULL,
|
|
9
|
+
"completion_cost" numeric(12, 8) NOT NULL,
|
|
10
|
+
"total_cost" numeric(12, 8) NOT NULL,
|
|
11
|
+
"duration_ms" integer,
|
|
12
|
+
"turns" integer,
|
|
13
|
+
"user_id" text NOT NULL,
|
|
14
|
+
"user_email" text,
|
|
15
|
+
"model" text,
|
|
16
|
+
"session_id" text,
|
|
17
|
+
"metadata" jsonb,
|
|
18
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
19
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
20
|
+
CONSTRAINT "conversation_usage_conversation_id_unique" UNIQUE("conversation_id")
|
|
21
|
+
);
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
ALTER TABLE "conversation_usage" ADD CONSTRAINT "conversation_usage_conversation_id_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
24
|
+
CREATE INDEX "idx_usage_workspace" ON "conversation_usage" USING btree ("workspace_id");--> statement-breakpoint
|
|
25
|
+
CREATE INDEX "idx_usage_workspace_created" ON "conversation_usage" USING btree ("workspace_id","created_at");--> statement-breakpoint
|
|
26
|
+
CREATE INDEX "idx_usage_conversation" ON "conversation_usage" USING btree ("conversation_id");--> statement-breakpoint
|
|
27
|
+
CREATE INDEX "idx_usage_user" ON "conversation_usage" USING btree ("user_id");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
CREATE TABLE "external_skills" (
|
|
2
|
+
"id" serial PRIMARY KEY NOT NULL,
|
|
3
|
+
"workspace_id" text NOT NULL,
|
|
4
|
+
"ref" text NOT NULL,
|
|
5
|
+
"name" text NOT NULL,
|
|
6
|
+
"description" text DEFAULT '' NOT NULL,
|
|
7
|
+
"runtime" text DEFAULT 'unknown' NOT NULL,
|
|
8
|
+
"allowed_tools" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
9
|
+
"is_public" boolean DEFAULT true NOT NULL,
|
|
10
|
+
"added_by_user_id" text NOT NULL,
|
|
11
|
+
"added_by_username" text NOT NULL,
|
|
12
|
+
"added_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
13
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
14
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
15
|
+
CONSTRAINT "external_skills_workspace_ref_unique" UNIQUE("workspace_id","ref")
|
|
16
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "conversations" ADD COLUMN "model" text DEFAULT 'claude-sonnet-4-5';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ALTER TABLE "conversation_usage" ADD COLUMN "cache_read_input_tokens" integer;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "conversation_usage" ADD COLUMN "cache_creation_input_tokens" integer;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "conversation_usage" ADD COLUMN "model_usage" jsonb;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "conversation_usage" ADD COLUMN "duration_api_ms" integer;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "conversation_usage" ADD COLUMN "web_search_requests" integer;--> statement-breakpoint
|
|
6
|
+
ALTER TABLE "conversation_usage" ADD COLUMN "web_fetch_requests" integer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "conversations" ADD COLUMN "applied_settings_snapshot" jsonb;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
CREATE SCHEMA IF NOT EXISTS "chat";
|
|
2
|
+
--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "public"."conversation_usage" SET SCHEMA "chat";
|
|
4
|
+
--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "public"."conversations" SET SCHEMA "chat";
|
|
6
|
+
--> statement-breakpoint
|
|
7
|
+
ALTER TABLE "public"."external_skills" SET SCHEMA "chat";
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "public"."messages" SET SCHEMA "chat";
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
ALTER TABLE "public"."workspace_settings" SET SCHEMA "chat";
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "b7059fdb-e53b-4013-877d-b18a443fe19c",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.conversations": {
|
|
8
|
+
"name": "conversations",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "uuid",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true,
|
|
16
|
+
"default": "gen_random_uuid()"
|
|
17
|
+
},
|
|
18
|
+
"workspace_id": {
|
|
19
|
+
"name": "workspace_id",
|
|
20
|
+
"type": "text",
|
|
21
|
+
"primaryKey": false,
|
|
22
|
+
"notNull": true
|
|
23
|
+
},
|
|
24
|
+
"user_id": {
|
|
25
|
+
"name": "user_id",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true
|
|
29
|
+
},
|
|
30
|
+
"title": {
|
|
31
|
+
"name": "title",
|
|
32
|
+
"type": "text",
|
|
33
|
+
"primaryKey": false,
|
|
34
|
+
"notNull": true,
|
|
35
|
+
"default": "'Nova conversa'"
|
|
36
|
+
},
|
|
37
|
+
"thread_session_id": {
|
|
38
|
+
"name": "thread_session_id",
|
|
39
|
+
"type": "text",
|
|
40
|
+
"primaryKey": false,
|
|
41
|
+
"notNull": false
|
|
42
|
+
},
|
|
43
|
+
"canvas_tools": {
|
|
44
|
+
"name": "canvas_tools",
|
|
45
|
+
"type": "jsonb",
|
|
46
|
+
"primaryKey": false,
|
|
47
|
+
"notNull": false
|
|
48
|
+
},
|
|
49
|
+
"created_at": {
|
|
50
|
+
"name": "created_at",
|
|
51
|
+
"type": "timestamp with time zone",
|
|
52
|
+
"primaryKey": false,
|
|
53
|
+
"notNull": true,
|
|
54
|
+
"default": "now()"
|
|
55
|
+
},
|
|
56
|
+
"updated_at": {
|
|
57
|
+
"name": "updated_at",
|
|
58
|
+
"type": "timestamp with time zone",
|
|
59
|
+
"primaryKey": false,
|
|
60
|
+
"notNull": true,
|
|
61
|
+
"default": "now()"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"indexes": {
|
|
65
|
+
"idx_conversations_workspace": {
|
|
66
|
+
"name": "idx_conversations_workspace",
|
|
67
|
+
"columns": [
|
|
68
|
+
{
|
|
69
|
+
"expression": "workspace_id",
|
|
70
|
+
"isExpression": false,
|
|
71
|
+
"asc": true,
|
|
72
|
+
"nulls": "last"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"isUnique": false,
|
|
76
|
+
"concurrently": false,
|
|
77
|
+
"method": "btree",
|
|
78
|
+
"with": {}
|
|
79
|
+
},
|
|
80
|
+
"idx_conversations_user": {
|
|
81
|
+
"name": "idx_conversations_user",
|
|
82
|
+
"columns": [
|
|
83
|
+
{
|
|
84
|
+
"expression": "user_id",
|
|
85
|
+
"isExpression": false,
|
|
86
|
+
"asc": true,
|
|
87
|
+
"nulls": "last"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"isUnique": false,
|
|
91
|
+
"concurrently": false,
|
|
92
|
+
"method": "btree",
|
|
93
|
+
"with": {}
|
|
94
|
+
},
|
|
95
|
+
"idx_conversations_updated": {
|
|
96
|
+
"name": "idx_conversations_updated",
|
|
97
|
+
"columns": [
|
|
98
|
+
{
|
|
99
|
+
"expression": "updated_at",
|
|
100
|
+
"isExpression": false,
|
|
101
|
+
"asc": true,
|
|
102
|
+
"nulls": "last"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"isUnique": false,
|
|
106
|
+
"concurrently": false,
|
|
107
|
+
"method": "btree",
|
|
108
|
+
"with": {}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"foreignKeys": {},
|
|
112
|
+
"compositePrimaryKeys": {},
|
|
113
|
+
"uniqueConstraints": {},
|
|
114
|
+
"policies": {},
|
|
115
|
+
"checkConstraints": {},
|
|
116
|
+
"isRLSEnabled": false
|
|
117
|
+
},
|
|
118
|
+
"public.messages": {
|
|
119
|
+
"name": "messages",
|
|
120
|
+
"schema": "",
|
|
121
|
+
"columns": {
|
|
122
|
+
"id": {
|
|
123
|
+
"name": "id",
|
|
124
|
+
"type": "uuid",
|
|
125
|
+
"primaryKey": true,
|
|
126
|
+
"notNull": true,
|
|
127
|
+
"default": "gen_random_uuid()"
|
|
128
|
+
},
|
|
129
|
+
"conversation_id": {
|
|
130
|
+
"name": "conversation_id",
|
|
131
|
+
"type": "uuid",
|
|
132
|
+
"primaryKey": false,
|
|
133
|
+
"notNull": true
|
|
134
|
+
},
|
|
135
|
+
"role": {
|
|
136
|
+
"name": "role",
|
|
137
|
+
"type": "text",
|
|
138
|
+
"primaryKey": false,
|
|
139
|
+
"notNull": true
|
|
140
|
+
},
|
|
141
|
+
"content": {
|
|
142
|
+
"name": "content",
|
|
143
|
+
"type": "text",
|
|
144
|
+
"primaryKey": false,
|
|
145
|
+
"notNull": true
|
|
146
|
+
},
|
|
147
|
+
"status": {
|
|
148
|
+
"name": "status",
|
|
149
|
+
"type": "text",
|
|
150
|
+
"primaryKey": false,
|
|
151
|
+
"notNull": false,
|
|
152
|
+
"default": "'completed'"
|
|
153
|
+
},
|
|
154
|
+
"reasoning_data": {
|
|
155
|
+
"name": "reasoning_data",
|
|
156
|
+
"type": "jsonb",
|
|
157
|
+
"primaryKey": false,
|
|
158
|
+
"notNull": false
|
|
159
|
+
},
|
|
160
|
+
"files": {
|
|
161
|
+
"name": "files",
|
|
162
|
+
"type": "jsonb",
|
|
163
|
+
"primaryKey": false,
|
|
164
|
+
"notNull": false
|
|
165
|
+
},
|
|
166
|
+
"created_at": {
|
|
167
|
+
"name": "created_at",
|
|
168
|
+
"type": "timestamp with time zone",
|
|
169
|
+
"primaryKey": false,
|
|
170
|
+
"notNull": true,
|
|
171
|
+
"default": "now()"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"indexes": {
|
|
175
|
+
"idx_messages_conversation": {
|
|
176
|
+
"name": "idx_messages_conversation",
|
|
177
|
+
"columns": [
|
|
178
|
+
{
|
|
179
|
+
"expression": "conversation_id",
|
|
180
|
+
"isExpression": false,
|
|
181
|
+
"asc": true,
|
|
182
|
+
"nulls": "last"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"isUnique": false,
|
|
186
|
+
"concurrently": false,
|
|
187
|
+
"method": "btree",
|
|
188
|
+
"with": {}
|
|
189
|
+
},
|
|
190
|
+
"idx_messages_created": {
|
|
191
|
+
"name": "idx_messages_created",
|
|
192
|
+
"columns": [
|
|
193
|
+
{
|
|
194
|
+
"expression": "created_at",
|
|
195
|
+
"isExpression": false,
|
|
196
|
+
"asc": true,
|
|
197
|
+
"nulls": "last"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"isUnique": false,
|
|
201
|
+
"concurrently": false,
|
|
202
|
+
"method": "btree",
|
|
203
|
+
"with": {}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"foreignKeys": {
|
|
207
|
+
"messages_conversation_id_conversations_id_fk": {
|
|
208
|
+
"name": "messages_conversation_id_conversations_id_fk",
|
|
209
|
+
"tableFrom": "messages",
|
|
210
|
+
"tableTo": "conversations",
|
|
211
|
+
"columnsFrom": [
|
|
212
|
+
"conversation_id"
|
|
213
|
+
],
|
|
214
|
+
"columnsTo": [
|
|
215
|
+
"id"
|
|
216
|
+
],
|
|
217
|
+
"onDelete": "cascade",
|
|
218
|
+
"onUpdate": "no action"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"compositePrimaryKeys": {},
|
|
222
|
+
"uniqueConstraints": {},
|
|
223
|
+
"policies": {},
|
|
224
|
+
"checkConstraints": {},
|
|
225
|
+
"isRLSEnabled": false
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"enums": {},
|
|
229
|
+
"schemas": {},
|
|
230
|
+
"sequences": {},
|
|
231
|
+
"roles": {},
|
|
232
|
+
"policies": {},
|
|
233
|
+
"views": {},
|
|
234
|
+
"_meta": {
|
|
235
|
+
"columns": {},
|
|
236
|
+
"schemas": {},
|
|
237
|
+
"tables": {}
|
|
238
|
+
}
|
|
239
|
+
}
|