@vibetools/dokploy-mcp 0.5.0 → 1.0.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.
@@ -1,168 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { getTool, postTool } from './_factory.js';
3
- // ── helpers ──────────────────────────────────────────────────────────
4
- const mgId = z.string().min(1).describe('Unique MongoDB database ID');
5
- const DB = 'mongo';
6
- // ── tools ────────────────────────────────────────────────────────────
7
- const one = getTool({
8
- name: `dokploy_${DB}_one`,
9
- title: 'Get MongoDB Details',
10
- description: 'Retrieve the full configuration and status details of a MongoDB database managed by Dokploy. Requires the unique MongoDB database ID. Returns all metadata including name, image, resource limits, environment variables, and current application status.',
11
- schema: z.object({ mongoId: mgId }).strict(),
12
- endpoint: `${DB}.one`,
13
- });
14
- const create = postTool({
15
- name: `dokploy_${DB}_create`,
16
- title: 'Create MongoDB Database',
17
- description: 'Create a new MongoDB database instance inside a Dokploy project. Requires a display name, app-level identifier, user credentials, and the target project ID. Optionally specify a Docker image, description, or remote server. Returns the newly created database record.',
18
- schema: z
19
- .object({
20
- name: z.string().min(1).describe('Display name for the database'),
21
- appName: z.string().min(1).describe('Unique app-level identifier'),
2
+ import { createDatabaseTools } from './_database.js';
3
+ export const mongoTools = createDatabaseTools({
4
+ type: 'mongo',
5
+ idField: 'mongoId',
6
+ displayName: 'MongoDB',
7
+ defaultImage: 'mongo:6',
8
+ createFields: z.object({
22
9
  databaseUser: z.string().min(1).describe('Database user'),
23
10
  databasePassword: z.string().min(1).describe('Database password'),
24
- projectId: z.string().min(1).describe('Project ID to create the database in'),
25
- dockerImage: z.string().optional().describe('Docker image (default: mongo:6)'),
26
- description: z.string().nullable().optional().describe('Optional description'),
27
- serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
28
- })
29
- .strict(),
30
- endpoint: `${DB}.create`,
31
- });
32
- const update = postTool({
33
- name: `dokploy_${DB}_update`,
34
- title: 'Update MongoDB Database',
35
- description: 'Update the configuration of an existing MongoDB database in Dokploy. Requires the MongoDB database ID and accepts optional fields such as name, Docker image, resource limits (memory and CPU), custom start command, environment variables, and external port. Returns the updated database configuration.',
36
- schema: z
37
- .object({
38
- mongoId: mgId,
39
- name: z.string().min(1).optional().describe('Display name'),
40
- appName: z.string().min(1).optional().describe('App-level identifier'),
41
- description: z.string().nullable().optional().describe('Description'),
42
- dockerImage: z.string().optional().describe('Docker image'),
43
- memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
44
- memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
45
- cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
46
- cpuLimit: z.number().nullable().optional().describe('CPU limit'),
47
- command: z.string().nullable().optional().describe('Custom start command'),
48
- env: z.string().nullable().optional().describe('Environment variables'),
49
- externalPort: z.number().nullable().optional().describe('External port'),
50
- })
51
- .strict(),
52
- endpoint: `${DB}.update`,
53
- });
54
- const remove = postTool({
55
- name: `dokploy_${DB}_remove`,
56
- title: 'Remove MongoDB Database',
57
- description: 'Permanently delete a MongoDB database from Dokploy. Requires the MongoDB database ID. This is a destructive operation that removes the container, all associated data, and configuration. Returns the operation status confirming deletion.',
58
- schema: z.object({ mongoId: mgId }).strict(),
59
- endpoint: `${DB}.remove`,
60
- annotations: { destructiveHint: true },
61
- });
62
- const move = postTool({
63
- name: `dokploy_${DB}_move`,
64
- title: 'Move MongoDB Database',
65
- description: 'Move a MongoDB database from its current project to a different project within Dokploy. Requires the MongoDB database ID and the destination project ID. The database configuration and data remain intact during the move. Returns the operation status.',
66
- schema: z
67
- .object({
68
- mongoId: mgId,
69
- targetProjectId: z.string().min(1).describe('Destination project ID'),
70
- })
71
- .strict(),
72
- endpoint: `${DB}.move`,
73
- });
74
- const deploy = postTool({
75
- name: `dokploy_${DB}_deploy`,
76
- title: 'Deploy MongoDB Database',
77
- description: 'Deploy a MongoDB database in Dokploy, pulling the configured Docker image and starting the container. Requires the MongoDB database ID. This triggers a full deployment lifecycle including image pull, container creation, and startup. Returns the deployment operation status.',
78
- schema: z.object({ mongoId: mgId }).strict(),
79
- endpoint: `${DB}.deploy`,
80
- });
81
- const start = postTool({
82
- name: `dokploy_${DB}_start`,
83
- title: 'Start MongoDB Database',
84
- description: 'Start a previously stopped MongoDB database container in Dokploy. Requires the MongoDB database ID. The container will resume with its existing data and configuration. Returns the operation status.',
85
- schema: z.object({ mongoId: mgId }).strict(),
86
- endpoint: `${DB}.start`,
87
- });
88
- const stop = postTool({
89
- name: `dokploy_${DB}_stop`,
90
- title: 'Stop MongoDB Database',
91
- description: 'Stop a currently running MongoDB database container in Dokploy. Requires the MongoDB database ID. The container will be gracefully stopped but its data and configuration are preserved for future restarts. Returns the operation status.',
92
- schema: z.object({ mongoId: mgId }).strict(),
93
- endpoint: `${DB}.stop`,
94
- annotations: { destructiveHint: true },
95
- });
96
- const reload = postTool({
97
- name: `dokploy_${DB}_reload`,
98
- title: 'Reload MongoDB Database',
99
- description: 'Reload the MongoDB database container in Dokploy without performing a full rebuild. Requires the MongoDB database ID and the app-level identifier. This restarts the container with its current configuration. Returns the operation status.',
100
- schema: z
101
- .object({
102
- mongoId: mgId,
103
- appName: z.string().min(1).describe('App-level identifier'),
104
- })
105
- .strict(),
106
- endpoint: `${DB}.reload`,
107
- });
108
- const rebuild = postTool({
109
- name: `dokploy_${DB}_rebuild`,
110
- title: 'Rebuild MongoDB Database',
111
- description: 'Rebuild the MongoDB database container from scratch in Dokploy. Requires the MongoDB database ID. This tears down the existing container and recreates it using the current configuration, which is useful when the container state has become inconsistent. Returns the operation status.',
112
- schema: z.object({ mongoId: mgId }).strict(),
113
- endpoint: `${DB}.rebuild`,
114
- });
115
- const changeStatus = postTool({
116
- name: `dokploy_${DB}_change_status`,
117
- title: 'Change MongoDB Status',
118
- description: 'Manually set the application status of a MongoDB database in Dokploy. Requires the MongoDB database ID and the desired status (idle, running, done, or error). This is typically used for administrative overrides when the reported status does not match reality. Returns the updated status.',
119
- schema: z
120
- .object({
121
- mongoId: mgId,
122
- applicationStatus: z
123
- .enum(['idle', 'running', 'done', 'error'])
124
- .describe('New application status'),
125
- })
126
- .strict(),
127
- endpoint: `${DB}.changeStatus`,
128
- });
129
- const saveExternalPort = postTool({
130
- name: `dokploy_${DB}_save_external_port`,
131
- title: 'Save MongoDB External Port',
132
- description: 'Set or clear the external port mapping for a MongoDB database in Dokploy. Requires the MongoDB database ID and the desired external port number, or null to remove the external port mapping. This controls whether the database is accessible from outside the Docker network. Returns the operation status.',
133
- schema: z
134
- .object({
135
- mongoId: mgId,
136
- externalPort: z.number().nullable().describe('External port number (null to remove)'),
137
- })
138
- .strict(),
139
- endpoint: `${DB}.saveExternalPort`,
140
- });
141
- const saveEnvironment = postTool({
142
- name: `dokploy_${DB}_save_environment`,
143
- title: 'Save MongoDB Environment',
144
- description: 'Overwrite the environment variables for a MongoDB database in Dokploy. Requires the MongoDB database ID and the environment variables as a string. This replaces all existing environment variables with the provided values. Returns the operation status.',
145
- schema: z
146
- .object({
147
- mongoId: mgId,
148
- env: z.string().nullable().optional().describe('Environment variables as a string'),
149
- })
150
- .strict(),
151
- endpoint: `${DB}.saveEnvironment`,
11
+ }),
152
12
  });
153
- // ── export ───────────────────────────────────────────────────────────
154
- export const mongoTools = [
155
- one,
156
- create,
157
- update,
158
- remove,
159
- move,
160
- deploy,
161
- start,
162
- stop,
163
- reload,
164
- rebuild,
165
- changeStatus,
166
- saveExternalPort,
167
- saveEnvironment,
168
- ];
@@ -1,2 +1 @@
1
- import { type ToolDefinition } from './_factory.js';
2
- export declare const mysqlTools: ToolDefinition[];
1
+ export declare const mysqlTools: import("./_factory.js").ToolDefinition[];
@@ -1,170 +1,14 @@
1
1
  import { z } from 'zod';
2
- import { getTool, postTool } from './_factory.js';
3
- // ── helpers ──────────────────────────────────────────────────────────
4
- const myId = z.string().min(1).describe('Unique MySQL database ID');
5
- const DB = 'mysql';
6
- // ── tools ────────────────────────────────────────────────────────────
7
- const one = getTool({
8
- name: `dokploy_${DB}_one`,
9
- title: 'Get MySQL Details',
10
- description: 'Retrieve detailed information about a specific MySQL database managed by Dokploy. Returns the full configuration including connection settings, resource limits, environment variables, and current status. Requires the unique MySQL database ID.',
11
- schema: z.object({ mysqlId: myId }).strict(),
12
- endpoint: `${DB}.one`,
13
- });
14
- const create = postTool({
15
- name: `dokploy_${DB}_create`,
16
- title: 'Create MySQL Database',
17
- description: 'Create a new MySQL database instance inside a Dokploy project. Requires a display name, app-level identifier, database name, user credentials, root password, and the target project ID. Optionally specify a Docker image, description, or remote server. Returns the newly created database record.',
18
- schema: z
19
- .object({
20
- name: z.string().min(1).describe('Display name for the database'),
21
- appName: z.string().min(1).describe('Unique app-level identifier'),
2
+ import { createDatabaseTools } from './_database.js';
3
+ export const mysqlTools = createDatabaseTools({
4
+ type: 'mysql',
5
+ idField: 'mysqlId',
6
+ displayName: 'MySQL',
7
+ defaultImage: 'mysql:8',
8
+ createFields: z.object({
22
9
  databaseName: z.string().min(1).describe('Name of the database to create'),
23
10
  databaseUser: z.string().min(1).describe('Database user'),
24
11
  databasePassword: z.string().min(1).describe('Database password'),
25
12
  databaseRootPassword: z.string().min(1).describe('Root password for MySQL'),
26
- projectId: z.string().min(1).describe('Project ID to create the database in'),
27
- dockerImage: z.string().optional().describe('Docker image (default: mysql:8)'),
28
- description: z.string().nullable().optional().describe('Optional description'),
29
- serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
30
- })
31
- .strict(),
32
- endpoint: `${DB}.create`,
33
- });
34
- const update = postTool({
35
- name: `dokploy_${DB}_update`,
36
- title: 'Update MySQL Database',
37
- description: 'Update the configuration of an existing MySQL database in Dokploy. Supports modifying the display name, Docker image, resource limits (CPU and memory), custom start command, environment variables, and external port. Requires the MySQL database ID. Only the provided fields are updated.',
38
- schema: z
39
- .object({
40
- mysqlId: myId,
41
- name: z.string().min(1).optional().describe('Display name'),
42
- appName: z.string().min(1).optional().describe('App-level identifier'),
43
- description: z.string().nullable().optional().describe('Description'),
44
- dockerImage: z.string().optional().describe('Docker image'),
45
- memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
46
- memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
47
- cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
48
- cpuLimit: z.number().nullable().optional().describe('CPU limit'),
49
- command: z.string().nullable().optional().describe('Custom start command'),
50
- env: z.string().nullable().optional().describe('Environment variables'),
51
- externalPort: z.number().nullable().optional().describe('External port'),
52
- })
53
- .strict(),
54
- endpoint: `${DB}.update`,
55
- });
56
- const remove = postTool({
57
- name: `dokploy_${DB}_remove`,
58
- title: 'Remove MySQL Database',
59
- description: 'Permanently delete a MySQL database from Dokploy. This action removes the database container, its data, and all associated configuration. Requires the MySQL database ID. This operation is destructive and cannot be undone.',
60
- schema: z.object({ mysqlId: myId }).strict(),
61
- endpoint: `${DB}.remove`,
62
- annotations: { destructiveHint: true },
63
- });
64
- const move = postTool({
65
- name: `dokploy_${DB}_move`,
66
- title: 'Move MySQL Database',
67
- description: 'Move a MySQL database from its current project to a different project within Dokploy. Requires the MySQL database ID and the destination project ID. The database configuration and data are preserved during the move.',
68
- schema: z
69
- .object({
70
- mysqlId: myId,
71
- targetProjectId: z.string().min(1).describe('Destination project ID'),
72
- })
73
- .strict(),
74
- endpoint: `${DB}.move`,
75
- });
76
- const deploy = postTool({
77
- name: `dokploy_${DB}_deploy`,
78
- title: 'Deploy MySQL Database',
79
- description: 'Deploy a MySQL database container in Dokploy. Triggers the build and start process for the specified database. Requires the MySQL database ID. Returns the deployment status.',
80
- schema: z.object({ mysqlId: myId }).strict(),
81
- endpoint: `${DB}.deploy`,
82
- });
83
- const start = postTool({
84
- name: `dokploy_${DB}_start`,
85
- title: 'Start MySQL Database',
86
- description: 'Start a previously stopped MySQL database container in Dokploy. The database must already be deployed. Requires the MySQL database ID. Returns the updated status after starting.',
87
- schema: z.object({ mysqlId: myId }).strict(),
88
- endpoint: `${DB}.start`,
89
- });
90
- const stop = postTool({
91
- name: `dokploy_${DB}_stop`,
92
- title: 'Stop MySQL Database',
93
- description: 'Stop a running MySQL database container in Dokploy. The database data is preserved but the container will no longer accept connections. Requires the MySQL database ID. This is a destructive action as it interrupts active connections.',
94
- schema: z.object({ mysqlId: myId }).strict(),
95
- endpoint: `${DB}.stop`,
96
- annotations: { destructiveHint: true },
97
- });
98
- const reload = postTool({
99
- name: `dokploy_${DB}_reload`,
100
- title: 'Reload MySQL Database',
101
- description: 'Reload the MySQL database container in Dokploy without a full restart. Applies configuration changes that do not require a rebuild. Requires the MySQL database ID and the app-level identifier. Returns the reload status.',
102
- schema: z
103
- .object({
104
- mysqlId: myId,
105
- appName: z.string().min(1).describe('App-level identifier'),
106
- })
107
- .strict(),
108
- endpoint: `${DB}.reload`,
109
- });
110
- const rebuild = postTool({
111
- name: `dokploy_${DB}_rebuild`,
112
- title: 'Rebuild MySQL Database',
113
- description: 'Rebuild the MySQL database container from scratch in Dokploy. This tears down the existing container and recreates it with the current configuration. Requires the MySQL database ID. Useful after changing the Docker image or when the container is in a broken state.',
114
- schema: z.object({ mysqlId: myId }).strict(),
115
- endpoint: `${DB}.rebuild`,
116
- });
117
- const changeStatus = postTool({
118
- name: `dokploy_${DB}_change_status`,
119
- title: 'Change MySQL Status',
120
- description: 'Manually set the application status of a MySQL database in Dokploy. Accepts one of: idle, running, done, or error. Requires the MySQL database ID and the new status value. Useful for correcting a stale or incorrect status.',
121
- schema: z
122
- .object({
123
- mysqlId: myId,
124
- applicationStatus: z
125
- .enum(['idle', 'running', 'done', 'error'])
126
- .describe('New application status'),
127
- })
128
- .strict(),
129
- endpoint: `${DB}.changeStatus`,
130
- });
131
- const saveExternalPort = postTool({
132
- name: `dokploy_${DB}_save_external_port`,
133
- title: 'Save MySQL External Port',
134
- description: 'Set or clear the external port mapping for a MySQL database in Dokploy. When set, the database is accessible from outside the Docker network on the specified port. Pass null to remove the external port. Requires the MySQL database ID.',
135
- schema: z
136
- .object({
137
- mysqlId: myId,
138
- externalPort: z.number().nullable().describe('External port number (null to remove)'),
139
- })
140
- .strict(),
141
- endpoint: `${DB}.saveExternalPort`,
142
- });
143
- const saveEnvironment = postTool({
144
- name: `dokploy_${DB}_save_environment`,
145
- title: 'Save MySQL Environment',
146
- description: 'Overwrite the environment variables for a MySQL database in Dokploy. Replaces all existing environment variables with the provided value. Pass the variables as a single string (one per line, KEY=VALUE format). Requires the MySQL database ID.',
147
- schema: z
148
- .object({
149
- mysqlId: myId,
150
- env: z.string().nullable().optional().describe('Environment variables as a string'),
151
- })
152
- .strict(),
153
- endpoint: `${DB}.saveEnvironment`,
13
+ }),
154
14
  });
155
- // ── export ───────────────────────────────────────────────────────────
156
- export const mysqlTools = [
157
- one,
158
- create,
159
- update,
160
- remove,
161
- move,
162
- deploy,
163
- start,
164
- stop,
165
- reload,
166
- rebuild,
167
- changeStatus,
168
- saveExternalPort,
169
- saveEnvironment,
170
- ];
@@ -1,2 +1 @@
1
- import { type ToolDefinition } from './_factory.js';
2
- export declare const postgresTools: ToolDefinition[];
1
+ export declare const postgresTools: import("./_factory.js").ToolDefinition[];
@@ -1,169 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { getTool, postTool } from './_factory.js';
3
- // ── helpers ──────────────────────────────────────────────────────────
4
- const pgId = z.string().min(1).describe('Unique Postgres database ID');
5
- const DB = 'postgres';
6
- // ── tools ────────────────────────────────────────────────────────────
7
- const one = getTool({
8
- name: `dokploy_${DB}_one`,
9
- title: 'Get Postgres Details',
10
- description: 'Retrieve detailed information about a specific Postgres database managed by Dokploy. Returns the full configuration including connection settings, resource limits, environment variables, and current status. Requires the unique Postgres database ID.',
11
- schema: z.object({ postgresId: pgId }).strict(),
12
- endpoint: `${DB}.one`,
13
- });
14
- const create = postTool({
15
- name: `dokploy_${DB}_create`,
16
- title: 'Create Postgres Database',
17
- description: 'Create a new Postgres database instance inside a Dokploy project. Requires a display name, app-level identifier, database name, user credentials, and the target project ID. Optionally specify a Docker image, description, or remote server. Returns the newly created database record.',
18
- schema: z
19
- .object({
20
- name: z.string().min(1).describe('Display name for the database'),
21
- appName: z.string().min(1).describe('Unique app-level identifier'),
2
+ import { createDatabaseTools } from './_database.js';
3
+ export const postgresTools = createDatabaseTools({
4
+ type: 'postgres',
5
+ idField: 'postgresId',
6
+ displayName: 'Postgres',
7
+ defaultImage: 'postgres:15',
8
+ createFields: z.object({
22
9
  databaseName: z.string().min(1).describe('Name of the database to create'),
23
10
  databaseUser: z.string().min(1).describe('Database user'),
24
11
  databasePassword: z.string().min(1).describe('Database password'),
25
- projectId: z.string().min(1).describe('Project ID to create the database in'),
26
- dockerImage: z.string().optional().describe('Docker image (default: postgres:15)'),
27
- description: z.string().nullable().optional().describe('Optional description'),
28
- serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
29
- })
30
- .strict(),
31
- endpoint: `${DB}.create`,
32
- });
33
- const update = postTool({
34
- name: `dokploy_${DB}_update`,
35
- title: 'Update Postgres Database',
36
- description: 'Update the configuration of an existing Postgres database in Dokploy. Supports modifying the display name, Docker image, resource limits (CPU and memory), custom start command, environment variables, and external port. Requires the Postgres database ID. Only the provided fields are updated.',
37
- schema: z
38
- .object({
39
- postgresId: pgId,
40
- name: z.string().min(1).optional().describe('Display name'),
41
- appName: z.string().min(1).optional().describe('App-level identifier'),
42
- description: z.string().nullable().optional().describe('Description'),
43
- dockerImage: z.string().optional().describe('Docker image'),
44
- memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
45
- memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
46
- cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
47
- cpuLimit: z.number().nullable().optional().describe('CPU limit'),
48
- command: z.string().nullable().optional().describe('Custom start command'),
49
- env: z.string().nullable().optional().describe('Environment variables'),
50
- externalPort: z.number().nullable().optional().describe('External port'),
51
- })
52
- .strict(),
53
- endpoint: `${DB}.update`,
54
- });
55
- const remove = postTool({
56
- name: `dokploy_${DB}_remove`,
57
- title: 'Remove Postgres Database',
58
- description: 'Permanently delete a Postgres database from Dokploy. This action removes the database container, its data, and all associated configuration. Requires the Postgres database ID. This operation is destructive and cannot be undone.',
59
- schema: z.object({ postgresId: pgId }).strict(),
60
- endpoint: `${DB}.remove`,
61
- annotations: { destructiveHint: true },
62
- });
63
- const move = postTool({
64
- name: `dokploy_${DB}_move`,
65
- title: 'Move Postgres Database',
66
- description: 'Move a Postgres database from its current project to a different project within Dokploy. Requires the Postgres database ID and the destination project ID. The database configuration and data are preserved during the move.',
67
- schema: z
68
- .object({
69
- postgresId: pgId,
70
- targetProjectId: z.string().min(1).describe('Destination project ID'),
71
- })
72
- .strict(),
73
- endpoint: `${DB}.move`,
74
- });
75
- const deploy = postTool({
76
- name: `dokploy_${DB}_deploy`,
77
- title: 'Deploy Postgres Database',
78
- description: 'Deploy a Postgres database container in Dokploy. Triggers the build and start process for the specified database. Requires the Postgres database ID. Returns the deployment status.',
79
- schema: z.object({ postgresId: pgId }).strict(),
80
- endpoint: `${DB}.deploy`,
81
- });
82
- const start = postTool({
83
- name: `dokploy_${DB}_start`,
84
- title: 'Start Postgres Database',
85
- description: 'Start a previously stopped Postgres database container in Dokploy. The database must already be deployed. Requires the Postgres database ID. Returns the updated status after starting.',
86
- schema: z.object({ postgresId: pgId }).strict(),
87
- endpoint: `${DB}.start`,
88
- });
89
- const stop = postTool({
90
- name: `dokploy_${DB}_stop`,
91
- title: 'Stop Postgres Database',
92
- description: 'Stop a running Postgres database container in Dokploy. The database data is preserved but the container will no longer accept connections. Requires the Postgres database ID. This is a destructive action as it interrupts active connections.',
93
- schema: z.object({ postgresId: pgId }).strict(),
94
- endpoint: `${DB}.stop`,
95
- annotations: { destructiveHint: true },
96
- });
97
- const reload = postTool({
98
- name: `dokploy_${DB}_reload`,
99
- title: 'Reload Postgres Database',
100
- description: 'Reload the Postgres database container in Dokploy without a full restart. Applies configuration changes that do not require a rebuild. Requires the Postgres database ID and the app-level identifier. Returns the reload status.',
101
- schema: z
102
- .object({
103
- postgresId: pgId,
104
- appName: z.string().min(1).describe('App-level identifier'),
105
- })
106
- .strict(),
107
- endpoint: `${DB}.reload`,
108
- });
109
- const rebuild = postTool({
110
- name: `dokploy_${DB}_rebuild`,
111
- title: 'Rebuild Postgres Database',
112
- description: 'Rebuild the Postgres database container from scratch in Dokploy. This tears down the existing container and recreates it with the current configuration. Requires the Postgres database ID. Useful after changing the Docker image or when the container is in a broken state.',
113
- schema: z.object({ postgresId: pgId }).strict(),
114
- endpoint: `${DB}.rebuild`,
115
- });
116
- const changeStatus = postTool({
117
- name: `dokploy_${DB}_change_status`,
118
- title: 'Change Postgres Status',
119
- description: 'Manually set the application status of a Postgres database in Dokploy. Accepts one of: idle, running, done, or error. Requires the Postgres database ID and the new status value. Useful for correcting a stale or incorrect status.',
120
- schema: z
121
- .object({
122
- postgresId: pgId,
123
- applicationStatus: z
124
- .enum(['idle', 'running', 'done', 'error'])
125
- .describe('New application status'),
126
- })
127
- .strict(),
128
- endpoint: `${DB}.changeStatus`,
129
- });
130
- const saveExternalPort = postTool({
131
- name: `dokploy_${DB}_save_external_port`,
132
- title: 'Save Postgres External Port',
133
- description: 'Set or clear the external port mapping for a Postgres database in Dokploy. When set, the database is accessible from outside the Docker network on the specified port. Pass null to remove the external port. Requires the Postgres database ID.',
134
- schema: z
135
- .object({
136
- postgresId: pgId,
137
- externalPort: z.number().nullable().describe('External port number (null to remove)'),
138
- })
139
- .strict(),
140
- endpoint: `${DB}.saveExternalPort`,
141
- });
142
- const saveEnvironment = postTool({
143
- name: `dokploy_${DB}_save_environment`,
144
- title: 'Save Postgres Environment',
145
- description: 'Overwrite the environment variables for a Postgres database in Dokploy. Replaces all existing environment variables with the provided value. Pass the variables as a single string (one per line, KEY=VALUE format). Requires the Postgres database ID.',
146
- schema: z
147
- .object({
148
- postgresId: pgId,
149
- env: z.string().nullable().optional().describe('Environment variables as a string'),
150
- })
151
- .strict(),
152
- endpoint: `${DB}.saveEnvironment`,
12
+ }),
153
13
  });
154
- // ── export ───────────────────────────────────────────────────────────
155
- export const postgresTools = [
156
- one,
157
- create,
158
- update,
159
- remove,
160
- move,
161
- deploy,
162
- start,
163
- stop,
164
- reload,
165
- rebuild,
166
- changeStatus,
167
- saveExternalPort,
168
- saveEnvironment,
169
- ];
@@ -1,2 +1 @@
1
- import { type ToolDefinition } from './_factory.js';
2
- export declare const redisTools: ToolDefinition[];
1
+ export declare const redisTools: import("./_factory.js").ToolDefinition[];