@daileyos/mcp-server 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +93 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/tools/analyze.d.ts +3 -0
- package/dist/tools/analyze.d.ts.map +1 -0
- package/dist/tools/analyze.js +67 -0
- package/dist/tools/analyze.js.map +1 -0
- package/dist/tools/backups.d.ts +3 -0
- package/dist/tools/backups.d.ts.map +1 -0
- package/dist/tools/backups.js +55 -0
- package/dist/tools/backups.js.map +1 -0
- package/dist/tools/build-logs.d.ts +3 -0
- package/dist/tools/build-logs.d.ts.map +1 -0
- package/dist/tools/build-logs.js +39 -0
- package/dist/tools/build-logs.js.map +1 -0
- package/dist/tools/credentials-reveal.d.ts +3 -0
- package/dist/tools/credentials-reveal.d.ts.map +1 -0
- package/dist/tools/credentials-reveal.js +19 -0
- package/dist/tools/credentials-reveal.js.map +1 -0
- package/dist/tools/db.d.ts.map +1 -1
- package/dist/tools/db.js +92 -0
- package/dist/tools/db.js.map +1 -1
- package/dist/tools/deploy-status.d.ts +3 -0
- package/dist/tools/deploy-status.d.ts.map +1 -0
- package/dist/tools/deploy-status.js +109 -0
- package/dist/tools/deploy-status.js.map +1 -0
- package/dist/tools/domains.d.ts.map +1 -1
- package/dist/tools/domains.js +81 -17
- package/dist/tools/domains.js.map +1 -1
- package/dist/tools/images.d.ts.map +1 -1
- package/dist/tools/images.js +5 -2
- package/dist/tools/images.js.map +1 -1
- package/dist/tools/lifecycle.d.ts +3 -0
- package/dist/tools/lifecycle.d.ts.map +1 -0
- package/dist/tools/lifecycle.js +53 -0
- package/dist/tools/lifecycle.js.map +1 -0
- package/dist/tools/links.d.ts +3 -0
- package/dist/tools/links.d.ts.map +1 -0
- package/dist/tools/links.js +55 -0
- package/dist/tools/links.js.map +1 -0
- package/dist/tools/processes.d.ts +3 -0
- package/dist/tools/processes.d.ts.map +1 -0
- package/dist/tools/processes.js +98 -0
- package/dist/tools/processes.js.map +1 -0
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +13 -0
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/resource-config.d.ts +3 -0
- package/dist/tools/resource-config.d.ts.map +1 -0
- package/dist/tools/resource-config.js +56 -0
- package/dist/tools/resource-config.js.map +1 -0
- package/dist/tools/scale.d.ts.map +1 -1
- package/dist/tools/scale.js +9 -2
- package/dist/tools/scale.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +32 -7
- package/src/tools/analyze.ts +98 -0
- package/src/tools/backups.ts +84 -0
- package/src/tools/build-logs.ts +65 -0
- package/src/tools/credentials-reveal.ts +31 -0
- package/src/tools/db.ts +104 -0
- package/src/tools/deploy-status.ts +149 -0
- package/src/tools/domains.ts +116 -21
- package/src/tools/images.ts +5 -2
- package/src/tools/lifecycle.ts +75 -0
- package/src/tools/links.ts +69 -0
- package/src/tools/processes.ts +172 -0
- package/src/tools/projects.ts +14 -0
- package/src/tools/resource-config.ts +84 -0
- package/src/tools/scale.ts +17 -3
- package/tests/mcp-protocol-smoke.mjs +149 -0
- package/tests/new-tools-smoke.mjs +211 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processes.d.ts","sourceRoot":"","sources":["../../src/tools/processes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAuCpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAoIrD"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { apiRequest, formatError, textResult } from '../api.js';
|
|
3
|
+
export function registerProcessTools(server) {
|
|
4
|
+
server.tool('dailey_processes', 'List processes defined in a project (from dailey.yaml). Shows web/worker/release processes with resource limits and status.', { project_id: z.string().describe('The project ID') }, async ({ project_id }) => {
|
|
5
|
+
const res = await apiRequest('GET', `/projects/${project_id}/processes`);
|
|
6
|
+
if (!res.ok)
|
|
7
|
+
return textResult(formatError(res));
|
|
8
|
+
const procs = res.data.processes || [];
|
|
9
|
+
if (procs.length === 0) {
|
|
10
|
+
return textResult('No processes defined. This project runs as a single process.');
|
|
11
|
+
}
|
|
12
|
+
const lines = [
|
|
13
|
+
`Processes (${procs.length})`,
|
|
14
|
+
`${'Name'.padEnd(20)} ${'Type'.padEnd(10)} ${'Replicas'.padEnd(9)} ${'CPU'.padEnd(8)} ${'Memory'.padEnd(10)} Status`,
|
|
15
|
+
'─'.repeat(80),
|
|
16
|
+
];
|
|
17
|
+
for (const p of procs) {
|
|
18
|
+
lines.push(`${(p.name || '').padEnd(20)} ${(p.type || '-').padEnd(10)} ${String(p.replicas ?? '-').padEnd(9)} ${String(p.cpu_millicores ?? '-').padEnd(8)} ${String(p.memory_mb ?? '-').padEnd(10)} ${p.status || '-'}`);
|
|
19
|
+
if (p.command)
|
|
20
|
+
lines.push(` cmd: ${p.command}`);
|
|
21
|
+
}
|
|
22
|
+
return textResult(lines.join('\n'));
|
|
23
|
+
});
|
|
24
|
+
server.tool('dailey_process_logs', 'Fetch logs for a specific process in a multi-process project.', {
|
|
25
|
+
project_id: z.string().describe('The project ID'),
|
|
26
|
+
process_name: z.string().describe('The process name (from dailey_processes)'),
|
|
27
|
+
tail: z.number().int().min(1).max(2000).optional().describe('Number of log lines to fetch (default: 100)'),
|
|
28
|
+
}, async ({ project_id, process_name, tail }) => {
|
|
29
|
+
const query = tail ? `?tail=${tail}` : '?tail=100';
|
|
30
|
+
const res = await apiRequest('GET', `/projects/${project_id}/processes/${encodeURIComponent(process_name)}/logs${query}`);
|
|
31
|
+
if (!res.ok)
|
|
32
|
+
return textResult(formatError(res));
|
|
33
|
+
const logs = res.data.logs || [];
|
|
34
|
+
if (logs.length === 0)
|
|
35
|
+
return textResult(`No logs for process ${process_name}.`);
|
|
36
|
+
return textResult([`Logs for ${process_name} (last ${tail || 100} lines):`, '', ...logs].join('\n'));
|
|
37
|
+
});
|
|
38
|
+
server.tool('dailey_process_restart', 'Restart a single process (rolling restart). Only affects the named process — other processes keep running.', {
|
|
39
|
+
project_id: z.string().describe('The project ID'),
|
|
40
|
+
process_name: z.string().describe('The process name to restart'),
|
|
41
|
+
}, async ({ project_id, process_name }) => {
|
|
42
|
+
const res = await apiRequest('POST', `/projects/${project_id}/processes/${encodeURIComponent(process_name)}/restart`);
|
|
43
|
+
if (!res.ok)
|
|
44
|
+
return textResult(formatError(res));
|
|
45
|
+
return textResult(`Restart initiated for process ${process_name}. Pods will roll one-by-one.`);
|
|
46
|
+
});
|
|
47
|
+
server.tool('dailey_process_metrics', 'Get live resource usage and pod health for a process: pods ready, restarts, CPU/memory limits.', {
|
|
48
|
+
project_id: z.string().describe('The project ID'),
|
|
49
|
+
process_name: z.string().describe('The process name'),
|
|
50
|
+
}, async ({ project_id, process_name }) => {
|
|
51
|
+
const res = await apiRequest('GET', `/projects/${project_id}/processes/${encodeURIComponent(process_name)}/metrics`);
|
|
52
|
+
if (!res.ok)
|
|
53
|
+
return textResult(formatError(res));
|
|
54
|
+
const usage = res.data.usage || {};
|
|
55
|
+
const resources = res.data.resources || {};
|
|
56
|
+
const pods = res.data.pods || [];
|
|
57
|
+
const lines = [
|
|
58
|
+
`Process: ${process_name}`,
|
|
59
|
+
'─'.repeat(40),
|
|
60
|
+
`Pods ready: ${usage.pods_ready ?? 0} / ${usage.pods_total ?? 0}`,
|
|
61
|
+
`Restarts: ${usage.restarts ?? 0}`,
|
|
62
|
+
`CPU limit: ${resources.cpu_limit_millicores ?? '-'}m`,
|
|
63
|
+
`Mem limit: ${resources.memory_limit_mb ?? '-'} MB`,
|
|
64
|
+
`Replicas: ${resources.replicas ?? '-'}`,
|
|
65
|
+
];
|
|
66
|
+
if (pods.length > 0) {
|
|
67
|
+
lines.push('');
|
|
68
|
+
lines.push('Pods:');
|
|
69
|
+
for (const pod of pods)
|
|
70
|
+
lines.push(` ${pod.name} on ${pod.node}`);
|
|
71
|
+
}
|
|
72
|
+
return textResult(lines.join('\n'));
|
|
73
|
+
});
|
|
74
|
+
server.tool('dailey_process_resources', 'Update replicas, CPU, or memory limits for a specific process. Omit fields you do not want to change.', {
|
|
75
|
+
project_id: z.string().describe('The project ID'),
|
|
76
|
+
process_name: z.string().describe('The process name'),
|
|
77
|
+
replicas: z.number().int().min(0).max(20).optional().describe('Replicas (0-20)'),
|
|
78
|
+
cpu_millicores: z.number().int().min(10).max(8000).optional().describe('CPU limit in millicores (10-8000)'),
|
|
79
|
+
memory_mb: z.number().int().min(64).max(32768).optional().describe('Memory limit in MB (64-32768)'),
|
|
80
|
+
}, async ({ project_id, process_name, replicas, cpu_millicores, memory_mb }) => {
|
|
81
|
+
const body = {};
|
|
82
|
+
if (replicas !== undefined)
|
|
83
|
+
body.replicas = replicas;
|
|
84
|
+
if (cpu_millicores !== undefined)
|
|
85
|
+
body.cpu_millicores = cpu_millicores;
|
|
86
|
+
if (memory_mb !== undefined)
|
|
87
|
+
body.memory_mb = memory_mb;
|
|
88
|
+
if (Object.keys(body).length === 0) {
|
|
89
|
+
return textResult('Error: specify at least one of replicas, cpu_millicores, or memory_mb.');
|
|
90
|
+
}
|
|
91
|
+
const res = await apiRequest('POST', `/projects/${project_id}/processes/${encodeURIComponent(process_name)}/resources`, body);
|
|
92
|
+
if (!res.ok)
|
|
93
|
+
return textResult(formatError(res));
|
|
94
|
+
const changed = Object.entries(body).map(([k, v]) => `${k}=${v}`).join(', ');
|
|
95
|
+
return textResult(`Updated process ${process_name}: ${changed}`);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=processes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processes.js","sourceRoot":"","sources":["../../src/tools/processes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAA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AAM,UAAU,CAC1B,MAAM,EACN,aAAa,UAAU,cAAc,kBAAkB,CAAC,YAAY,CAAC,YAAY,EACjF,IAAI,CACL,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7E,OAAO,UAAU,CAAC,mBAAmB,YAAY,KAAK,OAAO,EAAE,CAAC,CAAC;IACnE,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;AAgBpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgBpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAwMrD"}
|
package/dist/tools/projects.js
CHANGED
|
@@ -94,17 +94,30 @@ export function registerProjectTools(server) {
|
|
|
94
94
|
}
|
|
95
95
|
services = manifest.entries.filter((e) => e.type === 'managed' || e.type === 'app_service');
|
|
96
96
|
}
|
|
97
|
+
// Safety: ensure at least one service is marked 'app_service' so the
|
|
98
|
+
// deployer knows which one gets the public ingress. Without this, all
|
|
99
|
+
// services deploy as "internal only" and the project is unreachable
|
|
100
|
+
// with no warning. (Scott hit this on 2026-04-20.)
|
|
101
|
+
const hasAppService = services?.some((s) => s.type === 'app_service');
|
|
102
|
+
if (services?.length && !hasAppService) {
|
|
103
|
+
services[0].type = 'app_service';
|
|
104
|
+
}
|
|
97
105
|
const res = await apiRequest('POST', `/projects/${project_id}/deploy-multi`, {
|
|
98
106
|
selected_services: services,
|
|
99
107
|
});
|
|
100
108
|
if (!res.ok)
|
|
101
109
|
return textResult(formatError(res));
|
|
110
|
+
const primary = services?.find((s) => s.type === 'app_service')?.name;
|
|
102
111
|
return textResult([
|
|
103
112
|
`Multi-container deploy triggered!`,
|
|
104
113
|
``,
|
|
105
114
|
`Build ID: ${res.data.build_id}`,
|
|
106
115
|
`Deploy Group: ${res.data.deploy_group_id}`,
|
|
107
116
|
`Services: ${services?.length || 0}`,
|
|
117
|
+
`Primary (web): ${primary || 'none — check deploy log'}`,
|
|
118
|
+
``,
|
|
119
|
+
`Next: call dailey_deploy_status with project_id=${project_id} to watch progress.`,
|
|
120
|
+
` If it fails, call dailey_build_logs with project_id=${project_id} for full output.`,
|
|
108
121
|
].join('\n'));
|
|
109
122
|
});
|
|
110
123
|
server.tool('dailey_create_project', 'Create a new project', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAchE,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,+BAA+B,EAC/B,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,GAAG,GAAG,MAAM,UAAU,CAA0B,KAAK,EAAE,WAAW,CAAC,CAAC;QAC1E,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAEjD,MAAM,QAAQ,GAAG,GAA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AEjD,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;QACnB,OAAO,UAAU,CACf;YACE,+BAA+B;YAC/B,EAAE;YACF,aAAa,CAAC,CAAC,EAAE,EAAE;YACnB,aAAa,CAAC,CAAC,IAAI,EAAE;YACrB,aAAa,CAAC,CAAC,MAAM,IAAI,SAAS,EAAE;YACpC,aAAa,CAAC,CAAC,QAAQ,EAAE;YACzB,aAAa,CAAC,CAAC,MAAM,IAAI,MAAM,EAAE;YACjC,aAAa,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;SAC/C,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,iCAAiC,EACjC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,EAC/D,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QACvB,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,QAAQ,EAAE,aAAa,UAAU,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC,WAAW,UAAU,wBAAwB,CAAC,CAAC;IACnE,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-config.d.ts","sourceRoot":"","sources":["../../src/tools/resource-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA4BpE,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,QAuD5D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { apiRequest, formatError, textResult } from '../api.js';
|
|
3
|
+
export function registerResourceConfigTools(server) {
|
|
4
|
+
server.tool('dailey_resource_config', 'Get or set CPU/memory/storage limits for a project. Pool shows remaining plan capacity.', {
|
|
5
|
+
project_id: z.string().describe('The project ID'),
|
|
6
|
+
action: z.enum(['get', 'set']).describe('get | set'),
|
|
7
|
+
cpu: z.number().optional().describe('CPU cores (e.g., 0.5, 1, 2). Used by set.'),
|
|
8
|
+
memory_mb: z.number().int().optional().describe('Memory in MB. Used by set.'),
|
|
9
|
+
storage_gb: z.number().optional().describe('Storage in GB. Used by set.'),
|
|
10
|
+
replicas: z.number().int().min(0).max(20).optional().describe('Replicas. Used by set.'),
|
|
11
|
+
}, async ({ project_id, action, cpu, memory_mb, storage_gb, replicas }) => {
|
|
12
|
+
if (action === 'get') {
|
|
13
|
+
const res = await apiRequest('GET', `/projects/${project_id}/resource-config`);
|
|
14
|
+
if (!res.ok)
|
|
15
|
+
return textResult(formatError(res));
|
|
16
|
+
const d = res.data;
|
|
17
|
+
const proj = d.project || {};
|
|
18
|
+
const pool = d.pool || {};
|
|
19
|
+
const lines = [
|
|
20
|
+
`Resource config for project ${project_id}`,
|
|
21
|
+
'─'.repeat(50),
|
|
22
|
+
`CPU: ${d.cpu ?? 0} cores (limit: ${proj.cpu_limit || '-'}, request: ${proj.cpu_request || '-'})`,
|
|
23
|
+
`Memory: ${d.memory_mb ?? 0} MB (limit: ${proj.memory_limit || '-'}, request: ${proj.memory_request || '-'})`,
|
|
24
|
+
`Storage: ${d.storage_gb ?? 0} GB (limit: ${proj.storage_limit || '-'})`,
|
|
25
|
+
`Replicas: ${d.replicas ?? 1}`,
|
|
26
|
+
'',
|
|
27
|
+
`Plan: ${pool.plan || 'unknown'}`,
|
|
28
|
+
`CPU pool: ${pool.cpu_used ?? 0}/${pool.cpu_total ?? 0} cores used`,
|
|
29
|
+
`Memory pool: ${pool.memory_used_mb ?? 0}/${pool.memory_total_mb ?? 0} MB used`,
|
|
30
|
+
`Storage pool: ${pool.storage_used_gb ?? 0}/${pool.storage_total_gb ?? 0} GB used`,
|
|
31
|
+
];
|
|
32
|
+
return textResult(lines.join('\n'));
|
|
33
|
+
}
|
|
34
|
+
if (action === 'set') {
|
|
35
|
+
const body = {};
|
|
36
|
+
if (cpu !== undefined)
|
|
37
|
+
body.cpu = cpu;
|
|
38
|
+
if (memory_mb !== undefined)
|
|
39
|
+
body.memory_mb = memory_mb;
|
|
40
|
+
if (storage_gb !== undefined)
|
|
41
|
+
body.storage_gb = storage_gb;
|
|
42
|
+
if (replicas !== undefined)
|
|
43
|
+
body.replicas = replicas;
|
|
44
|
+
if (Object.keys(body).length === 0) {
|
|
45
|
+
return textResult('Error: specify at least one of cpu, memory_mb, storage_gb, replicas.');
|
|
46
|
+
}
|
|
47
|
+
const res = await apiRequest('PUT', `/projects/${project_id}/resource-config`, body);
|
|
48
|
+
if (!res.ok)
|
|
49
|
+
return textResult(formatError(res));
|
|
50
|
+
const changed = Object.entries(body).map(([k, v]) => `${k}=${v}`).join(', ');
|
|
51
|
+
return textResult(`Resource config updated: ${changed}.\n\nChanges take effect on the next deploy (or use dailey_process_restart).`);
|
|
52
|
+
}
|
|
53
|
+
return textResult('Invalid action. Use get or set.');
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=resource-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-config.js","sourceRoot":"","sources":["../../src/tools/resource-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AA0BhE,MAAM,UAAU,2BAA2B,CAAC,MAAiB;IAC3D,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,yFAAyF,EACzF;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACjD,MAAM,EAAE,CAAC,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,CAAC,sEAAsE,CAAC,CAAC;YAC5F,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,aAAa,UAAU,kBAAkB,EAAE,IAAI,CAAC,CAAC;YACrF,IAAI,CAAC,GAAG,CAAC,EAAE;gBAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YACjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7E,OAAO,UAAU,CAAC,4BAA4B,OAAO,8EAA8E,CAAC,CAAC;QACvI,CAAC;QAED,OAAO,UAAU,CAAC,iCAAiC,CAAC,CAAC;IACvD,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/tools/scale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/tools/scale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,QAsBnD"}
|
package/dist/tools/scale.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { apiRequest, formatError, textResult } from '../api.js';
|
|
3
3
|
export function registerScaleTools(server) {
|
|
4
|
-
server.tool('dailey_scale', 'Scale project replicas up or down', {
|
|
4
|
+
server.tool('dailey_scale', 'Scale project replicas up or down. Surfaces warnings if the DB updated but k8s did not apply (e.g., deployment missing).', {
|
|
5
5
|
project_id: z.string().describe('The project ID'),
|
|
6
6
|
replicas: z.number().describe('Number of replicas to scale to'),
|
|
7
7
|
}, async ({ project_id, replicas }) => {
|
|
8
8
|
const res = await apiRequest('POST', `/projects/${project_id}/scale`, { replicas });
|
|
9
9
|
if (!res.ok)
|
|
10
10
|
return textResult(formatError(res));
|
|
11
|
-
|
|
11
|
+
const lines = [`Project ${project_id} scaled to ${replicas} replica(s).`];
|
|
12
|
+
if (res.data?.warning) {
|
|
13
|
+
lines.push('');
|
|
14
|
+
lines.push(`⚠ Warning: ${res.data.warning}`);
|
|
15
|
+
lines.push('');
|
|
16
|
+
lines.push('Next steps: check dailey_project_resources to see if pods are actually running. If the deployment is missing, trigger a redeploy.');
|
|
17
|
+
}
|
|
18
|
+
return textResult(lines.join('\n'));
|
|
12
19
|
});
|
|
13
20
|
}
|
|
14
21
|
//# sourceMappingURL=scale.js.map
|
package/dist/tools/scale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.js","sourceRoot":"","sources":["../../src/tools/scale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"scale.js","sourceRoot":"","sources":["../../src/tools/scale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQhE,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,IAAI,CACT,cAAc,EACd,0HAA0H,EAC1H;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACjD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAChE,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;QACjC,MAAM,GAAG,GAAG,MAAM,UAAU,CAAgB,MAAM,EAAE,aAAa,UAAU,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnG,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAEjD,MAAM,KAAK,GAAG,CAAC,WAAW,UAAU,cAAc,QAAQ,cAAc,CAAC,CAAC;QAC1E,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,mIAAmI,CAAC,CAAC;QAClJ,CAAC;QACD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
6
6
|
import { registerAuthTools } from './tools/auth.js';
|
|
7
7
|
import { registerProjectTools } from './tools/projects.js';
|
|
8
8
|
import { registerDeployTools } from './tools/deploy.js';
|
|
9
|
+
import { registerDeployStatusTools } from './tools/deploy-status.js';
|
|
10
|
+
import { registerBuildLogsTools } from './tools/build-logs.js';
|
|
9
11
|
import { registerScaleTools } from './tools/scale.js';
|
|
10
12
|
import { registerEnvTools } from './tools/env.js';
|
|
11
13
|
import { registerDomainTools } from './tools/domains.js';
|
|
@@ -15,26 +17,49 @@ import { registerBillingTools } from './tools/billing.js';
|
|
|
15
17
|
import { registerPlatformTools } from './tools/platform.js';
|
|
16
18
|
import { registerStorageTools } from './tools/storage.js';
|
|
17
19
|
import { registerImageTools } from './tools/images.js';
|
|
20
|
+
import { registerProcessTools } from './tools/processes.js';
|
|
21
|
+
import { registerLifecycleTools } from './tools/lifecycle.js';
|
|
22
|
+
import { registerBackupTools } from './tools/backups.js';
|
|
23
|
+
import { registerResourceConfigTools } from './tools/resource-config.js';
|
|
24
|
+
import { registerLinkTools } from './tools/links.js';
|
|
25
|
+
import { registerCredentialRevealTools } from './tools/credentials-reveal.js';
|
|
26
|
+
import { registerAnalyzeTools } from './tools/analyze.js';
|
|
18
27
|
|
|
19
28
|
const server = new McpServer({
|
|
20
29
|
name: 'dailey-os',
|
|
21
|
-
version: '1.
|
|
30
|
+
version: '1.1.0',
|
|
22
31
|
});
|
|
23
32
|
|
|
24
|
-
//
|
|
33
|
+
// Core + identity
|
|
25
34
|
registerAuthTools(server);
|
|
35
|
+
registerPlatformTools(server);
|
|
36
|
+
registerUsageTools(server);
|
|
37
|
+
registerBillingTools(server);
|
|
38
|
+
|
|
39
|
+
// Projects + deploys
|
|
26
40
|
registerProjectTools(server);
|
|
41
|
+
registerAnalyzeTools(server);
|
|
27
42
|
registerDeployTools(server);
|
|
43
|
+
registerDeployStatusTools(server);
|
|
44
|
+
registerBuildLogsTools(server);
|
|
45
|
+
registerImageTools(server);
|
|
46
|
+
|
|
47
|
+
// Lifecycle + scaling
|
|
28
48
|
registerScaleTools(server);
|
|
49
|
+
registerLifecycleTools(server);
|
|
50
|
+
registerResourceConfigTools(server);
|
|
51
|
+
registerProcessTools(server);
|
|
52
|
+
|
|
53
|
+
// Config
|
|
29
54
|
registerEnvTools(server);
|
|
30
55
|
registerDomainTools(server);
|
|
56
|
+
registerLinkTools(server);
|
|
57
|
+
registerCredentialRevealTools(server);
|
|
58
|
+
|
|
59
|
+
// Data
|
|
31
60
|
registerDbTools(server);
|
|
32
|
-
registerUsageTools(server);
|
|
33
|
-
registerBillingTools(server);
|
|
34
|
-
registerPlatformTools(server);
|
|
35
61
|
registerStorageTools(server);
|
|
36
|
-
|
|
62
|
+
registerBackupTools(server);
|
|
37
63
|
|
|
38
|
-
// Start stdio transport
|
|
39
64
|
const transport = new StdioServerTransport();
|
|
40
65
|
await server.connect(transport);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { apiRequest, formatError, textResult } from '../api.js';
|
|
4
|
+
|
|
5
|
+
interface AnalyzeResponse {
|
|
6
|
+
_isDockerImage?: boolean;
|
|
7
|
+
image?: {
|
|
8
|
+
registry?: string;
|
|
9
|
+
size_mb?: number;
|
|
10
|
+
port?: number;
|
|
11
|
+
catalog_match?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
};
|
|
14
|
+
database?: { needed?: boolean };
|
|
15
|
+
estimates?: { pull_time_seconds?: number; deploy_time_seconds?: number };
|
|
16
|
+
issues?: string[];
|
|
17
|
+
stack?: { name?: string; version?: string };
|
|
18
|
+
services_manifest?: {
|
|
19
|
+
entries?: Array<{
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
provider?: string;
|
|
23
|
+
dockerfile?: string;
|
|
24
|
+
buildContext?: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
recommendations?: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function registerAnalyzeTools(server: McpServer) {
|
|
31
|
+
server.tool(
|
|
32
|
+
'dailey_analyze_repo',
|
|
33
|
+
'Analyze a Git repo or Docker image BEFORE creating a project — detects stack, Dockerfile, database needs, and multi-service manifest (dailey.yaml). Use this to preview what a deploy would do.',
|
|
34
|
+
{
|
|
35
|
+
repo_url: z.string().describe('Git repo URL or Docker image (e.g., github.com/user/repo, wordpress:6-apache)'),
|
|
36
|
+
branch: z.string().optional().describe('Branch to analyze (default: main)'),
|
|
37
|
+
},
|
|
38
|
+
async ({ repo_url, branch }) => {
|
|
39
|
+
const res = await apiRequest<AnalyzeResponse>('POST', '/projects/analyze', {
|
|
40
|
+
repo_url,
|
|
41
|
+
branch: branch || 'main',
|
|
42
|
+
});
|
|
43
|
+
if (!res.ok) return textResult(formatError(res));
|
|
44
|
+
|
|
45
|
+
const d = res.data;
|
|
46
|
+
const lines: string[] = [`Analysis: ${repo_url}`, '─'.repeat(50)];
|
|
47
|
+
|
|
48
|
+
if (d._isDockerImage) {
|
|
49
|
+
lines.push(`Type: Docker image`);
|
|
50
|
+
lines.push(`Registry: ${d.image?.registry || 'Docker Hub'}`);
|
|
51
|
+
lines.push(`Size: ${d.image?.size_mb ?? '?'} MB`);
|
|
52
|
+
lines.push(`Port: ${d.image?.port ?? 3000}`);
|
|
53
|
+
lines.push(`DB needed: ${d.database?.needed ? 'yes' : 'no'}`);
|
|
54
|
+
if (d.image?.catalog_match) lines.push(`Catalog: ✓ ${d.image.catalog_match}`);
|
|
55
|
+
if (d.image?.description) lines.push(`Description: ${d.image.description}`);
|
|
56
|
+
} else {
|
|
57
|
+
lines.push(`Type: Git repo`);
|
|
58
|
+
lines.push(`Branch: ${branch || 'main'}`);
|
|
59
|
+
if (d.stack?.name) {
|
|
60
|
+
lines.push(`Stack: ${d.stack.name}${d.stack.version ? ` ${d.stack.version}` : ''}`);
|
|
61
|
+
}
|
|
62
|
+
lines.push(`DB needed: ${d.database?.needed ? 'yes' : 'no'}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (d.services_manifest?.entries?.length) {
|
|
66
|
+
lines.push('');
|
|
67
|
+
lines.push(`Multi-service manifest found (${d.services_manifest.entries.length} services):`);
|
|
68
|
+
for (const e of d.services_manifest.entries) {
|
|
69
|
+
lines.push(` • ${e.name} [${e.type}]${e.provider ? ` provider=${e.provider}` : ''}${e.dockerfile ? ` dockerfile=${e.dockerfile}` : ''}`);
|
|
70
|
+
}
|
|
71
|
+
lines.push('');
|
|
72
|
+
lines.push('Tip: this project will be deployed via dailey_deploy_multi.');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (d.estimates) {
|
|
76
|
+
lines.push('');
|
|
77
|
+
lines.push(`Estimates: pull ~${d.estimates.pull_time_seconds}s, deploy ~${d.estimates.deploy_time_seconds}s`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (d.recommendations?.length) {
|
|
81
|
+
lines.push('');
|
|
82
|
+
lines.push('Recommendations:');
|
|
83
|
+
for (const r of d.recommendations) lines.push(` • ${r}`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (d.issues?.length) {
|
|
87
|
+
lines.push('');
|
|
88
|
+
lines.push('❌ Blocking issues:');
|
|
89
|
+
for (const issue of d.issues) lines.push(` ✗ ${issue}`);
|
|
90
|
+
} else {
|
|
91
|
+
lines.push('');
|
|
92
|
+
lines.push('✓ Ready to deploy via dailey_create_project + dailey_deploy_multi, or dailey_run_image.');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return textResult(lines.join('\n'));
|
|
96
|
+
},
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { apiRequest, formatError, textResult } from '../api.js';
|
|
4
|
+
|
|
5
|
+
interface Backup {
|
|
6
|
+
key: string;
|
|
7
|
+
timestamp?: string;
|
|
8
|
+
size_mb?: number;
|
|
9
|
+
last_modified?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface BackupsResponse {
|
|
13
|
+
backups?: Backup[];
|
|
14
|
+
total?: number;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function registerBackupTools(server: McpServer) {
|
|
19
|
+
server.tool(
|
|
20
|
+
'dailey_backups',
|
|
21
|
+
'List, create, or restore backups for a project. Use before risky changes (schema migrations, major redeploys).',
|
|
22
|
+
{
|
|
23
|
+
project_id: z.string().describe('The project ID'),
|
|
24
|
+
action: z.enum(['list', 'create', 'restore', 'download']).describe('list | create | restore | download'),
|
|
25
|
+
backup_key: z.string().optional().describe('Backup key (required for restore/download)'),
|
|
26
|
+
},
|
|
27
|
+
async ({ project_id, action, backup_key }) => {
|
|
28
|
+
if (action === 'list') {
|
|
29
|
+
const res = await apiRequest<BackupsResponse>('GET', `/projects/${project_id}/backups`);
|
|
30
|
+
if (!res.ok) return textResult(formatError(res));
|
|
31
|
+
|
|
32
|
+
const backups = res.data.backups || [];
|
|
33
|
+
if (backups.length === 0) {
|
|
34
|
+
const err = res.data.error ? `\n\nNote: ${res.data.error}` : '';
|
|
35
|
+
return textResult(`No backups found for this project.${err}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const lines = [
|
|
39
|
+
`Backups (${backups.length})`,
|
|
40
|
+
`${'Timestamp'.padEnd(24)} ${'Size'.padEnd(10)} Key`,
|
|
41
|
+
'─'.repeat(90),
|
|
42
|
+
];
|
|
43
|
+
for (const b of backups) {
|
|
44
|
+
lines.push(`${(b.timestamp || '-').padEnd(24)} ${String((b.size_mb ?? 0) + ' MB').padEnd(10)} ${b.key}`);
|
|
45
|
+
}
|
|
46
|
+
lines.push('');
|
|
47
|
+
lines.push('Restore with: dailey_backups action=restore backup_key=<key>');
|
|
48
|
+
return textResult(lines.join('\n'));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (action === 'create') {
|
|
52
|
+
const res = await apiRequest<{ triggered?: boolean; message?: string }>(
|
|
53
|
+
'POST',
|
|
54
|
+
`/projects/${project_id}/backups`,
|
|
55
|
+
);
|
|
56
|
+
if (!res.ok) return textResult(formatError(res));
|
|
57
|
+
return textResult(res.data.message || 'Backup triggered.');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (action === 'restore') {
|
|
61
|
+
if (!backup_key) return textResult('Error: backup_key is required for restore.');
|
|
62
|
+
const res = await apiRequest<{ restored?: boolean; message?: string }>(
|
|
63
|
+
'POST',
|
|
64
|
+
`/projects/${project_id}/backups/restore`,
|
|
65
|
+
{ backup_key },
|
|
66
|
+
);
|
|
67
|
+
if (!res.ok) return textResult(formatError(res));
|
|
68
|
+
return textResult(res.data.message || `Restored from ${backup_key}.`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (action === 'download') {
|
|
72
|
+
if (!backup_key) return textResult('Error: backup_key is required for download.');
|
|
73
|
+
const res = await apiRequest<{ url?: string; expires_in?: number }>(
|
|
74
|
+
'GET',
|
|
75
|
+
`/projects/${project_id}/backups/download?key=${encodeURIComponent(backup_key)}`,
|
|
76
|
+
);
|
|
77
|
+
if (!res.ok) return textResult(formatError(res));
|
|
78
|
+
return textResult(`Download URL (expires in ${res.data.expires_in || 3600}s):\n${res.data.url}`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return textResult('Invalid action. Use list, create, restore, or download.');
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { apiRequest, formatError, textResult } from '../api.js';
|
|
4
|
+
|
|
5
|
+
interface Build {
|
|
6
|
+
id: string;
|
|
7
|
+
status?: string;
|
|
8
|
+
started_at?: string;
|
|
9
|
+
finished_at?: string;
|
|
10
|
+
commit_sha?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface BuildRow {
|
|
14
|
+
id: string;
|
|
15
|
+
status: string;
|
|
16
|
+
log?: string;
|
|
17
|
+
started_at?: string;
|
|
18
|
+
finished_at?: string;
|
|
19
|
+
commit_sha?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function registerBuildLogsTools(server: McpServer) {
|
|
23
|
+
server.tool(
|
|
24
|
+
'dailey_build_logs',
|
|
25
|
+
'Fetch the full build log for a specific build (or the most recent build if build_id is omitted). Use this after a deploy fails to see the actual compiler/Docker output.',
|
|
26
|
+
{
|
|
27
|
+
project_id: z.string().describe('The project ID'),
|
|
28
|
+
build_id: z.string().optional().describe('Specific build ID (defaults to the most recent build for the project)'),
|
|
29
|
+
tail: z.number().int().min(1).max(5000).optional().describe('Return only the last N lines (default: full log)'),
|
|
30
|
+
},
|
|
31
|
+
async ({ project_id, build_id, tail }) => {
|
|
32
|
+
let targetBuildId = build_id;
|
|
33
|
+
|
|
34
|
+
if (!targetBuildId) {
|
|
35
|
+
const historyRes = await apiRequest<{ builds: Build[] }>('GET', `/projects/${project_id}/deploys`);
|
|
36
|
+
if (!historyRes.ok) return textResult(formatError(historyRes));
|
|
37
|
+
const builds = historyRes.data.builds || [];
|
|
38
|
+
if (builds.length === 0) {
|
|
39
|
+
return textResult('No builds found for this project.');
|
|
40
|
+
}
|
|
41
|
+
targetBuildId = builds[0].id;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const buildRes = await apiRequest<BuildRow>('GET', `/builds/${targetBuildId}`);
|
|
45
|
+
if (!buildRes.ok) return textResult(formatError(buildRes));
|
|
46
|
+
|
|
47
|
+
const build = buildRes.data;
|
|
48
|
+
const log = build.log || '';
|
|
49
|
+
const allLines = log.split('\n');
|
|
50
|
+
const shown = tail ? allLines.slice(-tail) : allLines;
|
|
51
|
+
|
|
52
|
+
const header = [
|
|
53
|
+
`Build ${build.id}`,
|
|
54
|
+
`Status: ${build.status || 'unknown'}`,
|
|
55
|
+
`Commit: ${build.commit_sha || '-'}`,
|
|
56
|
+
`Started: ${build.started_at || '-'}`,
|
|
57
|
+
`Finished: ${build.finished_at || '-'}`,
|
|
58
|
+
`Lines: ${allLines.length}${tail ? ` (showing last ${Math.min(tail, allLines.length)})` : ''}`,
|
|
59
|
+
'─'.repeat(60),
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
return textResult([...header, ...shown].join('\n'));
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
}
|