@guinetik/primitives-ts 0.2.9 → 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/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1,99 +1,134 @@
1
1
  /**
2
- * Chat types for Claude AI integration in Guinetik Admin Panel
3
- * Based on feature spec from TL agent grooming
2
+ * Chat Types
3
+ * Shared between API and Admin for Claude AI chat functionality
4
4
  */
5
5
  /**
6
- * Available Claude models for chat
6
+ * Available Claude models
7
7
  */
8
8
  export declare enum ClaudeModel {
9
+ /** Claude Haiku 3.5 - Fastest, most cost-effective */
9
10
  HAIKU_3_5 = "claude-3-5-haiku-20241022",
11
+ /** Claude Sonnet 3.7 - Extended thinking capability */
10
12
  SONNET_3_7 = "claude-3-7-sonnet-20250219",
13
+ /** Claude Sonnet 4 - Best model for complex reasoning */
11
14
  SONNET_4 = "claude-sonnet-4-20250514",
15
+ /** Claude Opus 4 - Exceptional for specialized complex tasks */
12
16
  OPUS_4 = "claude-opus-4-20250514"
13
17
  }
14
18
  /**
15
- * Chat session document stored in Firestore
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)
16
37
  */
17
38
  export interface ChatSession {
39
+ /** Session ID (Firestore document ID) */
18
40
  id: string;
41
+ /** User ID who created the session */
19
42
  userId: string;
43
+ /** Current model for the session */
44
+ model: ClaudeModel;
45
+ /** Session creation timestamp */
20
46
  createdAt: Date;
47
+ /** Last update timestamp */
21
48
  updatedAt: Date;
49
+ /** Optional session title (first message summary or user-defined) */
22
50
  title?: string;
23
- model: string;
24
51
  }
25
52
  /**
26
- * Chat message document stored in Firestore
53
+ * Chat message document (Firestore)
27
54
  */
28
55
  export interface ChatMessage {
56
+ /** Message ID (Firestore document ID) */
29
57
  id: string;
58
+ /** Parent session ID */
30
59
  sessionId: string;
31
- role: 'user' | 'assistant';
60
+ /** Message role */
61
+ role: ChatRole;
62
+ /** Message content */
32
63
  content: string;
64
+ /** Message timestamp */
33
65
  timestamp: Date;
34
- model: string;
66
+ /** Model used for this specific message (for assistant messages) */
67
+ model?: ClaudeModel;
35
68
  }
36
69
  /**
37
- * Request payload for sending a chat message
70
+ * Send message request body
38
71
  */
