@theia/ai-chat-ui 1.75.0-next.42 → 1.75.0-next.43
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/lib/browser/change-set-actions/change-set-accept-action.js +2 -17
- package/lib/browser/change-set-actions/change-set-accept-action.js.map +1 -1
- package/lib/browser/chat-banner-widget.js +7 -6
- package/lib/browser/chat-banner-widget.js.map +1 -1
- package/lib/browser/chat-capabilities-panel.js +8 -11
- package/lib/browser/chat-capabilities-panel.js.map +1 -1
- package/lib/browser/chat-input-agent-suggestions.js +3 -18
- package/lib/browser/chat-input-agent-suggestions.js.map +1 -1
- package/lib/browser/chat-input-widget.js +77 -151
- package/lib/browser/chat-input-widget.js.map +1 -1
- package/lib/browser/chat-progress-message.d.ts +2 -3
- package/lib/browser/chat-progress-message.d.ts.map +1 -1
- package/lib/browser/chat-progress-message.js +6 -27
- package/lib/browser/chat-progress-message.js.map +1 -1
- package/lib/browser/chat-response-renderer/blocked-resource-placeholder.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/blocked-resource-placeholder.js +4 -29
- package/lib/browser/chat-response-renderer/blocked-resource-placeholder.js.map +1 -1
- package/lib/browser/chat-response-renderer/code-part-renderer.js +11 -16
- package/lib/browser/chat-response-renderer/code-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/command-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/command-part-renderer.js +3 -18
- package/lib/browser/chat-response-renderer/command-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/compaction-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/compaction-part-renderer.js +3 -22
- package/lib/browser/chat-response-renderer/compaction-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/delegation-tool-renderer.js +10 -30
- package/lib/browser/chat-response-renderer/delegation-tool-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/error-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/error-part-renderer.js +2 -25
- package/lib/browser/chat-response-renderer/error-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/horizontal-layout-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/horizontal-layout-part-renderer.js +13 -13
- package/lib/browser/chat-response-renderer/horizontal-layout-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/markdown-part-renderer.d.ts +1 -1
- package/lib/browser/chat-response-renderer/markdown-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/markdown-part-renderer.js +3 -18
- package/lib/browser/chat-response-renderer/markdown-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/markdown-part-renderer.spec.js +14 -14
- package/lib/browser/chat-response-renderer/markdown-part-renderer.spec.js.map +1 -1
- package/lib/browser/chat-response-renderer/mermaid-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/mermaid-part-renderer.js +5 -5
- package/lib/browser/chat-response-renderer/mermaid-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/mermaid-rendering.js +14 -44
- package/lib/browser/chat-response-renderer/mermaid-rendering.js.map +1 -1
- package/lib/browser/chat-response-renderer/not-available-toolcall-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/not-available-toolcall-renderer.js +2 -23
- package/lib/browser/chat-response-renderer/not-available-toolcall-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/progress-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/progress-part-renderer.js +2 -17
- package/lib/browser/chat-response-renderer/progress-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/question-part-renderer.js +13 -25
- package/lib/browser/chat-response-renderer/question-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/server-toolcall-part-renderer.js +5 -41
- package/lib/browser/chat-response-renderer/server-toolcall-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/text-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/text-part-renderer.js +3 -21
- package/lib/browser/chat-response-renderer/text-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/thinking-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/thinking-part-renderer.js +2 -20
- package/lib/browser/chat-response-renderer/thinking-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/tool-call-rendering.js +7 -14
- package/lib/browser/chat-response-renderer/tool-call-rendering.js.map +1 -1
- package/lib/browser/chat-response-renderer/tool-confirmation.js +25 -82
- package/lib/browser/chat-response-renderer/tool-confirmation.js.map +1 -1
- package/lib/browser/chat-response-renderer/toolcall-part-renderer.js +5 -65
- package/lib/browser/chat-response-renderer/toolcall-part-renderer.js.map +1 -1
- package/lib/browser/chat-response-renderer/toolcall-result.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/toolcall-result.js +19 -38
- package/lib/browser/chat-response-renderer/toolcall-result.js.map +1 -1
- package/lib/browser/chat-response-renderer/unknown-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/unknown-part-renderer.js +5 -9
- package/lib/browser/chat-response-renderer/unknown-part-renderer.js.map +1 -1
- package/lib/browser/chat-tree-view/chat-view-tree-widget.js +101 -136
- package/lib/browser/chat-tree-view/chat-view-tree-widget.js.map +1 -1
- package/lib/browser/chat-tree-view/chat-view-tree-widget.spec.js +5 -5
- package/lib/browser/chat-tree-view/chat-view-tree-widget.spec.js.map +1 -1
- package/lib/browser/chat-tree-view/model-badge.js +3 -2
- package/lib/browser/chat-tree-view/model-badge.js.map +1 -1
- package/lib/browser/chat-tree-view/prompt-variant-badge.js +3 -2
- package/lib/browser/chat-tree-view/prompt-variant-badge.js.map +1 -1
- package/lib/browser/chat-tree-view/sub-chat-widget.js +16 -19
- package/lib/browser/chat-tree-view/sub-chat-widget.js.map +1 -1
- package/lib/browser/generic-capabilities-section.js +2 -19
- package/lib/browser/generic-capabilities-section.js.map +1 -1
- package/lib/browser/generic-capabilities-tree.js +31 -47
- package/lib/browser/generic-capabilities-tree.js.map +1 -1
- package/lib/browser/session-settings-dialog.js +12 -51
- package/lib/browser/session-settings-dialog.js.map +1 -1
- package/package.json +11 -11
- package/src/browser/chat-progress-message.tsx +0 -1
- package/src/browser/chat-response-renderer/blocked-resource-placeholder.tsx +1 -2
- package/src/browser/chat-response-renderer/command-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/compaction-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/error-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/horizontal-layout-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/markdown-part-renderer.spec.tsx +0 -1
- package/src/browser/chat-response-renderer/mermaid-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/not-available-toolcall-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/progress-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/text-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/thinking-part-renderer.tsx +0 -1
- package/src/browser/chat-response-renderer/toolcall-result.tsx +0 -1
- package/src/browser/chat-response-renderer/unknown-part-renderer.tsx +0 -1
- package/src/browser/chat-tree-view/chat-view-tree-widget.spec.tsx +0 -1
- package/src/browser/session-settings-dialog.tsx +1 -1
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ChangeSetAcceptAction = void 0;
|
|
19
4
|
const tslib_1 = require("tslib");
|
|
20
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("@theia/core/shared/react/jsx-runtime");
|
|
21
6
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
7
|
const core_1 = require("@theia/core");
|
|
23
8
|
let ChangeSetAcceptAction = class ChangeSetAcceptAction {
|
|
@@ -28,7 +13,7 @@ let ChangeSetAcceptAction = class ChangeSetAcceptAction {
|
|
|
28
13
|
return changeSet.getElements().length > 0;
|
|
29
14
|
}
|
|
30
15
|
render(changeSet) {
|
|
31
|
-
return
|
|
16
|
+
return (0, jsx_runtime_1.jsx)("button", { className: 'theia-button', disabled: !hasPendingElementsToAccept(changeSet), title: core_1.nls.localize('theia/ai/chat-ui/applyAllTitle', 'Apply all pending changes'), onClick: () => acceptAllPendingElements(changeSet), children: core_1.nls.localize('theia/ai/chat-ui/applyAll', 'Apply All') });
|
|
32
17
|
}
|
|
33
18
|
};
|
|
34
19
|
exports.ChangeSetAcceptAction = ChangeSetAcceptAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set-accept-action.js","sourceRoot":"","sources":["../../../src/browser/change-set-actions/change-set-accept-action.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"change-set-accept-action.js","sourceRoot":"","sources":["../../../src/browser/change-set-actions/change-set-accept-action.tsx"],"names":[],"mappings":";;;;;AAiBA,4DAA0D;AAG1D,sCAAkC;AAG3B,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAA3B;QACM,OAAE,GAAG,0BAA0B,CAAC;IAe7C,CAAC;IAdG,SAAS,CAAC,SAAoB;QAC1B,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,SAAoB;QACvB,OAAO,mCACH,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAE,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAChD,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,gCAAgC,EAAE,2BAA2B,CAAC,EAClF,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB,CAAC,SAAS,CAAC,YAEjD,UAAG,CAAC,QAAQ,CAAC,2BAA2B,EAAE,WAAW,CAAC,GAClD,CAAC;IACd,CAAC;CACJ,CAAA;AAhBY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAgBjC;AAED,SAAS,wBAAwB,CAAC,SAAoB;IAClD,yBAAyB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAM,EAAE,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,0BAA0B,CAAC,SAAoB;IACpD,OAAO,yBAAyB,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,yBAAyB,CAAC,SAAoB;IACnD,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;AAC5G,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var ChatBannerWidget_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ChatBannerWidget = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const jsx_runtime_1 = require("@theia/core/shared/react/jsx-runtime");
|
|
2
7
|
// *****************************************************************************
|
|
3
8
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
9
|
//
|
|
@@ -14,10 +19,6 @@
|
|
|
14
19
|
//
|
|
15
20
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
21
|
// *****************************************************************************
|
|
17
|
-
var ChatBannerWidget_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ChatBannerWidget = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
22
|
const React = require("@theia/core/shared/react");
|
|
22
23
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
24
|
const core_1 = require("@theia/core");
|
|
@@ -54,13 +55,13 @@ let ChatBannerWidget = class ChatBannerWidget extends browser_1.ReactWidget {
|
|
|
54
55
|
if (banner === undefined) {
|
|
55
56
|
return undefined;
|
|
56
57
|
}
|
|
57
|
-
return
|
|
58
|
+
return (0, jsx_runtime_1.jsx)(React.Fragment, { children: banner }, idx);
|
|
58
59
|
})
|
|
59
60
|
.filter((node) => node !== undefined);
|
|
60
61
|
if (nodes.length === 0) {
|
|
61
62
|
return undefined;
|
|
62
63
|
}
|
|
63
|
-
return
|
|
64
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nodes });
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
exports.ChatBannerWidget = ChatBannerWidget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-banner-widget.js","sourceRoot":"","sources":["../../src/browser/chat-banner-widget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-banner-widget.js","sourceRoot":"","sources":["../../src/browser/chat-banner-widget.tsx"],"names":[],"mappings":";;;;;;AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E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,CAA2B,CAAC;QAC/D,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAI,EAA8B,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACtE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,2DAAG,KAAK,GAAI,CAAC;IACxB,CAAC;;AAnCQ,4CAAgB;AAKN;IADlB,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,yCAAkB,CAAC;;yDACqB;AAGnE;IADT,IAAA,yBAAa,GAAE;;;;4CAUf;2BAjBQ,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAoC5B"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CapabilityChip = exports.CapabilityChipsRow = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@theia/core/shared/react/jsx-runtime");
|
|
2
5
|
// *****************************************************************************
|
|
3
6
|
// Copyright (C) 2026 EclipseSource GmbH.
|
|
4
7
|
//
|
|
@@ -14,8 +17,6 @@
|
|
|
14
17
|
//
|
|
15
18
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
19
|
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.CapabilityChip = exports.CapabilityChipsRow = void 0;
|
|
19
20
|
const React = require("@theia/core/shared/react");
|
|
20
21
|
const core_1 = require("@theia/core");
|
|
21
22
|
/**
|
|
@@ -57,12 +58,10 @@ const CapabilityChipsRow = ({ capabilities, overrides, onCapabilityChange, disab
|
|
|
57
58
|
chips?.[newIndex]?.focus();
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return (React.createElement(exports.CapabilityChip, { key: capability.fragmentId, fragmentId: capability.fragmentId, name: capability.name, description: capability.description, checked: isChecked, disabled: disabled, tabIndex: index === focusIndex ? 0 : -1, onToggle: onCapabilityChange, onFocus: () => setFocusIndex(index), hoverService: hoverService }));
|
|
65
|
-
}))));
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput-CapabilitiesSection", children: [(0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-CapabilitiesSection-heading", children: core_1.nls.localizeByDefault('Capabilities') }), (0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: "theia-ChatInput-CapabilityChips", role: "group", "aria-label": core_1.nls.localizeByDefault('Capabilities'), onKeyDown: handleKeyDown, children: capabilities.map((capability, index) => {
|
|
62
|
+
const isChecked = overrides.get(capability.fragmentId) ?? capability.defaultEnabled;
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(exports.CapabilityChip, { fragmentId: capability.fragmentId, name: capability.name, description: capability.description, checked: isChecked, disabled: disabled, tabIndex: index === focusIndex ? 0 : -1, onToggle: onCapabilityChange, onFocus: () => setFocusIndex(index), hoverService: hoverService }, capability.fragmentId));
|
|
64
|
+
}) })] }));
|
|
66
65
|
};
|
|
67
66
|
exports.CapabilityChipsRow = CapabilityChipsRow;
|
|
68
67
|
/**
|
|
@@ -95,8 +94,6 @@ exports.CapabilityChip = React.memo(function CapabilityChip({ fragmentId, name,
|
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
return (
|
|
99
|
-
checked && React.createElement("span", { className: "codicon codicon-check theia-ChatInput-CapabilityChip-icon" }),
|
|
100
|
-
label));
|
|
97
|
+
return ((0, jsx_runtime_1.jsxs)("span", { ref: chipRef, className: `theia-ChatInput-CapabilityChip${checked ? ' checked' : ''}${disabled ? ' chip-disabled' : ''}`, role: "switch", "aria-checked": checked, "aria-label": label, tabIndex: tabIndex, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: onFocus, onMouseEnter: handleMouseEnter, children: [checked && (0, jsx_runtime_1.jsx)("span", { className: "codicon codicon-check theia-ChatInput-CapabilityChip-icon" }), label] }));
|
|
101
98
|
});
|
|
102
99
|
//# sourceMappingURL=chat-capabilities-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-capabilities-panel.js","sourceRoot":"","sources":["../../src/browser/chat-capabilities-panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-capabilities-panel.js","sourceRoot":"","sources":["../../src/browser/chat-capabilities-panel.tsx"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF,kDAAkD;AAElD,sCAAkC;AAWlC;;;;;;;;;;;GAWG;AACI,MAAM,kBAAkB,GAAqD,CAAC,EACjF,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACf,EAAE,EAAE;IACD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,2CAA2C;IAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAExD,MAAM,aAAa,GAAG,CAAC,CAAsB,EAAQ,EAAE;QACnD,IAAI,QAAQ,EAAE,CAAC;YACX,OAAO;QACX,CAAC;QACD,IAAI,QAAQ,GAAG,UAAU,CAAC;QAC1B,IAAI,CAAC,CAAC,GAAG,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7D,IAAI,UAAU,GAAG,YAA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AChC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;YACjE,YAAY,CAAC,YAAY,CAAC;gBACtB,OAAO;gBACP,MAAM,EAAE,OAAO,CAAC,OAAO;gBACvB,QAAQ,EAAE,KAAK;aAClB,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,kCACI,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,iCAAiC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,EAC1G,IAAI,EAAC,QAAQ,kBACC,OAAO,gBACT,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,gBAAgB,aAE7B,OAAO,IAAI,iCAAM,SAAS,EAAC,2DAA2D,GAAG,EACzF,KAAK,IACH,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ChatInputAgentSuggestions = void 0;
|
|
19
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("@theia/core/shared/react/jsx-runtime");
|
|
20
5
|
const markdown_part_renderer_1 = require("./chat-response-renderer/markdown-part-renderer");
|
|
21
6
|
const ai_chat_1 = require("@theia/ai-chat");
|
|
22
7
|
function getText(suggestion) {
|
|
@@ -40,11 +25,11 @@ function getContent(suggestion) {
|
|
|
40
25
|
}
|
|
41
26
|
return suggestion.content;
|
|
42
27
|
}
|
|
43
|
-
const ChatInputAgentSuggestions = ({ suggestions, opener }) => (!!suggestions?.length &&
|
|
28
|
+
const ChatInputAgentSuggestions = ({ suggestions, opener }) => (!!suggestions?.length && (0, jsx_runtime_1.jsx)("div", { className: "chat-agent-suggestions", children: suggestions.map(suggestion => (0, jsx_runtime_1.jsx)(ChatInputAgentSuggestion, { suggestion: suggestion, opener: opener, handler: ai_chat_1.ChatSuggestionCallback.is(suggestion) ? new ChatSuggestionClickHandler(suggestion) : undefined }, getText(suggestion))) }));
|
|
44
29
|
exports.ChatInputAgentSuggestions = ChatInputAgentSuggestions;
|
|
45
30
|
const ChatInputAgentSuggestion = ({ suggestion, opener, handler }) => {
|
|
46
31
|
const ref = (0, markdown_part_renderer_1.useMarkdownRendering)(getContent(suggestion), opener, true, handler);
|
|
47
|
-
return
|
|
32
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "chat-agent-suggestion", style: (!handler || ai_chat_1.ChatSuggestionCallback.containsCallbackLink(suggestion)) ? undefined : { cursor: 'pointer' }, ref: ref });
|
|
48
33
|
};
|
|
49
34
|
class ChatSuggestionClickHandler {
|
|
50
35
|
constructor(suggestion) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-agent-suggestions.js","sourceRoot":"","sources":["../../src/browser/chat-input-agent-suggestions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-input-agent-suggestions.js","sourceRoot":"","sources":["../../src/browser/chat-input-agent-suggestions.tsx"],"names":[],"mappings":";;;;AAiBA,4FAA0H;AAE1H,4CAAwE;AAQxE,SAAS,OAAO,CAAC,UAA0B;IACvC,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IAC1D,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC,KAAK,CAAC;IAAC,CAAC;IACvD,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC,OAAO,CAAC;IAAC,CAAC;IAC1E,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;AACpC,CAAC;AAED,SAAS,UAAU,CAAC,UAA0B;IAC1C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IAC1D,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IACjD,OAAO,UAAU,CAAC,OAAO,CAAC;AAC9B,CAAC;AAEM,MAAM,yBAAyB,GAA6C,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAC5G,CAAC,CAAC,WAAW,EAAE,MAAM,IAAI,gCAAK,SAAS,EAAC,wBAAwB,YAC3D,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,uBAAC,wBAAwB,IAEpD,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,gCAAsB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SA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sBAAsB,CAAC,CAAC;QAC1E,2BAA2B;QAC3B,IAAI,CAAC,aAAa,EAAE,CAAC;YACjB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -3,6 +3,7 @@ var AIChatInputWidget_1;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.AIChatInputWidget = exports.AIChatInputConfiguration = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const jsx_runtime_1 = require("@theia/core/shared/react/jsx-runtime");
|
|
6
7
|
// *****************************************************************************
|
|
7
8
|
// Copyright (C) 2024 EclipseSource GmbH.
|
|
8
9
|
//
|
|
@@ -1194,7 +1195,7 @@ let AIChatInputWidget = class AIChatInputWidget extends browser_2.ReactWidget {
|
|
|
1194
1195
|
const isEditing = !!(currentRequest && (ai_chat_1.EditableChatRequestModel.isEditing(currentRequest)));
|
|
1195
1196
|
const isPending = () => !!(currentRequest && !isEditing && ai_chat_1.ChatRequestModel.isInProgress(currentRequest));
|
|
1196
1197
|
const pending = isPending();
|
|
1197
|
-
return (
|
|
1198
|
+
return ((0, jsx_runtime_1.jsx)(ChatInput, { branch: this._branch, onQuery: this._onQuery.bind(this), onUnpin: this._onUnpin.bind(this), onCancel: this._onCancel.bind(this), onDragOver: this.onDragOver.bind(this), onDrop: this.onDrop.bind(this), onPaste: this.onPaste.bind(this), onEscape: this.onEscape.bind(this), onDeleteChangeSet: this._onDeleteChangeSet.bind(this), onDeleteChangeSetElement: this._onDeleteChangeSetElement.bind(this), onAddContextElement: this.addContextElement.bind(this), onDeleteContextElement: this.deleteContextElement.bind(this), onOpenContextElement: this.openContextElement.bind(this), context: this.getContext(), fileValidationState: this.fileValidationState, chatModel: this._chatModel, pinnedAgent: this._pinnedAgent, editorProvider: this.editorProvider, uri: this.getResourceUri(), contextMenuCallback: this.handleContextMenu.bind(this), isEnabled: this.isEnabled, setEditorRef: editor => {
|
|
1198
1199
|
this.editorRef = editor;
|
|
1199
1200
|
this.setupEditorEventListeners();
|
|
1200
1201
|
this.editorReady.resolve();
|
|
@@ -1952,41 +1953,33 @@ const ChatInput = (props) => {
|
|
|
1952
1953
|
const tokenTooltip = showTokenUsage
|
|
1953
1954
|
? (0, chat_token_usage_indicator_util_1.buildBarTooltip)((0, chat_token_usage_indicator_util_1.getLatestTokenUsage)(props.chatModel), totalTokens, props.tokenUsageWarningThreshold, props.contextWindowSize, props.chatModel)
|
|
1954
1955
|
: undefined;
|
|
1955
|
-
return (
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
isOpen: props.capabilitiesProps.isOpen,
|
|
1983
|
-
hasActiveSelections: props.capabilitiesProps.overrides.size > 0
|
|
1984
|
-
|| ai_core_1.GenericCapabilitySelections.hasSelections(props.genericCapabilitiesProps.genericCapabilities)
|
|
1985
|
-
|| Object.values(props.genericCapabilitiesProps.serverToolSelections).some(ids => ids.length > 0),
|
|
1986
|
-
hasUnsavedChanges: props.capabilitiesProps.hasUnsavedChanges,
|
|
1987
|
-
onToggle: props.capabilitiesProps.onToggle,
|
|
1988
|
-
keybindingHint: props.capabilitiesProps.keybindingHint,
|
|
1989
|
-
} }))));
|
|
1956
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput", "data-ai-disabled": !props.isEnabled, onDragOver: props.onDragOver, onDrop: props.onDrop, ref: containerRef, children: [props.showSuggestions !== false && (0, jsx_runtime_1.jsx)(chat_input_agent_suggestions_1.ChatInputAgentSuggestions, { suggestions: props.suggestions, opener: props.openerService }), props.showChangeSet && changeSetUI?.elements &&
|
|
1957
|
+
(0, jsx_runtime_1.jsx)(ChangeSetBox, { changeSet: changeSetUI }), (0, jsx_runtime_1.jsxs)("div", { className: `theia-ChatInput-Editor-Box${tokenIsWarningOrError ? ` token-usage-border-${tokenColorClass}` : ''}`, children: [props.showCapabilities !== false && ((0, jsx_runtime_1.jsx)(CapabilitiesBar, { isOpen: props.capabilitiesProps.isOpen, capabilities: props.capabilitiesProps.capabilities, overrides: props.capabilitiesProps.overrides, onCapabilityChange: props.capabilitiesProps.onCapabilityChange, genericCapabilities: props.genericCapabilitiesProps.genericCapabilities, onGenericCapabilityChange: props.genericCapabilitiesProps.onGenericCapabilityChange, onResetGenericCapabilities: props.genericCapabilitiesProps.onResetGenericCapabilities, availableCapabilities: props.genericCapabilitiesProps.availableCapabilities, disabledCapabilities: props.genericCapabilitiesProps.disabledCapabilities, serverTools: props.genericCapabilitiesProps.serverTools, disabled: !props.isEnabled, hoverService: props.hoverService, hasUnsavedChanges: props.capabilitiesProps.hasUnsavedChanges, onSaveToSettings: props.capabilitiesProps.onSaveToSettings })), (0, jsx_runtime_1.jsx)("div", { className: 'theia-ChatInput-Editor', ref: editorContainerRef, onKeyDown: onKeyDown, onFocus: handleInputFocus, onBlur: handleInputBlur, children: (0, jsx_runtime_1.jsx)("div", { ref: placeholderRef, className: 'theia-ChatInput-Editor-Placeholder', children: placeholderText }) }), props.context && props.context.length > 0 &&
|
|
1958
|
+
(0, jsx_runtime_1.jsx)(ChatContext, { context: contextUI.context }), (0, jsx_runtime_1.jsx)(ChatInputOptions, { leftOptions: leftOptions, rightOptions: rightOptions, isEnabled: props.isEnabled, hoverService: props.hoverService, tokenUsage: showTokenUsage ? {
|
|
1959
|
+
percent: Math.min((totalTokens / props.contextWindowSize) * 100, 100),
|
|
1960
|
+
colorClass: tokenColorClass,
|
|
1961
|
+
tooltip: tokenTooltip,
|
|
1962
|
+
} : undefined, modeSelectorProps: {
|
|
1963
|
+
show: showModeSelector,
|
|
1964
|
+
modes: props.modeSelectorProps.receivingAgentModes,
|
|
1965
|
+
currentMode: props.modeSelectorProps.currentMode,
|
|
1966
|
+
onModeChange: props.modeSelectorProps.onModeChange,
|
|
1967
|
+
keybindingHint: props.modeSelectorProps.keybindingHint,
|
|
1968
|
+
}, reasoningSelectorProps: {
|
|
1969
|
+
show: !!props.reasoningSelectorProps.reasoningSupport,
|
|
1970
|
+
reasoningSupport: props.reasoningSelectorProps.reasoningSupport,
|
|
1971
|
+
currentLevel: props.reasoningSelectorProps.currentLevel,
|
|
1972
|
+
onReasoningChange: props.reasoningSelectorProps.onReasoningChange,
|
|
1973
|
+
}, modelSelectorProps: props.modelSelectorProps, capabilitiesToggle: {
|
|
1974
|
+
show: props.showCapabilities !== false,
|
|
1975
|
+
isOpen: props.capabilitiesProps.isOpen,
|
|
1976
|
+
hasActiveSelections: props.capabilitiesProps.overrides.size > 0
|
|
1977
|
+
|| ai_core_1.GenericCapabilitySelections.hasSelections(props.genericCapabilitiesProps.genericCapabilities)
|
|
1978
|
+
|| Object.values(props.genericCapabilitiesProps.serverToolSelections).some(ids => ids.length > 0),
|
|
1979
|
+
hasUnsavedChanges: props.capabilitiesProps.hasUnsavedChanges,
|
|
1980
|
+
onToggle: props.capabilitiesProps.onToggle,
|
|
1981
|
+
keybindingHint: props.capabilitiesProps.keybindingHint,
|
|
1982
|
+
} })] })] }));
|
|
1990
1983
|
};
|
|
1991
1984
|
/**
|
|
1992
1985
|
* Returns an onMouseEnter handler that shows a hover tooltip via HoverService.
|
|
@@ -2008,41 +2001,24 @@ const ChatInputOptions = ({ leftOptions, rightOptions, isEnabled, hoverService,
|
|
|
2008
2001
|
return (
|
|
2009
2002
|
// Right options are rendered first in DOM for tab order (send button first when enabled)
|
|
2010
2003
|
// CSS order property positions them visually (left on left, right on right)
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
e.preventDefault();
|
|
2030
|
-
option.handler();
|
|
2031
|
-
}
|
|
2032
|
-
} },
|
|
2033
|
-
React.createElement("span", null, option.text?.content),
|
|
2034
|
-
React.createElement("span", { className: `codicon ${option.className}` })))),
|
|
2035
|
-
modeSelectorProps.show && modeSelectorProps.modes && (React.createElement(ChatModeSelector, { modes: modeSelectorProps.modes, currentMode: modeSelectorProps.currentMode, onModeChange: modeSelectorProps.onModeChange, disabled: !isEnabled, keybindingHint: modeSelectorProps.keybindingHint, hoverService: hoverService })),
|
|
2036
|
-
capabilitiesToggle.show && (React.createElement("span", { className: `option${capabilitiesToggle.isOpen ? ' toggled' : ''}`, "aria-label": capabilitiesLabel, "aria-expanded": capabilitiesToggle.isOpen, "aria-pressed": capabilitiesToggle.isOpen, role: 'button', tabIndex: 0, onClick: capabilitiesToggle.onToggle, onMouseEnter: hoverHandler(hoverService, capabilitiesTitle), onKeyDown: e => {
|
|
2037
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
2038
|
-
e.preventDefault();
|
|
2039
|
-
capabilitiesToggle.onToggle();
|
|
2040
|
-
}
|
|
2041
|
-
} },
|
|
2042
|
-
React.createElement("span", { className: "codicon codicon-tools" }),
|
|
2043
|
-
capabilitiesToggle.hasUnsavedChanges && (React.createElement("span", { className: "theia-capabilities-unsaved-indicator" })))),
|
|
2044
|
-
reasoningSelectorProps.show && reasoningSelectorProps.reasoningSupport && (React.createElement(ReasoningSelector, { reasoningSupport: reasoningSelectorProps.reasoningSupport, currentLevel: reasoningSelectorProps.currentLevel, onReasoningChange: reasoningSelectorProps.onReasoningChange, disabled: !isEnabled, hoverService: hoverService })),
|
|
2045
|
-
(modelSelectorProps.models.length > 0 || modelSelectorProps.currentModelId) && (React.createElement(ChatModelSelector, { models: modelSelectorProps.models, currentModelId: modelSelectorProps.currentModelId, defaultLabel: modelSelectorProps.defaultLabel, onModelChange: modelSelectorProps.onModelChange, disabled: !isEnabled, hoverService: hoverService })))));
|
|
2004
|
+
(0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInputOptions", children: [(0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInputOptions-right", children: [tokenUsage && ((0, jsx_runtime_1.jsx)("span", { className: `token-usage-badge ${tokenUsage.colorClass}`, ...(tokenUsage.tooltip && { onMouseEnter: hoverHandler(hoverService, tokenUsage.tooltip, 'top') }), children: (0, jsx_runtime_1.jsx)("span", { className: 'token-usage-ring', style: {
|
|
2005
|
+
background: `conic-gradient(var(--token-usage-fill) ${tokenUsage.percent}%, var(--token-usage-track) ${tokenUsage.percent}%)`
|
|
2006
|
+
}, children: (0, jsx_runtime_1.jsx)("span", { className: 'token-usage-ring-inner' }) }) })), rightOptions.map((option, index) => ((0, jsx_runtime_1.jsxs)("span", { className: `option${option.disabled ? ' disabled' : ''}${option.text?.align === 'right' ? ' reverse' : ''}`, "aria-label": option.title, role: 'button', tabIndex: option.disabled ? -1 : 0, onClick: option.handler, onMouseEnter: hoverHandler(hoverService, option.title), onKeyDown: e => {
|
|
2007
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2008
|
+
e.preventDefault();
|
|
2009
|
+
option.handler();
|
|
2010
|
+
}
|
|
2011
|
+
}, children: [(0, jsx_runtime_1.jsx)("span", { children: option.text?.content }), (0, jsx_runtime_1.jsx)("span", { className: `codicon ${option.className}` })] }, index)))] }), (0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInputOptions-left", children: [leftOptions.map((option, index) => ((0, jsx_runtime_1.jsxs)("span", { className: `option${option.disabled ? ' disabled' : ''}${option.text?.align === 'right' ? ' reverse' : ''}`, "aria-label": option.title, role: 'button', tabIndex: option.disabled ? -1 : 0, onClick: option.handler, onMouseEnter: hoverHandler(hoverService, option.title), onKeyDown: e => {
|
|
2012
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2013
|
+
e.preventDefault();
|
|
2014
|
+
option.handler();
|
|
2015
|
+
}
|
|
2016
|
+
}, children: [(0, jsx_runtime_1.jsx)("span", { children: option.text?.content }), (0, jsx_runtime_1.jsx)("span", { className: `codicon ${option.className}` })] }, index))), modeSelectorProps.show && modeSelectorProps.modes && ((0, jsx_runtime_1.jsx)(ChatModeSelector, { modes: modeSelectorProps.modes, currentMode: modeSelectorProps.currentMode, onModeChange: modeSelectorProps.onModeChange, disabled: !isEnabled, keybindingHint: modeSelectorProps.keybindingHint, hoverService: hoverService })), capabilitiesToggle.show && ((0, jsx_runtime_1.jsxs)("span", { className: `option${capabilitiesToggle.isOpen ? ' toggled' : ''}`, "aria-label": capabilitiesLabel, "aria-expanded": capabilitiesToggle.isOpen, "aria-pressed": capabilitiesToggle.isOpen, role: 'button', tabIndex: 0, onClick: capabilitiesToggle.onToggle, onMouseEnter: hoverHandler(hoverService, capabilitiesTitle), onKeyDown: e => {
|
|
2017
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2018
|
+
e.preventDefault();
|
|
2019
|
+
capabilitiesToggle.onToggle();
|
|
2020
|
+
}
|
|
2021
|
+
}, children: [(0, jsx_runtime_1.jsx)("span", { className: "codicon codicon-tools" }), capabilitiesToggle.hasUnsavedChanges && ((0, jsx_runtime_1.jsx)("span", { className: "theia-capabilities-unsaved-indicator" }))] })), reasoningSelectorProps.show && reasoningSelectorProps.reasoningSupport && ((0, jsx_runtime_1.jsx)(ReasoningSelector, { reasoningSupport: reasoningSelectorProps.reasoningSupport, currentLevel: reasoningSelectorProps.currentLevel, onReasoningChange: reasoningSelectorProps.onReasoningChange, disabled: !isEnabled, hoverService: hoverService })), (modelSelectorProps.models.length > 0 || modelSelectorProps.currentModelId) && ((0, jsx_runtime_1.jsx)(ChatModelSelector, { models: modelSelectorProps.models, currentModelId: modelSelectorProps.currentModelId, defaultLabel: modelSelectorProps.defaultLabel, onModelChange: modelSelectorProps.onModelChange, disabled: !isEnabled, hoverService: hoverService }))] })] }));
|
|
2046
2022
|
};
|
|
2047
2023
|
/**
|
|
2048
2024
|
* Combined capabilities bar that shows:
|
|
@@ -2055,25 +2031,16 @@ const CapabilitiesBar = ({ isOpen, capabilities, overrides, onCapabilityChange,
|
|
|
2055
2031
|
const hasCapabilities = capabilities.length > 0;
|
|
2056
2032
|
const saveLabel = core_1.nls.localizeByDefault('Save');
|
|
2057
2033
|
const saveTitle = core_1.nls.localize('theia/ai/chat-ui/saveCurrentSelectionsToSettings', 'Save capability settings');
|
|
2058
|
-
return (
|
|
2059
|
-
hasCapabilities && (React.createElement(React.Fragment, null,
|
|
2060
|
-
React.createElement("div", { className: "theia-ChatInput-CapabilitiesPanel-Left" },
|
|
2061
|
-
React.createElement(chat_capabilities_panel_1.CapabilityChipsRow, { capabilities: capabilities, overrides: overrides, onCapabilityChange: onCapabilityChange, disabled: disabled, hoverService: hoverService })),
|
|
2062
|
-
React.createElement("div", { className: "theia-ChatInput-CapabilitiesPanel-Divider" }))),
|
|
2063
|
-
React.createElement("div", { className: "theia-ChatInput-CapabilitiesPanel-Right" },
|
|
2064
|
-
React.createElement(generic_capabilities_section_1.GenericCapabilitiesSection, { genericCapabilities: genericCapabilities, onGenericCapabilityChange: onGenericCapabilityChange, onResetGenericCapabilities: onResetGenericCapabilities, availableCapabilities: availableCapabilities, disabledCapabilities: disabledCapabilities, serverTools: serverTools, disabled: disabled, hoverService: hoverService })),
|
|
2065
|
-
React.createElement("div", { className: "theia-ChatInput-CapabilitiesPanel-SaveButton" },
|
|
2066
|
-
React.createElement("button", { className: "theia-button", disabled: !hasUnsavedChanges || disabled, title: saveTitle, onClick: onSaveToSettings }, saveLabel))));
|
|
2034
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput-CapabilitiesPanel", children: [hasCapabilities && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-CapabilitiesPanel-Left", children: (0, jsx_runtime_1.jsx)(chat_capabilities_panel_1.CapabilityChipsRow, { capabilities: capabilities, overrides: overrides, onCapabilityChange: onCapabilityChange, disabled: disabled, hoverService: hoverService }) }), (0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-CapabilitiesPanel-Divider" })] })), (0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-CapabilitiesPanel-Right", children: (0, jsx_runtime_1.jsx)(generic_capabilities_section_1.GenericCapabilitiesSection, { genericCapabilities: genericCapabilities, onGenericCapabilityChange: onGenericCapabilityChange, onResetGenericCapabilities: onResetGenericCapabilities, availableCapabilities: availableCapabilities, disabledCapabilities: disabledCapabilities, serverTools: serverTools, disabled: disabled, hoverService: hoverService }) }), (0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-CapabilitiesPanel-SaveButton", children: (0, jsx_runtime_1.jsx)("button", { className: "theia-button", disabled: !hasUnsavedChanges || disabled, title: saveTitle, onClick: onSaveToSettings, children: saveLabel }) })] }));
|
|
2067
2035
|
}
|
|
2068
2036
|
// Collapsed state: horizontal scrollable row of capability chips
|
|
2069
2037
|
if (capabilities.length === 0) {
|
|
2070
2038
|
return undefined;
|
|
2071
2039
|
}
|
|
2072
|
-
return (
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
}))));
|
|
2040
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "theia-capabilities-collapsed-bar", children: (0, jsx_runtime_1.jsx)("div", { className: "theia-capabilities-collapsed-scrollbar", children: capabilities.map((capability, index) => {
|
|
2041
|
+
const isChecked = overrides.get(capability.fragmentId) ?? capability.defaultEnabled;
|
|
2042
|
+
return ((0, jsx_runtime_1.jsx)(chat_capabilities_panel_1.CapabilityChip, { fragmentId: capability.fragmentId, name: capability.name, description: capability.description, checked: isChecked, disabled: disabled, tabIndex: disabled ? -1 : 0, onToggle: onCapabilityChange, onFocus: () => { }, hoverService: hoverService }, capability.fragmentId));
|
|
2043
|
+
}) }) }));
|
|
2077
2044
|
};
|
|
2078
2045
|
const ChatModeSelector = React.memo(({ modes, currentMode, onModeChange, disabled, keybindingHint, hoverService }) => {
|
|
2079
2046
|
const options = React.useMemo(() => modes.map(mode => ({ value: mode.id, label: mode.name })), [modes]);
|
|
@@ -2084,8 +2051,7 @@ const ChatModeSelector = React.memo(({ modes, currentMode, onModeChange, disable
|
|
|
2084
2051
|
}, [onModeChange]);
|
|
2085
2052
|
const label = core_1.nls.localize('theia/ai/chat-ui/switchAgentMode', 'Switch Agent Mode');
|
|
2086
2053
|
const title = keybindingHint ? `${label} (${keybindingHint})` : label;
|
|
2087
|
-
return (
|
|
2088
|
-
React.createElement(select_component_1.SelectComponent, { className: `theia-ChatInput-ModeSelector${disabled ? ' disabled' : ''}`, options: options, defaultValue: currentMode ?? modes[0]?.id ?? '', onChange: handleChange })));
|
|
2054
|
+
return ((0, jsx_runtime_1.jsx)("span", { onMouseEnter: hoverHandler(hoverService, title), children: (0, jsx_runtime_1.jsx)(select_component_1.SelectComponent, { className: `theia-ChatInput-ModeSelector${disabled ? ' disabled' : ''}`, options: options, defaultValue: currentMode ?? modes[0]?.id ?? '', onChange: handleChange }) }));
|
|
2089
2055
|
});
|
|
2090
2056
|
/**
|
|
2091
2057
|
* Per-session model selector. The first option ("Default") reverts to the agent's configured
|
|
@@ -2134,8 +2100,7 @@ const ChatModelSelector = React.memo(({ models, currentModelId, defaultLabel, on
|
|
|
2134
2100
|
: isOverridden
|
|
2135
2101
|
? core_1.nls.localize('theia/ai/chat-ui/sessionModel', 'Model for this chat')
|
|
2136
2102
|
: core_1.nls.localize('theia/ai/chat-ui/sessionModelDefault', 'Model for this chat ({0})', defaultLabel);
|
|
2137
|
-
return (
|
|
2138
|
-
React.createElement(select_component_1.SelectComponent, { className: `theia-ChatInput-ModelSelector${isOverridden ? ' session-override' : ''}${disabled ? ' disabled' : ''}`, options: options, defaultValue: currentModelId ?? defaultValueId, onChange: handleChange })));
|
|
2103
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: 'theia-ChatInput-ModelSelector-container', onMouseEnter: hoverHandler(hoverService, title), children: (0, jsx_runtime_1.jsx)(select_component_1.SelectComponent, { className: `theia-ChatInput-ModelSelector${isOverridden ? ' session-override' : ''}${disabled ? ' disabled' : ''}`, options: options, defaultValue: currentModelId ?? defaultValueId, onChange: handleChange }) }));
|
|
2139
2104
|
});
|
|
2140
2105
|
const reasoningLevelLabel = (level) => {
|
|
2141
2106
|
switch (level) {
|
|
@@ -2156,12 +2121,11 @@ const ReasoningSelector = React.memo(({ reasoningSupport, currentLevel, onReason
|
|
|
2156
2121
|
}, [onReasoningChange]);
|
|
2157
2122
|
const title = core_1.nls.localizeByDefault('Reasoning');
|
|
2158
2123
|
const effectiveLevel = currentLevel ?? reasoningSupport.defaultLevel ?? reasoningSupport.supportedLevels[0] ?? 'off';
|
|
2159
|
-
return (
|
|
2160
|
-
React.createElement(select_component_1.SelectComponent
|
|
2124
|
+
return ((0, jsx_runtime_1.jsx)("span", { onMouseEnter: hoverHandler(hoverService, title), children: (0, jsx_runtime_1.jsx)(select_component_1.SelectComponent
|
|
2161
2125
|
// `theia-ReasoningLevelSelector` carries the shared per-level glyphs; the ChatInput class the toolbar sizing.
|
|
2162
2126
|
, {
|
|
2163
2127
|
// `theia-ReasoningLevelSelector` carries the shared per-level glyphs; the ChatInput class the toolbar sizing.
|
|
2164
|
-
className: `theia-ChatInput-ReasoningSelector theia-ReasoningLevelSelector reasoning-level-${effectiveLevel}${disabled ? ' disabled' : ''}`, options: options, defaultValue: effectiveLevel, onChange: handleChange })));
|
|
2128
|
+
className: `theia-ChatInput-ReasoningSelector theia-ReasoningLevelSelector reasoning-level-${effectiveLevel}${disabled ? ' disabled' : ''}`, options: options, defaultValue: effectiveLevel, onChange: handleChange }) }));
|
|
2165
2129
|
});
|
|
2166
2130
|
const noPropagation = (handler) => (e) => {
|
|
2167
2131
|
handler();
|
|
@@ -2189,20 +2153,11 @@ const ChangeSetBox = React.memo(({ changeSet: { changeSet, title, deleteChangeSe
|
|
|
2189
2153
|
toggleCollapse();
|
|
2190
2154
|
}
|
|
2191
2155
|
}, [toggleCollapse]);
|
|
2192
|
-
return (
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
: core_1.nls.localize('theia/ai/chat-ui/collapseChangeSet', 'Collapse Change Set'), title: isCollapsed
|
|
2198
|
-
? core_1.nls.localize('theia/ai/chat-ui/expandChangeSet', 'Expand Change Set')
|
|
2199
|
-
: core_1.nls.localize('theia/ai/chat-ui/collapseChangeSet', 'Collapse Change Set') }),
|
|
2200
|
-
React.createElement("h3", null, title)),
|
|
2201
|
-
React.createElement("div", { className: 'theia-ChatInput-ChangeSet-Header-Actions' },
|
|
2202
|
-
actions.map(action => (React.createElement("div", { key: action.id, className: 'theia-changeSet-Action' }, action.render(changeSet)))),
|
|
2203
|
-
React.createElement("span", { className: 'codicon codicon-close action', title: core_1.nls.localize('theia/ai/chat-ui/deleteChangeSet', 'Delete Change Set'), onClick: () => deleteChangeSet() }))),
|
|
2204
|
-
React.createElement("div", { className: `theia-ChatInput-ChangeSet-List ${isCollapsed ? 'collapsed' : 'expanded'}` },
|
|
2205
|
-
React.createElement("ul", null, elements.map(element => React.createElement(ChangeSetElement, { key: element.uri, ...element }))))));
|
|
2156
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-Box', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-Header', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-Header-Title', children: [(0, jsx_runtime_1.jsx)("span", { className: `codicon ${isCollapsed ? 'codicon-chevron-right' : 'codicon-chevron-down'} theia-ChatInput-ChangeSet-Toggle`, onClick: toggleCollapse, onKeyDown: handleToggleKeyDown, role: 'button', tabIndex: 0, "aria-expanded": !isCollapsed, "aria-label": isCollapsed
|
|
2157
|
+
? core_1.nls.localize('theia/ai/chat-ui/expandChangeSet', 'Expand Change Set')
|
|
2158
|
+
: core_1.nls.localize('theia/ai/chat-ui/collapseChangeSet', 'Collapse Change Set'), title: isCollapsed
|
|
2159
|
+
? core_1.nls.localize('theia/ai/chat-ui/expandChangeSet', 'Expand Change Set')
|
|
2160
|
+
: core_1.nls.localize('theia/ai/chat-ui/collapseChangeSet', 'Collapse Change Set') }), (0, jsx_runtime_1.jsx)("h3", { children: title })] }), (0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-Header-Actions', children: [actions.map(action => ((0, jsx_runtime_1.jsx)("div", { className: 'theia-changeSet-Action', children: action.render(changeSet) }, action.id))), (0, jsx_runtime_1.jsx)("span", { className: 'codicon codicon-close action', title: core_1.nls.localize('theia/ai/chat-ui/deleteChangeSet', 'Delete Change Set'), onClick: () => deleteChangeSet() })] })] }), (0, jsx_runtime_1.jsx)("div", { className: `theia-ChatInput-ChangeSet-List ${isCollapsed ? 'collapsed' : 'expanded'}`, children: (0, jsx_runtime_1.jsx)("ul", { children: elements.map(element => (0, jsx_runtime_1.jsx)(ChangeSetElement, { ...element }, element.uri)) }) })] }));
|
|
2206
2161
|
});
|
|
2207
2162
|
function toUiElement(element, onDeleteChangeSetElement, labelProvider, decoratorService) {
|
|
2208
2163
|
return {
|
|
@@ -2219,19 +2174,8 @@ function toUiElement(element, onDeleteChangeSetElement, labelProvider, decorator
|
|
|
2219
2174
|
delete: () => onDeleteChangeSetElement(element.uri)
|
|
2220
2175
|
};
|
|
2221
2176
|
}
|
|
2222
|
-
const ChangeSetElement = element => (
|
|
2223
|
-
|
|
2224
|
-
React.createElement("div", { className: 'theia-ChatInput-ChangeSet-labelParts' },
|
|
2225
|
-
React.createElement("span", { className: `theia-ChatInput-ChangeSet-title ${element.nameClass}` }, element.name),
|
|
2226
|
-
React.createElement("div", { className: 'theia-ChatInput-ChangeSet-additionalInfo' },
|
|
2227
|
-
element.additionalInfo && React.createElement("span", null, element.additionalInfo),
|
|
2228
|
-
element.additionalInfoSuffixIcon
|
|
2229
|
-
&& React.createElement("div", { className: `theia-ChatInput-ChangeSet-AdditionalInfo-SuffixIcon ${element.additionalInfoSuffixIcon.join(' ')}` }))),
|
|
2230
|
-
React.createElement("div", { className: 'theia-ChatInput-ChangeSet-Actions' },
|
|
2231
|
-
element.open && (React.createElement("span", { className: 'codicon codicon-file action', title: core_1.nls.localize('theia/ai/chat-ui/openOriginalFile', 'Open Original File'), onClick: noPropagation(() => element.open()) })),
|
|
2232
|
-
element.revert && (React.createElement("span", { className: 'codicon codicon-discard action', title: core_1.nls.localizeByDefault('Revert'), onClick: noPropagation(() => element.revert()) })),
|
|
2233
|
-
element.apply && (React.createElement("span", { className: 'codicon codicon-check action', title: core_1.nls.localizeByDefault('Apply'), onClick: noPropagation(() => element.apply()) })),
|
|
2234
|
-
React.createElement("span", { className: 'codicon codicon-close action', title: core_1.nls.localizeByDefault('Delete'), onClick: noPropagation(() => element.delete()) }))));
|
|
2177
|
+
const ChangeSetElement = element => ((0, jsx_runtime_1.jsxs)("li", { title: core_1.nls.localize('theia/ai/chat-ui/openDiff', 'Open Diff'), onClick: () => element.openChange?.(), children: [(0, jsx_runtime_1.jsx)("div", { className: `theia-ChatInput-ChangeSet-Icon ${element.iconClass}` }), (0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-labelParts', children: [(0, jsx_runtime_1.jsx)("span", { className: `theia-ChatInput-ChangeSet-title ${element.nameClass}`, children: element.name }), (0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-additionalInfo', children: [element.additionalInfo && (0, jsx_runtime_1.jsx)("span", { children: element.additionalInfo }), element.additionalInfoSuffixIcon
|
|
2178
|
+
&& (0, jsx_runtime_1.jsx)("div", { className: `theia-ChatInput-ChangeSet-AdditionalInfo-SuffixIcon ${element.additionalInfoSuffixIcon.join(' ')}` })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: 'theia-ChatInput-ChangeSet-Actions', children: [element.open && ((0, jsx_runtime_1.jsx)("span", { className: 'codicon codicon-file action', title: core_1.nls.localize('theia/ai/chat-ui/openOriginalFile', 'Open Original File'), onClick: noPropagation(() => element.open()) })), element.revert && ((0, jsx_runtime_1.jsx)("span", { className: 'codicon codicon-discard action', title: core_1.nls.localizeByDefault('Revert'), onClick: noPropagation(() => element.revert()) })), element.apply && ((0, jsx_runtime_1.jsx)("span", { className: 'codicon codicon-check action', title: core_1.nls.localizeByDefault('Apply'), onClick: noPropagation(() => element.apply()) })), (0, jsx_runtime_1.jsx)("span", { className: 'codicon codicon-close action', title: core_1.nls.localizeByDefault('Delete'), onClick: noPropagation(() => element.delete()) })] })] }));
|
|
2235
2179
|
function buildContextUI(context, labelProvider, onDeleteContextElement, onOpen, fileValidationState) {
|
|
2236
2180
|
if (!context) {
|
|
2237
2181
|
return { context: [] };
|
|
@@ -2266,36 +2210,18 @@ function buildContextUI(context, labelProvider, onDeleteContextElement, onOpen,
|
|
|
2266
2210
|
})
|
|
2267
2211
|
};
|
|
2268
2212
|
}
|
|
2269
|
-
const ChatContext = ({ context }) => (
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
React.createElement("span", { className: "codicon codicon-close action", title: core_1.nls.localizeByDefault('Delete'), onClick: e => { e.stopPropagation(); element.delete(); } })),
|
|
2284
|
-
hasImageData && React.createElement("div", { className: "theia-ChatInput-ChatContext-ImageRow" },
|
|
2285
|
-
React.createElement("div", { className: 'theia-ChatInput-ImagePreview-Item' },
|
|
2286
|
-
React.createElement("img", { src: `data:${variable.mimeType};base64,${variable.data}`, alt: variable.name ?? displayName }))));
|
|
2287
|
-
}
|
|
2288
|
-
const isWarning = element.className === 'warning-file';
|
|
2289
|
-
const isInvalid = element.className === 'invalid-file';
|
|
2290
|
-
const tooltipTitle = element.validationMessage ?? element.details;
|
|
2291
|
-
return React.createElement("li", { key: index, className: `theia-ChatInput-ChatContext-Element ${element.className || ''}`, title: tooltipTitle, onClick: () => element.open?.() },
|
|
2292
|
-
React.createElement("div", { className: "theia-ChatInput-ChatContext-Row" },
|
|
2293
|
-
isWarning && React.createElement("span", { className: "codicon codicon-warning warning-file-icon" }),
|
|
2294
|
-
isInvalid && React.createElement("span", { className: "codicon codicon-error invalid-file-icon" }),
|
|
2295
|
-
React.createElement("div", { className: `theia-ChatInput-ChatContext-Icon ${element.iconClass}` }),
|
|
2296
|
-
React.createElement("div", { className: "theia-ChatInput-ChatContext-labelParts" },
|
|
2297
|
-
React.createElement("span", { className: `theia-ChatInput-ChatContext-title ${element.nameClass}` }, element.name),
|
|
2298
|
-
React.createElement("span", { className: 'theia-ChatInput-ChatContext-additionalInfo' }, element.additionalInfo)),
|
|
2299
|
-
React.createElement("span", { className: "codicon codicon-close action", title: core_1.nls.localizeByDefault('Delete'), onClick: e => { e.stopPropagation(); element.delete(); } })));
|
|
2300
|
-
}))));
|
|
2213
|
+
const ChatContext = ({ context }) => ((0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-ChatContext", children: (0, jsx_runtime_1.jsx)("ul", { children: context.map((element, index) => {
|
|
2214
|
+
if (image_context_variable_1.ImageContextVariable.isImageContextRequest(element.variable)) {
|
|
2215
|
+
const variable = image_context_variable_1.ImageContextVariable.parseRequest(element.variable);
|
|
2216
|
+
const displayName = variable?.name ?? variable?.wsRelativePath?.split('/').pop() ?? element.name;
|
|
2217
|
+
const title = variable?.name ?? variable?.wsRelativePath ?? element.details ?? element.name;
|
|
2218
|
+
// Check if we have the actual image data (pre-processed) or just a path reference
|
|
2219
|
+
const hasImageData = variable && image_context_variable_1.ImageContextVariable.isResolved(variable);
|
|
2220
|
+
return (0, jsx_runtime_1.jsxs)("li", { className: "theia-ChatInput-ChatContext-Element theia-ChatInput-ImageContext-Element", title: title, onClick: () => element.open?.(), children: [(0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput-ChatContext-Row", children: [(0, jsx_runtime_1.jsx)("div", { className: `theia-ChatInput-ChatContext-Icon ${element.iconClass}` }), (0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput-ChatContext-labelParts", children: [(0, jsx_runtime_1.jsx)("span", { className: `theia-ChatInput-ChatContext-title ${element.nameClass}`, children: displayName }), (0, jsx_runtime_1.jsx)("span", { className: 'theia-ChatInput-ChatContext-additionalInfo', children: element.additionalInfo })] }), (0, jsx_runtime_1.jsx)("span", { className: "codicon codicon-close action", title: core_1.nls.localizeByDefault('Delete'), onClick: e => { e.stopPropagation(); element.delete(); } })] }), hasImageData && (0, jsx_runtime_1.jsx)("div", { className: "theia-ChatInput-ChatContext-ImageRow", children: (0, jsx_runtime_1.jsx)("div", { className: 'theia-ChatInput-ImagePreview-Item', children: (0, jsx_runtime_1.jsx)("img", { src: `data:${variable.mimeType};base64,${variable.data}`, alt: variable.name ?? displayName }) }) })] }, index);
|
|
2221
|
+
}
|
|
2222
|
+
const isWarning = element.className === 'warning-file';
|
|
2223
|
+
const isInvalid = element.className === 'invalid-file';
|
|
2224
|
+
const tooltipTitle = element.validationMessage ?? element.details;
|
|
2225
|
+
return (0, jsx_runtime_1.jsx)("li", { className: `theia-ChatInput-ChatContext-Element ${element.className || ''}`, title: tooltipTitle, onClick: () => element.open?.(), children: (0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput-ChatContext-Row", children: [isWarning && (0, jsx_runtime_1.jsx)("span", { className: "codicon codicon-warning warning-file-icon" }), isInvalid && (0, jsx_runtime_1.jsx)("span", { className: "codicon codicon-error invalid-file-icon" }), (0, jsx_runtime_1.jsx)("div", { className: `theia-ChatInput-ChatContext-Icon ${element.iconClass}` }), (0, jsx_runtime_1.jsxs)("div", { className: "theia-ChatInput-ChatContext-labelParts", children: [(0, jsx_runtime_1.jsx)("span", { className: `theia-ChatInput-ChatContext-title ${element.nameClass}`, children: element.name }), (0, jsx_runtime_1.jsx)("span", { className: 'theia-ChatInput-ChatContext-additionalInfo', children: element.additionalInfo })] }), (0, jsx_runtime_1.jsx)("span", { className: "codicon codicon-close action", title: core_1.nls.localizeByDefault('Delete'), onClick: e => { e.stopPropagation(); element.delete(); } })] }) }, index);
|
|
2226
|
+
}) }) }));
|
|
2301
2227
|
//# sourceMappingURL=chat-input-widget.js.map
|