@daileyos/mcp-server 1.21.1 → 1.21.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 (53) hide show
  1. package/.dockerignore +6 -0
  2. package/Dockerfile +19 -0
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +14 -1
  5. package/dist/api.js.map +1 -1
  6. package/dist/context.d.ts +8 -0
  7. package/dist/context.d.ts.map +1 -0
  8. package/dist/context.js +6 -0
  9. package/dist/context.js.map +1 -0
  10. package/dist/http.d.ts +5 -0
  11. package/dist/http.d.ts.map +1 -0
  12. package/dist/http.js +193 -0
  13. package/dist/http.js.map +1 -0
  14. package/dist/index.js +8 -146
  15. package/dist/index.js.map +1 -1
  16. package/dist/server.d.ts +9 -0
  17. package/dist/server.d.ts.map +1 -0
  18. package/dist/server.js +165 -0
  19. package/dist/server.js.map +1 -0
  20. package/dist/tools/accounts.d.ts +4 -1
  21. package/dist/tools/accounts.d.ts.map +1 -1
  22. package/dist/tools/accounts.js +56 -52
  23. package/dist/tools/accounts.js.map +1 -1
  24. package/dist/tools/wordpress-targeting.d.ts.map +1 -1
  25. package/dist/tools/wordpress-targeting.js +22 -7
  26. package/dist/tools/wordpress-targeting.js.map +1 -1
  27. package/docs/superpowers/plans/2026-08-09-remote-mcp-endpoint.md +663 -0
  28. package/docs/superpowers/specs/2026-08-09-remote-mcp-endpoint-design.md +66 -0
  29. package/package.json +4 -3
  30. package/src/api.ts +9 -1
  31. package/src/context.ts +12 -0
  32. package/src/http.ts +160 -0
  33. package/src/index.ts +8 -161
  34. package/src/server.ts +188 -0
  35. package/src/tools/accounts.ts +69 -61
  36. package/src/tools/wordpress-targeting.ts +22 -7
  37. package/test/context.test.ts +36 -0
  38. package/test/http.test.ts +103 -0
  39. package/test/server-surface.test.ts +36 -0
  40. package/test/use-account-sticky.test.ts +28 -0
  41. package/test/wordpress-targeting.test.ts +36 -1
  42. package/dist/tools/buddy.d.ts +0 -3
  43. package/dist/tools/buddy.d.ts.map +0 -1
  44. package/dist/tools/buddy.js +0 -765
  45. package/dist/tools/buddy.js.map +0 -1
  46. package/dist/tools/payments.d.ts +0 -3
  47. package/dist/tools/payments.d.ts.map +0 -1
  48. package/dist/tools/payments.js +0 -96
  49. package/dist/tools/payments.js.map +0 -1
  50. package/dist/tools/redis.d.ts +0 -3
  51. package/dist/tools/redis.d.ts.map +0 -1
  52. package/dist/tools/redis.js +0 -72
  53. package/dist/tools/redis.js.map +0 -1
