goke 6.1.2 → 6.2.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.
package/dist/coerce.js CHANGED
@@ -28,27 +28,30 @@
28
28
  * Union types (e.g. ["number", "string"]):
29
29
  * Tries each type in order, returns first successful coercion.
30
30
  */
31
+ // ─── GokeError ───
32
+ /**
33
+ * Custom error class for CLI usage errors (unknown options, missing values,
34
+ * invalid types, etc.). Used by both the coercion layer and the framework
35
+ * to distinguish user-facing errors from unexpected failures.
36
+ */
37
+ export class GokeError extends Error {
38
+ constructor(message) {
39
+ super(message);
40
+ this.name = this.constructor.name;
41
+ if (typeof Error.captureStackTrace === 'function') {
42
+ Error.captureStackTrace(this, this.constructor);
43
+ }
44
+ else {
45
+ this.stack = new Error(message).stack;
46
+ }
47
+ }
48
+ }
31
49
  // ─── wrapJsonSchema ───
32
50
  /**
33
51
  * Wraps a plain JSON Schema object into a StandardJSONSchemaV1-compatible object.
34
52
  *
35
- * This is useful for dynamic use cases where you have a raw JSON Schema
36
- * (e.g. from an MCP tool's inputSchema) and need to pass it to Goke's
37
- * schema option which expects StandardJSONSchemaV1.
38
- *
39
- * @example
40
- * ```ts
41
- * import { wrapJsonSchema } from 'goke'
42
- *
43
- * // Wrap a plain JSON Schema for use with Goke options
44
- * const schema = wrapJsonSchema({ type: "number" })
45
- * cmd.option('--port <port>', 'Port', { schema })
46
- *
47
- * // Wrap MCP tool property schemas
48
- * for (const [name, propSchema] of Object.entries(tool.inputSchema.properties)) {
49
- * cmd.option(`--${name} <${name}>`, desc, { schema: wrapJsonSchema(propSchema) })
50
- * }
51
- * ```
53
+ * @internal This is an internal helper used by @goke/mcp to wrap MCP tool schemas.
54
+ * Users should pass Zod or other StandardSchema-compatible schemas to `.option()`.
52
55
  *
53
56
  * @param jsonSchema - A plain JSON Schema object (e.g. `{ type: "number" }`)
54
57
  * @returns A StandardJSONSchemaV1-compatible object that Goke can use for coercion
@@ -136,7 +139,7 @@ export function coerceBySchema(value, rawSchema, optionName) {
136
139
  }
137
140
  }
138
141
  // Schema does NOT expect array — repeated flags are not allowed
139
- throw new Error(`Option --${optionName} does not accept multiple values. ` +
142
+ throw new GokeError(`Option --${optionName} does not accept multiple values. ` +
140
143
  `Use an array schema (e.g. { type: "array" }) to allow repeated flags.`);
141
144
  }
142
145
  // Handle array schema with a single (non-array) value.
@@ -192,7 +195,7 @@ export function coerceBySchema(value, rawSchema, optionName) {
192
195
  return allowed;
193
196
  }
194
197
  }
195
- throw new Error(`Invalid value for --${optionName}: expected one of ${schema.enum.map(v => JSON.stringify(v)).join(', ')}, got ${JSON.stringify(value)}`);
198
+ throw new GokeError(`Invalid value for --${optionName}: expected one of ${schema.enum.map(v => JSON.stringify(v)).join(', ')}, got ${JSON.stringify(value)}`);
196
199
  }
197
200
  // Handle const constraint
198
201
  if (schema.const !== undefined) {
@@ -202,7 +205,7 @@ export function coerceBySchema(value, rawSchema, optionName) {
202
205
  const coerced = coerceToSingleType(value, targetType, optionName);
203
206
  if (coerced === constVal)
204
207
  return coerced;
205
- throw new Error(`Invalid value for --${optionName}: expected ${JSON.stringify(constVal)}, got ${JSON.stringify(value)}`);
208
+ throw new GokeError(`Invalid value for --${optionName}: expected ${JSON.stringify(constVal)}, got ${JSON.stringify(value)}`);
206
209
  }
207
210
  // Handle anyOf/oneOf — try each sub-schema
208
211
  if (schema.anyOf || schema.oneOf) {
@@ -215,7 +218,7 @@ export function coerceBySchema(value, rawSchema, optionName) {
215
218
  // Try next variant
216
219
  }
217
220
  }
218
- throw new Error(`Invalid value for --${optionName}: ${JSON.stringify(value)} does not match any allowed type`);
221
+ throw new GokeError(`Invalid value for --${optionName}: ${JSON.stringify(value)} does not match any allowed type`);
219
222
  }
220
223
  // Handle allOf — value must satisfy all sub-schemas (coerce with first, validate with rest)
221
224
  if (schema.allOf && schema.allOf.length > 0) {
@@ -245,7 +248,7 @@ export function coerceBySchema(value, rawSchema, optionName) {
245
248
  // Try next type
246
249
  }
247
250
  }
248
- throw new Error(`Invalid value for --${optionName}: expected ${schemaType.join(' or ')}, got ${JSON.stringify(value)}`);
251
+ throw new GokeError(`Invalid value for --${optionName}: expected ${schemaType.join(' or ')}, got ${JSON.stringify(value)}`);
249
252
  }
250
253
  // Single type
251
254
  return coerceToSingleType(value, schemaType, optionName);
@@ -285,18 +288,18 @@ function coerceToNumber(value, optionName) {
285
288
  return value ? 1 : 0;
286
289
  }
287
290
  if (value === '') {
288
- throw new Error(`Invalid value for --${optionName}: expected number, got empty string`);
291
+ throw new GokeError(`Invalid value for --${optionName}: expected number, got empty string`);
289
292
  }
290
293
  const num = +value;
291
294
  if (!Number.isFinite(num)) {
292
- throw new Error(`Invalid value for --${optionName}: expected number, got ${JSON.stringify(value)}`);
295
+ throw new GokeError(`Invalid value for --${optionName}: expected number, got ${JSON.stringify(value)}`);
293
296
  }
294
297
  return num;
295
298
  }
296
299
  function coerceToInteger(value, optionName) {
297
300
  const num = coerceToNumber(value, optionName);
298
301
  if (num % 1 !== 0) {
299
- throw new Error(`Invalid value for --${optionName}: expected integer, got ${JSON.stringify(value)}`);
302
+ throw new GokeError(`Invalid value for --${optionName}: expected integer, got ${JSON.stringify(value)}`);
300
303
  }
301
304
  return num;
302
305
  }
@@ -308,16 +311,16 @@ function coerceToBoolean(value, optionName) {
308
311
  return true;
309
312
  if (value === 'false')
310
313
  return false;
311
- throw new Error(`Invalid value for --${optionName}: expected true or false, got ${JSON.stringify(value)}`);
314
+ throw new GokeError(`Invalid value for --${optionName}: expected true or false, got ${JSON.stringify(value)}`);
312
315
  }
313
316
  function coerceToNull(value, optionName) {
314
317
  if (typeof value === 'string' && value === '')
315
318
  return null;
316
- throw new Error(`Invalid value for --${optionName}: expected empty string for null, got ${JSON.stringify(value)}`);
319
+ throw new GokeError(`Invalid value for --${optionName}: expected empty string for null, got ${JSON.stringify(value)}`);
317
320
  }
318
321
  function coerceToObject(value, optionName) {
319
322
  if (typeof value !== 'string') {
320
- throw new Error(`Invalid value for --${optionName}: expected JSON object, got ${typeof value}`);
323
+ throw new GokeError(`Invalid value for --${optionName}: expected JSON object, got ${typeof value}`);
321
324
  }
322
325
  try {
323
326
  const parsed = JSON.parse(value);
@@ -327,12 +330,12 @@ function coerceToObject(value, optionName) {
327
330
  return parsed;
328
331
  }
329
332
  catch {
330
- throw new Error(`Invalid value for --${optionName}: expected valid JSON object, got ${JSON.stringify(value)}`);
333
+ throw new GokeError(`Invalid value for --${optionName}: expected valid JSON object, got ${JSON.stringify(value)}`);
331
334
  }
332
335
  }
333
336
  function coerceToArray(value, optionName) {
334
337
  if (typeof value !== 'string') {
335
- throw new Error(`Invalid value for --${optionName}: expected JSON array, got ${typeof value}`);
338
+ throw new GokeError(`Invalid value for --${optionName}: expected JSON array, got ${typeof value}`);
336
339
  }
337
340
  try {
338
341
  const parsed = JSON.parse(value);
@@ -342,7 +345,7 @@ function coerceToArray(value, optionName) {
342
345
  return parsed;
343
346
  }
344
347
  catch {
345
- throw new Error(`Invalid value for --${optionName}: expected valid JSON array, got ${JSON.stringify(value)}`);
348
+ throw new GokeError(`Invalid value for --${optionName}: expected valid JSON array, got ${JSON.stringify(value)}`);
346
349
  }
347
350
  }
348
351
  // ─── Schema extraction ───
@@ -397,8 +400,8 @@ export function isStandardSchema(value) {
397
400
  return isJsonSchemaConverter(value['~standard'].jsonSchema);
398
401
  }
399
402
  /**
400
- * Extract description and default value from a StandardJSONSchemaV1-compatible schema.
401
- * Calls extractJsonSchema() internally and pulls `description` and `default` fields.
403
+ * Extract description, default value, and deprecated flag from a StandardJSONSchemaV1-compatible schema.
404
+ * Calls extractJsonSchema() internally and pulls `description`, `default`, and `deprecated` fields.
402
405
  */
