@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.
Files changed (48) hide show
  1. package/.github/workflows/publish.yml +22 -2
  2. package/README.md +12 -3
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +31 -1
  5. package/dist/api.js.map +1 -1
  6. package/dist/index.js +3 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/tools/buddy.d.ts.map +1 -1
  9. package/dist/tools/buddy.js +146 -50
  10. package/dist/tools/buddy.js.map +1 -1
  11. package/dist/tools/credentials-reveal.js +1 -1
  12. package/dist/tools/credentials-reveal.js.map +1 -1
  13. package/dist/tools/db.js +1 -1
  14. package/dist/tools/db.js.map +1 -1
  15. package/dist/tools/deploy-status.d.ts.map +1 -1
  16. package/dist/tools/deploy-status.js +0 -70
  17. package/dist/tools/deploy-status.js.map +1 -1
  18. package/dist/tools/diagnose.d.ts.map +1 -1
  19. package/dist/tools/diagnose.js +0 -152
  20. package/dist/tools/diagnose.js.map +1 -1
  21. package/dist/tools/exec-run.js +1 -1
  22. package/dist/tools/exec-run.js.map +1 -1
  23. package/dist/tools/platform.d.ts.map +1 -1
  24. package/dist/tools/platform.js +0 -82
  25. package/dist/tools/platform.js.map +1 -1
  26. package/dist/tools/projects.d.ts.map +1 -1
  27. package/dist/tools/projects.js +1 -1
  28. package/dist/tools/projects.js.map +1 -1
  29. package/dist/tools/storage.d.ts.map +1 -1
  30. package/dist/tools/storage.js +0 -30
  31. package/dist/tools/storage.js.map +1 -1
  32. package/dist/tools/support.d.ts +3 -0
  33. package/dist/tools/support.d.ts.map +1 -0
  34. package/dist/tools/support.js +34 -0
  35. package/dist/tools/support.js.map +1 -0
  36. package/package.json +1 -1
  37. package/src/api.ts +30 -1
  38. package/src/index.ts +4 -0
  39. package/src/tools/buddy.ts +146 -50
  40. package/src/tools/credentials-reveal.ts +1 -1
  41. package/src/tools/db.ts +1 -1
  42. package/src/tools/deploy-status.ts +0 -71
  43. package/src/tools/diagnose.ts +0 -183
  44. package/src/tools/exec-run.ts +1 -1
  45. package/src/tools/platform.ts +0 -88
  46. package/src/tools/projects.ts +1 -3
  47. package/src/tools/storage.ts +0 -42
  48. package/src/tools/support.ts +42 -0
