ohbaby-cli 0.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.
Files changed (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -0
  3. package/dist/bin.d.ts +19 -0
  4. package/dist/bin.d.ts.map +1 -0
  5. package/dist/bin.js +5705 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/cli/commands/run.d.ts +8 -0
  8. package/dist/cli/commands/run.d.ts.map +1 -0
  9. package/dist/cli/commands/serve.d.ts +13 -0
  10. package/dist/cli/commands/serve.d.ts.map +1 -0
  11. package/dist/cli/commands/terminal.d.ts +13 -0
  12. package/dist/cli/commands/terminal.d.ts.map +1 -0
  13. package/dist/cli/commands/types.d.ts +64 -0
  14. package/dist/cli/commands/types.d.ts.map +1 -0
  15. package/dist/cli/exit-codes.d.ts +7 -0
  16. package/dist/cli/exit-codes.d.ts.map +1 -0
  17. package/dist/cli/stdin.d.ts +3 -0
  18. package/dist/cli/stdin.d.ts.map +1 -0
  19. package/dist/cli/stdout-renderer.d.ts +10 -0
  20. package/dist/cli/stdout-renderer.d.ts.map +1 -0
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +5215 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/package-version.d.ts +2 -0
  26. package/dist/package-version.d.ts.map +1 -0
  27. package/dist/tui/app.d.ts +10 -0
  28. package/dist/tui/app.d.ts.map +1 -0
  29. package/dist/tui/components/dialog/command-panel-manager.d.ts +14 -0
  30. package/dist/tui/components/dialog/command-panel-manager.d.ts.map +1 -0
  31. package/dist/tui/components/dialog/command-panel-state.d.ts +25 -0
  32. package/dist/tui/components/dialog/command-panel-state.d.ts.map +1 -0
  33. package/dist/tui/components/dialog/connect-panel.d.ts +9 -0
  34. package/dist/tui/components/dialog/connect-panel.d.ts.map +1 -0
  35. package/dist/tui/components/dialog/overlay-card.d.ts +7 -0
  36. package/dist/tui/components/dialog/overlay-card.d.ts.map +1 -0
  37. package/dist/tui/components/header.d.ts +6 -0
  38. package/dist/tui/components/header.d.ts.map +1 -0
  39. package/dist/tui/components/logo.d.ts +3 -0
  40. package/dist/tui/components/logo.d.ts.map +1 -0
  41. package/dist/tui/components/message/message-list.d.ts +10 -0
  42. package/dist/tui/components/message/message-list.d.ts.map +1 -0
  43. package/dist/tui/components/message/message-row.d.ts +50 -0
  44. package/dist/tui/components/message/message-row.d.ts.map +1 -0
  45. package/dist/tui/components/message/notice-banner.d.ts +9 -0
  46. package/dist/tui/components/message/notice-banner.d.ts.map +1 -0
  47. package/dist/tui/components/message/parts/tool-part.d.ts +10 -0
  48. package/dist/tui/components/message/parts/tool-part.d.ts.map +1 -0
  49. package/dist/tui/components/prompt/completion.d.ts +9 -0
  50. package/dist/tui/components/prompt/completion.d.ts.map +1 -0
  51. package/dist/tui/components/prompt/editor-reducer.d.ts +46 -0
  52. package/dist/tui/components/prompt/editor-reducer.d.ts.map +1 -0
  53. package/dist/tui/components/prompt/index.d.ts +21 -0
  54. package/dist/tui/components/prompt/index.d.ts.map +1 -0
  55. package/dist/tui/components/shimmer-text.d.ts +28 -0
  56. package/dist/tui/components/shimmer-text.d.ts.map +1 -0
  57. package/dist/tui/components/spinner.d.ts +8 -0
  58. package/dist/tui/components/spinner.d.ts.map +1 -0
  59. package/dist/tui/components/transcript/command-notice-lane.d.ts +6 -0
  60. package/dist/tui/components/transcript/command-notice-lane.d.ts.map +1 -0
  61. package/dist/tui/components/transcript/committed-transcript.d.ts +13 -0
  62. package/dist/tui/components/transcript/committed-transcript.d.ts.map +1 -0
  63. package/dist/tui/components/transcript/live-tail-window.d.ts +14 -0
  64. package/dist/tui/components/transcript/live-tail-window.d.ts.map +1 -0
  65. package/dist/tui/components/transcript/live-tail.d.ts +6 -0
  66. package/dist/tui/components/transcript/live-tail.d.ts.map +1 -0
  67. package/dist/tui/components/transcript/notice-lane.d.ts +6 -0
  68. package/dist/tui/components/transcript/notice-lane.d.ts.map +1 -0
  69. package/dist/tui/components/transcript/transcript-viewport.d.ts +13 -0
  70. package/dist/tui/components/transcript/transcript-viewport.d.ts.map +1 -0
  71. package/dist/tui/components/working-phrases.d.ts +13 -0
  72. package/dist/tui/components/working-phrases.d.ts.map +1 -0
  73. package/dist/tui/components/working-spinner.d.ts +12 -0
  74. package/dist/tui/components/working-spinner.d.ts.map +1 -0
  75. package/dist/tui/dialogs/confirm.d.ts +9 -0
  76. package/dist/tui/dialogs/confirm.d.ts.map +1 -0
  77. package/dist/tui/dialogs/manager.d.ts +10 -0
  78. package/dist/tui/dialogs/manager.d.ts.map +1 -0
  79. package/dist/tui/dialogs/model-dialog.d.ts +9 -0
  80. package/dist/tui/dialogs/model-dialog.d.ts.map +1 -0
  81. package/dist/tui/dialogs/permission-dialog.d.ts +8 -0
  82. package/dist/tui/dialogs/permission-dialog.d.ts.map +1 -0
  83. package/dist/tui/dialogs/select-one.d.ts +10 -0
  84. package/dist/tui/dialogs/select-one.d.ts.map +1 -0
  85. package/dist/tui/dialogs/session-dialog.d.ts +10 -0
  86. package/dist/tui/dialogs/session-dialog.d.ts.map +1 -0
  87. package/dist/tui/index.d.ts +6 -0
  88. package/dist/tui/index.d.ts.map +1 -0
  89. package/dist/tui/layout/app-shell.d.ts +6 -0
  90. package/dist/tui/layout/app-shell.d.ts.map +1 -0
  91. package/dist/tui/layout/context.d.ts +9 -0
  92. package/dist/tui/layout/context.d.ts.map +1 -0
  93. package/dist/tui/layout/metrics.d.ts +13 -0
  94. package/dist/tui/layout/metrics.d.ts.map +1 -0
  95. package/dist/tui/render/highlight.d.ts +2 -0
  96. package/dist/tui/render/highlight.d.ts.map +1 -0
  97. package/dist/tui/render/logo.d.ts +5 -0
  98. package/dist/tui/render/logo.d.ts.map +1 -0
  99. package/dist/tui/render/markdown.d.ts +5 -0
  100. package/dist/tui/render/markdown.d.ts.map +1 -0
  101. package/dist/tui/render/status-panel.d.ts +2 -0
  102. package/dist/tui/render/status-panel.d.ts.map +1 -0
  103. package/dist/tui/render/usage.d.ts +3 -0
  104. package/dist/tui/render/usage.d.ts.map +1 -0
  105. package/dist/tui/render/wrap.d.ts +4 -0
  106. package/dist/tui/render/wrap.d.ts.map +1 -0
  107. package/dist/tui/slash-commands/completions.d.ts +7 -0
  108. package/dist/tui/slash-commands/completions.d.ts.map +1 -0
  109. package/dist/tui/slash-commands/hints.d.ts +5 -0
  110. package/dist/tui/slash-commands/hints.d.ts.map +1 -0
  111. package/dist/tui/slash-commands/runtime.d.ts +23 -0
  112. package/dist/tui/slash-commands/runtime.d.ts.map +1 -0
  113. package/dist/tui/store/events.d.ts +7 -0
  114. package/dist/tui/store/events.d.ts.map +1 -0
  115. package/dist/tui/store/selectors/transcript.d.ts +19 -0
  116. package/dist/tui/store/selectors/transcript.d.ts.map +1 -0
  117. package/dist/tui/store/selectors.d.ts +9 -0
  118. package/dist/tui/store/selectors.d.ts.map +1 -0
  119. package/dist/tui/store/snapshot.d.ts +82 -0
  120. package/dist/tui/store/snapshot.d.ts.map +1 -0
  121. package/dist/tui/store/stream-coalescer.d.ts +10 -0
  122. package/dist/tui/store/stream-coalescer.d.ts.map +1 -0
  123. package/dist/tui/store/transcript.d.ts +43 -0
  124. package/dist/tui/store/transcript.d.ts.map +1 -0
  125. package/dist/tui/theme/colors.d.ts +55 -0
  126. package/dist/tui/theme/colors.d.ts.map +1 -0
  127. package/dist/tui/theme/detect.d.ts +12 -0
  128. package/dist/tui/theme/detect.d.ts.map +1 -0
  129. package/dist/tui/theme/index.d.ts +14 -0
  130. package/dist/tui/theme/index.d.ts.map +1 -0
  131. package/dist/tui/theme/tokens.d.ts +61 -0
  132. package/dist/tui/theme/tokens.d.ts.map +1 -0
  133. package/package.json +55 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,QAAQ,CAQrE"}
@@ -0,0 +1,6 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ export interface AppShellProps {
3
+ readonly children: ReactNode;
4
+ }
5
+ export declare function AppShell({ children }: AppShellProps): ReactElement;
6
+ //# sourceMappingURL=app-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/tui/layout/app-shell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,aAAa,GAAG,YAAY,CAsBlE"}
@@ -0,0 +1,9 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type TuiLayoutMetrics } from "./metrics.js";
3
+ export interface LayoutProviderProps {
4
+ readonly children: ReactNode;
5
+ readonly value: TuiLayoutMetrics;
6
+ }
7
+ export declare function LayoutProvider({ children, value, }: LayoutProviderProps): ReactElement;
8
+ export declare function useTuiLayout(): TuiLayoutMetrics;
9
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/tui/layout/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAM3E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;CAClC;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,KAAK,GACN,EAAE,mBAAmB,GAAG,YAAY,CAIpC;AAED,wBAAgB,YAAY,IAAI,gBAAgB,CAE/C"}
@@ -0,0 +1,13 @@
1
+ export interface TuiLayoutMetrics {
2
+ readonly columns: number;
3
+ readonly rows: number;
4
+ readonly contentWidth: number;
5
+ readonly horizontalPadding: number;
6
+ readonly isCompact: boolean;
7
+ readonly liveTailRows: number;
8
+ }
9
+ export declare function computeLayoutMetrics(input: {
10
+ readonly columns: number;
11
+ readonly rows: number;
12
+ }): TuiLayoutMetrics;
13
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/tui/layout/metrics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAUD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,GAAG,gBAAgB,CA+BnB"}
@@ -0,0 +1,2 @@
1
+ export declare function highlightCode(code: string): string[];
2
+ //# sourceMappingURL=highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../src/tui/render/highlight.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpD"}
@@ -0,0 +1,5 @@
1
+ export interface LogoRenderOptions {
2
+ readonly maxWidth?: number;
3
+ }
4
+ export declare function renderOhbabyLogo(options?: LogoRenderOptions): readonly string[];
5
+ //# sourceMappingURL=logo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../../src/tui/render/logo.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,iBAAsB,GAC9B,SAAS,MAAM,EAAE,CAUnB"}
@@ -0,0 +1,5 @@
1
+ export interface MarkdownRenderOptions {
2
+ readonly width: number;
3
+ }
4
+ export declare function mdToAnsi(markdown: string, options: MarkdownRenderOptions): string[];
5
+ //# sourceMappingURL=markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/tui/render/markdown.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,GAC7B,MAAM,EAAE,CAiFV"}
@@ -0,0 +1,2 @@
1
+ export declare function renderStatusPanel(data: Record<string, unknown>): string;
2
+ //# sourceMappingURL=status-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-panel.d.ts","sourceRoot":"","sources":["../../../src/tui/render/status-panel.ts"],"names":[],"mappings":"AAeA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAgCvE"}
@@ -0,0 +1,3 @@
1
+ import type { UiContextWindowUsage } from "ohbaby-sdk";
2
+ export declare function formatContextWindowUsage(usage: UiContextWindowUsage | null | undefined): string;
3
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/tui/render/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAC7C,MAAM,CAWR"}
@@ -0,0 +1,4 @@
1
+ export declare function visibleWidth(input: string): number;
2
+ export declare function wrapAnsi(input: string, width: number): string[];
3
+ export declare function truncateAnsi(input: string, width: number): string;
4
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../../src/tui/render/wrap.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASlD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqC/D;AAkED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAoCjE"}
@@ -0,0 +1,7 @@
1
+ import type { TuiCommandCatalog, TuiCommandSpec } from "../store/snapshot.js";
2
+ export declare function getSlashCompletion(input: string, catalog: TuiCommandCatalog | null, selectedIndex?: number): string;
3
+ export declare function getSlashCompletionCandidates(input: string, catalog: TuiCommandCatalog | null): readonly TuiCommandSpec[];
4
+ export declare function getSlashCompletionWindow(input: string, catalog: TuiCommandCatalog | null, selectedIndex: number): readonly TuiCommandSpec[];
5
+ export declare function getSlashCompletionWindowStart(candidateCount: number, selectedIndex: number): number;
6
+ export declare function getSlashCompletionPageIndex(candidateCount: number, selectedIndex: number, direction: "next" | "previous"): number;
7
+ //# sourceMappingURL=completions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../../src/tui/slash-commands/completions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQ9E,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GAAG,IAAI,EACjC,aAAa,SAAI,GAChB,MAAM,CAeR;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAChC,SAAS,cAAc,EAAE,CAQ3B;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GAAG,IAAI,EACjC,aAAa,EAAE,MAAM,GACpB,SAAS,cAAc,EAAE,CAK3B;AAED,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GACpB,MAAM,CAaR;AAED,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAC7B,MAAM,CAuBR"}
@@ -0,0 +1,5 @@
1
+ import type { TuiCommandSpec } from "../store/snapshot.js";
2
+ export declare const COMMAND_HINT_LIMIT = 6;
3
+ export declare function formatCommandHint(command: TuiCommandSpec): string;
4
+ export declare function formatCommandHints(commands: readonly TuiCommandSpec[]): readonly string[];
5
+ //# sourceMappingURL=hints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../../src/tui/slash-commands/hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAGpC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAClC,SAAS,MAAM,EAAE,CAEnB"}
@@ -0,0 +1,23 @@
1
+ import { type UiCommandInvocation, type UiCommandSpec, type UiParsedSlashInput } from "ohbaby-sdk";
2
+ import type { TuiCommandCatalog } from "../store/snapshot.js";
3
+ export type ParsedSlashInput = UiParsedSlashInput | null;
4
+ export type ResolveCommandResult = {
5
+ readonly kind: "resolved";
6
+ readonly command: UiCommandSpec;
7
+ readonly invocation: UiCommandInvocation;
8
+ } | {
9
+ readonly kind: "not-found";
10
+ readonly reason: string;
11
+ } | {
12
+ readonly kind: "not-slash";
13
+ readonly reason: string;
14
+ };
15
+ export interface CommandRuntimeOptions {
16
+ readonly surface: "tui";
17
+ readonly sessionId?: string;
18
+ }
19
+ export declare function parseSlashInput(input: string): ParsedSlashInput;
20
+ export declare function resolveCommand(parsed: ParsedSlashInput, catalog: TuiCommandCatalog, options: CommandRuntimeOptions): ResolveCommandResult;
21
+ export declare function filterCommandCatalog(parsed: ParsedSlashInput, catalog: TuiCommandCatalog, options: Pick<CommandRuntimeOptions, "surface">): readonly UiCommandSpec[];
22
+ export declare function applySlashCompletion(input: string, catalog: TuiCommandCatalog, options: Pick<CommandRuntimeOptions, "surface">): string;
23
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tui/slash-commands/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC1C,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAE/D;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,qBAAqB,GAC7B,oBAAoB,CAiCtB;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAC9C,SAAS,aAAa,EAAE,CAQ1B;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAC9C,MAAM,CAYR"}
@@ -0,0 +1,7 @@
1
+ import type { UiSnapshot } from "ohbaby-sdk";
2
+ import type { TuiCommandCatalog, TuiEvent, TuiStore, TuiStoreState } from "./snapshot.js";
3
+ export declare function createStateFromSnapshot(snapshot: UiSnapshot): TuiStoreState;
4
+ export declare function applyTuiEvent(state: TuiStoreState, event: TuiEvent): TuiStoreState;
5
+ export declare function setCommandCatalog(state: TuiStoreState, catalog: TuiCommandCatalog): TuiStoreState;
6
+ export declare function createTuiStore(snapshot: UiSnapshot): TuiStore;
7
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/tui/store/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAWV,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,iBAAiB,EAEjB,QAAQ,EAGR,QAAQ,EACR,aAAa,EACd,MAAM,eAAe,CAAC;AAYvB,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,aAAa,CA+B3E;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,QAAQ,GACd,aAAa,CAqOf;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,iBAAiB,GACzB,aAAa,CAMf;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAiD7D"}
@@ -0,0 +1,19 @@
1
+ import type { UiMessage, UiNotice } from "ohbaby-sdk";
2
+ import type { TuiCommandNotice, TuiStoreState } from "../snapshot.js";
3
+ import type { TranscriptItem } from "../transcript.js";
4
+ export interface TranscriptSplitSelection {
5
+ readonly committedItems: readonly TranscriptItem[];
6
+ readonly liveMessage: UiMessage | null;
7
+ }
8
+ export interface NoticeLaneState {
9
+ readonly notices: readonly UiNotice[];
10
+ }
11
+ export interface CommandNoticeLaneState {
12
+ readonly commandNotices: readonly TuiCommandNotice[];
13
+ }
14
+ export declare function selectCommittedItems(state: TuiStoreState): readonly TranscriptItem[];
15
+ export declare function selectLiveMessage(state: TuiStoreState): UiMessage | null;
16
+ export declare function selectTranscriptSplit(state: TuiStoreState): TranscriptSplitSelection;
17
+ export declare function selectNoticeLaneState(state: TuiStoreState): NoticeLaneState;
18
+ export declare function selectCommandNoticeLaneState(state: TuiStoreState): CommandNoticeLaneState;
19
+ //# sourceMappingURL=transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/tui/store/selectors/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,cAAc,EAAE,SAAS,cAAc,EAAE,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,QAAQ,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,cAAc,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACtD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,GACnB,SAAS,cAAc,EAAE,CAE3B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAExE;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,aAAa,GACnB,wBAAwB,CAK1B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,CAE3E;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,aAAa,GACnB,sBAAsB,CAExB"}
@@ -0,0 +1,9 @@
1
+ import type { UiContextWindowUsage } from "ohbaby-sdk";
2
+ import type { TuiInteractionRequest, TuiRuntimeStatus, TuiStore, TuiStoreState } from "./snapshot.js";
3
+ export declare function selectActiveDialog(state: TuiStoreState): TuiInteractionRequest | undefined;
4
+ export declare function selectHasActivePermission(state: TuiStoreState): boolean;
5
+ export declare function selectEffectiveRuntime(state: TuiStoreState): TuiRuntimeStatus;
6
+ export declare function selectActiveContextWindowUsage(state: TuiStoreState): UiContextWindowUsage | null;
7
+ export declare function selectRuntimeLabel(state: TuiStoreState): string;
8
+ export declare function useTuiStoreSelector<TSelected>(store: TuiStore, selector: (state: TuiStoreState) => TSelected): TSelected;
9
+ //# sourceMappingURL=selectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/tui/store/selectors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,aAAa,GACnB,qBAAqB,GAAG,SAAS,CAEnC;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAQ7E;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,aAAa,GACnB,oBAAoB,GAAG,IAAI,CAU7B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAa/D;AAyBD,wBAAgB,mBAAmB,CAAC,SAAS,EAC3C,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,GAC5C,SAAS,CAMX"}
@@ -0,0 +1,82 @@
1
+ import type { CoreAPI, UiCommandCatalog, UiCommandInvocation, UiCommandSpec, UiContextWindowUsage, UiEvent as SdkUiEvent, UiEventHandler, UiInteractionKind, UiMessage, UiNotice, UiPermissionState, UiPermissionRequest, UiRun, UiRunStatus, UiSession, UiSnapshot, UiUnsubscribe } from "ohbaby-sdk";
2
+ import type { TranscriptItem } from "./transcript.js";
3
+ export type TuiRuntimeStatus = UiRunStatus;
4
+ export type TuiCommandSpec = UiCommandSpec;
5
+ export type TuiCommandCatalog = UiCommandCatalog;
6
+ export interface TuiCommandCatalogInvalidation {
7
+ readonly version?: string;
8
+ readonly reason?: string;
9
+ }
10
+ export interface TuiCommandInvocation extends UiCommandInvocation {
11
+ readonly surface: "tui";
12
+ }
13
+ export interface TuiCommandNotice {
14
+ readonly id: string;
15
+ readonly kind: "result" | "error";
16
+ readonly commandId: string;
17
+ readonly clientInvocationId?: string;
18
+ readonly sessionId?: string;
19
+ readonly text: string;
20
+ }
21
+ export interface TuiInteractionOption {
22
+ readonly id: string;
23
+ readonly label: string;
24
+ readonly description?: string;
25
+ readonly metadata?: Record<string, unknown>;
26
+ }
27
+ export type TuiInteractionSubject = string;
28
+ export interface TuiInteractionRequest {
29
+ readonly interactionId: string;
30
+ readonly kind: UiInteractionKind;
31
+ readonly subject: TuiInteractionSubject;
32
+ readonly title?: string;
33
+ readonly message?: string;
34
+ readonly options?: readonly TuiInteractionOption[];
35
+ }
36
+ export type TuiEvent = SdkUiEvent | {
37
+ readonly type: "message.part.delta";
38
+ readonly sessionId: string;
39
+ readonly messageId: string;
40
+ readonly partId?: string;
41
+ readonly delta: string;
42
+ readonly content?: string;
43
+ readonly timestamp?: number;
44
+ } | {
45
+ readonly type: "snapshot.replaced";
46
+ readonly snapshot: UiSnapshot;
47
+ };
48
+ export type TuiEventHandler = (event: TuiEvent) => void;
49
+ export type TerminalClient = CoreAPI & {
50
+ readonly subscribeEvents: (handler: TuiEventHandler | UiEventHandler) => UiUnsubscribe;
51
+ };
52
+ export interface TuiStoreState {
53
+ readonly snapshot: UiSnapshot;
54
+ readonly activeSessionId: string | null;
55
+ readonly sessions: readonly UiSession[];
56
+ readonly messages: readonly UiMessage[];
57
+ readonly runs: readonly UiRun[];
58
+ readonly permissions: readonly UiPermissionRequest[];
59
+ readonly permission: UiPermissionState | undefined;
60
+ readonly runtime: TuiRuntimeStatus;
61
+ readonly interactions: readonly TuiInteractionRequest[];
62
+ readonly notices: readonly UiNotice[];
63
+ readonly commandNotices: readonly TuiCommandNotice[];
64
+ readonly commandSessionIds: Readonly<Record<string, string | null>>;
65
+ readonly committedItems: readonly TranscriptItem[];
66
+ readonly committedPartCounts: Readonly<Partial<Record<string, number>>>;
67
+ readonly liveMessage: UiMessage | null;
68
+ readonly contextWindowUsages: readonly UiContextWindowUsage[];
69
+ readonly commandNoticeSequence: number;
70
+ readonly resolvedPermissionIds: readonly string[];
71
+ readonly catalog: TuiCommandCatalog | null;
72
+ readonly catalogInvalidation: TuiCommandCatalogInvalidation | null;
73
+ }
74
+ export interface TuiStore {
75
+ readonly getState: () => TuiStoreState;
76
+ readonly dispatch: (event: TuiEvent) => void;
77
+ readonly dispatchMany: (events: readonly TuiEvent[]) => void;
78
+ readonly replaceSnapshot: (snapshot: UiSnapshot) => void;
79
+ readonly setCatalog: (catalog: TuiCommandCatalog) => void;
80
+ readonly subscribe: (listener: () => void) => () => void;
81
+ }
82
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/tui/store/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,OAAO,IAAI,UAAU,EACrB,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAEjD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,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M,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,cAAc,EAAE,SAAS,cAAc,EAAE,CAAC;IACnD,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,mBAAmB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC9D,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,mBAAmB,EAAE,6BAA6B,GAAG,IAAI,CAAC;CACpE;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,aAAa,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC1D,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAC1D"}
@@ -0,0 +1,10 @@
1
+ import type { TuiEvent } from "./snapshot.js";
2
+ export declare const STREAMING_UI_FLUSH_MS = 50;
3
+ export interface CoalescedTuiEventDispatcher {
4
+ readonly dispatch: (event: TuiEvent) => void;
5
+ readonly dispose: () => void;
6
+ }
7
+ export declare function createCoalescedTuiEventDispatcher(dispatchBatch: (events: readonly TuiEvent[]) => void, options?: {
8
+ readonly flushMs?: number;
9
+ }): CoalescedTuiEventDispatcher;
10
+ //# sourceMappingURL=stream-coalescer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-coalescer.d.ts","sourceRoot":"","sources":["../../../src/tui/store/stream-coalescer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,KAAK,IAAI,EACpD,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1C,2BAA2B,CA2D7B"}
@@ -0,0 +1,43 @@
1
+ import type { UiMessage } from "ohbaby-sdk";
2
+ import type { TuiRuntimeStatus } from "./snapshot.js";
3
+ export interface TranscriptSplit {
4
+ readonly committedMessages: readonly UiMessage[];
5
+ readonly liveMessage: UiMessage | null;
6
+ }
7
+ /**
8
+ * One append-only entry of the committed transcript. Whole messages map to a
9
+ * single item; a streaming message is committed progressively as fragment
10
+ * items so finished parts reach the terminal scrollback (via <Static>) while
11
+ * the rest of the message is still being generated.
12
+ */
13
+ export interface TranscriptItem {
14
+ readonly id: string;
15
+ readonly messageId: string;
16
+ readonly message: UiMessage;
17
+ /** Render a bottom margin: true for whole messages and final fragments. */
18
+ readonly spacing: boolean;
19
+ }
20
+ export interface TranscriptCommitState {
21
+ readonly committedItems: readonly TranscriptItem[];
22
+ /** Parts already committed per fragmented message id. */
23
+ readonly committedPartCounts: Readonly<Partial<Record<string, number>>>;
24
+ readonly liveMessage: UiMessage | null;
25
+ }
26
+ /**
27
+ * Advances the committed transcript: emits new items for messages that have
28
+ * committed wholesale and fragment items for the sealed prefix of the live
29
+ * message. Items are append-only (committed output is frozen in scrollback),
30
+ * so previously committed parts are never re-emitted, and the returned arrays
31
+ * keep their previous references when nothing changed.
32
+ */
33
+ export declare function advanceTranscriptCommit(previous: TranscriptCommitState | undefined, messages: readonly UiMessage[], runtime: TuiRuntimeStatus): TranscriptCommitState;
34
+ /**
35
+ * Index of the first part of a streaming message that may still change.
36
+ * Everything before it is "sealed" and safe to freeze into the scrollback:
37
+ * text and reasoning parts once a later part exists, tool calls once they
38
+ * reached a terminal status and their result is present. A tool call is never
39
+ * separated from its result across the committed/live boundary.
40
+ */
41
+ export declare function computeLiveStartIndex(message: UiMessage): number;
42
+ export declare function splitTranscript(messages: readonly UiMessage[], runtime: TuiRuntimeStatus): TranscriptSplit;
43
+ //# sourceMappingURL=transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../src/tui/store/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,SAAS,EAAE,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,cAAc,EAAE,SAAS,cAAc,EAAE,CAAC;IACnD,yDAAyD;IACzD,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,EAC3C,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,OAAO,EAAE,gBAAgB,GACxB,qBAAqB,CA4FvB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAoDhE;AAkHD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,OAAO,EAAE,gBAAgB,GACxB,eAAe,CA+BjB"}
@@ -0,0 +1,55 @@
1
+ export interface RawPalette {
2
+ readonly border: string;
3
+ readonly gold: string;
4
+ readonly goldBright: string;
5
+ readonly green: string;
6
+ readonly purple: string;
7
+ readonly purpleBright: string;
8
+ readonly purpleShimmer: string;
9
+ readonly red: string;
10
+ readonly skyBlue: string;
11
+ readonly surface: string;
12
+ readonly text: string;
13
+ readonly textDim: string;
14
+ readonly textMuted: string;
15
+ readonly textStrong: string;
16
+ readonly userBlockBg: string;
17
+ readonly yellow: string;
18
+ }
19
+ export declare const darkPalette: {
20
+ readonly border: "#3E3A34";
21
+ readonly gold: "#D4A24F";
22
+ readonly goldBright: "#E0B463";
23
+ readonly green: "#8FCB9B";
24
+ readonly purple: "#B9A3E3";
25
+ readonly purpleBright: "#C9B8EC";
26
+ readonly purpleShimmer: "#F3ECFF";
27
+ readonly red: "#E8857D";
28
+ readonly skyBlue: "#6E9FCE";
29
+ readonly surface: "#141A12";
30
+ readonly text: "#E8E4DC";
31
+ readonly textDim: "#9A938A";
32
+ readonly textMuted: "#6E675F";
33
+ readonly textStrong: "#F5F2EC";
34
+ readonly userBlockBg: "#2C5D8A";
35
+ readonly yellow: "#E0C06B";
36
+ };
37
+ export declare const lightPalette: {
38
+ readonly border: "#C0B8AC";
39
+ readonly gold: "#B5832A";
40
+ readonly goldBright: "#C79535";
41
+ readonly green: "#3D9A57";
42
+ readonly purple: "#7C5BC4";
43
+ readonly purpleBright: "#8E6ED4";
44
+ readonly purpleShimmer: "#C9B2F5";
45
+ readonly red: "#C8453E";
46
+ readonly skyBlue: "#2E6FB0";
47
+ readonly surface: "#F0EBE2";
48
+ readonly text: "#1A1714";
49
+ readonly textDim: "#5F5750";
50
+ readonly textMuted: "#6E675F";
51
+ readonly textStrong: "#0F0D0B";
52
+ readonly userBlockBg: "#DCEEFF";
53
+ readonly yellow: "#9A7B1F";
54
+ };
55
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/tui/theme/colors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAiBO,CAAC;AAEhC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;CAiBM,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ColorLevel, type ColorMode, type Theme } from "./tokens.js";
2
+ export interface DetectThemeInput {
3
+ readonly chalkLevel?: number;
4
+ readonly env?: Readonly<Record<string, string | undefined>>;
5
+ }
6
+ export interface ThemeDetection {
7
+ readonly colorLevel: ColorLevel;
8
+ readonly mode: ColorMode;
9
+ readonly theme: Theme;
10
+ }
11
+ export declare function detectTheme(input?: DetectThemeInput): ThemeDetection;
12
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/tui/theme/detect.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,KAAK,EACX,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,KAAK,GAAE,gBAAqB,GAAG,cAAc,CAUxE"}
@@ -0,0 +1,14 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { type ThemeDetection } from "./detect.js";
3
+ import type { Theme } from "./tokens.js";
4
+ export { darkPalette, lightPalette, type RawPalette } from "./colors.js";
5
+ export { detectTheme, type DetectThemeInput, type ThemeDetection, } from "./detect.js";
6
+ export { BRAILLE_SPINNER_FRAMES, createTheme, type ColorLevel, type ColorMode, type Theme, } from "./tokens.js";
7
+ export interface ThemeProviderProps {
8
+ readonly children: ReactNode;
9
+ readonly detection?: ThemeDetection;
10
+ readonly theme?: Theme;
11
+ }
12
+ export declare function ThemeProvider({ children, detection, theme, }: ThemeProviderProps): ReactElement;
13
+ export declare function useTheme(): Theme;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tui/theme/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,KAAK,GACX,MAAM,aAAa,CAAC;AAKrB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CACxB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,GAAG,YAAY,CAWnC;AAED,wBAAgB,QAAQ,IAAI,KAAK,CAEhC"}
@@ -0,0 +1,61 @@
1
+ export type ColorMode = "dark" | "light";
2
+ export type ColorLevel = 0 | 1 | 2 | 3;
3
+ export interface Theme {
4
+ readonly border: string;
5
+ readonly brandTitle: {
6
+ readonly primary: string;
7
+ readonly secondary: string;
8
+ readonly tertiary: string;
9
+ };
10
+ readonly cursor: string;
11
+ readonly diff: {
12
+ readonly add: string;
13
+ readonly remove: string;
14
+ };
15
+ readonly message: {
16
+ readonly userBlockBg: string;
17
+ readonly userGutter: string;
18
+ };
19
+ readonly mode: ColorMode;
20
+ readonly reasoning: string;
21
+ readonly role: {
22
+ readonly assistant: string;
23
+ readonly user: string;
24
+ };
25
+ readonly spinner: {
26
+ readonly frames: readonly string[];
27
+ readonly palette: readonly string[];
28
+ };
29
+ readonly workingSpinner: {
30
+ readonly base: string;
31
+ readonly highlight: string;
32
+ };
33
+ readonly status: {
34
+ readonly accent: string;
35
+ readonly error: string;
36
+ readonly idle: string;
37
+ readonly running: string;
38
+ readonly success: string;
39
+ readonly waiting: string;
40
+ readonly warning: string;
41
+ };
42
+ readonly text: {
43
+ readonly dim: string;
44
+ readonly heading: string;
45
+ readonly headingAccent: string;
46
+ readonly link: string;
47
+ readonly muted: string;
48
+ readonly normal: string;
49
+ readonly strong: string;
50
+ };
51
+ readonly tool: {
52
+ readonly arg: string;
53
+ readonly failed: string;
54
+ readonly name: string;
55
+ readonly running: string;
56
+ readonly success: string;
57
+ };
58
+ }
59
+ export declare const BRAILLE_SPINNER_FRAMES: readonly ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
60
+ export declare function createTheme(mode: ColorMode, colorLevel?: number): Theme;
61
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/tui/theme/tokens.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,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K,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,eAAO,MAAM,sBAAsB,6DAWzB,CAAC;AAEX,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,SAAI,GAAG,KAAK,CA4DlE"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "ohbaby-cli",
3
+ "version": "0.1.0",
4
+ "description": "CLI frontend package for ohbaby-agent",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "bin": {
12
+ "ohbaby": "./dist/bin.js"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist/**/*.js",
22
+ "dist/**/*.js.map",
23
+ "dist/**/*.d.ts",
24
+ "dist/**/*.d.ts.map",
25
+ "!dist/**/*.test.d.ts",
26
+ "!dist/**/*.test.d.ts.map",
27
+ "!dist/**/*.unit.test.d.ts",
28
+ "!dist/**/*.unit.test.d.ts.map",
29
+ "!dist/**/*.contract.test.d.ts",
30
+ "!dist/**/*.contract.test.d.ts.map",
31
+ "!dist/**/*.integration.test.d.ts",
32
+ "!dist/**/*.integration.test.d.ts.map",
33
+ "README.md"
34
+ ],
35
+ "sideEffects": false,
36
+ "dependencies": {
37
+ "chalk": "^5.4.1",
38
+ "figlet": "^1.11.0",
39
+ "ink": "^6.0.0",
40
+ "ink-gradient": "^4.0.1",
41
+ "react": "^19.2.0",
42
+ "yargs": "^17.7.2",
43
+ "ohbaby-sdk": "0.1.0",
44
+ "ohbaby-agent": "0.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/yargs": "^17.0.33"
48
+ },
49
+ "scripts": {
50
+ "build": "rimraf dist && tsup && tsc -b --force",
51
+ "start": "node dist/bin.js",
52
+ "typecheck": "tsc -b",
53
+ "clean": "rimraf dist coverage"
54
+ }
55
+ }