@kb-labs/shared-command-kit 2.109.0 → 2.111.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/index.d.ts CHANGED
@@ -1247,7 +1247,7 @@ interface CommandDefinition<TConfig = unknown, TInput = unknown, TResult = unkno
1247
1247
  * context.ui.success(`Hello, ${target}!`);
1248
1248
  *
1249
1249
  * return {
1250
- * exitCode: 0,
1250
+ * ok: true,
1251
1251
  * result: { message: `Hello, ${target}!`, target },
1252
1252
  * meta: { version: 'v3' }
1253
1253
  * };
@@ -1312,8 +1312,8 @@ interface RouteDefinition<TConfig = unknown, TInput = unknown> {
1312
1312
  * handler: {
1313
1313
  * async execute(context, input: { name: string }) {
1314
1314
  * return {
1315
- * data: { message: `Hello, ${input.name}!` },
1316
- * exitCode: 0,
1315
+ * ok: true,
1316
+ * result: { message: `Hello, ${input.name}!` },
1317
1317
  * };
1318
1318
  * }
1319
1319
  * }
@@ -1377,8 +1377,8 @@ interface WebhookDefinition<TConfig = unknown, TInput = unknown> {
1377
1377
  * // Process webhook...
1378
1378
  *
1379
1379
  * return {
1380
- * data: { processed: true },
1381
- * exitCode: 0,
1380
+ * ok: true,
1381
+ * result: { processed: true },
1382
1382
  * };
1383
1383
  * }
1384
1384
  * }
@@ -1595,8 +1595,8 @@ interface ActionDefinition<TConfig = unknown, TInput = unknown> {
1595
1595
  * // Send email...
1596
1596
  *
1597
1597
  * return {
1598
- * data: { sent: true, messageId: '123' },
1599
- * exitCode: 0,
1598
+ * ok: true,
1599
+ * result: { sent: true, messageId: '123' },
1600
1600
  * };
1601
1601
  * }
1602
1602
  * }
