@daileyos/mcp-server 1.21.2 → 1.21.9

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 (164) hide show
  1. package/dist/api.d.ts +7 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +23 -2
  4. package/dist/api.js.map +1 -1
  5. package/dist/index.js +24 -17
  6. package/dist/index.js.map +1 -1
  7. package/dist/tools/accounts.d.ts.map +1 -1
  8. package/dist/tools/accounts.js +3 -2
  9. package/dist/tools/accounts.js.map +1 -1
  10. package/dist/tools/ai.d.ts.map +1 -1
  11. package/dist/tools/ai.js +7 -1
  12. package/dist/tools/ai.js.map +1 -1
  13. package/dist/tools/auth.d.ts.map +1 -1
  14. package/dist/tools/auth.js +25 -6
  15. package/dist/tools/auth.js.map +1 -1
  16. package/dist/tools/backups.d.ts.map +1 -1
  17. package/dist/tools/backups.js +3 -1
  18. package/dist/tools/backups.js.map +1 -1
  19. package/dist/tools/build-logs.d.ts.map +1 -1
  20. package/dist/tools/build-logs.js +3 -1
  21. package/dist/tools/build-logs.js.map +1 -1
  22. package/dist/tools/credentials-reveal.d.ts.map +1 -1
  23. package/dist/tools/credentials-reveal.js +3 -1
  24. package/dist/tools/credentials-reveal.js.map +1 -1
  25. package/dist/tools/dailey-images.js +3 -3
  26. package/dist/tools/dailey-images.js.map +1 -1
  27. package/dist/tools/db-migrate.js +5 -5
  28. package/dist/tools/db-migrate.js.map +1 -1
  29. package/dist/tools/db.d.ts.map +1 -1
  30. package/dist/tools/db.js +17 -1
  31. package/dist/tools/db.js.map +1 -1
  32. package/dist/tools/deploy-status.d.ts.map +1 -1
  33. package/dist/tools/deploy-status.js +3 -1
  34. package/dist/tools/deploy-status.js.map +1 -1
  35. package/dist/tools/deploy.d.ts.map +1 -1
  36. package/dist/tools/deploy.js +9 -1
  37. package/dist/tools/deploy.js.map +1 -1
  38. package/dist/tools/domains.d.ts.map +1 -1
  39. package/dist/tools/domains.js +3 -1
  40. package/dist/tools/domains.js.map +1 -1
  41. package/dist/tools/email.d.ts.map +1 -1
  42. package/dist/tools/email.js +8 -2
  43. package/dist/tools/email.js.map +1 -1
  44. package/dist/tools/env.d.ts.map +1 -1
  45. package/dist/tools/env.js +5 -1
  46. package/dist/tools/env.js.map +1 -1
  47. package/dist/tools/environments.js +3 -3
  48. package/dist/tools/environments.js.map +1 -1
  49. package/dist/tools/exec-run.d.ts.map +1 -1
  50. package/dist/tools/exec-run.js +7 -1
  51. package/dist/tools/exec-run.js.map +1 -1
  52. package/dist/tools/images.d.ts.map +1 -1
  53. package/dist/tools/images.js +5 -1
  54. package/dist/tools/images.js.map +1 -1
  55. package/dist/tools/lifecycle.d.ts.map +1 -1
  56. package/dist/tools/lifecycle.js +5 -1
  57. package/dist/tools/lifecycle.js.map +1 -1
  58. package/dist/tools/links.d.ts.map +1 -1
  59. package/dist/tools/links.js +3 -1
  60. package/dist/tools/links.js.map +1 -1
  61. package/dist/tools/platform.d.ts.map +1 -1
  62. package/dist/tools/platform.js +5 -3
  63. package/dist/tools/platform.js.map +1 -1
  64. package/dist/tools/processes.d.ts.map +1 -1
  65. package/dist/tools/processes.js +11 -1
  66. package/dist/tools/processes.js.map +1 -1
  67. package/dist/tools/projects.d.ts.map +1 -1
  68. package/dist/tools/projects.js +36 -12
  69. package/dist/tools/projects.js.map +1 -1
  70. package/dist/tools/resource-config.d.ts.map +1 -1
  71. package/dist/tools/resource-config.js +3 -1
  72. package/dist/tools/resource-config.js.map +1 -1
  73. package/dist/tools/scale.d.ts.map +1 -1
  74. package/dist/tools/scale.js +3 -1
  75. package/dist/tools/scale.js.map +1 -1
  76. package/dist/tools/storage.d.ts.map +1 -1
  77. package/dist/tools/storage.js +11 -1
  78. package/dist/tools/storage.js.map +1 -1
  79. package/dist/tools/support.d.ts.map +1 -1
  80. package/dist/tools/support.js +3 -1
  81. package/dist/tools/support.js.map +1 -1
  82. package/dist/tools/usage.d.ts.map +1 -1
  83. package/dist/tools/usage.js +3 -1
  84. package/dist/tools/usage.js.map +1 -1
  85. package/dist/tools/wordpress-import.d.ts.map +1 -1
  86. package/dist/tools/wordpress-import.js +3 -1
  87. package/dist/tools/wordpress-import.js.map +1 -1
  88. package/dist/tools/wordpress-migrate.d.ts.map +1 -1
  89. package/dist/tools/wordpress-migrate.js +3 -1
  90. package/dist/tools/wordpress-migrate.js.map +1 -1
  91. package/dist/tools/wordpress-snapshot.d.ts.map +1 -1
  92. package/dist/tools/wordpress-snapshot.js +9 -1
  93. package/dist/tools/wordpress-snapshot.js.map +1 -1
  94. package/package.json +10 -2
  95. package/.dockerignore +0 -6
  96. package/.github/workflows/publish.yml +0 -120
  97. package/Dockerfile +0 -19
  98. package/claude-config.json +0 -13
  99. package/docs/superpowers/plans/2026-08-09-remote-mcp-endpoint.md +0 -663
  100. package/docs/superpowers/specs/2026-08-09-remote-mcp-endpoint-design.md +0 -66
  101. package/src/api.ts +0 -263
  102. package/src/context.ts +0 -12
  103. package/src/http.ts +0 -160
  104. package/src/index.ts +0 -94
  105. package/src/server.ts +0 -188
  106. package/src/tools/accounts.ts +0 -119
  107. package/src/tools/addons.ts +0 -124
  108. package/src/tools/admin.ts +0 -42
  109. package/src/tools/ai.ts +0 -83
  110. package/src/tools/analyze.ts +0 -108
  111. package/src/tools/auth.ts +0 -177
  112. package/src/tools/backups.ts +0 -84
  113. package/src/tools/billing.ts +0 -34
  114. package/src/tools/build-logs.ts +0 -65
  115. package/src/tools/bundle.ts +0 -129
  116. package/src/tools/cli.ts +0 -76
  117. package/src/tools/credentials-reveal.ts +0 -64
  118. package/src/tools/credits.ts +0 -97
  119. package/src/tools/dailey-images.ts +0 -151
  120. package/src/tools/db-migrate.ts +0 -211
  121. package/src/tools/db.ts +0 -391
  122. package/src/tools/deploy-status.ts +0 -247
  123. package/src/tools/deploy.ts +0 -101
  124. package/src/tools/diagnose.ts +0 -567
  125. package/src/tools/domains.ts +0 -156
  126. package/src/tools/email.ts +0 -101
  127. package/src/tools/env.ts +0 -205
  128. package/src/tools/environments.ts +0 -138
  129. package/src/tools/exec-run.ts +0 -91
  130. package/src/tools/images.ts +0 -221
  131. package/src/tools/lifecycle.ts +0 -75
  132. package/src/tools/links.ts +0 -69
  133. package/src/tools/platform.ts +0 -209
  134. package/src/tools/processes.ts +0 -182
  135. package/src/tools/project-transfer.ts +0 -129
  136. package/src/tools/projects.ts +0 -287
  137. package/src/tools/resource-config.ts +0 -84
  138. package/src/tools/scale.ts +0 -33
  139. package/src/tools/storage.ts +0 -281
  140. package/src/tools/support.ts +0 -42
  141. package/src/tools/usage.ts +0 -128
  142. package/src/tools/wordpress-import.ts +0 -174
  143. package/src/tools/wordpress-live-edit.ts +0 -250
  144. package/src/tools/wordpress-migrate.ts +0 -104
  145. package/src/tools/wordpress-snapshot.ts +0 -225
  146. package/src/tools/wordpress-targeting.ts +0 -188
  147. package/src/upload.ts +0 -35
  148. package/src/version.ts +0 -70
  149. package/test/context.test.ts +0 -36
  150. package/test/http.test.ts +0 -103
  151. package/test/server-surface.test.ts +0 -36
  152. package/test/use-account-sticky.test.ts +0 -28
  153. package/test/wordpress-import.test.ts +0 -223
  154. package/test/wordpress-live-edit.test.ts +0 -159
  155. package/test/wordpress-targeting.test.ts +0 -162
  156. package/tests/dailey-images.test.mjs +0 -156
  157. package/tests/environments.test.mjs +0 -230
  158. package/tests/mcp-protocol-smoke.mjs +0 -149
  159. package/tests/new-tools-smoke.mjs +0 -217
  160. package/tests/pack1-mcp-preflight.test.mjs +0 -184
  161. package/tests/pack6-smoke.mjs +0 -222
  162. package/tests/wp-snapshot-labels.test.mjs +0 -21
  163. package/tests/wp-snapshot.test.mjs +0 -261
  164. package/tsconfig.json +0 -19
