@celljs/ta-web 4.24.0 → 4.25.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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/components/account-menu.js +5 -1
- package/esm/browser/components/app-nav.d.ts +3 -1
- package/esm/browser/components/app-nav.js +10 -10
- package/esm/browser/components/app-shell-state.d.ts +1 -0
- package/esm/browser/components/app-shell-state.js +19 -0
- package/esm/browser/components/app-view.js +5 -7
- package/esm/browser/components/chat-home.js +3 -3
- package/esm/browser/components/chat-list-hooks.d.ts +2 -0
- package/esm/browser/components/chat-list-hooks.js +6 -0
- package/esm/browser/components/chat-list-row.js +2 -2
- package/esm/browser/components/chat-list.js +2 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/editor-actions.d.ts +10 -0
- package/esm/browser/components/editor-actions.js +13 -0
- package/esm/browser/components/editor-area.js +7 -3
- package/esm/browser/components/fold-text.d.ts +4 -2
- package/esm/browser/components/fold-text.js +5 -4
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-swipe.d.ts +20 -0
- package/esm/browser/components/image-swipe.js +75 -0
- package/esm/browser/components/image-viewer.d.ts +2 -2
- package/esm/browser/components/image-viewer.js +2 -2
- package/esm/browser/components/list-motion.d.ts +44 -0
- package/esm/browser/components/list-motion.js +197 -0
- package/esm/browser/components/message-user.js +5 -3
- package/esm/browser/components/partner-row.js +1 -1
- package/esm/browser/components/relay-services.d.ts +1 -1
- package/esm/browser/components/relay-services.js +11 -91
- package/esm/browser/components/said-text.d.ts +6 -2
- package/esm/browser/components/said-text.js +8 -2
- package/esm/browser/components/side-lists.d.ts +7 -0
- package/esm/browser/components/side-lists.js +16 -0
- package/esm/browser/components/sortable.js +15 -0
- package/esm/browser/components/workbench-tabs.d.ts +5 -2
- package/esm/browser/components/workbench-tabs.js +13 -6
- package/esm/browser/components/workbench-toggle.d.ts +5 -0
- package/esm/browser/components/workbench-toggle.js +10 -0
- package/esm/browser/extension/extension-view.d.ts +1 -1
- package/esm/browser/extension/web-api-contributions.d.ts +4 -12
- package/esm/browser/extension/web-api-editors.d.ts +32 -0
- package/esm/browser/extension/web-api-editors.js +2 -0
- package/esm/browser/extension/web-api-menus.d.ts +40 -0
- package/esm/browser/extension/web-api-menus.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +9 -26
- package/esm/browser/extension/web-extension-context.js +5 -9
- package/esm/browser/extension/web-extension-protocol.d.ts +3 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +5 -2
- package/esm/browser/extension/web-extension-run.js +15 -0
- package/esm/browser/extension/web-session-notices.js +8 -0
- package/esm/browser/i18n/locales.d.ts +5 -2
- package/esm/browser/i18n/messages-ja.js +6 -3
- package/esm/browser/i18n/messages-zh-tw.js +6 -3
- package/esm/browser/i18n/messages.d.ts +4 -1
- package/esm/browser/i18n/messages.js +13 -7
- package/esm/browser/notices/chime.d.ts +16 -0
- package/esm/browser/notices/chime.js +67 -0
- package/esm/browser/notices/session-notices.d.ts +8 -0
- package/esm/browser/notices/session-notices.js +23 -2
- package/esm/browser/partners/partners-view.js +4 -1
- package/esm/browser/share/shared-page.js +2 -1
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +7 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +2 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +2 -0
- package/esm/browser/style/device.js +5 -2
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +28 -6
- package/esm/browser/style/shared.d.ts +1 -1
- package/esm/browser/style/shared.js +1 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +7 -2
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +1 -0
- package/esm/browser/util/image-swipe.d.ts +14 -3
- package/esm/browser/util/image-swipe.js +26 -3
- package/esm/browser/util/process.d.ts +5 -0
- package/esm/browser/util/process.js +22 -1
- package/lib/browser/components/account-menu.js +4 -0
- package/lib/browser/components/app-nav.d.ts +3 -1
- package/lib/browser/components/app-nav.js +8 -8
- package/lib/browser/components/app-shell-state.d.ts +1 -0
- package/lib/browser/components/app-shell-state.js +19 -0
- package/lib/browser/components/app-view.js +4 -6
- package/lib/browser/components/chat-home.js +3 -3
- package/lib/browser/components/chat-list-hooks.d.ts +2 -0
- package/lib/browser/components/chat-list-hooks.js +7 -0
- package/lib/browser/components/chat-list-row.js +2 -2
- package/lib/browser/components/chat-list.js +1 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/editor-actions.d.ts +11 -0
- package/lib/browser/components/editor-actions.js +50 -0
- package/lib/browser/components/editor-area.js +7 -3
- package/lib/browser/components/fold-text.d.ts +4 -2
- package/lib/browser/components/fold-text.js +5 -4
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-swipe.d.ts +20 -0
- package/lib/browser/components/image-swipe.js +75 -0
- package/lib/browser/components/image-viewer.d.ts +2 -2
- package/lib/browser/components/image-viewer.js +2 -2
- package/lib/browser/components/list-motion.d.ts +45 -0
- package/lib/browser/components/list-motion.js +234 -0
- package/lib/browser/components/message-user.js +5 -3
- package/lib/browser/components/partner-row.js +1 -1
- package/lib/browser/components/relay-services.d.ts +1 -1
- package/lib/browser/components/relay-services.js +9 -89
- package/lib/browser/components/said-text.d.ts +6 -2
- package/lib/browser/components/said-text.js +8 -2
- package/lib/browser/components/side-lists.d.ts +7 -0
- package/lib/browser/components/side-lists.js +16 -0
- package/lib/browser/components/sortable.js +15 -0
- package/lib/browser/components/workbench-tabs.d.ts +5 -2
- package/lib/browser/components/workbench-tabs.js +12 -5
- package/lib/browser/components/workbench-toggle.d.ts +5 -0
- package/lib/browser/components/workbench-toggle.js +11 -0
- package/lib/browser/extension/extension-view.d.ts +1 -1
- package/lib/browser/extension/web-api-contributions.d.ts +4 -12
- package/lib/browser/extension/web-api-editors.d.ts +33 -0
- package/lib/browser/extension/web-api-editors.js +3 -0
- package/lib/browser/extension/web-api-menus.d.ts +41 -0
- package/lib/browser/extension/web-api-menus.js +3 -0
- package/lib/browser/extension/web-extension-api.d.ts +9 -26
- package/lib/browser/extension/web-extension-context.js +5 -9
- package/lib/browser/extension/web-extension-protocol.d.ts +3 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +5 -2
- package/lib/browser/extension/web-extension-run.js +15 -0
- package/lib/browser/extension/web-session-notices.js +8 -0
- package/lib/browser/i18n/locales.d.ts +5 -2
- package/lib/browser/i18n/messages-ja.js +6 -3
- package/lib/browser/i18n/messages-zh-tw.js +6 -3
- package/lib/browser/i18n/messages.d.ts +4 -1
- package/lib/browser/i18n/messages.js +13 -7
- package/lib/browser/notices/chime.d.ts +17 -0
- package/lib/browser/notices/chime.js +71 -0
- package/lib/browser/notices/session-notices.d.ts +8 -0
- package/lib/browser/notices/session-notices.js +23 -2
- package/lib/browser/partners/partners-view.js +4 -1
- package/lib/browser/share/shared-page.js +2 -1
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +7 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +2 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +2 -0
- package/lib/browser/style/device.js +5 -2
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +28 -6
- package/lib/browser/style/shared.d.ts +1 -1
- package/lib/browser/style/shared.js +1 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +7 -2
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +1 -0
- package/lib/browser/util/image-swipe.d.ts +14 -3
- package/lib/browser/util/image-swipe.js +26 -3
- package/lib/browser/util/process.d.ts +5 -0
- package/lib/browser/util/process.js +22 -1
- package/package.json +7 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SwipeUtil } from '../device/swipe-util.js';
|
|
2
2
|
/**
|
|
3
|
-
* A finger that swipes a picture sideways goes to the one beside it, as the viewers of pictures of a phone do
|
|
4
|
-
* the picture follows
|
|
5
|
-
* for it. Zoomed in, the finger scrolls the picture, and only from its edge goes on to the next. Pure, for the tests.
|
|
3
|
+
* A finger that swipes a picture sideways goes to the one beside it, as the viewers of pictures of a phone do,
|
|
4
|
+
* and two fingers on a trackpad: the picture follows them with the one beside it in sight, and let go far
|
|
5
|
+
* enough, or flicked, slides out for it. Zoomed in, the finger scrolls the picture, and only from its edge goes on to the next. Pure, for the tests.
|
|
6
6
|
*/
|
|
7
7
|
export var ImageSwipeUtil;
|
|
8
8
|
(function (ImageSwipeUtil) {
|
|
@@ -14,6 +14,10 @@ export var ImageSwipeUtil;
|
|
|
14
14
|
ImageSwipeUtil.FAR = 0.25;
|
|
15
15
|
/** How long it slides on, let go slowly. */
|
|
16
16
|
ImageSwipeUtil.SETTLE_MS = 320;
|
|
17
|
+
/** Two fingers on a trackpad (wheels sideways) that went this far of its width go on at once, still moving. */
|
|
18
|
+
ImageSwipeUtil.WHEEL_FAR = 0.4;
|
|
19
|
+
/** No wheel for this long, the fingers (and the scroll that coasts on after them) let go. */
|
|
20
|
+
ImageSwipeUtil.WHEEL_QUIET_MS = 140;
|
|
17
21
|
/** Within this of an edge, it is at that edge (scrolls are fractional). */
|
|
18
22
|
const EDGE_PX = 1;
|
|
19
23
|
function edges(scrollLeft, scrollWidth, clientWidth) {
|
|
@@ -57,6 +61,25 @@ export var ImageSwipeUtil;
|
|
|
57
61
|
return beside.next ? 'next' : undefined;
|
|
58
62
|
}
|
|
59
63
|
ImageSwipeUtil.goes = goes;
|
|
64
|
+
/** A wheel's `delta` in pixels: `mode` is WheelEvent's `deltaMode` (pixels, lines, pages `page` wide). */
|
|
65
|
+
function wheelPixels(delta, mode, page) {
|
|
66
|
+
return mode === 1 ? delta * 16 : mode === 2 ? delta * page : delta;
|
|
67
|
+
}
|
|
68
|
+
ImageSwipeUtil.wheelPixels = wheelPixels;
|
|
69
|
+
/**
|
|
70
|
+
* Where two fingers on a trackpad go while they still move, `dx` from where they set off in a box `width`
|
|
71
|
+
* wide: on, once WHEEL_FAR toward a picture; else nowhere yet (it is told when they let go, as by `goes`).
|
|
72
|
+
*/
|
|
73
|
+
function wheelGoes(dx, width, beside) {
|
|
74
|
+
if (Math.abs(dx) < width * ImageSwipeUtil.WHEEL_FAR) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (dx > 0) {
|
|
78
|
+
return beside.previous ? 'previous' : undefined;
|
|
79
|
+
}
|
|
80
|
+
return beside.next ? 'next' : undefined;
|
|
81
|
+
}
|
|
82
|
+
ImageSwipeUtil.wheelGoes = wheelGoes;
|
|
60
83
|
/** Where it slides to: out of sight for the picture beside, or back. */
|
|
61
84
|
function rest(way, width) {
|
|
62
85
|
return way === 'next' ? -(width + ImageSwipeUtil.GAP) : way === 'previous' ? width + ImageSwipeUtil.GAP : 0;
|
|
@@ -84,6 +84,11 @@ export interface TurnItem {
|
|
|
84
84
|
last?: SessionMessage;
|
|
85
85
|
/** The agent is still at it. */
|
|
86
86
|
active: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The work went on in the next turn after messages an extension showed in the middle of it (a card of
|
|
89
|
+
* ta-initiative): it was not cut off where it stopped.
|
|
90
|
+
*/
|
|
91
|
+
continued?: boolean;
|
|
87
92
|
}
|
|
88
93
|
export type ThreadItem = MessageItem | TurnItem;
|
|
89
94
|
/** While the agent works, only the latest steps show; the earlier ones fold into one row. */
|
|
@@ -53,6 +53,7 @@ export var ProcessUtil;
|
|
|
53
53
|
if (working && ((_a = items[items.length - 1]) === null || _a === void 0 ? void 0 : _a.kind) !== 'turn') {
|
|
54
54
|
items.push({ kind: 'turn', key: `t${offset + messages.length}`, messages: [], steps: [], reply: [], active: true });
|
|
55
55
|
}
|
|
56
|
+
markContinued(items);
|
|
56
57
|
return items;
|
|
57
58
|
}
|
|
58
59
|
ProcessUtil.items = items;
|
|
@@ -78,6 +79,26 @@ export var ProcessUtil;
|
|
|
78
79
|
return false;
|
|
79
80
|
}
|
|
80
81
|
ProcessUtil.steered = steered;
|
|
82
|
+
/**
|
|
83
|
+
* A turn followed only by messages of extensions (role custom, a card shown in the middle of the work) and then by
|
|
84
|
+
* another turn: the work went on after them, so the turn was not cut off where it stopped.
|
|
85
|
+
*/
|
|
86
|
+
function markContinued(items) {
|
|
87
|
+
var _a;
|
|
88
|
+
for (let index = 0; index < items.length; index++) {
|
|
89
|
+
const item = items[index];
|
|
90
|
+
if (item.kind !== 'turn' || item.active) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
let next = index + 1;
|
|
94
|
+
while (next < items.length && items[next].kind === 'message' && items[next].message.role === 'custom') {
|
|
95
|
+
next++;
|
|
96
|
+
}
|
|
97
|
+
if (next > index + 1 && ((_a = items[next]) === null || _a === void 0 ? void 0 : _a.kind) === 'turn') {
|
|
98
|
+
item.continued = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
81
102
|
/** The note that Ta restarted in the middle of a run and went on with it (TaSessionResume). */
|
|
82
103
|
function resumed(message) {
|
|
83
104
|
return message.customType === TA_RESUME_MESSAGE;
|
|
@@ -170,7 +191,7 @@ export var ProcessUtil;
|
|
|
170
191
|
}
|
|
171
192
|
const roles = item.messages.map(message => message.role).filter(role => TURN_ROLES.has(role));
|
|
172
193
|
if (roles[roles.length - 1] === 'toolResult' || stopReason === 'toolUse') {
|
|
173
|
-
return 'interrupted';
|
|
194
|
+
return item.continued ? undefined : 'interrupted';
|
|
174
195
|
}
|
|
175
196
|
// An external agent that compacted its context (/compact) ends its turn with the summary, not a reply.
|
|
176
197
|
if (((_a = item.steps[item.steps.length - 1]) === null || _a === void 0 ? void 0 : _a.kind) === 'summary') {
|
|
@@ -56,6 +56,7 @@ const face_1 = require("./face");
|
|
|
56
56
|
const icon_1 = require("./icon");
|
|
57
57
|
const profile_view_1 = require("./profile-view");
|
|
58
58
|
const relay_view_1 = require("./relay-view");
|
|
59
|
+
const secret_peek_1 = require("./secret-peek");
|
|
59
60
|
const serve_restart_1 = require("./serve-restart");
|
|
60
61
|
const settings_controls_1 = require("./settings-controls");
|
|
61
62
|
const working_directory_1 = require("./working-directory");
|
|
@@ -81,6 +82,8 @@ function useAccountEntries(onSettings, onDialog) {
|
|
|
81
82
|
// A finger has no keys to learn; a phone is not the computer that pairs phones.
|
|
82
83
|
const { touch, handheld } = (0, device_1.useDevice)();
|
|
83
84
|
const restartTa = (0, serve_restart_1.useRestartTa)();
|
|
85
|
+
// The vault, while its package is on: the one place for the sign-ins, keys and personal details of the account.
|
|
86
|
+
const vault = (0, secret_peek_1.useSecretPeek)().manage;
|
|
84
87
|
const [, notices] = (0, hooks_1.useNotices)();
|
|
85
88
|
const side = (0, account_side_1.useAccountSide)();
|
|
86
89
|
const { info } = (0, account_side_1.useAccountInfo)(side, 15000);
|
|
@@ -125,6 +128,7 @@ function useAccountEntries(onSettings, onDialog) {
|
|
|
125
128
|
detail: inUse && (hosts_1.HostUtil.label(inUse) || t('ta.hosts.thisServer')),
|
|
126
129
|
}),
|
|
127
130
|
entry('accounts', t('ta.manage.accounts'), lucide_react_1.KeyRound, () => onDialog('accounts')),
|
|
131
|
+
...(vault ? [entry('vault', t('ta.manage.vault'), lucide_react_1.Vault, vault)] : []),
|
|
128
132
|
entry('directory', t('ta.manage.workingDirectory'), lucide_react_1.FolderOpen, () => onDialog('directory')),
|
|
129
133
|
...(workbench_util_1.WorkbenchUtil.isApp() || handheld ? [] : [entry('relay', t('ta.manage.relay'), lucide_react_1.Smartphone, () => onDialog('relay'))]),
|
|
130
134
|
],
|
|
@@ -35,13 +35,15 @@ export interface RailProps {
|
|
|
35
35
|
onDismissAsks?(): void;
|
|
36
36
|
/** A chat said something unseen: the amber dot on the double's entry, as on a phone's first tab; dragged away, all seen. */
|
|
37
37
|
onSeeAll?(): void;
|
|
38
|
+
/** A double click where nothing is: the sidebar and the workbench both go, or both come back. */
|
|
39
|
+
onToggleSides?(): void;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* The navigation on the left, as the tabs of a phone: the logo; the lists of the sidebar; the pages, and Discover
|
|
41
43
|
* once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
|
|
42
44
|
* Discover; that of the double talks to it, and that of the chats opens a new one (entryMenu).
|
|
43
45
|
*/
|
|
44
|
-
export declare function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, }: RailProps): React.JSX.Element;
|
|
46
|
+
export declare function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, onToggleSides, }: RailProps): React.JSX.Element;
|
|
45
47
|
/** A sidebar view of a web extension, under its title or its own top bar. */
|
|
46
48
|
export declare function SidebarView({ view }: {
|
|
47
49
|
view: WebViewEntry;
|
|
@@ -45,7 +45,6 @@ const extension_view_1 = require("../extension/extension-view");
|
|
|
45
45
|
const web_extension_protocol_1 = require("../extension/web-extension-protocol");
|
|
46
46
|
const hooks_1 = require("../hooks");
|
|
47
47
|
const use_t_1 = require("../i18n/use-t");
|
|
48
|
-
const agent_settings_1 = require("../settings/agent-settings");
|
|
49
48
|
const navigation_1 = require("../settings/navigation");
|
|
50
49
|
const account_menu_1 = require("./account-menu");
|
|
51
50
|
const asks_badge_1 = require("./asks-badge");
|
|
@@ -88,7 +87,7 @@ function RailItem({ label, place, active, onClick, onContextMenu, onPointerDown,
|
|
|
88
87
|
* once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
|
|
89
88
|
* Discover; that of the double talks to it, and that of the chats opens a new one (entryMenu).
|
|
90
89
|
*/
|
|
91
|
-
function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, }) {
|
|
90
|
+
function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, onToggleSides, }) {
|
|
92
91
|
const t = (0, use_t_1.useT)();
|
|
93
92
|
const [{ server }] = (0, hooks_1.useWorkbench)();
|
|
94
93
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
@@ -102,9 +101,12 @@ function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, on
|
|
|
102
101
|
React.createElement(Glyph, { size: 20, strokeWidth: 1.6 })));
|
|
103
102
|
};
|
|
104
103
|
const discover = (0, nav_places_1.hasDiscover)(navigation) || current === nav_places_1.DISCOVER;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
return (React.createElement("nav", { className: "ta-rail", "aria-label": t('ta.menu'), onDoubleClick: event => {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
if (onToggleSides && !((_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, 'button, a, [role="button"], input'))) {
|
|
107
|
+
onToggleSides();
|
|
108
|
+
}
|
|
109
|
+
} },
|
|
108
110
|
React.createElement("div", { className: "ta-rail-logo", title: server ? `Ta v${server.version}` : 'Ta' },
|
|
109
111
|
React.createElement(dino_1.Dino, { size: 26 })),
|
|
110
112
|
React.createElement("div", { className: "ta-rail-items" },
|
|
@@ -116,9 +118,7 @@ function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, on
|
|
|
116
118
|
navigation.nav.map(view => item(view)),
|
|
117
119
|
discover && (React.createElement(RailItem, { label: t('ta.discover'), place: "discover", active: !settingsShown && current === nav_places_1.DISCOVER, onClick: onDiscover, onContextMenu: event => openMenu(event, [settingsItem]) },
|
|
118
120
|
React.createElement(lucide_react_1.Compass, { size: 20, strokeWidth: 1.6 })))),
|
|
119
|
-
(
|
|
120
|
-
workbench && (React.createElement(RailItem, { label: `${t('ta.workbench')} (${agent_settings_1.ShortcutUtil.keys('Mod+J').join(agent_settings_1.ShortcutUtil.isMac() ? '' : '+')})`, active: workbench.open, onClick: workbench.toggle },
|
|
121
|
-
React.createElement(icon_1.SidebarRight, { size: 20, strokeWidth: 1.6 }))),
|
|
121
|
+
(surfaces.launcher || surfaces.board) && (React.createElement("div", { className: "ta-rail-tools" },
|
|
122
122
|
surfaces.launcher && (React.createElement(SurfaceButton, { label: t('ta.launcher'), active: surface === 'launcher', onClick: () => onSurface(surface === 'launcher' ? undefined : 'launcher') },
|
|
123
123
|
React.createElement(lucide_react_1.Grip, { size: 20, strokeWidth: 1.6 }))),
|
|
124
124
|
surfaces.board && (React.createElement(SurfaceButton, { label: t('ta.board'), active: surface === 'board', onClick: () => onSurface(surface === 'board' ? undefined : 'board') },
|
|
@@ -422,6 +422,24 @@ function useAppShell() {
|
|
|
422
422
|
editor.reveal();
|
|
423
423
|
}
|
|
424
424
|
};
|
|
425
|
+
// A double click on the rail where nothing is: both sides go, or come back if neither shows.
|
|
426
|
+
const toggleSides = () => {
|
|
427
|
+
const workbench = !!editors && showEditors;
|
|
428
|
+
if (sideShown || workbench) {
|
|
429
|
+
if (sideShown) {
|
|
430
|
+
toggleSide();
|
|
431
|
+
}
|
|
432
|
+
if (workbench) {
|
|
433
|
+
toggleRight();
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
toggleSide();
|
|
438
|
+
if (editors) {
|
|
439
|
+
toggleWorkbench();
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
};
|
|
425
443
|
// Cmd/Ctrl+Shift+T: the conversation last taken out of the list, back in it and shown, as it is picked there.
|
|
426
444
|
const picking = React.useRef(() => undefined);
|
|
427
445
|
const reopenChat = React.useCallback(() => {
|
|
@@ -499,6 +517,7 @@ function useAppShell() {
|
|
|
499
517
|
sideShown,
|
|
500
518
|
showList,
|
|
501
519
|
toggleWorkbench,
|
|
520
|
+
toggleSides,
|
|
502
521
|
picking,
|
|
503
522
|
chatsBusy,
|
|
504
523
|
deciding,
|
|
@@ -96,7 +96,7 @@ const workbench_view_1 = require("./workbench-view");
|
|
|
96
96
|
function AppShell() {
|
|
97
97
|
var _a, _b, _c;
|
|
98
98
|
var _d, _e;
|
|
99
|
-
const { t, workbench, extensions, host, store, pending, chat, setSideId, removedChats, chatsByDirectory, setChatsByDirectory, foldedChats, setFoldedChats, pinnedChats, setPinnedChats, letGoAsks, setLetGoAsks, navOpen, setNavOpen, phone, screenOpen, setScreenOpen, surface, setSurface, surfaces, settings, setSettings, settingsOpened, tabPage, setTabPage, openSettings, closeSettings, settingsShown, toggleRight, maximized, setMaximized, chatSettings, readArchived, sidebar, editor, online, fileUrl, openLink, activeEditor, view, sideView, side, showPage, lists, tools, openTool, editors, showEditors, navigation, codeScan, notices, railCurrent, tabView, screenPage, seenChats, looking, state, sideShown, showList, toggleWorkbench, picking, chatsBusy, setChatsBusy, deciding, } = (0, app_shell_state_1.useAppShell)();
|
|
99
|
+
const { t, workbench, extensions, host, store, pending, chat, setSideId, removedChats, chatsByDirectory, setChatsByDirectory, foldedChats, setFoldedChats, pinnedChats, setPinnedChats, letGoAsks, setLetGoAsks, navOpen, setNavOpen, phone, screenOpen, setScreenOpen, surface, setSurface, surfaces, settings, setSettings, settingsOpened, tabPage, setTabPage, openSettings, closeSettings, settingsShown, toggleRight, maximized, setMaximized, chatSettings, readArchived, sidebar, editor, online, fileUrl, openLink, activeEditor, view, sideView, side, showPage, lists, tools, openTool, editors, showEditors, navigation, codeScan, notices, railCurrent, tabView, screenPage, seenChats, looking, state, sideShown, showList, toggleWorkbench, toggleSides, picking, chatsBusy, setChatsBusy, deciding, } = (0, app_shell_state_1.useAppShell)();
|
|
100
100
|
const [providers, reloadProviders] = (0, auth_view_1.useAuthProviders)(online);
|
|
101
101
|
const [later, setLater] = (0, hooks_1.usePersisted)(app_shell_hooks_1.LOGIN_LATER);
|
|
102
102
|
/** A call failed for want of a sign-in (SIGN_IN_EVENT): the page of sign-in, even if the user put it off. */
|
|
@@ -143,9 +143,7 @@ function AppShell() {
|
|
|
143
143
|
}, onProviders: reloadProviders }));
|
|
144
144
|
}
|
|
145
145
|
// What the columns beside the conversation and the editors take, so that the editors never take more than the conversation.
|
|
146
|
-
const sideWidths = {
|
|
147
|
-
'--ta-left': `${app_shell_hooks_1.RAIL + (sideShown ? sidebar.size : 0)}px`,
|
|
148
|
-
};
|
|
146
|
+
const sideWidths = { '--ta-left': `${app_shell_hooks_1.RAIL + (sideShown ? sidebar.size : 0)}px` };
|
|
149
147
|
const classes = ['ta-app', navOpen && 'ta-nav-open', showEditors && 'ta-editors-open', showEditors && maximized && 'ta-workbench-max'];
|
|
150
148
|
const toggle = editors ? { open: showEditors, toggle: toggleWorkbench } : undefined;
|
|
151
149
|
const picked = () => {
|
|
@@ -384,8 +382,8 @@ function AppShell() {
|
|
|
384
382
|
setSettings(undefined);
|
|
385
383
|
setNavOpen(false);
|
|
386
384
|
setTabPage('discover');
|
|
387
|
-
}, onSettings: openSettings, settingsShown: settings !== undefined, surfaces: surfaces, surface: surface, onSurface: setSurface, holds: holds, asks: deciding, onDismissAsks: letGoAllAsks, onSeeAll: chatsUnseen ? seeAllChats : undefined }),
|
|
388
|
-
sideShown && (React.createElement(
|
|
385
|
+
}, onSettings: openSettings, settingsShown: settings !== undefined, surfaces: surfaces, surface: surface, onSurface: setSurface, holds: holds, asks: deciding, onDismissAsks: letGoAllAsks, onSeeAll: chatsUnseen ? seeAllChats : undefined, onToggleSides: toggleSides }),
|
|
386
|
+
sideShown && (React.createElement(workbench_toggle_1.SidebarPane, { style: (0, split_pane_1.paneStyle)(sidebar) },
|
|
389
387
|
sideList,
|
|
390
388
|
React.createElement(split_pane_1.Sash, { pane: sidebar, side: "start", label: t('ta.layout.sidebar') })))),
|
|
391
389
|
React.createElement("main", { className: "ta-main" },
|
|
@@ -75,7 +75,7 @@ function ChatDoubleItem({ home, counts, unseen, now }) {
|
|
|
75
75
|
const asks = counts.waiting > 0;
|
|
76
76
|
const fresh = counts.fresh > 0 || unseen;
|
|
77
77
|
const items = double.menu ? chat_home_util_1.ChatHomeUtil.menu(double.menu()) : [];
|
|
78
|
-
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row ta-chat-double ta-chat-home-double${double.shown ? ' ta-selected' : ''}`, "data-unseen": fresh && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, overlay: menu, onContextMenu: items.length ? event => openMenu(event, items) : undefined },
|
|
78
|
+
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row ta-chat-double ta-chat-home-double${double.shown ? ' ta-selected' : ''}`, "data-row": "double", "data-unseen": fresh && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, overlay: menu, onContextMenu: items.length ? event => openMenu(event, items) : undefined },
|
|
79
79
|
React.createElement("button", { type: "button", className: "ta-chat-item", title: double.name, "aria-current": double.shown ? 'true' : undefined, onClick: double.open },
|
|
80
80
|
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
81
81
|
React.createElement(ta_avatar_1.DinoFace, { className: "ta-chat-face", mood: asks ? 'attention' : double.busy || counts.running > 0 ? 'working' : 'idle', size: 38 }),
|
|
@@ -109,7 +109,7 @@ function ChatHomeItem({ row, time, home, selected, pinned, onPin, }) {
|
|
|
109
109
|
};
|
|
110
110
|
const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(!pinned) };
|
|
111
111
|
const current = selected || home.shownItem === item.key;
|
|
112
|
-
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row ta-chat-home-item${current ? ' ta-selected' : ''}`, "data-unseen": item.unseen ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, context_menu_1.ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: open }], [pin])) },
|
|
112
|
+
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row ta-chat-home-item${current ? ' ta-selected' : ''}`, "data-row": row.key, "data-unseen": item.unseen ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, context_menu_1.ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: open }], [pin])) },
|
|
113
113
|
React.createElement("button", { type: "button", className: "ta-chat-item", title: item.title, "aria-current": current ? 'true' : undefined, onClick: open },
|
|
114
114
|
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
115
115
|
Own && !opening ? (React.createElement("span", { className: "ta-chat-face", style: { width: 38, height: 38 }, "aria-hidden": "true" },
|
|
@@ -143,7 +143,7 @@ exports.ChatTaskItem = React.memo(function ChatTaskItem({ task, home, unseen, ti
|
|
|
143
143
|
const remove = task.remove ? () => home.remove([task]) : undefined;
|
|
144
144
|
const items = () => chat_home_util_1.ChatHomeUtil.taskMenu(task, { label: t('ta.chat.open'), run: open }, remove && { label: t('ta.task.remove'), run: remove, danger: true });
|
|
145
145
|
const ended = task.status === 'failed' || task.status === 'stopped' ? task.status : undefined;
|
|
146
|
-
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: "ta-chat-row ta-chat-task", "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: remove ? [{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: remove }] : undefined, overlay: menu, onContextMenu: event => openMenu(event, items()) },
|
|
146
|
+
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: "ta-chat-row ta-chat-task", "data-row": chat_home_util_1.ChatHomeUtil.seenKey(task), "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: remove ? [{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: remove }] : undefined, overlay: menu, onContextMenu: event => openMenu(event, items()) },
|
|
147
147
|
React.createElement("button", { type: "button", className: "ta-chat-item", title: task.title, onClick: open },
|
|
148
148
|
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
149
149
|
React.createElement(task_views_1.TaskIcon, { task: task, size: 38 }),
|
|
@@ -28,4 +28,6 @@ export declare function useMinute(): number;
|
|
|
28
28
|
export declare function usePageEnd(more: boolean, root: React.RefObject<HTMLElement | null>, end: React.RefObject<HTMLElement | null>, onEnd: () => void,
|
|
29
29
|
/** What the page drawn is: observed again as it changes. */
|
|
30
30
|
page: string): void;
|
|
31
|
+
/** A conversation that comes to the top, is pinned or let go slides to its place in the list and in a folder opened, as the others make room. */
|
|
32
|
+
export declare function useChatListMotion(list: React.RefObject<HTMLElement | null>, folder: React.RefObject<HTMLElement | null>): void;
|
|
31
33
|
//# sourceMappingURL=chat-list-hooks.d.ts.map
|
|
@@ -37,11 +37,13 @@ exports.useOfferPins = useOfferPins;
|
|
|
37
37
|
exports.useReadArchive = useReadArchive;
|
|
38
38
|
exports.useMinute = useMinute;
|
|
39
39
|
exports.usePageEnd = usePageEnd;
|
|
40
|
+
exports.useChatListMotion = useChatListMotion;
|
|
40
41
|
const react_1 = require("@celljs/react");
|
|
41
42
|
const React = __importStar(require("react"));
|
|
42
43
|
const state_protocol_1 = require("../state/state-protocol");
|
|
43
44
|
const chat_home_util_1 = require("./chat-home-util");
|
|
44
45
|
const chat_list_util_1 = require("./chat-list-util");
|
|
46
|
+
const list_motion_1 = require("./list-motion");
|
|
45
47
|
/**
|
|
46
48
|
* What comes as a row of its own (a folder, a row of the home) is pinned the first time it is there, once on any
|
|
47
49
|
* device (PIN_OFFERED): unpinned by the user, it stays so. Read from the server first, not to write over its pins.
|
|
@@ -117,4 +119,9 @@ page) {
|
|
|
117
119
|
return () => observer.disconnect();
|
|
118
120
|
}, [more, page, root, end]);
|
|
119
121
|
}
|
|
122
|
+
/** A conversation that comes to the top, is pinned or let go slides to its place in the list and in a folder opened, as the others make room. */
|
|
123
|
+
function useChatListMotion(list, folder) {
|
|
124
|
+
(0, list_motion_1.useListMotion)(list);
|
|
125
|
+
(0, list_motion_1.useListMotion)(folder);
|
|
126
|
+
}
|
|
120
127
|
//# sourceMappingURL=chat-list-hooks.js.map
|
|
@@ -129,7 +129,7 @@ function ChatFolderItem({ folder, time, selected, unseen, pinned, onOpen, onPin,
|
|
|
129
129
|
const working = folder.sessions.some(session => chat_list_util_1.ChatListUtil.isOpen(session) && session.isStreaming);
|
|
130
130
|
const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(!pinned) };
|
|
131
131
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
132
|
-
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row ta-chat-folder${selected ? ' ta-selected' : ''}`, "data-unseen": unseen.length > 0 ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, context_menu_1.ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: onOpen }], [pin])) },
|
|
132
|
+
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row ta-chat-folder${selected ? ' ta-selected' : ''}`, "data-row": folder.key, "data-unseen": unseen.length > 0 ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, context_menu_1.ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: onOpen }], [pin])) },
|
|
133
133
|
React.createElement("button", { type: "button", className: "ta-chat-item", title: `${folder.title} (${folder.sessions.length})`, "aria-current": selected ? 'true' : undefined, onClick: onOpen },
|
|
134
134
|
React.createElement("span", { className: "ta-chat-avatar-box" },
|
|
135
135
|
React.createElement(chat_icon_1.ChatIconTile, { found: folder.icon, size: 38 }),
|
|
@@ -197,7 +197,7 @@ exports.ChatItem = React.memo(function ChatItem({ session, source, selected, tim
|
|
|
197
197
|
// Its directory too for one of a package's group, as a run of a scheduled task, not the package's name.
|
|
198
198
|
const place = who || session.group ? message_1.MessageUtil.basename(session.cwd) : source.label;
|
|
199
199
|
const ended = task === 'failed' || task === 'stopped' ? task : undefined;
|
|
200
|
-
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: swipe, overlay: menu, onContextMenu: onContextMenu },
|
|
200
|
+
return (React.createElement(swipe_row_1.SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, "data-row": chat_list_util_1.ChatListUtil.key(session), "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: swipe, overlay: menu, onContextMenu: onContextMenu },
|
|
201
201
|
React.createElement("button", { type: "button", className: `ta-chat-item${compact ? ' ta-compact' : ''}${removing ? ' ta-pending' : ''}`, title: `${title}\n${source.title}`, "aria-current": selected ? 'true' : undefined, onClick: onSelect, ...screen_protocol_1.ScreenUtil.item(chat_list_util_1.ChatListUtil.file(session)) }, compact ? (React.createElement("span", { className: "ta-chat-text" },
|
|
202
202
|
React.createElement("span", { className: "ta-chat-line" },
|
|
203
203
|
who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
|
|
@@ -337,7 +337,6 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
337
337
|
const toggle = (label, open, onClick, title) => (React.createElement("button", { type: "button", className: "ta-chat-section-title ta-chat-fold", "aria-expanded": open, title: title, onClick: onClick },
|
|
338
338
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13 }),
|
|
339
339
|
label));
|
|
340
|
-
// The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left.
|
|
341
340
|
// A group of the list by directory: its head, and its conversations, those older folded.
|
|
342
341
|
const groupSection = (key, head, sessions) => {
|
|
343
342
|
const closed = folded.includes(key);
|
|
@@ -481,6 +480,7 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
481
480
|
const pageKey = `${pageCount}:${query}`;
|
|
482
481
|
(0, chat_list_hooks_1.usePageEnd)(budget.more && !(folderOpen && !handheld), scroller, end, nextPage, pageKey);
|
|
483
482
|
(0, chat_list_hooks_1.usePageEnd)(!!folder && folderBudget.more, folderScroller, folderEnd, nextPage, pageKey);
|
|
483
|
+
(0, chat_list_hooks_1.useChatListMotion)(scroller, folderScroller);
|
|
484
484
|
const head = (React.createElement("header", { className: "ta-chats-head" },
|
|
485
485
|
React.createElement("label", { className: "ta-chats-search" },
|
|
486
486
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Search, size: 15 }),
|