@@ -1690,10 +1690,6 @@ declare class MessageRouter<TConfig = unknown> {
1690
1690
  * Command Kit - High-level API and utilities for building CLI commands
1691
1691
  */
1692
1692
 
1693
- /**
1694
- * Command execution status
1695
- */
1696
- type CommandStatus = 'success' | 'failed' | 'error' | 'cancelled' | 'skipped' | 'warning' | 'info';
1697
1693
  /**
1698
1694
  * Helper types for command results (optional - use when convenient)
1699
1695
  *
@@ -1728,14 +1724,13 @@ type ResultWith<T extends Record<string, unknown>> = CommandResult & T;
1728
1724
  *
1729
1725
  * Recommended fields:
1730
1726
  * - `error?: string` - error message when ok === false
1731
- * - `status?: CommandStatus` - execution status (auto-inferred if not provided)
1732
1727
  *
1733
1728
  * Additional fields should be added via generic TResult type parameter.
1734
1729
  *
1735
1730
  * @example
1736
1731
  * ```typescript
1737
1732
  * // Minimal result (not recommended - use explicit type)
1738
- * type MyResult = CommandResult; // { ok: boolean; error?: string; status?: CommandStatus }
1733
+ * type MyResult = CommandResult;
1739
1734
  *
1740
1735
  * // Extended result with custom fields (RECOMMENDED)
1741
1736
  * type WorkflowRunResult = CommandResult & {
@@ -1749,14 +1744,7 @@ type ResultWith<T extends Record<string, unknown>> = CommandResult & T;
1749
1744
  * };
1750
1745
  * ```
1751
1746
  */
1752
- type CommandResult = {
1753
- /** Whether the command executed successfully - REQUIRED */
1754
- ok: boolean;
1755
- /** Error message if ok === false - RECOMMENDED for error cases */
1756
- error?: string;
1757
- /** Execution status - automatically inferred from ok if not provided */
1758
- status?: CommandStatus;
1759
- };
1747
+ type CommandResult<T = unknown> = CommandResult$1<T>;
1760
1748
  /**
1761
1749
  * Command handler function signature
1762
1750
  *
@@ -1908,4 +1896,4 @@ interface CommandConfig<TFlags extends FlagSchemaDefinition$1 = FlagSchemaDefini
1908
1896
  formatter?: CommandFormatter<TConfig, InferFlags<TFlags>, TResult, TArgv, TEnv>;
1909
1897
  }
1910
1898
 
1911
- export { type ActionDefinition, type ActionHandler, type CLIInput, type CliGroup, CmdBuilder, type Command, type CommandConfig, type CommandDefinition, type CommandFormatter, type CommandGroup, type CommandHandler, type CommandHandlerV3, type CommandResult, type CommandStatus, type ConfigUpdates, DELETE, type DefinedJob, type DestroyHandlerDefinition, type ErrorResult, FlagSchemaDefinition$1 as FlagSchemaDefinition, GET, type Handler, type HandlerDefinition, type HandlerRef, InferFlags, type JobDefinition, type JobHandler, type JobInput, type LifecycleContext, MessageBuilder, MessageRouter, PATCH, POST, PUT, type PluginId, type RestBase, type RestInput, type ResultWith, type RouteDefinition, type RouteHandler, type SemVer, type SetupHandlerDefinition, type SetupResult, type SuccessResult, type SystemCommandConfig, type TypedSender, type WebSocketDefinition, type WebSocketHandler, type WebhookDefinition, type WebhookHandler, type WorkspaceConfig, type WsBase, array, artifactId, boolean, cmd, commandId, createManifest, cwd, datetime, defineAction, defineCommand, defineCommandFlags, defineDestroyHandler, defineHandler, defineJob, defineManifest, defineMessage, defineRoute, defineSetupHandler, defineSystemCommand, defineSystemCommandGroup, defineWebSocket, defineWebhook, email, enumSchema, filePath, group, isCLIHost, isRESTHost, isWSHost, isWebhookHost, isWorkflowHost, json, mergeCliGroups, nonNegativeInt, object, pluginId, positiveInt, schema, scopeId, text, url, uuid, webhook };
1899
+ export { type ActionDefinition, type ActionHandler, type CLIInput, type CliGroup, CmdBuilder, type Command, type CommandConfig, type CommandDefinition, type CommandFormatter, type CommandGroup, type CommandHandler, type CommandHandlerV3, type CommandResult, type ConfigUpdates, DELETE, type DefinedJob, type DestroyHandlerDefinition, type ErrorResult, FlagSchemaDefinition$1 as FlagSchemaDefinition, GET, type Handler, type HandlerDefinition, type HandlerRef, InferFlags, type JobDefinition, type JobHandler, type JobInput, type LifecycleContext, MessageBuilder, MessageRouter, PATCH, POST, PUT, type PluginId, type RestBase, type RestInput, type ResultWith, type RouteDefinition, type RouteHandler, type SemVer, type SetupHandlerDefinition, type SetupResult, type SuccessResult, type SystemCommandConfig, type TypedSender, type WebSocketDefinition, type WebSocketHandler, type WebhookDefinition, type WebhookHandler, type WorkspaceConfig, type WsBase, array, artifactId, boolean, cmd, commandId, createManifest, cwd, datetime, defineAction, defineCommand, defineCommandFlags, defineDestroyHandler, defineHandler, defineJob, defineManifest, defineMessage, defineRoute, defineSetupHandler, defineSystemCommand, defineSystemCommandGroup, defineWebSocket, defineWebhook, email, enumSchema, filePath, group, isCLIHost, isRESTHost, isWSHost, isWebhookHost, isWorkflowHost, json, mergeCliGroups, nonNegativeInt, object, pluginId, positiveInt, schema, scopeId, text, url, uuid, webhook };
package/dist/index.js CHANGED
@@ -1508,7 +1508,7 @@ function defineCommand(definition) {
1508
1508
  return (async () => {
1509
1509
  const intent = await definition.handler.intent(context, input);
1510
1510
  renderDryRunIntent(context.ui, intent);
1511
- return { exitCode: 0, result: intent };
1511
+ return { ok: true, result: intent };
1512
1512
  })();
1513
1513
  }
1514
1514
  return definition.handler.execute(context, input);
@@ -1691,7 +1691,7 @@ function defineWebSocket(definition) {
1691
1691
  } finally {
1692
1692
  await definition.handler.cleanup?.();
1693
1693
  }
1694
- return { exitCode: 0 };
1694
+ return { ok: true };
1695
1695
  }
1696
1696
  };
1697
1697
  }