@cueloop/client 0.1.0-alpha.97 → 0.1.0-alpha.99

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 (76) hide show
  1. package/package.json +11 -11
  2. package/src/annotations/components/AnnotationCards.test.tsx +42 -0
  3. package/src/annotations/components/AnnotationCards.tsx +31 -8
  4. package/src/annotations/use-annotation-surface.tsx +257 -31
  5. package/src/app/App.deleted-scroll.test.tsx +1 -0
  6. package/src/app/App.diff.test.tsx +1 -0
  7. package/src/app/App.identity.test.tsx +1 -0
  8. package/src/app/App.regression.test.tsx +5 -0
  9. package/src/app/App.share-dialog.test.tsx +5 -0
  10. package/src/app/App.submit-confirm.test.tsx +3 -0
  11. package/src/app/App.test.tsx +1 -0
  12. package/src/app/App.thread-agent.test.ts +12 -0
  13. package/src/app/App.tsx +223 -97
  14. package/src/app/App.visual.test.tsx +2 -0
  15. package/src/app/App.workbench.test.tsx +53 -0
  16. package/src/app/app-screens.tsx +3 -0
  17. package/src/app/components/AppShell.tsx +1 -0
  18. package/src/app/components/AppShell.zoom.test.tsx +4 -3
  19. package/src/app/intent-dispatch.test.ts +1 -0
  20. package/src/app/run.ts +1 -0
  21. package/src/diff/components/AnnotatableFileView.test.tsx +2 -0
  22. package/src/diff/components/AnnotatableFileView.tsx +8 -0
  23. package/src/diff/components/DiffContentView.scroll.test.tsx +1 -0
  24. package/src/diff/components/DiffContentView.tsx +10 -0
  25. package/src/diff/diff-intraline.test.ts +1 -0
  26. package/src/diff/diff-intraline.ts +2 -0
  27. package/src/diff/split-diff.ts +2 -0
  28. package/src/integrations/components/ShareDialog.tsx +1 -0
  29. package/src/markdown/components/ThreadView.tsx +62 -16
  30. package/src/markdown/mark-runs.ts +1 -0
  31. package/src/markdown/markdown-highlight.ts +2 -0
  32. package/src/performance/otlp-trace.test.ts +3 -0
  33. package/src/performance/otlp-trace.ts +4 -0
  34. package/src/performance/perf-report.ts +1 -0
  35. package/src/performance/perf-timings.ts +1 -0
  36. package/src/settings/components/quick-actions-editor.test.tsx +3 -0
  37. package/src/settings/config.test.ts +15 -0
  38. package/src/settings/config.ts +14 -4
  39. package/src/stories/__snapshots__/stories.test.tsx.snap +74 -0
  40. package/src/stories/stories-app.tsx +3 -0
  41. package/src/stories/story.ts +2 -0
  42. package/src/terminal/pty.ts +1 -0
  43. package/src/thread/agent-continuation.test.ts +32 -0
  44. package/src/thread/agent-continuation.ts +13 -0
  45. package/src/thread/agent-transcript.test.ts +161 -0
  46. package/src/thread/agent-transcript.ts +336 -0
  47. package/src/thread/components/AgentConfigControls.stories.tsx +39 -0
  48. package/src/thread/components/AgentConfigControls.test.tsx +112 -0
  49. package/src/thread/components/AgentConfigControls.tsx +114 -0
  50. package/src/thread/components/AgentThreadPane.stories.tsx +105 -0
  51. package/src/thread/components/AgentThreadPane.test.tsx +829 -0
  52. package/src/thread/components/AgentThreadPane.tsx +367 -0
  53. package/src/thread/components/ThreadFooter.test.tsx +2 -0
  54. package/src/thread/components/ThreadFooter.tsx +3 -0
  55. package/src/thread/components/ThreadTree.test.tsx +41 -0
  56. package/src/thread/components/ThreadTree.tsx +25 -5
  57. package/src/thread/components/thread-tree.test.ts +3 -0
  58. package/src/thread/components/thread-tree.ts +4 -0
  59. package/src/thread/thread-controller.curate.test.ts +1 -0
  60. package/src/thread/thread-controller.live-diff.test.ts +7 -0
  61. package/src/thread/thread-controller.share.test.ts +1 -0
  62. package/src/thread/thread-controller.ts +42 -0
  63. package/src/thread/use-thread-agent.test.tsx +208 -0
  64. package/src/thread/use-thread-agent.ts +111 -0
  65. package/src/ui/components/PromptDialog.test.tsx +4 -0
  66. package/src/ui/components/RootOverlay.tsx +1 -0
  67. package/src/ui/components/primitives/Dialog.test.tsx +1 -0
  68. package/src/workbench/components/ChangesColumn.tsx +1 -0
  69. package/src/workbench/components/ChangesFileTree.test.tsx +2 -0
  70. package/src/workbench/components/FileContentsView.tsx +2 -0
  71. package/src/workbench/components/GridTabContent.tsx +7 -0
  72. package/src/workbench/components/ProjectTreeView.test.tsx +3 -0
  73. package/src/workbench/components/ProjectTreeView.tsx +1 -0
  74. package/src/workbench/components/editor-grid.test.ts +11 -0
  75. package/src/workbench/components/editor-grid.ts +10 -0
  76. package/src/workbench/use-changes-workbench.ts +5 -0
