@procedures/cli-run 0.34.0 → 0.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Provides cli.run procedure for calling mark CLI commands via client-shell.
7
7
  */
8
- import { type ProcedureModule, type ProcedureRegistry } from "@procedures/client";
8
+ import { type ProcedureModule, type PackageDefinition } from "@procedures/client";
9
9
  /**
10
10
  * The module of this package, for `createRegistry()`: its procedures as data. Importing this
11
11
  * file registers nothing. (`register.ts` registers the same procedures in the global registry.)
@@ -17,5 +17,5 @@ export default cliModule;
17
17
  * a registry. The default is the global registry. Importing this file registers nothing: the
18
18
  * `./register` entry starts this function (ARCHITECTURE-PROPOSALS-2026-10, P9).
19
19
  */
20
- export declare function registerCliProcedures(registry?: ProcedureRegistry): void;
20
+ export declare const registerCliProcedures: PackageDefinition["register"];
21
21
  //# sourceMappingURL=module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAiC,KAAK,eAAe,EAAuC,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgCtJ;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eAEL,CAAC;eAEL,SAAS;AAExB;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,GAAE,iBAAsC,GAAG,IAAI,CAE5F"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAkC,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAoClH;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eAAmC,CAAC;eAE7C,SAAS;AAExB;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC,UAAU,CAAuB,CAAC"}
package/dist/module.js CHANGED
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Provides cli.run procedure for calling mark CLI commands via client-shell.
7
7
  */
8
- import { createProcedure, defineModule, PROCEDURE_REGISTRY, registerModules } from "@procedures/client";
8
+ import { definePackage, createProcedure } from "@procedures/client";
9
9
  import shellModule from "@procedures/shell/module";
10
10
  import { cliRun } from "./procedures/cli/index.js";
11
11
  import { CliRunInputSchema, CliRunOutputSchema } from "./types.js";
@@ -32,20 +32,19 @@ const cliRunProcedure = createProcedure()
32
32
  // =============================================================================
33
33
  // Registration
34
34
  // =============================================================================
35
+ const cliPackage = definePackage("@procedures/cli-run", [
36
+ cliRunProcedure,
37
+ ], [shellModule]);
35
38
  /**
36
39
  * The module of this package, for `createRegistry()`: its procedures as data. Importing this
37
40
  * file registers nothing. (`register.ts` registers the same procedures in the global registry.)
38
41
  */
39
- export const cliModule = defineModule("@procedures/cli-run", [
40
- cliRunProcedure,
41
- ], [shellModule]);
42
+ export const cliModule = cliPackage.module;
42
43
  export default cliModule;
43
44
  /**
44
45
  * This function registers the procedures of @procedures/cli-run, and of the modules that it requires, in
45
46
  * a registry. The default is the global registry. Importing this file registers nothing: the
46
47
  * `./register` entry starts this function (ARCHITECTURE-PROPOSALS-2026-10, P9).
47
48
  */
48
- export function registerCliProcedures(registry = PROCEDURE_REGISTRY) {
49
- registerModules(registry, [cliModule]);
50
- }
49
+ export const registerCliProcedures = cliPackage.register;
51
50
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAwB,kBAAkB,EAAE,eAAe,EAA0B,MAAM,oBAAoB,CAAC;AACtJ,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OA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src/procedures/cli/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwBhE;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,MAAM,EAAE,CAUhG;AA8CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,YAAY,CAAC,CAiBvB"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/procedures/cli/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwBhE;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,MAAM,EAAE,CAUhG;AAKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,YAAY,CAAC,CAMvB"}
@@ -8,6 +8,7 @@
8
8
  import { existsSync } from "node:fs";
9
9
  import { dirname, join } from "node:path";
10
10
  import { fileURLToPath } from "node:url";
11
+ import { defineCliTool, nodeScript } from "@procedures/shell/cli";
11
12
  /**
12
13
  * Find the mark CLI of the workspace that contains this package (packages/mark/dist/cli.js)
13
14
  */
@@ -51,30 +52,8 @@ export function buildMarkArgs(input) {
51
52
  }
52
53
  return args;
53
54
  }
