@procedures/docker 0.0.0-stage → 0.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +752 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/index.d.ts +35 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +35 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/module.d.ts +16 -0
  10. package/dist/module.d.ts.map +1 -0
  11. package/dist/module.js +183 -0
  12. package/dist/module.js.map +1 -0
  13. package/dist/procedures/docker/build.d.ts +12 -0
  14. package/dist/procedures/docker/build.d.ts.map +1 -0
  15. package/dist/procedures/docker/build.js +34 -0
  16. package/dist/procedures/docker/build.js.map +1 -0
  17. package/dist/procedures/docker/down.d.ts +12 -0
  18. package/dist/procedures/docker/down.d.ts.map +1 -0
  19. package/dist/procedures/docker/down.js +25 -0
  20. package/dist/procedures/docker/down.js.map +1 -0
  21. package/dist/procedures/docker/exec.d.ts +12 -0
  22. package/dist/procedures/docker/exec.d.ts.map +1 -0
  23. package/dist/procedures/docker/exec.js +30 -0
  24. package/dist/procedures/docker/exec.js.map +1 -0
  25. package/dist/procedures/docker/index.d.ts +11 -0
  26. package/dist/procedures/docker/index.d.ts.map +1 -0
  27. package/dist/procedures/docker/index.js +11 -0
  28. package/dist/procedures/docker/index.js.map +1 -0
  29. package/dist/procedures/docker/logs.d.ts +16 -0
  30. package/dist/procedures/docker/logs.d.ts.map +1 -0
  31. package/dist/procedures/docker/logs.js +40 -0
  32. package/dist/procedures/docker/logs.js.map +1 -0
  33. package/dist/procedures/docker/ps.d.ts +12 -0
  34. package/dist/procedures/docker/ps.d.ts.map +1 -0
  35. package/dist/procedures/docker/ps.js +22 -0
  36. package/dist/procedures/docker/ps.js.map +1 -0
  37. package/dist/procedures/docker/pull.d.ts +12 -0
  38. package/dist/procedures/docker/pull.d.ts.map +1 -0
  39. package/dist/procedures/docker/pull.js +17 -0
  40. package/dist/procedures/docker/pull.js.map +1 -0
  41. package/dist/procedures/docker/rm.d.ts +12 -0
  42. package/dist/procedures/docker/rm.d.ts.map +1 -0
  43. package/dist/procedures/docker/rm.js +21 -0
  44. package/dist/procedures/docker/rm.js.map +1 -0
  45. package/dist/procedures/docker/run.d.ts +21 -0
  46. package/dist/procedures/docker/run.d.ts.map +1 -0
  47. package/dist/procedures/docker/run.js +56 -0
  48. package/dist/procedures/docker/run.js.map +1 -0
  49. package/dist/procedures/docker/shared.d.ts +23 -0
  50. package/dist/procedures/docker/shared.d.ts.map +1 -0
  51. package/dist/procedures/docker/shared.js +51 -0
  52. package/dist/procedures/docker/shared.js.map +1 -0
  53. package/dist/procedures/docker/stop.d.ts +12 -0
  54. package/dist/procedures/docker/stop.d.ts.map +1 -0
  55. package/dist/procedures/docker/stop.js +20 -0
  56. package/dist/procedures/docker/stop.js.map +1 -0
  57. package/dist/procedures/docker/up.d.ts +12 -0
  58. package/dist/procedures/docker/up.d.ts.map +1 -0
  59. package/dist/procedures/docker/up.js +28 -0
  60. package/dist/procedures/docker/up.js.map +1 -0
  61. package/dist/register.d.ts +9 -0
  62. package/dist/register.d.ts.map +1 -0
  63. package/dist/register.js +16 -0
  64. package/dist/register.js.map +1 -0
  65. package/dist/types.d.ts +130 -0
  66. package/dist/types.d.ts.map +1 -0
  67. package/dist/types.js +207 -0
  68. package/dist/types.js.map +1 -0
  69. package/package.json +81 -3
  70. package/src/index.ts +75 -0
  71. package/src/module.ts +237 -0
  72. package/src/procedures/docker/build.ts +46 -0
  73. package/src/procedures/docker/down.ts +31 -0
  74. package/src/procedures/docker/exec.ts +37 -0
  75. package/src/procedures/docker/index.ts +10 -0
  76. package/src/procedures/docker/logs.ts +52 -0
  77. package/src/procedures/docker/ps.ts +27 -0
  78. package/src/procedures/docker/pull.ts +23 -0
  79. package/src/procedures/docker/rm.ts +28 -0
  80. package/src/procedures/docker/run.ts +65 -0
  81. package/src/procedures/docker/shared.ts +62 -0
  82. package/src/procedures/docker/stop.ts +29 -0
  83. package/src/procedures/docker/up.ts +35 -0
  84. package/src/register.ts +20 -0
  85. package/src/types.ts +351 -0
