@celljs/ta-web 4.38.0 → 4.39.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/esm/browser/assistant/assistant-thread.d.ts +1 -1
- package/esm/browser/assistant/chat-task-source.js +2 -1
- package/esm/browser/components/app-contexts.js +11 -10
- package/esm/browser/components/chat-asks.d.ts +4 -1
- package/esm/browser/components/chat-asks.js +10 -0
- package/esm/browser/components/chat-list-row.js +5 -3
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-box-protocol.d.ts +5 -0
- package/esm/browser/components/composer-box.js +11 -14
- package/esm/browser/components/composer-media.d.ts +26 -0
- package/esm/browser/components/composer-media.js +37 -0
- package/esm/browser/components/composer-target.d.ts +2 -2
- package/esm/browser/components/composer-target.js +3 -3
- package/esm/browser/components/composer.js +1 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/link.d.ts +7 -1
- package/esm/browser/components/link.js +24 -5
- package/esm/browser/components/markdown.d.ts +1 -1
- package/esm/browser/components/markdown.js +70 -4
- package/esm/browser/components/remote-hosts.d.ts +3 -1
- package/esm/browser/components/remote-hosts.js +10 -5
- package/esm/browser/components/session-view.js +10 -6
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +12 -3
- package/esm/browser/device/photo-picker.d.ts +11 -3
- package/esm/browser/device/photo-picker.js +26 -9
- package/esm/browser/device/video-picks.d.ts +24 -0
- package/esm/browser/device/video-picks.js +104 -0
- package/esm/browser/extension/icons.js +3 -1
- package/esm/browser/extension/web-access.js +4 -1
- package/esm/browser/extension/web-api-code.d.ts +36 -0
- package/esm/browser/extension/web-api-code.js +3 -0
- package/esm/browser/extension/web-api-components.d.ts +22 -0
- package/esm/browser/extension/web-api-contributions.d.ts +0 -31
- package/esm/browser/extension/web-api-menus.d.ts +17 -5
- package/esm/browser/extension/web-api-play.d.ts +29 -0
- package/esm/browser/extension/web-api-play.js +2 -0
- package/esm/browser/extension/web-api-spec.js +3 -0
- package/esm/browser/extension/web-api-terminal.d.ts +20 -0
- package/esm/browser/extension/web-extension-api.d.ts +12 -17
- package/esm/browser/extension/web-extension-context.d.ts +1 -1
- package/esm/browser/extension/web-extension-context.js +4 -3
- package/esm/browser/extension/web-extension-protocol.d.ts +2 -0
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +4 -3
- package/esm/browser/extension/web-extension-run.js +15 -8
- package/esm/browser/extension/web-extensions-running.js +38 -7
- package/esm/browser/extension/web-on-demand.d.ts +5 -0
- package/esm/browser/extension/web-on-demand.js +11 -0
- package/esm/browser/i18n/en/assistant.d.ts +3 -0
- package/esm/browser/i18n/en/assistant.js +3 -0
- package/esm/browser/i18n/en/chat.d.ts +1 -0
- package/esm/browser/i18n/en/chat.js +1 -0
- package/esm/browser/i18n/en/common.d.ts +1 -0
- package/esm/browser/i18n/en/common.js +1 -0
- package/esm/browser/i18n/en/discover.d.ts +2 -0
- package/esm/browser/i18n/en/discover.js +2 -0
- package/esm/browser/i18n/en/service.js +6 -6
- package/esm/browser/i18n/ja/assistant.js +3 -0
- package/esm/browser/i18n/ja/chat.js +1 -0
- package/esm/browser/i18n/ja/common.js +1 -0
- package/esm/browser/i18n/ja/discover.js +2 -0
- package/esm/browser/i18n/ja/service.js +6 -6
- package/esm/browser/i18n/locales.d.ts +8 -1
- package/esm/browser/i18n/messages.d.ts +7 -0
- package/esm/browser/i18n/zh/assistant.js +3 -0
- package/esm/browser/i18n/zh/chat.js +1 -0
- package/esm/browser/i18n/zh/common.js +1 -0
- package/esm/browser/i18n/zh/discover.js +2 -0
- package/esm/browser/i18n/zh/service.js +6 -6
- package/esm/browser/i18n/zh-tw/assistant.js +3 -0
- package/esm/browser/i18n/zh-tw/chat.js +1 -0
- package/esm/browser/i18n/zh-tw/common.js +1 -0
- package/esm/browser/i18n/zh-tw/discover.js +2 -0
- package/esm/browser/i18n/zh-tw/service.js +6 -6
- package/esm/browser/markdown/code-renderers.d.ts +3 -1
- package/esm/browser/markdown/code-renderers.js +2 -0
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/sandbox/work/work-api.d.ts +113 -0
- package/esm/browser/sandbox/work/work-api.js +95 -0
- package/esm/browser/sandbox/work/work-docs.d.ts +18 -0
- package/esm/browser/sandbox/work/work-docs.js +66 -0
- package/esm/browser/sandbox/work/work-frame.d.ts +27 -0
- package/esm/browser/sandbox/work/work-frame.js +124 -0
- package/esm/browser/share/shared-extensions.d.ts +2 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +10 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +1 -0
- package/esm/browser/terminal/terminal-osc.d.ts +15 -0
- package/esm/browser/terminal/terminal-osc.js +91 -0
- package/esm/browser/terminal/web-terminal.d.ts +4 -7
- package/esm/browser/terminal/web-terminal.js +22 -26
- package/esm/browser/util/link.d.ts +6 -1
- package/esm/browser/util/link.js +11 -0
- package/lib/browser/assistant/assistant-thread.d.ts +1 -1
- package/lib/browser/assistant/chat-task-source.js +2 -1
- package/lib/browser/components/app-contexts.js +10 -9
- package/lib/browser/components/chat-asks.d.ts +4 -1
- package/lib/browser/components/chat-asks.js +10 -0
- package/lib/browser/components/chat-list-row.js +5 -3
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-box-protocol.d.ts +5 -0
- package/lib/browser/components/composer-box.js +9 -12
- package/lib/browser/components/composer-media.d.ts +27 -0
- package/lib/browser/components/composer-media.js +74 -0
- package/lib/browser/components/composer-target.d.ts +2 -2
- package/lib/browser/components/composer-target.js +3 -3
- package/lib/browser/components/composer.js +1 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/link.d.ts +7 -1
- package/lib/browser/components/link.js +25 -6
- package/lib/browser/components/markdown.d.ts +1 -1
- package/lib/browser/components/markdown.js +68 -2
- package/lib/browser/components/remote-hosts.d.ts +3 -1
- package/lib/browser/components/remote-hosts.js +10 -5
- package/lib/browser/components/session-view.js +8 -4
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +12 -3
- package/lib/browser/device/photo-picker.d.ts +11 -3
- package/lib/browser/device/photo-picker.js +26 -9
- package/lib/browser/device/video-picks.d.ts +25 -0
- package/lib/browser/device/video-picks.js +107 -0
- package/lib/browser/extension/icons.js +2 -0
- package/lib/browser/extension/web-access.js +4 -1
- package/lib/browser/extension/web-api-code.d.ts +37 -0
- package/lib/browser/extension/web-api-code.js +4 -0
- package/lib/browser/extension/web-api-components.d.ts +22 -0
- package/lib/browser/extension/web-api-contributions.d.ts +0 -31
- package/lib/browser/extension/web-api-menus.d.ts +17 -5
- package/lib/browser/extension/web-api-play.d.ts +30 -0
- package/lib/browser/extension/web-api-play.js +3 -0
- package/lib/browser/extension/web-api-spec.js +3 -0
- package/lib/browser/extension/web-api-terminal.d.ts +20 -0
- package/lib/browser/extension/web-extension-api.d.ts +12 -17
- package/lib/browser/extension/web-extension-context.d.ts +1 -1
- package/lib/browser/extension/web-extension-context.js +4 -3
- package/lib/browser/extension/web-extension-protocol.d.ts +2 -0
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +4 -3
- package/lib/browser/extension/web-extension-run.js +15 -8
- package/lib/browser/extension/web-extensions-running.js +38 -7
- package/lib/browser/extension/web-on-demand.d.ts +5 -0
- package/lib/browser/extension/web-on-demand.js +11 -0
- package/lib/browser/i18n/en/assistant.d.ts +3 -0
- package/lib/browser/i18n/en/assistant.js +3 -0
- package/lib/browser/i18n/en/chat.d.ts +1 -0
- package/lib/browser/i18n/en/chat.js +1 -0
- package/lib/browser/i18n/en/common.d.ts +1 -0
- package/lib/browser/i18n/en/common.js +1 -0
- package/lib/browser/i18n/en/discover.d.ts +2 -0
- package/lib/browser/i18n/en/discover.js +2 -0
- package/lib/browser/i18n/en/service.js +6 -6
- package/lib/browser/i18n/ja/assistant.js +3 -0
- package/lib/browser/i18n/ja/chat.js +1 -0
- package/lib/browser/i18n/ja/common.js +1 -0
- package/lib/browser/i18n/ja/discover.js +2 -0
- package/lib/browser/i18n/ja/service.js +6 -6
- package/lib/browser/i18n/locales.d.ts +8 -1
- package/lib/browser/i18n/messages.d.ts +7 -0
- package/lib/browser/i18n/zh/assistant.js +3 -0
- package/lib/browser/i18n/zh/chat.js +1 -0
- package/lib/browser/i18n/zh/common.js +1 -0
- package/lib/browser/i18n/zh/discover.js +2 -0
- package/lib/browser/i18n/zh/service.js +6 -6
- package/lib/browser/i18n/zh-tw/assistant.js +3 -0
- package/lib/browser/i18n/zh-tw/chat.js +1 -0
- package/lib/browser/i18n/zh-tw/common.js +1 -0
- package/lib/browser/i18n/zh-tw/discover.js +2 -0
- package/lib/browser/i18n/zh-tw/service.js +6 -6
- package/lib/browser/markdown/code-renderers.d.ts +3 -1
- package/lib/browser/markdown/code-renderers.js +3 -1
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/sandbox/work/work-api.d.ts +114 -0
- package/lib/browser/sandbox/work/work-api.js +99 -0
- package/lib/browser/sandbox/work/work-docs.d.ts +19 -0
- package/lib/browser/sandbox/work/work-docs.js +69 -0
- package/lib/browser/sandbox/work/work-frame.d.ts +28 -0
- package/lib/browser/sandbox/work/work-frame.js +160 -0
- package/lib/browser/share/shared-extensions.d.ts +2 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +10 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +1 -0
- package/lib/browser/terminal/terminal-osc.d.ts +16 -0
- package/lib/browser/terminal/terminal-osc.js +94 -0
- package/lib/browser/terminal/web-terminal.d.ts +4 -7
- package/lib/browser/terminal/web-terminal.js +25 -29
- package/lib/browser/util/link.d.ts +6 -1
- package/lib/browser/util/link.js +11 -0
- package/package.json +7 -7
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const PROGRESS_STATES = { '1': 'normal', '2': 'error', '3': 'busy', '4': 'paused' };
|
|
2
|
+
/** What OSC 7501 says, by its `state`: `none` for idle or cleared. */
|
|
3
|
+
const STATUS_STATES = {
|
|
4
|
+
working: 'working',
|
|
5
|
+
blocked: 'blocked',
|
|
6
|
+
done: 'done',
|
|
7
|
+
error: 'error',
|
|
8
|
+
idle: 'none',
|
|
9
|
+
clear: 'none',
|
|
10
|
+
};
|
|
11
|
+
const BLOCKED_KINDS = new Set(['permission', 'question', 'auth']);
|
|
12
|
+
const APP = /^[A-Za-z0-9_.+-]{1,32}$/;
|
|
13
|
+
/** OSC 9: the progress of ConEmu (`4;state;value`), else a notification of iTerm2 (its text). */
|
|
14
|
+
export var TerminalOsc;
|
|
15
|
+
(function (TerminalOsc) {
|
|
16
|
+
function progress(data) {
|
|
17
|
+
var _a;
|
|
18
|
+
const match = /^4(?:;(\d*))?(?:;(\d*))?/.exec(data);
|
|
19
|
+
if (!match) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const state = PROGRESS_STATES[(_a = match[1]) !== null && _a !== void 0 ? _a : '0'];
|
|
23
|
+
if (!state) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const value = match[2] ? Math.min(100, Math.max(0, Number(match[2]))) : undefined;
|
|
27
|
+
// A state without a number keeps no value; busy has none.
|
|
28
|
+
return state === 'busy' || value === undefined ? { state } : { state, value };
|
|
29
|
+
}
|
|
30
|
+
TerminalOsc.progress = progress;
|
|
31
|
+
/** What a terminal that takes OSC 7501 answers its query (`?`) with: the same. */
|
|
32
|
+
TerminalOsc.STATUS_REPLY = '\x1b]7501;?\x1b\\';
|
|
33
|
+
function isStatusQuery(data) {
|
|
34
|
+
return data.startsWith('?');
|
|
35
|
+
}
|
|
36
|
+
TerminalOsc.isStatusQuery = isStatusQuery;
|
|
37
|
+
/**
|
|
38
|
+
* OSC 7501 (superlogical.com/rex/docs/build/program-status): `state=blocked:kind=permission:msg=<base64>`;
|
|
39
|
+
* undefined for idle or cleared, null for what is not a status.
|
|
40
|
+
*/
|
|
41
|
+
function status(data) {
|
|
42
|
+
var _a;
|
|
43
|
+
const pairs = new Map();
|
|
44
|
+
for (const pair of data.split(':')) {
|
|
45
|
+
const at = pair.indexOf('=');
|
|
46
|
+
if (at > 0) {
|
|
47
|
+
pairs.set(pair.slice(0, at), pair.slice(at + 1));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const state = STATUS_STATES[(_a = pairs.get('state')) !== null && _a !== void 0 ? _a : ''];
|
|
51
|
+
if (!state) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
if (state === 'none') {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
const kind = pairs.get('kind');
|
|
58
|
+
const message = text(pairs.get('msg'));
|
|
59
|
+
const app = pairs.get('app');
|
|
60
|
+
return {
|
|
61
|
+
state,
|
|
62
|
+
...(state === 'blocked' && kind && BLOCKED_KINDS.has(kind) ? { kind: kind } : {}),
|
|
63
|
+
...(message ? { message } : {}),
|
|
64
|
+
...(app && APP.test(app) ? { app } : {}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
TerminalOsc.status = status;
|
|
68
|
+
/** The base64 UTF-8 of `msg`, one line; undefined for none, or what does not decode. */
|
|
69
|
+
function text(base64) {
|
|
70
|
+
if (!base64) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
const bytes = Uint8Array.from(atob(base64), char => char.charCodeAt(0));
|
|
75
|
+
return (new TextDecoder('utf-8', { fatal: true })
|
|
76
|
+
.decode(bytes)
|
|
77
|
+
.replace(/\p{Cc}/gu, ' ')
|
|
78
|
+
.trim() || undefined);
|
|
79
|
+
}
|
|
80
|
+
catch (_a) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** OSC 777: `notify;title;body`, as rxvt and Ghostty take it; null for anything else. */
|
|
85
|
+
function notification(data) {
|
|
86
|
+
const [kind, ...rest] = data.split(';');
|
|
87
|
+
return kind === 'notify' ? rest.filter(Boolean).join(': ') : null;
|
|
88
|
+
}
|
|
89
|
+
TerminalOsc.notification = notification;
|
|
90
|
+
})(TerminalOsc || (TerminalOsc = {}));
|
|
91
|
+
//# sourceMappingURL=terminal-osc.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FitAddon } from '@xterm/addon-fit';
|
|
2
2
|
import type { ILink, Terminal } from '@xterm/xterm';
|
|
3
|
-
import type { WebTerminal, WebTerminalKey, WebTerminalOptions, WebTerminalProgress } from '../extension/web-extension-api.js';
|
|
3
|
+
import type { WebTerminal, WebTerminalKey, WebTerminalOptions, WebTerminalProgress, WebTerminalStatus } from '../extension/web-extension-api.js';
|
|
4
4
|
import type { OpenLinkOptions } from '../links/links-protocol.js';
|
|
5
5
|
import { type TaSettings } from '../settings/settings-protocol.js';
|
|
6
6
|
import type { LinkTarget } from '../util/link.js';
|
|
@@ -9,12 +9,6 @@ type XtermModule = typeof import('./xterm.js');
|
|
|
9
9
|
export declare namespace XtermLoader {
|
|
10
10
|
function load(): Promise<XtermModule>;
|
|
11
11
|
}
|
|
12
|
-
/** OSC 9: the progress of ConEmu (`4;state;value`), else a notification of iTerm2 (its text). */
|
|
13
|
-
export declare namespace TerminalOsc {
|
|
14
|
-
function progress(data: string): WebTerminalProgress | undefined | null;
|
|
15
|
-
/** OSC 777: `notify;title;body`, as rxvt and Ghostty take it; null for anything else. */
|
|
16
|
-
function notification(data: string): string | null;
|
|
17
|
-
}
|
|
18
12
|
/** What a key of a terminal does besides typing: clear, copy, paste. */
|
|
19
13
|
export type TerminalShortcut = 'clear' | 'copy' | 'paste';
|
|
20
14
|
export declare namespace TerminalKeys {
|
|
@@ -61,8 +55,10 @@ export declare class DefaultWebTerminal implements WebTerminal {
|
|
|
61
55
|
protected readonly titleListeners: Set<(title: string | undefined) => void>;
|
|
62
56
|
protected readonly progressListeners: Set<(progress: WebTerminalProgress | undefined) => void>;
|
|
63
57
|
protected readonly attentionListeners: Set<(message: string | undefined) => void>;
|
|
58
|
+
protected readonly statusListeners: Set<(status: WebTerminalStatus | undefined) => void>;
|
|
64
59
|
title?: string;
|
|
65
60
|
progress?: WebTerminalProgress;
|
|
61
|
+
status?: WebTerminalStatus;
|
|
66
62
|
protected readonly host: HTMLDivElement;
|
|
67
63
|
protected parent?: HTMLElement;
|
|
68
64
|
protected observer?: ResizeObserver;
|
|
@@ -78,6 +74,7 @@ export declare class DefaultWebTerminal implements WebTerminal {
|
|
|
78
74
|
onCwdChange(listener: (cwd: string) => void): () => void;
|
|
79
75
|
onTitleChange(listener: (title: string | undefined) => void): () => void;
|
|
80
76
|
onProgressChange(listener: (progress: WebTerminalProgress | undefined) => void): () => void;
|
|
77
|
+
onStatusChange(listener: (status: WebTerminalStatus | undefined) => void): () => void;
|
|
81
78
|
onAttention(listener: (message: string | undefined) => void): () => void;
|
|
82
79
|
getSelection(): string;
|
|
83
80
|
selectAll(): void;
|
|
@@ -3,6 +3,7 @@ import { message } from '../i18n/messages.js';
|
|
|
3
3
|
import { ShortcutUtil } from '../settings/agent-settings.js';
|
|
4
4
|
import { SettingsUtil } from '../settings/settings-protocol.js';
|
|
5
5
|
import { TerminalLinkUtil } from './terminal-links.js';
|
|
6
|
+
import { TerminalOsc } from './terminal-osc.js';
|
|
6
7
|
import { TerminalTheme } from './terminal-theme.js';
|
|
7
8
|
/** Loads xterm.js the first time a terminal is made, not with the page. */
|
|
8
9
|
export var XtermLoader;
|
|
@@ -25,32 +26,6 @@ const MAX_WRAPPED_ROWS = 50;
|
|
|
25
26
|
/** A view being dragged to a new size fits once it stops. */
|
|
26
27
|
const FIT_MS = 50;
|
|
27
28
|
const ARROWS = { ArrowUp: 'A', ArrowDown: 'B', ArrowRight: 'C', ArrowLeft: 'D' };
|
|
28
|
-
const PROGRESS_STATES = { '1': 'normal', '2': 'error', '3': 'busy', '4': 'paused' };
|
|
29
|
-
/** OSC 9: the progress of ConEmu (`4;state;value`), else a notification of iTerm2 (its text). */
|
|
30
|
-
export var TerminalOsc;
|
|
31
|
-
(function (TerminalOsc) {
|
|
32
|
-
function progress(data) {
|
|
33
|
-
var _a;
|
|
34
|
-
const match = /^4(?:;(\d*))?(?:;(\d*))?/.exec(data);
|
|
35
|
-
if (!match) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const state = PROGRESS_STATES[(_a = match[1]) !== null && _a !== void 0 ? _a : '0'];
|
|
39
|
-
if (!state) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
const value = match[2] ? Math.min(100, Math.max(0, Number(match[2]))) : undefined;
|
|
43
|
-
// A state without a number keeps no value; busy has none.
|
|
44
|
-
return state === 'busy' || value === undefined ? { state } : { state, value };
|
|
45
|
-
}
|
|
46
|
-
TerminalOsc.progress = progress;
|
|
47
|
-
/** OSC 777: `notify;title;body`, as rxvt and Ghostty take it; null for anything else. */
|
|
48
|
-
function notification(data) {
|
|
49
|
-
const [kind, ...rest] = data.split(';');
|
|
50
|
-
return kind === 'notify' ? rest.filter(Boolean).join(': ') : null;
|
|
51
|
-
}
|
|
52
|
-
TerminalOsc.notification = notification;
|
|
53
|
-
})(TerminalOsc || (TerminalOsc = {}));
|
|
54
29
|
export var TerminalKeys;
|
|
55
30
|
(function (TerminalKeys) {
|
|
56
31
|
/**
|
|
@@ -112,6 +87,7 @@ export class DefaultWebTerminal {
|
|
|
112
87
|
this.titleListeners = new Set();
|
|
113
88
|
this.progressListeners = new Set();
|
|
114
89
|
this.attentionListeners = new Set();
|
|
90
|
+
this.statusListeners = new Set();
|
|
115
91
|
this.host = document.createElement('div');
|
|
116
92
|
this.cols = (_a = options.cols) !== null && _a !== void 0 ? _a : DEFAULT_COLS;
|
|
117
93
|
this.rows = (_b = options.rows) !== null && _b !== void 0 ? _b : DEFAULT_ROWS;
|
|
@@ -147,6 +123,10 @@ export class DefaultWebTerminal {
|
|
|
147
123
|
this.progressListeners.add(listener);
|
|
148
124
|
return () => this.progressListeners.delete(listener);
|
|
149
125
|
}
|
|
126
|
+
onStatusChange(listener) {
|
|
127
|
+
this.statusListeners.add(listener);
|
|
128
|
+
return () => this.statusListeners.delete(listener);
|
|
129
|
+
}
|
|
150
130
|
onAttention(listener) {
|
|
151
131
|
this.attentionListeners.add(listener);
|
|
152
132
|
return () => this.attentionListeners.delete(listener);
|
|
@@ -222,6 +202,7 @@ export class DefaultWebTerminal {
|
|
|
222
202
|
this.titleListeners.clear();
|
|
223
203
|
this.progressListeners.clear();
|
|
224
204
|
this.attentionListeners.clear();
|
|
205
|
+
this.statusListeners.clear();
|
|
225
206
|
}
|
|
226
207
|
start(module) {
|
|
227
208
|
if (this.disposed) {
|
|
@@ -313,6 +294,21 @@ export class DefaultWebTerminal {
|
|
|
313
294
|
}
|
|
314
295
|
return message !== null;
|
|
315
296
|
});
|
|
297
|
+
// OSC 7501: answered when asked, so that a program (pi) says what it does; the tab shows it.
|
|
298
|
+
term.parser.registerOscHandler(7501, data => {
|
|
299
|
+
if (TerminalOsc.isStatusQuery(data)) {
|
|
300
|
+
this.emitData(TerminalOsc.STATUS_REPLY);
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
const status = TerminalOsc.status(data);
|
|
304
|
+
if (status !== null && JSON.stringify(status) !== JSON.stringify(this.status)) {
|
|
305
|
+
this.status = status;
|
|
306
|
+
for (const listener of this.statusListeners) {
|
|
307
|
+
listener(status);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return status !== null;
|
|
311
|
+
});
|
|
316
312
|
term.onBell(() => this.emitAttention(undefined));
|
|
317
313
|
term.parser.registerOscHandler(7, data => {
|
|
318
314
|
const cwd = TerminalLinkUtil.cwdOf(data);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextSelection } from '../extension/web-extension-api.js';
|
|
1
|
+
import type { TextSelection, WebFileRef } from '../extension/web-extension-api.js';
|
|
2
2
|
/** What a link of a reply points to, as written: a page of the web, a mail, or a path on the machine of the conversation. */
|
|
3
3
|
export type LinkTarget = {
|
|
4
4
|
type: 'url';
|
|
@@ -76,4 +76,9 @@ export declare namespace LinkUtil {
|
|
|
76
76
|
* (the domain and those under it), `localhost:3000` (that port only), or `*` for all.
|
|
77
77
|
*/
|
|
78
78
|
function trusted(url: string, domains: readonly string[], ownHost?: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* A file of a conversation in `cwd` as the menus of files take it (WebFileRef): relative to `cwd` when inside it,
|
|
81
|
+
* else as the agent wrote it (an absolute path, which TaWorkspaceServer.fileUrl serves alone).
|
|
82
|
+
*/
|
|
83
|
+
function fileRef(cwd: string, path: string): WebFileRef;
|
|
79
84
|
}
|
package/esm/browser/util/link.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TaLocation } from '@celljs/ta-protocol';
|
|
1
2
|
const WEB = /^https?:\/\//i;
|
|
2
3
|
const SCHEME = /^[a-z][a-z\d+.-]*:/i;
|
|
3
4
|
const WINDOWS_PATH = /^[a-z]:[\\/]/i;
|
|
@@ -301,6 +302,16 @@ export var LinkUtil;
|
|
|
301
302
|
...(endLine && endLine >= startLine && endColumn && { endColumn }),
|
|
302
303
|
};
|
|
303
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* A file of a conversation in `cwd` as the menus of files take it (WebFileRef): relative to `cwd` when inside it,
|
|
307
|
+
* else as the agent wrote it (an absolute path, which TaWorkspaceServer.fileUrl serves alone).
|
|
308
|
+
*/
|
|
309
|
+
function fileRef(cwd, path) {
|
|
310
|
+
const base = TaLocation.path(cwd).replace(/\/+$/, '');
|
|
311
|
+
const relative = base && path.startsWith(`${base}/`) ? path.slice(base.length + 1) : path;
|
|
312
|
+
return { cwd, path: relative, name: path.replace(/\/+$/, '').split('/').pop() || path, kind: 'file' };
|
|
313
|
+
}
|
|
314
|
+
LinkUtil.fileRef = fileRef;
|
|
304
315
|
function count(text, char) {
|
|
305
316
|
return text.split(char).length - 1;
|
|
306
317
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SessionState } from '@celljs/ta-client';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { RowWindow } from '../components/earlier-messages';
|
|
4
|
-
import type { WebCodeRendererProps } from '../extension/web-api-
|
|
4
|
+
import type { WebCodeRendererProps } from '../extension/web-api-code';
|
|
5
5
|
import type { WebTaskEntry } from '../extension/web-extension-api';
|
|
6
6
|
import type { Translate } from '../i18n/use-t';
|
|
7
7
|
interface AssistantThreadProps {
|
|
@@ -62,7 +62,8 @@ class ChatTaskSource {
|
|
|
62
62
|
const { t } = this.actions;
|
|
63
63
|
const asked = chat_asks_1.ChatAskUtil.asking(entry, letGo);
|
|
64
64
|
const title = chat_list_util_1.ChatListUtil.title(entry, t);
|
|
65
|
-
const
|
|
65
|
+
const dialog = chat_list_util_1.ChatListUtil.isOpen(entry) && entry.waiting;
|
|
66
|
+
const detail = asked && !dialog ? asked.question : t(chat_asks_1.ChatAskUtil.waitingText(dialog ? entry.waitingFor : undefined));
|
|
66
67
|
const startedAt = (_a = asked === null || asked === void 0 ? void 0 : asked.at) !== null && _a !== void 0 ? _a : entry.updatedAt;
|
|
67
68
|
if (before && before.title === title && before.detail === detail && before.startedAt === startedAt) {
|
|
68
69
|
return before;
|
|
@@ -55,14 +55,15 @@ function AppContexts({ fileUrl, openLink, children, }) {
|
|
|
55
55
|
React.createElement(link_1.OpenLink.Provider, { value: openLink },
|
|
56
56
|
React.createElement(extension_view_1.MessageRenderers.Provider, { value: extensions.renderers },
|
|
57
57
|
React.createElement(code_renderers_1.CodeRenderers.Provider, { value: extensions.codeRenderers },
|
|
58
|
-
React.createElement(code_renderers_1.
|
|
59
|
-
React.createElement(
|
|
60
|
-
React.createElement(extension_view_1.
|
|
61
|
-
React.createElement(
|
|
62
|
-
React.createElement(
|
|
63
|
-
React.createElement(
|
|
64
|
-
React.createElement(extension_view_1.
|
|
65
|
-
React.createElement(extension_view_1.
|
|
66
|
-
React.createElement(
|
|
58
|
+
React.createElement(code_renderers_1.CodePointable.Provider, { value: extensions.codePointable },
|
|
59
|
+
React.createElement(code_renderers_1.CodeMenus.Provider, { value: extensions.codeMenus },
|
|
60
|
+
React.createElement(extension_view_1.ToolRenderers.Provider, { value: extensions.toolRenderers },
|
|
61
|
+
React.createElement(extension_view_1.SessionAvatars.Provider, { value: extensions.avatars },
|
|
62
|
+
React.createElement(chat_icon_1.ChatIconsProvider, { entries: extensions.chatIcons },
|
|
63
|
+
React.createElement(chat_tag_1.ChatTagsProvider, { entries: extensions.chatTags },
|
|
64
|
+
React.createElement(extension_view_1.SessionMenus.Provider, { value: extensions.sessionMenus },
|
|
65
|
+
React.createElement(extension_view_1.LoadedExtensions.Provider, { value: extensions.extensions },
|
|
66
|
+
React.createElement(extension_view_1.CallGroup.Provider, { value: extensions.callGroup },
|
|
67
|
+
React.createElement(secret_text_1.SecretPeeks.Provider, { value: secretPeek }, children)))))))))))))));
|
|
67
68
|
}
|
|
68
69
|
//# sourceMappingURL=app-contexts.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { TaAsking, TaSavedSessionInfo, TaSessionInfo } from '@celljs/ta-protocol';
|
|
1
|
+
import type { TaAsking, TaBlockedKind, TaSavedSessionInfo, TaSessionInfo } from '@celljs/ta-protocol';
|
|
2
2
|
import type { WebAsk } from '../extension/web-api-contributions';
|
|
3
|
+
import type { MessageId } from '../i18n/messages';
|
|
3
4
|
import type { StateSpec } from '../state/state-protocol';
|
|
4
5
|
/**
|
|
5
6
|
* The asks the user let go without answering (`Not now` of a row), by the file of their conversation: when the
|
|
@@ -22,6 +23,8 @@ export interface AskingEntry {
|
|
|
22
23
|
* typed or tapped, or letting it go.
|
|
23
24
|
*/
|
|
24
25
|
export declare namespace ChatAskUtil {
|
|
26
|
+
/** The words of one whose dialog waits: what it waits for (TaSessionInfo.waitingFor), when its Ta says. */
|
|
27
|
+
function waitingText(kind: TaBlockedKind | undefined): MessageId;
|
|
25
28
|
function parse(value: unknown): LetGoAsks | undefined;
|
|
26
29
|
/** Each let go as late as either page let it go; `a` itself when `b` adds nothing. */
|
|
27
30
|
function merge(a: LetGoAsks, b: LetGoAsks): LetGoAsks;
|
|
@@ -18,6 +18,16 @@ exports.LET_GO_ASKS = {
|
|
|
18
18
|
*/
|
|
19
19
|
var ChatAskUtil;
|
|
20
20
|
(function (ChatAskUtil) {
|
|
21
|
+
const WAITING = {
|
|
22
|
+
permission: 'ta.task.waitingPermission',
|
|
23
|
+
question: 'ta.task.waitingQuestion',
|
|
24
|
+
auth: 'ta.task.waitingAuth',
|
|
25
|
+
};
|
|
26
|
+
/** The words of one whose dialog waits: what it waits for (TaSessionInfo.waitingFor), when its Ta says. */
|
|
27
|
+
function waitingText(kind) {
|
|
28
|
+
return (kind && WAITING[kind]) || 'ta.task.waiting';
|
|
29
|
+
}
|
|
30
|
+
ChatAskUtil.waitingText = waitingText;
|
|
21
31
|
function parse(value) {
|
|
22
32
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
23
33
|
return undefined;
|
|
@@ -44,6 +44,7 @@ const use_t_1 = require("../i18n/use-t");
|
|
|
44
44
|
const screen_protocol_1 = require("../screen/screen-protocol");
|
|
45
45
|
const message_1 = require("../util/message");
|
|
46
46
|
const busy_1 = require("./busy");
|
|
47
|
+
const chat_asks_1 = require("./chat-asks");
|
|
47
48
|
const chat_icon_1 = require("./chat-icon");
|
|
48
49
|
const chat_list_util_1 = require("./chat-list-util");
|
|
49
50
|
const chat_tag_1 = require("./chat-tag");
|
|
@@ -80,12 +81,12 @@ function ChatAvatar({ session, source, who, size, mood }) {
|
|
|
80
81
|
React.createElement(Avatar, { session: session, mood: mood, size: size }))));
|
|
81
82
|
}
|
|
82
83
|
/** What goes on in it, on the line of a row of one line: waiting for the user, answering now, or how the double's task ended. */
|
|
83
|
-
function ChatState({ streaming, waiting, task }) {
|
|
84
|
+
function ChatState({ streaming, waiting, waitingFor, task }) {
|
|
84
85
|
const t = (0, use_t_1.useT)();
|
|
85
86
|
if (waiting) {
|
|
86
87
|
return (React.createElement("span", { className: "ta-chat-state ta-waiting" },
|
|
87
88
|
React.createElement("span", { className: "ta-status ta-status-waiting" }),
|
|
88
|
-
t(
|
|
89
|
+
t(chat_asks_1.ChatAskUtil.waitingText(waitingFor))));
|
|
89
90
|
}
|
|
90
91
|
if (streaming) {
|
|
91
92
|
return (React.createElement("span", { className: "ta-chat-state" },
|
|
@@ -199,7 +200,8 @@ exports.ChatItem = React.memo(function ChatItem({ session, source, selected, tim
|
|
|
199
200
|
const streaming = chat_list_util_1.ChatListUtil.isOpen(session) && session.isStreaming && !waiting;
|
|
200
201
|
const asks = waiting || (!!asking && !streaming);
|
|
201
202
|
const mood = asks ? 'attention' : streaming ? 'working' : 'idle';
|
|
202
|
-
const
|
|
203
|
+
const waitingFor = chat_list_util_1.ChatListUtil.isOpen(session) ? session.waitingFor : undefined;
|
|
204
|
+
const state = React.createElement(ChatState, { streaming: streaming, waiting: waiting, waitingFor: waitingFor, task: task });
|
|
203
205
|
// Others in the same Ta: their faces while they look at it, and whose message it answers.
|
|
204
206
|
const people = chat_list_util_1.ChatListUtil.isOpen(session) ? session.people : undefined;
|
|
205
207
|
const viewers = React.createElement(people_1.PeopleFaces, { people: people_1.PresenceUtil.viewing(people), size: 14, max: 3 });
|