@timurproko/a1 0.2.5-dev.683 → 0.2.5-dev.698

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 (62) hide show
  1. package/dist/app/session-shell/prompt-suggestion-controller.d.ts +2 -0
  2. package/dist/app/session-shell/prompt-suggestion-controller.js +10 -0
  3. package/dist/app/session-shell/session-shell-root.js +15 -2
  4. package/dist/app/session-shell/session-shell.js +71 -15
  5. package/dist/app/session-shell/share-operation.d.ts +3 -0
  6. package/dist/app/session-shell/share-operation.js +11 -0
  7. package/dist/composition/settings-route-host.js +1 -1
  8. package/dist/contracts/presentation/index.d.ts +5 -0
  9. package/dist/contracts/presentation/index.js +2 -0
  10. package/dist/features/owned-ui/project-trust-dialog.js +7 -5
  11. package/dist/features/owned-ui/reference-screen-app.d.ts +2 -2
  12. package/dist/features/owned-ui/reference-screen-app.js +10 -6
  13. package/dist/features/owned-ui/settings-app.js +10 -5
  14. package/dist/integrations/pi/components/index.d.ts +3 -2
  15. package/dist/integrations/pi/components/index.js +2 -1
  16. package/dist/integrations/pi/components/modal-frame.d.ts +11 -1
  17. package/dist/integrations/pi/components/modal-frame.js +29 -1
  18. package/dist/integrations/pi/components/models-dialog.js +17 -17
  19. package/dist/integrations/pi/components/share-operation-dialog.d.ts +6 -0
  20. package/dist/integrations/pi/components/share-operation-dialog.js +40 -0
  21. package/dist/integrations/pi/components/shell-editor-autocomplete.js +15 -6
  22. package/dist/integrations/pi/components/shell-extension-ui.d.ts +3 -0
  23. package/dist/integrations/pi/components/shell-extension-ui.js +8 -4
  24. package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +0 -4
  25. package/dist/integrations/pi/components/shell-selectors-dialogs.js +56 -34
  26. package/dist/integrations/pi/components/shell-session-info-reference.js +35 -2
  27. package/dist/integrations/pi/components/shell-shared-facade.d.ts +3 -1
  28. package/dist/integrations/pi/components/shell-shared-facade.js +13 -1
  29. package/dist/integrations/pi/components/skills-dialog.js +19 -6
  30. package/dist/integrations/pi/components/theme.d.ts +8 -1
  31. package/dist/integrations/pi/components/theme.js +28 -1
  32. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +10 -2
  33. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +20 -6
  34. package/dist/integrations/pi/components/upstream/components/extension-editor.js +2 -2
  35. package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -5
  36. package/dist/integrations/pi/components/upstream/components/extension-selector.js +2 -3
  37. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +3 -2
  38. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +4 -15
  39. package/dist/integrations/pi/components/upstream/components/session-selector.d.ts +2 -0
  40. package/dist/integrations/pi/components/upstream/components/session-selector.js +136 -109
  41. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +8 -5
  42. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +63 -26
  43. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +29 -20
  44. package/dist/integrations/pi/components/upstream/components/tree-selector.js +245 -210
  45. package/dist/integrations/pi/components/upstream/components/trust-selector.js +13 -15
  46. package/dist/integrations/pi/engine/adapter.js +21 -2
  47. package/dist/integrations/pi/engine/workflow-runner.js +2 -1
  48. package/dist/native/darwin-arm64/manifest.json +1 -1
  49. package/dist/native/linux-x64/manifest.json +1 -1
  50. package/dist/native/win32-x64/manifest.json +2 -2
  51. package/dist/native/win32-x64/process-guardian.exe +0 -0
  52. package/dist/ui/apps/host.d.ts +4 -3
  53. package/dist/ui/apps/host.js +9 -4
  54. package/dist/ui/components/dialog-panel.js +6 -7
  55. package/dist/ui/components/index.d.ts +1 -1
  56. package/dist/ui/components/index.js +1 -1
  57. package/dist/ui/components/list-view.d.ts +3 -3
  58. package/dist/ui/components/list-view.js +8 -9
  59. package/dist/ui/components/shortcut-hints.d.ts +2 -0
  60. package/dist/ui/components/shortcut-hints.js +17 -1
  61. package/dist/ui/components/theme.d.ts +1 -1
  62. package/package.json +1 -1
@@ -5,17 +5,20 @@
5
5
  * selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
6
6
  * title with the established bold semantic accent treatment, placing it directly below the top rule
7
7
  * through the shared compact padded modal frame and its muted hint directly below it, deduplicating