package/dist/server.js ADDED
@@ -0,0 +1,165 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { getActiveAccount, setActiveAccount } from './api.js';
4
+ import { OWN_VERSION } from './version.js';
5
+ import { registerAuthTools } from './tools/auth.js';
6
+ import { registerAccountTools } from './tools/accounts.js';
7
+ import { registerProjectTools } from './tools/projects.js';
8
+ import { registerDeployTools } from './tools/deploy.js';
9
+ import { registerDeployStatusTools } from './tools/deploy-status.js';
10
+ import { registerBuildLogsTools } from './tools/build-logs.js';
11
+ import { registerScaleTools } from './tools/scale.js';
12
+ import { registerEnvTools } from './tools/env.js';
13
+ import { registerDomainTools } from './tools/domains.js';
14
+ import { registerDbTools } from './tools/db.js';
15
+ import { registerMigrateTools } from './tools/db-migrate.js';
16
+ import { registerExecRunTools } from './tools/exec-run.js';
17
+ import { registerProjectTransferTools } from './tools/project-transfer.js';
18
+ import { registerAdminTools } from './tools/admin.js';
19
+ import { registerUsageTools } from './tools/usage.js';
20
+ import { registerBillingTools } from './tools/billing.js';
21
+ import { registerPlatformTools } from './tools/platform.js';
22
+ import { registerStorageTools } from './tools/storage.js';
23
+ import { registerAiTools } from './tools/ai.js';
24
+ import { registerEmailTools } from './tools/email.js';
25
+ import { registerCreditTools } from './tools/credits.js';
26
+ import { registerAddonTools } from './tools/addons.js';
27
+ import { registerDaileyImagesTools } from './tools/dailey-images.js';
28
+ import { registerImageTools } from './tools/images.js';
29
+ import { registerProcessTools } from './tools/processes.js';
30
+ import { registerLifecycleTools } from './tools/lifecycle.js';
31
+ import { registerBackupTools } from './tools/backups.js';
32
+ import { registerWordPressMigrateTools } from './tools/wordpress-migrate.js';
33
+ import { registerWordPressImportTools } from './tools/wordpress-import.js';
34
+ import { registerWordPressSnapshotTools } from './tools/wordpress-snapshot.js';
35
+ import { registerWordPressLiveEditTools } from './tools/wordpress-live-edit.js';
36
+ import { registerWordPressTargetingTools } from './tools/wordpress-targeting.js';
37
+ import { registerEnvironmentTools } from './tools/environments.js';
38
+ import { registerResourceConfigTools } from './tools/resource-config.js';
39
+ import { registerLinkTools } from './tools/links.js';
40
+ import { registerCredentialRevealTools } from './tools/credentials-reveal.js';
41
+ import { registerAnalyzeTools } from './tools/analyze.js';
42
+ import { registerCliTools } from './tools/cli.js';
43
+ import { registerBundleTools } from './tools/bundle.js';
44
+ import { registerDiagnoseTools } from './tools/diagnose.js';
45
+ import { registerSupportTools } from './tools/support.js';
46
+ export function buildServer(opts) {
47
+ const server = new McpServer({
48
+ name: 'dailey-os',
49
+ version: OWN_VERSION,
50
+ }, opts.instructions ? { instructions: opts.instructions } : undefined);
51
+ // ─── Account-context hardening (2026-07-13, Muenda's "which account am I in?") ───
52
+ // Two invariants, applied uniformly to ALL tools via this registration wrapper:
53
+ // 1. Every tool accepts an optional `account` param — a STATELESS, per-call
54
+ // scope to a managed account (set → run → restore). Agents no longer have
55
+ // to rely on dailey_use_account session state being what they remember.
56
+ // 2. Every tool result is prefixed with `[account: <effective>]` so the model
57
+ // (and the human reading the transcript) always sees which account the
58
+ // call actually ran against. Wrong-account work becomes visible instantly.
59
+ // Tools that declare their own `account` param (the WP tools) keep their schema;
60
+ // the wrapper still enforces the per-call set/restore around them.
61
+ {
62
+ const originalTool = server.tool.bind(server);
63
+ // Tools whose PURPOSE is to set the session account must be left alone by
64
+ // the per-call scope wrapper — otherwise the wrapper's finally-restore
65
+ // undoes the switch the moment the call returns (dailey_use_account was
66
+ // silently non-sticky on stdio because of this). Register them raw.
67
+ const SESSION_ACCOUNT_SETTERS = new Set(['dailey_use_account']);
68
+ server.tool = (name, description, schema, handler) => {
69
+ if (SESSION_ACCOUNT_SETTERS.has(name)) {
70
+ return originalTool(name, description, schema, handler);
71
+ }
72
+ const augmented = 'account' in schema
73
+ ? schema
74
+ : {
75
+ ...schema,
76
+ account: z.string().optional().describe('Managed-account slug to run THIS call against (per-call scope; overrides the dailey_use_account session state for this call only). Omit to use the current session account.'),
77
+ };
78
+ return originalTool(name, description, augmented, async (args, extra) => {
79
+ const requested = typeof args?.account === 'string' && args.account.trim() ? args.account.trim() : undefined;
80
+ const prev = getActiveAccount();
81
+ if (requested)
82
+ setActiveAccount(requested);
83
+ try {
84
+ const result = await handler(args, extra);
85
+ const effective = requested ?? getActiveAccount() ?? 'self (your own account)';
86
+ if (result?.content?.length && result.content[0]?.type === 'text') {
87
+ result.content[0].text = `[account: ${effective}]\n${result.content[0].text}`;
88
+ }
89
+ return result;
90
+ }
91
+ finally {
92
+ // Restore ONLY when this call temporarily overrode the session scope —
93
+ // dailey_use_account itself must keep its session-setting behavior.
94
+ if (requested)
95
+ setActiveAccount(prev);
96
+ }
97
+ });
98
+ };
99
+ }
100
+ // Core + identity
101
+ if (opts.includeLocalAuth)
102
+ registerAuthTools(server);
103
+ registerAccountTools(server, {
104
+ includeSwitch: opts.includeAccountSwitch,
105
+ remoteHint: !opts.includeAccountSwitch,
106
+ });
107
+ registerPlatformTools(server);
108
+ registerUsageTools(server);
109
+ registerBillingTools(server);
110
+ // À-la-carte billing surfaces — prepaid credits + capacity add-ons.
111
+ registerCreditTools(server);
112
+ registerAddonTools(server);
113
+ // Projects + deploys
114
+ registerProjectTools(server);
115
+ registerAnalyzeTools(server);
116
+ registerDeployTools(server);
117
+ registerDeployStatusTools(server);
118
+ registerBuildLogsTools(server);
119
+ registerImageTools(server);
120
+ // Lifecycle + scaling
121
+ registerScaleTools(server);
122
+ registerLifecycleTools(server);
123
+ registerResourceConfigTools(server);
124
+ registerProcessTools(server);
125
+ // Config
126
+ registerEnvTools(server);
127
+ registerDomainTools(server);
128
+ registerLinkTools(server);
129
+ registerCredentialRevealTools(server);
130
+ // Data
131
+ registerDbTools(server);
132
+ registerMigrateTools(server);
133
+ registerStorageTools(server);
134
+ registerAiTools(server);
135
+ registerEmailTools(server);
136
+ registerDaileyImagesTools(server);
137
+ registerBackupTools(server);
138
+ registerWordPressMigrateTools(server);
139
+ registerWordPressImportTools(server);
140
+ registerWordPressSnapshotTools(server);
141
+ // WordPress live-edit tools (files/media/wp-cli) wrapping customer-api#18's
142
+ // tenant-scoped live-edit routes. Mutating ops are two-phase (preview → confirm_token).
143
+ registerWordPressLiveEditTools(server);
144
+ // Scenario 1 create + WP targeting spine (list/target), paired with the
145
+ // customer-api targeting-spine deploy.
146
+ registerWordPressTargetingTools(server);
147
+ registerEnvironmentTools(server);
148
+ // Runtime operations — exec into a pod, run one-off jobs
149
+ registerExecRunTools(server);
150
+ // Admin-only — customer onboarding, project transfer
151
+ if (opts.includeAdmin) {
152
+ registerAdminTools(server);
153
+ registerProjectTransferTools(server);
154
+ }
155
+ // CLI assist
156
+ registerCliTools(server);
157
+ // Atomic deploy bundle
158
+ registerBundleTools(server);
159
+ // One-stop health check — first tool to reach for when something is broken
160
+ registerDiagnoseTools(server);
161
+ // Support — escalate to Dailey OS team
162
+ registerSupportTools(server);
163
+ return server;
164
+ }
165
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAA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AM,CAAC,CAAC;IAE5B,2EAA2E;IAC3E,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAE9B,uCAAuC;IACvC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE7B,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function registerAccountTools(server: McpServer): void;
2
+ export declare function registerAccountTools(server: McpServer, opts?: {
3
+ includeSwitch?: boolean;
4
+ remoteHint?: boolean;
5
+ }): void;
3
6
  //# sourceMappingURL=accounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAuBpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAuFrD"}
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAuBpE,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,IAAI,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3D,IAAI,CA4FN"}
@@ -6,8 +6,10 @@ const AUTH_REQUIRED_ERROR = {
6
6
  remediation: 'Run `dailey auth setup` in your terminal',
7
7
  help_url: 'https://docs.dailey.cloud/auth',
8
8
  };
