xtralab 0.11.1 → 0.12.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 (159) hide show
  1. package/README.md +37 -231
  2. package/lib/agentSessions.d.ts +6 -2
  3. package/lib/askAgent/editorSelection.d.ts +53 -0
  4. package/lib/askAgent/editorSelection.js +95 -0
  5. package/lib/askAgent/icons.d.ts +7 -0
  6. package/lib/askAgent/icons.js +15 -0
  7. package/lib/askAgent/index.d.ts +32 -0
  8. package/lib/askAgent/index.js +741 -0
  9. package/lib/askAgent/popup.d.ts +83 -0
  10. package/lib/askAgent/popup.js +221 -0
  11. package/lib/askAgent/prompt.d.ts +24 -0
  12. package/lib/askAgent/prompt.js +116 -0
  13. package/lib/askAgent/queue.d.ts +93 -0
  14. package/lib/askAgent/queue.js +207 -0
  15. package/lib/askAgent/queuePanel.d.ts +76 -0
  16. package/lib/askAgent/queuePanel.js +188 -0
  17. package/lib/askAgent/targetPicker.d.ts +58 -0
  18. package/lib/askAgent/targetPicker.js +74 -0
  19. package/lib/askAgent/tokens.d.ts +124 -0
  20. package/lib/askAgent/tokens.js +13 -0
  21. package/lib/commandBar/index.d.ts +12 -8
  22. package/lib/commandBar/index.js +58 -41
  23. package/lib/editorBreadcrumbs/index.js +9 -4
  24. package/lib/editorBreadcrumbs/widget.d.ts +7 -7
  25. package/lib/editorBreadcrumbs/widget.js +6 -8
  26. package/lib/fileBrowser/commands.d.ts +2 -8
  27. package/lib/fileBrowser/commands.js +39 -30
  28. package/lib/fileBrowser/contents.d.ts +8 -3
  29. package/lib/fileBrowser/fileBrowser.d.ts +2 -1
  30. package/lib/fileBrowser/widget.d.ts +5 -9
  31. package/lib/fileBrowser/widget.js +1 -1
  32. package/lib/fileTypeIcons/index.js +5 -2
  33. package/lib/git/api.d.ts +0 -26
  34. package/lib/git/api.js +2 -44
  35. package/lib/git/askRequest.d.ts +23 -0
  36. package/lib/git/askRequest.js +90 -0
  37. package/lib/git/commands.d.ts +14 -2
  38. package/lib/git/commands.js +16 -13
  39. package/lib/git/diffModel.d.ts +1 -9
  40. package/lib/git/diffModel.js +1 -1
  41. package/lib/git/diffProvider.js +8 -3
  42. package/lib/git/diffSurface.d.ts +19 -2
  43. package/lib/git/diffSurface.js +64 -18
  44. package/lib/git/diffTheme.d.ts +0 -4
  45. package/lib/git/diffTheme.js +1 -1
  46. package/lib/git/diffWidget.d.ts +9 -0
  47. package/lib/git/diffWidget.js +38 -10
  48. package/lib/git/imageDiff.d.ts +17 -4
  49. package/lib/git/imageDiff.js +90 -30
  50. package/lib/git/index.js +7 -2
  51. package/lib/git/notebookDiff.d.ts +10 -67
  52. package/lib/git/notebookDiff.js +62 -69
  53. package/lib/git/tokens.d.ts +5 -2
  54. package/lib/highlight/index.js +12 -8
  55. package/lib/index.js +2 -0
  56. package/lib/launcher/agents.js +3 -4
  57. package/lib/launcher/commands.d.ts +6 -2
  58. package/lib/launcher/dashboard.d.ts +8 -1
  59. package/lib/launcher/dashboard.js +39 -33
  60. package/lib/launcher/editorRegistry.js +5 -3
  61. package/lib/launcher/editors.d.ts +15 -5
  62. package/lib/launcher/icons.d.ts +0 -37
  63. package/lib/launcher/icons.js +11 -12
  64. package/lib/launcher/index.js +2 -1
  65. package/lib/launcher/invocation.d.ts +0 -15
  66. package/lib/launcher/invocation.js +1 -1
  67. package/lib/launcher/schemaDefaults.d.ts +3 -1
  68. package/lib/launcher/schemaDefaults.js +3 -1
  69. package/lib/mimeData.d.ts +7 -0
  70. package/lib/mimeData.js +16 -0
  71. package/lib/omnibox/index.d.ts +4 -0
  72. package/lib/omnibox/index.js +43 -2
  73. package/lib/omnibox/model.d.ts +43 -14
  74. package/lib/omnibox/model.js +117 -14
  75. package/lib/omnibox/recents.d.ts +65 -0
  76. package/lib/omnibox/recents.js +109 -0
  77. package/lib/omnibox/tokens.d.ts +6 -2
  78. package/lib/omnibox/widget.d.ts +23 -6
  79. package/lib/omnibox/widget.js +26 -7
  80. package/lib/showOutput/index.js +15 -18
  81. package/lib/terminals/agentTerminals.d.ts +63 -0
  82. package/lib/terminals/agentTerminals.js +157 -0
  83. package/lib/terminals/index.d.ts +7 -1
  84. package/lib/terminals/index.js +50 -30
  85. package/lib/terminals/model.d.ts +11 -2
  86. package/lib/terminals/model.js +27 -8
  87. package/lib/terminals/tokens.d.ts +66 -0
  88. package/lib/terminals/tokens.js +7 -0
  89. package/lib/terminals/widget.d.ts +3 -6
  90. package/lib/terminals/widget.js +1 -1
  91. package/lib/topBar/index.js +3 -3
  92. package/lib/walkthrough/index.js +14 -3
  93. package/lib/walkthrough/panel.d.ts +12 -4
  94. package/lib/walkthrough/panel.js +9 -3
  95. package/package.json +49 -51
  96. package/schema/command-bar.json +10 -0
  97. package/schema/omnibox.json +15 -0
  98. package/src/agentSessions.ts +6 -2
  99. package/src/askAgent/editorSelection.ts +138 -0
  100. package/src/askAgent/icons.ts +16 -0
  101. package/src/askAgent/index.ts +915 -0
  102. package/src/askAgent/popup.tsx +407 -0
  103. package/src/askAgent/prompt.ts +144 -0
  104. package/src/askAgent/queue.ts +269 -0
  105. package/src/askAgent/queuePanel.tsx +418 -0
  106. package/src/askAgent/targetPicker.tsx +209 -0
  107. package/src/askAgent/tokens.ts +139 -0
  108. package/src/commandBar/index.ts +75 -49
  109. package/src/editorBreadcrumbs/index.ts +14 -4
  110. package/src/editorBreadcrumbs/widget.ts +11 -9
  111. package/src/fileBrowser/commands.ts +45 -31
  112. package/src/fileBrowser/contents.ts +7 -3
  113. package/src/fileBrowser/fileBrowser.tsx +1 -1
  114. package/src/fileBrowser/widget.tsx +5 -3
  115. package/src/fileTypeIcons/index.ts +6 -3
  116. package/src/git/api.ts +2 -61
  117. package/src/git/askRequest.ts +113 -0
  118. package/src/git/commands.ts +41 -14
  119. package/src/git/diffModel.ts +1 -1
  120. package/src/git/diffProvider.tsx +11 -3
  121. package/src/git/diffSurface.tsx +114 -22
  122. package/src/git/diffTheme.ts +1 -1
  123. package/src/git/diffWidget.tsx +54 -7
  124. package/src/git/imageDiff.tsx +169 -58
  125. package/src/git/index.ts +10 -2
  126. package/src/git/notebookDiff.tsx +91 -57
  127. package/src/git/tokens.ts +4 -2
  128. package/src/highlight/index.ts +12 -8
  129. package/src/index.ts +2 -0
  130. package/src/launcher/agents.ts +3 -4
  131. package/src/launcher/commands.ts +6 -2
  132. package/src/launcher/dashboard.tsx +86 -38
  133. package/src/launcher/editorRegistry.ts +10 -4
  134. package/src/launcher/editors.ts +15 -5
  135. package/src/launcher/icons.ts +11 -12
  136. package/src/launcher/index.ts +2 -1
  137. package/src/launcher/invocation.ts +1 -1
  138. package/src/launcher/schemaDefaults.ts +3 -1
  139. package/src/mimeData.ts +20 -0
  140. package/src/omnibox/index.ts +48 -1
  141. package/src/omnibox/model.ts +173 -33
  142. package/src/omnibox/recents.ts +155 -0
  143. package/src/omnibox/tokens.ts +6 -2
  144. package/src/omnibox/widget.tsx +54 -13
  145. package/src/showOutput/index.ts +20 -23
  146. package/src/terminals/agentTerminals.ts +238 -0
  147. package/src/terminals/index.ts +54 -30
  148. package/src/terminals/model.ts +28 -7
  149. package/src/terminals/tokens.ts +77 -0
  150. package/src/terminals/widget.tsx +4 -2
  151. package/src/topBar/index.ts +12 -6
  152. package/src/walkthrough/index.ts +19 -4
  153. package/src/walkthrough/panel.ts +15 -5
  154. package/style/askAgent.css +544 -0
  155. package/style/commandBar.css +12 -33
  156. package/style/git.css +72 -31
  157. package/style/index.css +1 -0
  158. package/style/index.js +2 -0
  159. package/style/topBar.css +4 -4
