@kb-labs/shared-cli-ui 1.0.0 → 1.1.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
@@ -89,6 +89,8 @@ interface LoaderOptions {
89
89
  /** Whether JSON mode is enabled (disables all visual feedback) */
90
90
  jsonMode?: boolean;
91
91
  }
92
+ declare function setJsonMode(enabled: boolean): void;
93
+ declare function isJsonMode(): boolean;
92
94
  declare class Loader {
93
95
  private isActive;
94
96
  private options;
@@ -1034,4 +1036,4 @@ declare function infoResult(title: string, data?: {
1034
1036
  timing?: number;
1035
1037
  }): CommandOutput;
1036
1038
 
1037
- export { type AnalyticsConfig, type ArtifactDisplayOptions, type ArtifactInfo, type BaseFlagSpec, type BooleanFlagSpec, type CLIPackage, type CommandContext, type CommandDiscovery, type CommandExecutionResult, type CommandInfo, type CommandManifest, type CommandOutput, type CommandPresenter, type CommandRegistry, type CommandResult, type CommandResultParams, type CommandRunnerOptions, type CommandSuggestion, DynamicCommandDiscovery, type EnvDefinition, type EnvSchema, type FlagDefinition, type FlagSpec, type FlagType, type FlagsDefinition, type FlagsSchema, type FormatTimestampOptions, type InferFlagsType, type KeyValueOptions, Loader, type LoaderOptions, type ManifestLoader, type MultiCLIContext, MultiCLISuggestions, type NumberFlagSpec, type RuntimeLike, type SafeKeyValueOptions, type SectionContent, type SideBorderBoxOptions, StaticCommandDiscovery, type StringFlagSpec, type TableColumn, type TableOptions, TimingTracker, accentLabel, box, bulletList, colors, createCommandDiscovery, createCommandRegistry, createCommandRunner, createDetailedResult, createKBLabsCommandDiscovery, createProgressBar, createSimpleResult, createSpinner, defineEnv, defineFlags, discoverArtifacts, displayArtifacts, displayArtifactsCompact, displaySingleArtifact, errorResult, extractCommandGroups, extractCommandIds, findCommandById, findCommandsByGroup, formatCommandHelp, formatCommandOutput, formatCommandResult, formatKeyValueTable, formatRelativeTime, formatSize, formatTable, formatTimestamp, formatTiming, formatTimingBreakdown, generateDevlinkSuggestions, generateGroupSuggestions, generateQuickActions, getCommandInfo, getContextCwd, hasAnsi, headline, indent, infoResult, isCommandAvailable, keyValue, mergeFlags, metricsList, muted, pad, parseBoolean, parseEnvFromRuntime, parseFlagsFromInput, parseNumber, parseNumberFlag, parseString, safeColors, safeKeyValue, safeSymbols, section, sectionHeader, showError, showLoading, showSuccess, sideBorderBox, statusLine, stripAnsi, successResult, supportsColor, symbols, table, toPosixPath, truncate, useLoader, validateSuggestions, warningResult };
1039
+ export { type AnalyticsConfig, type ArtifactDisplayOptions, type ArtifactInfo, type BaseFlagSpec, type BooleanFlagSpec, type CLIPackage, type CommandContext, type CommandDiscovery, type CommandExecutionResult, type CommandInfo, type CommandManifest, type CommandOutput, type CommandPresenter, type CommandRegistry, type CommandResult, type CommandResultParams, type CommandRunnerOptions, type CommandSuggestion, DynamicCommandDiscovery, type EnvDefinition, type EnvSchema, type FlagDefinition, type FlagSpec, type FlagType, type FlagsDefinition, type FlagsSchema, type FormatTimestampOptions, type InferFlagsType, type KeyValueOptions, Loader, type LoaderOptions, type ManifestLoader, type MultiCLIContext, MultiCLISuggestions, type NumberFlagSpec, type RuntimeLike, type SafeKeyValueOptions, type SectionContent, type SideBorderBoxOptions, StaticCommandDiscovery, type StringFlagSpec, type TableColumn, type TableOptions, TimingTracker, accentLabel, box, bulletList, colors, createCommandDiscovery, createCommandRegistry, createCommandRunner, createDetailedResult, createKBLabsCommandDiscovery, createProgressBar, createSimpleResult, createSpinner, defineEnv, defineFlags, discoverArtifacts, displayArtifacts, displayArtifactsCompact, displaySingleArtifact, errorResult, extractCommandGroups, extractCommandIds, findCommandById, findCommandsByGroup, formatCommandHelp, formatCommandOutput, formatCommandResult, formatKeyValueTable, formatRelativeTime, formatSize, formatTable, formatTimestamp, formatTiming, formatTimingBreakdown, generateDevlinkSuggestions, generateGroupSuggestions, generateQuickActions, getCommandInfo, getContextCwd, hasAnsi, headline, indent, infoResult, isCommandAvailable, isJsonMode, keyValue, mergeFlags, metricsList, muted, pad, parseBoolean, parseEnvFromRuntime, parseFlagsFromInput, parseNumber, parseNumberFlag, parseString, safeColors, safeKeyValue, safeSymbols, section, sectionHeader, setJsonMode, showError, showLoading, showSuccess, sideBorderBox, statusLine, stripAnsi, successResult, supportsColor, symbols, table, toPosixPath, truncate, useLoader, validateSuggestions, warningResult };
package/dist/index.d.ts CHANGED
@@ -89,6 +89,8 @@ interface LoaderOptions {
89
89
  /** Whether JSON mode is enabled (disables all visual feedback) */
90
90
  jsonMode?: boolean;
91
91
  }
92
+ declare function setJsonMode(enabled: boolean): void;
93
+ declare function isJsonMode(): boolean;
92
94
  declare class Loader {
93
95
  private isActive;
94
96
  private options;
@@ -1034,4 +1036,4 @@ declare function infoResult(title: string, data?: {
1034
1036
  timing?: number;
1035
1037
  }): CommandOutput;
1036
1038
 
1037
- export { type AnalyticsConfig, type ArtifactDisplayOptions, type ArtifactInfo, type BaseFlagSpec, type BooleanFlagSpec, type CLIPackage, type CommandContext, type CommandDiscovery, type CommandExecutionResult, type CommandInfo, type CommandManifest, type CommandOutput, type CommandPresenter, type CommandRegistry, type CommandResult, type CommandResultParams, type CommandRunnerOptions, type CommandSuggestion, DynamicCommandDiscovery, type EnvDefinition, type EnvSchema, type FlagDefinition, type FlagSpec, type FlagType, type FlagsDefinition, type FlagsSchema, type FormatTimestampOptions, type InferFlagsType, type KeyValueOptions, Loader, type LoaderOptions, type ManifestLoader, type MultiCLIContext, MultiCLISuggestions, type NumberFlagSpec, type RuntimeLike, type SafeKeyValueOptions, type SectionContent, type SideBorderBoxOptions, StaticCommandDiscovery, type StringFlagSpec, type TableColumn, type TableOptions, TimingTracker, accentLabel, box, bulletList, colors, createCommandDiscovery, createCommandRegistry, createCommandRunner, createDetailedResult, createKBLabsCommandDiscovery, createProgressBar, createSimpleResult, createSpinner, defineEnv, defineFlags, discoverArtifacts, displayArtifacts, displayArtifactsCompact, displaySingleArtifact, errorResult, extractCommandGroups, extractCommandIds, findCommandById, findCommandsByGroup, formatCommandHelp, formatCommandOutput, formatCommandResult, formatKeyValueTable, formatRelativeTime, formatSize, formatTable, formatTimestamp, formatTiming, formatTimingBreakdown, generateDevlinkSuggestions, generateGroupSuggestions, generateQuickActions, getCommandInfo, getContextCwd, hasAnsi, headline, indent, infoResult, isCommandAvailable, keyValue, mergeFlags, metricsList, muted, pad, parseBoolean, parseEnvFromRuntime, parseFlagsFromInput, parseNumber, parseNumberFlag, parseString, safeColors, safeKeyValue, safeSymbols, section, sectionHeader, showError, showLoading, showSuccess, sideBorderBox, statusLine, stripAnsi, successResult, supportsColor, symbols, table, toPosixPath, truncate, useLoader, validateSuggestions, warningResult };
1039
+ export { type AnalyticsConfig, type ArtifactDisplayOptions, type ArtifactInfo, type BaseFlagSpec, type BooleanFlagSpec, type CLIPackage, type CommandContext, type CommandDiscovery, type CommandExecutionResult, type CommandInfo, type CommandManifest, type CommandOutput, type CommandPresenter, type CommandRegistry, type CommandResult, type CommandResultParams, type CommandRunnerOptions, type CommandSuggestion, DynamicCommandDiscovery, type EnvDefinition, type EnvSchema, type FlagDefinition, type FlagSpec, type FlagType, type FlagsDefinition, type FlagsSchema, type FormatTimestampOptions, type InferFlagsType, type KeyValueOptions, Loader, type LoaderOptions, type ManifestLoader, type MultiCLIContext, MultiCLISuggestions, type NumberFlagSpec, type RuntimeLike, type SafeKeyValueOptions, type SectionContent, type SideBorderBoxOptions, StaticCommandDiscovery, type StringFlagSpec, type TableColumn, type TableOptions, TimingTracker, accentLabel, box, bulletList, colors, createCommandDiscovery, createCommandRegistry, createCommandRunner, createDetailedResult, createKBLabsCommandDiscovery, createProgressBar, createSimpleResult, createSpinner, defineEnv, defineFlags, discoverArtifacts, displayArtifacts, displayArtifactsCompact, displaySingleArtifact, errorResult, extractCommandGroups, extractCommandIds, findCommandById, findCommandsByGroup, formatCommandHelp, formatCommandOutput, formatCommandResult, formatKeyValueTable, formatRelativeTime, formatSize, formatTable, formatTimestamp, formatTiming, formatTimingBreakdown, generateDevlinkSuggestions, generateGroupSuggestions, generateQuickActions, getCommandInfo, getContextCwd, hasAnsi, headline, indent, infoResult, isCommandAvailable, isJsonMode, keyValue, mergeFlags, metricsList, muted, pad, parseBoolean, parseEnvFromRuntime, parseFlagsFromInput, parseNumber, parseNumberFlag, parseString, safeColors, safeKeyValue, safeSymbols, section, sectionHeader, setJsonMode, showError, showLoading, showSuccess, sideBorderBox, statusLine, stripAnsi, successResult, supportsColor, symbols, table, toPosixPath, truncate, useLoader, validateSuggestions, warningResult };
package/dist/index.js CHANGED
@@ -131,6 +131,13 @@ var safeSymbols = {
131
131
 
132
132
  // src/loader.ts
133
133
  var SPINNER_CHARS = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
134
+ var _jsonMode = false;
135
+ function setJsonMode(enabled) {
136
+ _jsonMode = enabled;
137
+ }
138
+ function isJsonMode() {
139
+ return _jsonMode;
140
+ }
134
141
  var Loader = class {
135
142
  isActive = false;
136
143
  options;
@@ -241,7 +248,7 @@ function showError(text, jsonMode = false) {
241
248
  }
242
249
  }
243
250
  function useLoader(text, options) {
244
- return new Loader({ text, ...options });
251
+ return new Loader({ text, jsonMode: _jsonMode, ...options });
245
252
  }
246
253
 
247
254
  // src/format.ts
@@ -380,7 +387,7 @@ function getOffsetMinutes(date, timeZone) {
380
387
  const year = lookup.year ?? date.getUTCFullYear();
381
388
  const month = (lookup.month ?? date.getUTCMonth() + 1) - 1;
382
389
  const day = lookup.day ?? date.getUTCDate();
383
- const hour = lookup.hour ?? date.getUTCHours();
390
+ const hour = (lookup.hour ?? date.getUTCHours()) % 24;
384
391
  const minute = lookup.minute ?? date.getUTCMinutes();
385
392
  const second = lookup.second ?? date.getUTCSeconds();
386
393
  const asUTC = Date.UTC(year, month, day, hour, minute, second);
@@ -422,7 +429,8 @@ function getDateParts(date, timeZone) {
422
429
  year: lookup.year ?? date.getUTCFullYear(),
423
430
  month: lookup.month ?? date.getUTCMonth() + 1,
424
431
  day: lookup.day ?? date.getUTCDate(),
425
- hour: lookup.hour ?? date.getUTCHours(),
432
+ // Intl.DateTimeFormat with hour12:false may return 24 for midnight, normalize to 0
433
+ hour: (lookup.hour ?? date.getUTCHours()) % 24,
426
434
  minute: lookup.minute ?? date.getUTCMinutes(),
427
435
  second: lookup.second ?? date.getUTCSeconds()
428
436
  };
@@ -2511,6 +2519,6 @@ function infoResult(title, data) {
2511
2519
  });
2512
2520
  }
2513
2521
 
2514
- export { DebugOutput, DebugSection, DebugTrace, DebugTree, DynamicCommandDiscovery, Loader, MultiCLISuggestions, StaticCommandDiscovery, TimingTracker, accentLabel, box, bulletList, colors, createCommandDiscovery, createCommandRegistry, createCommandRunner, createDebugTree, createDetailedResult, createKBLabsCommandDiscovery, createProgressBar, createSimpleResult, createSpinner, defineEnv, defineFlags, describeEntriesAI, describeEntriesHuman, describeEntriesTimeline, discoverArtifacts, displayArtifacts, displayArtifactsCompact, displaySingleArtifact, errorResult, exportDebugEntries, exportToChromeFormat, exportToJSON, exportToPlainText, extractCommandGroups, extractCommandIds, filterByLevel, filterByNamespace, filterByTimeRange, filterDebugEntries, findCommandById, findCommandsByGroup, formatCommandHelp, formatCommandOutput, formatCommandResult, formatDebugEntriesAI, formatDebugEntriesHuman, formatDebugEntryAI, formatDebugEntryHuman, formatDebugOutput, formatDebugOutputs, formatKeyValueTable, formatRelativeTime, formatSize, formatTable, formatTimeline, formatTimelineNode, formatTimelineWithSummary, formatTimestamp, formatTiming, formatTimingBreakdown, generateDevlinkSuggestions, generateGroupSuggestions, generateQuickActions, getCommandInfo, getContextCwd, groupByGroup, groupByNamespace, hasAnsi, headline, indent, infoResult, isCommandAvailable, keyValue, mergeFlags, metricsList, muted, pad, parseBoolean, parseEnvFromRuntime, parseFlagsFromInput, parseNumber, parseNumberFlag, parseString, safeColors, safeKeyValue, safeSymbols, searchInLogs, section, sectionHeader, shouldUseAIFormat, showError, showLoading, showSuccess, sideBorderBox, statusLine, stripAnsi, successResult, supportsColor, symbols, table, toPosixPath, truncate, useLoader, validateSuggestions, warningResult };
2522
+ export { DebugOutput, DebugSection, DebugTrace, DebugTree, DynamicCommandDiscovery, Loader, MultiCLISuggestions, StaticCommandDiscovery, TimingTracker, accentLabel, box, bulletList, colors, createCommandDiscovery, createCommandRegistry, createCommandRunner, createDebugTree, createDetailedResult, createKBLabsCommandDiscovery, createProgressBar, createSimpleResult, createSpinner, defineEnv, defineFlags, describeEntriesAI, describeEntriesHuman, describeEntriesTimeline, discoverArtifacts, displayArtifacts, displayArtifactsCompact, displaySingleArtifact, errorResult, exportDebugEntries, exportToChromeFormat, exportToJSON, exportToPlainText, extractCommandGroups, extractCommandIds, filterByLevel, filterByNamespace, filterByTimeRange, filterDebugEntries, findCommandById, findCommandsByGroup, formatCommandHelp, formatCommandOutput, formatCommandResult, formatDebugEntriesAI, formatDebugEntriesHuman, formatDebugEntryAI, formatDebugEntryHuman, formatDebugOutput, formatDebugOutputs, formatKeyValueTable, formatRelativeTime, formatSize, formatTable, formatTimeline, formatTimelineNode, formatTimelineWithSummary, formatTimestamp, formatTiming, formatTimingBreakdown, generateDevlinkSuggestions, generateGroupSuggestions, generateQuickActions, getCommandInfo, getContextCwd, groupByGroup, groupByNamespace, hasAnsi, headline, indent, infoResult, isCommandAvailable, isJsonMode, keyValue, mergeFlags, metricsList, muted, pad, parseBoolean, parseEnvFromRuntime, parseFlagsFromInput, parseNumber, parseNumberFlag, parseString, safeColors, safeKeyValue, safeSymbols, searchInLogs, section, sectionHeader, setJsonMode, shouldUseAIFormat, showError, showLoading, showSuccess, sideBorderBox, statusLine, stripAnsi, successResult, supportsColor, symbols, table, toPosixPath, truncate, useLoader, validateSuggestions, warningResult };
2515
2523
  //# sourceMappingURL=index.js.map
2516
2524
  //# sourceMappingURL=index.js.map