@daileyos/mcp-server 1.9.0 → 1.9.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"credentials-reveal.d.ts","sourceRoot":"","sources":["../../src/tools/credentials-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,QAgC9D"}
1
+ {"version":3,"file":"credentials-reveal.d.ts","sourceRoot":"","sources":["../../src/tools/credentials-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgBpE,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,QA+C9D"}
@@ -1,11 +1,25 @@
1
1
  import { z } from 'zod';
2
2
  import { apiRequest, formatError, textResult } from '../api.js';
3
+ /**
4
+ * Mask a credential value for display. Keeps the last 3 characters so the
5
+ * caller can sanity-check which credential they're looking at, hides the
6
+ * rest. Returns just the length indicator for very short values.
7
+ */
8
+ function maskValue(v) {
9
+ if (!v)
10
+ return '(empty)';
11
+ if (v.length <= 4)
12
+ return '•'.repeat(v.length) + ` (${v.length} chars)`;
13
+ const tail = v.slice(-3);
14
+ return '•'.repeat(Math.min(v.length - 3, 12)) + tail + ` (${v.length} chars)`;
15
+ }
3
16
  export function registerCredentialRevealTools(server) {
4
- server.tool('dailey_reveal_credential', 'Reveal the actual value of a single project credential (e.g., DB_PASSWORD). Requires password re-auth for audit. Uses DAILEY_PASSWORD env var if set, otherwise provide password argument. Every reveal is logged.', {
17
+ server.tool('dailey_reveal_credential', '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.', {
5
18
  project_id: z.string().describe('The project ID'),
6
19
  key: z.string().describe('Credential key (e.g., DB_PASSWORD, WORDPRESS_ADMIN_PASSWORD)'),
7
20
  password: z.string().optional().describe('Account password for re-auth (falls back to DAILEY_PASSWORD env var)'),
8
- }, async ({ project_id, key, password }) => {
21
+ emit_plaintext: z.boolean().optional().describe('If true, emits the cleartext credential into the response. Default false. Only set true when you understand the chat-log exposure. Rotate immediately afterward if the transcript will be shared.'),
22
+ }, async ({ project_id, key, password, emit_plaintext }) => {
9
23
  const pw = password || process.env.DAILEY_PASSWORD;
10
24
  if (!pw) {
11
25
  return textResult('Error: re-auth password required. Set DAILEY_PASSWORD env var or pass password argument. Every reveal is audited.');
@@ -13,13 +27,25 @@ export function registerCredentialRevealTools(server) {
13
27
  const res = await apiRequest('POST', `/projects/${project_id}/credentials/reveal`, { key, password: pw });
14
28
  if (!res.ok)
15
29
  return textResult(formatError(res));
16
- return textResult([
17
- `${res.data.key}: ${res.data.value}`,
18
- '',
19
- '⚠ This secret was just emitted into a chat/log session. If the reader',
20
- ' is untrusted (logs, transcripts shared with third parties, AI chat',
21
- ' histories), rotate this value now via dailey_env_vars set.',
22
- ].join('\n'));
30
+ const { key: k, value } = res.data;
31
+ const lines = [];
32
+ if (emit_plaintext) {
33
+ lines.push(`${k}: ${value}`);
34
+ lines.push('');
35
+ lines.push('⚠ EMITTED CLEARTEXT — this response is now in the chat log. Rotate');
36
+ lines.push(' this credential now via dailey_env_vars set if the transcript is shared,');
37
+ lines.push(' synced to cloud AI history, or anywhere outside a private terminal.');
38
+ }
39
+ else {
40
+ lines.push(`${k}: ${maskValue(value)} [masked — pass emit_plaintext=true to see]`);
41
+ lines.push('');
42
+ lines.push('The full credential was NOT emitted. Reveal is audited server-side either way.');
43
+ lines.push('If you need the cleartext:');
44
+ lines.push(' • dailey_db_tunnel (for DB creds — opens a local port, no value in chat)');
45
+ lines.push(' • dashboard "reveal" (browser-only modal — does not hit chat)');
46
+ lines.push(' • dailey_reveal_credential(..., emit_plaintext=true) as last resort');
47
+ }
48
+ return textResult(lines.join('\n'));
23
49
  });
24
50
  }
25
51
  //# sourceMappingURL=credentials-reveal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials-reveal.js","sourceRoot":"","sources":["../../src/tools/credentials-reveal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhE,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B,oNAAoN,EACpN;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACjD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;QACxF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;KACjH,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QACnD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,OAAO,UAAU,CACf,mHAAmH,CACpH,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,UAAU,CAC1B,MAAM,EACN,aAAa,UAAU,qBAAqB,EAC5C,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CACtB,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC;YAChB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gF,CAAC,CAAC;YAC7F,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;YACzC,KAAK,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;YACzF,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;YAC9E,KAAK,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daileyos/mcp-server",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Dailey OS MCP server for Claude Code and AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -2,16 +2,29 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
3
  import { apiRequest, formatError, textResult } from '../api.js';
4
4
 
5
+ /**
6
+ * Mask a credential value for display. Keeps the last 3 characters so the
7
+ * caller can sanity-check which credential they're looking at, hides the
8
+ * rest. Returns just the length indicator for very short values.
9
+ */
10
+ function maskValue(v: string): string {
11
+ if (!v) return '(empty)';
12
+ if (v.length <= 4) return '•'.repeat(v.length) + ` (${v.length} chars)`;
13
+ const tail = v.slice(-3);
14
+ return '•'.repeat(Math.min(v.length - 3, 12)) + tail + ` (${v.length} chars)`;
15
+ }
16
+
5
17
  export function registerCredentialRevealTools(server: McpServer) {
6
18
  server.tool(
7
19
  'dailey_reveal_credential',
8
- 'Reveal the actual value of a single project credential (e.g., DB_PASSWORD). Requires password re-auth for audit. Uses DAILEY_PASSWORD env var if set, otherwise provide password argument. Every reveal is logged.',
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.',
9
21
  {
10
22
  project_id: z.string().describe('The project ID'),
11
23
  key: z.string().describe('Credential key (e.g., DB_PASSWORD, WORDPRESS_ADMIN_PASSWORD)'),
12
24
  password: z.string().optional().describe('Account password for re-auth (falls back to DAILEY_PASSWORD env var)'),
25
+ emit_plaintext: z.boolean().optional().describe('If true, emits the cleartext credential into the response. Default false. Only set true when you understand the chat-log exposure. Rotate immediately afterward if the transcript will be shared.'),
13
26
  },
14
- async ({ project_id, key, password }) => {
27
+ async ({ project_id, key, password, emit_plaintext }) => {
15
28
  const pw = password || process.env.DAILEY_PASSWORD;
16
29
  if (!pw) {
17
30
  return textResult(
@@ -25,13 +38,27 @@ export function registerCredentialRevealTools(server: McpServer) {
25
38
  { key, password: pw },
26
39
  );
27
40
  if (!res.ok) return textResult(formatError(res));
28
- return textResult([
29
- `${res.data.key}: ${res.data.value}`,
30
- '',
31
- '⚠ This secret was just emitted into a chat/log session. If the reader',
32
- ' is untrusted (logs, transcripts shared with third parties, AI chat',
33
- ' histories), rotate this value now via dailey_env_vars set.',
34
- ].join('\n'));
41
+
42
+ const { key: k, value } = res.data;
43
+ const lines: string[] = [];
44
+
45
+ if (emit_plaintext) {
46
+ lines.push(`${k}: ${value}`);
47
+ lines.push('');
48
+ lines.push('⚠ EMITTED CLEARTEXT — this response is now in the chat log. Rotate');
49
+ lines.push(' this credential now via dailey_env_vars set if the transcript is shared,');
50
+ lines.push(' synced to cloud AI history, or anywhere outside a private terminal.');
51
+ } else {
52
+ lines.push(`${k}: ${maskValue(value)} [masked — pass emit_plaintext=true to see]`);
53
+ lines.push('');
54
+ lines.push('The full credential was NOT emitted. Reveal is audited server-side either way.');
55
+ lines.push('If you need the cleartext:');
56
+ lines.push(' • dailey_db_tunnel (for DB creds — opens a local port, no value in chat)');
57
+ lines.push(' • dashboard "reveal" (browser-only modal — does not hit chat)');
58
+ lines.push(' • dailey_reveal_credential(..., emit_plaintext=true) as last resort');
59
+ }
60
+
61
+ return textResult(lines.join('\n'));
35
62
  },
36
63
  );
37
64
  }