package/style/git.css CHANGED
@@ -1,8 +1,7 @@
1
1
  /*
2
2
  * Styles for xtralab's @pierre/diffs viewer. The same surface is used by
3
3
  * the launcher dashboard's own diff tab and by the jupyterlab-git diff
4
- * providers, so these rules cover both hosts. (xtralab no longer ships a
5
- * git changes panel — the upstream jupyterlab-git panel is reused.)
4
+ * providers, so these rules cover both hosts.
6
5
  */
7
6
 
8
7
  /*
@@ -97,8 +96,8 @@
97
96
 
98
97
  .jp-xtralab-DiffWidget-segmented {
99
98
  display: inline-flex;
100
- border: 1px solid var(--jp-border-color2);
101
- border-radius: 3px;
99
+ border: var(--jp-border-width) solid var(--jp-border-color2);
100
+ border-radius: var(--jp-border-radius);
102
101
  overflow: hidden;
103
102
  background-color: var(--jp-layout-color1);
104
103
  }
@@ -109,14 +108,20 @@
109
108
  background: transparent;
110
109
  color: var(--jp-ui-font-color1);
111
110
  font-size: var(--jp-ui-font-size0);
112
- cursor: pointer;
113
111
  line-height: 1.4;
112
+ cursor: pointer;
114
113
  }
115
114
 
116
115
  .jp-xtralab-DiffWidget-segmentedButton:hover {
117
116
  background-color: var(--jp-layout-color2);
118
117
  }
119
118
 
119
+ /*
120
+ * Active segment: brand-colour fill with the inverse UI font colour — the
121
+ * same pair JupyterLab uses to mark selected items (the command palette
122
+ * active item, the file browser selection). The inverse font colour adapts
123
+ * per theme, so the label stays legible on the brand fill in both themes.
124
+ */
120
125
  .jp-xtralab-DiffWidget-segmentedButton[data-active='true'] {
121
126
  background-color: var(--jp-brand-color1);
122
127
  color: var(--jp-ui-inverse-font-color1);
@@ -586,17 +591,27 @@
586
591
  margin: 0;
587
592
  }
