@ebowwa/coder 0.7.64 → 0.7.65

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 (101) hide show
  1. package/dist/index.js +36168 -32
  2. package/dist/interfaces/ui/terminal/cli/index.js +34253 -158
  3. package/dist/interfaces/ui/terminal/native/README.md +53 -0
  4. package/dist/interfaces/ui/terminal/native/claude_code_native.darwin-x64.node +0 -0
  5. package/dist/interfaces/ui/terminal/native/claude_code_native.dylib +0 -0
  6. package/dist/interfaces/ui/terminal/native/index.d.ts +0 -0
  7. package/dist/interfaces/ui/terminal/native/index.darwin-arm64.node +0 -0
  8. package/dist/interfaces/ui/terminal/native/index.js +43 -0
  9. package/dist/interfaces/ui/terminal/native/index.node +0 -0
  10. package/dist/interfaces/ui/terminal/native/package.json +34 -0
  11. package/dist/native/README.md +53 -0
  12. package/dist/native/claude_code_native.darwin-x64.node +0 -0
  13. package/dist/native/claude_code_native.dylib +0 -0
  14. package/dist/native/index.d.ts +0 -480
  15. package/dist/native/index.darwin-arm64.node +0 -0
  16. package/dist/native/index.js +43 -1625
  17. package/dist/native/index.node +0 -0
  18. package/dist/native/package.json +34 -0
  19. package/native/index.darwin-arm64.node +0 -0
  20. package/native/index.js +33 -19
  21. package/package.json +3 -2
  22. package/packages/src/core/agent-loop/__tests__/compaction.test.ts +17 -14
  23. package/packages/src/core/agent-loop/compaction.ts +6 -2
  24. package/packages/src/core/agent-loop/index.ts +2 -0
  25. package/packages/src/core/agent-loop/loop-state.ts +1 -1
  26. package/packages/src/core/agent-loop/turn-executor.ts +4 -0
  27. package/packages/src/core/agent-loop/types.ts +4 -0
  28. package/packages/src/core/api-client-impl.ts +283 -173
  29. package/packages/src/core/cognitive-security/hooks.ts +2 -1
  30. package/packages/src/core/config/todo +7 -0
  31. package/packages/src/core/context/__tests__/integration.test.ts +334 -0
  32. package/packages/src/core/context/compaction.ts +170 -0
  33. package/packages/src/core/context/constants.ts +58 -0
  34. package/packages/src/core/context/extraction.ts +85 -0
  35. package/packages/src/core/context/index.ts +66 -0
  36. package/packages/src/core/context/summarization.ts +251 -0
  37. package/packages/src/core/context/token-estimation.ts +98 -0
  38. package/packages/src/core/context/types.ts +59 -0
  39. package/packages/src/core/models.ts +81 -4
  40. package/packages/src/core/normalizers/todo +5 -1
  41. package/packages/src/core/providers/README.md +230 -0
  42. package/packages/src/core/providers/__tests__/providers.test.ts +135 -0
  43. package/packages/src/core/providers/index.ts +419 -0
  44. package/packages/src/core/providers/types.ts +132 -0
  45. package/packages/src/core/retry.ts +10 -0
  46. package/packages/src/ecosystem/tools/index.ts +174 -0
  47. package/packages/src/index.ts +23 -2
  48. package/packages/src/interfaces/ui/index.ts +17 -20
  49. package/packages/src/interfaces/ui/spinner.ts +2 -2
  50. package/packages/src/interfaces/ui/terminal/bridge/index.ts +370 -0
  51. package/packages/src/interfaces/ui/terminal/bridge/ipc.ts +829 -0
  52. package/packages/src/interfaces/ui/terminal/bridge/screen-export.ts +968 -0
  53. package/packages/src/interfaces/ui/terminal/bridge/types.ts +226 -0
  54. package/packages/src/interfaces/ui/terminal/bridge/useBridge.ts +210 -0
  55. package/packages/src/interfaces/ui/terminal/cli/bootstrap.ts +132 -0
  56. package/packages/src/interfaces/ui/terminal/cli/index.ts +200 -13
  57. package/packages/src/interfaces/ui/terminal/cli/interactive/index.ts +110 -0
  58. package/packages/src/interfaces/ui/terminal/cli/interactive/input-handler.ts +393 -0
  59. package/packages/src/interfaces/ui/terminal/cli/interactive/interactive-runner.ts +820 -0
  60. package/packages/src/interfaces/ui/terminal/cli/interactive/message-store.ts +299 -0
  61. package/packages/src/interfaces/ui/terminal/cli/interactive/types.ts +274 -0
  62. package/packages/src/interfaces/ui/terminal/shared/index.ts +13 -0
  63. package/packages/src/interfaces/ui/terminal/shared/query.ts +9 -3
  64. package/packages/src/interfaces/ui/terminal/shared/setup.ts +5 -1
  65. package/packages/src/interfaces/ui/terminal/shared/spinner-frames.ts +73 -0
  66. package/packages/src/interfaces/ui/terminal/shared/status-line.ts +10 -2
  67. package/packages/src/native/index.ts +404 -27
  68. package/packages/src/native/tui_v2_types.ts +39 -0
  69. package/packages/src/teammates/coordination.test.ts +279 -0
  70. package/packages/src/teammates/coordination.ts +646 -0
  71. package/packages/src/teammates/index.ts +95 -25
  72. package/packages/src/teammates/integration.test.ts +272 -0
  73. package/packages/src/teammates/runner.test.ts +235 -0
  74. package/packages/src/teammates/runner.ts +750 -0
  75. package/packages/src/teammates/schemas.ts +673 -0
  76. package/packages/src/types/index.ts +1 -0
  77. package/packages/src/core/context-compaction.ts +0 -578
  78. package/packages/src/interfaces/ui/Screenshot 2026-03-02 at 9.23.10/342/200/257PM.png +0 -0
  79. package/packages/src/interfaces/ui/Screenshot 2026-03-03 at 10.55.11/342/200/257AM.png +0 -0
  80. package/packages/src/interfaces/ui/terminal/tui/HelpPanel.tsx +0 -262
  81. package/packages/src/interfaces/ui/terminal/tui/InputContext.tsx +0 -232
  82. package/packages/src/interfaces/ui/terminal/tui/InputField.tsx +0 -62
  83. package/packages/src/interfaces/ui/terminal/tui/InteractiveTUI.tsx +0 -537
  84. package/packages/src/interfaces/ui/terminal/tui/MessageArea.tsx +0 -107
  85. package/packages/src/interfaces/ui/terminal/tui/MessageStore.tsx +0 -240
  86. package/packages/src/interfaces/ui/terminal/tui/StatusBar.tsx +0 -54
  87. package/packages/src/interfaces/ui/terminal/tui/commands.ts +0 -438
  88. package/packages/src/interfaces/ui/terminal/tui/components/InteractiveElements.tsx +0 -584
  89. package/packages/src/interfaces/ui/terminal/tui/components/MultilineInput.tsx +0 -614
  90. package/packages/src/interfaces/ui/terminal/tui/components/PaneManager.tsx +0 -333
  91. package/packages/src/interfaces/ui/terminal/tui/components/Sidebar.tsx +0 -604
  92. package/packages/src/interfaces/ui/terminal/tui/components/index.ts +0 -118
  93. package/packages/src/interfaces/ui/terminal/tui/console.ts +0 -49
  94. package/packages/src/interfaces/ui/terminal/tui/index.ts +0 -90
  95. package/packages/src/interfaces/ui/terminal/tui/run.tsx +0 -42
  96. package/packages/src/interfaces/ui/terminal/tui/spinner.ts +0 -69
  97. package/packages/src/interfaces/ui/terminal/tui/tui-app.tsx +0 -390
  98. package/packages/src/interfaces/ui/terminal/tui/tui-footer.ts +0 -422
  99. package/packages/src/interfaces/ui/terminal/tui/types.ts +0 -186
  100. package/packages/src/interfaces/ui/terminal/tui/useInputHandler.ts +0 -104
  101. package/packages/src/interfaces/ui/terminal/tui/useNativeInput.ts +0 -239
