@kb-labs/shared-cli-ui 2.109.0 → 2.110.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.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { DebugContext, DebugDetailLevel, DebugEntry, DebugExportOptions, DebugFilterOptions, DebugFormat, DebugLevel, DebugMeta, DebugOutput, DebugOutputOptions, DebugSection, DebugTrace, DebugTree, DebugTreeNode, DebugTreeOptions, HumanFormatterOptions, TraceOptions, createDebugTree, describeEntriesAI, describeEntriesHuman, describeEntriesTimeline, exportDebugEntries, exportToChromeFormat, exportToJSON, exportToPlainText, filterByLevel, filterByNamespace, filterByTimeRange, filterDebugEntries, formatDebugEntriesAI, formatDebugEntriesHuman, formatDebugEntryAI, formatDebugEntryHuman, formatDebugOutput, formatDebugOutputs, formatTimeline, formatTimelineNode, formatTimelineWithSummary, groupByGroup, groupByNamespace, searchInLogs, shouldUseAIFormat } from './debug.cjs';
2
+ import { CommandFailure, SelectChoice, MultiSelectChoice, UIFacade } from '@kb-labs/plugin-contracts';
2
3
  export { ConfirmOptions, MultiSelectChoice, MultiSelectOptions, SelectChoice, SelectOptions, TextOptions, confirm, isInteractive, multiSelect, select, text } from './interactive/index.cjs';
3
- import { SelectChoice, MultiSelectChoice, UIFacade } from '@kb-labs/plugin-contracts';
4
4
 
5
5
  /**
6
6
  * Minimalist color utilities for CLI output
@@ -975,9 +975,7 @@ declare function confirmDestructive(ctx: ConfirmContext, opts: {
975
975
  confirmed: boolean;
976
976
  isJson?: boolean;
977
977
  action: DestructiveAction;
978
- }): {
979
- exitCode: number;
980
- } | null;
978
+ }): CommandFailure | null;
981
979
 
982
980
  /**
983
981
  * Modern CLI formatting utilities with side border design
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { DebugContext, DebugDetailLevel, DebugEntry, DebugExportOptions, DebugFilterOptions, DebugFormat, DebugLevel, DebugMeta, DebugOutput, DebugOutputOptions, DebugSection, DebugTrace, DebugTree, DebugTreeNode, DebugTreeOptions, HumanFormatterOptions, TraceOptions, createDebugTree, describeEntriesAI, describeEntriesHuman, describeEntriesTimeline, exportDebugEntries, exportToChromeFormat, exportToJSON, exportToPlainText, filterByLevel, filterByNamespace, filterByTimeRange, filterDebugEntries, formatDebugEntriesAI, formatDebugEntriesHuman, formatDebugEntryAI, formatDebugEntryHuman, formatDebugOutput, formatDebugOutputs, formatTimeline, formatTimelineNode, formatTimelineWithSummary, groupByGroup, groupByNamespace, searchInLogs, shouldUseAIFormat } from './debug.js';
2
+ import { CommandFailure, SelectChoice, MultiSelectChoice, UIFacade } from '@kb-labs/plugin-contracts';
2
3
  export { ConfirmOptions, MultiSelectChoice, MultiSelectOptions, SelectChoice, SelectOptions, TextOptions, confirm, isInteractive, multiSelect, select, text } from './interactive/index.js';
3
- import { SelectChoice, MultiSelectChoice, UIFacade } from '@kb-labs/plugin-contracts';
4
4
 
5
5
  /**
6
6
  * Minimalist color utilities for CLI output
@@ -975,9 +975,7 @@ declare function confirmDestructive(ctx: ConfirmContext, opts: {
975
975
  confirmed: boolean;
976
976
  isJson?: boolean;
977
977
  action: DestructiveAction;
978
- }): {
979
- exitCode: number;
980
- } | null;
978
+ }): CommandFailure | null;
981
979
 
982
980
  /**
983
981
  * Modern CLI formatting utilities with side border design
package/dist/index.js CHANGED
@@ -2358,12 +2358,22 @@ function confirmDestructive(ctx, opts) {
2358
2358
  return null;
2359
2359
  }
2360
2360
  const a = opts.action;
2361
+ const signal = buildConfirmationSignal(a);
2361
2362
  if (opts.isJson) {
2362
- ctx.ui?.json?.(buildConfirmationSignal(a));
2363
+ ctx.ui?.json?.(signal);
2363
2364
  } else {
2364
2365
  (ctx.ui?.warn ?? ctx.ui?.error)?.(renderDestructiveMessage(a));
2365
2366
  }
2366
- return { exitCode: 1 };
2367
+ return {
2368
+ ok: false,
2369
+ error: {
2370
+ code: "CONFIRMATION_REQUIRED",
2371
+ kind: "validation",
2372
+ message: signal.message,
2373
+ details: { ...signal }
2374
+ },
2375
+ result: signal
2376
+ };
2367
2377
  }
2368
2378
 
2369
2379
  // src/modern-format.ts