citadel_cli 1.1.7 → 1.4.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,2 +1,6 @@
1
1
  import { default as React } from 'react';
2
- export declare const AvailableCommands: React.FC;
2
+ interface AvailableCommandsProps {
3
+ currentInput?: string;
4
+ }
5
+ export declare const AvailableCommands: React.FC<AvailableCommandsProps>;
6
+ export {};
@@ -4,6 +4,8 @@ interface CommandOutputLineProps {
4
4
  command: string;
5
5
  timestamp: string;
6
6
  status: CommandStatus;
7
+ fontFamily?: string;
8
+ fontSize?: string;
7
9
  }
8
10
  export declare const CommandOutputLine: React.FC<CommandOutputLineProps>;
9
11
  export {};
@@ -14,7 +14,11 @@ import { CitadelConfig } from './types';
14
14
  * @property includeHelpCommand - When true, automatically adds a 'help' command that displays all available commands.
15
15
  * When false, no help command will be shown. Default: true.
16
16
  *
17
- * @property initialHeight - The initial CSS height of the interface. Default: '40vh'.
17
+ * @property fontFamily - The font family used by the interface. Default: 'monospace'.
18
+ *
19
+ * @property fontSize - The default font size used by the interface. Default: '0.875rem'.
20
+ *
21
+ * @property initialHeight - The initial CSS height of the interface. Default: '50vh'.
18
22
  *
19
23
  * @property logLevel - The logging level for the Citadel interface. Default: DEBUG in development, ERROR in production.
20
24
  *
@@ -22,7 +26,7 @@ import { CitadelConfig } from './types';
22
26
  *
23
27
  * @property minHeight - The minimum CSS height of the interface. Default: '200'.
24
28
  *
25
- * @property outputFontSize - The TailwindCSS class for the font size of the output text. Default: 'text-sm'.
29
+ * @property outputFontSize - The output font size as a CSS value. Default: '0.875rem'.
26
30
  *
27
31
  * @property resetStateOnHide - When true, hiding the interface (via Escape key or other means) will clear the command input.
28
32
  * When false, the interface preserves the last input when hidden. Default: false.