@@ -81,6 +81,7 @@ export function firstGroupId(node: EditorNode): string {
81
81
  /** Whether a group id still exists in the grid; used to re-home focus after a prune. */
82
82
  export function containsGroup(node: EditorNode, groupId: string): boolean {
83
83
  if (node.type === "group") return node.id === groupId;
84
+
84
85
  return node.children.some((child) => containsGroup(child, groupId));
85
86
  }
86
87
 
@@ -97,6 +98,7 @@ function replaceGroup(
97
98
  fn: (group: EditorGroup) => EditorNode,
98
99
  ): EditorNode {
99
100
  if (node.type === "group") return node.id === id ? fn(node) : node;
101
+
100
102
  return { ...node, children: node.children.map((child) => replaceGroup(child, id, fn)) };
101
103
  }
102
104
 
@@ -223,8 +225,10 @@ export function keepFileTab(node: EditorNode, groupId: string, tabId: string): E
223
225
  export function pruneEmpty(node: EditorNode): EditorNode | null {
224
226
  if (node.type === "group") return node.tabs.length > 0 ? node : null;
225
227
  const kept = node.children.map(pruneEmpty).filter((child): child is EditorNode => child !== null);
228
+
226
229
  if (kept.length === 0) return null;
227
230
  if (kept.length === 1) return kept[0]!;
231
+
228
232
  return { ...node, children: kept };
229
233
  }
230
234
 
@@ -233,8 +237,10 @@ export function closeTab(node: EditorNode, groupId: string, tabId: string): Edit
233
237
  const next = replaceGroup(node, groupId, (group) => {
234
238
  const tabs = group.tabs.filter((tab) => tab.id !== tabId);
235
239
  const activeTabId = group.activeTabId === tabId ? (tabs[0]?.id ?? null) : group.activeTabId;
240
+
236
241
  return { ...group, tabs, activeTabId };
237
242
  });
243
+
238
244
  return pruneEmpty(next);
239
245
  }
240
246
 
@@ -249,10 +255,12 @@ export function splitGroup(
249
255
  let focusGroupId = groupId;
250
256
  const tree = replaceGroup(node, groupId, (group) => {
251
257
  const active = group.tabs.find((tab) => tab.id === group.activeTabId) ?? group.tabs[0];
258
+
252
259
  if (active === undefined) return group;
253
260
  const movedTab: EditorTab =
254
261
  active.kind === "welcome" ? { ...active, id: freshId() } : { ...active, preview: false };
255
262
  const newGroup = makeGroup([movedTab]);
263
+
256
264
  focusGroupId = newGroup.id;
257
265
  const orientation = direction === "left" || direction === "right" ? "horizontal" : "vertical";
258
266
  const newFirst = direction === "left" || direction === "up";
@@ -268,7 +276,9 @@ export function splitGroup(
268
276
  activeTabId: sourceTabs[0]!.id,
269
277
  };
270
278
  const children = newFirst ? [newGroup, sourceGroup] : [sourceGroup, newGroup];
279
+
271
280
  return { type: "branch", id: freshId(), orientation, children };
272
281
  });
282
+
273
283
  return { tree, focusGroupId };
274
284
  }
@@ -141,24 +141,29 @@ export function useChangesWorkbench(options?: ChangesWorkbenchOptions): ChangesW
141
141
  const close = (groupId: string, tabId: string): void => {
142
142
  setGrid((tree) => {
143
143
  const pruned = closeTab(tree, groupId, tabId);
144
+
144
145
  if (pruned === null) {
145
146
  setChangesOpen(false);
146
147
  setProjectMode("tree");
147
148
  // leaving zoom on would hide the Thread pane with no editor to fill the gap
148
149
  setZoomed(false);
150
+
149
151
  return makeGroup([changesTab()]);
150
152
  }
151
153
  // re-home focus when the closed group was pruned away, so the next open has a live target
152
154
  setFocusedGroup((current) =>
153
155
  current !== null && containsGroup(pruned, current) ? current : firstGroupId(pruned),
154
156
  );
157
+
155
158
  return pruned;
156
159
  });
157
160
  };
158
161
  const split = (groupId: string, direction: SplitDirection): void => {
159
162
  setGrid((tree) => {
160
163
  const result = splitGroup(tree, groupId, direction);
164
+
161
165
  setFocusedGroup(result.focusGroupId);
166
+
162
167
  return result.tree;
163
168
  });
164
169
  };