588
593
 
594
+ /*
595
+ * Checkerboard + border so transparent regions read clearly. The squares
596
+ * are theme-aware (JupyterLab layout colors) so the frame stays a calm
597
+ * light checkerboard in the light theme and a calm dark one in the dark
598
+ * theme, rather than a bright white block.
599
+ *
600
+ * 2-up and onion fill their whole panel with it; the swipe view instead
601
+ * carries it on its image-sized *frame* (not the surrounding area) so the
602
+ * checkerboard hugs the image. That keeps the divider's top/bottom handles
603
+ * sitting at the image edges instead of floating in the middle of a
604
+ * checkerboard expanse.
605
+ */
589
606
  .jp-xtralab-ImageDiff-frame,
590
- .jp-xtralab-ImageDiff-stack {
591
- /*
592
- * Checkerboard so transparent regions are obvious; theme-neutral.
593
- */
594
- background-color: #fff;
607
+ .jp-xtralab-ImageDiff-stack,
608
+ .jp-xtralab-ImageDiff-swipeFrame {
609
+ background-color: var(--jp-layout-color1);
595
610
  background-image:
596
- linear-gradient(45deg, #c8c8c8 25%, transparent 25%),
597
- linear-gradient(-45deg, #c8c8c8 25%, transparent 25%),
598
- linear-gradient(45deg, transparent 75%, #c8c8c8 75%),
599
- linear-gradient(-45deg, transparent 75%, #c8c8c8 75%);
611
+ linear-gradient(45deg, var(--jp-layout-color3) 25%, transparent 25%),
612
+ linear-gradient(-45deg, var(--jp-layout-color3) 25%, transparent 25%),
613
+ linear-gradient(45deg, transparent 75%, var(--jp-layout-color3) 75%),
614
+ linear-gradient(-45deg, transparent 75%, var(--jp-layout-color3) 75%);
600
615
  background-size: 16px 16px;
601
616
  background-position:
602
617
  0 0,
@@ -651,8 +666,8 @@
651
666
  }
652
667
 
653
668
  /*
654
- * Both revisions occupy the same grid cell so swipe/onion can overlay
655
- * them. `place-items: center` keeps each image at its own size (no
669
+ * Onion-skin view: both revisions occupy the same grid cell so they
670
+ * overlay. `place-items: center` keeps each image at its own size (no
656
671
  * stretching the smaller revision up to the larger one's box) while
657
672
  * `max-height/width` scale either one down to fit the available space.
658
673
  */
@@ -677,31 +692,57 @@
677
692
  }
678
693
 
679
694
  /*
680
- * Swipe view wraps the stack in a positioning context so the divider
681
- * can be overlaid without joining the grid. Keeping the divider as a
682
- * sibling of `.jp-xtralab-ImageDiff-stack` (rather than a child)
683
- * preserves the stack's existing flex sizing — it stays the only flex
684
- * item the interactive column needs to shrink, so `max-height: 100%`
685
- * on the image still keeps big revisions inside the available area.
686
- *
687
- * The whole frame is the drag target: pressing anywhere over the image
688
- * sets the divider to that x position and drag-tracks the pointer. The
689
- * dedicated bottom slider was removed because its thumb sat on a
690
- * narrow centered track that drifted out of sync with the wide
691
- * divider, which felt off. Dragging directly on the image (GitHub /
692
- * Pierre style) keeps cursor and divider visually aligned.
695
+ * Swipe view: a transparent container that just centers the image-sized
696
+ * frame in whatever space the body leaves. The checkerboard lives on the
697
+ * frame (above), not here, so it hugs the image rather than spanning the
698
+ * panel.
693
699
  */
694
- .jp-xtralab-ImageDiff-swipeFrame {
700
+ .jp-xtralab-ImageDiff-swipeArea {
695
701
  flex: 1 1 auto;
696
702
  min-height: 0;
697
703
  min-width: 0;
698
704
  width: 100%;
699
- position: relative;
700
705
  display: flex;
706
+ align-items: center;
707
+ justify-content: center;
708
+ }
709
+
710
+ /*
711
+ * The frame is sized in JS (inline `width`/`height`) to exactly the
712
+ * displayed image box. Because the frame *is* that box, the divider's
713
+ * `left: N%`, the pointer-to-percent mapping in `setFromClientX` and each
714
+ * image's `clip-path` inset all resolve against the same width — so the
715
+ * white divider line sits precisely on the seam between the two revisions
716
+ * as it is dragged. (A full-width frame instead let the line drift off the
717
+ * seam by up to half the surrounding letterbox.)
718
+ *
719
+ * The whole frame is the drag target: pressing anywhere over the image
720
+ * jumps the divider to that x and then drag-tracks the pointer (GitHub /
721
+ * Pierre style), keeping cursor, divider and seam together.
722
+ */
723
+ .jp-xtralab-ImageDiff-swipeFrame {
724
+ position: relative;
725
+ max-width: 100%;
726
+ max-height: 100%;
701
727
  user-select: none;
702
728
  touch-action: none;
703
729
  }
704
730
 
731
+ /*
732
+ * Both revisions fill the frame, so an image's clip inset of N% and the
733
+ * divider at `left: N%` cut at the same x. `object-fit: contain` only
734
+ * letterboxes when the two revisions differ in aspect ratio; for the
735
+ * common same-dimensions edit it fills the box exactly.
736
+ */
737
+ .jp-xtralab-ImageDiff-swipeImg {
738
+ position: absolute;
739
+ inset: 0;
740
+ width: 100%;
741
+ height: 100%;
742
+ display: block;
743
+ object-fit: contain;
744
+ }
745
+
705
746
  /*
706
747
  * Swipe divider: a vertical line marking the boundary between the two
707
748
  * clipped revisions. The natural seam between two clipped images is
package/style/index.css CHANGED
@@ -1,4 +1,5 @@
1
1
  @import url('base.css');
2
+ @import url('askAgent.css');
2
3
  @import url('commandBar.css');
3
4
  @import url('editorBreadcrumbs.css');
4
5
  @import url('git.css');
package/style/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import './base.css';
2
+ import './askAgent.css';
2
3
  import './commandBar.css';
4
+ import './editorBreadcrumbs.css';
3
5
  import './git.css';
4
6
  import './highlight.css';
5
7
  import './launcher.css';
package/style/topBar.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /* Sidebar toggle buttons in the top bar (xtralab:top-bar). */
2
2
 
3
- .xtralab-TopBarButton {
3
+ .jp-xtralab-TopBarButton {
4
4
  display: flex;
5
5
  align-items: center;
6
6
  }
@@ -11,7 +11,7 @@
11
11
  * its left so it floats to the far right, mirroring the left button at the
12
12
  * leading edge.
13
13
  */
14
- .xtralab-TopBarButton-right {
14
+ .jp-xtralab-TopBarButton-right {
15
15
  margin-left: auto;
16
16
  }
17
17
 
@@ -29,10 +29,10 @@
29
29
  * `!important` is needed to override the (non-important) `:host(...)` rules
30
30
  * defined inside the component's shadow DOM.
31
31
  */
32
- .xtralab-TopBarButton .jp-ToolbarButtonComponent {
32
+ .jp-xtralab-TopBarButton .jp-ToolbarButtonComponent {
33
33
  box-shadow: none !important;
34
34
  }
35
35
 
36
- .xtralab-TopBarButton .jp-ToolbarButtonComponent[disabled] {
36
+ .jp-xtralab-TopBarButton .jp-ToolbarButtonComponent[disabled] {
37
37
  background: transparent !important;
38
38
  }