Skip to content

Commit c949143

Browse files
author
Sebastian Benjamin
committed
Add chat history
1 parent d669a15 commit c949143

15 files changed

Lines changed: 1536 additions & 85 deletions

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/.gradle
1+
.gradle
22
/jbrowse/resources/web/jbrowseApp
3-
/jbrowse/node_modules
3+
node_modules
4+
.claude
45
/intellijBuild
56
/travisSettings.sh
67
index/

mcp/module.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ URL: https://github.com/BimberLab/DiscvrLabKeyModules
55
License: Apache 2.0
66
LicenseURL: http://www.apache.org/licenses/LICENSE-2.0
77
ManageVersion: false
8+
SchemaVersion: 26.001
89
SupportedDatabases: mssql, pgsql
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) 2026 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
CREATE SCHEMA mcp;
18+
19+
CREATE TABLE mcp.chats (
20+
rowId BIGSERIAL NOT NULL,
21+
remoteId VARCHAR(64) NOT NULL,
22+
userId USERID NOT NULL,
23+
title VARCHAR(255),
24+
status VARCHAR(20) NOT NULL DEFAULT 'regular',
25+
created TIMESTAMP NOT NULL,
26+
modified TIMESTAMP NOT NULL,
27+
CONSTRAINT PK_mcp_chats PRIMARY KEY (rowId),
28+
CONSTRAINT UQ_mcp_chats_remoteId UNIQUE (remoteId)
29+
);
30+
31+
CREATE INDEX IX_mcp_chats_user ON mcp.chats (userId, status, modified);
32+
33+
CREATE TABLE mcp.chatMessages (
34+
rowId BIGSERIAL NOT NULL,
35+
chatId BIGINT NOT NULL,
36+
messageId VARCHAR(64) NOT NULL,
37+
parentId VARCHAR(64),
38+
sequence INT NOT NULL,
39+
format VARCHAR(32) NOT NULL,
40+
content TEXT NOT NULL,
41+
created TIMESTAMP NOT NULL,
42+
CONSTRAINT PK_mcp_chatMessages PRIMARY KEY (rowId),
43+
CONSTRAINT FK_mcp_chatMessages_chatId FOREIGN KEY (chatId) REFERENCES mcp.chats(rowId),
44+
CONSTRAINT UQ_mcp_chatMessages UNIQUE (chatId, messageId)
45+
);
46+
47+
CREATE INDEX IX_mcp_chatMessages_chat ON mcp.chatMessages (chatId, sequence);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2026 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
CREATE SCHEMA mcp;
18+
GO
19+
20+
CREATE TABLE mcp.chats (
21+
rowId BIGINT IDENTITY(1,1) NOT NULL,
22+
remoteId NVARCHAR(64) NOT NULL,
23+
userId USERID NOT NULL,
24+
title NVARCHAR(255) NULL,
25+
status NVARCHAR(20) NOT NULL CONSTRAINT DF_mcp_chats_status DEFAULT 'regular',
26+
created DATETIME NOT NULL,
27+
modified DATETIME NOT NULL,
28+
CONSTRAINT PK_mcp_chats PRIMARY KEY (rowId),
29+
CONSTRAINT UQ_mcp_chats_remoteId UNIQUE (remoteId)
30+
);
31+
GO
32+
33+
CREATE INDEX IX_mcp_chats_user ON mcp.chats (userId, status, modified);
34+
GO
35+
36+
CREATE TABLE mcp.chatMessages (
37+
rowId BIGINT IDENTITY(1,1) NOT NULL,
38+
chatId BIGINT NOT NULL,
39+
messageId NVARCHAR(64) NOT NULL,
40+
parentId NVARCHAR(64) NULL,
41+
sequence INT NOT NULL,
42+
format NVARCHAR(32) NOT NULL,
43+
content NVARCHAR(MAX) NOT NULL,
44+
created DATETIME NOT NULL,
45+
CONSTRAINT PK_mcp_chatMessages PRIMARY KEY (rowId),
46+
CONSTRAINT FK_mcp_chatMessages_chatId FOREIGN KEY (chatId) REFERENCES mcp.chats(rowId),
47+
CONSTRAINT UQ_mcp_chatMessages UNIQUE (chatId, messageId)
48+
);
49+
GO
50+
51+
CREATE INDEX IX_mcp_chatMessages_chat ON mcp.chatMessages (chatId, sequence);
52+
GO

0 commit comments

Comments
 (0)