@@ -32,144 +32,6 @@ interface ProjectListEntry {
32
32
 
33
33
  const ERROR_LINE_PATTERN = /(error|fatal|panic|exception|uncaught|unhandled)/i;
34
34
 
35
- interface KnownIssue {
36
- id: string;
37
- name: string;
38
- plain_english: string;
39
- fix: string;
40
- severity: 'fail' | 'warn';
41
- }
42
-
43
- interface PatternRule {
44
- pattern: RegExp;
45
- issue: KnownIssue;
46
- }
47
-
48
- const KNOWN_PATTERNS: PatternRule[] = [
49
- {
50
- pattern: /P3009|migrate found failed migrations|applied migration.*is not recorded/i,
51
- issue: {
52
- id: 'prisma_failed_migration',
53
- name: 'Prisma: failed migration in history',
54
- plain_english:
55
- 'Your database has a migration that started but never finished — usually because the app crashed mid-deploy or you restored a dump on top of an existing schema. Prisma refuses to start until it is resolved.',
56
- fix: 'Run: dailey db exec <project> "UPDATE _prisma_migrations SET finished_at = started_at, logs = NULL WHERE finished_at IS NULL AND rolled_back_at IS NULL;" --confirm\nThen redeploy: dailey deploy <project>',
57
- severity: 'fail',
58
- },
59
- },
60
- {
61
- pattern: /PrismaClientInitializationError|prisma\.generate|@prisma\/client did not initialize/i,
62
- issue: {
63
- id: 'prisma_client_not_generated',
64
- name: 'Prisma: client not generated',
65
- plain_english:
66
- 'The Prisma client was not generated during the build step. Your Dockerfile or build command is missing "prisma generate" before "node" starts.',
67
- fix: 'Add "npx prisma generate" to your build step. In package.json: "build": "prisma generate && tsc" (or whatever your build command is). Then redeploy: dailey deploy <project>',
68
- severity: 'fail',
69
- },
70
- },
71
- {
72
- pattern: /exit code 137|OOMKilled|out of memory kill|memory limit exceeded/i,
73
- issue: {
74
- id: 'oom_killed',
75
- name: 'Pod killed: out of memory (OOM)',
76
- plain_english:
77
- 'Your app used more memory than its limit and the platform killed it. The default limit is 512 MB per replica.',
78
- fix: 'Check memory usage: dailey usage <project>\nIncrease the limit: dailey resource-config <project> --memory-limit 1024\nOr reduce memory use (Node.js tip: set NODE_OPTIONS="--max-old-space-size=900" in your env vars).',
79
- severity: 'fail',
80
- },
81
- },
82
- {
83
- pattern: /FATAL ERROR:.*JavaScript heap out of memory|heap out of memory/i,
84
- issue: {
85
- id: 'node_heap_oom',
86
- name: 'Node.js heap out of memory',
87
- plain_english:
88
- "Your Node.js process ran out of heap space. It didn't hit the container memory limit — the V8 heap limit (default ~512 MB) was hit first.",
89
- fix: 'Set NODE_OPTIONS env var: dailey env set <project> NODE_OPTIONS "--max-old-space-size=1024"\nThen redeploy: dailey deploy <project>',
90
- severity: 'fail',
91
- },
92
- },
93
- {
94
- pattern: /ECONNREFUSED.*(?:3306|5432|27017)|connect ECONNREFUSED.*database|database connection refused/i,
95
- issue: {
96
- id: 'db_connection_refused',
97
- name: 'Database connection refused',
98
- plain_english:
99
- 'Your app tried to connect to the database but got "connection refused." Either the database is not provisioned, or the connection URL is wrong.',
100
- fix: 'Check if a database is provisioned: dailey db info <project>\nIf not provisioned: dailey db provision <project> --type mysql (or postgres)\nIf provisioned, verify DATABASE_URL is correct: dailey env list <project>',
101
- severity: 'fail',
102
- },
103
- },
104
- {
105
- pattern: /EADDRINUSE|address already in use|port.*already in use/i,
106
- issue: {
107
- id: 'port_in_use',
108
- name: 'Port already in use',
109
- plain_english:
110
- "Your app tried to listen on a port that's already occupied. On Dailey OS you must listen on the PORT env var (always 3000) — never hardcode a port number.",
111
- fix: 'Update your app to bind to process.env.PORT (not a hardcoded number). Example: app.listen(process.env.PORT || 3000)\nThen redeploy: dailey deploy <project>',
112
- severity: 'fail',
113
- },
114
- },
115
- {
116
- pattern: /Cannot find module|MODULE_NOT_FOUND|Error: Cannot find|module not found/i,
117
- issue: {
118
- id: 'module_not_found',
119
- name: 'Module not found',
120
- plain_english:
121
- 'A package your app depends on is missing from the build. This usually means a dependency was not installed during the build, or was accidentally added to devDependencies instead of dependencies.',
122
- fix: 'Check your package.json: make sure the missing package is in "dependencies" (not "devDependencies").\nThen redeploy: dailey deploy <project>\nIf the build is failing: dailey build-logs <project>',
123
- severity: 'fail',
124
- },
125
- },
126
- {
127
- pattern:
128
- /TypeError: Cannot read propert(?:y|ies) of undefined|TypeError: Cannot read propert(?:y|ies) of null|ReferenceError: process is not defined/i,
129
- issue: {
130
- id: 'missing_env_var',
131
- name: 'Missing environment variable (likely)',
132
- plain_english:
133
- 'Your app crashed trying to read a value that was undefined or null. This is often a missing environment variable — your code references process.env.SOMETHING that was never set.',
134
- fix: 'Check which env vars are set: dailey env list <project>\nSet a missing var: dailey env set <project> MY_VAR "my value"\nThen redeploy: dailey deploy <project>',
135
- severity: 'warn',
136
- },
137
- },
138
- {
139
- pattern: /secretOrPrivateKey must have a value|jwt.*secret.*undefined|invalid signature/i,
140
- issue: {
141
- id: 'missing_jwt_secret',
142
- name: 'Missing JWT secret',
143
- plain_english:
144
- 'Your app uses JWT (JSON Web Tokens) but the secret key env var is not set. Sessions and auth will fail.',
145
- fix: 'Set your JWT secret: dailey env set <project> JWT_SECRET "$(openssl rand -hex 32)"\nThen redeploy: dailey deploy <project>',
146
- severity: 'fail',
147
- },
148
- },
149
- {
150
- pattern: /SSL SYSCALL error|SSL connection has been closed|EPROTO.*SSL|certificate verify failed/i,
151
- issue: {
152
- id: 'ssl_db_error',
153
- name: 'Database SSL error',
154
- plain_english:
155
- 'Your app failed to establish a secure connection to the database. This usually means the SSL mode in your connection string does not match what the server requires.',
156
- fix: 'If using PostgreSQL, add ?sslmode=require to DATABASE_URL.\nIf using MySQL, add ?ssl=true.\nCheck current DATABASE_URL: dailey env list <project>',
157
- severity: 'fail',
158
- },
159
- },
160
- {
161
- pattern: /SIGTERM|graceful shutdown|terminating connection|Gracefully stopping/i,
162
- issue: {
163
- id: 'sigterm_restart',
164
- name: 'Pod restarting (SIGTERM)',
165
- plain_english:
166
- 'Your app is being stopped and restarted by the platform. This is normal during deploys, but if it is happening repeatedly it means the app is not starting up properly after being stopped.',
167
- fix: 'Check pod restart count and crash reasons: dailey processes <project>\nCheck if the latest deploy succeeded: dailey deploy-status <project>',
168
- severity: 'warn',
169
- },
170
- },
171
- ];
172
-
173
35
  async function resolveProjectId(
174
36
  projectOrSlug: string,
175
37
  ): Promise<{ id: string | null; matched_by: 'id' | 'slug' | 'name' | 'none'; hint?: string }> {
@@ -413,46 +275,6 @@ async function checkRecentErrors(projectId: string): Promise<Lane> {
413
275
  };
414
276
  }
415
277
 
416
- async function checkKnownPatterns(projectId: string): Promise<Lane> {
417
- const res = await apiRequest<{ logs?: string[] }>('GET', `/projects/${projectId}/logs?tail=100`);
418
- if (!res.ok) {
419
- return { name: 'known_issues', status: 'skip', summary: 'No logs available to scan for known issues.' };
420
- }
421
- const lines = res.data.logs || [];
422
- const logText = lines.join('\n');
423
-
424
- const matched: KnownIssue[] = [];
425
- const seen = new Set<string>();
426
- for (const rule of KNOWN_PATTERNS) {
427
- if (rule.pattern.test(logText) && !seen.has(rule.issue.id)) {
428
- seen.add(rule.issue.id);
429
- matched.push(rule.issue);
430
- }
431
- }
432
-
433
- if (matched.length === 0) {
434
- return { name: 'known_issues', status: 'ok', summary: 'No known crash patterns detected in last 100 log lines.' };
435
- }
436
-
437
- const hasFail = matched.some((i) => i.severity === 'fail');
438
- const laneStatus: LaneStatus = hasFail ? 'fail' : 'warn';
439
- const names = matched.map((i) => i.name).join('; ');
440
-
441
- return {
442
- name: 'known_issues',
443
- status: laneStatus,
444
- summary: `${matched.length} known issue(s) detected: ${names}`,
445
- detail: {
446
- issues: matched.map((i) => ({
447
- id: i.id,
448
- name: i.name,
449
- plain_english: i.plain_english,
450
- fix: i.fix,
451
- })),
452
- },
453
- };
454
- }
455
-
456
278
  function aggregateVerdict(lanes: Lane[]): { verdict: 'healthy' | 'degraded' | 'broken'; summary: string } {
457
279
  const hasFail = lanes.some((l) => l.status === 'fail');
458
280
  const hasWarn = lanes.some((l) => l.status === 'warn');
@@ -540,11 +362,6 @@ export function registerDiagnoseTools(server: McpServer) {
540
362
  status: 'fail' as LaneStatus,
541
363
  summary: `lane crashed: ${err.message}`,
542
364
  })),