8
- * levels, and rendering aligned muted descriptions after fixed active and bracketed default columns.
9
- * Bare A1 persists defaults immediately on Space, closes only on Escape, and uses the shared compact
10
- * semantic shortcut row. All list and border colors use the owned theme and its explicit color mode.
11
- * The comparison profile retains the public pinned component.
8
+ * levels, and rendering exclusive radio-style default markers before level names, an item-adjacent
9
+ * active checkmark, and aligned muted descriptions. Bare A1 persists defaults immediately on Space,
10
+ * closes through the implicit Ctrl+C-capable selection-cancel action, and uses the shared compact
11
+ * semantic shortcut row without advertising that alias. All list and border colors use the owned theme
12
+ * and its explicit color mode. Selected rows use the shared bare-A1 blue selection surface only around
13
+ * the rendered item span, with the existing accent arrow, normal-text level, and preserved
14
+ * current/default/description roles. The comparison profile retains the public pinned component.
12
15
  * Deviations: owned-modal-shortcut-hints, owned-level-cycle-shortcut, owned-thinking-selector-heading,
13
- * owned-thinking-selector-controls.
16
+ * owned-thinking-selector-controls, owned-dialog-ctrl-c-cancel, owned-standard-dialog-selection.
14
17
  */
15
- import { Container, fuzzyFilter, getKeybindings, Input, Key, matchesKey, SelectList, Spacer, Text, } from "@earendil-works/pi-tui";
18
+ import { Container, fuzzyFilter, getKeybindings, Input, SelectList, Spacer, Text, } from "@earendil-works/pi-tui";
16
19
  import { DynamicBorder } from "../../../startup-public.js";
17
20
  import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
