@procedures/mark 0.33.0 → 0.35.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,7 +1,7 @@
1
1
  {
2
2
  "version": 2,
3
- "fingerprint": "b71161fed26ba33fe82feeb6e13b44e3dc152979ab2161a3900bda50cecb058c",
4
- "generatedAt": "2026-10-25T21:45:09.340Z",
3
+ "fingerprint": "23d2e754ff5fd77e97e8598a0d8732478c8b5d450f4688372e3172bae0b2f3cf",
4
+ "generatedAt": "2026-10-26T14:52:46.400Z",
5
5
  "commands": [
6
6
  {
7
7
  "path": [
@@ -9540,7 +9540,8 @@
9540
9540
  {
9541
9541
  "path": [
9542
9542
  "fs",
9543
- "read.json"
9543
+ "read",
9544
+ "json"
9544
9545
  ],
9545
9546
  "metadata": {
9546
9547
  "description": "Read and parse JSON file",
@@ -9606,7 +9607,8 @@
9606
9607
  {
9607
9608
  "path": [
9608
9609
  "fs",
9609
- "write.json"
9610
+ "write",
9611
+ "json"
9610
9612
  ],
9611
9613
  "metadata": {
9612
9614
  "description": "Write a value as a JSON file, with a rename at the end",
@@ -10067,7 +10069,7 @@
10067
10069
  "kind": "number"
10068
10070
  },
10069
10071
  "required": true,
10070
- "description": "The exit code of mark"
10072
+ "description": "The exit code of mark (0 is success)"
10071
10073
  },
10072
10074
  {
10073
10075
  "name": "stdout",
@@ -10085,7 +10087,7 @@
10085
10087
  "kind": "string"
10086
10088
  },
10087
10089
  "required": true,
10088
- "description": "The standard error of mark"
10090
+ "description": "The standard error of mark, or the error message when mark did not start"
10089
10091
  },
10090
10092
  {
10091
10093
  "name": "success",
@@ -10257,7 +10259,7 @@
10257
10259
  "kind": "string"
10258
10260
  },
10259
10261
  "required": true,
10260
- "description": "The standard error of pnpm"
10262
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
10261
10263
  },
10262
10264
  {
10263
10265
  "name": "success",
@@ -10435,7 +10437,7 @@
10435
10437
  "kind": "string"
10436
10438
  },
10437
10439
  "required": true,
10438
- "description": "The standard error of pnpm"
10440
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
10439
10441
  },
10440
10442
  {
10441
10443
  "name": "success",
@@ -10599,7 +10601,7 @@
10599
10601
  "kind": "string"
10600
10602
  },
10601
10603
  "required": true,
10602
- "description": "The standard error of pnpm"
10604
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
10603
10605
  },
10604
10606
  {
10605
10607
  "name": "success",
@@ -10719,7 +10721,7 @@
10719
10721
  "kind": "string"
10720
10722
  },
10721
10723
  "required": true,
10722
- "description": "The standard error of pnpm"
10724
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
10723
10725
  },
10724
10726
  {
10725
10727
  "name": "success",
@@ -10882,7 +10884,7 @@
10882
10884
  "kind": "string"
10883
10885
  },
10884
10886
  "required": true,
10885
- "description": "The standard error of pnpm"
10887
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
10886
10888
  },
10887
10889
  {
10888
10890
  "name": "success",
@@ -11111,7 +11113,7 @@
11111
11113
  "kind": "string"
11112
11114
  },
11113
11115
  "required": true,
11114
- "description": "The standard error of pnpm"
11116
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
11115
11117
  },
11116
11118
  {
11117
11119
  "name": "success",
@@ -11301,7 +11303,7 @@
11301
11303
  "kind": "string"
11302
11304
  },
11303
11305
  "required": true,
11304
- "description": "The standard error of pnpm"
11306
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
11305
11307
  },
11306
11308
  {
11307
11309
  "name": "success",
@@ -11310,7 +11312,7 @@
11310
11312
  "kind": "boolean"
11311
11313
  },
11312
11314
  "required": true,
11313
- "description": "True when the command succeeded"
11315
+ "description": "True when the exit code is 0"
11314
11316
  },
11315
11317
  {
11316
11318
  "name": "duration",
@@ -11504,7 +11506,7 @@
11504
11506
  "kind": "string"
11505
11507
  },