543
- checkKnownPatterns(projectId).catch((err) => ({
544
- name: 'known_issues',
545
- status: 'fail' as LaneStatus,
546
- summary: `lane crashed: ${err.message}`,
547
- })),
548
365
  ]);
549
366
 
550
367
  const { verdict, summary } = aggregateVerdict(lanes);
@@ -5,7 +5,7 @@ import { apiRequest, textResult, formatError } from '../api.js';
5
5
  export function registerExecRunTools(server: McpServer) {
6
6
  server.tool(
7
7
  'dailey_exec',
8
- 'Run a one-off command inside a running pod for a project (similar to `kubectl exec`). Useful for troubleshooting — inspect files, run `node --version`, `cat /etc/env`, etc. The command is an argv array (not a shell string). Captures up to 1 MB of stdout/stderr and times out at 60s by default (configurable to 300s max). Needs at least one Ready pod. For one-off jobs that run to completion in their own pod (migrations, seeders, backfills) use dailey_run instead — exec attaches to a live pod, run spawns a new Job.',
8
+ 'Run a one-off command inside a running pod for a project (similar to `kubectl exec`). Useful for troubleshooting — inspect files, run `node --version`, check directory contents, etc. The command is an argv array (not a shell string). Captures up to 1 MB of stdout/stderr and times out at 60s by default (configurable to 300s max). Needs at least one Ready pod. For one-off jobs that run to completion in their own pod (migrations, seeders, backfills) use dailey_run instead — exec attaches to a live pod, run spawns a new Job. Avoid running commands that print env vars or secrets (env, printenv) — use dailey_env_vars to inspect config instead.',
9
9
  {
10
10
  project_id: z.string().describe('The project ID'),
11
11
  command: z.array(z.string()).describe('Command as argv array, e.g. ["node","--version"] or ["ls","-la","/app"]. Not a shell string.'),
@@ -83,92 +83,4 @@ export function registerPlatformTools(server: McpServer) {
83
83
  return textResult(lines.join('\n'));
84
84
  },
85
85
  );
86
-
87
- server.tool(
88
- 'dailey_os_guide',
89
- 'Return a guide on how Dailey OS works and the right approach for common tasks. Call this when you need context on platform architecture, database access patterns, deployment flow, or when a user asks how to do something in DOS and you are unsure of the right path.',
90
- {},
91
- async () => {
92
- return textResult(`
93
- Dailey OS — Platform Guide for AI Assistants
94
- ═════════════════════════════════════════════
95
-
96
- ## Architecture overview
97
-
98
- Dailey OS is a managed app platform (like Heroku/Render) running on a private Kubernetes cluster.
99
- Each customer has a namespace (customer-<slug>). Projects map to K8s Deployments.
100
- Databases (MySQL or PostgreSQL) run on dedicated nodes, reachable only via Tailscale CGNAT IPs (100.x.x.x).
101
-
102
- ## Database access — choose the right path
103
-
104
- ### Reading data (no write access needed)
105
- → Use dailey_db_recall — runs a SELECT through the API, no Tailscale, no shell.
106
-
107
- ### Schema inspection
108
- → Use dailey_db_schema — returns all tables, columns, row counts.
109
-
110
- ### Applying a migration (DDL/DML)
111
- → Use dailey_db_exec — runs SQL in a transaction under a scoped user. Works for CREATE TABLE, ALTER, INSERT, UPDATE, etc.
112
-
113
- ### Importing a full database dump (pg_dump .sql or .pgdump, mysqldump .sql)
114
- → Tell the user to run: dailey db connect <project>
115
- This opens a LOCAL port on 127.0.0.1 via WebSocket proxy (NO Tailscale required on their machine).
116
- Then in a second terminal:
117
- PostgreSQL SQL file: PGPASSWORD='...' psql -h 127.0.0.1 -p 15432 -U <user> -d <db> < dump.sql
118
- PostgreSQL custom: pg_restore -h 127.0.0.1 -p 15432 -U <user> -d <db> dump.pgdump
119
- MySQL: mysql -h 127.0.0.1 -P 13306 -u <user> -p<pass> <db> < dump.sql
120
- The CLI prints ready-to-paste commands when the tunnel opens.
121
- Session lasts 1 hour.
122
-
123
- ### Connecting a GUI tool (TablePlus, DBeaver, pgAdmin)
124
- → Same path: dailey db connect <project> — no Tailscale needed.
125
- The CLI prints the local connection string. Point any GUI at 127.0.0.1 on the printed port.
126
-
127
- ### Bulk row insert/upsert (structured data, not a full dump)
128
- → Use dailey_db_import — accepts JSON array or CSV inline, two-phase commit (dry_run then confirm).
129
-
130
- ## Deployment flow
131
-
132
- 1. Customer pushes code to GitHub
133
- 2. Dailey detects the push via webhook → triggers a build
134
- 3. Build runs on a build-worker node (Docker/buildpack)
135
- 4. Image is pushed to registry.dailey.cloud/dailey/<slug>:<tag>
136
- 5. deploy-service rolls out new image to the K8s Deployment
137
- 6. Canary probe runs (HTTP health check) — rollback on failure
138
-
139
- To redeploy manually: use dailey_deploy.
140
- To check build status: use dailey_deploy_status or dailey_build_logs.
141
-
142
- ## Environment variables
143
-
144
- - Set via dailey_env_set (single) or dailey_env_set_many (bulk)
145
- - Changes take effect on next deploy (not live-patched)
146
- - Never auto-generate or overwrite variables that look customer-set
147
- - Sensitive vars (API keys, passwords) are encrypted at rest
148
-
149
- ## Storage (object storage)
150
-
151
- - Each project has an R2 bucket prefix scoped to its project ID
152
- - Credentials are auto-injected as S3_* env vars (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL, AWS_REGION, S3_BUCKET)
153
- - Use any S3-compatible SDK — no Dailey-specific client needed
154
- - For presigned URLs: use dailey_storage_presign_upload / dailey_storage_presign_download
155
-
156
- ## Common mistakes to avoid
157
-
158
- - DO NOT suggest using third-party file hosts (transfer.sh, S3 public links) for database dumps — use dailey db connect instead
159
- - DO NOT assume the customer needs Tailscale to connect a GUI tool or run psql — the CLI WebSocket proxy handles it
160
- - DO NOT suggest mysqldump/pg_dump --host with the CGNAT IP (100.x.x.x) directly — that requires Tailscale
161
- - DO NOT run dailey_db_import for full schema dumps — it's for structured row data only, not DDL
162
- - DO NOT suggest redeploying to apply env var changes without confirming the user wants a redeploy
163
-
164
- ## Useful diagnostic sequence
165
-
166
- User reports app is down / crashing:
167
- 1. dailey_deploy_status — check last deploy result
168
- 2. dailey_build_logs — check if latest build succeeded
169
- 3. dailey_diagnose — AI-powered diagnosis of pod/build state
170
- 4. dailey_processes — see running containers and recent restart counts
171
- `.trim());
172
- },
173
- );
174
86
  }
@@ -26,9 +26,7 @@ export function registerProjectTools(server: McpServer) {
26
26
 
27
27
  const projects = res.data.projects;
28
28
  if (!projects || projects.length === 0) {
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
- );
29
+ return textResult('No projects found.');
32
30
  }
33
31
 
34
32
  // Include slug — when multiple projects share a name (common with
@@ -88,13 +88,6 @@ 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
-
98
91
  // Render the new integration_paths block when the API surfaces it.
99
92
  // Older customer-api responses still set next_step; fall back to that
100
93
  // verbatim so this tool keeps working during the rolling deploy.
@@ -212,41 +205,6 @@ export function registerStorageTools(server: McpServer) {
212
205
  },
213
206
  );
