@agentick/tui 0.5.0 → 0.7.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 (141) hide show
  1. package/README.md +164 -21
  2. package/dist/commands-context.d.ts +10 -0
  3. package/dist/commands-context.d.ts.map +1 -0
  4. package/dist/commands-context.js +10 -0
  5. package/dist/commands-context.js.map +1 -0
  6. package/dist/commands.d.ts +30 -0
  7. package/dist/commands.d.ts.map +1 -0
  8. package/dist/commands.js +165 -0
  9. package/dist/commands.js.map +1 -0
  10. package/dist/components/CompletionPicker.d.ts +12 -0
  11. package/dist/components/CompletionPicker.d.ts.map +1 -0
  12. package/dist/components/CompletionPicker.js +41 -0
  13. package/dist/components/CompletionPicker.js.map +1 -0
  14. package/dist/components/DiffView.d.ts +21 -0
  15. package/dist/components/DiffView.d.ts.map +1 -0
  16. package/dist/components/DiffView.js +94 -0
  17. package/dist/components/DiffView.js.map +1 -0
  18. package/dist/components/ErrorDisplay.d.ts +6 -6
  19. package/dist/components/ErrorDisplay.d.ts.map +1 -1
  20. package/dist/components/ErrorDisplay.js +6 -8
  21. package/dist/components/ErrorDisplay.js.map +1 -1
  22. package/dist/components/InputBar.d.ts +8 -17
  23. package/dist/components/InputBar.d.ts.map +1 -1
  24. package/dist/components/InputBar.js +7 -22
  25. package/dist/components/InputBar.js.map +1 -1
  26. package/dist/components/MessageList.d.ts +11 -6
  27. package/dist/components/MessageList.d.ts.map +1 -1
  28. package/dist/components/MessageList.js +37 -54
  29. package/dist/components/MessageList.js.map +1 -1
  30. package/dist/components/RichTextInput.d.ts +14 -0
  31. package/dist/components/RichTextInput.d.ts.map +1 -0
  32. package/dist/components/RichTextInput.js +24 -0
  33. package/dist/components/RichTextInput.js.map +1 -0
  34. package/dist/components/ToolCallIndicator.d.ts.map +1 -1
  35. package/dist/components/ToolCallIndicator.js +12 -5
  36. package/dist/components/ToolCallIndicator.js.map +1 -1
  37. package/dist/components/ToolConfirmationPrompt.d.ts +9 -6
  38. package/dist/components/ToolConfirmationPrompt.d.ts.map +1 -1
  39. package/dist/components/ToolConfirmationPrompt.js +18 -19
  40. package/dist/components/ToolConfirmationPrompt.js.map +1 -1
  41. package/dist/components/status-bar/DefaultStatusBar.d.ts +20 -0
  42. package/dist/components/status-bar/DefaultStatusBar.d.ts.map +1 -0
  43. package/dist/components/status-bar/DefaultStatusBar.js +11 -0
  44. package/dist/components/status-bar/DefaultStatusBar.js.map +1 -0
  45. package/dist/components/status-bar/StatusBar.d.ts +22 -0
  46. package/dist/components/status-bar/StatusBar.d.ts.map +1 -0
  47. package/dist/components/status-bar/StatusBar.js +16 -0
  48. package/dist/components/status-bar/StatusBar.js.map +1 -0
  49. package/dist/components/status-bar/StatusBarRight.d.ts +12 -0
  50. package/dist/components/status-bar/StatusBarRight.d.ts.map +1 -0
  51. package/dist/components/status-bar/StatusBarRight.js +29 -0
  52. package/dist/components/status-bar/StatusBarRight.js.map +1 -0
  53. package/dist/components/status-bar/context.d.ts +27 -0
  54. package/dist/components/status-bar/context.d.ts.map +1 -0
  55. package/dist/components/status-bar/context.js +18 -0
  56. package/dist/components/status-bar/context.js.map +1 -0
  57. package/dist/components/status-bar/index.d.ts +5 -0
  58. package/dist/components/status-bar/index.d.ts.map +1 -0
  59. package/dist/components/status-bar/index.js +5 -0
  60. package/dist/components/status-bar/index.js.map +1 -0
  61. package/dist/components/status-bar/widgets/BrandLabel.d.ts +8 -0
  62. package/dist/components/status-bar/widgets/BrandLabel.d.ts.map +1 -0
  63. package/dist/components/status-bar/widgets/BrandLabel.js +6 -0
  64. package/dist/components/status-bar/widgets/BrandLabel.js.map +1 -0
  65. package/dist/components/status-bar/widgets/ContextUtilization.d.ts +11 -0
  66. package/dist/components/status-bar/widgets/ContextUtilization.d.ts.map +1 -0
  67. package/dist/components/status-bar/widgets/ContextUtilization.js +12 -0
  68. package/dist/components/status-bar/widgets/ContextUtilization.js.map +1 -0
  69. package/dist/components/status-bar/widgets/KeyboardHints.d.ts +16 -0
  70. package/dist/components/status-bar/widgets/KeyboardHints.d.ts.map +1 -0
  71. package/dist/components/status-bar/widgets/KeyboardHints.js +25 -0
  72. package/dist/components/status-bar/widgets/KeyboardHints.js.map +1 -0
  73. package/dist/components/status-bar/widgets/ModelInfo.d.ts +7 -0
  74. package/dist/components/status-bar/widgets/ModelInfo.d.ts.map +1 -0
  75. package/dist/components/status-bar/widgets/ModelInfo.js +10 -0
  76. package/dist/components/status-bar/widgets/ModelInfo.js.map +1 -0
  77. package/dist/components/status-bar/widgets/Separator.d.ts +7 -0
  78. package/dist/components/status-bar/widgets/Separator.d.ts.map +1 -0
  79. package/dist/components/status-bar/widgets/Separator.js +6 -0
  80. package/dist/components/status-bar/widgets/Separator.js.map +1 -0
  81. package/dist/components/status-bar/widgets/StateIndicator.d.ts +12 -0
  82. package/dist/components/status-bar/widgets/StateIndicator.d.ts.map +1 -0
  83. package/dist/components/status-bar/widgets/StateIndicator.js +21 -0
  84. package/dist/components/status-bar/widgets/StateIndicator.js.map +1 -0
  85. package/dist/components/status-bar/widgets/TickCount.d.ts +9 -0
  86. package/dist/components/status-bar/widgets/TickCount.d.ts.map +1 -0
  87. package/dist/components/status-bar/widgets/TickCount.js +11 -0
  88. package/dist/components/status-bar/widgets/TickCount.js.map +1 -0
  89. package/dist/components/status-bar/widgets/TokenCount.d.ts +12 -0
  90. package/dist/components/status-bar/widgets/TokenCount.d.ts.map +1 -0
  91. package/dist/components/status-bar/widgets/TokenCount.js +28 -0
  92. package/dist/components/status-bar/widgets/TokenCount.js.map +1 -0
  93. package/dist/components/status-bar/widgets/index.d.ts +9 -0
  94. package/dist/components/status-bar/widgets/index.d.ts.map +1 -0
  95. package/dist/components/status-bar/widgets/index.js +9 -0
  96. package/dist/components/status-bar/widgets/index.js.map +1 -0
  97. package/dist/create-tui.d.ts +5 -0
  98. package/dist/create-tui.d.ts.map +1 -1
  99. package/dist/create-tui.js +15 -12
  100. package/dist/create-tui.js.map +1 -1
  101. package/dist/hooks/use-double-ctrl-c.d.ts +5 -0
  102. package/dist/hooks/use-double-ctrl-c.d.ts.map +1 -0
  103. package/dist/hooks/use-double-ctrl-c.js +32 -0
  104. package/dist/hooks/use-double-ctrl-c.js.map +1 -0
  105. package/dist/hooks/use-line-editor.d.ts +26 -0
  106. package/dist/hooks/use-line-editor.d.ts.map +1 -0
  107. package/dist/hooks/use-line-editor.js +63 -0
  108. package/dist/hooks/use-line-editor.js.map +1 -0
  109. package/dist/index.d.ts +13 -3
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +14 -0
  112. package/dist/index.js.map +1 -1
  113. package/dist/input-utils.d.ts +15 -0
  114. package/dist/input-utils.d.ts.map +1 -0
  115. package/dist/input-utils.js +29 -0
  116. package/dist/input-utils.js.map +1 -0
  117. package/dist/rendering/content-block.d.ts +12 -0
  118. package/dist/rendering/content-block.d.ts.map +1 -0
  119. package/dist/rendering/content-block.js +82 -0
  120. package/dist/rendering/content-block.js.map +1 -0
  121. package/dist/rendering/index.d.ts +5 -0
  122. package/dist/rendering/index.d.ts.map +1 -0
  123. package/dist/rendering/index.js +5 -0
  124. package/dist/rendering/index.js.map +1 -0
  125. package/dist/rendering/markdown.d.ts +14 -0
  126. package/dist/rendering/markdown.d.ts.map +1 -0
  127. package/dist/rendering/markdown.js +61 -0
  128. package/dist/rendering/markdown.js.map +1 -0
  129. package/dist/rendering/message.d.ts +25 -0
  130. package/dist/rendering/message.d.ts.map +1 -0
  131. package/dist/rendering/message.js +54 -0
  132. package/dist/rendering/message.js.map +1 -0
  133. package/dist/rendering/theme.d.ts +37 -0
  134. package/dist/rendering/theme.d.ts.map +1 -0
  135. package/dist/rendering/theme.js +49 -0
  136. package/dist/rendering/theme.js.map +1 -0
  137. package/dist/ui/chat.d.ts +26 -4
  138. package/dist/ui/chat.d.ts.map +1 -1
  139. package/dist/ui/chat.js +91 -68
  140. package/dist/ui/chat.js.map +1 -1
  141. package/package.json +11 -6
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from "ink";
3
+ import { useContextInfo, useStreamingText } from "@agentick/react";
4
+ import { StatusBarContext } from "./context.js";
5
+ export function StatusBar({ sessionId, mode = "idle", isExecuting: explicitExecuting, left, right, }) {
6
+ const { contextInfo } = useContextInfo({ sessionId });
7
+ const { isStreaming } = useStreamingText();
8
+ const data = {
9
+ mode,
10
+ isExecuting: explicitExecuting ?? isStreaming,
11
+ sessionId,
12
+ contextInfo,
13
+ };
14
+ return (_jsx(StatusBarContext, { value: data, children: _jsxs(Box, { flexDirection: "row", justifyContent: "space-between", paddingX: 1, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, children: left }), right && _jsx(Box, { flexShrink: 0, children: right })] }) }));
15
+ }
16
+ //# sourceMappingURL=StatusBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../../src/components/status-bar/StatusBar.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,cAAc,CAAC;AAepE,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,IAAI,GAAG,MAAM,EACb,WAAW,EAAE,iBAAiB,EAC9B,IAAI,EACJ,KAAK,GACU;IACf,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IACtD,MAAM,EAAE,WAAW,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAE3C,MAAM,IAAI,GAAkB;QAC1B,IAAI;QACJ,WAAW,EAAE,iBAAiB,IAAI,WAAW;QAC7C,SAAS;QACT,WAAW;KACZ,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,IAAC,KAAK,EAAE,IAAI,YAC3B,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,cAAc,EAAC,eAAe,EAAC,QAAQ,EAAE,CAAC,aACjE,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,YAC5B,IAAI,GACD,EACL,KAAK,IAAI,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,YAAG,KAAK,GAAO,IACvC,GACW,CACpB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * StatusBarRight — right-side composition for DefaultStatusBar.
3
+ *
4
+ * Renders as a child of StatusBar so it has access to StatusBarContext.
5
+ * Dogfoods the widget components and adapts to terminal width.
6
+ */
7
+ interface StatusBarRightProps {
8
+ width: number;
9
+ }
10
+ export declare function StatusBarRight({ width }: StatusBarRightProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=StatusBarRight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusBarRight.d.ts","sourceRoot":"","sources":["../../../src/components/status-bar/StatusBarRight.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAsC5D"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * StatusBarRight — right-side composition for DefaultStatusBar.
4
+ *
5
+ * Renders as a child of StatusBar so it has access to StatusBarContext.
6
+ * Dogfoods the widget components and adapts to terminal width.
7
+ */
8
+ import { Text } from "ink";
9
+ import { ModelInfo } from "./widgets/ModelInfo.js";
10
+ import { TokenCount } from "./widgets/TokenCount.js";
11
+ import { ContextUtilization } from "./widgets/ContextUtilization.js";
12
+ import { StateIndicator } from "./widgets/StateIndicator.js";
13
+ import { Separator } from "./widgets/Separator.js";
14
+ import { useStatusBarData } from "./context.js";
15
+ export function StatusBarRight({ width }) {
16
+ const data = useStatusBarData();
17
+ const ci = data?.contextInfo;
18
+ const hasModel = !!(ci?.modelName ?? ci?.modelId);
19
+ const hasTokens = (ci?.cumulativeUsage?.totalTokens ?? ci?.totalTokens ?? 0) > 0;
20
+ const hasUtil = ci?.utilization != null;
21
+ // Wide (80+): model | 6.2K 35% | idle
22
+ // Medium (60-79): model | idle
23
+ // Narrow (<60): idle
24
+ const showModel = hasModel && width >= 60;
25
+ const showTokens = hasTokens && width >= 80;
26
+ const showUtil = hasUtil && width >= 80;
27
+ return (_jsxs(Text, { children: [showModel && (_jsxs(_Fragment, { children: [_jsx(ModelInfo, {}), _jsx(Separator, {})] })), showTokens && (_jsxs(_Fragment, { children: [_jsx(TokenCount, { cumulative: true }), showUtil && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(ContextUtilization, {})] })), _jsx(Separator, {})] })), _jsx(StateIndicator, {})] }));
28
+ }
29
+ //# sourceMappingURL=StatusBarRight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusBarRight.js","sourceRoot":"","sources":["../../../src/components/status-bar/StatusBarRight.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAuB;IAC3D,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC;IAE7B,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,CAAC,EAAE,EAAE,eAAe,EAAE,WAAW,IAAI,EAAE,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACjF,MAAM,OAAO,GAAG,EAAE,EAAE,WAAW,IAAI,IAAI,CAAC;IAExC,sCAAsC;IACtC,+BAA+B;IAC/B,qBAAqB;IACrB,MAAM,SAAS,GAAG,QAAQ,IAAI,KAAK,IAAI,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,SAAS,IAAI,KAAK,IAAI,EAAE,CAAC;IAC5C,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,CAAC;IAExC,OAAO,CACL,MAAC,IAAI,eACF,SAAS,IAAI,CACZ,8BACE,KAAC,SAAS,KAAG,EACb,KAAC,SAAS,KAAG,IACZ,CACJ,EACA,UAAU,IAAI,CACb,8BACE,KAAC,UAAU,IAAC,UAAU,SAAG,EACxB,QAAQ,IAAI,CACX,8BACE,KAAC,IAAI,oBAAS,EACd,KAAC,kBAAkB,KAAG,IACrB,CACJ,EACD,KAAC,SAAS,KAAG,IACZ,CACJ,EACD,KAAC,cAAc,KAAG,IACb,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * StatusBar context — provides data from hooks to child widgets.
3
+ *
4
+ * `<StatusBar>` calls `useContextInfo` and `useStreamingText` once,
5
+ * then populates this context so widgets can read shared data without
6
+ * each widget subscribing independently.
7
+ */
8
+ import type { ContextInfo } from "@agentick/shared";
9
+ import type { ChatMode } from "@agentick/client";
10
+ export interface StatusBarData {
11
+ /** Current chat mode (idle, streaming, confirming_tool) */
12
+ mode: ChatMode;
13
+ /** Whether an execution is currently running */
14
+ isExecuting: boolean;
15
+ /** Session ID */
16
+ sessionId: string;
17
+ /** Context info from latest tick (null before first tick) */
18
+ contextInfo: ContextInfo | null;
19
+ }
20
+ export declare const StatusBarContext: import("react").Context<StatusBarData | null>;
21
+ /**
22
+ * Read StatusBar data from context.
23
+ * Returns null when used outside a `<StatusBar>` — widgets should
24
+ * fall back to explicit props in that case.
25
+ */
26
+ export declare function useStatusBarData(): StatusBarData | null;
27
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/status-bar/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,IAAI,EAAE,QAAQ,CAAC;IACf,gDAAgD;IAChD,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,gBAAgB,+CAA4C,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAEvD"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * StatusBar context — provides data from hooks to child widgets.
3
+ *
4
+ * `<StatusBar>` calls `useContextInfo` and `useStreamingText` once,
5
+ * then populates this context so widgets can read shared data without
6
+ * each widget subscribing independently.
7
+ */
8
+ import { createContext, useContext } from "react";
9
+ export const StatusBarContext = createContext(null);
10
+ /**
11
+ * Read StatusBar data from context.
12
+ * Returns null when used outside a `<StatusBar>` — widgets should
13
+ * fall back to explicit props in that case.
14
+ */
15
+ export function useStatusBarData() {
16
+ return useContext(StatusBarContext);
17
+ }
18
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/status-bar/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAelD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { StatusBar, type StatusBarProps } from "./StatusBar.js";
2
+ export { DefaultStatusBar } from "./DefaultStatusBar.js";
3
+ export { StatusBarContext, useStatusBarData, type StatusBarData } from "./context.js";
4
+ export { ModelInfo, TokenCount, TickCount, ContextUtilization, StateIndicator, KeyboardHints, type KeyboardHint, BrandLabel, Separator, } from "./widgets/index.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/status-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,KAAK,YAAY,EACjB,UAAU,EACV,SAAS,GACV,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { StatusBar } from "./StatusBar.js";
2
+ export { DefaultStatusBar } from "./DefaultStatusBar.js";
3
+ export { StatusBarContext, useStatusBarData } from "./context.js";
4
+ export { ModelInfo, TokenCount, TickCount, ContextUtilization, StateIndicator, KeyboardHints, BrandLabel, Separator, } from "./widgets/index.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/status-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAsB,MAAM,cAAc,CAAC;AACtF,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,aAAa,EAEb,UAAU,EACV,SAAS,GACV,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ interface BrandLabelProps {
2
+ name?: string;
3
+ color?: string;
4
+ bold?: boolean;
5
+ }
6
+ export declare function BrandLabel({ name, color, bold }: BrandLabelProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=BrandLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/BrandLabel.tsx"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAiB,EAAE,KAAiB,EAAE,IAAW,EAAE,EAAE,eAAe,2CAMhG"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ export function BrandLabel({ name = "agentick", color = "#34d399", bold = true }) {
4
+ return (_jsx(Text, { color: color, bold: bold, children: name }));
5
+ }
6
+ //# sourceMappingURL=BrandLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandLabel.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/BrandLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAQ3B,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,UAAU,EAAE,KAAK,GAAG,SAAS,EAAE,IAAI,GAAG,IAAI,EAAmB;IAC/F,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,YAC3B,IAAI,GACA,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ interface ContextUtilizationProps {
2
+ /** Override utilization percentage (0-100) */
3
+ utilization?: number;
4
+ /** Color thresholds: [warn, critical] (default: [50, 80]) */
5
+ thresholds?: [number, number];
6
+ /** Colors for [normal, warn, critical] */
7
+ colors?: [string, string, string];
8
+ }
9
+ export declare function ContextUtilization({ utilization: explicitUtil, thresholds, colors, }: ContextUtilizationProps): import("react/jsx-runtime").JSX.Element | null;
10
+ export {};
11
+ //# sourceMappingURL=ContextUtilization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextUtilization.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/ContextUtilization.tsx"],"names":[],"mappings":"AAGA,UAAU,uBAAuB;IAC/B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EAAE,YAAY,EACzB,UAAqB,EACrB,MAAkC,GACnC,EAAE,uBAAuB,kDASzB"}
@@ -0,0 +1,12 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ import { useStatusBarData } from "../context.js";
4
+ export function ContextUtilization({ utilization: explicitUtil, thresholds = [50, 80], colors = ["gray", "yellow", "red"], }) {
5
+ const data = useStatusBarData();
6
+ const util = explicitUtil ?? data?.contextInfo?.utilization;
7
+ if (util == null)
8
+ return null;
9
+ const color = util > thresholds[1] ? colors[2] : util > thresholds[0] ? colors[1] : colors[0];
10
+ return _jsxs(Text, { color: color, children: [Math.round(util), "%"] });
11
+ }
12
+ //# sourceMappingURL=ContextUtilization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextUtilization.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/ContextUtilization.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAWjD,MAAM,UAAU,kBAAkB,CAAC,EACjC,WAAW,EAAE,YAAY,EACzB,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EACrB,MAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,GACV;IACxB,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,YAAY,IAAI,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC;IAE5D,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE9F,OAAO,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,aAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;AACxD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ChatMode } from "@agentick/client";
2
+ import type { ReactNode } from "react";
3
+ interface Hint {
4
+ key: string;
5
+ action: string;
6
+ color?: string;
7
+ }
8
+ interface KeyboardHintsProps {
9
+ /** Override mode */
10
+ mode?: ChatMode;
11
+ /** Custom hints per mode (overrides defaults for that mode) */
12
+ hints?: Partial<Record<ChatMode, Hint[]>>;
13
+ }
14
+ export declare function KeyboardHints({ mode: explicitMode, hints }: KeyboardHintsProps): ReactNode;
15
+ export type { Hint as KeyboardHint };
16
+ //# sourceMappingURL=KeyboardHints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyboardHints.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/KeyboardHints.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,IAAI;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAeD,UAAU,kBAAkB;IAC1B,oBAAoB;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;CAC3C;AAkBD,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,kBAAkB,aAM9E;AAED,YAAY,EAAE,IAAI,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ import { useStatusBarData } from "../context.js";
4
+ const DEFAULT_HINTS = {
5
+ idle: [
6
+ { key: "Enter", action: "send" },
7
+ { key: "Ctrl+C", action: "exit" },
8
+ ],
9
+ streaming: [{ key: "Ctrl+C", action: "abort" }],
10
+ confirming_tool: [
11
+ { key: "Y", action: "approve", color: "green" },
12
+ { key: "N", action: "reject", color: "red" },
13
+ { key: "A", action: "always", color: "#34d399" },
14
+ ],
15
+ };
16
+ function renderHints(hints) {
17
+ return (_jsx(Text, { children: hints.map((hint, i) => (_jsxs(Text, { children: [i > 0 && _jsx(Text, { color: "gray", children: " | " }), _jsx(Text, { bold: true, color: hint.color, children: hint.key }), _jsxs(Text, { color: "gray", children: [" ", hint.action] })] }, hint.key))) }));
18
+ }
19
+ export function KeyboardHints({ mode: explicitMode, hints }) {
20
+ const data = useStatusBarData();
21
+ const mode = explicitMode ?? data?.mode ?? "idle";
22
+ const modeHints = hints?.[mode] ?? DEFAULT_HINTS[mode];
23
+ return renderHints(modeHints);
24
+ }
25
+ //# sourceMappingURL=KeyboardHints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyboardHints.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/KeyboardHints.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQjD,MAAM,aAAa,GAA6B;IAC9C,IAAI,EAAE;QACJ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;QAChC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE;KAClC;IACD,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC/C,eAAe,EAAE;QACf,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;QAC/C,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE;QAC5C,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;KACjD;CACF,CAAC;AASF,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,CACL,KAAC,IAAI,cACF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,IAAI,eACF,CAAC,GAAG,CAAC,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,oBAAW,EACvC,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,IAAI,CAAC,KAAK,YACzB,IAAI,CAAC,GAAG,GACJ,EACP,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBAAG,IAAI,CAAC,MAAM,IAAQ,KAL/B,IAAI,CAAC,GAAG,CAMZ,CACR,CAAC,GACG,CACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAsB;IAC7E,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,YAAY,IAAI,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC;IAClD,MAAM,SAAS,GAAG,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IAEvD,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface ModelInfoProps {
2
+ modelName?: string;
3
+ color?: string;
4
+ }
5
+ export declare function ModelInfo({ modelName, color }: ModelInfoProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=ModelInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/ModelInfo.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,cAAc,2CAK7D"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ import { useStatusBarData } from "../context.js";
4
+ export function ModelInfo({ modelName, color }) {
5
+ const data = useStatusBarData();
6
+ const ci = data?.contextInfo;
7
+ const display = modelName ?? ci?.modelName ?? ci?.modelId ?? "\u2014";
8
+ return _jsx(Text, { color: color, children: display });
9
+ }
10
+ //# sourceMappingURL=ModelInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelInfo.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/ModelInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAOjD,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,KAAK,EAAkB;IAC5D,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC;IAC7B,MAAM,OAAO,GAAG,SAAS,IAAI,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,OAAO,IAAI,QAAQ,CAAC;IACtE,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,OAAO,GAAQ,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface SeparatorProps {
2
+ char?: string;
3
+ color?: string;
4
+ }
5
+ export declare function Separator({ char, color }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=Separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/Separator.tsx"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAU,EAAE,KAAc,EAAE,EAAE,cAAc,2CAEvE"}
@@ -0,0 +1,6 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ export function Separator({ char = "|", color = "gray" }) {
4
+ return _jsxs(Text, { color: color, children: [" ", char, " "] });
5
+ }
6
+ //# sourceMappingURL=Separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/Separator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAO3B,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,MAAM,EAAkB;IACtE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,kBAAI,IAAI,SAAS,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ChatMode } from "@agentick/client";
2
+ interface StateIndicatorProps {
3
+ /** Override mode */
4
+ mode?: ChatMode;
5
+ /** Custom labels per mode */
6
+ labels?: Partial<Record<ChatMode, string>>;
7
+ /** Custom colors per mode */
8
+ colors?: Partial<Record<ChatMode, string>>;
9
+ }
10
+ export declare function StateIndicator({ mode: explicitMode, labels, colors }: StateIndicatorProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=StateIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/StateIndicator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAejD,UAAU,mBAAmB;IAC3B,oBAAoB;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,6BAA6B;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;CAC5C;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CAOzF"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ import { useStatusBarData } from "../context.js";
4
+ const DEFAULT_LABELS = {
5
+ idle: "idle",
6
+ streaming: "streaming",
7
+ confirming_tool: "confirm",
8
+ };
9
+ const DEFAULT_COLORS = {
10
+ idle: "green",
11
+ streaming: "yellow",
12
+ confirming_tool: "magenta",
13
+ };
14
+ export function StateIndicator({ mode: explicitMode, labels, colors }) {
15
+ const data = useStatusBarData();
16
+ const mode = explicitMode ?? data?.mode ?? "idle";
17
+ const label = labels?.[mode] ?? DEFAULT_LABELS[mode];
18
+ const color = colors?.[mode] ?? DEFAULT_COLORS[mode];
19
+ return _jsx(Text, { color: color, children: label });
20
+ }
21
+ //# sourceMappingURL=StateIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateIndicator.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/StateIndicator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,cAAc,GAA6B;IAC/C,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,eAAe,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAM,cAAc,GAA6B;IAC/C,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE,SAAS;CAC3B,CAAC;AAWF,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAuB;IACxF,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,YAAY,IAAI,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC;IAClD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAErD,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,KAAK,GAAQ,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,9 @@
1
+ interface TickCountProps {
2
+ /** Override tick number */
3
+ tick?: number;
4
+ /** Text color */
5
+ color?: string;
6
+ }
7
+ export declare function TickCount({ tick: explicitTick, color }: TickCountProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
9
+ //# sourceMappingURL=TickCount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TickCount.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/TickCount.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAc,EAAE,EAAE,cAAc,kDAO/E"}
@@ -0,0 +1,11 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ import { useStatusBarData } from "../context.js";
4
+ export function TickCount({ tick: explicitTick, color = "gray" }) {
5
+ const data = useStatusBarData();
6
+ const tick = explicitTick ?? data?.contextInfo?.tick;
7
+ if (tick == null || tick === 0)
8
+ return null;
9
+ return _jsxs(Text, { color: color, children: ["tick ", tick] });
10
+ }
11
+ //# sourceMappingURL=TickCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TickCount.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/TickCount.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AASjD,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,GAAG,MAAM,EAAkB;IAC9E,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,YAAY,IAAI,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC;IAErD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5C,OAAO,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,sBAAQ,IAAI,IAAQ,CAAC;AAChD,CAAC"}
@@ -0,0 +1,12 @@
1
+ interface TokenCountProps {
2
+ /** Override token count */
3
+ tokens?: number;
4
+ /** Show cumulative usage across ticks (default: true) */
5
+ cumulative?: boolean;
6
+ /** Prefix label (e.g. "tokens:") */
7
+ label?: string;
8
+ color?: string;
9
+ }
10
+ export declare function TokenCount({ tokens, cumulative, label, color }: TokenCountProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
12
+ //# sourceMappingURL=TokenCount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenCount.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/TokenCount.tsx"],"names":[],"mappings":"AASA,UAAU,eAAe;IACvB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,UAAiB,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE,eAAe,kDAqB/F"}
@@ -0,0 +1,28 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from "ink";
3
+ import { useStatusBarData } from "../context.js";
4
+ function formatTokens(n) {
5
+ if (n >= 1_000_000)
6
+ return `${(n / 1_000_000).toFixed(1)}M`;
7
+ if (n >= 1_000)
8
+ return `${(n / 1_000).toFixed(1)}K`;
9
+ return String(n);
10
+ }
11
+ export function TokenCount({ tokens, cumulative = true, label, color = "gray" }) {
12
+ const data = useStatusBarData();
13
+ const ci = data?.contextInfo;
14
+ let count;
15
+ if (tokens != null) {
16
+ count = tokens;
17
+ }
18
+ else if (cumulative && ci?.cumulativeUsage) {
19
+ count = ci.cumulativeUsage.totalTokens;
20
+ }
21
+ else {
22
+ count = ci?.totalTokens ?? 0;
23
+ }
24
+ if (count === 0)
25
+ return null;
26
+ return (_jsxs(Text, { color: color, children: [label ? `${label} ` : "", formatTokens(count)] }));
27
+ }
28
+ //# sourceMappingURL=TokenCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenCount.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/TokenCount.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC,IAAI,SAAS;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5D,IAAI,CAAC,IAAI,KAAK;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACpD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAYD,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAmB;IAC9F,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC;IAE7B,IAAI,KAAa,CAAC;IAClB,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,KAAK,GAAG,MAAM,CAAC;IACjB,CAAC;SAAM,IAAI,UAAU,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC;QAC7C,KAAK,GAAG,EAAE,CAAC,eAAe,CAAC,WAAW,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,EAAE,EAAE,WAAW,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE7B,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,aACf,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EACxB,YAAY,CAAC,KAAK,CAAC,IACf,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { ModelInfo } from "./ModelInfo.js";
2
+ export { TokenCount } from "./TokenCount.js";
3
+ export { TickCount } from "./TickCount.js";
4
+ export { ContextUtilization } from "./ContextUtilization.js";
5
+ export { StateIndicator } from "./StateIndicator.js";
6
+ export { KeyboardHints, type KeyboardHint } from "./KeyboardHints.js";
7
+ export { BrandLabel } from "./BrandLabel.js";
8
+ export { Separator } from "./Separator.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { ModelInfo } from "./ModelInfo.js";
2
+ export { TokenCount } from "./TokenCount.js";
3
+ export { TickCount } from "./TickCount.js";
4
+ export { ContextUtilization } from "./ContextUtilization.js";
5
+ export { StateIndicator } from "./StateIndicator.js";
6
+ export { KeyboardHints } from "./KeyboardHints.js";
7
+ export { BrandLabel } from "./BrandLabel.js";
8
+ export { Separator } from "./Separator.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/status-bar/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -28,6 +28,7 @@
28
28
  * @module @agentick/tui/create-tui
29
29
  */
30
30
  import type { ComponentType } from "react";
31
+ import type { SlashCommand } from "./commands.js";
31
32
  import type { App } from "@agentick/core";
32
33
  /** A TUI component receives a sessionId and renders the full interface. */
33
34
  export type TUIComponent = ComponentType<{
@@ -38,12 +39,16 @@ interface TUIOptionsBase {
38
39
  ui?: TUIComponent;
39
40
  /** Use alternate screen buffer to avoid polluting terminal scrollback. */
40
41
  alternateScreen?: boolean;
42
+ /** Slash commands available in the TUI. Accepts singles and arrays (command packs). */
43
+ commands?: (SlashCommand | SlashCommand[])[];
41
44
  }
42
45
  export type TUIOptions = ({
43
46
  app: App;
44
47
  } & TUIOptionsBase) | ({
45
48
  url: string;
46
49
  token?: string;
50
+ } & TUIOptionsBase) | ({
51
+ client: import("@agentick/client").AgentickClient;
47
52
  } & TUIOptionsBase);
48
53
  export declare function createTUI(options: TUIOptions): {
49
54
  start(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"create-tui.d.ts","sourceRoot":"","sources":["../src/create-tui.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG1C,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhE,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,UAAU,GAClB,CAAC;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,GAAG,cAAc,CAAC,GAC/B,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAAC,CAAC;AAEvD,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU;;EAuC5C"}
1
+ {"version":3,"file":"create-tui.d.ts","sourceRoot":"","sources":["../src/create-tui.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG1C,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhE,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uFAAuF;IACvF,QAAQ,CAAC,EAAE,CAAC,YAAY,GAAG,YAAY,EAAE,CAAC,EAAE,CAAC;CAC9C;AAED,MAAM,MAAM,UAAU,GAClB,CAAC;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,GAAG,cAAc,CAAC,GAC/B,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAAC,GAClD,CAAC;IAAE,MAAM,EAAE,OAAO,kBAAkB,EAAE,cAAc,CAAA;CAAE,GAAG,cAAc,CAAC,CAAC;AAE7E,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU;;EA2C5C"}
@@ -4,27 +4,30 @@ import { createClient } from "@agentick/client";
4
4
  import { createLocalTransport } from "@agentick/core";
5
5
  import { AgentickProvider } from "@agentick/react";
6
6
  import { Chat } from "./ui/chat.js";
7
+ import { CommandsProvider } from "./commands-context.js";
7
8
  import EventSourcePolyfill from "eventsource";
8
9
  export function createTUI(options) {
9
10
  return {
10
11
  async start() {
11
12
  const sessionId = options.sessionId ?? "main";
12
13
  const Component = options.ui ?? Chat;
13
- const client = "app" in options
14
- ? createClient({
15
- baseUrl: "local://",
16
- transport: createLocalTransport(options.app),
17
- })
18
- : createClient({
19
- baseUrl: options.url,
20
- token: options.token,
21
- EventSource: (globalThis.EventSource ??
22
- EventSourcePolyfill),
23
- });
14
+ const client = "client" in options
15
+ ? options.client
16
+ : "app" in options
17
+ ? createClient({
18
+ baseUrl: "local://",
19
+ transport: createLocalTransport(options.app),
20
+ })
21
+ : createClient({
22
+ baseUrl: options.url,
23
+ token: options.token,
24
+ EventSource: (globalThis.EventSource ??
25
+ EventSourcePolyfill),
26
+ });
24
27
  if (options.alternateScreen) {
25
28
  process.stdout.write("\x1b[?1049h\x1b[H\x1b[2J");
26
29
  }
27
- const { waitUntilExit } = render(_jsx(AgentickProvider, { client: client, children: _jsx(Component, { sessionId: sessionId }) }), { exitOnCtrlC: false });
30
+ const { waitUntilExit } = render(_jsx(AgentickProvider, { client: client, children: _jsx(CommandsProvider, { commands: options.commands ?? [], children: _jsx(Component, { sessionId: sessionId }) }) }), { exitOnCtrlC: false });
28
31
  try {
29
32
  await waitUntilExit();
30
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-tui.js","sourceRoot":"","sources":["../src/create-tui.tsx"],"names":[],"mappings":";AA+BA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,mBAAmB,MAAM,aAAa,CAAC;AAgB9C,MAAM,UAAU,SAAS,CAAC,OAAmB;IAC3C,OAAO;QACL,KAAK,CAAC,KAAK;YACT,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;YAC9C,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,IAAI,IAAI,CAAC;YAErC,MAAM,MAAM,GACV,KAAK,IAAI,OAAO;gBACd,CAAC,CAAC,YAAY,CAAC;oBACX,OAAO,EAAE,UAAU;oBACnB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC;iBAC7C,CAAC;gBACJ,CAAC,CAAC,YAAY,CAAC;oBACX,OAAO,EAAE,OAAO,CAAC,GAAG;oBACpB,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,WAAW,EAAE,CAAC,UAAU,CAAC,WAAW;wBAClC,mBAAmB,CAAkC;iBACxD,CAAC,CAAC;YAET,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;gBAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YACnD,CAAC;YAED,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAC9B,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,YAC9B,KAAC,SAAS,IAAC,SAAS,EAAE,SAAS,GAAI,GAClB,EACnB,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,aAAa,EAAE,CAAC;YACxB,CAAC;oBAAS,CAAC;gBACT,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;oBAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"create-tui.js","sourceRoot":"","sources":["../src/create-tui.tsx"],"names":[],"mappings":";AA+BA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,mBAAmB,MAAM,aAAa,CAAC;AAmB9C,MAAM,UAAU,SAAS,CAAC,OAAmB;IAC3C,OAAO;QACL,KAAK,CAAC,KAAK;YACT,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;YAC9C,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,IAAI,IAAI,CAAC;YAErC,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO;gBACjB,CAAC,CAAC,OAAO,CAAC,MAAM;gBAChB,CAAC,CAAC,KAAK,IAAI,OAAO;oBAChB,CAAC,CAAC,YAAY,CAAC;wBACX,OAAO,EAAE,UAAU;wBACnB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC;qBAC7C,CAAC;oBACJ,CAAC,CAAC,YAAY,CAAC;wBACX,OAAO,EAAE,OAAO,CAAC,GAAG;wBACpB,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,WAAW,EAAE,CAAC,UAAU,CAAC,WAAW;4BAClC,mBAAmB,CAAkC;qBACxD,CAAC,CAAC;YAEX,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;gBAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YACnD,CAAC;YAED,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAC9B,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,YAC9B,KAAC,gBAAgB,IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE,YAChD,KAAC,SAAS,IAAC,SAAS,EAAE,SAAS,GAAI,GAClB,GACF,EACnB,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,aAAa,EAAE,CAAC;YACxB,CAAC;oBAAS,CAAC;gBACT,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;oBAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function useDoubleCtrlC(onExit: () => void): {
2
+ handleCtrlC: (isStreaming: boolean, onAbort: () => void) => void;
3
+ showExitHint: boolean;
4
+ };
5
+ //# sourceMappingURL=use-double-ctrl-c.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-double-ctrl-c.d.ts","sourceRoot":"","sources":["../../src/hooks/use-double-ctrl-c.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,IAAI;+BAM/B,OAAO,WAAW,MAAM,IAAI;;EA6B7C"}