@theia/ai-history 1.61.0 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/ai-history-contribution.d.ts +9 -1
- package/lib/browser/ai-history-contribution.d.ts.map +1 -1
- package/lib/browser/ai-history-contribution.js +102 -4
- package/lib/browser/ai-history-contribution.js.map +1 -1
- package/lib/browser/ai-history-exchange-card.d.ts +11 -0
- package/lib/browser/ai-history-exchange-card.d.ts.map +1 -0
- package/lib/browser/ai-history-exchange-card.js +132 -0
- package/lib/browser/ai-history-exchange-card.js.map +1 -0
- package/lib/browser/ai-history-frontend-module.d.ts.map +1 -1
- package/lib/browser/ai-history-frontend-module.js +0 -4
- package/lib/browser/ai-history-frontend-module.js.map +1 -1
- package/lib/browser/ai-history-widget.d.ts +17 -5
- package/lib/browser/ai-history-widget.d.ts.map +1 -1
- package/lib/browser/ai-history-widget.js +50 -30
- package/lib/browser/ai-history-widget.js.map +1 -1
- package/lib/common/index.d.ts +0 -1
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +0 -4
- package/lib/common/index.js.map +1 -1
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +9 -8
- package/src/browser/ai-history-contribution.ts +107 -3
- package/src/browser/ai-history-exchange-card.tsx +243 -0
- package/src/browser/ai-history-frontend-module.ts +0 -5
- package/src/browser/ai-history-widget.tsx +74 -31
- package/src/browser/style/ai-history.css +145 -60
- package/src/common/index.ts +0 -1
- package/src/package.spec.ts +28 -0
- package/lib/browser/ai-history-communication-card.d.ts +0 -8
- package/lib/browser/ai-history-communication-card.d.ts.map +0 -1
- package/lib/browser/ai-history-communication-card.js +0 -71
- package/lib/browser/ai-history-communication-card.js.map +0 -1
- package/lib/common/communication-recording-service.d.ts +0 -18
- package/lib/common/communication-recording-service.d.ts.map +0 -1
- package/lib/common/communication-recording-service.js +0 -74
- package/lib/common/communication-recording-service.js.map +0 -1
- package/lib/common/communication-recording-service.spec.d.ts +0 -2
- package/lib/common/communication-recording-service.spec.d.ts.map +0 -1
- package/lib/common/communication-recording-service.spec.js +0 -43
- package/lib/common/communication-recording-service.spec.js.map +0 -1
- package/src/browser/ai-history-communication-card.tsx +0 -103
- package/src/common/communication-recording-service.spec.ts +0 -63
- package/src/common/communication-recording-service.ts +0 -97
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,GAA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,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;IAC1F,CAAC;IAED,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC7C,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC;IAC3C,CAAC;IAED,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IAC9C,CAAC;;AA9JQ,sCAAa;AAMR,gBAAE,GAAG,mBAAmB,AAAtB,CAAuB;AAChC,mBAAK,GAAG,UAAG,CAAC,QAAQ,CAAC,6BAA6B,EAAE,0BAA0B,CAAC,AAA1E,CAA2E;AAL7E;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"}
|
package/lib/common/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":""}
|
package/lib/common/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
3
|
//
|
|
@@ -14,7 +13,4 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const tslib_1 = require("tslib");
|
|
19
|
-
tslib_1.__exportStar(require("./communication-recording-service"), exports);
|
|
20
16
|
//# sourceMappingURL=index.js.map
|
package/lib/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=package.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-history",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.62.0",
|
|
4
4
|
"description": "Theia - AI communication history",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/ai-
|
|
7
|
-
"@theia/core": "1.
|
|
8
|
-
"@theia/
|
|
9
|
-
"@theia/
|
|
10
|
-
"@theia/
|
|
6
|
+
"@theia/ai-chat-ui": "1.62.0",
|
|
7
|
+
"@theia/ai-core": "1.62.0",
|
|
8
|
+
"@theia/core": "1.62.0",
|
|
9
|
+
"@theia/filesystem": "1.62.0",
|
|
10
|
+
"@theia/output": "1.62.0",
|
|
11
|
+
"@theia/workspace": "1.62.0",
|
|
11
12
|
"minimatch": "^5.1.0",
|
|
12
13
|
"tslib": "^2.6.2"
|
|
13
14
|
},
|
|
@@ -45,10 +46,10 @@
|
|
|
45
46
|
"watch": "theiaext watch"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@theia/ext-scripts": "1.
|
|
49
|
+
"@theia/ext-scripts": "1.62.0"
|
|
49
50
|
},
|
|
50
51
|
"nyc": {
|
|
51
52
|
"extends": "../../configs/nyc.json"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a4e035ccc26fde24c2769a466cb18e3b54c517c5"
|
|
54
55
|
}
|
|
@@ -19,7 +19,8 @@ import { inject, injectable } from '@theia/core/shared/inversify';
|
|
|
19
19
|
import { AIHistoryView } from './ai-history-widget';
|
|
20
20
|
import { Command, CommandRegistry, Emitter, nls } from '@theia/core';
|
|
21
21
|
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
22
|
-
import {
|
|
22
|
+
import { LanguageModelService } from '@theia/ai-core';
|
|
23
|
+
import { ChatViewWidget } from '@theia/ai-chat-ui/lib/browser/chat-view-widget';
|
|
23
24
|
|
|
24
25
|
export const AI_HISTORY_TOGGLE_COMMAND_ID = 'aiHistory:toggle';
|
|
25
26
|
export const OPEN_AI_HISTORY_VIEW = Command.toLocalizedCommand({
|
|
@@ -39,6 +40,30 @@ export const AI_HISTORY_VIEW_SORT_REVERSE_CHRONOLOGICALLY = Command.toLocalizedC
|
|
|
39
40
|
iconClass: codicon('arrow-up')
|
|
40
41
|
});
|
|
41
42
|
|
|
43
|
+
export const AI_HISTORY_VIEW_TOGGLE_COMPACT = Command.toLocalizedCommand({
|
|
44
|
+
id: 'aiHistory:toggleCompact',
|
|
45
|
+
label: 'AI History: Toggle compact view',
|
|
46
|
+
iconClass: codicon('list-flat')
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const AI_HISTORY_VIEW_TOGGLE_RAW = Command.toLocalizedCommand({
|
|
50
|
+
id: 'aiHistory:toggleRaw',
|
|
51
|
+
label: 'AI History: Toggle raw view',
|
|
52
|
+
iconClass: codicon('list-tree')
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES = Command.toLocalizedCommand({
|
|
56
|
+
id: 'aiHistory:toggleRenderNewlines',
|
|
57
|
+
label: 'AI History: Interpret newlines',
|
|
58
|
+
iconClass: codicon('newline')
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES = Command.toLocalizedCommand({
|
|
62
|
+
id: 'aiHistory:toggleHideNewlines',
|
|
63
|
+
label: 'AI History: Stop interpreting newlines',
|
|
64
|
+
iconClass: codicon('no-newline')
|
|
65
|
+
});
|
|
66
|
+
|
|
42
67
|
export const AI_HISTORY_VIEW_CLEAR = Command.toLocalizedCommand({
|
|
43
68
|
id: 'aiHistory:clear',
|
|
44
69
|
label: 'AI History: Clear History',
|
|
@@ -47,11 +72,17 @@ export const AI_HISTORY_VIEW_CLEAR = Command.toLocalizedCommand({
|
|
|
47
72
|
|
|
48
73
|
@injectable()
|
|
49
74
|
export class AIHistoryViewContribution extends AIViewContribution<AIHistoryView> implements TabBarToolbarContribution {
|
|
50
|
-
@inject(
|
|
75
|
+
@inject(LanguageModelService) private languageModelService: LanguageModelService;
|
|
51
76
|
|
|
52
77
|
protected readonly chronologicalChangedEmitter = new Emitter<void>();
|
|
53
78
|
protected readonly chronologicalStateChanged = this.chronologicalChangedEmitter.event;
|
|
54
79
|
|
|
80
|
+
protected readonly compactViewChangedEmitter = new Emitter<void>();
|
|
81
|
+
protected readonly compactViewStateChanged = this.compactViewChangedEmitter.event;
|
|
82
|
+
|
|
83
|
+
protected readonly renderNewlinesChangedEmitter = new Emitter<void>();
|
|
84
|
+
protected readonly renderNewlinesStateChanged = this.renderNewlinesChangedEmitter.event;
|
|
85
|
+
|
|
55
86
|
constructor() {
|
|
56
87
|
super({
|
|
57
88
|
widgetId: AIHistoryView.ID,
|
|
@@ -91,6 +122,42 @@ export class AIHistoryViewContribution extends AIViewContribution<AIHistoryView>
|
|
|
91
122
|
return true;
|
|
92
123
|
})
|
|
93
124
|
});
|
|
125
|
+
registry.registerCommand(AI_HISTORY_VIEW_TOGGLE_COMPACT, {
|
|
126
|
+
isEnabled: widget => this.withHistoryWidget(widget),
|
|
127
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isCompactView),
|
|
128
|
+
execute: widget => this.withHistoryWidget(widget, historyView => {
|
|
129
|
+
historyView.toggleCompactView();
|
|
130
|
+
this.compactViewChangedEmitter.fire();
|
|
131
|
+
return true;
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
registry.registerCommand(AI_HISTORY_VIEW_TOGGLE_RAW, {
|
|
135
|
+
isEnabled: widget => this.withHistoryWidget(widget),
|
|
136
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isCompactView),
|
|
137
|
+
execute: widget => this.withHistoryWidget(widget, historyView => {
|
|
138
|
+
historyView.toggleCompactView();
|
|
139
|
+
this.compactViewChangedEmitter.fire();
|
|
140
|
+
return true;
|
|
141
|
+
})
|
|
142
|
+
});
|
|
143
|
+
registry.registerCommand(AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES, {
|
|
144
|
+
isEnabled: widget => this.withHistoryWidget(widget),
|
|
145
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isRenderNewlines),
|
|
146
|
+
execute: widget => this.withHistoryWidget(widget, historyView => {
|
|
147
|
+
historyView.toggleRenderNewlines();
|
|
148
|
+
this.renderNewlinesChangedEmitter.fire();
|
|
149
|
+
return true;
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
registry.registerCommand(AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES, {
|
|
153
|
+
isEnabled: widget => this.withHistoryWidget(widget),
|
|
154
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isRenderNewlines),
|
|
155
|
+
execute: widget => this.withHistoryWidget(widget, historyView => {
|
|
156
|
+
historyView.toggleRenderNewlines();
|
|
157
|
+
this.renderNewlinesChangedEmitter.fire();
|
|
158
|
+
return true;
|
|
159
|
+
})
|
|
160
|
+
});
|
|
94
161
|
registry.registerCommand(AI_HISTORY_VIEW_CLEAR, {
|
|
95
162
|
isEnabled: widget => this.withHistoryWidget(widget),
|
|
96
163
|
isVisible: widget => this.withHistoryWidget(widget),
|
|
@@ -101,7 +168,7 @@ export class AIHistoryViewContribution extends AIViewContribution<AIHistoryView>
|
|
|
101
168
|
});
|
|
102
169
|
}
|
|
103
170
|
public clearHistory(): void {
|
|
104
|
-
this.
|
|
171
|
+
this.languageModelService.sessions = [];
|
|
105
172
|
}
|
|
106
173
|
|
|
107
174
|
protected withHistoryWidget(
|
|
@@ -126,11 +193,48 @@ export class AIHistoryViewContribution extends AIViewContribution<AIHistoryView>
|
|
|
126
193
|
isVisible: widget => this.withHistoryWidget(widget),
|
|
127
194
|
onDidChange: this.chronologicalStateChanged
|
|
128
195
|
});
|
|
196
|
+
registry.registerItem({
|
|
197
|
+
id: AI_HISTORY_VIEW_TOGGLE_COMPACT.id,
|
|
198
|
+
command: AI_HISTORY_VIEW_TOGGLE_COMPACT.id,
|
|
199
|
+
tooltip: nls.localize('theia/ai/history/toggleCompact/tooltip', 'Show compact view'),
|
|
200
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isCompactView),
|
|
201
|
+
onDidChange: this.compactViewStateChanged
|
|
202
|
+
});
|
|
203
|
+
registry.registerItem({
|
|
204
|
+
id: AI_HISTORY_VIEW_TOGGLE_RAW.id,
|
|
205
|
+
command: AI_HISTORY_VIEW_TOGGLE_RAW.id,
|
|
206
|
+
tooltip: nls.localize('theia/ai/history/toggleRaw/tooltip', 'Show raw view'),
|
|
207
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isCompactView),
|
|
208
|
+
onDidChange: this.compactViewStateChanged
|
|
209
|
+
});
|
|
210
|
+
registry.registerItem({
|
|
211
|
+
id: AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES.id,
|
|
212
|
+
command: AI_HISTORY_VIEW_TOGGLE_RENDER_NEWLINES.id,
|
|
213
|
+
tooltip: nls.localize('theia/ai/history/toggleRenderNewlines/tooltip', 'Interpret newlines'),
|
|
214
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => !historyView.isRenderNewlines),
|
|
215
|
+
onDidChange: this.renderNewlinesStateChanged
|
|
216
|
+
});
|
|
217
|
+
registry.registerItem({
|
|
218
|
+
id: AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES.id,
|
|
219
|
+
command: AI_HISTORY_VIEW_TOGGLE_HIDE_NEWLINES.id,
|
|
220
|
+
tooltip: nls.localize('theia/ai/history/toggleHideNewlines/tooltip', 'Stop interpreting newlines'),
|
|
221
|
+
isVisible: widget => this.withHistoryWidget(widget, historyView => historyView.isRenderNewlines),
|
|
222
|
+
onDidChange: this.renderNewlinesStateChanged
|
|
223
|
+
});
|
|
129
224
|
registry.registerItem({
|
|
130
225
|
id: AI_HISTORY_VIEW_CLEAR.id,
|
|
131
226
|
command: AI_HISTORY_VIEW_CLEAR.id,
|
|
132
227
|
tooltip: nls.localize('theia/ai/history/clear/tooltip', 'Clear History of all agents'),
|
|
133
228
|
isVisible: widget => this.withHistoryWidget(widget)
|
|
134
229
|
});
|
|
230
|
+
// Register the AI History view command for the chat view
|
|
231
|
+
registry.registerItem({
|
|
232
|
+
id: 'chat-view.' + OPEN_AI_HISTORY_VIEW.id,
|
|
233
|
+
command: OPEN_AI_HISTORY_VIEW.id,
|
|
234
|
+
tooltip: nls.localize('theia/ai/history/open-history-tooltip', 'Open AI history...'),
|
|
235
|
+
group: 'ai-settings',
|
|
236
|
+
priority: 1,
|
|
237
|
+
isVisible: widget => widget instanceof ChatViewWidget
|
|
238
|
+
});
|
|
135
239
|
}
|
|
136
240
|
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2025 STMicroelectronics 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
|
+
import {
|
|
17
|
+
LanguageModelExchangeRequest,
|
|
18
|
+
LanguageModelExchange,
|
|
19
|
+
LanguageModelMonitoredStreamResponse,
|
|
20
|
+
LanguageModelExchangeRequestResponse
|
|
21
|
+
} from '@theia/ai-core/lib/common/language-model-interaction-model';
|
|
22
|
+
import { nls } from '@theia/core';
|
|
23
|
+
import * as React from '@theia/core/shared/react';
|
|
24
|
+
|
|
25
|
+
const getTextFromResponse = (response: LanguageModelExchangeRequestResponse): string => {
|
|
26
|
+
// Handle monitored stream response
|
|
27
|
+
if ('parts' in response) {
|
|
28
|
+
let result = '';
|
|
29
|
+
for (const chunk of response.parts) {
|
|
30
|
+
if ('content' in chunk && chunk.content) {
|
|
31
|
+
result += chunk.content;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Handle text response
|
|
38
|
+
if ('text' in response) {
|
|
39
|
+
return response.text;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Handle parsed response
|
|
43
|
+
if ('content' in response) {
|
|
44
|
+
return response.content;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return JSON.stringify(response);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const renderTextWithNewlines = (text: string): React.ReactNode => text.split(/\\n|\n/).map((line, i) => (
|
|
51
|
+
<React.Fragment key={i}>
|
|
52
|
+
{i > 0 && <br />}
|
|
53
|
+
{line}
|
|
54
|
+
</React.Fragment>
|
|
55
|
+
));
|
|
56
|
+
|
|
57
|
+
const formatJson = (data: unknown): string => {
|
|
58
|
+
try {
|
|
59
|
+
return JSON.stringify(data, undefined, 2);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error('Error formatting JSON:', error);
|
|
62
|
+
return 'Error formatting data';
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const formatTimestamp = (timestamp: number | undefined): string =>
|
|
67
|
+
timestamp ? new Date(timestamp).toLocaleString(undefined, {
|
|
68
|
+
year: 'numeric',
|
|
69
|
+
month: 'short',
|
|
70
|
+
day: 'numeric',
|
|
71
|
+
hour: '2-digit',
|
|
72
|
+
minute: '2-digit',
|
|
73
|
+
second: '2-digit'
|
|
74
|
+
}) : 'N/A';
|
|
75
|
+
|
|
76
|
+
export interface ExchangeCardProps {
|
|
77
|
+
exchange: LanguageModelExchange;
|
|
78
|
+
selectedAgentId?: string;
|
|
79
|
+
compactView?: boolean;
|
|
80
|
+
renderNewlines?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const ExchangeCard: React.FC<ExchangeCardProps> = ({ exchange, selectedAgentId, compactView = true, renderNewlines = false }) => {
|
|
84
|
+
|
|
85
|
+
const earliestTimestamp = exchange.requests.reduce((earliest, req) => {
|
|
86
|
+
const timestamp = req.metadata.timestamp as number || 0;
|
|
87
|
+
return timestamp && (!earliest || timestamp < earliest) ? timestamp : earliest;
|
|
88
|
+
}, 0);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div className="theia-card exchange-card"
|
|
92
|
+
role="article"
|
|
93
|
+
aria-label={`Exchange ${exchange.id}`}>
|
|
94
|
+
<div className='theia-card-meta'>
|
|
95
|
+
<span className='theia-card-request-id'>
|
|
96
|
+
{nls.localize('theia/ai/history/exchange-card/exchangeId', 'ID')}: {exchange.id}
|
|
97
|
+
</span>
|
|
98
|
+
{exchange.metadata.agent && (
|
|
99
|
+
<span className='theia-card-agent-id'>
|
|
100
|
+
{nls.localize('theia/ai/history/exchange-card/agentId', 'Agent')}: {exchange.metadata.agent}
|
|
101
|
+
</span>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
<div className='theia-card-content'>
|
|
105
|
+
<div className='requests-container'>
|
|
106
|
+
{exchange.requests.map((request, index) => (
|
|
107
|
+
<RequestCard
|
|
108
|
+
key={request.id}
|
|
109
|
+
request={request}
|
|
110
|
+
index={index}
|
|
111
|
+
totalRequests={exchange.requests.length}
|
|
112
|
+
selectedAgentId={selectedAgentId}
|
|
113
|
+
compactView={compactView}
|
|
114
|
+
renderNewlines={renderNewlines}
|
|
115
|
+
/>
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
<div className='theia-card-meta'>
|
|
120
|
+
{earliestTimestamp > 0 && (
|
|
121
|
+
<span className='theia-card-timestamp'>
|
|
122
|
+
{nls.localize('theia/ai/history/exchange-card/timestamp', 'Started')}: {formatTimestamp(earliestTimestamp)}
|
|
123
|
+
</span>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
interface RequestCardProps {
|
|
131
|
+
request: LanguageModelExchangeRequest;
|
|
132
|
+
index: number;
|
|
133
|
+
totalRequests: number;
|
|
134
|
+
selectedAgentId?: string;
|
|
135
|
+
compactView?: boolean;
|
|
136
|
+
renderNewlines?: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const RequestCard: React.FC<RequestCardProps> = ({ request, index, totalRequests, selectedAgentId, compactView = true, renderNewlines = false }) => {
|
|
140
|
+
const isFromDifferentAgent = selectedAgentId &&
|
|
141
|
+
request.metadata.agent &&
|
|
142
|
+
request.metadata.agent !== selectedAgentId;
|
|
143
|
+
|
|
144
|
+
const isStreamResponse = 'parts' in request.response;
|
|
145
|
+
|
|
146
|
+
const getRequestContent = () => {
|
|
147
|
+
if (compactView) {
|
|
148
|
+
const content = formatJson(request.request.messages);
|
|
149
|
+
return (
|
|
150
|
+
<div className="compact-response">
|
|
151
|
+
<pre className={`formatted-json ${renderNewlines ? 'render-newlines' : ''}`}>
|
|
152
|
+
{renderNewlines ? renderTextWithNewlines(content) : content}
|
|
153
|
+
</pre>
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
} else {
|
|
157
|
+
const content = formatJson(request.request);
|
|
158
|
+
return (
|
|
159
|
+
<pre className={`formatted-json ${renderNewlines ? 'render-newlines' : ''}`}>
|
|
160
|
+
{renderNewlines ? renderTextWithNewlines(content) : content}
|
|
161
|
+
</pre>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const getResponseContent = () => {
|
|
167
|
+
if (compactView) {
|
|
168
|
+
const content = getTextFromResponse(request.response);
|
|
169
|
+
return (
|
|
170
|
+
<div className="compact-response">
|
|
171
|
+
<pre className={`formatted-json ${renderNewlines ? 'render-newlines' : ''}`}>
|
|
172
|
+
{renderNewlines ? renderTextWithNewlines(content) : content}
|
|
173
|
+
</pre>
|
|
174
|
+
</div>
|
|
175
|
+
);
|
|
176
|
+
} else if (isStreamResponse) {
|
|
177
|
+
const streamResponse = request.response as LanguageModelMonitoredStreamResponse;
|
|
178
|
+
return streamResponse.parts.map((part, i) => (
|
|
179
|
+
<div key={`part-${i}`} className="stream-part">
|
|
180
|
+
<pre className={`formatted-json ${renderNewlines ? 'render-newlines' : ''}`}>
|
|
181
|
+
{renderNewlines ? renderTextWithNewlines(JSON.stringify(part, undefined, 2)) : JSON.stringify(part, undefined, 2)}
|
|
182
|
+
</pre>
|
|
183
|
+
</div>
|
|
184
|
+
));
|
|
185
|
+
} else {
|
|
186
|
+
const content = formatJson(request.response);
|
|
187
|
+
return (
|
|
188
|
+
<pre className={`formatted-json ${renderNewlines ? 'render-newlines' : ''}`}>
|
|
189
|
+
{renderNewlines ? renderTextWithNewlines(content) : content}
|
|
190
|
+
</pre>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<div className={`request-card ${isFromDifferentAgent ? 'different-agent-opacity' : ''}`}>
|
|
197
|
+
<div className='request-header'>
|
|
198
|
+
{totalRequests > 1 && (
|
|
199
|
+
<h3>{nls.localize('theia/ai/history/request-card/title', 'Request')} {index + 1}</h3>
|
|
200
|
+
)}
|
|
201
|
+
<div className='request-info'>
|
|
202
|
+
<span className='request-id'>ID: {request.id}</span>
|
|
203
|
+
{request.metadata.agent && (
|
|
204
|
+
<span className={`request-agent ${isFromDifferentAgent ? 'different-agent-name' : ''}`}>
|
|
205
|
+
{nls.localize('theia/ai/history/request-card/agent', 'Agent')}: {request.metadata.agent}
|
|
206
|
+
</span>
|
|
207
|
+
)}
|
|
208
|
+
<span className='request-model'>
|
|
209
|
+
{nls.localize('theia/ai/history/request-card/model', 'Model')}: {request.languageModel}
|
|
210
|
+
</span>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<div className='request-content-container'>
|
|
215
|
+
<details>
|
|
216
|
+
<summary>
|
|
217
|
+
{nls.localize('theia/ai/history/request-card/request', 'Request')}
|
|
218
|
+
</summary>
|
|
219
|
+
<div className='request-content'>
|
|
220
|
+
{getRequestContent()}
|
|
221
|
+
</div>
|
|
222
|
+
</details>
|
|
223
|
+
|
|
224
|
+
<details>
|
|
225
|
+
<summary>
|
|
226
|
+
{nls.localize('theia/ai/history/request-card/response', 'Response')}
|
|
227
|
+
</summary>
|
|
228
|
+
<div className='response-content'>
|
|
229
|
+
{getResponseContent()}
|
|
230
|
+
</div>
|
|
231
|
+
</details>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div className='request-meta'>
|
|
235
|
+
{request.metadata.timestamp && (
|
|
236
|
+
<span className='request-timestamp'>
|
|
237
|
+
{nls.localize('theia/ai/history/request-card/timestamp', 'Timestamp')}: {formatTimestamp(request.metadata.timestamp as number)}
|
|
238
|
+
</span>
|
|
239
|
+
)}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
};
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
|
-
import { CommunicationRecordingService } from '@theia/ai-core';
|
|
17
16
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
-
import { DefaultCommunicationRecordingService } from '../common/communication-recording-service';
|
|
19
17
|
import { bindViewContribution, WidgetFactory } from '@theia/core/lib/browser';
|
|
20
18
|
import { AIHistoryViewContribution } from './ai-history-contribution';
|
|
21
19
|
import { AIHistoryView } from './ai-history-widget';
|
|
@@ -23,9 +21,6 @@ import '../../src/browser/style/ai-history.css';
|
|
|
23
21
|
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
24
22
|
|
|
25
23
|
export default new ContainerModule(bind => {
|
|
26
|
-
bind(DefaultCommunicationRecordingService).toSelf().inSingletonScope();
|
|
27
|
-
bind(CommunicationRecordingService).toService(DefaultCommunicationRecordingService);
|
|
28
|
-
|
|
29
24
|
bindViewContribution(bind, AIHistoryViewContribution);
|
|
30
25
|
|
|
31
26
|
bind(AIHistoryView).toSelf();
|