9
- export function registerAccountTools(server) {
10
- server.tool('dailey_accounts', 'List the managed accounts (the "fleet") this user manages — other Dailey accounts that have granted you a consent-based access grant. Returns each account\'s managed_customer_id, slug, and name, plus which account is currently active for this session. Empty fleet means you manage no other accounts. Use `dailey_use_account` to switch into one of these accounts; after switching, all other dailey tools operate inside that account until you clear or switch.', {}, async () => {
9
+ export function registerAccountTools(server, opts = {}) {
10
+ const { includeSwitch = true, remoteHint = false } = opts;
11
+ server.tool('dailey_accounts', 'List the managed accounts (the "fleet") this user manages — other Dailey accounts that have granted you a consent-based access grant. Returns each account\'s managed_customer_id, slug, and name, plus which account is currently active for this session. Empty fleet means you manage no other accounts. Use `dailey_use_account` to switch into one of these accounts; after switching, all other dailey tools operate inside that account until you clear or switch.' +
12
+ (remoteHint ? ' NOTE: this server is remote and stateless — there is no session account switching. Pass `account: "<slug>"` on each tool call to operate in a managed account.' : ''), {}, async () => {
11
13
  const res = await apiRequest('GET', '/customers/me/managed-accounts');
12
14
  if (!res.ok) {
13
15
  if (res.status === 401 || res.status === 403) {
@@ -23,59 +25,61 @@ export function registerAccountTools(server) {
23
25
  accounts: fleet,
24
26
  });
25
27
  });
26
- server.tool('dailey_use_account', 'Switch the active managed-account context for this MCP session. Pass `account` (a slug or id from `dailey_accounts`) to operate INSIDE that managed account; after calling this, ALL other dailey tools act inside that managed account until you clear or switch. Pass `clear: true` to stop and operate as yourself again. The target account must be in your fleet (`dailey_accounts`) — an invalid account is rejected. This context is session-scoped: it persists for the life of this MCP server.', {
27
- account: z
28
- .string()
29
- .optional()
30
- .describe('The slug or id of a managed account to operate within (must be in your fleet from dailey_accounts)'),
31
- clear: z
32
- .boolean()
33
- .optional()
34
- .describe('If true, clear the active managed account and operate as yourself again'),
35
- }, async ({ account, clear }) => {
36
- if (clear) {
37
- setActiveAccount(undefined);
38
- return jsonResult({
39
- ok: true,
40
- active_account: null,
41
- operating_as: 'self',
42
- message: 'Cleared managed-account context — now operating as yourself.',
43
- });
44
- }
45
- if (!account || !account.trim()) {
46
- return jsonResult({
47
- ok: false,
48
- message: 'Provide `account` (a slug or id from dailey_accounts) to switch into, or `clear: true` to operate as yourself.',
49
- });
50
- }
51
- const res = await apiRequest('GET', '/customers/me/managed-accounts');
52
- if (!res.ok) {
53
- if (res.status === 401 || res.status === 403) {
54
- return jsonResult(AUTH_REQUIRED_ERROR);
28
+ if (includeSwitch) {
29
+ server.tool('dailey_use_account', 'Switch the active managed-account context for this MCP session. Pass `account` (a slug or id from `dailey_accounts`) to operate INSIDE that managed account; after calling this, ALL other dailey tools act inside that managed account until you clear or switch. Pass `clear: true` to stop and operate as yourself again. The target account must be in your fleet (`dailey_accounts`) — an invalid account is rejected. This context is session-scoped: it persists for the life of this MCP server.', {
30
+ account: z
31
+ .string()
32
+ .optional()
33
+ .describe('The slug or id of a managed account to operate within (must be in your fleet from dailey_accounts)'),
34
+ clear: z
35
+ .boolean()
36
+ .optional()
37
+ .describe('If true, clear the active managed account and operate as yourself again'),
38
+ }, async ({ account, clear }) => {
39
+ if (clear) {
40
+ setActiveAccount(undefined);
41
+ return jsonResult({
42
+ ok: true,
43
+ active_account: null,
44
+ operating_as: 'self',
45
+ message: 'Cleared managed-account context — now operating as yourself.',
46
+ });
55
47
  }
56
- return jsonResult({ ok: false, error: formatError(res) });
57
- }
58
- const fleet = Array.isArray(res.data) ? res.data : [];
59
- const target = account.trim();
60
- const match = fleet.find((a) => a.slug === target || a.managed_customer_id === target);
61
- if (!match) {
48
+ if (!account || !account.trim()) {
49
+ return jsonResult({
50
+ ok: false,
51
+ message: 'Provide `account` (a slug or id from dailey_accounts) to switch into, or `clear: true` to operate as yourself.',
52
+ });
53
+ }
54
+ const res = await apiRequest('GET', '/customers/me/managed-accounts');
55
+ if (!res.ok) {
56
+ if (res.status === 401 || res.status === 403) {
57
+ return jsonResult(AUTH_REQUIRED_ERROR);
58
+ }
59
+ return jsonResult({ ok: false, error: formatError(res) });
60
+ }
61
+ const fleet = Array.isArray(res.data) ? res.data : [];
62
+ const target = account.trim();
63
+ const match = fleet.find((a) => a.slug === target || a.managed_customer_id === target);
64
+ if (!match) {
65
+ return jsonResult({
66
+ ok: false,
67
+ message: `Account "${target}" is not in your managed-accounts fleet. Call dailey_accounts to list the accounts you manage.`,
68
+ available: fleet.map((a) => ({ slug: a.slug, name: a.name })),
69
+ });
70
+ }
71
+ // Use the slug as the header value when available (matches the dashboard/CLI
72
+ // convention); the server accepts either slug or id.
73
+ const activeValue = match.slug || match.managed_customer_id;
74
+ setActiveAccount(activeValue);
62
75
  return jsonResult({
63
- ok: false,
64
- message: `Account "${target}" is not in your managed-accounts fleet. Call dailey_accounts to list the accounts you manage.`,
65
- available: fleet.map((a) => ({ slug: a.slug, name: a.name })),
76
+ ok: true,
77
+ active_account: activeValue,
78
+ operating_as: 'managed_account',
79
+ account: match,
80
+ message: `Now operating within "${match.name}" (${match.slug}). All subsequent dailey tool calls run inside this account until you clear or switch.`,
66
81
  });
67
- }
68
- // Use the slug as the header value when available (matches the dashboard/CLI
69
- // convention); the server accepts either slug or id.
70
- const activeValue = match.slug || match.managed_customer_id;
71
- setActiveAccount(activeValue);
72
- return jsonResult({
73
- ok: true,
74
- active_account: activeValue,
75
- operating_as: 'managed_account',
76
- account: match,
77
- message: `Now operating within "${match.name}" (${match.slug}). All subsequent dailey tool calls run inside this account until you clear or switch.`,
78
82
  });
79
- });
83
+ }
80
84
  }
81
85
  //# sourceMappingURL=accounts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAQnB,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,sBAAsB;IAClC,OAAO,EAAE,mBAAmB;IAC5B,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,gCAAgC;CAC3C,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,2cAA2c,EAC3c,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,GAAG,GAAG,MAAM,UAAU,CAAmB,KAAK,EAAE,gCAAgC,CAAC,CAAC;QAC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AG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,mBAAmB,CAAC;YAC5D,gBAAgB,CAAC,WAAW,CAAC,CAAC;YAC9B,OAAO,UAAU,CAAC;gBAChB,EAAE,EAAE,IAAI;gBACR,cAAc,EAAE,WAAW;gBAC3B,YAAY,EAAE,iBAAiB;gBAC/B,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,yBAAyB,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,wFAAwF;aACrJ,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wordpress-targeting.d.ts","sourceRoot":"","sources":["../../src/tools/wordpress-targeting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAqDpE,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,SAAS,QAuHhE"}
1
+ {"version":3,"file":"wordpress-targeting.d.ts","sourceRoot":"","sources":["../../src/tools/wordpress-targeting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoEpE,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,SAAS,QAuHhE"}
@@ -1,9 +1,24 @@
1
1
  import { z } from 'zod';
2
2
  import { apiRequest, formatError, textResult, jsonResult, getActiveAccount, setActiveAccount, } from '../api.js';
3
- // The hardened WordPress catalog template is resolved by the deploy-service from
4
- // this image name — it wires the MySQL DB + persistent wp-content volume +
5
- // generated admin creds. Do NOT change without the paired catalog entry.
6
- const WORDPRESS_CATALOG_IMAGE = 'wordpress:6-apache';
3
+ /**
4
+ * The catalog SLUG (the key in dailey-deploy-service's CATALOG, src/routes/deploy-image.ts)
5
+ * — not an image ref. This is what gets stored as the project's `repo_url`, and the
6
+ * deploy-service resolves the template from it on every deploy: MySQL DB env, the
7
+ * persistent wp-content volume, the backup sidecar, the Recreate strategy and the
8
+ * generated admin creds all hang off that lookup.
9
+ *
10
+ * It used to be the image ref `wordpress:6-apache`, matched by comparing image
11
+ * repositories. On 2026-07-13 the catalog image was repointed to
12
+ * `registry.dailey.cloud/catalog/wordpress:6-apache-wpcli` to bake in wp-cli, and the
13
+ * repository names stopped matching — so `getCatalogEntry` returned null and every
14
+ * WordPress site created afterwards came up as a generic stateless app: no volume, no
15
+ * WORDPRESS_DB_* env, no wp-cli, serving the installer. Verified 2026-08-07.
16
+ *
17
+ * The slug is matched by exact key (`if (CATALOG[input]) return CATALOG[input]`), which
18
+ * is the FIRST branch of the lookup, so it cannot be broken by repointing the image
19
+ * again. Prefer the slug over any image ref here, permanently.
20
+ */
21
+ const WORDPRESS_CATALOG_SLUG = 'wordpress';
7
22
  // If the caller passed an explicit `account`, adopt it as the acting-as target
8
23
  // for this session (same mechanism as dailey_use_account — sends X-Dailey-Account
9
24
  // on every subsequent request). Returns the EFFECTIVE account so every tool
@@ -16,7 +31,7 @@ function scopeAccount(account) {
16
31
  }
17
32
  export function registerWordPressTargetingTools(server) {
18
33
  // ── Tool 1 — Scenario 1: create a fresh hardened WordPress site ──────────
19
- server.tool('dailey_create_wordpress', 'Create a brand-new hardened WordPress site in the effective account (respects the account set by dailey_use_account, or the optional `account` arg here). POSTs the standard project-create endpoint with the WordPress catalog image so the deploy-service provisions the MySQL database, a persistent wp-content volume, and generated admin credentials. Prefer this over dailey_wordpress_import when you just need a fresh site (import is for migrating an existing bundle). Returns the project_id, slug, the wp-admin URL, and the effective account. The generated admin password is retrievable via dailey_reveal_credential (key WORDPRESS_ADMIN_PASSWORD).', {
34
+ server.tool('dailey_create_wordpress', 'Create a brand-new hardened WordPress site in the effective account (respects the account set by dailey_use_account, or the optional `account` arg here). POSTs the standard project-create endpoint with the WordPress catalog slug so the deploy-service provisions the MySQL database, a persistent wp-content volume, a backup sidecar, and generated admin credentials. Note: WordPress core is NOT auto-installed — the site serves the standard WordPress installer on first visit; the generated admin credentials are for the account you create there. Prefer this over dailey_wordpress_import when you just need a fresh site (import is for migrating an existing bundle). Returns the project_id, slug, the wp-admin URL, and the effective account. The generated admin password is retrievable via dailey_reveal_credential (key WORDPRESS_ADMIN_PASSWORD).', {
20
35
  name: z.string().describe('Project name for the new WordPress site'),
21
36
  account: z
22
37
  .string()
@@ -26,10 +41,10 @@ export function registerWordPressTargetingTools(server) {
26
41
  const activeAccount = scopeAccount(account);
27
42
  // Reuse the exact dailey_create_project call shape (POST /projects) but
28
43
  // with the hardened WordPress catalog inputs. The deploy-service resolves
29
- // the catalog template by image name and wires DB + storage + admin creds.
44
+ // the catalog template from this slug and wires DB + storage + admin creds.
30
45
  const res = await apiRequest('POST', '/projects', {
31
46
  name,
32
- repo_url: WORDPRESS_CATALOG_IMAGE,
47
+ repo_url: WORDPRESS_CATALOG_SLUG,
33
48
  needs_database: true,
34
49
  needs_storage: true,
35
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"wordpress-targeting.js","sourceRoot":"","sources":["../../src/tools/wordpress-targeting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,iFAAiF;AACjF,2EAA2E;AAC3E,yEAAyE;AACzE,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AA4BrD,+EAA+E;AAC/E,kFAAkF;AAClF,4EAA4E;AAC5E,0DAA0D;AAC1D,SAAS,YAAY,CAAC,OAAgB;IACpC,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QAC9B,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,gBAAgB,EAAE,IAAI,IAAI,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,MAAiB;IAC/D,4EAA4E;IAC5E,MAAM,CAAC,IAAI,CACT,y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