39
- export interface SendChatMessageRequest {
72
+ export interface SendMessageRequest {
73
+ /** Optional session ID (creates new session if not provided) */
40
74
  sessionId?: string;
75
+ /** User message content */
41
76
  message: string;
42
- model: string;
77
+ /** Model to use for response */
78
+ model: ClaudeModel;
43
79
  }
44
80
  /**
45
- * Response from sending a chat message
81
+ * Send message response
46
82
  */
47
- export interface SendChatMessageResponse {
83
+ export interface SendMessageResponse {
84
+ /** Session ID (existing or newly created) */
48
85
  sessionId: string;
86
+ /** Assistant's response content */
49
87
  response: string;
50
- messageId: string;
51
- }
52
- /**
53
- * Request payload for creating a new chat session
54
- */
55
- export interface CreateChatSessionRequest {
56
- model: string;
57
- }
58
- /**
59
- * Response from creating a new chat session
60
- */
61
- export interface CreateChatSessionResponse {
62
- sessionId: string;
88
+ /** User message ID */
89
+ userMessageId: string;
90
+ /** Assistant message ID */
91
+ assistantMessageId: string;
63
92
  }
64
93
  /**
65
- * Response for listing chat sessions
94
+ * Get chat sessions response
66
95
  */
67
- export interface ListChatSessionsResponse {
96
+ export interface GetChatSessionsResponse {
97
+ /** List of chat sessions */
68
98
  sessions: ChatSession[];
99
+ /** Total number of sessions */
100
+ total: number;
69
101
  }
70
102
  /**
71
- * Response for listing messages in a session
103
+ * Get session messages response
72
104
  */
73
- export interface ListChatMessagesResponse {
105
+ export interface GetSessionMessagesResponse {
106
+ /** List of messages in the session */
74
107
  messages: ChatMessage[];
108
+ /** Total number of messages */
109
+ total: number;
75
110
  }
76
111
  /**
77
- * Model information for the models endpoint
112
+ * Create new session request
78
113
  */
79
- export interface ChatModel {
80
- id: string;
81
- name: string;
82
- description: string;
114
+ export interface CreateSessionRequest {
115
+ /** Initial model for the session */
116
+ model: ClaudeModel;
117
+ /** Optional session title */
118
+ title?: string;
83
119
  }
84
120
  /**
85
- * Response for listing available models
121
+ * Create new session response
86
122
  */
87
- export interface ListChatModelsResponse {
88
- models: ChatModel[];
123
+ export interface CreateSessionResponse {
124
+ /** Newly created session */
125
+ session: ChatSession;
89
126
  }
90
127
  /**
91
- * Chat service configuration
128
+ * Get available models response
92
129
  */
93
- export interface ChatConfig {
94
- maxTokens: number;
95
- systemPrompt: string;
96
- rateLimitRpm: number;
97
- maxMessageLength: number;
130
+ export interface GetModelsResponse {
131
+ /** List of available models */
132
+ models: ClaudeModelInfo[];
98
133
  }
99
134
  //# sourceMappingURL=chat.types.d.ts.map
@@ -1 +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,SAAS,8BAA8B;IACvC,UAAU,+BAA+B;IACzC,QAAQ,6BAA6B;IACrC,MAAM,2BAA2B;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
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;IACz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WAAW,mBAAmB;IAClC,6CAA6C;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"}
@@ -1,17 +1,21 @@
1
1
  "use strict";
2
2
  /**
3
- * Chat types for Claude AI integration in Guinetik Admin Panel
4
- * Based on feature spec from TL agent grooming
3
+ * Chat Types
4
+ * Shared between API and Admin for Claude AI chat functionality
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ClaudeModel = void 0;
8
8
  /**
9
- * Available Claude models for chat
9
+ * Available Claude models
10
10
  */
11
11
  var ClaudeModel;
12
12
  (function (ClaudeModel) {
13
+ /** Claude Haiku 3.5 - Fastest, most cost-effective */
13
14
  ClaudeModel["HAIKU_3_5"] = "claude-3-5-haiku-20241022";
15
+ /** Claude Sonnet 3.7 - Extended thinking capability */
14
16
  ClaudeModel["SONNET_3_7"] = "claude-3-7-sonnet-20250219";
17
+ /** Claude Sonnet 4 - Best model for complex reasoning */
15
18
  ClaudeModel["SONNET_4"] = "claude-sonnet-4-20250514";
19
+ /** Claude Opus 4 - Exceptional for specialized complex tasks */
16
20
  ClaudeModel["OPUS_4"] = "claude-opus-4-20250514";
17
21
  })(ClaudeModel || (exports.ClaudeModel = ClaudeModel = {}));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
File without changes
File without changes
package/dist/index.js CHANGED
@@ -40,7 +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 types for Claude AI integration
43
+ // Chat system types
44
44
  __exportStar(require("./chat.types"), exports);
45
45
  var security_interface_1 = require("./security.interface");
46
46
  Object.defineProperty(exports, "SecurityLevel", { enumerable: true, get: function () { return security_interface_1.SecurityLevel; } });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guinetik/primitives-ts",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "Shared TypeScript primitives for Guinetik projects",
5
5
  "author": "Guinetik",
6
6
  "license": "MIT",