@@ -26,6 +26,17 @@ export interface CitadelConfig {
26
26
  * Whether to include the default help command in the command registry.
27
27
  */
28
28
  includeHelpCommand?: boolean;
29
+ /**
30
+ * The font family used by the interface.
31
+ * Accepts any valid CSS `font-family` value.
32
+ * Example: '"JetBrains Mono", monospace'
33
+ */
34
+ fontFamily?: string;
35
+ /**
36
+ * The default font size used by the interface.
37
+ * Accepts any valid CSS `font-size` value (e.g. '14px', '0.875rem').
38
+ */
39
+ fontSize?: string;
29
40
  /**
30
41
  * The initial height of the command interface.
31
42
  * Accepts any valid CSS height value.
@@ -49,8 +60,9 @@ export interface CitadelConfig {
49
60
  maxHeight?: string;
50
61
  minHeight?: string;
51
62
  /**
52
- * The font size for the command output text.
53
- * Accepts Tailwind text size classes: 'text-xs', 'text-sm', 'text-base', 'text-lg', etc.
63
+ * The font size for command output text.
64
+ * Accepts any valid CSS `font-size` value (e.g. '14px', '0.875rem').
65
+ * If omitted, output uses `fontSize`.
54
66
  */
55
67
  outputFontSize?: string;
56
68
  /**
@@ -0,0 +1,32 @@
1
+ import { CommandRegistry, CommandSegment } from './command-registry';
2
+ import { CommandResult, ErrorCommandResult, ImageCommandResult, JsonCommandResult, TextCommandResult } from './command-results';
3
+ export interface CommandExecutionContext<ArgName extends string = string> {
4
+ rawArgs: string[];
5
+ namedArgs: Record<ArgName, string | undefined>;
6
+ commandPath: string;
7
+ }
8
+ export type DslCommandHandler<ArgName extends string = string> = (context: CommandExecutionContext<ArgName>) => CommandResult | Promise<CommandResult>;
9
+ export interface CommandDefinition<ArgName extends string = string> {
10
+ path: string;
11
+ description: string;
12
+ details?: string;
13
+ segments: CommandSegment[];
14
+ handler: DslCommandHandler<ArgName>;
15
+ }
16
+ export interface ArgumentBuilderApi {
17
+ describe(description: string): this;
18
+ }
19
+ export interface CommandBuilderApi<ArgName extends string = never> {
20
+ describe(description: string): this;
21
+ details(details: string): this;
22
+ arg<Name extends string>(name: Name, configure?: (argument: ArgumentBuilderApi) => ArgumentBuilderApi | void): CommandBuilderApi<ArgName | Name>;
23
+ handle(handler: DslCommandHandler<ArgName>): CommandDefinition<ArgName>;
24
+ }
25
+ export declare function command(path: string): CommandBuilderApi;
26
+ export declare function registerCommand(registry: CommandRegistry, definition: CommandDefinition): void;
27
+ export declare function registerCommands(registry: CommandRegistry, definitions: CommandDefinition[]): CommandRegistry;
28
+ export declare function createCommandRegistry(definitions: CommandDefinition[]): CommandRegistry;
29
+ export declare function text(value: string): TextCommandResult;
30
+ export declare function json(value: unknown): JsonCommandResult;
31
+ export declare function image(url: string, altText?: string): ImageCommandResult;
32
+ export declare function error(value: string): ErrorCommandResult;
@@ -34,6 +34,8 @@ export declare class ArgumentSegment extends BaseSegment {
34
34
  readonly valid?: (() => boolean) | undefined;
35
35
  constructor(name: string, description?: string, value?: string | undefined, valid?: (() => boolean) | undefined);
36
36
  }
37
+ export declare const cloneCommandSegment: (segment: CommandSegment) => CommandSegment;
38
+ export declare const cloneCommandSegments: (segments: CommandSegment[]) => CommandSegment[];
37
39
  /** Defines a complete command with its path and behavior */
38
40
  export declare class CommandNode {
39
41
  private readonly _segments;
@@ -88,6 +90,16 @@ export declare class CommandRegistry {
88
90
  * @returns An array of completion strings.
89
91
  */
90
92
  getCompletionNames(path: string[]): string[];
93
+ /**
94
+ * Returns completion segments whose names start with the given prefix.
95
+ * Matching is case-insensitive.
96
+ */
97
+ getMatchingCompletions(path: string[], prefix: string): CommandSegment[];
98
+ /**
99
+ * Returns a single completion when prefix matching is unambiguous.
100
+ * Returns undefined for ambiguous or no-match prefixes.
101
+ */
102
+ getUniqueCompletion(path: string[], prefix: string): CommandSegment | undefined;
91
103
  /**
92
104
  * Gets an array of segments reachable from a given path
93
105
  *
@@ -1,3 +1,4 @@
1
1
  export * from './state';
2
2
  export * from './cursor';
3
3
  export * from './command-results';
4
+ export * from './command-dsl';
@@ -0,0 +1,7 @@
1
+ import { CSSProperties } from 'react';
2
+ interface TypographySettings {
3
+ style?: CSSProperties;
4
+ }
5
+ export declare const resolveTextSize: (size?: string) => TypographySettings;
6
+ export declare const resolveTypography: (fontFamily?: string, fontSize?: string) => TypographySettings;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { CommandRegistry } from '../components/Citadel/types/command-registry';
2
+ export declare function createDevOpsCommandRegistry(): CommandRegistry;
@@ -0,0 +1,2 @@
1
+ import { CommandRegistry } from '../components/Citadel/types/command-registry';
2
+ export declare function createLocalDevCommandRegistry(): CommandRegistry;
@@ -1,4 +1,5 @@
1
1
  import { CommandRegistry } from '../components/Citadel/types/command-registry';
2
+ import { CommandDefinition } from '../components/Citadel/types/command-dsl';
2
3
  import { CursorType } from '../components/Citadel/types/cursor';
3
4
  export type DisplayMode = 'panel' | 'inline';
4
5
  export declare const RUNTIME_CONFIG_CURSOR_TYPES: readonly CursorType[];
@@ -7,6 +8,8 @@ export interface RuntimeConfigControls {
7
8
  setCursorColor: (color: string) => void;
8
9
  setDisplayMode: (mode: DisplayMode) => void;
9
10
  setIncludeHelpCommand: (enabled: boolean) => void;
11
+ setMaxHeight: (value: string) => void;
10
12
  resetConfig: () => void;
11
13
  }
12
14
  export declare function registerRuntimeConfigCommands(registry: CommandRegistry, controls: RuntimeConfigControls): void;
15
+ export declare function createRuntimeConfigCommandDefinitions(controls: RuntimeConfigControls): CommandDefinition[];
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/jchilders/citadel_cli.git"
19
19
  },
20
- "version": "1.1.7",
20
+ "version": "1.4.0",
21
21
  "type": "module",
22
22
  "scripts": {
23
23
  "build": "tsc && vite build",
@@ -30,6 +30,11 @@
30
30
  "test:e2e": "playwright test",
31
31
  "test:e2e:ui": "playwright test --ui",
32
32
  "coverage": "vitest run --coverage",
33
+ "metrics:build": "node scripts/metrics/collect-build-metrics.mjs",
34
+ "metrics:runtime": "node scripts/metrics/collect-runtime-metrics.mjs",
35
+ "metrics:compare": "node scripts/metrics/compare-metrics.mjs",
36
+ "metrics:all": "node scripts/metrics/run-all-metrics.mjs",
37
+ "metrics:report": "node scripts/metrics/run-all-metrics.mjs --skip-build --skip-runtime",
33
38
  "postinstall": "playwright install"
34
39
  },
35
40
  "exports": {
@@ -39,7 +44,7 @@
39
44
  "import": "./dist/citadel.es.js",
40
45
  "require": "./dist/citadel.umd.cjs"
41
46
  },
42
- "./styles.css": "./dist/styles.css",
47
+ "./styles.css": "./dist/citadel.css",
43
48
  "./citadel.css": "./dist/citadel.css"
44
49
  },
45
50
  "types": "./dist/index.d.ts",
@@ -65,15 +70,13 @@
65
70
  "@types/react-dom": "^18.2.21",
66
71
  "@vitejs/plugin-react": "^4.3.3",
67
72
  "@vitest/coverage-v8": "^2.1.6",
68
- "autoprefixer": "^10.4.20",
69
73
  "eslint": "^9.13.0",
70
74
  "eslint-plugin-react-hooks": "^5.0.0",
75
+ "eslint-plugin-react-perf": "^3.3.3",
71
76
  "eslint-plugin-react-refresh": "^0.4.14",
72
77
  "globals": "^15.11.0",
73
78
  "jsdom": "^25.0.1",
74
79
  "playwright": "^1.49.0",
75
- "postcss": "^8.4.49",
76
- "tailwindcss": "^3.4.17",
77
80
  "typescript": "^5.4.2",
78
81
  "typescript-eslint": "^8.11.0",
79
82
  "vite": "^5.1.5",
package/dist/citadel.css DELETED
@@ -1 +0,0 @@
1
- ._panelContainer_1pav9_3{position:fixed;height:var(--citadel-default-height);min-height:var(--citadel-min-height);max-height:var(--citadel-max-height);background-color:var(--citadel-bg);overflow:hidden;width:100%;box-sizing:border-box;margin:0;padding:0;bottom:0;left:0;right:0}._innerContainer_1pav9_19{height:100%;flex:1;width:100%;display:flex;flex-direction:column;margin:0;padding:0}._inputSection_1pav9_29{border-top:1px solid var(--citadel-border);padding:1rem;margin:0;box-sizing:border-box}._resizeHandle_1pav9_36{width:100%;height:6px;background:transparent;cursor:ns-resize;position:absolute;top:-3px;left:0;right:0;z-index:10;-moz-user-select:none;user-select:none;-webkit-user-select:none;pointer-events:all}._resizeHandle_1pav9_36:hover{background:#ffffff1a}@keyframes _citadel_slideUp_1pav9_65{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _citadel_slideDown_1pav9_69{0%{transform:translateY(0)}to{transform:translateY(100%)}}._citadel_slideUp_1pav9_65{animation:_citadel_slideUp_1pav9_65 .2s ease-out forwards}._citadel_slideDown_1pav9_69{animation:_citadel_slideDown_1pav9_69 .2s ease-out forwards}._inlineContainer_1pav9_73{position:relative;width:100%;height:100%;display:flex;flex-direction:column;background-color:var(--citadel-bg);overflow:hidden;box-sizing:border-box}