11506
11508
  "required": true,
11507
- "description": "The standard error of pnpm"
11509
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
11508
11510
  },
11509
11511
  {
11510
11512
  "name": "success",
@@ -11513,7 +11515,7 @@
11513
11515
  "kind": "boolean"
11514
11516
  },
11515
11517
  "required": true,
11516
- "description": "True when the command succeeded"
11518
+ "description": "True when the exit code is 0"
11517
11519
  },
11518
11520
  {
11519
11521
  "name": "duration",
@@ -11687,7 +11689,7 @@
11687
11689
  "kind": "string"
11688
11690
  },
11689
11691
  "required": true,
11690
- "description": "The standard error of pnpm"
11692
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
11691
11693
  },
11692
11694
  {
11693
11695
  "name": "success",
@@ -11696,7 +11698,7 @@
11696
11698
  "kind": "boolean"
11697
11699
  },
11698
11700
  "required": true,
11699
- "description": "True when the command succeeded"
11701
+ "description": "True when the exit code is 0"
11700
11702
  },
11701
11703
  {
11702
11704
  "name": "duration",
@@ -11884,7 +11886,7 @@
11884
11886
  "kind": "string"
11885
11887
  },
11886
11888
  "required": true,
11887
- "description": "The standard error of pnpm"
11889
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
11888
11890
  },
11889
11891
  {
11890
11892
  "name": "success",
@@ -12006,7 +12008,7 @@
12006
12008
  "kind": "string"
12007
12009
  },
12008
12010
  "required": true,
12009
- "description": "The standard error of pnpm"
12011
+ "description": "The standard error of pnpm, or the error message when pnpm did not start"
12010
12012
  },
12011
12013
  {
12012
12014
  "name": "success",
@@ -12015,7 +12017,7 @@
12015
12017
  "kind": "boolean"
12016
12018
  },
12017
12019
  "required": true,
12018
- "description": "True when the command succeeded"
12020
+ "description": "True when the exit code is 0"
12019
12021
  },
