@theia/ai-history 1.67.0-next.3 → 1.67.0-next.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,6 +17,7 @@ It also offers a view to inspect the history.
17
17
 
18
18
  ## Additional Information
19
19
 
20
+ - [API documentation for `@theia/ai-history`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_ai-history.html)
20
21
  - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
22
  - [Theia - Website](https://theia-ide.org/)
22
23
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@theia/ai-history",
3
- "version": "1.67.0-next.3+7946ca874",
3
+ "version": "1.67.0-next.56+d8f18cc386c",
4
4
  "description": "Theia - AI communication history",
5
5
  "dependencies": {
6
- "@theia/ai-chat-ui": "1.67.0-next.3+7946ca874",
7
- "@theia/ai-core": "1.67.0-next.3+7946ca874",
8
- "@theia/core": "1.67.0-next.3+7946ca874",
9
- "@theia/filesystem": "1.67.0-next.3+7946ca874",
10
- "@theia/output": "1.67.0-next.3+7946ca874",
11
- "@theia/workspace": "1.67.0-next.3+7946ca874",
6
+ "@theia/ai-chat-ui": "1.67.0-next.56+d8f18cc386c",
7
+ "@theia/ai-core": "1.67.0-next.56+d8f18cc386c",
8
+ "@theia/core": "1.67.0-next.56+d8f18cc386c",
9
+ "@theia/filesystem": "1.67.0-next.56+d8f18cc386c",
10
+ "@theia/output": "1.67.0-next.56+d8f18cc386c",
11
+ "@theia/workspace": "1.67.0-next.56+d8f18cc386c",
12
12
  "tslib": "^2.6.2"
13
13
  },
14
14
  "main": "lib/common",
@@ -50,5 +50,5 @@
50
50
  "nyc": {
51
51
  "extends": "../../configs/nyc.json"
52
52
  },
53
- "gitHead": "7946ca874b04e6249d883e9a586f193194df1365"
53
+ "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
54
54
  }
