@daileyos/mcp-server 1.13.0 → 1.13.2
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/.github/workflows/publish.yml +22 -2
- package/README.md +12 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +31 -1
- package/dist/api.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/buddy.d.ts.map +1 -1
- package/dist/tools/buddy.js +146 -50
- package/dist/tools/buddy.js.map +1 -1
- package/dist/tools/credentials-reveal.js +1 -1
- package/dist/tools/credentials-reveal.js.map +1 -1
- package/dist/tools/db.js +1 -1
- package/dist/tools/db.js.map +1 -1
- package/dist/tools/deploy-status.d.ts.map +1 -1
- package/dist/tools/deploy-status.js +0 -70
- package/dist/tools/deploy-status.js.map +1 -1
- package/dist/tools/diagnose.d.ts.map +1 -1
- package/dist/tools/diagnose.js +0 -152
- package/dist/tools/diagnose.js.map +1 -1
- package/dist/tools/exec-run.js +1 -1
- package/dist/tools/exec-run.js.map +1 -1
- package/dist/tools/platform.d.ts.map +1 -1
- package/dist/tools/platform.js +0 -82
- package/dist/tools/platform.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +1 -1
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/storage.d.ts.map +1 -1
- package/dist/tools/storage.js +0 -30
- package/dist/tools/storage.js.map +1 -1
- package/dist/tools/support.d.ts +3 -0
- package/dist/tools/support.d.ts.map +1 -0
- package/dist/tools/support.js +34 -0
- package/dist/tools/support.js.map +1 -0
- package/package.json +1 -1
- package/src/api.ts +30 -1
- package/src/index.ts +4 -0
- package/src/tools/buddy.ts +146 -50
- package/src/tools/credentials-reveal.ts +1 -1
- package/src/tools/db.ts +1 -1
- package/src/tools/deploy-status.ts +0 -71
- package/src/tools/diagnose.ts +0 -183
- package/src/tools/exec-run.ts +1 -1
- package/src/tools/platform.ts +0 -88
- package/src/tools/projects.ts +1 -3
- package/src/tools/storage.ts +0 -42
- package/src/tools/support.ts +42 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/tools/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AA6DhE,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,6aAA6a,EAC7a,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,EACrD,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QACvB,MAAM,GAAG,GAAG,MAAM,UAAU,CAAsB,KAAK,EAAE,aAAa,UAAU,UAAU,CAAC,CAAC;QAC5F,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAEjD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACtB,MAAM,KAAK,GAAG;YACZ,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YAC/B,gBAAgB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACnC,gBAAgB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACrC,gBAAgB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACvC,gBAAgB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACvC,gBAAgB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACrC,gBAAgB,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YAC3C,gBAAgB,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC5C,gBAAgB,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAC9C,gBAAgB,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AI;YAAE,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,QAAQ,CAAC,CAAC;QAC9E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9B,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/tools/support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAqCrD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { apiRequest, textResult, formatError } from '../api.js';
|
|
3
|
+
export function registerSupportTools(server) {
|
|
4
|
+
server.tool('dailey_support', 'Send a bug report to the Dailey OS support team (jonny@dailey.llc). Use this when you have diagnosed an issue that requires platform-level investigation — a build failure you cannot explain, unexpected pod behavior, database connectivity, storage errors, or anything that looks like an infrastructure problem rather than a code problem. The tool automatically collects recent build logs, pod logs, and env var keys (no values) and includes them in the report. Returns a confirmation once the report is sent.', {
|
|
5
|
+
project_id: z.string().describe('The project ID'),
|
|
6
|
+
description: z.string().describe('What is going wrong — be specific. Include what the user was trying to do, what actually happened, and any error messages or unexpected behavior you observed.'),
|
|
7
|
+
error_text: z.string().optional().describe('Full error text, stack trace, or log excerpt relevant to the issue'),
|
|
8
|
+
steps_tried: z.string().optional().describe('What troubleshooting steps have already been attempted'),
|
|
9
|
+
severity: z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Impact level: low (minor inconvenience), medium (feature broken), high (app down), critical (data loss or security). Default: medium'),
|
|
10
|
+
}, async ({ project_id, description, error_text, steps_tried, severity }) => {
|
|
11
|
+
const body = { description };
|
|
12
|
+
if (error_text)
|
|
13
|
+
body.error_text = error_text;
|
|
14
|
+
if (steps_tried)
|
|
15
|
+
body.steps_tried = steps_tried;
|
|
16
|
+
if (severity)
|
|
17
|
+
body.severity = severity;
|
|
18
|
+
const res = await apiRequest('POST', `/projects/${project_id}/support`, body);
|
|
19
|
+
if (!res.ok)
|
|
20
|
+
return textResult(formatError(res));
|
|
21
|
+
return textResult([
|
|
22
|
+
`✓ ${res.data.message}`,
|
|
23
|
+
'',
|
|
24
|
+
'The report includes:',
|
|
25
|
+
' • Your description and any error text provided',
|
|
26
|
+
' • Last 3 build logs (truncated)',
|
|
27
|
+
' • Recent pod logs',
|
|
28
|
+
' • Env var keys (no values)',
|
|
29
|
+
'',
|
|
30
|
+
'You can expect a response at the email on your account.',
|
|
31
|
+
].join('\n'));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/tools/support.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEhE,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,IAAI,CACT,gBAAgB,EAChB,6fAA6f,EAC7f;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACjD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gKAAgK,CAAC;QAClM,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;QAChH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QACrG,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sIAAsI,CAAC;KACpN,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;QACvE,MAAM,IAAI,GAA4B,EAAE,WAAW,EAAE,CAAC;QACtD,IAAI,UAAU;YAAE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7C,IAAI,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAChD,IAAI,QAAQ;YAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEvC,MAAM,GAAG,GAAG,MAAM,UAAU,CAC1B,MAAM,EACN,aAAa,UAAU,UAAU,EACjC,IAAI,CACL,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAEjD,OAAO,UAAU,CAAC;YAChB,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE;YACvB,EAAE;YACF,sBAAsB;YACtB,kDAAkD;YAClD,mCAAmC;YACnC,qBAAqB;YACrB,8BAA8B;YAC9B,EAAE;YACF,yDAAyD;SAC1D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -1,8 +1,37 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
|
|
1
5
|
const API_URL = process.env.DAILEY_API_URL || 'https://os.dailey.cloud/api';
|
|
2
6
|
const DAILEY_EMAIL = process.env.DAILEY_EMAIL;
|
|
3
7
|
const DAILEY_PASSWORD = process.env.DAILEY_PASSWORD;
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
// Read the token the Dailey CLI stores after `dailey auth login`. The CLI uses
|
|
10
|
+
// `conf` ({ projectName: 'dailey' }), which writes <config>/dailey-nodejs/config.json
|
|
11
|
+
// (env-paths layout). Reusing it means anyone already logged into the CLI (their
|
|
12
|
+
// `dailey whoami` works) gets a working MCP server with NO credentials in the
|
|
13
|
+
// client config — the installer's generated config only sets DAILEY_API_URL, so
|
|
14
|
+
// without this the server has no auth and exits, surfacing as "Connection closed".
|
|
15
|
+
function readCliStoredToken(): string | undefined {
|
|
16
|
+
try {
|
|
17
|
+
const name = 'dailey-nodejs';
|
|
18
|
+
let dir: string;
|
|
19
|
+
if (process.platform === 'darwin') {
|
|
20
|
+
dir = join(homedir(), 'Library', 'Preferences', name);
|
|
21
|
+
} else if (process.platform === 'win32') {
|
|
22
|
+
dir = join(process.env.APPDATA || join(homedir(), 'AppData', 'Roaming'), name, 'Config');
|
|
23
|
+
} else {
|
|
24
|
+
dir = join(process.env.XDG_CONFIG_HOME || join(homedir(), '.config'), name);
|
|
25
|
+
}
|
|
26
|
+
const cfg = JSON.parse(readFileSync(join(dir, 'config.json'), 'utf8'));
|
|
27
|
+
const tok = typeof cfg?.token === 'string' ? cfg.token.trim() : '';
|
|
28
|
+
return tok || undefined;
|
|
29
|
+
} catch {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let currentToken = process.env.DAILEY_API_TOKEN || readCliStoredToken() || '';
|
|
6
35
|
|
|
7
36
|
// Credential preflight lives in index.ts so it can distinguish TTY vs
|
|
8
37
|
// MCP-stdio invocation and emit a JSON-RPC-shaped error instead of just
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { registerCliTools } from './tools/cli.js';
|
|
|
32
32
|
import { registerBundleTools } from './tools/bundle.js';
|
|
33
33
|
import { registerDiagnoseTools } from './tools/diagnose.js';
|
|
34
34
|
import { registerBuddyTools } from './tools/buddy.js';
|
|
35
|
+
import { registerSupportTools } from './tools/support.js';
|
|
35
36
|
|
|
36
37
|
function preflight(): void {
|
|
37
38
|
const isInteractive = Boolean(process.stdin.isTTY);
|
|
@@ -148,5 +149,8 @@ registerBundleTools(server);
|
|
|
148
149
|
// One-stop health check — first tool to reach for when something is broken
|
|
149
150
|
registerDiagnoseTools(server);
|
|
150
151
|
|
|
152
|
+
// Support — escalate to Dailey OS team
|
|
153
|
+
registerSupportTools(server);
|
|
154
|
+
|
|
151
155
|
const transport = new StdioServerTransport();
|
|
152
156
|
await server.connect(transport);
|
package/src/tools/buddy.ts
CHANGED
|
@@ -154,7 +154,11 @@ Common issues and what they actually mean:
|
|
|
154
154
|
|
|
155
155
|
## Core Auth — For Apps With End Users
|
|
156
156
|
|
|
157
|
-
Dailey Core is a multi-tenant identity platform at core.dailey.cloud. Use it when your app has
|
|
157
|
+
Dailey Core is a multi-tenant identity platform at core.dailey.cloud. Use it when your app has end-users — not just a single admin account. It handles registration, login, password reset, and JWT issuance so you don't build auth from scratch.
|
|
158
|
+
|
|
159
|
+
### Single-tenant vs multi-tenant
|
|
160
|
+
|
|
161
|
+
Most customer apps are single-tenant: one organization, its members. You don't need to build tenant-selection UI or multi-org logic. Just register one "app" in Core for your project, and all users authenticate under that app_slug. Use multi-tenant only if your app itself serves multiple organizations (e.g., a SaaS where each customer is a separate tenant).
|
|
158
162
|
|
|
159
163
|
### How Core JWTs work
|
|
160
164
|
|
|
@@ -164,75 +168,167 @@ Core issues RS256 JWTs. Your Express server verifies them using the public JWKS
|
|
|
164
168
|
JWT claims: sub (Core user UUID), email, name, tenant, tenants, roles, app_slug
|
|
165
169
|
KID: dailey-core-20251223-01 | Issuer: https://core.dailey.cloud
|
|
166
170
|
|
|
167
|
-
### Express auth middleware
|
|
171
|
+
### Express auth middleware — no extra library needed
|
|
172
|
+
|
|
173
|
+
No jwks-rsa. Verify Core JWTs with jsonwebtoken + Node's built-in crypto:
|
|
168
174
|
|
|
169
|
-
npm install
|
|
175
|
+
npm install jsonwebtoken
|
|
170
176
|
|
|
171
|
-
const
|
|
177
|
+
const https = require('https');
|
|
178
|
+
const crypto = require('crypto');
|
|
172
179
|
const jwt = require('jsonwebtoken');
|
|
173
180
|
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
const CORE_URL = process.env.CORE_API_URL || 'https://core.dailey.cloud';
|
|
182
|
+
let jwksCache = null, jwksFetchedAt = 0, jwksPending = null;
|
|
183
|
+
|
|
184
|
+
async function getJwks() {
|
|
185
|
+
if (jwksCache && Date.now() - jwksFetchedAt < 10 * 60 * 1000) return jwksCache;
|
|
186
|
+
if (jwksPending) return jwksPending;
|
|
187
|
+
jwksPending = new Promise((resolve, reject) => {
|
|
188
|
+
https.get(\`\${CORE_URL}/.well-known/jwks.json\`, res => {
|
|
189
|
+
let body = '';
|
|
190
|
+
res.on('data', d => body += d);
|
|
191
|
+
res.on('end', () => {
|
|
192
|
+
try { jwksCache = JSON.parse(body).keys; jwksFetchedAt = Date.now(); jwksPending = null; resolve(jwksCache); }
|
|
193
|
+
catch (e) { reject(e); }
|
|
194
|
+
});
|
|
195
|
+
}).on('error', reject);
|
|
196
|
+
});
|
|
197
|
+
return jwksPending;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function verifyCoreJwt(token) {
|
|
201
|
+
const { header } = jwt.decode(token, { complete: true });
|
|
202
|
+
const keys = await getJwks();
|
|
203
|
+
const jwk = keys.find(k => k.kid === header.kid);
|
|
204
|
+
if (!jwk) throw new Error('Key not found');
|
|
205
|
+
const pubkey = crypto.createPublicKey({ key: jwk, format: 'jwk' });
|
|
206
|
+
return jwt.verify(token, pubkey, { algorithms: ['RS256'] });
|
|
207
|
+
}
|
|
179
208
|
|
|
180
|
-
|
|
209
|
+
// Pure JWT middleware — use for SPAs, mobile apps, pure APIs
|
|
210
|
+
async function requireAuth(req, res, next) {
|
|
181
211
|
const token = req.headers.authorization?.split(' ')[1];
|
|
182
212
|
if (!token) return res.status(401).json({ error: 'No token' });
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (err) return res.status(401).json({ error: 'Invalid token' });
|
|
186
|
-
try {
|
|
187
|
-
req.user = jwt.verify(token, key.getPublicKey(), { algorithms: ['RS256'] });
|
|
188
|
-
next();
|
|
189
|
-
} catch { return res.status(401).json({ error: 'Token expired' }); }
|
|
190
|
-
});
|
|
213
|
+
try { req.user = await verifyCoreJwt(token); next(); }
|
|
214
|
+
catch { return res.status(401).json({ error: 'Invalid or expired token' }); }
|
|
191
215
|
}
|
|
192
216
|
|
|
193
|
-
|
|
217
|
+
// Hybrid middleware — JWT first, falls back to express-session (use when migrating existing session apps)
|
|
218
|
+
async function requireAuthHybrid(req, res, next) {
|
|
219
|
+
const token = req.headers.authorization?.split(' ')[1];
|
|
220
|
+
if (token) {
|
|
221
|
+
try { req.user = await verifyCoreJwt(token); return next(); } catch {}
|
|
222
|
+
}
|
|
223
|
+
if (req.session?.user) { req.user = req.session.user; return next(); }
|
|
224
|
+
return res.status(401).json({ error: 'Unauthorized' });
|
|
225
|
+
}
|
|
194
226
|
|
|
195
|
-
|
|
196
|
-
|
|
227
|
+
app.use('/api', requireAuth); // pure JWT app
|
|
228
|
+
// app.use('/api', requireAuthHybrid); // migrating from express-session
|
|
197
229
|
|
|
198
|
-
|
|
230
|
+
### Upsert local user on first request (ensureLocalUser pattern)
|
|
231
|
+
|
|
232
|
+
After verifying the JWT, look up or create a local user row. Look up by Core ID first,
|
|
233
|
+
then email — this handles existing users created before Core was integrated:
|
|
234
|
+
|
|
235
|
+
async function ensureLocalUser(req, res, next) {
|
|
199
236
|
const { sub: core_user_id, email, name } = req.user;
|
|
200
|
-
|
|
201
|
-
await pool.query(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
);
|
|
214
|
-
const [rows] = await pool.query('SELECT * FROM users WHERE core_user_id = ?', [core_user_id]);
|
|
215
|
-
req.dbUser = rows[0];
|
|
237
|
+
let [rows] = await pool.query('SELECT * FROM users WHERE core_user_id = ?', [core_user_id]);
|
|
238
|
+
if (!rows.length) [rows] = await pool.query('SELECT * FROM users WHERE email = ?', [email]);
|
|
239
|
+
if (rows.length) {
|
|
240
|
+
if (!rows[0].core_user_id)
|
|
241
|
+
await pool.query('UPDATE users SET core_user_id = ? WHERE id = ?', [core_user_id, rows[0].id]);
|
|
242
|
+
req.dbUser = rows[0];
|
|
243
|
+
} else {
|
|
244
|
+
await pool.query(
|
|
245
|
+
'INSERT INTO users (id, core_user_id, email, full_name, password_hash) VALUES (UUID(), ?, ?, ?, "")',
|
|
246
|
+
[core_user_id, email, name || email]
|
|
247
|
+
);
|
|
248
|
+
[[req.dbUser]] = await pool.query('SELECT * FROM users WHERE core_user_id = ?', [core_user_id]);
|
|
249
|
+
}
|
|
216
250
|
next();
|
|
217
251
|
}
|
|
218
252
|
|
|
219
|
-
|
|
253
|
+
router.get('/me', requireAuth, ensureLocalUser, handler);
|
|
220
254
|
|
|
221
|
-
|
|
255
|
+
Migration to add the Core columns if you have an existing users table:
|
|
222
256
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
257
|
+
ALTER TABLE users
|
|
258
|
+
ADD COLUMN core_user_id VARCHAR(36) NULL,
|
|
259
|
+
ADD COLUMN email VARCHAR(255) NULL;
|
|
260
|
+
CREATE INDEX idx_users_core_user_id ON users (core_user_id);
|
|
227
261
|
|
|
228
|
-
|
|
229
|
-
const token = await AsyncStorage.getItem('access_token');
|
|
230
|
-
fetch('/api/teams', { headers: { Authorization: 'Bearer ' + token } });
|
|
262
|
+
### Client-side: proxy through Express (browser SPA)
|
|
231
263
|
|
|
232
|
-
|
|
233
|
-
|
|
264
|
+
Core doesn't allow cross-origin requests from browser clients — CORS will block direct calls.
|
|
265
|
+
Add three thin proxy routes to your Express server, then call those from the browser:
|
|
266
|
+
|
|
267
|
+
// In Express (server.js) — add before the requireAuth middleware:
|
|
268
|
+
const CORE_URL = process.env.CORE_API_URL || 'https://core.dailey.cloud';
|
|
269
|
+
const APP_SLUG = process.env.CORE_APP_SLUG || 'your-app-slug';
|
|
270
|
+
|
|
271
|
+
app.post('/api/auth/login', async (req, res) => {
|
|
272
|
+
const { email, password } = req.body;
|
|
273
|
+
const coreRes = await fetch(\`\${CORE_URL}/auth/login\`, {
|
|
274
|
+
method: 'POST',
|
|
275
|
+
headers: { 'Content-Type': 'application/json', 'X-Client-Id': APP_SLUG },
|
|
276
|
+
body: JSON.stringify({ email, password, app_slug: APP_SLUG }),
|
|
277
|
+
});
|
|
278
|
+
const data = await coreRes.json();
|
|
279
|
+
res.status(coreRes.status).json(coreRes.ok ? data : { error: data.error || 'Login failed.' });
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
app.post('/api/auth/refresh', async (req, res) => {
|
|
283
|
+
const coreRes = await fetch(\`\${CORE_URL}/auth/refresh\`, {
|
|
284
|
+
method: 'POST',
|
|
285
|
+
headers: { 'Content-Type': 'application/json', 'Authorization': req.headers.authorization },
|
|
286
|
+
});
|
|
287
|
+
res.status(coreRes.status).json(await coreRes.json());
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
app.post('/api/auth/logout', async (req, res) => {
|
|
291
|
+
if (req.headers.authorization)
|
|
292
|
+
fetch(\`\${CORE_URL}/auth/logout\`, { method: 'POST', headers: { 'Authorization': req.headers.authorization } }).catch(() => {});
|
|
293
|
+
res.json({ success: true });
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// In the browser (localStorage-based):
|
|
297
|
+
async function login(email, password) {
|
|
298
|
+
const res = await fetch('/api/auth/login', {
|
|
299
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
300
|
+
body: JSON.stringify({ email, password }),
|
|
301
|
+
});
|
|
302
|
+
const { access_token, refresh_token, user } = await res.json();
|
|
303
|
+
localStorage.setItem('access_token', access_token);
|
|
304
|
+
localStorage.setItem('refresh_token', refresh_token);
|
|
305
|
+
localStorage.setItem('user', JSON.stringify(user));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Every API call to your Express server:
|
|
309
|
+
const token = localStorage.getItem('access_token');
|
|
310
|
+
fetch('/api/me', { headers: { Authorization: 'Bearer ' + token } });
|
|
311
|
+
|
|
312
|
+
// On 401, refresh and retry:
|
|
313
|
+
async function tryRefresh() {
|
|
314
|
+
const refresh_token = localStorage.getItem('refresh_token');
|
|
315
|
+
if (!refresh_token) return false;
|
|
316
|
+
const res = await fetch('/api/auth/refresh', {
|
|
317
|
+
method: 'POST', headers: { 'Authorization': 'Bearer ' + refresh_token },
|
|
318
|
+
});
|
|
319
|
+
if (!res.ok) return false;
|
|
320
|
+
const { access_token } = await res.json();
|
|
321
|
+
localStorage.setItem('access_token', access_token);
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
async function logout() {
|
|
326
|
+
const token = localStorage.getItem('access_token');
|
|
327
|
+
if (token) await fetch('/api/auth/logout', { method: 'POST', headers: { Authorization: 'Bearer ' + token } }).catch(() => {});
|
|
328
|
+
['access_token', 'refresh_token', 'user'].forEach(k => localStorage.removeItem(k));
|
|
329
|
+
}
|
|
234
330
|
|
|
235
|
-
|
|
331
|
+
For React Native / mobile: use AsyncStorage instead of localStorage, and you can call Core directly (no CORS in native apps).
|
|
236
332
|
|
|
237
333
|
## Storage Proxy Pattern — Uploads From Browser / Mobile
|
|
238
334
|
|
|
@@ -17,7 +17,7 @@ function maskValue(v: string): string {
|
|
|
17
17
|
export function registerCredentialRevealTools(server: McpServer) {
|
|
18
18
|
server.tool(
|
|
19
19
|
'dailey_reveal_credential',
|
|
20
|
-
'Reveal a project credential
|
|
20
|
+
'Reveal a project credential (e.g. DB_PASSWORD). Re-auth required — every reveal is audited. BY DEFAULT returns a masked preview (last 3 chars + length) so the value never enters chat transcripts. To emit the plaintext into this response, pass emit_plaintext=true AND acknowledge that the response will be visible in the chat log / AI history / anyone the user shares the transcript with. Better workflow: use dailey_db_tunnel or dashboard "reveal" (which uses a browser-only modal) for anything you wouldn\'t paste in Slack.',
|
|
21
21
|
{
|
|
22
22
|
project_id: z.string().describe('The project ID'),
|
|
23
23
|
key: z.string().describe('Credential key (e.g., DB_PASSWORD, WORDPRESS_ADMIN_PASSWORD)'),
|
package/src/tools/db.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function registerDbTools(server: McpServer) {
|
|
|
65
65
|
`Port: ${db.port || '-'}`,
|
|
66
66
|
`Database: ${db.database || '-'}`,
|
|
67
67
|
`Username: ${db.username || '-'}`,
|
|
68
|
-
`Password:
|
|
68
|
+
`Password: [use dailey_db_tunnel to connect — password not returned here to avoid chat-log exposure]`,
|
|
69
69
|
];
|
|
70
70
|
if (db.size_mb !== undefined) {
|
|
71
71
|
lines.push(`Size: ${db.size_mb} MB`);
|
|
@@ -14,7 +14,6 @@ interface DeployStatus {
|
|
|
14
14
|
new_commits?: number;
|
|
15
15
|
latest_sha?: string | null;
|
|
16
16
|
latest_message?: string | null;
|
|
17
|
-
pod_crash?: { restart_count: number; recent_logs: string } | null;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
interface Build {
|
|
@@ -82,57 +81,6 @@ function getFailureGuidance(log: string): { reason: string; fix: string } | null
|
|
|
82
81
|
return null;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
const RUNTIME_CRASH_PATTERNS: Array<{ pattern: RegExp; summary: string; fix: string }> = [
|
|
86
|
-
{
|
|
87
|
-
pattern: /P3009|migrate found failed migrations/i,
|
|
88
|
-
summary: 'Prisma migration failed on startup (P3009). A previous migration left the database in a dirty state and Prisma is blocking all further migrations.',
|
|
89
|
-
fix: 'Run `npx prisma migrate resolve --rolled-back <migration_name>` to mark the failed migration as rolled back, then redeploy. If the database is fresh with no real data, you can clear `_prisma_migrations` entirely and redeploy to run all migrations from scratch. Use `dailey_db_exec` to inspect the `_prisma_migrations` table.',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
pattern: /Cannot find module|MODULE_NOT_FOUND/,
|
|
93
|
-
summary: 'App crashed at startup — a required module or file is missing at runtime.',
|
|
94
|
-
fix: 'A file is imported but does not exist in the deployed image. Search for the import in your source, check if the file was deleted or renamed, and fix the import before redeploying. Run `npx tsc --noEmit` locally to catch this before deploying.',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
pattern: /password authentication failed|ECONNREFUSED.*5432|ECONNREFUSED.*3306|connection refused.*database/i,
|
|
98
|
-
summary: 'App crashed — cannot connect to the database.',
|
|
99
|
-
fix: 'Check that the database is provisioned and DATABASE_URL is set. Run `dailey_env_list` to verify the env var is present. If the database was recently created, it may still be initialising — wait 30 seconds and redeploy.',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
pattern: /EADDRINUSE/i,
|
|
103
|
-
summary: 'App crashed — port already in use.',
|
|
104
|
-
fix: 'The app is trying to bind a hardcoded port. Read the port from `process.env.PORT` and bind to `0.0.0.0`, not localhost.',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
pattern: /ENOMEM|heap out of memory|JavaScript heap out of memory/i,
|
|
108
|
-
summary: 'App crashed — out of memory (OOM).',
|
|
109
|
-
fix: 'The app exceeded its RAM limit. Scale up RAM from the dashboard, or add `--max-old-space-size=<MB>` to NODE_OPTIONS env var to cap Node.js heap below the container limit.',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
pattern: /missing required env|required environment variable|env.*not.*set|getenv.*undefined/i,
|
|
113
|
-
summary: 'App crashed — a required environment variable is not set.',
|
|
114
|
-
fix: 'Run `dailey_env_list` to see what env vars are set. Add the missing variable with `dailey_env_set`, then redeploy.',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
pattern: /PRISMA_CLIENT_NOT_GENERATED|@prisma\/client did not initialize/i,
|
|
118
|
-
summary: 'Prisma Client was not generated before the app started.',
|
|
119
|
-
fix: 'Add `prisma generate` to your build step or postinstall script. In package.json: `"postinstall": "prisma generate"`.',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
pattern: /SyntaxError|unexpected token|Cannot use import/i,
|
|
123
|
-
summary: 'App crashed — JavaScript syntax error or ESM/CJS module incompatibility.',
|
|
124
|
-
fix: 'The compiled output has a syntax error or module format mismatch. Check your tsconfig `module` and `target` settings. Run `npm run build` locally and start the compiled output to reproduce.',
|
|
125
|
-
},
|
|
126
|
-
];
|
|
127
|
-
|
|
128
|
-
function getRuntimeCrashGuidance(logs: string): { summary: string; fix: string } | null {
|
|
129
|
-
if (!logs) return null;
|
|
130
|
-
for (const { pattern, summary, fix } of RUNTIME_CRASH_PATTERNS) {
|
|
131
|
-
if (pattern.test(logs)) return { summary, fix };
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
84
|
export function registerDeployStatusTools(server: McpServer) {
|
|
137
85
|
// Project-level pre-deploy status: can I deploy? is a build running? is there a new commit?
|
|
138
86
|
// Also fetches the latest build row to show progress emojis during active builds.
|
|
@@ -195,25 +143,6 @@ export function registerDeployStatusTools(server: McpServer) {
|
|
|
195
143
|
if (progress) {
|
|
196
144
|
lines.push(` Progress: ${progress}`);
|
|
197
145
|
}
|
|
198
|
-
// Runtime crash — build succeeded but pod is CrashLoopBackOff
|
|
199
|
-
if (status.pod_crash) {
|
|
200
|
-
const crash = status.pod_crash;
|
|
201
|
-
const guidance = getRuntimeCrashGuidance(crash.recent_logs);
|
|
202
|
-
lines.push('');
|
|
203
|
-
lines.push(`⚠️ RUNTIME CRASH (build succeeded, app crashes on startup)`);
|
|
204
|
-
lines.push(` Restarts: ${crash.restart_count}`);
|
|
205
|
-
if (guidance) {
|
|
206
|
-
lines.push(` Error: ${guidance.summary}`);
|
|
207
|
-
lines.push(` Fix: ${guidance.fix}`);
|
|
208
|
-
} else {
|
|
209
|
-
lines.push(` Logs (last 40 lines):`);
|
|
210
|
-
crash.recent_logs.split('\n').slice(-20).filter(Boolean).forEach((l) => {
|
|
211
|
-
lines.push(` ${l}`);
|
|
212
|
-
});
|
|
213
|
-
lines.push(` Tip: call dailey_app_logs with project_id=${project_id} for full logs.`);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
146
|
if (latest.status === 'failed') {
|
|
218
147
|
// Prefer the structured diagnosis fields surfaced by the deploy-service
|
|
219
148
|
// (build_error_summary / build_error_fix) over the local pattern matching.
|