12020
12022
  {
12021
12023
  "name": "duration",
package/dist/parse.d.ts CHANGED
@@ -1,88 +1,11 @@
1
1
  /**
2
2
  * Schema-based CLI Argument Parser
3
3
  *
4
- * Reads the field types of a procedure's input schema, converts CLI text to those types, and
5
- * makes the help text. Validation is delegated to the procedure's schema.
4
+ * The field types, the conversion of CLI text and the help text are in `@procedures/cli-kit`
5
+ * (roadmap O61). This module gives them to mark with the name `mark` and the global flags of mark.
6
6
  */
7
- /**
8
- * CLI metadata that can be attached to procedures via .meta()
9
- */
10
- export interface CLIMeta {
11
- /** Description for help text */
12
- description?: string;
13
- /** Field names that are positional args (in order). An array field that is last takes the rest. */
14
- args?: string[];
15
- /** Short flag mappings: { fieldName: "f" } */
16
- shorts?: Record<string, string>;
17
- /** Output format hint */
18
- output?: "text" | "json" | "table" | "streaming";
19
- /** Whether to prompt for missing required fields */
20
- interactive?: boolean;
21
- }
22
- /**
23
- * The kinds of field the CLI can convert to. "any" is a field with no usable type: its value is
24
- * JSON when it parses as JSON, and text otherwise.
25
- */
26
- export type FieldKind = "string" | "number" | "bigint" | "boolean" | "enum" | "literal" | "date" | "array" | "record" | "object" | "union" | "any";
27
- /**
28
- * The type of a schema field, as the CLI sees it
29
- */
30
- export interface FieldType {
31
- kind: FieldKind;
32
- /** The item type of an array */
33
- item?: FieldType;
34
- /** The value type of a record */
35
- value?: FieldType;
36
- /** The member types of a union */
37
- options?: FieldType[];
38
- /** The values of an enum */
39
- values?: readonly string[];
40
- /** The value of a literal */
41
- literal?: unknown;
42
- }
43
- /**
44
- * Extracted schema field info for help generation
45
- */
46
- export interface SchemaFieldInfo {
47
- name: string;
48
- /** The display name of the type, for the help text */
49
- type: string;
50
- /** The type the CLI converts values to */
51
- fieldType: FieldType;
52
- required: boolean;
53
- description: string | undefined;
54
- defaultValue: unknown;
55
- enumValues: readonly string[] | undefined;
56
- }
57
- /**
58
- * The CLI type of a schema: a procedure schema (a Standard Schema such as zod 4) or its JSON
59
- * Schema. The type comes from the JSON Schema, so every schema library works. (Before, the
60
- * parser read the private fields of zod 3.)
61
- */
62
- export declare function fieldTypeOf(schema: unknown): FieldType;
63
- /**
64
- * Extract field information from a schema: a procedure schema or its JSON Schema. A schema that
65
- * is not an object (or that has no JSON Schema) gives no fields: the CLI then passes its flags
66
- * through.
67
- */
68
- export declare function extractSchemaFields(schema: unknown): SchemaFieldInfo[];
69
- /** The result of a conversion: the value, or a message for the user */
70
- export type Converted = {
71
- ok: true;
72
- value: unknown;
73
- } | {
74
- ok: false;
75
- error: string;
76
- };
77
- /**
78
- * Convert the CLI text of one value to a field type
79
- */
80
- export declare function convertValue(text: string, type: FieldType, label: string): Converted;
81
- /**
82
- * Add a converted value to a field that already has one. Arrays collect and records merge,
83
- * so a repeated flag adds to the field. Other fields take the last value.
84
- */
85
- export declare function mergeValue(previous: unknown, next: unknown, type: FieldType): unknown;
7
+ import { type CLIMeta, type SchemaFieldInfo } from "@procedures/cli-kit";
8
+ export { convertValue, extractSchemaFields, fieldTypeOf, fieldsOf, mergeValue, resultFieldsOf, resultFieldsOfSchema, toCamel, toKebab, type CLIMeta, type CommandLike, type Converted, type FieldKind, type FieldType, type SchemaFieldInfo, } from "@procedures/cli-kit";
86
9
  /**
87
10
  * Gluegun parameters shape
88
11
  */
@@ -95,45 +18,12 @@ export interface Parameters {
95
18
  raw?: string[];
96
19
  string?: string;
97
20
  }
98
- /**
99
- * Convert camelCase to kebab-case
100
- */
101
- export declare function toKebab(str: string): string;
102
- /**
103
- * Convert kebab-case to camelCase
104
- */
105
- export declare function toCamel(str: string): string;
106
21
  /**
107
22
  * Parse CLI parameters into procedure input based on metadata. With the schema, each value is
108
23
  * converted by the type of its field: a string field keeps its text. Without the schema, a value
109
24
  * is JSON when it parses as JSON, and text otherwise.
110
25
  */
111
26
  export declare function parseFromSchema(params: Parameters, meta: CLIMeta, schema?: unknown): Record<string, unknown>;
112
- /**
113
- * A command as mark sees it: a procedure of the registry (with its input schema), or a command
114
- * of the manifest (with the fields of its input). See manifest.ts.
115
- */
116
- export interface CommandLike {
117
- path: readonly string[];
118
- metadata?: unknown;
119
- /** The input schema of a procedure of the registry */
120
- input?: unknown;
121
- /** The output schema of a procedure of the registry */
122
- output?: unknown;
123
- /** The fields of the input of a command of the manifest */
124
- fields?: readonly SchemaFieldInfo[];
125
- /** The fields of the result of a command of the manifest */
126
- resultFields?: readonly SchemaFieldInfo[];
127
- }
128
- /** The fields of the input of a command: from the manifest, or read from the schema */
129
- export declare function fieldsOf(command: CommandLike): SchemaFieldInfo[];
130
- /**
131
- * The fields of the result of a procedure, from its output schema: only for a result that is an
132
- * object (a union, a stream item or a pass-through schema gives none).
133
- */
134
- export declare function resultFieldsOfSchema(output: unknown): SchemaFieldInfo[];
135
- /** The fields of the result of a command: from the manifest, or read from the output schema */
136
- export declare function resultFieldsOf(command: CommandLike): SchemaFieldInfo[];
137
27
  /**
138
28
  * Generate help text for a procedure based on its metadata and schema. `schema` is the input
139
29
  * schema, or the fields of the input (a command of the manifest). `result` gives the fields of
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IACjD,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,gCAAgC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iCAAiC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kCAAkC;IAClC,OAAO,CAAC,EAAE,SAAS,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