@@ -1,333 +0,0 @@
1
- /** @jsx React.createElement */
2
- /**
3
- * Pane Manager Component
4
- * Resizable split pane layout for TUI
5
- *
6
- * Supports:
7
- * - Horizontal and vertical splits
8
- * - Keyboard-driven resize (Ctrl+Arrow keys when focused)
9
- * - Collapsible panes
10
- * - Min/max widths
11
- */
12
-
13
- import React, { useState, useCallback, useRef, createContext, useContext } from "react";
14
- import { Box, Text, useStdout } from "ink";
15
-
16
- // ============================================
17
- // TYPES
18
- // ============================================
19
-
20
- export type PaneDirection = "horizontal" | "vertical";
21
-
22
- export interface PaneConfig {
23
- id: string;
24
- /** Initial size (width for horizontal, height for vertical) as percentage or absolute */
25
- size: number;
26
- /** Size unit: "percent" or "fixed" */
27
- sizeUnit?: "percent" | "fixed";
28
- /** Minimum size in cells */
29
- minSize?: number;
30
- /** Maximum size in cells */
31
- maxSize?: number;
32
- /** Whether pane can be collapsed */
33
- collapsible?: boolean;
34
- /** Whether pane starts collapsed */
35
- collapsed?: boolean;
36
- /** Pane label for header */
37
- label?: string;
38
- }
39
-
40
- export interface PaneManagerProps {
41
- direction?: PaneDirection;
42
- panes: PaneConfig[];
43
- children: React.ReactNode[];
44
- /** Active pane index for resize focus */
45
- activePane?: number;
46
- /** Show resize handles */
47
- showHandles?: boolean;
48
- /** Handle character */
49
- handleChar?: string;
50
- /** Handle color */
51
- handleColor?: string;
52
- /** Called when pane sizes change */
53
- onPaneChange?: (sizes: number[]) => void;
54
- }
55
-
56
- export interface PaneContextValue {
57
- width: number;
58
- height: number;
59
- isActive: boolean;
60
- paneId: string;
61
- }
62
-
63
- export const PaneContext = createContext<PaneContextValue>({
64
- width: 80,
65
- height: 24,
66
- isActive: false,
67
- paneId: "",
68
- });
69
-
70
- /** Hook to access current pane context */
71
- export function usePaneContext(): PaneContextValue {
72
- return useContext(PaneContext);
73
- }
74
-
75
- /** Alias for usePaneContext for convenience */
76
- export const usePane = usePaneContext;
77
-
78
- // ============================================
79
- // RESIZE HANDLE COMPONENT
80
- // ============================================
81
-
82
- interface ResizeHandleProps {
83
- direction: PaneDirection;
84
- color?: string;
85
- char?: string;
86
- isFocused?: boolean;
87
- }
88
-
89
- function ResizeHandle({ direction, color = "gray", char = "│", isFocused }: ResizeHandleProps) {
90
- const handleColor = isFocused ? "cyan" : color;
91
- const displayChar = direction === "horizontal" ? char : "─";
92
-
93
- return (
94
- <Box>
95
- <Text color={handleColor}>{displayChar}</Text>
96
- </Box>
97
- );
98
- }
99
-
100
- // ============================================
101
- // COLLAPSED PANE HEADER
102
- // ============================================
103
-
104
- interface CollapsedPaneProps {
105
- config: PaneConfig;
106
- onToggle: () => void;
107
- }
108
-
109
- function CollapsedPane({ config, onToggle }: CollapsedPaneProps) {
110
- return (
111
- <Box
112
- borderStyle="single"
113
- borderColor="gray"
114
- paddingX={1}
115
- width={3}
116
- flexDirection="column"
117
- >
118
- <Text dimColor bold>
119
- {config.label?.charAt(0) || "P"}
120
- </Text>
121
- <Text dimColor>
122
- {config.collapsed ? "▶" : "◀"}
123
- </Text>
124
- </Box>
125
- );
126
- }
127
-
128
- // ============================================
129
- // PANE COMPONENT
130
- // ============================================
131
-
132
- interface PaneProps {
133
- config: PaneConfig;
134
- width: number;
135
- height: number;
136
- isActive: boolean;
137
- children: React.ReactNode;
138
- showHeader?: boolean;
139
- }
140
-
141
- function Pane({ config, width, height, isActive, children, showHeader = true }: PaneProps) {
142
- return (
143
- <PaneContext.Provider value={{ width, height, isActive, paneId: config.id }}>
144
- <Box
145
- flexDirection="column"
146
- width={width}
147
- height={height}
148
- borderStyle={isActive ? "double" : "single"}
149
- borderColor={isActive ? "cyan" : "gray"}
150
- >
151
- {/* Optional header */}
152
- {showHeader && config.label && (
153
- <Box paddingX={1} {...(isActive ? { backgroundColor: "cyan" } : {})}>
154
- <Text bold inverse={isActive} color={isActive ? "black" : "white"}>
155
- {config.label}
156
- </Text>
157
- </Box>
158
- )}
159
-
160
- {/* Content */}
161
- <Box flexGrow={1} overflow="hidden">
162
- {children}
163
- </Box>
164
- </Box>
165
- </PaneContext.Provider>
166
- );
167
- }
168
-
169
- // ============================================
170
- // PANE MANAGER COMPONENT
171
- // ============================================
172
-
173
- export function PaneManager({
174
- direction = "horizontal",
175
- panes,
176
- children,
177
- activePane = 0,
178
- showHandles = true,
179
- handleChar = "│",
180
- handleColor = "gray",
181
- onPaneChange,
182
- }: PaneManagerProps) {
183
- const { stdout } = useStdout();
184
- const totalWidth = stdout.columns || 80;
185
- const totalHeight = stdout.rows || 24;
186
-
187
- const [sizes, setSizes] = useState<number[]>(() =>
188
- panes.map(p => p.size)
189
- );
190
- const [collapsedPanes, setCollapsedPanes] = useState<Set<string>>(
191
- () => new Set(panes.filter(p => p.collapsed).map(p => p.id))
192
- );
193
-
194
- const containerRef = useRef<number>(0);
195
-
196
- // Calculate actual sizes
197
- const calculateSizes = useCallback(() => {
198
- const availableSpace = direction === "horizontal" ? totalWidth : totalHeight;
199
- const visiblePanes = panes.filter(p => !collapsedPanes.has(p.id));
200
- const handleCount = showHandles ? Math.max(0, visiblePanes.length - 1) : 0;
201
- const handleSpace = handleCount * 1; // 1 char per handle
202
- const usableSpace = availableSpace - handleSpace;
203
-
204
- const calculated: number[] = [];
205
- let remainingSpace = usableSpace;
206
- let percentTotal = 0;
207
-
208
- panes.forEach((pane, i) => {
209
- if (collapsedPanes.has(pane.id)) {
210
- calculated.push(3); // Collapsed width
211
- return;
212
- }
213
-
214
- const size = sizes[i] ?? pane.size;
215
- const unit = pane.sizeUnit ?? "percent";
216
-
217
- if (unit === "fixed") {
218
- calculated.push(size);
219
- remainingSpace -= size;
220
- } else {
221
- percentTotal += size;
222
- }
223
- });
224
-
225
- // Distribute remaining space by percentage
226
- let percentSpace = remainingSpace;
227
- panes.forEach((pane, i) => {
228
- if (collapsedPanes.has(pane.id)) return;
229
- if (pane.sizeUnit === "fixed") return;
230
-
231
- const size = sizes[i] ?? pane.size;
232
- const actualSize = Math.round((size / percentTotal) * percentSpace);
233
-
234
- // Apply min/max constraints
235
- const constrained = Math.max(
236
- pane.minSize ?? 10,
237
- Math.min(pane.maxSize ?? availableSpace, actualSize)
238
- );
239
-
240
- calculated[i] = constrained;
241
- });
242
-
243
- return calculated;
244
- }, [panes, sizes, collapsedPanes, direction, totalWidth, totalHeight, showHandles]);
245
-
246
- const actualSizes = calculateSizes();
247
-
248
- // Toggle pane collapse
249
- const togglePane = useCallback((paneId: string) => {
250
- setCollapsedPanes(prev => {
251
- const next = new Set(prev);
252
- if (next.has(paneId)) {
253
- next.delete(paneId);
254
- } else {
255
- next.add(paneId);
256
- }
257
- return next;
258
- });
259
- }, []);
260
-
261
- // Resize pane (keyboard-driven)
262
- const resizePane = useCallback((paneIndex: number, delta: number) => {
263
- setSizes(prev => {
264
- const next = [...prev];
265
- const currentSize = next[paneIndex] ?? panes[paneIndex]?.size ?? 50;
266
- const newSize = Math.max(
267
- panes[paneIndex]?.minSize ?? 10,
268
- Math.min(panes[paneIndex]?.maxSize ?? 90, currentSize + delta)
269
- );
270
- next[paneIndex] = newSize;
271
- onPaneChange?.(next);
272
- return next;
273
- });
274
- }, [panes, onPaneChange]);
275
-
276
- // Build layout
277
- const elements: React.ReactNode[] = [];
278
- let childIndex = 0;
279
-
280
- panes.forEach((pane, i) => {
281
- const isCollapsed = collapsedPanes.has(pane.id);
282
- const size = actualSizes[i] ?? 10;
283
-
284
- if (isCollapsed) {
285
- elements.push(
286
- <CollapsedPane
287
- key={pane.id}
288
- config={pane}
289
- onToggle={() => togglePane(pane.id)}
290
- />
291
- );
292
- } else {
293
- elements.push(
294
- <Pane
295
- key={pane.id}
296
- config={pane}
297
- width={direction === "horizontal" ? size : totalWidth}
298
- height={direction === "vertical" ? size : totalHeight}
299
- isActive={i === activePane}
300
- >
301
- {children[childIndex]}
302
- </Pane>
303
- );
304
- childIndex++;
305
- }
306
-
307
- // Add resize handle between panes
308
- if (showHandles && i < panes.length - 1 && !isCollapsed) {
309
- elements.push(
310
- <ResizeHandle
311
- key={`handle-${i}`}
312
- direction={direction}
313
- color={handleColor}
314
- char={handleChar}
315
- isFocused={i === activePane - 1 || i === activePane}
316
- />
317
- );
318
- }
319
- });
320
-
321
- return (
322
- <Box
323
- ref={containerRef as any}
324
- flexDirection={direction === "horizontal" ? "row" : "column"}
325
- width={totalWidth}
326
- height={totalHeight}
327
- >
328
- {elements}
329
- </Box>
330
- );
331
- }
332
-
333
- export default PaneManager;