54
- /**
55
- * Execute via shell (spawn node process)
56
- */
57
- async function shellExecution(input, ctx, startTime) {
58
- const args = buildMarkArgs(input);
59
- // Build shell input
60
- const shellInput = {
61
- command: process.execPath,
62
- args: [resolveMarkCli(), ...args],
63
- };
64
- if (input.cwd !== undefined)
65
- shellInput.cwd = input.cwd;
66
- if (input.timeout !== undefined)
67
- shellInput.timeout = input.timeout;
68
- // Call shell.run
69
- const result = await ctx.client.call(["shell", "run"], shellInput);
70
- return {
71
- exitCode: result.exitCode,
72
- stdout: result.stdout,
73
- stderr: result.stderr,
74
- success: result.exitCode === 0,
75
- duration: Date.now() - startTime,
76
- };
77
- }
55
+ /** The runner of mark: the mark CLI of the workspace, run with Node through `shell.run`. */
56
+ const mark = defineCliTool({ name: "mark", resolve: () => nodeScript(resolveMarkCli()) });
78
57
  /**
79
58
  * Run a mark CLI command
80
59
  *
@@ -95,21 +74,10 @@ async function shellExecution(input, ctx, startTime) {
95
74
  * });
96
75
  */
97
76
  export async function cliRun(input, ctx) {
98
- const startTime = Date.now();
99
- try {
100
- // Always through the mark CLI. Before, a second path sent the input straight to a running
101
- // CLI server, without mark's argument mapping, so the two paths gave different results
102
- // (a "dry run" wrote files), and it had its own copy of the lockfile logic (deep dive CLI-12).
103
- return await shellExecution(input, ctx, startTime);
104
- }
105
- catch (error) {
106
- return {
107
- exitCode: 1,
108
- stdout: "",
109
- stderr: error instanceof Error ? error.message : String(error),
110
- success: false,
111
- duration: Date.now() - startTime,
112
- };
113
- }
77
+ // Always through the mark CLI. Before, a second path sent the input straight to a running
78
+ // CLI server, without mark's argument mapping, so the two paths gave different results
79
+ // (a "dry run" wrote files), and it had its own copy of the lockfile logic (deep dive CLI-12).
80
+ // The runner does not throw: an error gives exit code 1 and its message.
81
+ return mark.run(buildMarkArgs(input), { cwd: input.cwd, timeout: input.timeout }, ctx);
114
82
  }
115
83
  //# sourceMappingURL=run.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","source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AAC,EAAE,CAAC,CAAC;AAE1F;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,KAAkB,EAClB,GAAqB;IAErB,0FAA0F;IAC1F,uFAAuF;IACvF,+FAA+F;IAC/F,yEAAyE;IACzE,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;AACzF,CAAC"}
package/dist/types.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  * client-cli wraps the mark CLI as procedures using client-shell.
5
5
  */
6
6
  import { z } from "zod";
