@guinetik/primitives-ts 0.8.3 → 0.9.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 +99 -25
- package/dist/access.types.d.ts +1 -1
- package/dist/access.types.d.ts.map +1 -1
- package/dist/access.types.js +2 -0
- package/dist/access.types.spec.js +8 -1
- package/dist/chat.types.d.ts +11 -11
- package/dist/chat.types.d.ts.map +1 -1
- package/dist/chat.types.js +8 -8
- package/dist/chat.types.spec.js +19 -19
- package/dist/email.types.d.ts +111 -0
- package/dist/email.types.d.ts.map +1 -0
- package/dist/email.types.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/type-guards.spec.js +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,31 +40,105 @@ const metrics: SystemMetrics = {
|
|
|
40
40
|
};
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
## Concept Catalog
|
|
44
|
+
|
|
45
|
+
`primitives-ts` is the contract layer of the Guinetik stack. Every type below is
|
|
46
|
+
consumed by at least two of: the NestJS API, the Vue admin panel, the Firestore
|
|
47
|
+
migration tooling, and guinetik.com itself.
|
|
48
|
+
|
|
49
|
+
```mermaid
|
|
50
|
+
flowchart LR
|
|
51
|
+
P[primitives-ts]
|
|
52
|
+
P --> ID[Identity]
|
|
53
|
+
P --> CO[Content]
|
|
54
|
+
P --> OP[Operations]
|
|
55
|
+
P --> AS[Assistant]
|
|
56
|
+
P --> ST[Storage]
|
|
57
|
+
|
|
58
|
+
ID --> ID1[auth]
|
|
59
|
+
ID --> ID2[access]
|
|
60
|
+
ID --> ID3[totp]
|
|
61
|
+
ID --> ID4[security]
|
|
62
|
+
|
|
63
|
+
CO --> CO1[website]
|
|
64
|
+
CO --> CO2[launchpad]
|
|
65
|
+
CO --> CO3[files]
|
|
66
|
+
|
|
67
|
+
OP --> OP1[system]
|
|
68
|
+
OP --> OP2[agents]
|
|
69
|
+
OP --> OP3[deployments]
|
|
70
|
+
OP --> OP4[github]
|
|
71
|
+
|
|
72
|
+
AS --> AS1[chat]
|
|
73
|
+
AS --> AS2[guards]
|
|
74
|
+
|
|
75
|
+
ST --> ST1[firestore]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### How the domains relate
|
|
79
|
+
|
|
80
|
+
```mermaid
|
|
81
|
+
flowchart LR
|
|
82
|
+
A[auth<br/>who you are] --> B[access<br/>what you may do]
|
|
83
|
+
T[totp<br/>second factor] --> A
|
|
84
|
+
B --> F[FeatureKey]
|
|
85
|
+
F --> C[Content]
|
|
86
|
+
F --> O[Operations]
|
|
87
|
+
F --> X[Assistant]
|
|
88
|
+
C --> S[(firestore)]
|
|
89
|
+
X --> S
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Authentication proves identity, access control turns that identity into a set of
|
|
93
|
+
`FeatureKey` grants, and every other domain is gated by one of those keys. The
|
|
94
|
+
Firestore document types are the persisted shape of whatever the other domains
|
|
95
|
+
produce.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Identity & Access
|
|
100
|
+
|
|
101
|
+
| Module | Key exports | Purpose |
|
|
102
|
+
| --- | --- | --- |
|
|
103
|
+
| `auth.types` | `User`, `AuthResponse`, `LoginPayload`, `AuthProvider`, `UserProvider` | Firebase-backed sign-in, email or Google |
|
|
104
|
+
| `access.types` | `AdminRole`, `FeatureKey`, `FEATURE_CATALOG`, `AdminUser`, `userHasFeature` | Role plus per-feature grants for the admin panel |
|
|
105
|
+
| `totp.types` | `TotpSetupResponse`, `TotpVerifyRequest`, `TotpStatusResponse` | Time-based one-time password enrolment and checks |
|
|
106
|
+
| `security.interface` | `Security`, `SecurityLevel`, `SecurityChallengeResult` | Provider-agnostic challenge contract |
|
|
107
|
+
|
|
108
|
+
An `AdminUser` is an `admin` or a `guest`; a guest sees only the features
|
|
109
|
+
explicitly granted to it. The nine grantable features are `dashboard`, `site`,
|
|
110
|
+
`runtime`, `files`, `launchpad`, `users`, `system`, `chat` and `agents`.
|
|
111
|
+
|
|
112
|
+
### Content
|
|
113
|
+
|
|
114
|
+
| Module | Key exports | Purpose |
|
|
115
|
+
| --- | --- | --- |
|
|
116
|
+
| `website.types` | `SiteContent`, `SiteMetadata`, `SiteSections`, `Menu`, `Theme`, `Card` | Everything guinetik.com renders |
|
|
117
|
+
| `website-firestore.types` | `ProjectDocument`, `DemoDocument`, `FIRESTORE_COLLECTIONS` | The stored counterparts of the above |
|
|
118
|
+
| `launchpad.types` | `LaunchpadBoard`, `LaunchpadGroup`, `LaunchpadItem` | Bookmark board grouping and layout |
|
|
119
|
+
| `file.types` | `FileMetadata`, `FileUploadResponse`, `FileUploadProgress` | Uploads and their lifecycle |
|
|
120
|
+
|
|
121
|
+
### Operations
|
|
122
|
+
|
|
123
|
+
| Module | Key exports | Purpose |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| `system.types` | `SystemMetrics`, `Container`, `LogEntry`, `NetworkStats`, `CommandResult` | Host and Docker telemetry |
|
|
126
|
+
| `agent.types` | `AgentInfo`, `AgentStatus`, `AgentTask`, `AgentTasksResponse` | Autonomous agent fleet monitoring |
|
|
127
|
+
| `deployment-history.types` | `DeploymentRecord`, `DeploymentHistoryResponse` | What shipped, when, and whether it held |
|
|
128
|
+
| `github.types` | `GitHubRepository`, `GitHubOwner`, `GitHubLicense` | The subset of the GitHub REST shape we consume |
|
|
129
|
+
|
|
130
|
+
### Assistant
|
|
131
|
+
|
|
132
|
+
| Module | Key exports | Purpose |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| `chat.types` | `ChatSession`, `ChatMessage`, `ClaudeModel`, `SendMessageRequest` | Session-based chat with model selection |
|
|
135
|
+
| `type-guards` | `isChatMessage`, `isChatSession`, `isModel`, `isClaudeModel` | Runtime validation at the API boundary |
|
|
136
|
+
|
|
137
|
+
### Storage
|
|
138
|
+
|
|
139
|
+
| Module | Key exports | Purpose |
|
|
140
|
+
| --- | --- | --- |
|
|
141
|
+
| `firestore.types` | `FirestoreDocument`, `FirestoreCollection` | Base document shape every stored type extends |
|
|
68
142
|
|
|
69
143
|
## Development
|
|
70
144
|
|
package/dist/access.types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type AdminUserStatus = 'invited' | 'active' | 'disabled';
|
|
|
9
9
|
/** Avatar resolution strategy for admin users. */
|
|
10
10
|
export type AvatarSource = 'gravatar' | 'google' | 'custom';
|
|
11
11
|
/** Feature keys that gate admin panel pages and API areas. */
|
|
12
|
-
export type FeatureKey = 'dashboard' | 'site' | 'runtime' | 'files' | 'launchpad' | 'users' | 'system' | 'chat' | 'agents';
|
|
12
|
+
export type FeatureKey = 'dashboard' | 'site' | 'runtime' | 'files' | 'launchpad' | 'users' | 'system' | 'chat' | 'agents' | 'email';
|
|
13
13
|
/** Canonical ordered list of grantable features. */
|
|
14
14
|
export declare const FEATURE_CATALOG: readonly FeatureKey[];
|
|
15
15
|
/** Human-readable labels for feature checklist UI. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.types.d.ts","sourceRoot":"","sources":["../src/access.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,+CAA+C;AAC/C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,oDAAoD;AACpD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,Q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AAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,OAAO,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,CAAC,EAClD,OAAO,EAAE,UAAU,GAClB,OAAO,CAGT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,CAAC,EAClD,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,OAAO,CAGT"}
|
package/dist/access.types.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.FEATURE_CATALOG = [
|
|
|
21
21
|
'system',
|
|
22
22
|
'chat',
|
|
23
23
|
'agents',
|
|
24
|
+
'email',
|
|
24
25
|
];
|
|
25
26
|
/** Human-readable labels for feature checklist UI. */
|
|
26
27
|
exports.FEATURE_LABELS = {
|
|
@@ -33,6 +34,7 @@ exports.FEATURE_LABELS = {
|
|
|
33
34
|
system: 'System monitoring',
|
|
34
35
|
chat: 'Chat',
|
|
35
36
|
agents: 'Agents',
|
|
37
|
+
email: 'Email',
|
|
36
38
|
};
|
|
37
39
|
/**
|
|
38
40
|
* Returns true when the value is a known feature key.
|
|
@@ -33,6 +33,13 @@ describe('access.types', () => {
|
|
|
33
33
|
});
|
|
34
34
|
it('exposes a stable feature catalog', () => {
|
|
35
35
|
expect(access_types_1.FEATURE_CATALOG).toContain('users');
|
|
36
|
-
expect(access_types_1.FEATURE_CATALOG.length).toBe(
|
|
36
|
+
expect(access_types_1.FEATURE_CATALOG.length).toBe(10);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('email feature key', () => {
|
|
40
|
+
it('includes email in the catalog with a label', () => {
|
|
41
|
+
expect(access_types_1.FEATURE_CATALOG).toContain('email');
|
|
42
|
+
expect(access_types_1.FEATURE_LABELS.email).toBe('Email');
|
|
43
|
+
expect((0, access_types_1.isFeatureKey)('email')).toBe(true);
|
|
37
44
|
});
|
|
38
45
|
});
|
package/dist/chat.types.d.ts
CHANGED
|
@@ -20,14 +20,14 @@ export interface Model {
|
|
|
20
20
|
* @deprecated Use Model type instead
|
|
21
21
|
*/
|
|
22
22
|
export declare enum ClaudeModel {
|
|
23
|
-
/** Claude Haiku
|
|
24
|
-
|
|
25
|
-
/** Claude Sonnet
|
|
26
|
-
|
|
27
|
-
/** Claude
|
|
28
|
-
|
|
29
|
-
/** Claude
|
|
30
|
-
|
|
23
|
+
/** Claude Haiku 4.5 - Fastest, most cost-effective */
|
|
24
|
+
HAIKU_4_5 = "claude-haiku-4-5",
|
|
25
|
+
/** Claude Sonnet 5 - Balanced performance and quality */
|
|
26
|
+
SONNET_5 = "claude-sonnet-5",
|
|
27
|
+
/** Claude Opus 5 - Powerful reasoning, adaptive thinking on by default */
|
|
28
|
+
OPUS_5 = "claude-opus-5",
|
|
29
|
+
/** Claude Fable 5 - Most capable model, premium pricing */
|
|
30
|
+
FABLE_5 = "claude-fable-5"
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Model metadata for display in UI
|
|
@@ -55,7 +55,7 @@ export interface ChatSession {
|
|
|
55
55
|
id: string;
|
|
56
56
|
/** User ID who created the session */
|
|
57
57
|
userId: string;
|
|
58
|
-
/** Current model ID for the session (e.g., "claude-
|
|
58
|
+
/** Current model ID for the session (e.g., "claude-opus-5") */
|
|
59
59
|
model: string;
|
|
60
60
|
/** Session creation timestamp */
|
|
61
61
|
createdAt: Date;
|
|
@@ -89,7 +89,7 @@ export interface SendMessageRequest {
|
|
|
89
89
|
sessionId?: string;
|
|
90
90
|
/** User message content */
|
|
91
91
|
message: string;
|
|
92
|
-
/** Model ID to use for response (e.g., "claude-
|
|
92
|
+
/** Model ID to use for response (e.g., "claude-opus-5") */
|
|
93
93
|
model: string;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
@@ -127,7 +127,7 @@ export interface GetSessionMessagesResponse {
|
|
|
127
127
|
* Create new session request
|
|
128
128
|
*/
|
|
129
129
|
export interface CreateSessionRequest {
|
|
130
|
-
/** Initial model ID for the session (e.g., "claude-
|
|
130
|
+
/** Initial model ID for the session (e.g., "claude-opus-5") */
|
|
131
131
|
model: string;
|
|
132
132
|
/** Optional session title */
|
|
133
133
|
title?: string;
|
package/dist/chat.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.types.d.ts","sourceRoot":"","sources":["../src/chat.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;CACpD;AAED;;;GAGG;AACH,oBAAY,WAAW;IACrB,sDAAsD;IACtD,SAAS,
|
|
1
|
+
{"version":3,"file":"chat.types.d.ts","sourceRoot":"","sources":["../src/chat.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;CACpD;AAED;;;GAGG;AACH,oBAAY,WAAW;IACrB,sDAAsD;IACtD,SAAS,qBAAqB;IAE9B,yDAAyD;IACzD,QAAQ,oBAAoB;IAE5B,0EAA0E;IAC1E,MAAM,kBAAkB;IAExB,2DAA2D;IAC3D,OAAO,mBAAmB;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,e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AC;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,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IAEd,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,KAAK,EAAE,GAAG,eAAe,EAAE,CAAC;CACrC"}
|
package/dist/chat.types.js
CHANGED
|
@@ -11,12 +11,12 @@ exports.ClaudeModel = void 0;
|
|
|
11
11
|
*/
|
|
12
12
|
var ClaudeModel;
|
|
13
13
|
(function (ClaudeModel) {
|
|
14
|
-
/** Claude Haiku
|
|
15
|
-
ClaudeModel["
|
|
16
|
-
/** Claude Sonnet
|
|
17
|
-
ClaudeModel["
|
|
18
|
-
/** Claude
|
|
19
|
-
ClaudeModel["
|
|
20
|
-
/** Claude
|
|
21
|
-
ClaudeModel["
|
|
14
|
+
/** Claude Haiku 4.5 - Fastest, most cost-effective */
|
|
15
|
+
ClaudeModel["HAIKU_4_5"] = "claude-haiku-4-5";
|
|
16
|
+
/** Claude Sonnet 5 - Balanced performance and quality */
|
|
17
|
+
ClaudeModel["SONNET_5"] = "claude-sonnet-5";
|
|
18
|
+
/** Claude Opus 5 - Powerful reasoning, adaptive thinking on by default */
|
|
19
|
+
ClaudeModel["OPUS_5"] = "claude-opus-5";
|
|
20
|
+
/** Claude Fable 5 - Most capable model, premium pricing */
|
|
21
|
+
ClaudeModel["FABLE_5"] = "claude-fable-5";
|
|
22
22
|
})(ClaudeModel || (exports.ClaudeModel = ClaudeModel = {}));
|
package/dist/chat.types.spec.js
CHANGED
|
@@ -17,35 +17,35 @@ describe('Chat Types', () => {
|
|
|
17
17
|
const modelCount = Object.keys(chat_types_1.ClaudeModel).length;
|
|
18
18
|
expect(modelCount).toBe(4);
|
|
19
19
|
});
|
|
20
|
-
it('should have
|
|
21
|
-
expect(chat_types_1.ClaudeModel.
|
|
20
|
+
it('should have HAIKU_4_5 with correct ID', () => {
|
|
21
|
+
expect(chat_types_1.ClaudeModel.HAIKU_4_5).toBe('claude-haiku-4-5');
|
|
22
22
|
});
|
|
23
|
-
it('should have
|
|
24
|
-
expect(chat_types_1.ClaudeModel.
|
|
23
|
+
it('should have SONNET_5 with correct ID', () => {
|
|
24
|
+
expect(chat_types_1.ClaudeModel.SONNET_5).toBe('claude-sonnet-5');
|
|
25
25
|
});
|
|
26
|
-
it('should have
|
|
27
|
-
expect(chat_types_1.ClaudeModel.
|
|
26
|
+
it('should have OPUS_5 with correct ID', () => {
|
|
27
|
+
expect(chat_types_1.ClaudeModel.OPUS_5).toBe('claude-opus-5');
|
|
28
28
|
});
|
|
29
|
-
it('should have
|
|
30
|
-
expect(chat_types_1.ClaudeModel.
|
|
29
|
+
it('should have FABLE_5 with correct ID', () => {
|
|
30
|
+
expect(chat_types_1.ClaudeModel.FABLE_5).toBe('claude-fable-5');
|
|
31
31
|
});
|
|
32
32
|
it('should not have duplicate model IDs', () => {
|
|
33
33
|
const modelIds = Object.values(chat_types_1.ClaudeModel);
|
|
34
34
|
const uniqueIds = new Set(modelIds);
|
|
35
35
|
expect(modelIds.length).toBe(uniqueIds.size);
|
|
36
36
|
});
|
|
37
|
-
it('should
|
|
37
|
+
it('should not carry legacy date suffixes', () => {
|
|
38
38
|
const allModels = Object.values(chat_types_1.ClaudeModel);
|
|
39
|
-
const datePattern =
|
|
39
|
+
const datePattern = /-\d{8}$/; // legacy YYYYMMDD snapshot suffix
|
|
40
40
|
allModels.forEach((modelId) => {
|
|
41
|
-
expect(modelId).toMatch(datePattern);
|
|
41
|
+
expect(modelId).not.toMatch(datePattern);
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
it('should be accessible by enum key', () => {
|
|
45
|
-
expect(chat_types_1.ClaudeModel['
|
|
46
|
-
expect(chat_types_1.ClaudeModel['
|
|
47
|
-
expect(chat_types_1.ClaudeModel['
|
|
48
|
-
expect(chat_types_1.ClaudeModel['
|
|
45
|
+
expect(chat_types_1.ClaudeModel['HAIKU_4_5']).toBeDefined();
|
|
46
|
+
expect(chat_types_1.ClaudeModel['SONNET_5']).toBeDefined();
|
|
47
|
+
expect(chat_types_1.ClaudeModel['OPUS_5']).toBeDefined();
|
|
48
|
+
expect(chat_types_1.ClaudeModel['FABLE_5']).toBeDefined();
|
|
49
49
|
});
|
|
50
50
|
it('should support iteration over enum values', () => {
|
|
51
51
|
const models = [];
|
|
@@ -53,10 +53,10 @@ describe('Chat Types', () => {
|
|
|
53
53
|
models.push(model);
|
|
54
54
|
}
|
|
55
55
|
expect(models).toHaveLength(4);
|
|
56
|
-
expect(models).toContain('claude-
|
|
57
|
-
expect(models).toContain('claude-
|
|
58
|
-
expect(models).toContain('claude-
|
|
59
|
-
expect(models).toContain('claude-
|
|
56
|
+
expect(models).toContain('claude-haiku-4-5');
|
|
57
|
+
expect(models).toContain('claude-sonnet-5');
|
|
58
|
+
expect(models).toContain('claude-opus-5');
|
|
59
|
+
expect(models).toContain('claude-fable-5');
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
describe('Model Tier Values', () => {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email module types: provider configuration, sending, and API keys.
|
|
3
|
+
*/
|
|
4
|
+
import type { FirestoreDocument } from './firestore.types';
|
|
5
|
+
/** Supported outbound email providers. */
|
|
6
|
+
export type EmailProviderType = 'resend' | 'mailersend' | 'smtp';
|
|
7
|
+
/** Settings shared by every provider type. */
|
|
8
|
+
export interface EmailProviderSettingsBase {
|
|
9
|
+
fromEmail: string;
|
|
10
|
+
fromName?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Resend (https://resend.com) settings. */
|
|
13
|
+
export interface ResendSettings extends EmailProviderSettingsBase {
|
|
14
|
+
apiKey: string;
|
|
15
|
+
}
|
|
16
|
+
/** MailerSend (https://mailersend.com) settings. */
|
|
17
|
+
export interface MailerSendSettings extends EmailProviderSettingsBase {
|
|
18
|
+
apiKey: string;
|
|
19
|
+
}
|
|
20
|
+
/** Generic SMTP settings (nodemailer). */
|
|
21
|
+
export interface SmtpSettings extends EmailProviderSettingsBase {
|
|
22
|
+
host: string;
|
|
23
|
+
port: number;
|
|
24
|
+
secure: boolean;
|
|
25
|
+
username: string;
|
|
26
|
+
password: string;
|
|
27
|
+
}
|
|
28
|
+
export type EmailProviderSettings = ResendSettings | MailerSendSettings | SmtpSettings;
|
|
29
|
+
/** A configured provider with decrypted settings (server-internal). */
|
|
30
|
+
export interface EmailProviderConfig {
|
|
31
|
+
id: string;
|
|
32
|
+
type: EmailProviderType;
|
|
33
|
+
name: string;
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
settings: EmailProviderSettings;
|
|
36
|
+
}
|
|
37
|
+
/** Provider settings safe to return to clients (no secrets). */
|
|
38
|
+
export interface EmailProviderPublicSettings {
|
|
39
|
+
fromEmail: string;
|
|
40
|
+
fromName?: string;
|
|
41
|
+
host?: string;
|
|
42
|
+
port?: number;
|
|
43
|
+
secure?: boolean;
|
|
44
|
+
username?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Provider config as exposed by the API: secrets stripped, flags instead. */
|
|
47
|
+
export interface EmailProviderConfigPublic {
|
|
48
|
+
id: string;
|
|
49
|
+
type: EmailProviderType;
|
|
50
|
+
name: string;
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
active: boolean;
|
|
53
|
+
settings: EmailProviderPublicSettings;
|
|
54
|
+
hasApiKey: boolean;
|
|
55
|
+
hasPassword: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** Payload for POST /email/send and the admin test send. */
|
|
58
|
+
export interface SendEmailRequest {
|
|
59
|
+
to: string[];
|
|
60
|
+
subject: string;
|
|
61
|
+
html: string;
|
|
62
|
+
text?: string;
|
|
63
|
+
/** Optional from-address override; defaults to the provider's fromEmail. */
|
|
64
|
+
from?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Result of a successful send. */
|
|
67
|
+
export interface SendEmailResult {
|
|
68
|
+
id: string;
|
|
69
|
+
provider: EmailProviderType;
|
|
70
|
+
accepted: string[];
|
|
71
|
+
timestamp: string;
|
|
72
|
+
}
|
|
73
|
+
/** Result of a provider connection check. */
|
|
74
|
+
export interface EmailVerifyResult {
|
|
75
|
+
ok: boolean;
|
|
76
|
+
error?: string;
|
|
77
|
+
}
|
|
78
|
+
/** API key metadata — never contains the full key. */
|
|
79
|
+
export interface EmailApiKey {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
/** Free-form attribution label (e.g. agents@guinetik.com). Not an account link. */
|
|
83
|
+
owner?: string;
|
|
84
|
+
prefix: string;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
lastUsedAt?: string;
|
|
87
|
+
}
|
|
88
|
+
/** Returned once, at creation time only. */
|
|
89
|
+
export interface EmailApiKeyCreated extends EmailApiKey {
|
|
90
|
+
key: string;
|
|
91
|
+
}
|
|
92
|
+
/** email-providers doc. Secret fields stored as enc:v1:... strings. */
|
|
93
|
+
export interface EmailProviderDocument extends FirestoreDocument {
|
|
94
|
+
type: EmailProviderType;
|
|
95
|
+
name: string;
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
settings: Record<string, string | number | boolean>;
|
|
98
|
+
}
|
|
99
|
+
/** email-settings singleton doc. */
|
|
100
|
+
export interface EmailSettingsDocument extends FirestoreDocument {
|
|
101
|
+
activeProviderId: string | null;
|
|
102
|
+
}
|
|
103
|
+
/** email-api-keys doc. */
|
|
104
|
+
export interface EmailApiKeyDocument extends FirestoreDocument {
|
|
105
|
+
name: string;
|
|
106
|
+
owner?: string;
|
|
107
|
+
keyHash: string;
|
|
108
|
+
prefix: string;
|
|
109
|
+
lastUsedAt?: Date;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=email.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.types.d.ts","sourceRoot":"","sources":["../src/email.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,0CAA0C;AAC1C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAEjE,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,4CAA4C;AAC5C,MAAM,WAAW,cAAe,SAAQ,yBAAyB;IAC/D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0CAA0C;AAC1C,MAAM,WAAW,YAAa,SAAQ,yBAAyB;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,kBAAkB,GAAG,YAAY,CAAC;AAEvF,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;I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AsD;AACtD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,GAAG,EAAE,MAAM,CAAC;CACb;AAMD,uEAAuE;AACvE,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACrD;AAED,oCAAoC;AACpC,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,0BAA0B;AAC1B,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './type-guards';
|
|
|
21
21
|
export * from './agent.types';
|
|
22
22
|
export * from './file.types';
|
|
23
23
|
export * from './launchpad.types';
|
|
24
|
+
export * from './email.types';
|
|
24
25
|
export type { Security, SecurityChallengeOptions, SecurityChallengeResult } from './security.interface';
|
|
25
26
|
export { SecurityLevel } from './security.interface';
|
|
26
27
|
//# 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,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,cAAc,eAAe,CAAC;AAG9B,cAAc,eAAe,CAAC;AAG9B,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAGlC,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,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,cAAc,eAAe,CAAC;AAG9B,cAAc,eAAe,CAAC;AAG9B,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,eAAe,CAAC;AAG9B,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -52,5 +52,7 @@ __exportStar(require("./agent.types"), exports);
|
|
|
52
52
|
__exportStar(require("./file.types"), exports);
|
|
53
53
|
// Launchpad bookmark board types
|
|
54
54
|
__exportStar(require("./launchpad.types"), exports);
|
|
55
|
+
// Email module types
|
|
56
|
+
__exportStar(require("./email.types"), exports);
|
|
55
57
|
var security_interface_1 = require("./security.interface");
|
|
56
58
|
Object.defineProperty(exports, "SecurityLevel", { enumerable: true, get: function () { return security_interface_1.SecurityLevel; } });
|
package/dist/type-guards.spec.js
CHANGED
|
@@ -35,7 +35,7 @@ describe('Type Guards', () => {
|
|
|
35
35
|
it('should return true for ChatMessage with optional model', () => {
|
|
36
36
|
const messageWithModel = {
|
|
37
37
|
...validMessage,
|
|
38
|
-
model: 'claude-
|
|
38
|
+
model: 'claude-opus-5',
|
|
39
39
|
};
|
|
40
40
|
expect((0, type_guards_1.isChatMessage)(messageWithModel)).toBe(true);
|
|
41
41
|
});
|
|
@@ -68,7 +68,7 @@ describe('Type Guards', () => {
|
|
|
68
68
|
const validSession = {
|
|
69
69
|
id: 'session_123',
|
|
70
70
|
userId: 'user_456',
|
|
71
|
-
model: 'claude-
|
|
71
|
+
model: 'claude-opus-5',
|
|
72
72
|
createdAt: new Date(),
|
|
73
73
|
updatedAt: new Date(),
|
|
74
74
|
};
|
|
@@ -105,7 +105,7 @@ describe('Type Guards', () => {
|
|
|
105
105
|
describe('isModel', () => {
|
|
106
106
|
const validModel = {
|
|
107
107
|
type: 'model',
|
|
108
|
-
id: 'claude-
|
|
108
|
+
id: 'claude-opus-5',
|
|
109
109
|
display_name: 'Claude Sonnet 4.5',
|
|
110
110
|
created_at: '2025-09-29T00:00:00Z',
|
|
111
111
|
};
|
|
@@ -139,19 +139,19 @@ describe('Type Guards', () => {
|
|
|
139
139
|
});
|
|
140
140
|
describe('isClaudeModel', () => {
|
|
141
141
|
it('should return true for valid ClaudeModel enum values', () => {
|
|
142
|
-
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.
|
|
143
|
-
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.
|
|
144
|
-
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.
|
|
145
|
-
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.
|
|
142
|
+
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.HAIKU_4_5)).toBe(true);
|
|
143
|
+
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.SONNET_5)).toBe(true);
|
|
144
|
+
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.OPUS_5)).toBe(true);
|
|
145
|
+
expect((0, type_guards_1.isClaudeModel)(chat_types_1.ClaudeModel.FABLE_5)).toBe(true);
|
|
146
146
|
});
|
|
147
147
|
it('should return true for valid model ID strings', () => {
|
|
148
|
-
expect((0, type_guards_1.isClaudeModel)('claude-
|
|
149
|
-
expect((0, type_guards_1.isClaudeModel)('claude-
|
|
150
|
-
expect((0, type_guards_1.isClaudeModel)('claude-
|
|
151
|
-
expect((0, type_guards_1.isClaudeModel)('claude-
|
|
148
|
+
expect((0, type_guards_1.isClaudeModel)('claude-haiku-4-5')).toBe(true);
|
|
149
|
+
expect((0, type_guards_1.isClaudeModel)('claude-sonnet-5')).toBe(true);
|
|
150
|
+
expect((0, type_guards_1.isClaudeModel)('claude-opus-5')).toBe(true);
|
|
151
|
+
expect((0, type_guards_1.isClaudeModel)('claude-fable-5')).toBe(true);
|
|
152
152
|
});
|
|
153
153
|
it('should return false for invalid model IDs', () => {
|
|
154
|
-
expect((0, type_guards_1.isClaudeModel)('claude-
|
|
154
|
+
expect((0, type_guards_1.isClaudeModel)('claude-3-opus-20240229')).toBe(false);
|
|
155
155
|
expect((0, type_guards_1.isClaudeModel)('gpt-4')).toBe(false);
|
|
156
156
|
expect((0, type_guards_1.isClaudeModel)('invalid-model')).toBe(false);
|
|
157
157
|
expect((0, type_guards_1.isClaudeModel)('')).toBe(false);
|
|
@@ -166,7 +166,7 @@ describe('Type Guards', () => {
|
|
|
166
166
|
describe('isSendMessageRequest', () => {
|
|
167
167
|
const validRequest = {
|
|
168
168
|
message: 'Hello, Claude!',
|
|
169
|
-
model: 'claude-
|
|
169
|
+
model: 'claude-opus-5',
|
|
170
170
|
};
|
|
171
171
|
it('should return true for valid SendMessageRequest', () => {
|
|
172
172
|
expect((0, type_guards_1.isSendMessageRequest)(validRequest)).toBe(true);
|
|
@@ -194,7 +194,7 @@ describe('Type Guards', () => {
|
|
|
194
194
|
});
|
|
195
195
|
describe('isCreateSessionRequest', () => {
|
|
196
196
|
const validRequest = {
|
|
197
|
-
model: 'claude-
|
|
197
|
+
model: 'claude-opus-5',
|
|
198
198
|
};
|
|
199
199
|
it('should return true for valid CreateSessionRequest', () => {
|
|
200
200
|
expect((0, type_guards_1.isCreateSessionRequest)(validRequest)).toBe(true);
|