@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,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalOsc = void 0;
|
|
4
|
+
const PROGRESS_STATES = { '1': 'normal', '2': 'error', '3': 'busy', '4': 'paused' };
|
|
5
|
+
/** What OSC 7501 says, by its `state`: `none` for idle or cleared. */
|
|
6
|
+
const STATUS_STATES = {
|
|
7
|
+
working: 'working',
|
|
8
|
+
blocked: 'blocked',
|
|
9
|
+
done: 'done',
|
|
10
|
+
error: 'error',
|
|
11
|
+
idle: 'none',
|
|
12
|
+
clear: 'none',
|
|
13
|
+
};
|
|
14
|
+
const BLOCKED_KINDS = new Set(['permission', 'question', 'auth']);
|
|
15
|
+
const APP = /^[A-Za-z0-9_.+-]{1,32}$/;
|
|
16
|
+
/** OSC 9: the progress of ConEmu (`4;state;value`), else a notification of iTerm2 (its text). */
|
|
17
|
+
var TerminalOsc;
|
|
18
|
+
(function (TerminalOsc) {
|
|
19
|
+
function progress(data) {
|
|
20
|
+
var _a;
|
|
21
|
+
const match = /^4(?:;(\d*))?(?:;(\d*))?/.exec(data);
|
|
22
|
+
if (!match) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const state = PROGRESS_STATES[(_a = match[1]) !== null && _a !== void 0 ? _a : '0'];
|
|
26
|
+
if (!state) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const value = match[2] ? Math.min(100, Math.max(0, Number(match[2]))) : undefined;
|
|
30
|
+
// A state without a number keeps no value; busy has none.
|
|
31
|
+
return state === 'busy' || value === undefined ? { state } : { state, value };
|
|
32
|
+
}
|
|
33
|
+
TerminalOsc.progress = progress;
|
|
34
|
+
/** What a terminal that takes OSC 7501 answers its query (`?`) with: the same. */
|
|
35
|
+
TerminalOsc.STATUS_REPLY = '\x1b]7501;?\x1b\\';
|
|
36
|
+
function isStatusQuery(data) {
|
|
37
|
+
return data.startsWith('?');
|
|
38
|
+
}
|
|
39
|
+
TerminalOsc.isStatusQuery = isStatusQuery;
|
|
40
|
+
/**
|
|
41
|
+
* OSC 7501 (superlogical.com/rex/docs/build/program-status): `state=blocked:kind=permission:msg=<base64>`;
|
|
42
|
+
* undefined for idle or cleared, null for what is not a status.
|
|
43
|
+
*/
|
|
44
|
+
function status(data) {
|
|
45
|
+
var _a;
|
|
46
|
+
const pairs = new Map();
|
|
47
|
+
for (const pair of data.split(':')) {
|
|
48
|
+
const at = pair.indexOf('=');
|
|
49
|
+
if (at > 0) {
|
|
50
|
+
pairs.set(pair.slice(0, at), pair.slice(at + 1));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const state = STATUS_STATES[(_a = pairs.get('state')) !== null && _a !== void 0 ? _a : ''];
|
|
54
|
+
if (!state) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (state === 'none') {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const kind = pairs.get('kind');
|
|
61
|
+
const message = text(pairs.get('msg'));
|
|
62
|
+
const app = pairs.get('app');
|
|
63
|
+
return {
|
|
64
|
+
state,
|
|
65
|
+
...(state === 'blocked' && kind && BLOCKED_KINDS.has(kind) ? { kind: kind } : {}),
|
|
66
|
+
...(message ? { message } : {}),
|
|
67
|
+
...(app && APP.test(app) ? { app } : {}),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
TerminalOsc.status = status;
|
|
71
|
+
/** The base64 UTF-8 of `msg`, one line; undefined for none, or what does not decode. */
|
|
72
|
+
function text(base64) {
|
|
73
|
+
if (!base64) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const bytes = Uint8Array.from(atob(base64), char => char.charCodeAt(0));
|
|
78
|
+
return (new TextDecoder('utf-8', { fatal: true })
|
|
79
|
+
.decode(bytes)
|
|
80
|
+
.replace(/\p{Cc}/gu, ' ')
|
|
81
|
+
.trim() || undefined);
|
|
82
|
+
}
|
|
83
|
+
catch (_a) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** OSC 777: `notify;title;body`, as rxvt and Ghostty take it; null for anything else. */
|
|
88
|
+
function notification(data) {
|
|
89
|
+
const [kind, ...rest] = data.split(';');
|
|
90
|
+
return kind === 'notify' ? rest.filter(Boolean).join(': ') : null;
|
|
91
|
+
}
|
|
92
|
+
TerminalOsc.notification = notification;
|
|
93
|
+
})(TerminalOsc || (exports.TerminalOsc = TerminalOsc = {}));
|
|
94
|
+
//# 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';
|
|
3
|
+
import type { WebTerminal, WebTerminalKey, WebTerminalOptions, WebTerminalProgress, WebTerminalStatus } from '../extension/web-extension-api';
|
|
4
4
|
import type { OpenLinkOptions } from '../links/links-protocol';
|
|
5
5
|
import { type TaSettings } from '../settings/settings-protocol';
|
|
6
6
|
import type { LinkTarget } from '../util/link';
|
|
@@ -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;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultWebTerminal = exports.TerminalKeys = exports.
|
|
3
|
+
exports.DefaultWebTerminal = exports.TerminalKeys = exports.XtermLoader = void 0;
|
|
4
4
|
const device_1 = require("../device/device");
|
|
5
5
|
const messages_1 = require("../i18n/messages");
|
|
6
6
|
const agent_settings_1 = require("../settings/agent-settings");
|
|
7
7
|
const settings_protocol_1 = require("../settings/settings-protocol");
|
|
8
8
|
const terminal_links_1 = require("./terminal-links");
|
|
9
|
+
const terminal_osc_1 = require("./terminal-osc");
|
|
9
10
|
const terminal_theme_1 = require("./terminal-theme");
|
|
10
11
|
/** Loads xterm.js the first time a terminal is made, not with the page. */
|
|
11
12
|
var XtermLoader;
|
|
@@ -28,32 +29,6 @@ const MAX_WRAPPED_ROWS = 50;
|
|
|
28
29
|
/** A view being dragged to a new size fits once it stops. */
|
|
29
30
|
const FIT_MS = 50;
|
|
30
31
|
const ARROWS = { ArrowUp: 'A', ArrowDown: 'B', ArrowRight: 'C', ArrowLeft: 'D' };
|
|
31
|
-
const PROGRESS_STATES = { '1': 'normal', '2': 'error', '3': 'busy', '4': 'paused' };
|
|
32
|
-
/** OSC 9: the progress of ConEmu (`4;state;value`), else a notification of iTerm2 (its text). */
|
|
33
|
-
var TerminalOsc;
|
|
34
|
-
(function (TerminalOsc) {
|
|
35
|
-
function progress(data) {
|
|
36
|
-
var _a;
|
|
37
|
-
const match = /^4(?:;(\d*))?(?:;(\d*))?/.exec(data);
|
|
38
|
-
if (!match) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const state = PROGRESS_STATES[(_a = match[1]) !== null && _a !== void 0 ? _a : '0'];
|
|
42
|
-
if (!state) {
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
const value = match[2] ? Math.min(100, Math.max(0, Number(match[2]))) : undefined;
|
|
46
|
-
// A state without a number keeps no value; busy has none.
|
|
47
|
-
return state === 'busy' || value === undefined ? { state } : { state, value };
|
|
48
|
-
}
|
|
49
|
-
TerminalOsc.progress = progress;
|
|
50
|
-
/** OSC 777: `notify;title;body`, as rxvt and Ghostty take it; null for anything else. */
|
|
51
|
-
function notification(data) {
|
|
52
|
-
const [kind, ...rest] = data.split(';');
|
|
53
|
-
return kind === 'notify' ? rest.filter(Boolean).join(': ') : null;
|
|
54
|
-
}
|
|
55
|
-
TerminalOsc.notification = notification;
|
|
56
|
-
})(TerminalOsc || (exports.TerminalOsc = TerminalOsc = {}));
|
|
57
32
|
var TerminalKeys;
|
|
58
33
|
(function (TerminalKeys) {
|
|
59
34
|
/**
|
|
@@ -115,6 +90,7 @@ class DefaultWebTerminal {
|
|
|
115
90
|
this.titleListeners = new Set();
|
|
116
91
|
this.progressListeners = new Set();
|
|
117
92
|
this.attentionListeners = new Set();
|
|
93
|
+
this.statusListeners = new Set();
|
|
118
94
|
this.host = document.createElement('div');
|
|
119
95
|
this.cols = (_a = options.cols) !== null && _a !== void 0 ? _a : DEFAULT_COLS;
|
|
120
96
|
this.rows = (_b = options.rows) !== null && _b !== void 0 ? _b : DEFAULT_ROWS;
|
|
@@ -150,6 +126,10 @@ class DefaultWebTerminal {
|
|
|
150
126
|
this.progressListeners.add(listener);
|
|
151
127
|
return () => this.progressListeners.delete(listener);
|
|
152
128
|
}
|
|
129
|
+
onStatusChange(listener) {
|
|
130
|
+
this.statusListeners.add(listener);
|
|
131
|
+
return () => this.statusListeners.delete(listener);
|
|
132
|
+
}
|
|
153
133
|
onAttention(listener) {
|
|
154
134
|
this.attentionListeners.add(listener);
|
|
155
135
|
return () => this.attentionListeners.delete(listener);
|
|
@@ -225,6 +205,7 @@ class DefaultWebTerminal {
|
|
|
225
205
|
this.titleListeners.clear();
|
|
226
206
|
this.progressListeners.clear();
|
|
227
207
|
this.attentionListeners.clear();
|
|
208
|
+
this.statusListeners.clear();
|
|
228
209
|
}
|
|
229
210
|
start(module) {
|
|
230
211
|
if (this.disposed) {
|
|
@@ -297,7 +278,7 @@ class DefaultWebTerminal {
|
|
|
297
278
|
});
|
|
298
279
|
term.parser.registerOscHandler(9, data => {
|
|
299
280
|
var _a, _b;
|
|
300
|
-
const progress = TerminalOsc.progress(data);
|
|
281
|
+
const progress = terminal_osc_1.TerminalOsc.progress(data);
|
|
301
282
|
if (progress === null) {
|
|
302
283
|
this.emitAttention(data || undefined);
|
|
303
284
|
}
|
|
@@ -310,12 +291,27 @@ class DefaultWebTerminal {
|
|
|
310
291
|
return true;
|
|
311
292
|
});
|
|
312
293
|
term.parser.registerOscHandler(777, data => {
|
|
313
|
-
const message = TerminalOsc.notification(data);
|
|
294
|
+
const message = terminal_osc_1.TerminalOsc.notification(data);
|
|
314
295
|
if (message !== null) {
|
|
315
296
|
this.emitAttention(message || undefined);
|
|
316
297
|
}
|
|
317
298
|
return message !== null;
|
|
318
299
|
});
|
|
300
|
+
// OSC 7501: answered when asked, so that a program (pi) says what it does; the tab shows it.
|
|
301
|
+
term.parser.registerOscHandler(7501, data => {
|
|
302
|
+
if (terminal_osc_1.TerminalOsc.isStatusQuery(data)) {
|
|
303
|
+
this.emitData(terminal_osc_1.TerminalOsc.STATUS_REPLY);
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
const status = terminal_osc_1.TerminalOsc.status(data);
|
|
307
|
+
if (status !== null && JSON.stringify(status) !== JSON.stringify(this.status)) {
|
|
308
|
+
this.status = status;
|
|
309
|
+
for (const listener of this.statusListeners) {
|
|
310
|
+
listener(status);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return status !== null;
|
|
314
|
+
});
|
|
319
315
|
term.onBell(() => this.emitAttention(undefined));
|
|
320
316
|
term.parser.registerOscHandler(7, data => {
|
|
321
317
|
const cwd = terminal_links_1.TerminalLinkUtil.cwdOf(data);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextSelection } from '../extension/web-extension-api';
|
|
1
|
+
import type { TextSelection, WebFileRef } from '../extension/web-extension-api';
|
|
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,5 +76,10 @@ 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
|
}
|
|
80
85
|
//# sourceMappingURL=link.d.ts.map
|
package/lib/browser/util/link.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LinkUtil = void 0;
|
|
4
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
4
5
|
const WEB = /^https?:\/\//i;
|
|
5
6
|
const SCHEME = /^[a-z][a-z\d+.-]*:/i;
|
|
6
7
|
const WINDOWS_PATH = /^[a-z]:[\\/]/i;
|
|
@@ -304,6 +305,16 @@ var LinkUtil;
|
|
|
304
305
|
...(endLine && endLine >= startLine && endColumn && { endColumn }),
|
|
305
306
|
};
|
|
306
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* A file of a conversation in `cwd` as the menus of files take it (WebFileRef): relative to `cwd` when inside it,
|
|
310
|
+
* else as the agent wrote it (an absolute path, which TaWorkspaceServer.fileUrl serves alone).
|
|
311
|
+
*/
|
|
312
|
+
function fileRef(cwd, path) {
|
|
313
|
+
const base = ta_protocol_1.TaLocation.path(cwd).replace(/\/+$/, '');
|
|
314
|
+
const relative = base && path.startsWith(`${base}/`) ? path.slice(base.length + 1) : path;
|
|
315
|
+
return { cwd, path: relative, name: path.replace(/\/+$/, '').split('/').pop() || path, kind: 'file' };
|
|
316
|
+
}
|
|
317
|
+
LinkUtil.fileRef = fileRef;
|
|
307
318
|
function count(text, char) {
|
|
308
319
|
return text.split(char).length - 1;
|
|
309
320
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-web",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.39.0",
|
|
4
4
|
"description": "The web client of ta serve: sessions, streaming messages, tool runs with diffs, and dialogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@celljs/core": "4.
|
|
37
|
-
"@celljs/react": "4.
|
|
38
|
-
"@celljs/ta-client": "4.
|
|
39
|
-
"@celljs/ta-protocol": "4.
|
|
40
|
-
"@celljs/ta-relay": "4.
|
|
41
|
-
"@celljs/widget": "4.
|
|
36
|
+
"@celljs/core": "4.39.0",
|
|
37
|
+
"@celljs/react": "4.39.0",
|
|
38
|
+
"@celljs/ta-client": "4.39.0",
|
|
39
|
+
"@celljs/ta-protocol": "4.39.0",
|
|
40
|
+
"@celljs/ta-relay": "4.39.0",
|
|
41
|
+
"@celljs/widget": "4.39.0",
|
|
42
42
|
"@types/three": "^0.187.0",
|
|
43
43
|
"@xterm/addon-fit": "^0.11.0",
|
|
44
44
|
"@xterm/addon-unicode11": "^0.9.0",
|