214
207
 
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
- `Pods are restarting to pick up the new secret (~30s). No rebuild needed.`,
245
- `If vars are still missing after 60s, call dailey_deploy to trigger a fresh rollout.`,
246
- ].join('\n'));
247
- },
248
- );
249
-
250
208
  server.tool(
251
209
  'dailey_storage_presign_download',
252
210
  '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.',
@@ -0,0 +1,42 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { apiRequest, textResult, formatError } from '../api.js';
4
+
5
+ export function registerSupportTools(server: McpServer) {
6
+ server.tool(
7
+ 'dailey_support',
8
+ '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.',
9
+ {
10
+ project_id: z.string().describe('The project ID'),
11
+ 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.'),
12
+ error_text: z.string().optional().describe('Full error text, stack trace, or log excerpt relevant to the issue'),
13
+ steps_tried: z.string().optional().describe('What troubleshooting steps have already been attempted'),
14
+ 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'),
15
+ },
16
+ async ({ project_id, description, error_text, steps_tried, severity }) => {
17
+ const body: Record<string, unknown> = { description };
18
+ if (error_text) body.error_text = error_text;
19
+ if (steps_tried) body.steps_tried = steps_tried;
20
+ if (severity) body.severity = severity;
21
+
22
+ const res = await apiRequest<{ ok: boolean; message: string }>(
23
+ 'POST',
24
+ `/projects/${project_id}/support`,
25
+ body,
26
+ );
27
+ if (!res.ok) return textResult(formatError(res));
28
+
29
+ return textResult([
30
+ `✓ ${res.data.message}`,
31
+ '',
32
+ 'The report includes:',
33
+ ' • Your description and any error text provided',
34
+ ' • Last 3 build logs (truncated)',
35
+ ' • Recent pod logs',
36
+ ' • Env var keys (no values)',
37
+ '',
38
+ 'You can expect a response at the email on your account.',
39
+ ].join('\n'));
40
+ },
41
+ );
42
+ }