mcp-twake-mail 0.1.0 → 1.0.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 +77 -48
- package/build/cli/commands/setup.js +54 -12
- package/build/cli/commands/setup.js.map +1 -1
- package/build/cli/prompts/setup-wizard.d.ts +33 -1
- package/build/cli/prompts/setup-wizard.js +134 -2
- package/build/cli/prompts/setup-wizard.js.map +1 -1
- package/build/cli/prompts/setup-wizard.test.d.ts +1 -0
- package/build/cli/prompts/setup-wizard.test.js +161 -0
- package/build/cli/prompts/setup-wizard.test.js.map +1 -0
- package/build/config/schema.d.ts +2 -0
- package/build/config/schema.js +3 -0
- package/build/config/schema.js.map +1 -1
- package/build/discovery/dns-srv.d.ts +18 -0
- package/build/discovery/dns-srv.js +60 -0
- package/build/discovery/dns-srv.js.map +1 -0
- package/build/discovery/dns-srv.test.d.ts +4 -0
- package/build/discovery/dns-srv.test.js +79 -0
- package/build/discovery/dns-srv.test.js.map +1 -0
- package/build/discovery/index.d.ts +9 -0
- package/build/discovery/index.js +13 -0
- package/build/discovery/index.js.map +1 -0
- package/build/discovery/oauth-discovery.d.ts +34 -0
- package/build/discovery/oauth-discovery.js +160 -0
- package/build/discovery/oauth-discovery.js.map +1 -0
- package/build/discovery/oauth-discovery.test.d.ts +1 -0
- package/build/discovery/oauth-discovery.test.js +198 -0
- package/build/discovery/oauth-discovery.test.js.map +1 -0
- package/build/discovery/orchestrator.d.ts +31 -0
- package/build/discovery/orchestrator.js +87 -0
- package/build/discovery/orchestrator.js.map +1 -0
- package/build/discovery/orchestrator.test.d.ts +4 -0
- package/build/discovery/orchestrator.test.js +242 -0
- package/build/discovery/orchestrator.test.js.map +1 -0
- package/build/discovery/types.d.ts +18 -0
- package/build/discovery/types.js +15 -0
- package/build/discovery/types.js.map +1 -0
- package/build/discovery/well-known.d.ts +21 -0
- package/build/discovery/well-known.js +52 -0
- package/build/discovery/well-known.js.map +1 -0
- package/build/discovery/well-known.test.d.ts +4 -0
- package/build/discovery/well-known.test.js +120 -0
- package/build/discovery/well-known.test.js.map +1 -0
- package/build/mcp/server.d.ts +5 -3
- package/build/mcp/server.js +11 -5
- package/build/mcp/server.js.map +1 -1
- package/build/mcp/tools/email-sending.d.ts +10 -1
- package/build/mcp/tools/email-sending.js +60 -15
- package/build/mcp/tools/email-sending.js.map +1 -1
- package/build/mcp/tools/index.d.ts +10 -1
- package/build/mcp/tools/index.js +4 -3
- package/build/mcp/tools/index.js.map +1 -1
- package/build/signature/converter.d.ts +2 -0
- package/build/signature/converter.js +23 -0
- package/build/signature/converter.js.map +1 -0
- package/build/signature/converter.test.d.ts +1 -0
- package/build/signature/converter.test.js +84 -0
- package/build/signature/converter.test.js.map +1 -0
- package/build/signature/index.d.ts +2 -0
- package/build/signature/index.js +3 -0
- package/build/signature/index.js.map +1 -0
- package/build/signature/loader.d.ts +6 -0
- package/build/signature/loader.js +31 -0
- package/build/signature/loader.js.map +1 -0
- package/build/signature/loader.test.d.ts +1 -0
- package/build/signature/loader.test.js +85 -0
- package/build/signature/loader.test.js.map +1 -0
- package/docs/auto-discovery.md +210 -0
- package/docs/oidc-configuration.md +261 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# mcp-twake-mail
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/mcp-twake-mail)
|
|
3
4
|
[](LICENSE)
|
|
4
5
|
[](https://nodejs.org/)
|
|
5
6
|
|
|
@@ -16,6 +17,8 @@ mcp-twake-mail is a Model Context Protocol (MCP) server that connects any MCP-co
|
|
|
16
17
|
- Works with any MCP-compatible AI assistant
|
|
17
18
|
- Full control over email data — read, write, send, and organize
|
|
18
19
|
- Multiple authentication methods: Basic, Bearer token, or OIDC
|
|
20
|
+
- **Auto-discovery** — configure with just your email address
|
|
21
|
+
- **Email signatures** — automatic Markdown signature injection
|
|
19
22
|
- Secure HTTPS-only connections
|
|
20
23
|
|
|
21
24
|
## Features
|
|
@@ -47,6 +50,9 @@ mcp-twake-mail is a Model Context Protocol (MCP) server that connects any MCP-co
|
|
|
47
50
|
- `download_attachment` - Download attachment content (auto-saves large files to disk)
|
|
48
51
|
|
|
49
52
|
**Advanced Features:**
|
|
53
|
+
- **Auto-discovery** — Configure with just your email address (DNS SRV + .well-known/jmap)
|
|
54
|
+
- **Email signatures** — Markdown signature files automatically appended to emails
|
|
55
|
+
- **Default sender identity** — Configure default "from" address
|
|
50
56
|
- OIDC authentication with PKCE (S256) for enterprise SSO
|
|
51
57
|
- Automatic token refresh for OIDC sessions
|
|
52
58
|
- Thread-based email grouping
|
|
@@ -83,54 +89,58 @@ npx mcp-twake-mail setup
|
|
|
83
89
|
```
|
|
84
90
|
|
|
85
91
|
The wizard will:
|
|
86
|
-
1.
|
|
92
|
+
1. **Auto-discover** your JMAP server from your email address (or enter manually)
|
|
87
93
|
2. Ask for your authentication method (Basic, Bearer, or OIDC)
|
|
88
94
|
3. Collect the required credentials
|
|
89
|
-
4.
|
|
90
|
-
5.
|
|
95
|
+
4. **Configure default sender** and optional email signature
|
|
96
|
+
5. Test the connection to your JMAP server
|
|
97
|
+
6. Generate and optionally write the configuration to your Claude Desktop config file
|
|
98
|
+
|
|
99
|
+
### Auto-Discovery Mode (New!)
|
|
100
|
+
|
|
101
|
+
The setup wizard now supports **auto-discovery** — just provide your email address and the system will automatically find your JMAP server:
|
|
91
102
|
|
|
92
|
-
Example session:
|
|
93
103
|
```
|
|
94
104
|
=== MCP Twake Mail Setup Wizard ===
|
|
95
105
|
|
|
96
|
-
|
|
106
|
+
Setup mode:
|
|
107
|
+
1. Auto-discover from email address (Recommended)
|
|
108
|
+
2. Manual configuration
|
|
109
|
+
Choose [1-2]: 1
|
|
97
110
|
|
|
98
|
-
|
|
99
|
-
1. Basic (username/password)
|
|
100
|
-
2. Bearer token (JWT)
|
|
101
|
-
3. OIDC (OpenID Connect)
|
|
102
|
-
Choose [1-3]: 1
|
|
111
|
+
Email address: user@example.com
|
|
103
112
|
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
Discovering JMAP server...
|
|
114
|
+
✓ Found JMAP server: https://jmap.example.com/jmap/session
|
|
115
|
+
✓ Found OIDC issuer: https://sso.example.com
|
|
106
116
|
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
Use discovered settings? [Y/n]: y
|
|
118
|
+
```
|
|
109
119
|
|
|
110
|
-
|
|
120
|
+
The auto-discovery uses:
|
|
121
|
+
- **DNS SRV** lookup: `_jmap._tcp.{domain}`
|
|
122
|
+
- **.well-known/jmap** endpoint
|
|
123
|
+
- **OAuth metadata** discovery for OIDC configuration
|
|
111
124
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"twake-mail": {
|
|
116
|
-
"command": "npx",
|
|
117
|
-
"args": ["-y", "mcp-twake-mail"],
|
|
118
|
-
"env": {
|
|
119
|
-
"JMAP_SESSION_URL": "https://jmap.example.com/jmap/session",
|
|
120
|
-
"JMAP_AUTH_METHOD": "basic",
|
|
121
|
-
"JMAP_USERNAME": "user@example.com",
|
|
122
|
-
"JMAP_PASSWORD": "********"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
---------------------------------------
|
|
125
|
+
See [docs/auto-discovery.md](docs/auto-discovery.md) for details.
|
|
126
|
+
|
|
127
|
+
### Email Signature Support (New!)
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Configure an optional Markdown signature file that will be automatically appended to all emails:
|
|
130
130
|
|
|
131
|
-
Config written successfully!
|
|
132
|
-
Restart Claude Desktop to load the new configuration.
|
|
133
131
|
```
|
|
132
|
+
Configure email signature file? [y/N]: y
|
|
133
|
+
Path to signature file (Markdown format): ~/.mcp-twake-mail/signature.md
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Example signature file (`~/.mcp-twake-mail/signature.md`):
|
|
137
|
+
```markdown
|
|
138
|
+
**John Doe**
|
|
139
|
+
Software Engineer
|
|
140
|
+
[john.doe@example.com](mailto:john.doe@example.com)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The signature is automatically converted to HTML for rich emails and plain text for simple emails.
|
|
134
144
|
|
|
135
145
|
### CLI Commands
|
|
136
146
|
|
|
@@ -173,9 +183,18 @@ For enterprise SSO with OpenID Connect (PKCE S256):
|
|
|
173
183
|
| `JMAP_OIDC_ISSUER` | Yes | OIDC provider issuer URL | `https://sso.example.com` |
|
|
174
184
|
| `JMAP_OIDC_CLIENT_ID` | Yes | OIDC client ID | `my-client-id` |
|
|
175
185
|
| `JMAP_OIDC_SCOPE` | No | OIDC scopes | `openid profile email offline_access` |
|
|
176
|
-
| `JMAP_OIDC_REDIRECT_URI` | No | Callback URI for OIDC flow | `http://localhost:
|
|
186
|
+
| `JMAP_OIDC_REDIRECT_URI` | No | Callback URI for OIDC flow | `http://localhost:3000/callback` |
|
|
177
187
|
|
|
178
|
-
|
|
188
|
+
See [docs/oidc-configuration.md](docs/oidc-configuration.md) for detailed OIDC setup instructions.
|
|
189
|
+
|
|
190
|
+
#### Identity & Signature (Optional)
|
|
191
|
+
|
|
192
|
+
| Variable | Required | Description | Example |
|
|
193
|
+
|----------|----------|-------------|---------|
|
|
194
|
+
| `JMAP_DEFAULT_FROM` | No | Default sender email address | `user@example.com` |
|
|
195
|
+
| `JMAP_SIGNATURE_PATH` | No | Path to Markdown signature file | `~/.mcp-twake-mail/signature.md` |
|
|
196
|
+
|
|
197
|
+
#### Other Options
|
|
179
198
|
|
|
180
199
|
| Variable | Description | Default |
|
|
181
200
|
|----------|-------------|---------|
|
|
@@ -196,14 +215,16 @@ Add the following to your Claude Desktop configuration file:
|
|
|
196
215
|
```json
|
|
197
216
|
{
|
|
198
217
|
"mcpServers": {
|
|
199
|
-
"twake-mail": {
|
|
200
|
-
"command": "
|
|
201
|
-
"args": ["
|
|
218
|
+
"mcp-twake-mail": {
|
|
219
|
+
"command": "npx",
|
|
220
|
+
"args": ["-y", "mcp-twake-mail"],
|
|
202
221
|
"env": {
|
|
203
222
|
"JMAP_SESSION_URL": "https://jmap.example.com/jmap/session",
|
|
204
223
|
"JMAP_AUTH_METHOD": "basic",
|
|
205
224
|
"JMAP_USERNAME": "user@example.com",
|
|
206
|
-
"JMAP_PASSWORD": "your-password"
|
|
225
|
+
"JMAP_PASSWORD": "your-password",
|
|
226
|
+
"JMAP_DEFAULT_FROM": "user@example.com",
|
|
227
|
+
"JMAP_SIGNATURE_PATH": "~/.mcp-twake-mail/signature.md"
|
|
207
228
|
}
|
|
208
229
|
}
|
|
209
230
|
}
|
|
@@ -215,16 +236,17 @@ Add the following to your Claude Desktop configuration file:
|
|
|
215
236
|
```json
|
|
216
237
|
{
|
|
217
238
|
"mcpServers": {
|
|
218
|
-
"twake-mail": {
|
|
219
|
-
"command": "
|
|
220
|
-
"args": ["
|
|
239
|
+
"mcp-twake-mail": {
|
|
240
|
+
"command": "npx",
|
|
241
|
+
"args": ["-y", "mcp-twake-mail"],
|
|
221
242
|
"env": {
|
|
222
243
|
"JMAP_SESSION_URL": "https://jmap.example.com/jmap/session",
|
|
223
244
|
"JMAP_AUTH_METHOD": "oidc",
|
|
224
245
|
"JMAP_OIDC_ISSUER": "https://sso.example.com",
|
|
225
246
|
"JMAP_OIDC_CLIENT_ID": "my-client-id",
|
|
226
247
|
"JMAP_OIDC_SCOPE": "openid profile email offline_access",
|
|
227
|
-
"
|
|
248
|
+
"JMAP_DEFAULT_FROM": "user@example.com",
|
|
249
|
+
"JMAP_SIGNATURE_PATH": "~/.mcp-twake-mail/signature.md"
|
|
228
250
|
}
|
|
229
251
|
}
|
|
230
252
|
}
|
|
@@ -259,6 +281,11 @@ Once configured, you can ask Claude natural language questions about your email:
|
|
|
259
281
|
- "What attachments are in this email?"
|
|
260
282
|
- "Download the PDF attachment"
|
|
261
283
|
|
|
284
|
+
## Documentation
|
|
285
|
+
|
|
286
|
+
- [Auto-Discovery](docs/auto-discovery.md) — How JMAP and OIDC auto-discovery works
|
|
287
|
+
- [OIDC Configuration](docs/oidc-configuration.md) — Detailed OIDC/OAuth setup guide
|
|
288
|
+
|
|
262
289
|
## Available Tools
|
|
263
290
|
|
|
264
291
|
| Tool Name | Description |
|
|
@@ -301,10 +328,12 @@ mcp-twake-mail is built with a layered architecture:
|
|
|
301
328
|
2. **Logging Layer** - Pino logger configured for stderr output (prevents stdout contamination in MCP stdio transport)
|
|
302
329
|
3. **Authentication Layer** - Multi-method auth support (Basic, Bearer, OIDC with PKCE)
|
|
303
330
|
4. **Token Management** - Automatic token refresh for OIDC with secure token storage
|
|
304
|
-
5. **
|
|
305
|
-
6. **
|
|
306
|
-
7. **
|
|
307
|
-
8. **
|
|
331
|
+
5. **Discovery Layer** - Auto-discovery via DNS SRV, .well-known/jmap, and OAuth metadata
|
|
332
|
+
6. **JMAP Client Layer** - Session management, request batching, blob download support
|
|
333
|
+
7. **Signature Layer** - Markdown-to-HTML conversion for email signatures
|
|
334
|
+
8. **Transformation Layer** - Email/Mailbox data transformation for AI-friendly output
|
|
335
|
+
9. **MCP Tool Layer** - 17 MCP tools exposing email functionality with tool annotations
|
|
336
|
+
10. **Entry Point** - MCP server initialization with stdio transport
|
|
308
337
|
|
|
309
338
|
**Key design decisions:**
|
|
310
339
|
- ESM modules with `.js` import extensions (required by MCP SDK)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { homedir } from 'node:os';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
8
|
-
import { promptJmapUrl, promptAuthMethod, promptBasicAuth, promptBearerToken, promptOidcAuth, promptWriteConfig, promptServerName, } from '../prompts/setup-wizard.js';
|
|
8
|
+
import { promptJmapUrl, promptAuthMethod, promptBasicAuth, promptBearerToken, promptOidcAuth, promptWriteConfig, promptServerName, promptSetupMode, promptEmail, promptConfirmDiscovery, promptDefaultFrom, promptSignaturePath, } from '../prompts/setup-wizard.js';
|
|
9
9
|
/**
|
|
10
10
|
* Get Claude Desktop config file path based on platform.
|
|
11
11
|
*/
|
|
@@ -87,8 +87,39 @@ async function testConnection(env) {
|
|
|
87
87
|
*/
|
|
88
88
|
export async function runSetup() {
|
|
89
89
|
console.log('\n=== MCP Twake Mail Setup Wizard ===\n');
|
|
90
|
-
// Step 1:
|
|
91
|
-
const
|
|
90
|
+
// Step 1: Choose setup mode
|
|
91
|
+
const mode = await promptSetupMode();
|
|
92
|
+
let jmapUrl;
|
|
93
|
+
const discoveredOidc = {};
|
|
94
|
+
if (mode === 'auto') {
|
|
95
|
+
// Auto-discovery flow
|
|
96
|
+
const email = await promptEmail();
|
|
97
|
+
console.log('\nDiscovering settings...');
|
|
98
|
+
try {
|
|
99
|
+
// Dynamic import to avoid loading discovery in non-auto mode
|
|
100
|
+
const { discoverFromEmail } = await import('../../discovery/index.js');
|
|
101
|
+
const result = await discoverFromEmail(email);
|
|
102
|
+
const confirmed = await promptConfirmDiscovery({
|
|
103
|
+
jmapUrl: result.jmap.sessionUrl,
|
|
104
|
+
oidcIssuer: result.oidc?.issuer,
|
|
105
|
+
});
|
|
106
|
+
jmapUrl = confirmed.jmapUrl;
|
|
107
|
+
if (confirmed.oidcIssuer) {
|
|
108
|
+
discoveredOidc.issuer = confirmed.oidcIssuer;
|
|
109
|
+
}
|
|
110
|
+
console.log(`\nUsing discovered settings for ${result.domain}\n`);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error(`\nAuto-discovery failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
114
|
+
console.log('Falling back to manual configuration...\n');
|
|
115
|
+
// Fall back to manual mode
|
|
116
|
+
jmapUrl = await promptJmapUrl();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
// Manual mode - existing flow
|
|
121
|
+
jmapUrl = await promptJmapUrl();
|
|
122
|
+
}
|
|
92
123
|
// Step 2: Auth method
|
|
93
124
|
const authMethod = await promptAuthMethod();
|
|
94
125
|
// Step 3: Auth-specific prompts
|
|
@@ -105,13 +136,24 @@ export async function runSetup() {
|
|
|
105
136
|
env.JMAP_BEARER_TOKEN = await promptBearerToken();
|
|
106
137
|
}
|
|
107
138
|
else if (authMethod === 'oidc') {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
env.
|
|
111
|
-
env.
|
|
112
|
-
env.
|
|
139
|
+
// Pre-fill discovered OIDC issuer if available
|
|
140
|
+
const oidcConfig = await promptOidcAuth(discoveredOidc.issuer);
|
|
141
|
+
env.JMAP_OIDC_ISSUER = oidcConfig.issuer;
|
|
142
|
+
env.JMAP_OIDC_CLIENT_ID = oidcConfig.clientId;
|
|
143
|
+
env.JMAP_OIDC_SCOPE = oidcConfig.scope;
|
|
144
|
+
env.JMAP_OIDC_REDIRECT_URI = oidcConfig.redirectUri;
|
|
145
|
+
}
|
|
146
|
+
// Step 4: Identity configuration (optional)
|
|
147
|
+
console.log('\n--- Identity Configuration ---');
|
|
148
|
+
const defaultFrom = await promptDefaultFrom();
|
|
149
|
+
if (defaultFrom) {
|
|
150
|
+
env.JMAP_DEFAULT_FROM = defaultFrom;
|
|
151
|
+
}
|
|
152
|
+
const signaturePath = await promptSignaturePath();
|
|
153
|
+
if (signaturePath) {
|
|
154
|
+
env.JMAP_SIGNATURE_PATH = signaturePath;
|
|
113
155
|
}
|
|
114
|
-
// Step
|
|
156
|
+
// Step 5: Test connection
|
|
115
157
|
console.log('\nTesting connection...');
|
|
116
158
|
const testResult = await testConnection(env);
|
|
117
159
|
if (!testResult.success) {
|
|
@@ -120,15 +162,15 @@ export async function runSetup() {
|
|
|
120
162
|
process.exit(1);
|
|
121
163
|
}
|
|
122
164
|
console.log('\nConnection successful!\n');
|
|
123
|
-
// Step
|
|
165
|
+
// Step 6: Server name for Claude config
|
|
124
166
|
const serverName = await promptServerName();
|
|
125
|
-
// Step
|
|
167
|
+
// Step 7: Generate config
|
|
126
168
|
const config = generateClaudeConfig(serverName, env);
|
|
127
169
|
const configJson = JSON.stringify(config, null, 2);
|
|
128
170
|
console.log('\n--- Generated Claude Desktop Config ---');
|
|
129
171
|
console.log(configJson);
|
|
130
172
|
console.log('---------------------------------------\n');
|
|
131
|
-
// Step
|
|
173
|
+
// Step 8: Optionally write to Claude Desktop config
|
|
132
174
|
const shouldWrite = await promptWriteConfig();
|
|
133
175
|
if (shouldWrite) {
|
|
134
176
|
const configPath = getClaudeConfigPath();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,SAAS,mBAAmB;IAC1B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QA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ode: auto-discover or manual configuration */
|
|
4
|
+
export type SetupMode = 'auto' | 'manual';
|
|
5
|
+
/**
|
|
6
|
+
* Prompt for setup mode: auto-discover or manual configuration.
|
|
7
|
+
*/
|
|
8
|
+
export declare function promptSetupMode(): Promise<SetupMode>;
|
|
9
|
+
/**
|
|
10
|
+
* Prompt for email address for auto-discovery.
|
|
11
|
+
*/
|
|
12
|
+
export declare function promptEmail(): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Prompt to confirm or edit discovered settings.
|
|
15
|
+
*/
|
|
16
|
+
export declare function promptConfirmDiscovery(settings: {
|
|
17
|
+
jmapUrl: string;
|
|
18
|
+
oidcIssuer?: string;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
confirmed: boolean;
|
|
21
|
+
jmapUrl: string;
|
|
22
|
+
oidcIssuer?: string;
|
|
23
|
+
}>;
|
|
3
24
|
/**
|
|
4
25
|
* Prompt for JMAP session URL with validation.
|
|
5
26
|
*/
|
|
@@ -22,7 +43,7 @@ export declare function promptBearerToken(): Promise<string>;
|
|
|
22
43
|
/**
|
|
23
44
|
* Prompt for OIDC configuration.
|
|
24
45
|
*/
|
|
25
|
-
export declare function promptOidcAuth(): Promise<{
|
|
46
|
+
export declare function promptOidcAuth(defaultIssuer?: string): Promise<{
|
|
26
47
|
issuer: string;
|
|
27
48
|
clientId: string;
|
|
28
49
|
scope: string;
|
|
@@ -36,3 +57,14 @@ export declare function promptWriteConfig(): Promise<boolean>;
|
|
|
36
57
|
* Prompt for custom server name in Claude config.
|
|
37
58
|
*/
|
|
38
59
|
export declare function promptServerName(): Promise<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Prompt for default sender email address.
|
|
62
|
+
* Returns undefined if user skips configuration.
|
|
63
|
+
*/
|
|
64
|
+
export declare function promptDefaultFrom(): Promise<string | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* Prompt for signature file path.
|
|
67
|
+
* Validates file exists and is readable.
|
|
68
|
+
* Returns undefined if user skips configuration.
|
|
69
|
+
*/
|
|
70
|
+
export declare function promptSignaturePath(): Promise<string | undefined>;
|
|
@@ -3,6 +3,88 @@
|
|
|
3
3
|
* Uses @inquirer/prompts for modern, TypeScript-first prompts.
|
|
4
4
|
*/
|
|
5
5
|
import { input, select, password, confirm } from '@inquirer/prompts';
|
|
6
|
+
import { homedir } from 'node:os';
|
|
7
|
+
import { access, constants } from 'node:fs/promises';
|
|
8
|
+
/**
|
|
9
|
+
* Prompt for setup mode: auto-discover or manual configuration.
|
|
10
|
+
*/
|
|
11
|
+
export async function promptSetupMode() {
|
|
12
|
+
return select({
|
|
13
|
+
message: 'Setup mode:',
|
|
14
|
+
choices: [
|
|
15
|
+
{ value: 'auto', name: 'Auto-discover from email address (recommended)' },
|
|
16
|
+
{ value: 'manual', name: 'Manual configuration' },
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Prompt for email address for auto-discovery.
|
|
22
|
+
*/
|
|
23
|
+
export async function promptEmail() {
|
|
24
|
+
return input({
|
|
25
|
+
message: 'Email address:',
|
|
26
|
+
validate: (value) => {
|
|
27
|
+
// Basic email validation
|
|
28
|
+
if (!value.includes('@') || !value.split('@')[1]?.includes('.')) {
|
|
29
|
+
return 'Please enter a valid email address';
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Prompt to confirm or edit discovered settings.
|
|
37
|
+
*/
|
|
38
|
+
export async function promptConfirmDiscovery(settings) {
|
|
39
|
+
console.log('\nDiscovered settings:');
|
|
40
|
+
console.log(` JMAP URL: ${settings.jmapUrl}`);
|
|
41
|
+
if (settings.oidcIssuer) {
|
|
42
|
+
console.log(` OIDC Issuer: ${settings.oidcIssuer}`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(' OIDC Issuer: Not discovered (will need manual entry)');
|
|
46
|
+
}
|
|
47
|
+
console.log('');
|
|
48
|
+
const useDiscovered = await confirm({
|
|
49
|
+
message: 'Use these settings?',
|
|
50
|
+
default: true,
|
|
51
|
+
});
|
|
52
|
+
if (useDiscovered) {
|
|
53
|
+
return { confirmed: true, ...settings };
|
|
54
|
+
}
|
|
55
|
+
// Allow editing
|
|
56
|
+
const jmapUrl = await input({
|
|
57
|
+
message: 'JMAP Session URL:',
|
|
58
|
+
default: settings.jmapUrl,
|
|
59
|
+
validate: (value) => {
|
|
60
|
+
try {
|
|
61
|
+
new URL(value);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return 'Please enter a valid URL';
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const oidcIssuer = settings.oidcIssuer
|
|
70
|
+
? await input({
|
|
71
|
+
message: 'OIDC Issuer URL:',
|
|
72
|
+
default: settings.oidcIssuer,
|
|
73
|
+
validate: (value) => {
|
|
74
|
+
if (!value)
|
|
75
|
+
return true; // Optional
|
|
76
|
+
try {
|
|
77
|
+
new URL(value);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return 'Please enter a valid URL';
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
: undefined;
|
|
86
|
+
return { confirmed: true, jmapUrl, oidcIssuer };
|
|
87
|
+
}
|
|
6
88
|
/**
|
|
7
89
|
* Prompt for JMAP session URL with validation.
|
|
8
90
|
*/
|
|
@@ -61,10 +143,10 @@ export async function promptBearerToken() {
|
|
|
61
143
|
/**
|
|
62
144
|
* Prompt for OIDC configuration.
|
|
63
145
|
*/
|
|
64
|
-
export async function promptOidcAuth() {
|
|
146
|
+
export async function promptOidcAuth(defaultIssuer) {
|
|
65
147
|
const issuer = await input({
|
|
66
148
|
message: 'OIDC Issuer URL:',
|
|
67
|
-
default: 'https://sso.linagora.com',
|
|
149
|
+
default: defaultIssuer || 'https://sso.linagora.com',
|
|
68
150
|
validate: (value) => {
|
|
69
151
|
try {
|
|
70
152
|
new URL(value);
|
|
@@ -118,4 +200,54 @@ export async function promptServerName() {
|
|
|
118
200
|
validate: (value) => /^[a-z0-9-]+$/.test(value) || 'Use lowercase letters, numbers, and hyphens only',
|
|
119
201
|
});
|
|
120
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Prompt for default sender email address.
|
|
205
|
+
* Returns undefined if user skips configuration.
|
|
206
|
+
*/
|
|
207
|
+
export async function promptDefaultFrom() {
|
|
208
|
+
const shouldConfigure = await confirm({
|
|
209
|
+
message: 'Configure default sender email address?',
|
|
210
|
+
default: true,
|
|
211
|
+
});
|
|
212
|
+
if (!shouldConfigure)
|
|
213
|
+
return undefined;
|
|
214
|
+
return input({
|
|
215
|
+
message: 'Default "from" email address:',
|
|
216
|
+
validate: (value) => {
|
|
217
|
+
// Simple email regex - Zod will do full validation
|
|
218
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
219
|
+
return emailRegex.test(value) || 'Please enter a valid email address';
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Prompt for signature file path.
|
|
225
|
+
* Validates file exists and is readable.
|
|
226
|
+
* Returns undefined if user skips configuration.
|
|
227
|
+
*/
|
|
228
|
+
export async function promptSignaturePath() {
|
|
229
|
+
const shouldConfigure = await confirm({
|
|
230
|
+
message: 'Configure email signature file?',
|
|
231
|
+
default: false,
|
|
232
|
+
});
|
|
233
|
+
if (!shouldConfigure)
|
|
234
|
+
return undefined;
|
|
235
|
+
return input({
|
|
236
|
+
message: 'Path to signature file (Markdown format):',
|
|
237
|
+
default: '~/.mcp-twake-mail/signature.md',
|
|
238
|
+
validate: async (value) => {
|
|
239
|
+
if (!value)
|
|
240
|
+
return 'Signature path cannot be empty';
|
|
241
|
+
// Expand ~ to home directory for validation
|
|
242
|
+
const expandedPath = value.replace(/^~/, homedir());
|
|
243
|
+
try {
|
|
244
|
+
await access(expandedPath, constants.R_OK);
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
return `File not found or not readable: ${expandedPath}`;
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
}
|
|
121
253
|
//# sourceMappingURL=setup-wizard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-wizard.js","sourceRoot":"","sources":["../../../src/cli/prompts/setup-wizard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup-wizard.js","sourceRoot":"","sources":["../../../src/cli/prompts/setup-wizard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQrD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,OAAO,MAAM,CAAC;QACZ,OAAO,EAAE,aAAa;QACtB,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,MAAe,EAAE,IAAI,EAAE,gDAAgD,EAAE;YAClF,EAAE,KAAK,EAAE,QAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;SAC3D;KACF,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,OAAO,KAAK,CAAC;QACX,OAAO,EAAE,gBAAgB;QACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,yBAAyB;YACzB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAA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