@@ -1,261 +0,0 @@
1
- /**
2
- * WP snapshot/restore MCP tools — two-layer test.
3
- *
4
- * Layer 1 (protocol smoke): spawns dist/index.js, does the MCP handshake,
5
- * calls tools/list, and asserts all four dailey_wp_* tool names appear with
6
- * input schemas. No real credentials needed — tools/list is pure schema.
7
- *
8
- * Layer 2 (restore confirm-gate): verifies that calling dailey_wp_restore
9
- * WITHOUT a confirm_token returns plan-style text and does NOT hit the
10
- * execute route. We stub the MCP server object and apiRequest by intercepting
11
- * at the handler level using a minimal in-process seam.
12
- *
13
- * Run:
14
- * node --test tests/wp-snapshot.test.mjs
15
- */
16
-
17
- import { test, describe } from 'node:test';
18
- import assert from 'node:assert/strict';
19
- import { spawn } from 'node:child_process';
20
- import { join, dirname } from 'node:path';
21
- import { fileURLToPath } from 'node:url';
22
-
23
- const __dirname = dirname(fileURLToPath(import.meta.url));
24
- const BINARY = join(__dirname, '..', 'dist', 'index.js');
25
-
26
- // ── Layer 1: protocol smoke (tools/list) ───────────────────────────────────
27
-
28
- describe('wp-snapshot MCP tools — protocol smoke', { concurrency: false }, () => {
29
- test('all four dailey_wp_* tools appear in tools/list with input schemas', async () => {
30
- const child = spawn('node', [BINARY], {
31
- env: {
32
- ...process.env,
33
- // Throwaway creds — tools/list needs no real auth (schema only).
34
- DAILEY_EMAIL: process.env.DAILEY_EMAIL || 'smoke@example.com',
35
- DAILEY_PASSWORD: process.env.DAILEY_PASSWORD || 'smoke-password',
36
- DAILEY_API_TOKEN: process.env.DAILEY_API_TOKEN || '',
37
- // Pass DAILEY_API_URL through if set, otherwise prod
38
- DAILEY_API_URL: process.env.DAILEY_API_URL || 'https://os.dailey.cloud/api',
39
- },
40
- stdio: ['pipe', 'pipe', 'pipe'],
41
- });
42
-
43
- let buffer = '';
44
- let nextId = 1;
45
- const pending = new Map();
46
-
47
- child.stdout.on('data', (chunk) => {
48
- buffer += chunk.toString();
49
- const lines = buffer.split('\n');
50
- buffer = lines.pop();
51
- for (const line of lines) {
52
- if (!line.trim()) continue;
53
- try {
54
- const msg = JSON.parse(line);
55
- if (msg.id != null && pending.has(msg.id)) {
56
- const { resolve } = pending.get(msg.id);
57
- pending.delete(msg.id);
58
- resolve(msg);
59
- }
60
- } catch { /* ignore non-JSON lines */ }
61
- }
62
- });
63
-
64
- child.stderr.on('data', (_chunk) => { /* suppress */ });
65
-
66
- function send(method, params, timeoutMs = 10000) {
67
- return new Promise((resolve, reject) => {
68
- const id = nextId++;
69
- pending.set(id, { resolve, reject });
70
- child.stdin.write(JSON.stringify({ jsonrpc: '2.0', id, method, params }) + '\n');
71
- const timer = setTimeout(() => {
72
- if (pending.has(id)) {
73
- pending.delete(id);
74
- reject(new Error(`Timeout waiting for ${method}`));
75
- }
76
- }, timeoutMs);
77
- // Let the timer be GC'd once resolved
78
- pending.set(id, {
79
- resolve: (v) => { clearTimeout(timer); resolve(v); },
80
- reject,
81
- });
82
- });
83
- }
84
-
85
- try {
86
- // MCP handshake
87
- await send('initialize', {
88
- protocolVersion: '2024-11-05',
89
- capabilities: {},
90
- clientInfo: { name: 'wp-snapshot-smoke', version: '1.0.0' },
91
- });
92
- child.stdin.write(JSON.stringify({ jsonrpc: '2.0', method: 'notifications/initialized' }) + '\n');
93
-
94
- // List tools
95
- const toolsMsg = await send('tools/list', {});
96
- const tools = toolsMsg.result?.tools ?? [];
97
- const names = new Set(tools.map((t) => t.name));
98
-
99
- const expected = [
100
- 'dailey_wp_snapshots',
101
- 'dailey_wp_snapshot',
102
- 'dailey_wp_restore',
103
- 'dailey_wp_operation_status',
104
- ];
105
-
106
- for (const name of expected) {
107
- assert.ok(names.has(name), `Expected tool "${name}" in tools/list (got: ${[...names].join(', ')})`);
108
- }
109
-
110
- // Verify each has an inputSchema
111
- const toolMap = Object.fromEntries(tools.map((t) => [t.name, t]));
112
- for (const name of expected) {
113
- const tool = toolMap[name];
114
- assert.ok(
115
- tool.inputSchema && typeof tool.inputSchema === 'object',
116
- `Tool "${name}" must have an inputSchema`,
117
- );
118
- assert.ok(
119
- tool.inputSchema.properties && typeof tool.inputSchema.properties === 'object',
120
- `Tool "${name}" inputSchema must have properties`,
121
- );
122
- }
123
-
124
- // Spot-check: dailey_wp_restore must have project_id, snapshot_id, optional confirm_token
125
- const restore = toolMap['dailey_wp_restore'];
126
- const props = restore.inputSchema.properties;
127
- assert.ok('project_id' in props, 'dailey_wp_restore must have project_id param');
128
- assert.ok('snapshot_id' in props, 'dailey_wp_restore must have snapshot_id param');
129
- assert.ok('confirm_token' in props, 'dailey_wp_restore must have confirm_token param');
130
- // confirm_token must not be in the required array (it is optional)
131
- const required = restore.inputSchema.required ?? [];
132
- assert.ok(!required.includes('confirm_token'), 'confirm_token must be optional (not in required[])');
133
-
134
- } finally {
135
- child.kill();
136
- }
137
- });
138
- });
139
-
140
- // ── Layer 2: restore confirm-gate (in-process handler stub) ───────────────
141
-
142
- describe('dailey_wp_restore — confirm-gate logic', { concurrency: false }, () => {
143
- test('without confirm_token: calls preview route, returns plan text, does NOT call execute route', async () => {
144
- // We test this by importing the compiled dist module and wiring up a fake
145
- // server.tool() collector + a stubbed apiRequest injected via env override.
146
- //
147
- // The cleanest seam available in this codebase is: the handler is registered
148
- // via server.tool(name, desc, schema, handler). We capture handlers by
149
- // replacing McpServer with a stub that records them, then call the restore
150
- // handler directly with controlled inputs.
151
- //
152
- // apiRequest is imported from ../api.js which is already loaded in dist.
153
- // We can't monkey-patch ES module exports after load. Instead, we verify the
154
- // confirm-gate purely by inspecting the source logic:
155
- //
156
- // - The handler has an early `if (!confirm_token)` branch.
157
- // - That branch calls /wp/restore/preview (not /wp/restore).
158
- // - The execute path (/wp/restore) is only reached when confirm_token is set.
159
- //
160
- // We assert this by:
161
- // (a) Reading the compiled output and confirming the branching pattern, AND
162
- // (b) Calling the handler via stub server against a fake apiRequest that
163
- // records which paths were hit — using dynamic import with a module
164
- // mock is not available in node:test without loader flags, so we verify
165
- // (a) as the authoritative check and note (b) below.
166
-
167
- // (a) Source-level check: the compiled tool must branch on confirm_token
168
- // and the preview call must precede any non-preview /wp/restore call.
169
- const { readFileSync } = await import('node:fs');
170
- const src = readFileSync(join(__dirname, '..', 'dist', 'tools', 'wordpress-snapshot.js'), 'utf8');
171
-
172
- // confirm_token guard exists
173
- assert.ok(
174
- src.includes('if (!confirm_token)'),
175
- 'Compiled output must contain `if (!confirm_token)` branch guard',
176
- );
177
-
178
- // preview route is used in the no-token branch
179
- assert.ok(
180
- src.includes('/wp/restore/preview'),
181
- 'Compiled output must reference /wp/restore/preview',
182
- );
183
-
184
- // execute route exists in source
185
- assert.ok(
186
- src.includes("'/wp/restore'") || src.includes('`/projects/${project_id}/wp/restore`') ||
187
- src.includes('/wp/restore`'),
188
- 'Compiled output must reference execute route /wp/restore',
189
- );
190
-
191
- // The preview path appears BEFORE the execute path in the file
192
- const previewIdx = src.indexOf('/wp/restore/preview');
193
- const executeIdx = src.indexOf("'/wp/restore'") !== -1
194
- ? src.indexOf("'/wp/restore'")
195
- : src.indexOf('/wp/restore`');
196
- assert.ok(
197
- previewIdx < executeIdx,
198
- `Preview route (idx ${previewIdx}) must appear before execute route (idx ${executeIdx}) in compiled output — confirms branch ordering`,
199
- );
200
-
201
- // confirmation:'RESTORE' is only sent on the execute path (not preview)
202
- assert.ok(
203
- src.includes("confirmation: 'RESTORE'"),
204
- "Execute path must pass confirmation: 'RESTORE'",
205
- );
206
- // preview body does NOT include confirmation
207
- const previewCallStart = src.indexOf('/wp/restore/preview');
208
- const previewCallEnd = src.indexOf(');', previewCallStart);
209
- const previewCallText = src.slice(previewCallStart, previewCallEnd);
210
- assert.ok(
211
- !previewCallText.includes("confirmation"),
212
- 'Preview call must NOT include confirmation field',
213
- );
214
- });
215
-
216
- test('dailey_wp_restore description mentions DESTRUCTIVE and two-phase', async () => {
217
- // Load the compiled dist and capture tool registrations via stub server
218
- const registrations = [];
219
- const stubServer = {
220
- tool(name, description, schema, handler) {
221
- registrations.push({ name, description, schema, handler });
222
- },
223
- };
224
-
225
- // We can't re-import with different mocks, but we CAN import the module and
226
- // call registerWordPressSnapshotTools with our stub server to inspect
227
- // the tool metadata registered (names, descriptions, schemas).
228
- const mod = await import(join(__dirname, '..', 'dist', 'tools', 'wordpress-snapshot.js'));
229
- mod.registerWordPressSnapshotTools(stubServer);
230
-
231
- const restore = registrations.find((r) => r.name === 'dailey_wp_restore');
232
- assert.ok(restore, 'dailey_wp_restore must be registered');
233
- assert.match(restore.description, /DESTRUCTIVE/i, 'Description must mention DESTRUCTIVE');
234
- assert.match(restore.description, /two-phase|two phase/i, 'Description must mention two-phase');
235
- assert.match(restore.description, /confirm_token/, 'Description must mention confirm_token');
236
-
237
- // All four tools must be registered
238
- const expectedTools = [
239
- 'dailey_wp_snapshots',
240
- 'dailey_wp_snapshot',
241
- 'dailey_wp_restore',
242
- 'dailey_wp_operation_status',
243
- ];
244
- for (const name of expectedTools) {
245
- assert.ok(
246
- registrations.some((r) => r.name === name),
247
- `Tool "${name}" must be registered`,
248
- );
249
- }
250
-
251
- // confirm_token must be optional in schema (zod .optional() → not in required)
252
- // The schema shape registered is a zod object — check the _def for optionality
253
- const confirmField = restore.schema?.confirm_token;
254
- assert.ok(confirmField, 'confirm_token field must be in schema');
255
- // Zod optional() wraps in ZodOptional — check typeName or isOptional
256
- const isOptional =
257
- confirmField?._def?.typeName === 'ZodOptional' ||
258
- typeof confirmField?.isOptional === 'function' && confirmField.isOptional();
259
- assert.ok(isOptional, 'confirm_token must be a ZodOptional (marked .optional())');
260
- });
261
- });
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "outDir": "dist",
7
- "rootDir": "src",
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "resolveJsonModule": true,
13
- "declaration": true,
14
- "declarationMap": true,
15
- "sourceMap": true
16
- },
17
- "include": ["src/**/*"],
18
- "exclude": ["node_modules", "dist"]
19
- }