@@ -1,30 +0,0 @@
1
- import { FrontendApplication } from '@theia/core/lib/browser';
2
- import { AIViewContribution } from '@theia/ai-core/lib/browser';
3
- import { AIHistoryView } from './ai-history-widget';
4
- import { Command, CommandRegistry, Emitter } from '@theia/core';
5
- import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
6
- export declare const AI_HISTORY_TOGGLE_COMMAND_ID = "aiHistory:toggle";
7
- export declare const OPEN_AI_HISTORY_VIEW: Command;
8
- export declare const AI_HISTORY_VIEW_SORT_CHRONOLOGICALLY: Command;
9
- export declare const AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY: Command;
10
- export declare const AI_HISTORY_VIEW_TOGGLE_COMPACT: Command;
11
- export declare const AI_HISTORY_VIEW_TOGGLE_RAW: Command;
12
- export declare const AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES: Command;
13
- export declare const AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES: Command;
14
- export declare const AI_HISTORY_VIEW_CLEAR: Command;
15
- export declare class AIHistoryViewContribution extends AIViewContribution<AIHistoryView> implements TabBarToolbarContribution {
16
- private languageModelService;
17
- protected readonly chronologicalChangedEmitter: Emitter<void>;
18
- protected readonly chronologicalStateChanged: import("@theia/core").Event<void>;
19
- protected readonly compactViewChangedEmitter: Emitter<void>;
20
- protected readonly compactViewStateChanged: import("@theia/core").Event<void>;
21
- protected readonly renderNewlinesChangedEmitter: Emitter<void>;
22
- protected readonly renderNewlinesStateChanged: import("@theia/core").Event<void>;
23
- constructor();
24
- initializeLayout(_app: FrontendApplication): Promise<void>;
25
- registerCommands(registry: CommandRegistry): void;
26
- clearHistory(): void;
27
- protected withHistoryWidget(widget?: unknown, predicate?: (output: AIHistoryView) => boolean): boolean | false;
28
- registerToolbarItems(registry: TabBarToolbarRegistry): void;
29
- }
30
- //# sourceMappingURL=ai-history-contribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-contribution.d.ts","sourceRoot":"","sources":["../../src/browser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;IAI3B,SAAS,CAAC,iBAAiB,CACvB,MAAM,GAAE,OAA6B,EACrC,SAAS,GAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAoB,GAC3D,OAAO,GAAG,KAAK;IAIlB,oBAAoB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;CA2D9D"}
@@ -1,231 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AIHistoryViewContribution = exports.AI_HISTORY_VIEW_CLEAR = exports.AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES = exports.AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES = exports.AI_HISTORY_VIEW_TOGGLE_RAW = exports.AI_HISTORY_VIEW_TOGGLE_COMPACT = exports.AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY = exports.AI_HISTORY_VIEW_SORT_CHRONOLOGICALLY = exports.OPEN_AI_HISTORY_VIEW = exports.AI_HISTORY_TOGGLE_COMMAND_ID = void 0;
4
- const tslib_1 = require("tslib");
5
- // *****************************************************************************
6
- // Copyright (C) 2024 EclipseSource GmbH.
7
- //
8
- // This program and the accompanying materials are made available under the
9
- // terms of the Eclipse Public License v. 2.0 which is available at
10
- // http://www.eclipse.org/legal/epl-2.0.
11
- //
12
- // This Source Code may also be made available under the following Secondary
13
- // Licenses when the conditions for such availability set forth in the Eclipse
14
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
15
- // with the GNU Classpath Exception which is available at
16
- // https://www.gnu.org/software/classpath/license.html.
17
- //
18
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
19
- // *****************************************************************************
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const browser_2 = require("@theia/ai-core/lib/browser");
22
- const inversify_1 = require("@theia/core/shared/inversify");
23
- const ai_history_widget_1 = require("./ai-history-widget");
24
- const core_1 = require("@theia/core");
25
- const ai_core_1 = require("@theia/ai-core");
26
- const chat_view_widget_1 = require("@theia/ai-chat-ui/lib/browser/chat-view-widget");
27
- exports.AI_HISTORY_TOGGLE_COMMAND_ID = 'aiHistory:toggle';
28
- exports.OPEN_AI_HISTORY_VIEW = core_1.Command.toLocalizedCommand({
29
- id: 'aiHistory:open',
30
- label: 'Open AI History view',
31
- });
32
- exports.AI_HISTORY_VIEW_SORT_CHRONOLOGICALLY = core_1.Command.toLocalizedCommand({
33
- id: 'aiHistory:sortChronologically',
34
- label: 'AI History: Sort chronologically',
35
- iconClass: (0, browser_1.codicon)('arrow-down')
36
- });
37
- exports.AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY = core_1.Command.toLocalizedCommand({
38
- id: 'aiHistory:sortReverseChronologically',
39
- label: 'AI History: Sort reverse chronologically',
40
- iconClass: (0, browser_1.codicon)('arrow-up')
41
- });
42
- exports.AI_HISTORY_VIEW_TOGGLE_COMPACT = core_1.Command.toLocalizedCommand({
43
- id: 'aiHistory:toggleCompact',
44
- label: 'AI History: Toggle compact view',
45
- iconClass: (0, browser_1.codicon)('list-flat')
46
- });
47
- exports.AI_HISTORY_VIEW_TOGGLE_RAW = core_1.Command.toLocalizedCommand({
48
- id: 'aiHistory:toggleRaw',
49
- label: 'AI History: Toggle raw view',
50
- iconClass: (0, browser_1.codicon)('list-tree')
51
- });
52
- exports.AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES = core_1.Command.toLocalizedCommand({
53
- id: 'aiHistory:toggleRenderNewlines',
54
- label: 'AI History: Interpret newlines',
55
- iconClass: (0, browser_1.codicon)('newline')
56
- });
57
- exports.AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES = core_1.Command.toLocalizedCommand({
58
- id: 'aiHistory:toggleHideNewlines',
59
- label: 'AI History: Stop interpreting newlines',
60
- iconClass: (0, browser_1.codicon)('no-newline')
61
- });
62
- exports.AI_HISTORY_VIEW_CLEAR = core_1.Command.toLocalizedCommand({
63
- id: 'aiHistory:clear',
64
- label: 'AI History: Clear History',
65
- iconClass: (0, browser_1.codicon)('clear-all')
66
- });
67
- let AIHistoryViewContribution = class AIHistoryViewContribution extends browser_2.AIViewContribution {
68
- constructor() {
69
- super({
70
- widgetId: ai_history_widget_1.AIHistoryView.ID,
71
- widgetName: ai_history_widget_1.AIHistoryView.LABEL,
72
- defaultWidgetOptions: {
73
- area: 'bottom',
74
- rank: 100
75
- },
76
- toggleCommandId: exports.AI_HISTORY_TOGGLE_COMMAND_ID,
77
- });
78
- this.chronologicalChangedEmitter = new core_1.Emitter();
79
- this.chronologicalStateChanged = this.chronologicalChangedEmitter.event;
80
- this.compactViewChangedEmitter = new core_1.Emitter();
81
- this.compactViewStateChanged = this.compactViewChangedEmitter.event;
82
- this.renderNewlinesChangedEmitter = new core_1.Emitter();
83
- this.renderNewlinesStateChanged = this.renderNewlinesChangedEmitter.event;
84
- }
85
- async initializeLayout(_app) {
86
- await this.openView();
87
- }
88
- registerCommands(registry) {
89
- super.registerCommands(registry);
90
- registry.registerCommand(exports.OPEN_AI_HISTORY_VIEW, {
91
- execute: () => this.openView({ activate: true }),
92
- });
93
- registry.registerCommand(exports.AI_HISTORY_VIEW_SORT_CHRONOLOGICALLY, {
94
- isEnabled: widget => this.withHistoryWidget(widget, historyView => !historyView.isChronological),
95
- isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isChronological),
96
- execute: widget => this.withHistoryWidget(widget, historyView => {
97
- historyView.sortHistory(true);
98
- this.chronologicalChangedEmitter.fire();
99
- return true;
100
- })
101
- });
102
- registry.registerCommand(exports.AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY, {
103
- isEnabled: widget => this.withHistoryWidget(widget, historyView => historyView.isChronological),
104
- isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isChronological),
105
- execute: widget => this.withHistoryWidget(widget, historyView => {
106
- historyView.sortHistory(false);
107
- this.chronologicalChangedEmitter.fire();
108
- return true;
109
- })
110
- });
111
- registry.registerCommand(exports.AI_HISTORY_VIEW_TOGGLE_COMPACT, {
112
- isEnabled: widget => this.withHistoryWidget(widget),
113
- isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isCompactView),
114
- execute: widget => this.withHistoryWidget(widget, historyView => {
115
- historyView.toggleCompactView();
116
- this.compactViewChangedEmitter.fire();
117
- return true;
118
- })
119
- });
120
- registry.registerCommand(exports.AI_HISTORY_VIEW_TOGGLE_RAW, {
121
- isEnabled: widget => this.withHistoryWidget(widget),
122
- isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isCompactView),
123
- execute: widget => this.withHistoryWidget(widget, historyView => {
124
- historyView.toggleCompactView();
125
- this.compactViewChangedEmitter.fire();
126
- return true;
127
- })
128
- });
129
- registry.registerCommand(exports.AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES, {
130
- isEnabled: widget => this.withHistoryWidget(widget),
131
- isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isRenderNewlines),
132
- execute: widget => this.withHistoryWidget(widget, historyView => {
133
- historyView.toggleRenderNewlines();
134
- this.renderNewlinesChangedEmitter.fire();
135
- return true;
136
- })
137
- });
138
- registry.registerCommand(exports.AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES, {
139
- isEnabled: widget => this.withHistoryWidget(widget),
140
- isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isRenderNewlines),
141
- execute: widget => this.withHistoryWidget(widget, historyView => {
142
- historyView.toggleRenderNewlines();
143
- this.renderNewlinesChangedEmitter.fire();
144
- return true;
145
- })
146
- });
147
- registry.registerCommand(exports.AI_HISTORY_VIEW_CLEAR, {
148
- isEnabled: widget => this.withHistoryWidget(widget),
149
- isVisible: widget => this.withHistoryWidget(widget),
150
- execute: widget => this.withHistoryWidget(widget, () => {
151
- this.clearHistory();
152
- return true;
153
- })
154
- });
155
- }
156
- clearHistory() {
157
- this.languageModelService.sessions = [];
158
- }
159
- withHistoryWidget(widget = this.tryGetWidget(), predicate = () => true) {
160
- return widget instanceof ai_history_widget_1.AIHistoryView ? predicate(widget) : false;
161
- }
162
- registerToolbarItems(registry) {
163
- registry.registerItem({
164
- id: exports.AI_HISTORY_VIEW_SORT_CHRONOLOGICALLY.id,
165
- command: exports.AI_HISTORY_VIEW_SORT_CHRONOLOGICALLY.id,
166
- tooltip: core_1.nls.localize('theia/ai/history/sortChronologically/tooltip', 'Sort chronologically'),
167
- isVisible: widget => this.withHistoryWidget(widget),
168
- onDidChange: this.chronologicalStateChanged
169
- });
170
- registry.registerItem({
171
- id: exports.AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY.id,
172
- command: exports.AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY.id,
173
- tooltip: core_1.nls.localize('theia/ai/history/sortReverseChronologically/tooltip', 'Sort reverse chronologically'),
174
- isVisible: widget => this.withHistoryWidget(widget),
175
- onDidChange: this.chronologicalStateChanged
176
- });
177
- registry.registerItem({
178
- id: exports.AI_HISTORY_VIEW_TOGGLE_COMPACT.id,
179
- command: exports.AI_HISTORY_VIEW_TOGGLE_COMPACT.id,
180
- tooltip: core_1.nls.localize('theia/ai/history/toggleCompact/tooltip', 'Show compact view'),
181
- isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isCompactView),
182
- onDidChange: this.compactViewStateChanged
183
- });
184
- registry.registerItem({
185
- id: exports.AI_HISTORY_VIEW_TOGGLE_RAW.id,
186
- command: exports.AI_HISTORY_VIEW_TOGGLE_RAW.id,
187
- tooltip: core_1.nls.localize('theia/ai/history/toggleRaw/tooltip', 'Show raw view'),
188
- isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isCompactView),
189
- onDidChange: this.compactViewStateChanged
190
- });
191
- registry.registerItem({
192
- id: exports.AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES.id,
193
- command: exports.AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES.id,
194
- tooltip: core_1.nls.localize('theia/ai/history/toggleRenderNewlines/tooltip', 'Interpret newlines'),
195
- isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isRenderNewlines),
196
- onDidChange: this.renderNewlinesStateChanged
197
- });
198
- registry.registerItem({
199
- id: exports.AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES.id,
200
- command: exports.AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES.id,
201
- tooltip: core_1.nls.localize('theia/ai/history/toggleHideNewlines/tooltip', 'Stop interpreting newlines'),
202
- isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isRenderNewlines),
203
- onDidChange: this.renderNewlinesStateChanged
204
- });
205
- registry.registerItem({
206
- id: exports.AI_HISTORY_VIEW_CLEAR.id,
207
- command: exports.AI_HISTORY_VIEW_CLEAR.id,
208
- tooltip: core_1.nls.localize('theia/ai/history/clear/tooltip', 'Clear History of all agents'),
209
- isVisible: widget => this.withHistoryWidget(widget)
210
- });
211
- // Register the AI History view command for the chat view
212
- registry.registerItem({
213
- id: 'chat-view.' + exports.OPEN_AI_HISTORY_VIEW.id,
214
- command: exports.OPEN_AI_HISTORY_VIEW.id,
215
- tooltip: core_1.nls.localize('theia/ai/history/open-history-tooltip', 'Open AI history...'),
216
- group: 'ai-settings',
217
- priority: 1,
218
- isVisible: widget => this.activationService.isActive && widget instanceof chat_view_widget_1.ChatViewWidget
219
- });
220
- }
221
- };
222
- exports.AIHistoryViewContribution = AIHistoryViewContribution;
223
- tslib_1.__decorate([
224
- (0, inversify_1.inject)(ai_core_1.LanguageModelService),
225
- tslib_1.__metadata("design:type", Object)
226
- ], AIHistoryViewContribution.prototype, "languageModelService", void 0);
227
- exports.AIHistoryViewContribution = AIHistoryViewContribution = tslib_1.__decorate([
228
- (0, inversify_1.injectable)(),
229
- tslib_1.__metadata("design:paramtypes", [])
230
- ], AIHistoryViewContribution);
231
- //# sourceMappingURL=ai-history-contribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-contribution.js","sourceRoot":"","sources":["../../src/browser/ai-history-contribution.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,yCAAyC;AACz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0BAA0B;SAC/C,CAAC,CAAC;QACH,QAAQ,CAAC,YAAY,CAAC;YAClB,EAAE,EAAE,6BAAqB,CAAC,EAAE;YAC5B,OAAO,EAAE,6BAAqB,CAAC,EAAE;YACjC,OAAO,EAAE,UAAG,CAAC,QAAQ,CAAC,gCAAgC,EAAE,6BAA6B,CAAC;YACtF,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;SACtD,CAAC,CAAC;QACH,yDAAyD;QACzD,QAAQ,CAAC,YAAY,CAAC;YAClB,EAAE,EAAE,YAAY,GAAG,4BAAoB,CAAC,EAAE;YAC1C,OAAO,EAAE,4BAAoB,CAAC,EAAE;YAChC,OAAO,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EAAE,oBAAoB,CAAC;YACpF,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,IAAI,MAAM,YAAY,iCAAc;SAC3F,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAtKY,8DAAyB;AACI;IAArC,IAAA,kBAAM,EAAC,8BAAoB,CAAC;;uEAAoD;oCADxE,yBAAyB;IADrC,IAAA,sBAAU,GAAE;;GACA,yBAAyB,CAsKrC"}
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { LanguageModelExchange } from '@theia/ai-core/lib/common/language-model-interaction-model';
3
- import * as React from '@theia/core/shared/react';
4
- export interface ExchangeCardProps {
5
- exchange: LanguageModelExchange;
6
- selectedAgentId?: string;
7
- compactView?: boolean;
8
- renderNewlines?: boolean;
9
- }
10
- export declare const ExchangeCard: React.FC<ExchangeCardProps>;
11
- //# sourceMappingURL=ai-history-exchange-card.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-exchange-card.d.ts","sourceRoot":"","sources":["../../src/browser/ai-history-exchange-card.tsx"],"names":[],"mappings":";AAeA,OAAO,EAEH,qBAAqB,EAGxB,MAAM,4DAA4D,CAAC;AAEpE,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAqDlD,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6CpD,CAAC"}
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExchangeCard = void 0;
4
- const core_1 = require("@theia/core");
5
- const React = require("@theia/core/shared/react");
6
- const getTextFromResponse = (response) => {
7
- // Handle monitored stream response
8
- if ('parts' in response) {
9
- let result = '';
10
- for (const chunk of response.parts) {
11
- if ('content' in chunk && chunk.content) {
12
- result += chunk.content;
13
- }
14
- }
15
- return result;
16
- }
17
- // Handle text response
18
- if ('text' in response) {
19
- return response.text;
20
- }
21
- // Handle parsed response
22
- if ('content' in response) {
23
- return response.content;
24
- }
25
- return JSON.stringify(response);
26
- };
27
- const renderTextWithNewlines = (text) => text.split(/\\n|\n/).map((line, i) => (React.createElement(React.Fragment, { key: i },
28
- i > 0 && React.createElement("br", null),
29
- line)));
30
- const formatJson = (data) => {
31
- try {
32
- return JSON.stringify(data, undefined, 2);
33
- }
34
- catch (error) {
35
- console.error('Error formatting JSON:', error);
36
- return 'Error formatting data';
37
- }
38
- };
39
- const formatTimestamp = (timestamp) => timestamp ? new Date(timestamp).toLocaleString(undefined, {
40
- year: 'numeric',
41
- month: 'short',
42
- day: 'numeric',
43
- hour: '2-digit',
44
- minute: '2-digit',
45
- second: '2-digit'
46
- }) : 'N/A';
47
- const ExchangeCard = ({ exchange, selectedAgentId, compactView = true, renderNewlines = false }) => {
48
- const earliestTimestamp = exchange.requests.reduce((earliest, req) => {
49
- const timestamp = req.metadata.timestamp || 0;
50
- return timestamp && (!earliest || timestamp < earliest) ? timestamp : earliest;
51
- }, 0);
52
- return (React.createElement("div", { className: "theia-card exchange-card", role: "article", "aria-label": `Exchange ${exchange.id}` },
53
- React.createElement("div", { className: 'theia-card-meta' },
54
- React.createElement("span", { className: 'theia-card-request-id' },
55
- core_1.nls.localize('theia/ai/history/exchange-card/exchangeId', 'ID'),
56
- ": ",
57
- exchange.id),
58
- exchange.metadata.agent && (React.createElement("span", { className: 'theia-card-agent-id' },
59
- core_1.nls.localize('theia/ai/history/exchange-card/agentId', 'Agent'),
60
- ": ",
61
- exchange.metadata.agent))),
62
- React.createElement("div", { className: 'theia-card-content' },
63
- React.createElement("div", { className: 'requests-container' }, exchange.requests.map((request, index) => (React.createElement(RequestCard, { key: request.id, request: request, index: index, totalRequests: exchange.requests.length, selectedAgentId: selectedAgentId, compactView: compactView, renderNewlines: renderNewlines }))))),
64
- React.createElement("div", { className: 'theia-card-meta' }, earliestTimestamp > 0 && (React.createElement("span", { className: 'theia-card-timestamp' },
65
- core_1.nls.localize('theia/ai/history/exchange-card/timestamp', 'Started'),
66
- ": ",
67
- formatTimestamp(earliestTimestamp))))));
68
- };
69
- exports.ExchangeCard = ExchangeCard;
70
- const RequestCard = ({ request, index, totalRequests, selectedAgentId, compactView = true, renderNewlines = false }) => {
71
- const isFromDifferentAgent = selectedAgentId &&
72
- request.metadata.agent &&
73
- request.metadata.agent !== selectedAgentId;
74
- const isStreamResponse = 'parts' in request.response;
75
- const getRequestContent = () => {
76
- if (compactView) {
77
- const content = formatJson(request.request.messages);
78
- return (React.createElement("div", { className: "compact-response" },
79
- React.createElement("pre", { className: `formatted-json ${renderNewlines ? 'render-newlines' : ''}` }, renderNewlines ? renderTextWithNewlines(content) : content)));
80
- }
81
- else {
82
- const content = formatJson(request.request);
83
- return (React.createElement("pre", { className: `formatted-json ${renderNewlines ? 'render-newlines' : ''}` }, renderNewlines ? renderTextWithNewlines(content) : content));
84
- }
85
- };
86
- const getResponseContent = () => {
87
- if (compactView) {
88
- const content = getTextFromResponse(request.response);
89
- return (React.createElement("div", { className: "compact-response" },
90
- React.createElement("pre", { className: `formatted-json ${renderNewlines ? 'render-newlines' : ''}` }, renderNewlines ? renderTextWithNewlines(content) : content)));
91
- }
92
- else if (isStreamResponse) {
93
- const streamResponse = request.response;
94
- return streamResponse.parts.map((part, i) => (React.createElement("div", { key: `part-${i}`, className: "stream-part" },
95
- React.createElement("pre", { className: `formatted-json ${renderNewlines ? 'render-newlines' : ''}` }, renderNewlines ? renderTextWithNewlines(JSON.stringify(part, undefined, 2)) : JSON.stringify(part, undefined, 2)))));
96
- }
97
- else {
98
- const content = formatJson(request.response);
99
- return (React.createElement("pre", { className: `formatted-json ${renderNewlines ? 'render-newlines' : ''}` }, renderNewlines ? renderTextWithNewlines(content) : content));
100
- }
101
- };
102
- return (React.createElement("div", { className: `request-card ${isFromDifferentAgent ? 'different-agent-opacity' : ''}` },
103
- React.createElement("div", { className: 'request-header' },
104
- totalRequests > 1 && (React.createElement("h3", null,
105
- core_1.nls.localize('theia/ai/history/request-card/title', 'Request'),
106
- " ",
107
- index + 1)),
108
- React.createElement("div", { className: 'request-info' },
109
- React.createElement("span", { className: 'request-id' },
110
- "ID: ",
111
- request.id),
112
- request.metadata.agent && (React.createElement("span", { className: `request-agent ${isFromDifferentAgent ? 'different-agent-name' : ''}` },
113
- core_1.nls.localize('theia/ai/history/request-card/agent', 'Agent'),
114
- ": ",
115
- request.metadata.agent)),
116
- React.createElement("span", { className: 'request-model' },
117
- core_1.nls.localize('theia/ai/history/request-card/model', 'Model'),
118
- ": ",
119
- request.languageModel))),
120
- React.createElement("div", { className: 'request-content-container' },
121
- React.createElement("details", null,
122
- React.createElement("summary", null, core_1.nls.localize('theia/ai/history/request-card/request', 'Request')),
123
- React.createElement("div", { className: 'request-content' }, getRequestContent())),
124
- React.createElement("details", null,
125
- React.createElement("summary", null, core_1.nls.localize('theia/ai/history/request-card/response', 'Response')),
126
- React.createElement("div", { className: 'response-content' }, getResponseContent()))),
127
- React.createElement("div", { className: 'request-meta' }, request.metadata.timestamp && (React.createElement("span", { className: 'request-timestamp' },
128
- core_1.nls.localize('theia/ai/history/request-card/timestamp', 'Timestamp'),
129
- ": ",
130
- formatTimestamp(request.metadata.timestamp))))));
131
- };
132
- //# sourceMappingURL=ai-history-exchange-card.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-exchange-card.js","sourceRoot":"","sources":["../../src/browser/ai-history-exchange-card.tsx"],"names":[],"mappings":";;;AAqBA,sCAAkC;AAClC,kDAAkD;AAElD,MAAM,mBAAmB,GAAG,CAAC,QAA8C,EAAU,EAAE;IACnF,mCAAmC;IACnC,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;QACtB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjC,IAAI,SAAS,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;YAC5B,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,uBAAuB;IACvB,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,yBAAyB;IACzB,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAmB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACpG,oBAAC,KAAK,CAAC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AAC,CAAM,CACxF;YACD,6BAAK,SAAS,EAAC,cAAc;gBACzB,8BAAM,SAAS,EAAC,YAAY;;oBAAM,OAAO,CAAC,EAAE,CAAQ;gBACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CACvB,8BAAM,SAAS,EAAE,iBAAiB,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,EAAE;oBACjF,UAAG,CAAC,QAAQ,CAAC,qCAAqC,EAAE,OAAO,CAAC;;oBAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CACpF,CACV;gBACD,8BAAM,SAAS,EAAC,eAAe;oBAC1B,UAAG,CAAC,QAAQ,CAAC,qCAAqC,EAAE,OAAO,CAAC;;oBAAI,OAAO,CAAC,aAAa,CACnF,CACL,CACJ;QAEN,6BAAK,SAAS,EAAC,2BAA2B;YACtC;gBACI,qCACK,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EAAE,SAAS,CAAC,CAC3D;gBACV,6BAAK,SAAS,EAAC,iBAAiB,IAC3B,iBAAiB,EAAE,CAClB,CACA;YAEV;gBACI,qCACK,UAAG,CAAC,QAAQ,CAAC,wCAAwC,EAAE,UAAU,CAAC,CAC7D;gBACV,6BAAK,SAAS,EAAC,kBAAkB,IAC5B,kBAAkB,EAAE,CACnB,CACA,CACR;QAEN,6BAAK,SAAS,EAAC,cAAc,IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,IAAI,CAC3B,8BAAM,SAAS,EAAC,mBAAmB;YAC9B,UAAG,CAAC,QAAQ,CAAC,yCAAyC,EAAE,WAAW,CAAC;;YAAI,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAmB,CAAC,CAC3H,CACV,CACC,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- import '../../src/browser/style/ai-history.css';
3
- declare const _default: ContainerModule;
4
- export default _default;
5
- //# sourceMappingURL=ai-history-frontend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/ai-history-frontend-module.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI/D,OAAO,wCAAwC,CAAC;;AAGhD,wBASG"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // *****************************************************************************
4
- // Copyright (C) 2024 EclipseSource GmbH.
5
- //
6
- // This program and the accompanying materials are made available under the
7
- // terms of the Eclipse Public License v. 2.0 which is available at
8
- // http://www.eclipse.org/legal/epl-2.0.
9
- //
10
- // This Source Code may also be made available under the following Secondary
11
- // Licenses when the conditions for such availability set forth in the Eclipse
12
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
- // with the GNU Classpath Exception which is available at
14
- // https://www.gnu.org/software/classpath/license.html.
15
- //
16
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
17
- // *****************************************************************************
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const browser_1 = require("@theia/core/lib/browser");
20
- const ai_history_contribution_1 = require("./ai-history-contribution");
21
- const ai_history_widget_1 = require("./ai-history-widget");
22
- require("../../src/browser/style/ai-history.css");
23
- const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
24
- exports.default = new inversify_1.ContainerModule(bind => {
25
- (0, browser_1.bindViewContribution)(bind, ai_history_contribution_1.AIHistoryViewContribution);
26
- bind(ai_history_widget_1.AIHistoryView).toSelf();
27
- bind(browser_1.WidgetFactory).toDynamicValue(context => ({
28
- id: ai_history_widget_1.AIHistoryView.ID,
29
- createWidget: () => context.container.get(ai_history_widget_1.AIHistoryView)
30
- })).inSingletonScope();
31
- bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(ai_history_contribution_1.AIHistoryViewContribution);
32
- });
33
- //# sourceMappingURL=ai-history-frontend-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-history-frontend-module.ts"],"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;AAChF,4DAA+D;AAC/D,qDAA8E;AAC9E,uEAAsE;AACtE,2DAAoD;AACpD,kDAAgD;AAChD,mFAA0F;AAE1F,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAA,8BAAoB,EAAC,IAAI,EAAE,mDAAyB,CAAC,CAAC;IAEtD,IAAI,CAAC,iCAAa,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,IAAI,CAAC,uBAAa,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC3C,EAAE,EAAE,iCAAa,CAAC,EAAE;QACpB,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAgB,iCAAa,CAAC;KAC1E,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvB,IAAI,CAAC,2CAAyB,CAAC,CAAC,SAAS,CAAC,mDAAyB,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
@@ -1,44 +0,0 @@
1
- /// <reference types="react" />
2
- import { Agent, AgentService, LanguageModelService, SessionEvent } from '@theia/ai-core';
3
- import { LanguageModelExchange } from '@theia/ai-core/lib/common/language-model-interaction-model';
4
- import { ReactWidget, StatefulWidget } from '@theia/core/lib/browser';
5
- import * as React from '@theia/core/shared/react';
6
- declare namespace AIHistoryView {
7
- interface State {
8
- chronological: boolean;
9
- compactView: boolean;
10
- renderNewlines: boolean;
11
- selectedAgentId?: string;
12
- }
13
- }
14
- export declare class AIHistoryView extends ReactWidget implements StatefulWidget {
15
- protected languageModelService: LanguageModelService;
16
- protected readonly agentService: AgentService;
17
- static ID: string;
18
- static LABEL: string;
19
- protected _state: AIHistoryView.State;
20
- constructor();
21
- protected get state(): AIHistoryView.State;
22
- protected set state(state: AIHistoryView.State);
23
- storeState(): object;
24
- restoreState(oldState: object & Partial<AIHistoryView.State>): void;
25
- protected init(): void;
26
- protected selectAgent(agent: Agent | undefined): void;
27
- protected historyContentUpdated(event: SessionEvent): void;
28
- render(): React.ReactNode;
29
- protected renderHistory(): React.ReactNode;
30
- /**
31
- * Get all exchanges for a specific agent.
32
- * Includes all exchanges in which the agent is involved, either as the main exchange or as a sub-request.
33
- * @param agentId The agent ID to filter by
34
- */
35
- protected getExchangesByAgent(agentId: string): LanguageModelExchange[];
36
- sortHistory(chronological: boolean): void;
37
- toggleCompactView(): void;
38
- toggleRenderNewlines(): void;
39
- get isChronological(): boolean;
40
- get isCompactView(): boolean;
41
- get isRenderNewlines(): boolean;
42
- }
43
- export {};
44
- //# sourceMappingURL=ai-history-widget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-widget.d.ts","sourceRoot":"","sources":["../../src/browser/ai-history-widget.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAW,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAKlD,kBAAU,aAAa,CAAC;IACpB,UAAiB,KAAK;QAClB,aAAa,EAAE,OAAO,CAAC;QACvB,WAAW,EAAE,OAAO,CAAC;QACrB,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC5B;CACJ;AAED,qBACa,aAAc,SAAQ,WAAY,YAAW,cAAc;IAEpE,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAErD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAE9C,OAAc,EAAE,SAAuB;IACvC,MAAM,CAAC,KAAK,SAA0E;IAEtF,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAqE;;IAW1G,SAAS,KAAK,KAAK,IAAI,aAAa,CAAC,KAAK,CAEzC;IAED,SAAS,KAAK,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,EAG7C;IAED,UAAU,IAAI,MAAM;IAIpB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;IAenE,SAAS,CAAC,IAAI,IAAI,IAAI;IAMtB,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;IAIrD,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAI1D,MAAM,IAAI,KAAK,CAAC,SAAS;IA4BzB,SAAS,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS;IAgC1C;;;;OAIG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,EAAE;IAShE,WAAW,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI;IAIzC,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,IAAI,IAAI;IAInC,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,IAAI,gBAAgB,IAAI,OAAO,CAE9B;CACJ"}
@@ -1,156 +0,0 @@
1
- "use strict";
2
- var AIHistoryView_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AIHistoryView = void 0;
5
- const tslib_1 = require("tslib");
6
- // *****************************************************************************
7
- // Copyright (C) 2024 EclipseSource GmbH.
8
- //
9
- // This program and the accompanying materials are made available under the
10
- // terms of the Eclipse Public License v. 2.0 which is available at
11
- // http://www.eclipse.org/legal/epl-2.0.
12
- //
13
- // This Source Code may also be made available under the following Secondary
14
- // Licenses when the conditions for such availability set forth in the Eclipse
15
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
16
- // with the GNU Classpath Exception which is available at
17
- // https://www.gnu.org/software/classpath/license.html.
18
- //
19
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
20
- // *****************************************************************************
21
- const ai_core_1 = require("@theia/ai-core");
22
- const browser_1 = require("@theia/core/lib/browser");
23
- const inversify_1 = require("@theia/core/shared/inversify");
24
- const React = require("@theia/core/shared/react");
25
- const ai_history_exchange_card_1 = require("./ai-history-exchange-card");
26
- const select_component_1 = require("@theia/core/lib/browser/widgets/select-component");
27
- const core_1 = require("@theia/core");
28
- let AIHistoryView = AIHistoryView_1 = class AIHistoryView extends browser_1.ReactWidget {
29
- constructor() {
30
- super();
31
- this._state = { chronological: false, compactView: true, renderNewlines: true };
32
- this.id = AIHistoryView_1.ID;
33
- this.title.label = AIHistoryView_1.LABEL;
34
- this.title.caption = AIHistoryView_1.LABEL;
35
- this.title.closable = true;
36
- this.title.iconClass = (0, browser_1.codicon)('history');
37
- }
38
- get state() {
39
- return this._state;
40
- }
41
- set state(state) {
42
- this._state = state;
43
- this.update();
44
- }
45
- storeState() {
46
- return this.state;
47
- }
48
- restoreState(oldState) {
49
- const copy = (0, core_1.deepClone)(this.state);
50
- if (oldState.chronological !== undefined) {
51
- copy.chronological = oldState.chronological;
52
- }
53
- if (oldState.compactView !== undefined) {
54
- copy.compactView = oldState.compactView;
55
- }
56
- if (oldState.renderNewlines !== undefined) {
57
- copy.renderNewlines = oldState.renderNewlines;
58
- }
59
- this.state = copy;
60
- }
61
- init() {
62
- this.update();
63
- this.toDispose.push(this.languageModelService.onSessionChanged((event) => this.historyContentUpdated(event)));
64
- this.selectAgent(this.agentService.getAllAgents()[0]);
65
- }
66
- selectAgent(agent) {
67
- this.state = { ...this.state, selectedAgentId: agent === null || agent === void 0 ? void 0 : agent.id };
68
- }
69
- historyContentUpdated(event) {
70
- this.update();
71
- }
72
- render() {
73
- const selectionChange = (value) => {
74
- this.selectAgent(this.agentService.getAllAgents().find(agent => agent.id === value.value));
75
- };
76
- const agents = this.agentService.getAllAgents();
77
- if (agents.length === 0) {
78
- return (React.createElement("div", { className: 'agent-history-widget' },
79
- React.createElement("div", { className: 'theia-card no-content' }, core_1.nls.localize('theia/ai/history/view/noAgent', 'No agent available.'))));
80
- }
81
- return (React.createElement("div", { className: 'agent-history-widget' },
82
- React.createElement(select_component_1.SelectComponent, { options: agents.map(agent => ({
83
- value: agent.id,
84
- label: agent.name,
85
- description: agent.description || ''
86
- })), onChange: selectionChange, defaultValue: this.state.selectedAgentId }),
87
- React.createElement("div", { className: 'agent-history' }, this.renderHistory())));
88
- }
89
- renderHistory() {
90
- if (!this.state.selectedAgentId) {
91
- return React.createElement("div", { className: 'theia-card no-content' }, core_1.nls.localize('theia/ai/history/view/noAgentSelected', 'No agent selected.'));
92
- }
93
- const exchanges = this.getExchangesByAgent(this.state.selectedAgentId);
94
- if (exchanges.length === 0) {
95
- const selectedAgent = this.agentService.getAllAgents().find(agent => agent.id === this.state.selectedAgentId);
96
- return React.createElement("div", { className: 'theia-card no-content' }, core_1.nls.localize('theia/ai/history/view/noHistoryForAgent', 'No history available for the selected agent \'{0}\'', (selectedAgent === null || selectedAgent === void 0 ? void 0 : selectedAgent.name) || this.state.selectedAgentId));
97
- }
98
- // Sort exchanges by timestamp (using the first sub-request's timestamp)
99
- const sortedExchanges = [...exchanges].sort((a, b) => {
100
- var _a, _b;
101
- const aTimestamp = ((_a = a.requests[0]) === null || _a === void 0 ? void 0 : _a.metadata.timestamp) || 0;
102
- const bTimestamp = ((_b = b.requests[0]) === null || _b === void 0 ? void 0 : _b.metadata.timestamp) || 0;
103
- return this.state.chronological ? aTimestamp - bTimestamp : bTimestamp - aTimestamp;
104
- });
105
- return sortedExchanges.map(exchange => (React.createElement(ai_history_exchange_card_1.ExchangeCard, { key: exchange.id, exchange: exchange, selectedAgentId: this.state.selectedAgentId, compactView: this.state.compactView, renderNewlines: this.state.renderNewlines })));
106
- }
107
- /**
108
- * Get all exchanges for a specific agent.
109
- * Includes all exchanges in which the agent is involved, either as the main exchange or as a sub-request.
110
- * @param agentId The agent ID to filter by
111
- */
112
- getExchangesByAgent(agentId) {
113
- return this.languageModelService.sessions.flatMap(session => session.exchanges.filter(exchange => exchange.metadata.agent === agentId ||
114
- exchange.requests.some(request => request.metadata.agent === agentId)));
115
- }
116
- sortHistory(chronological) {
117
- this.state = { ...(0, core_1.deepClone)(this.state), chronological: chronological };
118
- }
119
- toggleCompactView() {
120
- this.state = { ...(0, core_1.deepClone)(this.state), compactView: !this.state.compactView };
121
- }
122
- toggleRenderNewlines() {
123
- this.state = { ...(0, core_1.deepClone)(this.state), renderNewlines: !this.state.renderNewlines };
124
- }
125
- get isChronological() {
126
- return this.state.chronological === true;
127
- }
128
- get isCompactView() {
129
- return this.state.compactView === true;
130
- }
131
- get isRenderNewlines() {
132
- return this.state.renderNewlines === true;
133
- }
134
- };
135
- exports.AIHistoryView = AIHistoryView;
136
- AIHistoryView.ID = 'ai-history-widget';
137
- AIHistoryView.LABEL = core_1.nls.localize('theia/ai/history/view/label', 'AI Agent History [Beta]');
138
- tslib_1.__decorate([
139
- (0, inversify_1.inject)(ai_core_1.LanguageModelService),
140
- tslib_1.__metadata("design:type", Object)
141
- ], AIHistoryView.prototype, "languageModelService", void 0);
142
- tslib_1.__decorate([
143
- (0, inversify_1.inject)(ai_core_1.AgentService),
144
- tslib_1.__metadata("design:type", Object)
145
- ], AIHistoryView.prototype, "agentService", void 0);
146
- tslib_1.__decorate([
147
- (0, inversify_1.postConstruct)(),
148
- tslib_1.__metadata("design:type", Function),
149
- tslib_1.__metadata("design:paramtypes", []),
150
- tslib_1.__metadata("design:returntype", void 0)
151
- ], AIHistoryView.prototype, "init", null);
152
- exports.AIHistoryView = AIHistoryView = AIHistoryView_1 = tslib_1.__decorate([
153
- (0, inversify_1.injectable)(),
154
- tslib_1.__metadata("design:paramtypes", [])
155
- ], AIHistoryView);
156
- //# sourceMappingURL=ai-history-widget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-history-widget.js","sourceRoot":"","sources":["../../src/browser/ai-history-widget.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;AAChF,4CAAyF;AAEzF,qDAA+E;AAC/E,4DAAiF;AACjF,kDAAkD;AAClD,yEAA0D;AAC1D,uFAAiG;AACjG,sCAA6C;AAYtC,IAAM,aAAa,qBAAnB,MAAM,aAAc,SAAQ,qBAAW;IAW1C;QACI,KAAK,EAAE,CAAC;QAHF,WAAM,GAAwB,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAItG,IAAI,CAAC,EAAE,GAAG,eAAa,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,eAAa,CAAC,KAAK,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,eAAa,CAAC,KAAK,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAA,iBAAO,EAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED,IAAc,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,IAAc,KAAK,CAAC,KAA0B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AK,IAAI,CAAC;IAC9C,CAAC;;AA9JQ,sCAAa;AAMR,gBAAE,GAAG,mBAAmB,AAAtB,CAAuB;AAChC,mBAAK,GAAG,UAAG,CAAC,QAAQ,CAAC,6BAA6B,EAAE,yBAAyB,CAAC,AAAzE,CAA0E;AAL5E;IADT,IAAA,kBAAM,EAAC,8BAAoB,CAAC;;2DACwB;AAElC;IADlB,IAAA,kBAAM,EAAC,sBAAY,CAAC;;mDACyB;AA4CpC;IADT,IAAA,yBAAa,GAAE;;;;yCAKf;wBApDQ,aAAa;IADzB,IAAA,sBAAU,GAAE;;GACA,aAAa,CA+JzB"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2024 EclipseSource GmbH.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"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"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=package.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2025 EclipseSource GmbH and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- /* note: this bogus test file is required so that
17
- we are able to run mocha unit tests on this
18
- package, without having any actual unit tests in it.
19
- This way a coverage report will be generated,
20
- showing 0% coverage, instead of no report.
21
- This file can be removed once we have real unit
22
- tests in place. */
23
- describe('ai-history package', () => {
24
- it('support code coverage statistics', () => true);
25
- });
26
- //# sourceMappingURL=package.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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;;;;;;qBAMqB;AAErB,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAEhC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}