18
- import { piTheme, renderPiModalShortcutHints } from "../../theme.js";
21
+ import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalListRow, renderPiModalShortcutHints } from "../../theme.js";
19
22
  const THINKING_SELECT_LIST_LAYOUT = {
20
23
  minPrimaryColumnWidth: 12,
21
24
  maxPrimaryColumnWidth: 32,
@@ -29,6 +32,25 @@ const LEVEL_DESCRIPTIONS = {
29
32
  xhigh: "Extra-high reasoning (~32k tokens)",
30
33
  max: "Maximum reasoning",
31
34
  };
35
+ class ThinkingSelectListPresentation {
36
+ list;
37
+ items;
38
+ constructor(list, items) {
39
+ this.list = list;
40
+ this.items = items;
41
+ }
42
+ invalidate() {
43
+ this.list.invalidate();
44
+ }
45
+ handleMouse(event) {
46
+ return this.list.handleMouse(event);
47
+ }
48
+ render(width) {
49
+ const selected = this.list.getSelectedItem();
50
+ const selectedIndex = selected === null ? -1 : this.items.findIndex((item) => item.value === selected.value);
51
+ return this.list.render(width).map((row, index) => renderPiModalListRow(row, width, index === selectedIndex));
52
+ }
53
+ }
32
54
  /** Bare-A1 thinking-level selector with profile-resolved shortcut presentation. */
33
55
  export class OwnedThinkingSelectorComponent extends Container {
34
56
  searchInput;
@@ -67,15 +89,16 @@ export class OwnedThinkingSelectorComponent extends Container {
67
89
  this.searchInput.onSubmit = () => this.selectList.handleInput("\r");
68
90
  this.addChild(this.searchInput);
69
91
  this.addChild(new Spacer(1));
70
- this.selectList = this.buildSelectList(this.allItems, currentLevel);
92
+ const initialList = this.buildSelectList(this.allItems, currentLevel);
93
+ this.selectList = initialList.list;
71
94
  this.selectListContainer = new Container();
72
- this.selectListContainer.addChild(this.selectList);
95
+ this.selectListContainer.addChild(initialList.presentation);
73
96
  this.addChild(this.selectListContainer);
74
97
  this.addChild(new Spacer(1));
75
98
  this.addChild(new Text(renderPiModalShortcutHints([
76
99
  { key: this.keyDisplayText("tui.select.confirm"), action: "select" },
77
100
  { key: "Space", action: "default" },
78
- { key: "Esc", action: "close" },
101
+ DIALOG_CLOSE_SHORTCUT_HINT,
79
102
  ]), 0, 0));
80
103
  this.addChild(new DynamicBorder((text) => piTheme().fg("border", text)));
81
104
  adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1, header });
@@ -89,29 +112,43 @@ export class OwnedThinkingSelectorComponent extends Container {
89
112
  .join("/");
90
113
  }
91
114
  buildSelectList(items, preselect) {
115
+ const theme = piTheme();
92
116
  const levelWidth = this.allItems.reduce((widest, item) => Math.max(widest, (item.label ?? item.value).length), 0);
117
+ const selectedDefaultMarker = theme.fg("accent", "◉");
118
+ const unselectedDefaultMarker = theme.fg("dim", "○");
93
119
  const themedItems = items.map((item) => {
94
- const level = (item.label ?? item.value).padEnd(levelWidth);
95
- const currentMarker = item.value === this.currentLevel ? ` ${piTheme().fg("success", "✓")}` : " ";
96
- const defaultMarker = item.value === this.defaultThinkingLevel
97
- ? ` ${piTheme().fg("muted", "[default]")}`
98
- : " ";
99
- const description = item.description ? piTheme().fg("muted", item.description) : "";
100
- return { value: item.value, label: `${level}${currentMarker}${defaultMarker} ${description}` };
120
+ const level = item.label ?? item.value;
121
+ const isCurrent = item.value === this.currentLevel;
122
+ const currentMarker = isCurrent ? ` ${theme.fg("success", "✓")}` : "";
123
+ const statePadding = " ".repeat(levelWidth - level.length + (isCurrent ? 0 : 2));
124
+ const defaultMarker = item.value === this.defaultThinkingLevel ? selectedDefaultMarker : unselectedDefaultMarker;
125
+ const description = item.description ? theme.fg("muted", item.description) : "";
126
+ return { value: item.value, label: `${defaultMarker} ${level}${currentMarker}${statePadding} ${description}` };
101
127
  });
102
128
  // Invariant: the bare selector uses the owned theme's explicit color mode, not upstream's host detection.
103
129
  const list = new SelectList(themedItems, Math.max(1, themedItems.length), {
104
- selectedPrefix: text => piTheme().fg("accent", text),
105
- selectedText: text => piTheme().fg("accent", text),
106
- description: text => piTheme().fg("muted", text),
107
- scrollInfo: text => piTheme().fg("muted", text),
108
- noMatch: text => piTheme().fg("muted", text),
130
+ selectedPrefix: text => theme.fg("accent", text),
131
+ selectedText: text => {
132
+ const arrowEnd = text.startsWith("→ ") ? 2 : 0;
133
+ const arrow = arrowEnd === 0 ? "" : theme.fg("accent", text.slice(0, arrowEnd));
134
+ const marker = text.includes(selectedDefaultMarker) ? selectedDefaultMarker : unselectedDefaultMarker;
135
+ const markerIndex = text.indexOf(marker, arrowEnd);
136
+ return markerIndex === -1
137
+ ? arrow + theme.fg("text", text.slice(arrowEnd))
138
+ : arrow
139
+ + theme.fg("text", text.slice(arrowEnd, markerIndex))
140
+ + marker
141
+ + theme.fg("text", text.slice(markerIndex + marker.length));
142
+ },
143
+ description: text => theme.fg("muted", text),
144
+ scrollInfo: text => theme.fg("muted", text),
145
+ noMatch: text => theme.fg("muted", text),
109
146
  }, THINKING_SELECT_LIST_LAYOUT);
110
147
  const currentIndex = themedItems.findIndex((item) => item.value === preselect);
111
148
  if (currentIndex !== -1)
112
149
  list.setSelectedIndex(currentIndex);
113
150
  list.onSelect = (item) => this.onSelect(item.value);
114
- return list;
151
+ return { list, presentation: new ThinkingSelectListPresentation(list, themedItems) };
115
152
  }
116
153
  applyFilter(query) {
117
154
  const filtered = query
@@ -120,8 +157,8 @@ export class OwnedThinkingSelectorComponent extends Container {
120
157
  const selectedValue = this.selectList.getSelectedItem()?.value;
121
158
  const newList = this.buildSelectList(filtered, selectedValue);
122
159
  this.selectListContainer.clear();
123
- this.selectListContainer.addChild(newList);
124
- this.selectList = newList;
160
+ this.selectListContainer.addChild(newList.presentation);
161
+ this.selectList = newList.list;
125
162
  }
126
163
  handleInput(keyData) {
127
164
  const kb = getKeybindings();
@@ -134,7 +171,7 @@ export class OwnedThinkingSelectorComponent extends Container {
134
171
  }
135
172
  return;
136
173
  }
137
- if (matchesKey(keyData, Key.escape)) {
174
+ if (kb.matches(keyData, "tui.select.cancel")) {
138
175
  this.onCancel();
139
176
  return;
140
177
  }
@@ -1,11 +1,17 @@
1
1
  /**
2
2
  * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
4
- * Modifications: Source-synchronized tree selector port: preserve filtering, folding, labels, copying,
5
- * tree navigation, key hints, focus, and viewport behavior while remapping public types/components
6
- * plus owned keybindings/theme helpers required to avoid the pinned package nested pi-tui singleton;
7
- * bare A1 uses the shared semantic modal shortcut row and compact padded modal frame.
8
- * Deviations: owned-modal-shortcut-hints.
4
+ * Modifications: Port remaps public types/components plus owned keybindings/theme helpers while
5
+ * preserving tree behavior; bare A1 uses compact modal chrome and label editing, four-mode
6
+ * Models-style filter status with Tab/Shift+Tab directional cycling and concise all-first presentation
7
+ * excluding internal bookkeeping, standard search input, blue item-bounded menu-arrow selection that
8
+ * preserves per-entry semantic foregrounds and has no path bullets, accent entry labels, bracketed
9
+ * timestamps, and plain label-time status, semantic role colors with session naming for the system
10
+ * root, standard paging/first-last/non-root containing-branch folding keys with a permanently expanded
11
+ * system session entry even behind hidden metadata, single-character ellipses on both clipped edges
12
+ * with bracket-delimiter preservation and selected-fragment highlighting, and Models-ordered semantic
13
+ * shortcut footers without a redundant select hint.
14
+ * Deviations: owned-modal-shortcut-hints, owned-session-tree-dialog.
9
15
  */
10
16
  import { type Component, Container, type Focusable } from "@earendil-works/pi-tui";
11
17
  import { type SessionTreeNode } from "@earendil-works/pi-coding-agent";
@@ -22,9 +28,9 @@ declare class TreeList implements Component {
22
28
  private toolCallMap;
23
29
  private multipleRoots;
24
30
  private showLabelTimestamps;
25
- private activePathIds;
26
31
  private visibleParentMap;
27
32
  private visibleChildrenMap;
33
+ private sessionRootIds;
28
34
  private lastSelectedId;
29
35
  private foldedNodes;
30
36
  onSelect?: (entryId: string) => void;
@@ -37,8 +43,6 @@ declare class TreeList implements Component {
37
43
  * Returns the index in filteredNodes, or the last index as fallback.
38
44
  */
39
45
  private findNearestVisibleIndex;
40
- /** Build the set of entry IDs on the path from root to current leaf */
41
- private buildActivePath;
42
46
  private flattenTree;
43
47
  private applyFilter;
44
48
  /**
@@ -52,6 +56,7 @@ declare class TreeList implements Component {
52
56
  private getSearchableText;
53
57
  invalidate(): void;
54
58
  getSearchQuery(): string;
59
+ getFilterMode(): FilterMode;
55
60
  getSelectedNode(): SessionTreeNode | undefined;
56
61
  copySelected(): void;
57
62
  updateNodeLabel(entryId: string, label: string | undefined, labelTimestamp?: string): void;
@@ -66,18 +71,15 @@ declare class TreeList implements Component {
66
71
  private formatToolCall;
67
72
  handleInput(keyData: string): void;
68
73
  /**
69
- * Whether a node can be folded. A node is foldable if it has visible children
70
- * and is either a root (no visible parent) or a segment start (visible parent
71
- * has multiple visible children).
74
+ * Whether a node can be folded. The system entry rendered as the session root
75
+ * stays expanded even when hidden metadata precedes it; other nodes are
76
+ * foldable when they have visible children and either appear at the filtered
77
+ * root or begin a segment below a visible branch point.
72
78
  */
73
79
  private isFoldable;
74
- /**
75
- * Find the index of the next branch segment start in the given direction.
76
- * A segment start is the first child of a branch point.
77
- *
78
- * "up" walks the visible parent chain; "down" walks visible children
79
- * (always following the first child).
80
- */
80
+ /** Resolve the nearest expanded branch containing the selected entry. */
81
+ private findNearestExpandedBranch;
82
+ /** Find the next branch segment start for the retained modified-arrow shortcuts. */
81
83
  private findBranchSegmentStart;
82
84
  }
83
85
  /**
@@ -85,15 +87,22 @@ declare class TreeList implements Component {
85
87
  */
86
88
  export declare class TreeSelectorComponent extends Container implements Focusable {
87
89
  private treeList;
90
+ private readonly searchInput;
91
+ private readonly treeFilter;
92
+ private readonly titleText;
93
+ private readonly searchInputContainer;
94
+ private readonly treeContainer;
95
+ private readonly labelInputContainer;
96
+ private readonly footerContainer;
97
+ private readonly treeHelp;
88
98
  private labelInput;
89
- private labelInputContainer;
90
- private treeContainer;
91
99
  private onLabelChangeCallback;
92
100
  onCopy?: (text: string | undefined) => void;
93
101
  private _focused;
94
102
  get focused(): boolean;
95
103
  set focused(value: boolean);
96
104
  constructor(tree: SessionTreeNode[], currentLeafId: string | null, terminalHeight: number, onSelect: (entryId: string) => void, onCancel: () => void, onLabelChange?: (entryId: string, label: string | undefined) => void, initialSelectedId?: string, initialFilterMode?: FilterMode);
105
+ private restoreTreeContent;
97
106
  private showLabelInput;
98
107
  private hideLabelInput;
99
108
  handleInput(keyData: string): void;