@guinetik/primitives-ts 0.2.8 → 0.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/dist/chat.types.d.ts +134 -0
- package/dist/chat.types.d.ts.map +1 -0
- package/dist/chat.types.js +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat Types
|
|
3
|
+
* Shared between API and Admin for Claude AI chat functionality
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Available Claude models
|
|
7
|
+
*/
|
|
8
|
+
export declare enum ClaudeModel {
|
|
9
|
+
/** Claude Haiku 3.5 - Fastest, most cost-effective */
|
|
10
|
+
HAIKU_3_5 = "claude-3-5-haiku-20241022",
|
|
11
|
+
/** Claude Sonnet 3.7 - Extended thinking capability */
|
|
12
|
+
SONNET_3_7 = "claude-3-7-sonnet-20250219",
|
|
13
|
+
/** Claude Sonnet 4 - Best model for complex reasoning */
|
|
14
|
+
SONNET_4 = "claude-sonnet-4-20250514",
|
|
15
|
+
/** Claude Opus 4 - Exceptional for specialized complex tasks */
|
|
16
|
+
OPUS_4 = "claude-opus-4-20250514"
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Model metadata for display in UI
|
|
20
|
+
*/
|
|
21
|
+
export interface ClaudeModelInfo {
|
|
22
|
+
/** Model ID */
|
|
23
|
+
id: ClaudeModel;
|
|
24
|
+
/** Display name */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Model description */
|
|
27
|
+
description: string;
|
|
28
|
+
/** Model tier (for cost indication) */
|
|
29
|
+
tier: 'fast' | 'balanced' | 'powerful' | 'expert';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Chat message role
|
|
33
|
+
*/
|
|
34
|
+
export type ChatRole = 'user' | 'assistant';
|
|
35
|
+
/**
|
|
36
|
+
* Chat session document (Firestore)
|
|
37
|
+
*/
|
|
38
|
+
export interface ChatSession {
|
|
39
|
+
/** Session ID (Firestore document ID) */
|
|
40
|
+
id: string;
|
|
41
|
+
/** User ID who created the session */
|
|
42
|
+
userId: string;
|
|
43
|
+
/** Current model for the session */
|
|
44
|
+
model: ClaudeModel;
|
|
45
|
+
/** Session creation timestamp */
|
|
46
|
+
createdAt: Date;
|
|
47
|
+
/** Last update timestamp */
|
|
48
|
+
updatedAt: Date;
|
|
49
|
+
/** Optional session title (first message summary or user-defined) */
|
|
50
|
+
title?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Chat message document (Firestore)
|
|
54
|
+
*/
|
|
55
|
+
export interface ChatMessage {
|
|
56
|
+
/** Message ID (Firestore document ID) */
|
|
57
|
+
id: string;
|
|
58
|
+
/** Parent session ID */
|
|
59
|
+
sessionId: string;
|
|
60
|
+
/** Message role */
|
|
61
|
+
role: ChatRole;
|
|
62
|
+
/** Message content */
|
|
63
|
+
content: string;
|
|
64
|
+
/** Message timestamp */
|
|
65
|
+
timestamp: Date;
|
|
66
|
+
/** Model used for this specific message (for assistant messages) */
|
|
67
|
+
model?: ClaudeModel;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Send message request body
|
|
71
|
+
*/
|
|
72
|
+
export interface SendMessageRequest {
|
|
73
|
+
/** Optional session ID (creates new session if not provided) */
|
|
74
|
+
sessionId?: string;
|
|
75
|
+
/** User message content */
|
|
76
|
+
message: string;
|
|
77
|
+
/** Model to use for response */
|
|
78
|
+
model: ClaudeModel;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Send message response
|
|
82
|
+
*/
|
|
83
|
+
export interface SendMessageResponse {
|
|
84
|
+
/** Session ID (existing or newly created) */
|
|
85
|
+
sessionId: string;
|
|
86
|
+
/** Assistant's response content */
|
|
87
|
+
response: string;
|
|
88
|
+
/** User message ID */
|
|
89
|
+
userMessageId: string;
|
|
90
|
+
/** Assistant message ID */
|
|
91
|
+
assistantMessageId: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get chat sessions response
|
|
95
|
+
*/
|
|
96
|
+
export interface GetChatSessionsResponse {
|
|
97
|
+
/** List of chat sessions */
|
|
98
|
+
sessions: ChatSession[];
|
|
99
|
+
/** Total number of sessions */
|
|
100
|
+
total: number;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get session messages response
|
|
104
|
+
*/
|
|
105
|
+
export interface GetSessionMessagesResponse {
|
|
106
|
+
/** List of messages in the session */
|
|
107
|
+
messages: ChatMessage[];
|
|
108
|
+
/** Total number of messages */
|
|
109
|
+
total: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Create new session request
|
|
113
|
+
*/
|
|
114
|
+
export interface CreateSessionRequest {
|
|
115
|
+
/** Initial model for the session */
|
|
116
|
+
model: ClaudeModel;
|
|
117
|
+
/** Optional session title */
|
|
118
|
+
title?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Create new session response
|
|
122
|
+
*/
|
|
123
|
+
export interface CreateSessionResponse {
|
|
124
|
+
/** Newly created session */
|
|
125
|
+
session: ChatSession;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get available models response
|
|
129
|
+
*/
|
|
130
|
+
export interface GetModelsResponse {
|
|
131
|
+
/** List of available models */
|
|
132
|
+
models: ClaudeModelInfo[];
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=chat.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.types.d.ts","sourceRoot":"","sources":["../src/chat.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,oBAAY,WAAW;IACrB,sDAAsD;IACtD,SAAS,8BAA8B;IAEvC,uDAAuD;IACvD,UAAU,+BAA+B;IAEzC,yDAAyD;IACzD,QAAQ,6BAA6B;IAErC,gEA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;IAC7C,SAAS,EAAE,MAAM,CAAC;IAElB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IAEjB,sBAAsB;IACtB,aAAa,EAAE,MAAM,CAAC;IAEtB,2BAA2B;IAC3B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,4BAA4B;IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;IAExB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,sCAAsC;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;IAExB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,KAAK,EAAE,WAAW,CAAC;IAEnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,4BAA4B;IAC5B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Chat Types
|
|
4
|
+
* Shared between API and Admin for Claude AI chat functionality
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ClaudeModel = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Available Claude models
|
|
10
|
+
*/
|
|
11
|
+
var ClaudeModel;
|
|
12
|
+
(function (ClaudeModel) {
|
|
13
|
+
/** Claude Haiku 3.5 - Fastest, most cost-effective */
|
|
14
|
+
ClaudeModel["HAIKU_3_5"] = "claude-3-5-haiku-20241022";
|
|
15
|
+
/** Claude Sonnet 3.7 - Extended thinking capability */
|
|
16
|
+
ClaudeModel["SONNET_3_7"] = "claude-3-7-sonnet-20250219";
|
|
17
|
+
/** Claude Sonnet 4 - Best model for complex reasoning */
|
|
18
|
+
ClaudeModel["SONNET_4"] = "claude-sonnet-4-20250514";
|
|
19
|
+
/** Claude Opus 4 - Exceptional for specialized complex tasks */
|
|
20
|
+
ClaudeModel["OPUS_4"] = "claude-opus-4-20250514";
|
|
21
|
+
})(ClaudeModel || (exports.ClaudeModel = ClaudeModel = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './website-firestore.types';
|
|
|
15
15
|
export * from './totp.types';
|
|
16
16
|
export * from './deployment-history.types';
|
|
17
17
|
export * from './github.types';
|
|
18
|
+
export * from './chat.types';
|
|
18
19
|
export type { Security, SecurityChallengeOptions, SecurityChallengeResult } from './security.interface';
|
|
19
20
|
export { SecurityLevel } from './security.interface';
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,cAAc,CAAC;AAG7B,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,cAAc,CAAC;AAG7B,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,cAAc,cAAc,CAAC;AAG7B,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -40,5 +40,7 @@ __exportStar(require("./totp.types"), exports);
|
|
|
40
40
|
__exportStar(require("./deployment-history.types"), exports);
|
|
41
41
|
// GitHub API types
|
|
42
42
|
__exportStar(require("./github.types"), exports);
|
|
43
|
+
// Chat system types
|
|
44
|
+
__exportStar(require("./chat.types"), exports);
|
|
43
45
|
var security_interface_1 = require("./security.interface");
|
|
44
46
|
Object.defineProperty(exports, "SecurityLevel", { enumerable: true, get: function () { return security_interface_1.SecurityLevel; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guinetik/primitives-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared TypeScript primitives for Guinetik projects",
|
|
5
5
|
"author": "Guinetik",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"guinetik"
|
|
21
21
|
],
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"typescript": "^5.
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|