7
+ import { type CliToolOutput } from "@procedures/shell/cli";
7
8
  export declare const CliRunInputSchema: z.ZodObject<{
8
9
  path: z.ZodArray<z.ZodString>;
9
10
  args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -12,17 +13,8 @@ export declare const CliRunInputSchema: z.ZodObject<{
12
13
  timeout: z.ZodOptional<z.ZodNumber>;
13
14
  }>;
14
15
  export type CliRunInput = z.infer<typeof CliRunInputSchema>;
15
- export interface CliRunOutput {
16
- /** Exit code of the command */
17
- exitCode: number;
18
- /** Standard output */
19
- stdout: string;
20
- /** Standard error */
21
- stderr: string;
22
- /** Whether command succeeded (exit code 0) */
23
- success: boolean;
24
- /** Duration in milliseconds */
25
- duration: number;
16
+ /** The result of cli.run: the shared result of a CLI tool (`@procedures/shell/cli`). */
17
+ export interface CliRunOutput extends CliToolOutput {
26
18
  }
27
19
  /** The output schema of cli.run (roadmap 2.1). Loose: a field that it does not name stays. */
28
20
  export declare const CliRunOutputSchema: z.ZodType<CliRunOutput>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAI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AC;AACxB,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMhF,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,SAAS,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7G,UAAU,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;CACrC,CAWC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,wFAAwF;AACxF,MAAM,WAAW,YAAa,SAAQ,aAAa;CAAG;AAEtD,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAA+B,CAAC"}
package/dist/types.js CHANGED
@@ -4,6 +4,7 @@
4
4
  * client-cli wraps the mark CLI as procedures using client-shell.
5
5
  */
6
6
  import { z } from "zod";
7
+ import { cliToolOutputSchema } from "@procedures/shell/cli";
7
8
  // =============================================================================
8
9
  // cli.run Types
9
10
  // =============================================================================
@@ -20,11 +21,5 @@ export const CliRunInputSchema = z.object({
20
21
  timeout: z.number().optional().describe("Timeout in milliseconds"),
21
22
  });
22
23
  /** The output schema of cli.run (roadmap 2.1). Loose: a field that it does not name stays. */
23
- export const CliRunOutputSchema = z.looseObject({
24
- exitCode: z.number().describe("The exit code of mark"),
25
- stdout: z.string().describe("The standard output of mark"),
26
- stderr: z.string().describe("The standard error of mark"),
27
- success: z.boolean().describe("True when the exit code is 0"),
28
- duration: z.number().describe("The time of the command, in milliseconds"),
29
- });
24
+ export const CliRunOutputSchema = cliToolOutputSchema("mark");
30
25
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAMzB,CAAC,CAAC,MAAM,CAAC;IACZ,qEAAqE;IACrE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,sEAAsE,CAAC;IAC1G,+EAA+E;IAC/E,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IAC9K,0CAA0C;IAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC1F,wBAAwB;IACxB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACxD,8BAA8B;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,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E,CAAC;IAC9K,0CAA0C;IAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC1F,wBAAwB;IACxB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACxD,8BAA8B;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACnE,CAAC,CAAC;AAOH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAA4B,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@procedures/cli-run",
4
- "version": "0.34.0",
4
+ "version": "0.35.1",
5
5
  "description": "Run any mark CLI command as a procedure (cli.run) with a safe argv mapping: no shell, typed flags and captured output.",
6
6
  "keywords": [
7
7
  "cli",
@@ -60,8 +60,8 @@
60
60
  "provenance": true
61
61
  },
62
62
  "dependencies": {
63
- "@procedures/client": "0.34.0",
64
- "@procedures/shell": "0.34.0",
63
+ "@procedures/client": "0.35.1",
64
+ "@procedures/shell": "0.35.1",
65
65
  "zod": "^4.6.5"
66
66
  },
67
67
  "devDependencies": {
package/src/module.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
 
10
- import { createProcedure, defineModule, type ProcedureModule, PROCEDURE_REGISTRY, registerModules, type ProcedureRegistry } from "@procedures/client";
10
+ import { definePackage, createProcedure, type ProcedureModule, type PackageDefinition } from "@procedures/client";
11
11
  import shellModule from "@procedures/shell/module";
12
12
  import { cliRun } from "./procedures/cli/index.js";
13
13
  import { CliRunInputSchema, CliRunOutputSchema, type CliRunInput, type CliRunOutput } from "./types.js";
@@ -39,13 +39,15 @@ const cliRunProcedure = createProcedure()
39
39
  // Registration
40
40
  // =============================================================================
41
41
 
42
+ const cliPackage: PackageDefinition = definePackage("@procedures/cli-run", [
43
+ cliRunProcedure,
44
+ ], [shellModule]);
45
+
42
46
  /**
43
47
  * The module of this package, for `createRegistry()`: its procedures as data. Importing this
44
48
  * file registers nothing. (`register.ts` registers the same procedures in the global registry.)
45
49
  */
46
- export const cliModule: ProcedureModule = defineModule("@procedures/cli-run", [
47
- cliRunProcedure,
48
- ], [shellModule]);
50
+ export const cliModule: ProcedureModule = cliPackage.module;
49
51
 
50
52
  export default cliModule;
51
53
 
@@ -54,6 +56,4 @@ export default cliModule;
54
56
  * a registry. The default is the global registry. Importing this file registers nothing: the
55
57
  * `./register` entry starts this function (ARCHITECTURE-PROPOSALS-2026-10, P9).
56
58
  */
57
- export function registerCliProcedures(registry: ProcedureRegistry = PROCEDURE_REGISTRY): void {
58
- registerModules(registry, [cliModule]);
59
- }
59
+ export const registerCliProcedures: PackageDefinition["register"] = cliPackage.register;
@@ -10,6 +10,7 @@ import { existsSync } from "node:fs";
10
10
  import { dirname, join } from "node:path";
11
11
  import { fileURLToPath } from "node:url";
12
12
  import type { ProcedureContext } from "@procedures/client";
13
+ import { defineCliTool, nodeScript } from "@procedures/shell/cli";
13
14
  import type { CliRunInput, CliRunOutput } from "../../types.js";
14
15
 
15
16
  /**
@@ -56,49 +57,8 @@ export function buildMarkArgs(input: Pick<CliRunInput, "path" | "positional" | "
56
57
  return args;
57
58
  }
58
59
 
59
- /**
60
- * Execute via shell (spawn node process)
61
- */
62
- async function shellExecution(
63
- input: CliRunInput,
64
- ctx: ProcedureContext,
65
- startTime: number
66
- ): Promise<CliRunOutput> {
67
- const args = buildMarkArgs(input);
68
-
69
- // Build shell input
70
- const shellInput: {
71
- command: string;
72
- args: string[];
73
- cwd?: string | undefined;
74
- timeout?: number | undefined;
75
- } = {
76
- command: process.execPath,
77
- args: [resolveMarkCli(), ...args],
78
- };
79
-
80
- if (input.cwd !== undefined) shellInput.cwd = input.cwd;
81
- if (input.timeout !== undefined) shellInput.timeout = input.timeout;
82
-
83
- // Call shell.run
84
- const result = await ctx.client.call<
85
- typeof shellInput,
86
- {
87
- exitCode: number;
88
- stdout: string;
89
- stderr: string;
90
- signal?: string | undefined;
91
- }
92
- >(["shell", "run"], shellInput);
93
-
94
- return {
95
- exitCode: result.exitCode,
96
- stdout: result.stdout,
97
- stderr: result.stderr,
98
- success: result.exitCode === 0,
99
- duration: Date.now() - startTime,
100
- };
101
- }
60
+ /** The runner of mark: the mark CLI of the workspace, run with Node through `shell.run`. */
61
+ const mark = defineCliTool({ name: "mark", resolve: () => nodeScript(resolveMarkCli()) });
102
62
 
103
63
  /**
104
64
  * Run a mark CLI command
@@ -123,20 +83,9 @@ export async function cliRun(
123
83
  input: CliRunInput,
124
84
  ctx: ProcedureContext
125
85
  ): Promise<CliRunOutput> {
126
- const startTime = Date.now();
127
-
128
- try {
129
- // Always through the mark CLI. Before, a second path sent the input straight to a running
130
- // CLI server, without mark's argument mapping, so the two paths gave different results
131
- // (a "dry run" wrote files), and it had its own copy of the lockfile logic (deep dive CLI-12).
132
- return await shellExecution(input, ctx, startTime);
133
- } catch (error) {
134
- return {
135
- exitCode: 1,
136
- stdout: "",
137
- stderr: error instanceof Error ? error.message : String(error),
138
- success: false,
139
- duration: Date.now() - startTime,
140
- };
141
- }
86
+ // Always through the mark CLI. Before, a second path sent the input straight to a running
87
+ // CLI server, without mark's argument mapping, so the two paths gave different results
88
+ // (a "dry run" wrote files), and it had its own copy of the lockfile logic (deep dive CLI-12).
89
+ // The runner does not throw: an error gives exit code 1 and its message.
90
+ return mark.run(buildMarkArgs(input), { cwd: input.cwd, timeout: input.timeout }, ctx);
142
91
  }
package/src/types.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import { z } from "zod";
8
+ import { cliToolOutputSchema, type CliToolOutput } from "@procedures/shell/cli";
8
9
 
9
10
  // =============================================================================
10
11
  // cli.run Types
@@ -31,24 +32,8 @@ export const CliRunInputSchema: z.ZodObject<{
31
32
 
32
33
  export type CliRunInput = z.infer<typeof CliRunInputSchema>;
33
34
 
34
- export interface CliRunOutput {
35
- /** Exit code of the command */
36
- exitCode: number;
37
- /** Standard output */
38
- stdout: string;
39
- /** Standard error */
40
- stderr: string;
41
- /** Whether command succeeded (exit code 0) */
42
- success: boolean;
43
- /** Duration in milliseconds */
44
- duration: number;
45
- }
35
+ /** The result of cli.run: the shared result of a CLI tool (`@procedures/shell/cli`). */
36
+ export interface CliRunOutput extends CliToolOutput {}
46
37
 
47
38
  /** The output schema of cli.run (roadmap 2.1). Loose: a field that it does not name stays. */
48
- export const CliRunOutputSchema: z.ZodType<CliRunOutput> = z.looseObject({
49
- exitCode: z.number().describe("The exit code of mark"),
50
- stdout: z.string().describe("The standard output of mark"),
51
- stderr: z.string().describe("The standard error of mark"),
52
- success: z.boolean().describe("True when the exit code is 0"),
53
- duration: z.number().describe("The time of the command, in milliseconds"),
54
- });
39
+ export const CliRunOutputSchema: z.ZodType<CliRunOutput> = cliToolOutputSchema("mark");