@@ -0,0 +1,65 @@
1
+ /**
2
+ * docker.run procedure
3
+ *
4
+ * Run a Docker container.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker, words } from "./shared.js";
9
+ import type { DockerRunInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Run a Docker container
13
+ *
14
+ * @example
15
+ * // Run nginx in detached mode
16
+ * await client.call(["docker", "run"], {
17
+ * image: "nginx:latest",
18
+ * name: "my-nginx",
19
+ * ports: ["8080:80"],
20
+ * detach: true,
21
+ * });
22
+ */
23
+ export async function dockerRun(
24
+ input: DockerRunInput,
25
+ ctx: ProcedureContext
26
+ ): Promise<DockerCommandOutput> {
27
+ {
28
+ const args: string[] = ["run"];
29
+
30
+ // Add flags
31
+ if (input.detach) args.push("-d");
32
+ if (input.rm) args.push("--rm");
33
+ if (input.name) args.push("--name", input.name);
34
+
35
+ // Add port mappings
36
+ if (input.ports) {
37
+ for (const port of input.ports) {
38
+ args.push("-p", port);
39
+ }
40
+ }
41
+
42
+ // Add volume mappings
43
+ if (input.volumes) {
44
+ for (const volume of input.volumes) {
45
+ args.push("-v", volume);
46
+ }
47
+ }
48
+
49
+ // Add environment variables
50
+ if (input.env) {
51
+ for (const [key, value] of Object.entries(input.env)) {
52
+ args.push("-e", `${key}=${value}`);
53
+ }
54
+ }
55
+
56
+ // Add image
57
+ args.push(dockerArg("image", input.image));
58
+
59
+ // Add command if specified
60
+ if (input.command) {
61
+ args.push(...words(input.command));
62
+ }
63
+ return runDocker(args, input, ctx);
64
+ }
65
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The way every docker procedure runs docker: an argument list through `shell.run`, no shell.
3
+ *
4
+ * Before, each procedure joined its arguments into one string for `shell.exec`, which runs a
5
+ * shell, so a value such as `x & calc` ran a second command. `docker.*` is an MCP tool, and
6
+ * the deep dive ran an injected command through `docker.ps` and through `client.chain`
7
+ * (documentation/deep-dive-2026-10/wrappers.md, WRP-1).
8
+ */
9
+
10
+ import type { ProcedureContext } from "@procedures/client";
11
+ import type { DockerCommandOutput } from "../../types.js";
12
+
13
+ /**
14
+ * A value that docker reads as an argument (an image, a container, a path, a service). It must
15
+ * not start with "-", or docker reads it as an option (for example `--privileged`).
16
+ */
17
+ export function dockerArg(name: string, value: string): string {
18
+ if (value.startsWith("-")) {
19
+ throw new Error(`Invalid ${name} (starts with "-"): ${value}`);
20
+ }
21
+ return value;
22
+ }
23
+
24
+ /** The words of a command string, split at whitespace. No shell runs it, so there is no quoting. */
25
+ export function words(command: string): string[] {
26
+ return command.trim().split(/\s+/).filter((word) => word.length > 0);
27
+ }
28
+
29
+ /** This function runs `docker <args>` and gives its result. It does not throw. */
30
+ export async function runDocker(
31
+ args: string[],
32
+ input: { cwd?: string | undefined; timeout?: number | undefined },
33
+ ctx: ProcedureContext
34
+ ): Promise<DockerCommandOutput> {
35
+ const startTime = Date.now();
36
+ try {
37
+ const shellInput: { command: string; args: string[]; cwd?: string; timeout?: number } = { command: "docker", args };
38
+ if (input.cwd !== undefined) shellInput.cwd = input.cwd;
39
+ if (input.timeout !== undefined) shellInput.timeout = input.timeout;
40
+
41
+ const result = await ctx.client.call<
42
+ typeof shellInput,
43
+ { exitCode: number; stdout: string; stderr: string }
44
+ >(["shell", "run"], shellInput);
45
+
46
+ return {
47
+ exitCode: result.exitCode,
48
+ stdout: result.stdout,
49
+ stderr: result.stderr,
50
+ success: result.exitCode === 0,
51
+ duration: Date.now() - startTime,
52
+ };
53
+ } catch (error) {
54
+ return {
55
+ exitCode: 1,
56
+ stdout: "",
57
+ stderr: error instanceof Error ? error.message : String(error),
58
+ success: false,
59
+ duration: Date.now() - startTime,
60
+ };
61
+ }
62
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * docker.stop procedure
3
+ *
4
+ * Stop running container(s).
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker } from "./shared.js";
9
+ import type { DockerStopInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Stop container(s)
13
+ */
14
+ export async function dockerStop(
15
+ input: DockerStopInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["stop"];
20
+
21
+ if (input.time !== undefined) {
22
+ args.push("-t", String(input.time));
23
+ }
24
+
25
+ args.push(...input.containers.map((c) => dockerArg("container", c)));
26
+
27
+ return runDocker(args, input, ctx);
28
+ }
29
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * docker.compose.up procedure
3
+ *
4
+ * Start services with docker compose.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker } from "./shared.js";
9
+ import type { DockerComposeUpInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Start services with docker compose
13
+ */
14
+ export async function dockerComposeUp(
15
+ input: DockerComposeUpInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["compose"];
20
+
21
+ if (input.file) args.push("-f", input.file);
22
+
23
+ args.push("up");
24
+
25
+ if (input.detach) args.push("-d");
26
+ if (input.build) args.push("--build");
27
+ if (input.forceRecreate) args.push("--force-recreate");
28
+
29
+ if (input.services && input.services.length > 0) {
30
+ args.push(...input.services.map((s) => dockerArg("service", s)));
31
+ }
32
+
33
+ return runDocker(args, input, ctx);
34
+ }
35
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Importing this file registers the procedures of @procedures/docker in the global registry
3
+ * (DECISIONS-2026-10, "Every package root registers its procedures"). The procedures as data
4
+ * are in `module.ts`, which registers nothing: a host with its own registry uses that one.
5
+ */
6
+
7
+ // Import shell dependency to ensure shell.exec is registered
8
+ import "@procedures/shell";
9
+
10
+ import { registerProcedures } from "@procedures/client";
11
+ import { dockerModule } from "./module.js";
12
+
13
+ export * from "./module.js";
14
+
15
+ export function registerDockerProcedures(): void {
16
+ registerProcedures(dockerModule.procedures);
17
+ }
18
+
19
+ // Auto-register when this module is loaded
20
+ registerDockerProcedures();
package/src/types.ts ADDED
@@ -0,0 +1,351 @@
1
+ /**
2
+ * Type definitions for client-docker procedures
3
+ *
4
+ * client-docker wraps Docker CLI commands as procedures using client-shell.
5
+ */
6
+
7
+ import { z } from "zod";
8
+
9
+ // =============================================================================
10
+ // Shared Output Type
11
+ // =============================================================================
12
+
13
+ export interface DockerCommandOutput {
14
+ /** Exit code of the command */
15
+ exitCode: number;
16
+ /** Standard output */
17
+ stdout: string;
18
+ /** Standard error */
19
+ stderr: string;
20
+ /** Whether command succeeded (exit code 0) */
21
+ success: boolean;
22
+ /** Duration in milliseconds */
23
+ duration: number;
24
+ }
25
+
26
+ /** One item of a followed log: a line of the container, or the end of `docker logs` (the last item). */
27
+ export type DockerLogItem =
28
+ | { type: "stdout" | "stderr"; line: string }
29
+ | {
30
+ type: "exit";
31
+ exitCode: number;
32
+ duration: number;
33
+ signal?: string | undefined;
34
+ timedOut?: boolean | undefined;
35
+ aborted?: boolean | undefined;
36
+ };
37
+
38
+ // Output schemas (roadmap 2.1). Loose objects: a field that a schema does not name stays in the
39
+ // result (a strict schema would remove it when the output is validated).
40
+
41
+ /** The result of a docker command: every docker.* procedure gives it. */
42
+ export const DockerCommandOutputSchema: z.ZodType<DockerCommandOutput> = z.looseObject({
43
+ exitCode: z.number().describe("The exit code of docker (0 is success)"),
44
+ stdout: z.string().describe("The standard output of docker"),
45
+ stderr: z.string().describe("The standard error of docker, or the error message when docker did not start"),
46
+ success: z.boolean().describe("True when the exit code is 0"),
47
+ duration: z.number().describe("The time of the command, in milliseconds"),
48
+ });
49
+
50
+ /** docker.logs: one result, or with follow a stream of lines and one last exit item. */
51
+ export const DockerLogsOutputSchema: z.ZodType<DockerCommandOutput | DockerLogItem> = z.union([
52
+ DockerCommandOutputSchema,
53
+ z.looseObject({
54
+ type: z.enum(["stdout", "stderr"]).describe("The stream of the line"),
55
+ line: z.string().describe("One line of the log, without its line end"),
56
+ }),
57
+ z.looseObject({
58
+ type: z.literal("exit").describe("The end of the stream"),
59
+ exitCode: z.number().describe("The exit code of docker logs"),
60
+ duration: z.number().describe("The time of the stream, in milliseconds"),
61
+ signal: z.string().optional().describe("The signal that ended docker logs"),
62
+ timedOut: z.boolean().optional().describe("True when the timeout ended the stream"),
63
+ aborted: z.boolean().optional().describe("True when the reader or the signal ended the stream"),
64
+ }),
65
+ ]);
66
+
67
+ // =============================================================================
68
+ // docker.run Types
69
+ // =============================================================================
70
+
71
+ export const DockerRunInputSchema: z.ZodObject<{
72
+ image: z.ZodString;
73
+ name: z.ZodOptional<z.ZodString>;
74
+ ports: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
+ volumes: z.ZodOptional<z.ZodArray<z.ZodString>>;
76
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
77
+ detach: z.ZodOptional<z.ZodBoolean>;
78
+ rm: z.ZodOptional<z.ZodBoolean>;
79
+ command: z.ZodOptional<z.ZodString>;
80
+ cwd: z.ZodOptional<z.ZodString>;
81
+ timeout: z.ZodOptional<z.ZodNumber>;
82
+ }> = z.object({
83
+ /** Docker image to run */
84
+ image: z.string().describe("Docker image to run"),
85
+ /** Container name */
86
+ name: z.string().optional().describe("Container name"),
87
+ /** Port mappings (e.g., ["8080:80", "3000:3000"]) */
88
+ ports: z.array(z.string()).optional().describe("Port mappings (e.g., [\"8080:80\", \"3000:3000\"])"),
89
+ /** Volume mappings (e.g., ["/host:/container"]) */
90
+ volumes: z.array(z.string()).optional().describe("Volume mappings (e.g., [\"/host:/container\"])"),
91
+ /** Environment variables */
92
+ env: z.record(z.string(), z.string()).optional().describe("Environment variables"),
93
+ /** Run in detached mode */
94
+ detach: z.boolean().optional().describe("Run in detached mode"),
95
+ /** Automatically remove container when it exits */
96
+ rm: z.boolean().optional().describe("Automatically remove container when it exits"),
97
+ /** Command to run in container */
98
+ command: z.string().optional().describe("Command to run in container"),
99
+ /** Working directory */
100
+ cwd: z.string().optional().describe("Working directory"),
101
+ /** Timeout in milliseconds */
102
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
103
+ });
104
+
105
+ export type DockerRunInput = z.infer<typeof DockerRunInputSchema>;
106
+
107
+ // =============================================================================
108
+ // docker.build Types
109
+ // =============================================================================
110
+
111
+ export const DockerBuildInputSchema: z.ZodObject<{
112
+ context: z.ZodString;
113
+ tag: z.ZodString;
114
+ dockerfile: z.ZodOptional<z.ZodString>;
115
+ buildArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
116
+ noCache: z.ZodOptional<z.ZodBoolean>;
117
+ cwd: z.ZodOptional<z.ZodString>;
118
+ timeout: z.ZodOptional<z.ZodNumber>;
119
+ }> = z.object({
120
+ /** Build context path */
121
+ context: z.string().describe("Build context path"),
122
+ /** Image tag */
123
+ tag: z.string().describe("Image tag"),
124
+ /** Dockerfile path (relative to context) */
125
+ dockerfile: z.string().optional().describe("Dockerfile path (relative to context)"),
126
+ /** Build arguments */
127
+ buildArgs: z.record(z.string(), z.string()).optional().describe("Build arguments"),
128
+ /** Do not use cache when building */
129
+ noCache: z.boolean().optional().describe("Do not use cache when building"),
130
+ /** Working directory */
131
+ cwd: z.string().optional().describe("Working directory"),
132
+ /** Timeout in milliseconds */
133
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
134
+ });
135
+
136
+ export type DockerBuildInput = z.infer<typeof DockerBuildInputSchema>;
137
+
138
+ // =============================================================================
139
+ // docker.pull Types
140
+ // =============================================================================
141
+
142
+ export const DockerPullInputSchema: z.ZodObject<{
143
+ image: z.ZodString;
144
+ tag: z.ZodOptional<z.ZodString>;
145
+ cwd: z.ZodOptional<z.ZodString>;
146
+ timeout: z.ZodOptional<z.ZodNumber>;
147
+ }> = z.object({
148
+ /** Image to pull */
149
+ image: z.string().describe("Image to pull"),
150
+ /** Image tag (default: latest) */
151
+ tag: z.string().optional().describe("Image tag (default: latest)"),
152
+ /** Working directory */
153
+ cwd: z.string().optional().describe("Working directory"),
154
+ /** Timeout in milliseconds */
155
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
156
+ });
157
+
158
+ export type DockerPullInput = z.infer<typeof DockerPullInputSchema>;
159
+
160
+ // =============================================================================
161
+ // docker.exec Types
162
+ // =============================================================================
163
+
164
+ export const DockerExecInputSchema: z.ZodObject<{
165
+ container: z.ZodString;
166
+ command: z.ZodString;
167
+ interactive: z.ZodOptional<z.ZodBoolean>;
168
+ tty: z.ZodOptional<z.ZodBoolean>;
169
+ workdir: z.ZodOptional<z.ZodString>;
170
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
171
+ cwd: z.ZodOptional<z.ZodString>;
172
+ timeout: z.ZodOptional<z.ZodNumber>;
173
+ }> = z.object({
174
+ /** Container name or ID */
175
+ container: z.string().describe("Container name or ID"),
176
+ /** Command to execute */
177
+ command: z.string().describe("Command to execute"),
178
+ /** Run interactively */
179
+ interactive: z.boolean().optional().describe("Run interactively"),
180
+ /** Allocate a TTY */
181
+ tty: z.boolean().optional().describe("Allocate a TTY"),
182
+ /** Working directory inside container */
183
+ workdir: z.string().optional().describe("Working directory inside container"),
184
+ /** Environment variables */
185
+ env: z.record(z.string(), z.string()).optional().describe("Environment variables"),
186
+ /** Working directory (host) */
187
+ cwd: z.string().optional().describe("Working directory (host)"),
188
+ /** Timeout in milliseconds */
189
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
190
+ });
191
+
192
+ export type DockerExecInput = z.infer<typeof DockerExecInputSchema>;
193
+
194
+ // =============================================================================
195
+ // docker.stop Types
196
+ // =============================================================================
197
+
198
+ export const DockerStopInputSchema: z.ZodObject<{
199
+ containers: z.ZodArray<z.ZodString>;
200
+ time: z.ZodOptional<z.ZodNumber>;
201
+ cwd: z.ZodOptional<z.ZodString>;
202
+ timeout: z.ZodOptional<z.ZodNumber>;
203
+ }> = z.object({
204
+ /** Container name(s) or ID(s) */
205
+ containers: z.array(z.string()).describe("Container name(s) or ID(s)"),
206
+ /** Seconds to wait before killing */
207
+ time: z.number().optional().describe("Seconds to wait before killing"),
208
+ /** Working directory */
209
+ cwd: z.string().optional().describe("Working directory"),
210
+ /** Timeout in milliseconds */
211
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
212
+ });
213
+
214
+ export type DockerStopInput = z.infer<typeof DockerStopInputSchema>;
215
+
216
+ // =============================================================================
217
+ // docker.rm Types
218
+ // =============================================================================
219
+
220
+ export const DockerRmInputSchema: z.ZodObject<{
221
+ containers: z.ZodArray<z.ZodString>;
222
+ force: z.ZodOptional<z.ZodBoolean>;
223
+ volumes: z.ZodOptional<z.ZodBoolean>;
224
+ cwd: z.ZodOptional<z.ZodString>;
225
+ timeout: z.ZodOptional<z.ZodNumber>;
226
+ }> = z.object({
227
+ /** Container name(s) or ID(s) */
228
+ containers: z.array(z.string()).describe("Container name(s) or ID(s)"),
229
+ /** Force removal */
230
+ force: z.boolean().optional().describe("Force removal"),
231
+ /** Remove volumes */
232
+ volumes: z.boolean().optional().describe("Remove volumes"),
233
+ /** Working directory */
234
+ cwd: z.string().optional().describe("Working directory"),
235
+ /** Timeout in milliseconds */
236
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
237
+ });
238
+
239
+ export type DockerRmInput = z.infer<typeof DockerRmInputSchema>;
240
+
241
+ // =============================================================================
242
+ // docker.ps Types
243
+ // =============================================================================
244
+
245
+ export const DockerPsInputSchema: z.ZodObject<{
246
+ all: z.ZodOptional<z.ZodBoolean>;
247
+ filter: z.ZodOptional<z.ZodString>;
248
+ format: z.ZodOptional<z.ZodString>;
249
+ cwd: z.ZodOptional<z.ZodString>;
250
+ timeout: z.ZodOptional<z.ZodNumber>;
251
+ }> = z.object({
252
+ /** Show all containers (default shows just running) */
253
+ all: z.boolean().optional().describe("Show all containers (default shows just running)"),
254
+ /** Filter containers */
255
+ filter: z.string().optional().describe("Filter containers"),
256
+ /** Format output */
257
+ format: z.string().optional().describe("Format output"),
258
+ /** Working directory */
259
+ cwd: z.string().optional().describe("Working directory"),
260
+ /** Timeout in milliseconds */
261
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
262
+ });
263
+
264
+ export type DockerPsInput = z.infer<typeof DockerPsInputSchema>;
265
+
266
+ // =============================================================================
267
+ // docker.logs Types
268
+ // =============================================================================
269
+
270
+ export const DockerLogsInputSchema: z.ZodObject<{
271
+ container: z.ZodString;
272
+ follow: z.ZodOptional<z.ZodBoolean>;
273
+ tail: z.ZodOptional<z.ZodNumber>;
274
+ timestamps: z.ZodOptional<z.ZodBoolean>;
275
+ cwd: z.ZodOptional<z.ZodString>;
276
+ timeout: z.ZodOptional<z.ZodNumber>;
277
+ }> = z.object({
278
+ /** Container name or ID */
279
+ container: z.string().describe("Container name or ID"),
280
+ /** Follow log output */
281
+ follow: z.boolean().optional().describe("Follow log output"),
282
+ /** Number of lines from end */
283
+ tail: z.number().optional().describe("Number of lines from end"),
284
+ /** Show timestamps */
285
+ timestamps: z.boolean().optional().describe("Show timestamps"),
286
+ /** Working directory */
287
+ cwd: z.string().optional().describe("Working directory"),
288
+ /** Timeout in milliseconds */
289
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
290
+ });
291
+
292
+ export type DockerLogsInput = z.infer<typeof DockerLogsInputSchema>;
293
+
294
+ // =============================================================================
295
+ // docker.compose.up Types
296
+ // =============================================================================
297
+
298
+ export const DockerComposeUpInputSchema: z.ZodObject<{
299
+ file: z.ZodOptional<z.ZodString>;
300
+ services: z.ZodOptional<z.ZodArray<z.ZodString>>;
301
+ detach: z.ZodOptional<z.ZodBoolean>;
302
+ build: z.ZodOptional<z.ZodBoolean>;
303
+ forceRecreate: z.ZodOptional<z.ZodBoolean>;
304
+ cwd: z.ZodOptional<z.ZodString>;
305
+ timeout: z.ZodOptional<z.ZodNumber>;
306
+ }> = z.object({
307
+ /** Compose file path */
308
+ file: z.string().optional().describe("Compose file path"),
309
+ /** Services to start (default: all) */
310
+ services: z.array(z.string()).optional().describe("Services to start (default: all)"),
311
+ /** Detached mode */
312
+ detach: z.boolean().optional().describe("Detached mode"),
313
+ /** Build images before starting */
314
+ build: z.boolean().optional().describe("Build images before starting"),
315
+ /** Force recreate containers */
316
+ forceRecreate: z.boolean().optional().describe("Force recreate containers"),
317
+ /** Working directory */
318
+ cwd: z.string().optional().describe("Working directory"),
319
+ /** Timeout in milliseconds */
320
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
321
+ });
322
+
323
+ export type DockerComposeUpInput = z.infer<typeof DockerComposeUpInputSchema>;
324
+
325
+ // =============================================================================
326
+ // docker.compose.down Types
327
+ // =============================================================================
328
+
329
+ export const DockerComposeDownInputSchema: z.ZodObject<{
330
+ file: z.ZodOptional<z.ZodString>;
331
+ volumes: z.ZodOptional<z.ZodBoolean>;
332
+ removeOrphans: z.ZodOptional<z.ZodBoolean>;
333
+ rmi: z.ZodOptional<z.ZodEnum<{ all: "all"; local: "local" }>>;
334
+ cwd: z.ZodOptional<z.ZodString>;
335
+ timeout: z.ZodOptional<z.ZodNumber>;
336
+ }> = z.object({
337
+ /** Compose file path */
338
+ file: z.string().optional().describe("Compose file path"),
339
+ /** Remove volumes */
340
+ volumes: z.boolean().optional().describe("Remove volumes"),
341
+ /** Remove orphan containers */
342
+ removeOrphans: z.boolean().optional().describe("Remove orphan containers"),
343
+ /** Remove images (all, local) */
344
+ rmi: z.enum(["all", "local"]).optional().describe("Remove images (all, local)"),
345
+ /** Working directory */
346
+ cwd: z.string().optional().describe("Working directory"),
347
+ /** Timeout in milliseconds */
348
+ timeout: z.number().optional().describe("Timeout in milliseconds"),
349
+ });
350
+
351
+ export type DockerComposeDownInput = z.infer<typeof DockerComposeDownInputSchema>;