403
406
  export function extractSchemaMetadata(schema) {
404
407
  const jsonSchema = extractJsonSchema(schema);
@@ -411,5 +414,8 @@ export function extractSchemaMetadata(schema) {
411
414
  if (jsonSchema.default !== undefined) {
412
415
  result.default = jsonSchema.default;
413
416
  }
417
+ if (jsonSchema.deprecated === true) {
418
+ result.deprecated = true;
419
+ }
414
420
  return result;
415
421
  }
package/dist/goke.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  * Goke — a cac-inspired CLI framework.
3
3
  *
4
4
  * This file contains the entire core framework:
5
- * - GokeError: custom error class
6
5
  * - Option: CLI option parsing (flags, required/optional values)
7
6
  * - Command / GlobalCommand: command definition, help/version output
8
7
  * - Goke: main CLI class with parsing, matching, and execution
@@ -26,6 +25,8 @@ declare class Option {
26
25
  default?: unknown;
27
26
  /** Standard JSON Schema V1 schema for type coercion and inference */
28
27
  schema?: StandardJSONSchemaV1;
28
+ /** Whether this option is deprecated (hidden from help output) */
29
+ deprecated?: boolean;
29
30
  /**
30
31
  * Create an option.
31
32
  * @param rawName - The raw option string, e.g. '--port <port>', '-v, --verbose'
@@ -139,6 +140,11 @@ declare class Command {
139
140
  * @param name Option name
140
141
  */
141
142
  hasOption(name: string): Option | undefined;
143
+ /**
144
+ * Return the formatted help string without printing it.
145
+ * Useful for embedding help text in documentation, tests, or other programmatic uses.
146
+ */
147
+ helpText(): string;
142
148
  outputHelp(): void;
143
149
  outputVersion(): void;
144
150
  checkRequiredArgs(): void;
@@ -184,6 +190,11 @@ interface GokeOptions {
184
190
  argv?: string[];
185
191
  /** Terminal width used to wrap help output. Defaults to process.stdout.columns, or Infinity when unavailable */
186
192
  columns?: number;
193
+ /**
194
+ * Custom exit function called on CLI errors (unknown option, missing value, etc.).
195
+ * Defaults to process.exit. Set to a no-op or throw to prevent exit in tests.
196
+ */
197
+ exit?: (code: number) => void;
187
198
  }
188
199
  /**
189
200
  * Creates a console-like object that writes to the given output streams.
@@ -229,6 +240,8 @@ declare class Goke extends EventEmitter {
229
240
  readonly console: GokeConsole;
230
241
  /** Terminal width used to wrap help output text */
231
242
  readonly columns: number;
243
+ /** Exit function called on CLI errors. Defaults to process.exit */
244
+ readonly exit: (code: number) => void;
232
245
  /**
233
246
  * @param name The program name to display in help and version message
234
247
  * @param options Configuration for stdout, stderr, and argv
@@ -266,11 +279,16 @@ declare class Goke extends EventEmitter {
266
279
  * This example added here will not be used by sub-commands.
267
280
  */
268
281
  example(example: CommandExample): this;
282
+ /**
283
+ * Return the formatted help string without printing it.
284
+ * When a sub-command is matched, returns help for that command.
285
+ * Otherwise returns the global help.
286
+ */
287
+ helpText(): string;
269
288
  /**
270
289
  * Output the corresponding help message
271
290
  * When a sub-command is matched, output the help message for the command
272
291
  * Otherwise output the global one.
273
- *
274
292
  */
275
293
  outputHelp(): void;
276
294
  /**
@@ -285,6 +303,11 @@ declare class Goke extends EventEmitter {
285
303
  outputVersion(): void;
286
304
  private setParsedInfo;
287
305
  unsetMatchedCommand(): void;
306
+ /**
307
+ * Handle a CLI error by formatting it and writing to stderr.
308
+ * For GokeError / coercion errors, also includes a help hint.
309
+ */
310
+ private handleCliError;
288
311
  /**
289
312
  * Parse argv
290
313
  */
@@ -1 +1 @@
1
- {"version":3,"file":"goke.d.ts","sourceRoot":"","sources":["../src/goke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAIrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAgOvD,cAAM,MAAM;IAsBD,OAAO,EAAE,MAAM;IArBxB,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,8BAA8B;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAE7B;;;;;OAKG;gBAEM,OAAO,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,MAAM,GAAG,oBAAoB;CAsCtD;AAMD;;;GAGG;AACH,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