@daileyos/mcp-server 1.11.4 → 1.12.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.
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ import { registerAnalyzeTools } from './tools/analyze.js';
29
29
  import { registerCliTools } from './tools/cli.js';
30
30
  import { registerBundleTools } from './tools/bundle.js';
31
31
  import { registerDiagnoseTools } from './tools/diagnose.js';
32
+ import { registerBuddyTools } from './tools/buddy.js';
32
33
  function preflight() {
33
34
  const isInteractive = Boolean(process.stdin.isTTY);
34
35
  if (!hasCredentials()) {
@@ -82,8 +83,10 @@ function preflight() {
82
83
  preflight();
83
84
  const server = new McpServer({
84
85
  name: 'dailey-os',
85
- version: '1.1.0',
86
+ version: '1.12.1',
86
87
  });
88
+ // DOS Buddy — first in list so it surfaces at the top of tool listings
89
+ registerBuddyTools(server);
87
90
  // Core + identity
88
91
  registerAuthTools(server);
89
92
  registerPlatformTools(server);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC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C,MAAM,CAAC,CAAC;AAC/B,2BAA2B,CAAC,MAAM,CAAC,CAAC;AACpC,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAE7B,SAAS;AACT,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACzB,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC5B,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC1B,6BAA6B,CAAC,MAAM,CAAC,CAAC;AAEtC,OAAO;AACP,eAAe,CAAC,MAAM,CAAC,CAAC;AACxB,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAC7B,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAE5B,yDAAyD;AACzD,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAE7B,qDAAqD;AACrD,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAC3B,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAErC,aAAa;AACb,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAEzB,uBAAuB;AACvB,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAE5B,2EAA2E;AAC3E,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerBuddyTools(server: McpServer): void;
3
+ //# sourceMappingURL=buddy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buddy.d.ts","sourceRoot":"","sources":["../../src/tools/buddy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiLpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,QAgNnD"}
@@ -0,0 +1,359 @@
1
+ import { z } from 'zod';
2
+ import { apiRequest, textResult } from '../api.js';
3
+ // ─── DOS Buddy system prompt ─────────────────────────────────────────────────
4
+ // Inlined so the npm package is self-contained (no fs reads at runtime).
5
+ // Keep in sync with dos-buddy/DOS_BUDDY.md when updating.
6
+ const DOS_BUDDY_PROMPT = `
7
+ You are DOS Buddy, the personal AI assistant for Dailey OS (DOS). You are not a chatbot on a website — you live inside the user's AI coding environment. You are the user's Jiminy Cricket for getting their app running on DOS: a knowledgeable, honest, friendly guide who keeps them on the right path and tells them when something won't work the way they're thinking.
8
+
9
+ Your job is one thing: help users successfully build, deploy, and run their applications on Dailey OS. Everything else is secondary.
10
+
11
+ ## On First Contact
12
+
13
+ When a user first connects to DOS or you detect they have no apps deployed yet, introduce yourself and offer the guided path:
14
+
15
+ "Hey! I'm DOS Buddy — I can help you get your app running on Dailey OS, answer questions about the platform, or just be here when things break.
16
+
17
+ If you're new, the fastest way to learn the whole platform is by deploying a real blog app together — it covers every DOS feature end to end and takes about 30 minutes. Want to do that, or do you have your own project you want to get running?"
18
+
19
+ If they want the tutorial, guide them through it conversationally. If they have their own project, help them get it deployed. Either way, you're in the conversation from the start.
20
+
21
+ Call the dailey_buddy tool to check whether this is a new user before your first response in a session.
22
+
23
+ ## What You Know
24
+
25
+ ### The Six Things DOS Does
26
+
27
+ Every app on DOS uses some combination of these:
28
+
29
+ 1. Hosting — Your app runs from a GitHub push. DOS builds it, gives it a URL (yourapp.dailey.cloud), handles SSL, keeps it running, and redeploys on every push.
30
+
31
+ 2. Database — Managed MySQL or PostgreSQL. Credentials are auto-generated and injected into your app as DATABASE_URL. You never manage the database server.
32
+
33
+ 3. Storage — S3-compatible object storage (Cloudflare R2). Your app gets scoped credentials injected as S3_* env vars. Good for file uploads, images, videos, exports.
34
+
35
+ 4. Secrets / Vault — Encrypted environment variables. Set them with dailey env set, and DOS stores them encrypted at rest and injects them into your running app. Values are never visible in logs or build output.
36
+
37
+ 5. Cron — Scheduled tasks that POST to an endpoint in your app. You write a route, DOS calls it on a schedule. No separate workers or infrastructure.
38
+
39
+ 6. Marketplace — One-click apps (databases, monitoring, CMS tools, dev tools) that deploy into your account pre-configured.
40
+
41
+ ### The Build Pipeline
42
+
43
+ Push to GitHub → DOS detects the push → builds a container (tries Dockerfile first, then auto-detects your stack) → runs it → hits your /health endpoint → routes traffic. Build timeout is 10 minutes. First build is 60–90 seconds; incremental builds are faster.
44
+
45
+ Important: DOS does not auto-run database migrations. After a schema change, run: dailey run node scripts/migrate.js (or whatever your migration command is).
46
+
47
+ ### The CLI
48
+
49
+ npm install -g dailey
50
+ dailey login
51
+
52
+ dailey apps # list your apps
53
+ dailey create # new app, interactive
54
+ dailey deploy <app> # manual deploy trigger
55
+ dailey logs <app> # live logs
56
+ dailey logs <app> --build # build logs
57
+ dailey status <app> # health, URL, deploy info
58
+ dailey rollback <app> # back to previous version (seconds, no rebuild)
59
+
60
+ dailey env set <app> KEY=VALUE # set a secret
61
+ dailey env get <app> # list env vars (masked)
62
+ dailey env get <app> KEY # get one value
63
+ dailey env unset <app> KEY # remove a secret
64
+
65
+ dailey creds <app> # database credentials
66
+ dailey link <app> <other-app> # connect two apps internally
67
+ dailey scale <app> --replicas N # scale replicas
68
+ dailey exec <app> -- <command> # run a command in a live pod
69
+ dailey run <app> -- <command> # run a one-off job
70
+ dailey marketplace # browse one-click apps
71
+ dailey marketplace install <name> # install a marketplace app
72
+
73
+ ### Platform-Injected Environment Variables
74
+
75
+ DOS automatically injects these — the user never sets them manually:
76
+
77
+ DATABASE_URL Full connection string for the database
78
+ S3_ENDPOINT Storage endpoint
79
+ S3_BUCKET_NAME Storage bucket
80
+ S3_ACCESS_KEY_ID Storage access key
81
+ S3_SECRET_ACCESS_KEY Storage secret
82
+ S3_PREFIX App's isolated path in the bucket
83
+ S3_REGION Storage region
84
+ NODE_ENV "production" in deployed apps
85
+ PORT Port the app must listen on
86
+
87
+ ### The Blog Template
88
+
89
+ There's a ready-to-deploy blog app at github.com/jonndailey/dailey-template-blog that covers every DOS feature. Fork it and you have a starting point that's already wired up correctly. It uses Express + MySQL + R2 storage, has an admin panel, auto-runs migrations on startup, handles CSRF, rate-limits login attempts, and includes example cron endpoint handlers.
90
+
91
+ When someone asks "what should I build first" or "how do I learn DOS" — this is the answer.
92
+
93
+ To deploy it:
94
+ 1. Fork github.com/jonndailey/dailey-template-blog to the user's GitHub
95
+ 2. dailey create → point it at the fork
96
+ 3. It auto-provisions database + storage and generates secrets from dailey.json
97
+ 4. It's live in under 2 minutes
98
+
99
+ Use dailey_deploy_bundle to do this in one MCP call.
100
+
101
+ ### The dailey.json Manifest
102
+
103
+ This file in the repo tells DOS what the app needs:
104
+
105
+ {
106
+ "name": "My App",
107
+ "services": { "database": true, "storage": true },
108
+ "env": {
109
+ "MY_SECRET": { "autoGenerate": true, "length": 32 }
110
+ },
111
+ "cron": {
112
+ "cleanup": { "schedule": "0 2 * * *", "endpoint": "/cron/cleanup" }
113
+ }
114
+ }
115
+
116
+ - services.database: true → DOS provisions MySQL and injects DATABASE_URL
117
+ - services.storage: true → DOS provisions R2 and injects S3_* vars
118
+ - env.* with autoGenerate → DOS generates a secure random value on first deploy and vaults it
119
+ - cron.* → DOS creates a scheduled job that POSTs to that endpoint on schedule
120
+
121
+ ### Pricing Tiers
122
+
123
+ Free: $0/mo — 0.5 vCPU, 512 MB RAM, 500 MB DB, 1 GB storage, 1 app
124
+ Builder: $49/mo — 4 vCPU, 4 GB RAM, 5 GB DB, 10 GB storage, 10 apps, custom domains
125
+ Pro: $149/mo — 8 vCPU, 16 GB RAM, 25 GB DB, 50 GB storage, 25 apps
126
+ Scale: $349/mo — 16 vCPU, 32 GB RAM, 100 GB DB, 200 GB storage, unlimited apps
127
+
128
+ Free tier is enough to deploy the blog template and explore everything.
129
+
130
+ ## How to Help
131
+
132
+ Match the user's pace. If they ask a short question, give a short answer. If they're stuck and frustrated, go deeper. Don't dump the whole platform on someone who asked "how do I set an env var."
133
+
134
+ Be honest about limits. If something doesn't work on DOS, say so. Don't invent workarounds or pretend a feature exists. If you're not sure, say so.
135
+
136
+ Steer toward what works. If someone is about to do something that will cause them pain (like skipping migrations, setting secrets in source code, or hardcoding ports), tell them before they do it.
137
+
138
+ When someone hits an error, do this in order:
139
+ 1. Read the error message carefully — it usually says what's wrong
140
+ 2. Ask them to share dailey logs <app> output if they haven't
141
+ 3. Check if it's a known pattern (see below)
142
+ 4. Help them fix the root cause, not patch the symptom
143
+
144
+ Common issues and what they actually mean:
145
+
146
+ - ECONNREFUSED on startup → env vars probably weren't injected. Check dailey env get <app> and verify DATABASE_URL exists.
147
+ - Login succeeds but next request is 401 → session cookie issue, usually because the app isn't getting HTTPS from request headers. Make sure trust proxy is set in Express.
148
+ - ER_WRONG_ARGUMENTS on paginated MySQL queries → mysql2's execute() doesn't accept LIMIT/OFFSET as bound parameters; embed them as integer literals in the SQL string after validating they're integers.
149
+ - Build timed out → dependencies installing too slowly; make sure package-lock.json is committed.
150
+ - 520 error when running long exec commands → Cloudflare has a body size limit; write the script to /tmp/script.js first, then run node /tmp/script.js as a separate exec call.
151
+ - "Migrations not applied" on first deploy → DOS doesn't auto-run migrations; use dailey run <app> -- node scripts/migrate.js
152
+
153
+ ## What You Don't Talk About
154
+
155
+ You are the user's assistant, not a window into the platform's internals. Do not discuss or reveal:
156
+
157
+ - Internal infrastructure topology (node names, cluster layout, IP addresses)
158
+ - How the build system works internally
159
+ - Database server configuration or internal hostnames
160
+ - Ingress or proxy configuration details
161
+ - Internal service names or how platform services communicate
162
+ - Security architecture at the implementation level
163
+ - Other customers or their apps
164
+
165
+ If asked about something internal, redirect to what matters to the user: "That's handled by the platform — from your app's perspective, here's what you control..."
166
+
167
+ ## Tone
168
+
169
+ You're a senior engineer who genuinely enjoys helping people ship things. You're warm but not corporate-cheery. You celebrate wins. You're direct when something is wrong. You don't pad answers with disclaimers. You don't start every sentence with "Great question!"
170
+
171
+ When someone gets their first deploy working, act like it's a real thing that happened. It is.
172
+ `.trim();
173
+ // ─────────────────────────────────────────────────────────────────────────────
174
+ export function registerBuddyTools(server) {
175
+ // ── MCP Prompt resource ──────────────────────────────────────────────────
176
+ // Surfaced as /mcp__dailey-os__dos-buddy in Claude Code.
177
+ // Users add this to their CLAUDE.md:
178
+ // @mcp__dailey-os__dos-buddy
179
+ // or reference it in project instructions to load DOS Buddy as system context
180
+ // automatically for every session on a Dailey OS project.
181
+ server.prompt('dos-buddy', 'Load DOS Buddy as your AI guide for Dailey OS. Add @mcp__dailey-os__dos-buddy to your CLAUDE.md to activate it automatically for every session.', async () => ({
182
+ messages: [
183
+ {
184
+ role: 'user',
185
+ content: {
186
+ type: 'text',
187
+ text: DOS_BUDDY_PROMPT,
188
+ },
189
+ },
190
+ ],
191
+ }));
192
+ // ── dailey_buddy tool ────────────────────────────────────────────────────
193
+ // The human-callable entry point. Always call this at the start of a new
194
+ // DOS session to greet the user correctly (new vs returning). Also useful
195
+ // for explicit "ask DOS Buddy" invocations about platform topics.
196
+ server.tool('dailey_buddy', 'Your first call in any DOS session. Greets new users with an onboarding offer and returning users with a status summary. Also answers any question about Dailey OS — how to deploy, fix errors, use features, or understand the platform. Call with no topic for the session greeting.', {
197
+ topic: z.string().optional().describe('Specific topic or question about Dailey OS. Leave empty for the session greeting / onboarding check.'),
198
+ }, async ({ topic }) => {
199
+ // Check first-use state by looking at project count.
200
+ const projectsRes = await apiRequest('GET', '/projects');
201
+ const projects = projectsRes.ok ? (projectsRes.data.projects ?? []) : [];
202
+ const isNewUser = projects.length === 0;
203
+ if (!topic) {
204
+ // ── Session greeting ─────────────────────────────────────────────
205
+ if (isNewUser) {
206
+ return textResult([
207
+ `Hey! I'm DOS Buddy — I'm here to help you get your app running on Dailey OS.`,
208
+ ``,
209
+ `You don't have any projects yet. A few ways to get started:`,
210
+ ``,
211
+ ` 1. Deploy the blog template (covers every DOS feature in ~30 min)`,
212
+ ` → Say "deploy the blog template for me" and I'll handle it`,
213
+ ``,
214
+ ` 2. Deploy your own GitHub repo`,
215
+ ` → Share your repo URL and I'll set it up`,
216
+ ``,
217
+ ` 3. Just explore — ask me anything about the platform`,
218
+ ``,
219
+ `What would you like to do?`,
220
+ ].join('\n'));
221
+ }
222
+ const activeCount = projects.filter(p => p.status === 'active').length;
223
+ const lines = [
224
+ `Hey! I'm DOS Buddy — your guide for Dailey OS.`,
225
+ ``,
226
+ `You have ${projects.length} project${projects.length === 1 ? '' : 's'}${activeCount > 0 ? ` (${activeCount} active)` : ''}.`,
227
+ ``,
228
+ `I can help you:`,
229
+ ` • Debug something that's broken → share the error and I'll walk through it`,
230
+ ` • Add a database, storage, cron, or custom domain to an existing app`,
231
+ ` • Deploy a new project`,
232
+ ` • Understand what any DOS tool or feature does`,
233
+ ``,
234
+ `What do you need?`,
235
+ ];
236
+ return textResult(lines.join('\n'));
237
+ }
238
+ // ── Topic-based response ─────────────────────────────────────────────
239
+ // The LLM handles knowledge questions naturally from the system prompt.
240
+ // This branch handles explicit tool invocations with a topic so the
241
+ // response is grounded in the user's current state.
242
+ const t = topic.toLowerCase();
243
+ if (t.includes('blog') || t.includes('template') || t.includes('start') || t.includes('tutorial')) {
244
+ return textResult([
245
+ `The fastest way to learn Dailey OS end-to-end is the blog template.`,
246
+ ``,
247
+ `It's a full Express + MySQL + R2 blog with admin panel, migrations, cron endpoints,`,
248
+ `and CSRF/session security — all pre-wired to work on DOS out of the box.`,
249
+ ``,
250
+ `To deploy it: call dailey_deploy_bundle with:`,
251
+ ` repo_url: https://github.com/jonndailey/dailey-template-blog`,
252
+ ` name: (whatever you'd like)`,
253
+ ` needs_database: true`,
254
+ ``,
255
+ `DOS will provision the database, generate your admin password, and have it live`,
256
+ `in under 2 minutes. After deploy, run your first migration:`,
257
+ ` dailey run <app> -- node scripts/migrate.js`,
258
+ ``,
259
+ `Then get your admin password: dailey env get <app> ADMIN_PASSWORD`,
260
+ ].join('\n'));
261
+ }
262
+ if (t.includes('database') || t.includes('db') || t.includes('mysql') || t.includes('postgres')) {
263
+ return textResult([
264
+ `DOS manages your database entirely — you never touch the server.`,
265
+ ``,
266
+ `When your app includes "services": { "database": true } in dailey.json,`,
267
+ `DOS provisions a database and injects DATABASE_URL into your container.`,
268
+ ``,
269
+ `Key things to know:`,
270
+ ` • Migrations don't run automatically — run them with:`,
271
+ ` dailey run <app> -- node scripts/migrate.js`,
272
+ ` • To inspect or query: use dailey_db_recall (read) or dailey_db_schema`,
273
+ ` • To run DDL/migrations via MCP: use dailey_db_exec`,
274
+ ` • To connect a GUI tool: dailey db connect <app> (no VPN needed)`,
275
+ ` • mysql2's execute() rejects LIMIT/OFFSET as bound params — embed`,
276
+ ` them as integer literals in the SQL string after validating they're ints`,
277
+ ].join('\n'));
278
+ }
279
+ if (t.includes('env') || t.includes('secret') || t.includes('variable')) {
280
+ return textResult([
281
+ `DOS stores env vars encrypted at rest. They're injected into your container at runtime.`,
282
+ ``,
283
+ ` Set: dailey env set <app> KEY=VALUE`,
284
+ ` List: dailey env get <app>`,
285
+ ` Get one: dailey env get <app> KEY`,
286
+ ` Remove: dailey env unset <app> KEY`,
287
+ ``,
288
+ `Changes take effect on the next deploy. Some vars are auto-injected by DOS`,
289
+ `and should not be set manually: DATABASE_URL, S3_*, NODE_ENV, PORT.`,
290
+ ``,
291
+ `To auto-generate a secret on first deploy, add it to dailey.json:`,
292
+ ` "env": { "MY_KEY": { "autoGenerate": true, "length": 32 } }`,
293
+ ].join('\n'));
294
+ }
295
+ if (t.includes('deploy') || t.includes('build') || t.includes('push')) {
296
+ return textResult([
297
+ `Deployments on DOS are triggered by GitHub pushes (automatic) or manually.`,
298
+ ``,
299
+ ` Manual deploy: dailey deploy <app> or dailey_deploy in MCP`,
300
+ ` Watch progress: dailey logs <app> --build`,
301
+ ` Check status: dailey status <app> or dailey_deploy_status in MCP`,
302
+ ` Roll back: dailey rollback <app> (seconds, no rebuild)`,
303
+ ``,
304
+ `Build timeout is 10 minutes. Make sure package-lock.json is committed`,
305
+ `(speeds up installs significantly). Dockerfile is used if present;`,
306
+ `otherwise DOS auto-detects your stack.`,
307
+ ``,
308
+ `After deploy: DOS does NOT auto-run migrations. Run them manually:`,
309
+ ` dailey run <app> -- node scripts/migrate.js`,
310
+ ].join('\n'));
311
+ }
312
+ if (t.includes('storage') || t.includes('s3') || t.includes('r2') || t.includes('upload') || t.includes('file')) {
313
+ return textResult([
314
+ `DOS provides S3-compatible object storage (Cloudflare R2).`,
315
+ ``,
316
+ `Enable it: set "services": { "storage": true } in dailey.json.`,
317
+ `DOS injects S3_ENDPOINT, S3_BUCKET_NAME, S3_ACCESS_KEY_ID,`,
318
+ `S3_SECRET_ACCESS_KEY, S3_PREFIX, S3_REGION into your container.`,
319
+ ``,
320
+ `Your app's prefix is scoped — it can only read/write its own files.`,
321
+ `Use any S3-compatible SDK (AWS SDK v3 works perfectly).`,
322
+ ``,
323
+ `For presigned URLs (serve files without exposing credentials):`,
324
+ ` dailey_storage_presign_download / dailey_storage_presign_upload`,
325
+ ].join('\n'));
326
+ }
327
+ if (t.includes('cron') || t.includes('schedule') || t.includes('job')) {
328
+ return textResult([
329
+ `DOS cron jobs POST to an HTTP endpoint in your running app on a schedule.`,
330
+ ``,
331
+ `Add to dailey.json:`,
332
+ ` "cron": {`,
333
+ ` "cleanup": {`,
334
+ ` "schedule": "0 2 * * *",`,
335
+ ` "endpoint": "/cron/cleanup",`,
336
+ ` "headers": { "x-cron-secret": "{{CRON_SECRET}}" }`,
337
+ ` }`,
338
+ ` }`,
339
+ ``,
340
+ `In your app, add a POST route at /cron/cleanup that verifies the secret`,
341
+ `and runs the job. Keep it fast — if it needs to be long-running, queue`,
342
+ `the work and return 200 immediately.`,
343
+ ``,
344
+ `Set the secret: dailey env set <app> CRON_SECRET=$(openssl rand -hex 32)`,
345
+ ].join('\n'));
346
+ }
347
+ // Generic fallback — the LLM has full context from the prompt resource
348
+ return textResult([
349
+ `I'm DOS Buddy — ask me anything about Dailey OS.`,
350
+ ``,
351
+ `You asked about: ${topic}`,
352
+ ``,
353
+ `I have full context on deployments, databases, storage, secrets, cron,`,
354
+ `marketplace, CLI commands, and common errors. Just ask naturally and I'll`,
355
+ `walk you through it.`,
356
+ ].join('\n'));
357
+ });
358
+ }
359
+ //# sourceMappingURL=buddy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buddy.js","sourceRoot":"","sources":["../../src/tools/buddy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,gFAAgF;AAChF,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKxB,CAAC,IAAI,EAAE,CAAC;AAET,gFAAgF;AAEhF,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,4EAA4E;IAC5E,yDAAyD;IACzD,qCAAqC;IACrC,+BAA+B;IAC/B,8EAA8E;IAC9E,0DAA0D;IAC1D,MAAM,CAAC,MAAM,CACX,WAAW,EACX,iJAAiJ,EACjJ,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,gBAAgB;iBACvB;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,4EAA4E;IAC5E,yEAAyE;IACzE,0EAA0E;IAC1E,kEAAkE;IAClE,MAAM,CAAC,IAAI,CACT,cAAc,EACd,wRAAwR,EACxR;QACE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnC,sGAAsG,CACvG;KACF,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAClB,qDAAqD;QACrD,MAAM,WA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C,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACtE,OAAO,UAAU,CAAC;gBAChB,2EAA2E;gBAC3E,EAAE;gBACF,qBAAqB;gBACrB,aAAa;gBACb,kBAAkB;gBAClB,gCAAgC;gBAChC,oCAAoC;gBACpC,yDAAyD;gBACzD,OAAO;gBACP,KAAK;gBACL,EAAE;gBACF,yEAAyE;gBACzE,wEAAwE;gBACxE,sCAAsC;gBACtC,EAAE;gBACF,0EAA0E;aAC3E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChB,CAAC;QAED,uEAAuE;QACvE,OAAO,UAAU,CAAC;YAChB,kDAAkD;YAClD,EAAE;YACF,oBAAoB,KAAK,EAAE;YAC3B,EAAE;YACF,wEAAwE;YACxE,2EAA2E;YAC3E,sBAAsB;SACvB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -14,7 +14,7 @@ function maskValue(v) {
14
14
  return '•'.repeat(Math.min(v.length - 3, 12)) + tail + ` (${v.length} chars)`;
15
15
  }
16
16
  export function registerCredentialRevealTools(server) {
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.', {
17
+ server.tool('dailey_reveal_credential', 'Reveal a project credential after re-auth. Supports DB credentials (DB_PASSWORD, DB_USER, DB_HOST, DB_PORT, DB_NAME) and storage credentials (S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_SESSION_TOKEN, S3_ENDPOINT, S3_REGION, S3_BUCKET_NAME, S3_KEY_PREFIX). Every reveal is audited. BY DEFAULT returns a masked preview (last 3 chars + length) so the value never enters chat transcripts. Pass emit_plaintext=true to see the full value — only do this when you understand the chat-log exposure. Better workflow for S3 vars: use dailey_storage_enable to fix missing injection; use dailey_db_tunnel for DB creds.', {
18
18
  project_id: z.string().describe('The project ID'),
19
19
  key: z.string().describe('Credential key (e.g., DB_PASSWORD, WORDPRESS_ADMIN_PASSWORD)'),
20
20
  password: z.string().optional().describe('Account password for re-auth (falls back to DAILEY_PASSWORD env var)'),
@@ -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;;;;GAIG;AACH,SAAS,SAAS,CAAC,CAAS;IAC1B,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,SAAS,CAAC;IACxE,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,MAAM,SAAS,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B,8gBAA8gB,EAC9gB;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACjD,GAAG,EAAE,CAAC,CAAC,MAAM,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I,CAAC,uEAAuE,CAAC,CAAC;QACtF,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;YACpF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,gFAAgF,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiBpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QA2QrD"}
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiBpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QA6QrD"}
@@ -7,7 +7,7 @@ export function registerProjectTools(server) {
7
7
  return textResult(formatError(res));
8
8
  const projects = res.data.projects;
9
9
  if (!projects || projects.length === 0) {
10
- return textResult('No projects found.');
10
+ return textResult(`No projects found.\n\nNew to Dailey OS? Call dailey_buddy to get started — it can deploy the blog template (covers every DOS feature in ~30 min) or help you get your own app running.`);
11
11
  }
12
12
  // Include slug — when multiple projects share a name (common with
13
13
  // template-generated repos or duplicated test projects) the slug is
@@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BAAwB,CAAC,CAAC;IACnE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/tools/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA+DpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QA+KrD"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/tools/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA+DpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAyNrD"}
@@ -22,6 +22,12 @@ export function registerStorageTools(server) {
22
22
  `Max Upload: ${data.binding.limits.max_single_upload_mb} MB`,
23
23
  `URL TTL: ${data.binding.limits.signed_url_ttl_seconds}s`,
24
24
  ];
25
+ // Surface credential-missing warning before anything else so the LLM
26
+ // sees it immediately and can call dailey_storage_enable to fix it.
27
+ if (data.secret_warning) {
28
+ lines.push('');
29
+ lines.push(`⚠ WARNING: ${data.secret_warning}`);
30
+ }
25
31
  // Render the new integration_paths block when the API surfaces it.
26
32
  // Older customer-api responses still set next_step; fall back to that
27
33
  // verbatim so this tool keeps working during the rolling deploy.
@@ -124,6 +130,30 @@ export function registerStorageTools(server) {
124
130
  lines.push(data.upload_url);
125
131
  return textResult(lines.join('\n'));
126
132
  });
133
+ server.tool('dailey_storage_enable', 'Enable object storage on an existing project that was created without it, OR fix a project where storage was enabled but S3_* env vars are missing from the pod (secret_injected=false from dailey_storage_info). Provisions R2 credentials, creates the k8s secret, and patches the running deployment so pods pick up S3_* vars immediately. A redeploy is not required after calling this.', { project_id: z.string().describe('The project ID') }, async ({ project_id }) => {
134
+ const res = await apiRequest('POST', `/projects/${project_id}/storage/enable`);
135
+ if (!res.ok) {
136
+ // 409 means already enabled — check if the secret is actually present
137
+ if (res.status === 409) {
138
+ return textResult(`Storage is already enabled for this project.\n\nIf S3_* vars are still missing from your pod, the credentials secret may not have been created correctly.\nCheck: dailey_storage_info to see secret_injected status.\nFix: redeploy the project (dailey_deploy) to re-mount the secret.`);
139
+ }
140
+ return textResult(formatError(res));
141
+ }
142
+ return textResult([
143
+ `Storage enabled.`,
144
+ ``,
145
+ `Prefix: ${res.data.prefix}`,
146
+ ``,
147
+ res.data.message,
148
+ ``,
149
+ `S3_* env vars now available in your pod:`,
150
+ ` S3_ENDPOINT, S3_REGION, S3_BUCKET_NAME`,
151
+ ` S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_SESSION_TOKEN, S3_KEY_PREFIX`,
152
+ ``,
153
+ `No redeploy needed — the running deployment was patched directly.`,
154
+ `If vars are still missing after ~30s, call dailey_deploy to trigger a fresh rollout.`,
155
+ ].join('\n'));
156
+ });
127
157
  server.tool('dailey_storage_presign_download', 'For BROWSER-side flows. Server-side apps deployed on Dailey should instead use the S3 SDK with the auto-injected S3_* env vars (see dailey_storage_info). Creates a presigned download URL for an object in a project bucket.', {
128
158
  project_id: z.string().describe('The project ID'),
129
159
  key: z.string().describe('The object key to download'),
@@ -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;QAC5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,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACnE,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daileyos/mcp-server",
3
- "version": "1.11.4",
3
+ "version": "1.12.1",
4
4
  "description": "Dailey OS MCP server for Claude Code and AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -31,6 +31,7 @@ import { registerAnalyzeTools } from './tools/analyze.js';
31
31
  import { registerCliTools } from './tools/cli.js';
32
32
  import { registerBundleTools } from './tools/bundle.js';
33
33
  import { registerDiagnoseTools } from './tools/diagnose.js';
34
+ import { registerBuddyTools } from './tools/buddy.js';
34
35
 
35
36
  function preflight(): void {
36
37
  const isInteractive = Boolean(process.stdin.isTTY);
@@ -94,9 +95,12 @@ preflight();
94
95
 
95
96
  const server = new McpServer({
96
97
  name: 'dailey-os',
97
- version: '1.1.0',
98
+ version: '1.12.1',
98
99
  });
99
100
 
101
+ // DOS Buddy — first in list so it surfaces at the top of tool listings
102
+ registerBuddyTools(server);
103
+
100
104
  // Core + identity
101
105
  registerAuthTools(server);
102
106
  registerPlatformTools(server);
@@ -0,0 +1,386 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { apiRequest, textResult } from '../api.js';
4
+
5
+ // ─── DOS Buddy system prompt ─────────────────────────────────────────────────
6
+ // Inlined so the npm package is self-contained (no fs reads at runtime).
7
+ // Keep in sync with dos-buddy/DOS_BUDDY.md when updating.
8
+ const DOS_BUDDY_PROMPT = `
9
+ You are DOS Buddy, the personal AI assistant for Dailey OS (DOS). You are not a chatbot on a website — you live inside the user's AI coding environment. You are the user's Jiminy Cricket for getting their app running on DOS: a knowledgeable, honest, friendly guide who keeps them on the right path and tells them when something won't work the way they're thinking.
10
+
11
+ Your job is one thing: help users successfully build, deploy, and run their applications on Dailey OS. Everything else is secondary.
12
+
13
+ ## On First Contact
14
+
15
+ When a user first connects to DOS or you detect they have no apps deployed yet, introduce yourself and offer the guided path:
16
+
17
+ "Hey! I'm DOS Buddy — I can help you get your app running on Dailey OS, answer questions about the platform, or just be here when things break.
18
+
19
+ If you're new, the fastest way to learn the whole platform is by deploying a real blog app together — it covers every DOS feature end to end and takes about 30 minutes. Want to do that, or do you have your own project you want to get running?"
20
+
21
+ If they want the tutorial, guide them through it conversationally. If they have their own project, help them get it deployed. Either way, you're in the conversation from the start.
22
+
23
+ Call the dailey_buddy tool to check whether this is a new user before your first response in a session.
24
+
25
+ ## What You Know
26
+
27
+ ### The Six Things DOS Does
28
+
29
+ Every app on DOS uses some combination of these:
30
+
31
+ 1. Hosting — Your app runs from a GitHub push. DOS builds it, gives it a URL (yourapp.dailey.cloud), handles SSL, keeps it running, and redeploys on every push.
32
+
33
+ 2. Database — Managed MySQL or PostgreSQL. Credentials are auto-generated and injected into your app as DATABASE_URL. You never manage the database server.
34
+
35
+ 3. Storage — S3-compatible object storage (Cloudflare R2). Your app gets scoped credentials injected as S3_* env vars. Good for file uploads, images, videos, exports.
36
+
37
+ 4. Secrets / Vault — Encrypted environment variables. Set them with dailey env set, and DOS stores them encrypted at rest and injects them into your running app. Values are never visible in logs or build output.
38
+
39
+ 5. Cron — Scheduled tasks that POST to an endpoint in your app. You write a route, DOS calls it on a schedule. No separate workers or infrastructure.
40
+
41
+ 6. Marketplace — One-click apps (databases, monitoring, CMS tools, dev tools) that deploy into your account pre-configured.
42
+
43
+ ### The Build Pipeline
44
+
45
+ Push to GitHub → DOS detects the push → builds a container (tries Dockerfile first, then auto-detects your stack) → runs it → hits your /health endpoint → routes traffic. Build timeout is 10 minutes. First build is 60–90 seconds; incremental builds are faster.
46
+
47
+ Important: DOS does not auto-run database migrations. After a schema change, run: dailey run node scripts/migrate.js (or whatever your migration command is).
48
+
49
+ ### The CLI
50
+
51
+ npm install -g dailey
52
+ dailey login
53
+
54
+ dailey apps # list your apps
55
+ dailey create # new app, interactive
56
+ dailey deploy <app> # manual deploy trigger
57
+ dailey logs <app> # live logs
58
+ dailey logs <app> --build # build logs
59
+ dailey status <app> # health, URL, deploy info
60
+ dailey rollback <app> # back to previous version (seconds, no rebuild)
61
+
62
+ dailey env set <app> KEY=VALUE # set a secret
63
+ dailey env get <app> # list env vars (masked)
64
+ dailey env get <app> KEY # get one value
65
+ dailey env unset <app> KEY # remove a secret
66
+
67
+ dailey creds <app> # database credentials
68
+ dailey link <app> <other-app> # connect two apps internally
69
+ dailey scale <app> --replicas N # scale replicas
70
+ dailey exec <app> -- <command> # run a command in a live pod
71
+ dailey run <app> -- <command> # run a one-off job
72
+ dailey marketplace # browse one-click apps
73
+ dailey marketplace install <name> # install a marketplace app
74
+
75
+ ### Platform-Injected Environment Variables
76
+
77
+ DOS automatically injects these — the user never sets them manually:
78
+
79
+ DATABASE_URL Full connection string for the database
80
+ S3_ENDPOINT Storage endpoint
81
+ S3_BUCKET_NAME Storage bucket
82
+ S3_ACCESS_KEY_ID Storage access key
83
+ S3_SECRET_ACCESS_KEY Storage secret
84
+ S3_PREFIX App's isolated path in the bucket
85
+ S3_REGION Storage region
86
+ NODE_ENV "production" in deployed apps
87
+ PORT Port the app must listen on
88
+
89
+ ### The Blog Template
90
+
91
+ There's a ready-to-deploy blog app at github.com/jonndailey/dailey-template-blog that covers every DOS feature. Fork it and you have a starting point that's already wired up correctly. It uses Express + MySQL + R2 storage, has an admin panel, auto-runs migrations on startup, handles CSRF, rate-limits login attempts, and includes example cron endpoint handlers.
92
+
93
+ When someone asks "what should I build first" or "how do I learn DOS" — this is the answer.
94
+
95
+ To deploy it:
96
+ 1. Fork github.com/jonndailey/dailey-template-blog to the user's GitHub
97
+ 2. dailey create → point it at the fork
98
+ 3. It auto-provisions database + storage and generates secrets from dailey.json
99
+ 4. It's live in under 2 minutes
100
+
101
+ Use dailey_deploy_bundle to do this in one MCP call.
102
+
103
+ ### The dailey.json Manifest
104
+
105
+ This file in the repo tells DOS what the app needs:
106
+
107
+ {
108
+ "name": "My App",
109
+ "services": { "database": true, "storage": true },
110
+ "env": {
111
+ "MY_SECRET": { "autoGenerate": true, "length": 32 }
112
+ },
113
+ "cron": {
114
+ "cleanup": { "schedule": "0 2 * * *", "endpoint": "/cron/cleanup" }
115
+ }
116
+ }
117
+
118
+ - services.database: true → DOS provisions MySQL and injects DATABASE_URL
119
+ - services.storage: true → DOS provisions R2 and injects S3_* vars
120
+ - env.* with autoGenerate → DOS generates a secure random value on first deploy and vaults it
121
+ - cron.* → DOS creates a scheduled job that POSTs to that endpoint on schedule
122
+
123
+ ### Pricing Tiers
124
+
125
+ Free: $0/mo — 0.5 vCPU, 512 MB RAM, 500 MB DB, 1 GB storage, 1 app
126
+ Builder: $49/mo — 4 vCPU, 4 GB RAM, 5 GB DB, 10 GB storage, 10 apps, custom domains
127
+ Pro: $149/mo — 8 vCPU, 16 GB RAM, 25 GB DB, 50 GB storage, 25 apps
128
+ Scale: $349/mo — 16 vCPU, 32 GB RAM, 100 GB DB, 200 GB storage, unlimited apps
129
+
130
+ Free tier is enough to deploy the blog template and explore everything.
131
+
132
+ ## How to Help
133
+
134
+ Match the user's pace. If they ask a short question, give a short answer. If they're stuck and frustrated, go deeper. Don't dump the whole platform on someone who asked "how do I set an env var."
135
+
136
+ Be honest about limits. If something doesn't work on DOS, say so. Don't invent workarounds or pretend a feature exists. If you're not sure, say so.
137
+
138
+ Steer toward what works. If someone is about to do something that will cause them pain (like skipping migrations, setting secrets in source code, or hardcoding ports), tell them before they do it.
139
+
140
+ When someone hits an error, do this in order:
141
+ 1. Read the error message carefully — it usually says what's wrong
142
+ 2. Ask them to share dailey logs <app> output if they haven't
143
+ 3. Check if it's a known pattern (see below)
144
+ 4. Help them fix the root cause, not patch the symptom
145
+
146
+ Common issues and what they actually mean:
147
+
148
+ - ECONNREFUSED on startup → env vars probably weren't injected. Check dailey env get <app> and verify DATABASE_URL exists.
149
+ - Login succeeds but next request is 401 → session cookie issue, usually because the app isn't getting HTTPS from request headers. Make sure trust proxy is set in Express.
150
+ - ER_WRONG_ARGUMENTS on paginated MySQL queries → mysql2's execute() doesn't accept LIMIT/OFFSET as bound parameters; embed them as integer literals in the SQL string after validating they're integers.
151
+ - Build timed out → dependencies installing too slowly; make sure package-lock.json is committed.
152
+ - 520 error when running long exec commands → Cloudflare has a body size limit; write the script to /tmp/script.js first, then run node /tmp/script.js as a separate exec call.
153
+ - "Migrations not applied" on first deploy → DOS doesn't auto-run migrations; use dailey run <app> -- node scripts/migrate.js
154
+
155
+ ## What You Don't Talk About
156
+
157
+ You are the user's assistant, not a window into the platform's internals. Do not discuss or reveal:
158
+
159
+ - Internal infrastructure topology (node names, cluster layout, IP addresses)
160
+ - How the build system works internally
161
+ - Database server configuration or internal hostnames
162
+ - Ingress or proxy configuration details
163
+ - Internal service names or how platform services communicate
164
+ - Security architecture at the implementation level
165
+ - Other customers or their apps
166
+
167
+ If asked about something internal, redirect to what matters to the user: "That's handled by the platform — from your app's perspective, here's what you control..."
168
+
169
+ ## Tone
170
+
171
+ You're a senior engineer who genuinely enjoys helping people ship things. You're warm but not corporate-cheery. You celebrate wins. You're direct when something is wrong. You don't pad answers with disclaimers. You don't start every sentence with "Great question!"
172
+
173
+ When someone gets their first deploy working, act like it's a real thing that happened. It is.
174
+ `.trim();
175
+
176
+ // ─────────────────────────────────────────────────────────────────────────────
177
+
178
+ export function registerBuddyTools(server: McpServer) {
179
+ // ── MCP Prompt resource ──────────────────────────────────────────────────
180
+ // Surfaced as /mcp__dailey-os__dos-buddy in Claude Code.
181
+ // Users add this to their CLAUDE.md:
182
+ // @mcp__dailey-os__dos-buddy
183
+ // or reference it in project instructions to load DOS Buddy as system context
184
+ // automatically for every session on a Dailey OS project.
185
+ server.prompt(
186
+ 'dos-buddy',
187
+ 'Load DOS Buddy as your AI guide for Dailey OS. Add @mcp__dailey-os__dos-buddy to your CLAUDE.md to activate it automatically for every session.',
188
+ async () => ({
189
+ messages: [
190
+ {
191
+ role: 'user' as const,
192
+ content: {
193
+ type: 'text' as const,
194
+ text: DOS_BUDDY_PROMPT,
195
+ },
196
+ },
197
+ ],
198
+ }),
199
+ );
200
+
201
+ // ── dailey_buddy tool ────────────────────────────────────────────────────
202
+ // The human-callable entry point. Always call this at the start of a new
203
+ // DOS session to greet the user correctly (new vs returning). Also useful
204
+ // for explicit "ask DOS Buddy" invocations about platform topics.
205
+ server.tool(
206
+ 'dailey_buddy',
207
+ 'Your first call in any DOS session. Greets new users with an onboarding offer and returning users with a status summary. Also answers any question about Dailey OS — how to deploy, fix errors, use features, or understand the platform. Call with no topic for the session greeting.',
208
+ {
209
+ topic: z.string().optional().describe(
210
+ 'Specific topic or question about Dailey OS. Leave empty for the session greeting / onboarding check.',
211
+ ),
212
+ },
213
+ async ({ topic }) => {
214
+ // Check first-use state by looking at project count.
215
+ const projectsRes = await apiRequest<{ projects: { id: string; name: string; status?: string }[] }>(
216
+ 'GET', '/projects',
217
+ );
218
+ const projects = projectsRes.ok ? (projectsRes.data.projects ?? []) : [];
219
+ const isNewUser = projects.length === 0;
220
+
221
+ if (!topic) {
222
+ // ── Session greeting ─────────────────────────────────────────────
223
+ if (isNewUser) {
224
+ return textResult([
225
+ `Hey! I'm DOS Buddy — I'm here to help you get your app running on Dailey OS.`,
226
+ ``,
227
+ `You don't have any projects yet. A few ways to get started:`,
228
+ ``,
229
+ ` 1. Deploy the blog template (covers every DOS feature in ~30 min)`,
230
+ ` → Say "deploy the blog template for me" and I'll handle it`,
231
+ ``,
232
+ ` 2. Deploy your own GitHub repo`,
233
+ ` → Share your repo URL and I'll set it up`,
234
+ ``,
235
+ ` 3. Just explore — ask me anything about the platform`,
236
+ ``,
237
+ `What would you like to do?`,
238
+ ].join('\n'));
239
+ }
240
+
241
+ const activeCount = projects.filter(p => p.status === 'active').length;
242
+ const lines = [
243
+ `Hey! I'm DOS Buddy — your guide for Dailey OS.`,
244
+ ``,
245
+ `You have ${projects.length} project${projects.length === 1 ? '' : 's'}${activeCount > 0 ? ` (${activeCount} active)` : ''}.`,
246
+ ``,
247
+ `I can help you:`,
248
+ ` • Debug something that's broken → share the error and I'll walk through it`,
249
+ ` • Add a database, storage, cron, or custom domain to an existing app`,
250
+ ` • Deploy a new project`,
251
+ ` • Understand what any DOS tool or feature does`,
252
+ ``,
253
+ `What do you need?`,
254
+ ];
255
+ return textResult(lines.join('\n'));
256
+ }
257
+
258
+ // ── Topic-based response ─────────────────────────────────────────────
259
+ // The LLM handles knowledge questions naturally from the system prompt.
260
+ // This branch handles explicit tool invocations with a topic so the
261
+ // response is grounded in the user's current state.
262
+ const t = topic.toLowerCase();
263
+
264
+ if (t.includes('blog') || t.includes('template') || t.includes('start') || t.includes('tutorial')) {
265
+ return textResult([
266
+ `The fastest way to learn Dailey OS end-to-end is the blog template.`,
267
+ ``,
268
+ `It's a full Express + MySQL + R2 blog with admin panel, migrations, cron endpoints,`,
269
+ `and CSRF/session security — all pre-wired to work on DOS out of the box.`,
270
+ ``,
271
+ `To deploy it: call dailey_deploy_bundle with:`,
272
+ ` repo_url: https://github.com/jonndailey/dailey-template-blog`,
273
+ ` name: (whatever you'd like)`,
274
+ ` needs_database: true`,
275
+ ``,
276
+ `DOS will provision the database, generate your admin password, and have it live`,
277
+ `in under 2 minutes. After deploy, run your first migration:`,
278
+ ` dailey run <app> -- node scripts/migrate.js`,
279
+ ``,
280
+ `Then get your admin password: dailey env get <app> ADMIN_PASSWORD`,
281
+ ].join('\n'));
282
+ }
283
+
284
+ if (t.includes('database') || t.includes('db') || t.includes('mysql') || t.includes('postgres')) {
285
+ return textResult([
286
+ `DOS manages your database entirely — you never touch the server.`,
287
+ ``,
288
+ `When your app includes "services": { "database": true } in dailey.json,`,
289
+ `DOS provisions a database and injects DATABASE_URL into your container.`,
290
+ ``,
291
+ `Key things to know:`,
292
+ ` • Migrations don't run automatically — run them with:`,
293
+ ` dailey run <app> -- node scripts/migrate.js`,
294
+ ` • To inspect or query: use dailey_db_recall (read) or dailey_db_schema`,
295
+ ` • To run DDL/migrations via MCP: use dailey_db_exec`,
296
+ ` • To connect a GUI tool: dailey db connect <app> (no VPN needed)`,
297
+ ` • mysql2's execute() rejects LIMIT/OFFSET as bound params — embed`,
298
+ ` them as integer literals in the SQL string after validating they're ints`,
299
+ ].join('\n'));
300
+ }
301
+
302
+ if (t.includes('env') || t.includes('secret') || t.includes('variable')) {
303
+ return textResult([
304
+ `DOS stores env vars encrypted at rest. They're injected into your container at runtime.`,
305
+ ``,
306
+ ` Set: dailey env set <app> KEY=VALUE`,
307
+ ` List: dailey env get <app>`,
308
+ ` Get one: dailey env get <app> KEY`,
309
+ ` Remove: dailey env unset <app> KEY`,
310
+ ``,
311
+ `Changes take effect on the next deploy. Some vars are auto-injected by DOS`,
312
+ `and should not be set manually: DATABASE_URL, S3_*, NODE_ENV, PORT.`,
313
+ ``,
314
+ `To auto-generate a secret on first deploy, add it to dailey.json:`,
315
+ ` "env": { "MY_KEY": { "autoGenerate": true, "length": 32 } }`,
316
+ ].join('\n'));
317
+ }
318
+
319
+ if (t.includes('deploy') || t.includes('build') || t.includes('push')) {
320
+ return textResult([
321
+ `Deployments on DOS are triggered by GitHub pushes (automatic) or manually.`,
322
+ ``,
323
+ ` Manual deploy: dailey deploy <app> or dailey_deploy in MCP`,
324
+ ` Watch progress: dailey logs <app> --build`,
325
+ ` Check status: dailey status <app> or dailey_deploy_status in MCP`,
326
+ ` Roll back: dailey rollback <app> (seconds, no rebuild)`,
327
+ ``,
328
+ `Build timeout is 10 minutes. Make sure package-lock.json is committed`,
329
+ `(speeds up installs significantly). Dockerfile is used if present;`,
330
+ `otherwise DOS auto-detects your stack.`,
331
+ ``,
332
+ `After deploy: DOS does NOT auto-run migrations. Run them manually:`,
333
+ ` dailey run <app> -- node scripts/migrate.js`,
334
+ ].join('\n'));
335
+ }
336
+
337
+ if (t.includes('storage') || t.includes('s3') || t.includes('r2') || t.includes('upload') || t.includes('file')) {
338
+ return textResult([
339
+ `DOS provides S3-compatible object storage (Cloudflare R2).`,
340
+ ``,
341
+ `Enable it: set "services": { "storage": true } in dailey.json.`,
342
+ `DOS injects S3_ENDPOINT, S3_BUCKET_NAME, S3_ACCESS_KEY_ID,`,
343
+ `S3_SECRET_ACCESS_KEY, S3_PREFIX, S3_REGION into your container.`,
344
+ ``,
345
+ `Your app's prefix is scoped — it can only read/write its own files.`,
346
+ `Use any S3-compatible SDK (AWS SDK v3 works perfectly).`,
347
+ ``,
348
+ `For presigned URLs (serve files without exposing credentials):`,
349
+ ` dailey_storage_presign_download / dailey_storage_presign_upload`,
350
+ ].join('\n'));
351
+ }
352
+
353
+ if (t.includes('cron') || t.includes('schedule') || t.includes('job')) {
354
+ return textResult([
355
+ `DOS cron jobs POST to an HTTP endpoint in your running app on a schedule.`,
356
+ ``,
357
+ `Add to dailey.json:`,
358
+ ` "cron": {`,
359
+ ` "cleanup": {`,
360
+ ` "schedule": "0 2 * * *",`,
361
+ ` "endpoint": "/cron/cleanup",`,
362
+ ` "headers": { "x-cron-secret": "{{CRON_SECRET}}" }`,
363
+ ` }`,
364
+ ` }`,
365
+ ``,
366
+ `In your app, add a POST route at /cron/cleanup that verifies the secret`,
367
+ `and runs the job. Keep it fast — if it needs to be long-running, queue`,
368
+ `the work and return 200 immediately.`,
369
+ ``,
370
+ `Set the secret: dailey env set <app> CRON_SECRET=$(openssl rand -hex 32)`,
371
+ ].join('\n'));
372
+ }
373
+
374
+ // Generic fallback — the LLM has full context from the prompt resource
375
+ return textResult([
376
+ `I'm DOS Buddy — ask me anything about Dailey OS.`,
377
+ ``,
378
+ `You asked about: ${topic}`,
379
+ ``,
380
+ `I have full context on deployments, databases, storage, secrets, cron,`,
381
+ `marketplace, CLI commands, and common errors. Just ask naturally and I'll`,
382
+ `walk you through it.`,
383
+ ].join('\n'));
384
+ },
385
+ );
386
+ }
@@ -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 (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.',
20
+ 'Reveal a project credential after re-auth. Supports DB credentials (DB_PASSWORD, DB_USER, DB_HOST, DB_PORT, DB_NAME) and storage credentials (S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_SESSION_TOKEN, S3_ENDPOINT, S3_REGION, S3_BUCKET_NAME, S3_KEY_PREFIX). Every reveal is audited. BY DEFAULT returns a masked preview (last 3 chars + length) so the value never enters chat transcripts. Pass emit_plaintext=true to see the full value — only do this when you understand the chat-log exposure. Better workflow for S3 vars: use dailey_storage_enable to fix missing injection; use dailey_db_tunnel for DB creds.',
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)'),
@@ -26,7 +26,9 @@ export function registerProjectTools(server: McpServer) {
26
26
 
27
27
  const projects = res.data.projects;
28
28
  if (!projects || projects.length === 0) {
29
- return textResult('No projects found.');
29
+ return textResult(
30
+ `No projects found.\n\nNew to Dailey OS? Call dailey_buddy to get started — it can deploy the blog template (covers every DOS feature in ~30 min) or help you get your own app running.`,
31
+ );
30
32
  }
31
33
 
32
34
  // Include slug — when multiple projects share a name (common with
@@ -88,6 +88,13 @@ export function registerStorageTools(server: McpServer) {
88
88
  `URL TTL: ${data.binding.limits.signed_url_ttl_seconds}s`,
89
89
  ];
90
90
 
91
+ // Surface credential-missing warning before anything else so the LLM
92
+ // sees it immediately and can call dailey_storage_enable to fix it.
93
+ if ((data as any).secret_warning) {
94
+ lines.push('');
95
+ lines.push(`⚠ WARNING: ${(data as any).secret_warning}`);
96
+ }
97
+
91
98
  // Render the new integration_paths block when the API surfaces it.
92
99
  // Older customer-api responses still set next_step; fall back to that
93
100
  // verbatim so this tool keeps working during the rolling deploy.
@@ -205,6 +212,41 @@ export function registerStorageTools(server: McpServer) {
205
212
  },
206
213
  );
207
214
 
215
+ server.tool(
216
+ 'dailey_storage_enable',
217
+ 'Enable object storage on an existing project that was created without it, OR fix a project where storage was enabled but S3_* env vars are missing from the pod (secret_injected=false from dailey_storage_info). Provisions R2 credentials, creates the k8s secret, and patches the running deployment so pods pick up S3_* vars immediately. A redeploy is not required after calling this.',
218
+ { project_id: z.string().describe('The project ID') },
219
+ async ({ project_id }) => {
220
+ const res = await apiRequest<{ ok: boolean; message: string; prefix: string }>(
221
+ 'POST',
222
+ `/projects/${project_id}/storage/enable`,
223
+ );
224
+ if (!res.ok) {
225
+ // 409 means already enabled — check if the secret is actually present
226
+ if (res.status === 409) {
227
+ return textResult(
228
+ `Storage is already enabled for this project.\n\nIf S3_* vars are still missing from your pod, the credentials secret may not have been created correctly.\nCheck: dailey_storage_info to see secret_injected status.\nFix: redeploy the project (dailey_deploy) to re-mount the secret.`,
229
+ );
230
+ }
231
+ return textResult(formatError(res));
232
+ }
233
+ return textResult([
234
+ `Storage enabled.`,
235
+ ``,
236
+ `Prefix: ${res.data.prefix}`,
237
+ ``,
238
+ res.data.message,
239
+ ``,
240
+ `S3_* env vars now available in your pod:`,
241
+ ` S3_ENDPOINT, S3_REGION, S3_BUCKET_NAME`,
242
+ ` S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_SESSION_TOKEN, S3_KEY_PREFIX`,
243
+ ``,
244
+ `No redeploy needed — the running deployment was patched directly.`,
245
+ `If vars are still missing after ~30s, call dailey_deploy to trigger a fresh rollout.`,
246
+ ].join('\n'));
247
+ },
248
+ );
249
+
208
250
  server.tool(
209
251
  'dailey_storage_presign_download',
210
252
  'For BROWSER-side flows. Server-side apps deployed on Dailey should instead use the S3 SDK with the auto-injected S3_* env vars (see dailey_storage_info). Creates a presigned download URL for an object in a project bucket.',