@theia/ai-history 1.61.0-next.8 → 1.61.1
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-communication-card.d.ts.map +1 -1
- package/lib/browser/ai-history-communication-card.js +63 -66
- package/lib/browser/ai-history-communication-card.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/ai-history-communication-card.tsx +20 -24
- package/src/browser/style/ai-history.css +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-history-communication-card.d.ts","sourceRoot":"","sources":["../../src/browser/ai-history-communication-card.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,yBAAyB,CAAC;CACpC;
|
|
1
|
+
{"version":3,"file":"ai-history-communication-card.d.ts","sourceRoot":"","sources":["../../src/browser/ai-history-communication-card.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,yBAAyB,CAAC;CACpC;AAsBD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA2D1D,CAAC"}
|
|
@@ -3,72 +3,69 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CommunicationCard = void 0;
|
|
4
4
|
const core_1 = require("@theia/core");
|
|
5
5
|
const React = require("@theia/core/shared/react");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
// Format the timestamp for better readability
|
|
18
|
-
const formatTimestamp = (timestamp) => new Date(timestamp).toLocaleString(undefined, {
|
|
19
|
-
year: 'numeric',
|
|
20
|
-
month: 'short',
|
|
21
|
-
day: 'numeric',
|
|
22
|
-
hour: '2-digit',
|
|
23
|
-
minute: '2-digit',
|
|
24
|
-
second: '2-digit'
|
|
25
|
-
});
|
|
26
|
-
;
|
|
27
|
-
return (React.createElement("div", { className: 'theia-card', role: "article", "aria-label": `Communication log for request ${entry.requestId}` },
|
|
28
|
-
React.createElement("div", { className: 'theia-card-meta' },
|
|
29
|
-
React.createElement("span", { className: 'theia-card-request-id' },
|
|
30
|
-
core_1.nls.localize('theia/ai/history/communication-card/requestId', 'Request ID'),
|
|
31
|
-
": ",
|
|
32
|
-
entry.requestId),
|
|
33
|
-
React.createElement("span", { className: 'theia-card-session-id' },
|
|
34
|
-
core_1.nls.localize('theia/ai/history/communication-card/sessionId', 'Session ID'),
|
|
35
|
-
": ",
|
|
36
|
-
entry.sessionId)),
|
|
37
|
-
React.createElement("div", { className: 'theia-card-content' },
|
|
38
|
-
entry.request && (React.createElement("div", { className: 'theia-card-request' },
|
|
39
|
-
React.createElement("h2", null, core_1.nls.localize('theia/ai/history/communication-card/request', 'Request')),
|
|
40
|
-
React.createElement("details", { key: `request-${entry.requestId}` },
|
|
41
|
-
React.createElement("summary", null,
|
|
42
|
-
React.createElement("h3", null,
|
|
43
|
-
core_1.nls.localize('theia/ai/history/communication-card/request/summary', 'Request'),
|
|
44
|
-
" ",
|
|
45
|
-
entry.requestId)),
|
|
46
|
-
React.createElement("div", { className: 'theia-card-request-messages' },
|
|
47
|
-
React.createElement("h4", null, core_1.nls.localize('theia/ai/history/communication-card/request/messages', 'Messages')),
|
|
48
|
-
React.createElement("ul", { className: 'theia-card-request-messages-list' }, entry.request.map((message, index) => (React.createElement("li", { key: `message-${entry.requestId}-${index}`, className: "message-item" },
|
|
49
|
-
React.createElement("pre", { className: "message-content" }, formatJson(message)))))))))),
|
|
50
|
-
entry.response && (React.createElement("div", { className: 'theia-card-response' },
|
|
51
|
-
React.createElement("h2", null, core_1.nls.localize('theia/ai/history/communication-card/response', 'Response')),
|
|
52
|
-
React.createElement("details", { key: `response-${entry.requestId}` },
|
|
53
|
-
React.createElement("summary", null,
|
|
54
|
-
React.createElement("h3", null,
|
|
55
|
-
core_1.nls.localize('theia/ai/history/communication-card/response/summary', 'Response'),
|
|
56
|
-
" ",
|
|
57
|
-
entry.requestId)),
|
|
58
|
-
React.createElement("div", { className: 'theia-card-response-messages' },
|
|
59
|
-
React.createElement("h4", null, core_1.nls.localize('theia/ai/history/communication-card/response/messages', 'Messages')),
|
|
60
|
-
React.createElement("ul", { className: 'theia-card-response-messages-list' }, entry.response.map((message, index) => (React.createElement("li", { key: `message-${entry.requestId}-${index}`, className: "message-item" },
|
|
61
|
-
React.createElement("pre", { className: "message-content" }, formatJson(message))))))))))),
|
|
62
|
-
React.createElement("div", { className: 'theia-card-meta' },
|
|
63
|
-
React.createElement("span", { className: 'theia-card-timestamp' },
|
|
64
|
-
core_1.nls.localize('theia/ai/history/communication-card/timestamp', 'Timestamp'),
|
|
65
|
-
": ",
|
|
66
|
-
formatTimestamp(entry.timestamp)),
|
|
67
|
-
entry.responseTime !== undefined && (React.createElement("span", { className: 'theia-card-response-time' },
|
|
68
|
-
core_1.nls.localize('theia/ai/history/communication-card/responseTime', 'Response Time'),
|
|
69
|
-
": ",
|
|
70
|
-
entry.responseTime,
|
|
71
|
-
"ms")))));
|
|
6
|
+
// Format JSON with error handling
|
|
7
|
+
const formatJson = (data) => {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.stringify(data, undefined, 2).split(/(?:\\r)?\\n/).flatMap((stringChunk, i) => [stringChunk, React.createElement("br", { key: stringChunk + i })]);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
console.error('Error formatting JSON:', error);
|
|
13
|
+
return 'Error formatting data';
|
|
14
|
+
}
|
|
72
15
|
};
|
|
16
|
+
// Format the timestamp for better readability
|
|
17
|
+
const formatTimestamp = (timestamp) => new Date(timestamp).toLocaleString(undefined, {
|
|
18
|
+
year: 'numeric',
|
|
19
|
+
month: 'short',
|
|
20
|
+
day: 'numeric',
|
|
21
|
+
hour: '2-digit',
|
|
22
|
+
minute: '2-digit',
|
|
23
|
+
second: '2-digit'
|
|
24
|
+
});
|
|
25
|
+
const CommunicationCard = ({ entry }) => (React.createElement("div", { className: 'theia-card', role: "article", "aria-label": `Communication log for request ${entry.requestId}` },
|
|
26
|
+
React.createElement("div", { className: 'theia-card-meta' },
|
|
27
|
+
React.createElement("span", { className: 'theia-card-request-id' },
|
|
28
|
+
core_1.nls.localize('theia/ai/history/communication-card/requestId', 'Request ID'),
|
|
29
|
+
": ",
|
|
30
|
+
entry.requestId),
|
|
31
|
+
React.createElement("span", { className: 'theia-card-session-id' },
|
|
32
|
+
core_1.nls.localize('theia/ai/history/communication-card/sessionId', 'Session ID'),
|
|
33
|
+
": ",
|
|
34
|
+
entry.sessionId)),
|
|
35
|
+
React.createElement("div", { className: 'theia-card-content' },
|
|
36
|
+
entry.request && (React.createElement("div", { className: 'theia-card-request' },
|
|
37
|
+
React.createElement("h2", null, core_1.nls.localize('theia/ai/history/communication-card/request', 'Request')),
|
|
38
|
+
React.createElement("details", { key: `request-${entry.requestId}` },
|
|
39
|
+
React.createElement("summary", null,
|
|
40
|
+
React.createElement("h3", null,
|
|
41
|
+
core_1.nls.localize('theia/ai/history/communication-card/request/summary', 'Request'),
|
|
42
|
+
" ",
|
|
43
|
+
entry.requestId)),
|
|
44
|
+
React.createElement("div", { className: 'theia-card-request-messages' },
|
|
45
|
+
React.createElement("h4", null, core_1.nls.localize('theia/ai/history/communication-card/request/messages', 'Messages')),
|
|
46
|
+
React.createElement("ul", { className: 'theia-card-request-messages-list' }, entry.request.map((message, index) => (React.createElement("li", { key: `message-${entry.requestId}-${index}`, className: "message-item" },
|
|
47
|
+
React.createElement("pre", { className: "message-content" }, formatJson(message)))))))))),
|
|
48
|
+
entry.response && (React.createElement("div", { className: 'theia-card-response' },
|
|
49
|
+
React.createElement("h2", null, core_1.nls.localize('theia/ai/history/communication-card/response', 'Response')),
|
|
50
|
+
React.createElement("details", { key: `response-${entry.requestId}` },
|
|
51
|
+
React.createElement("summary", null,
|
|
52
|
+
React.createElement("h3", null,
|
|
53
|
+
core_1.nls.localize('theia/ai/history/communication-card/response/summary', 'Response'),
|
|
54
|
+
" ",
|
|
55
|
+
entry.requestId)),
|
|
56
|
+
React.createElement("div", { className: 'theia-card-response-messages' },
|
|
57
|
+
React.createElement("h4", null, core_1.nls.localize('theia/ai/history/communication-card/response/messages', 'Messages')),
|
|
58
|
+
React.createElement("ul", { className: 'theia-card-response-messages-list' }, entry.response.map((message, index) => (React.createElement("li", { key: `message-${entry.requestId}-${index}`, className: "message-item" },
|
|
59
|
+
React.createElement("pre", { className: "message-content" }, formatJson(message))))))))))),
|
|
60
|
+
React.createElement("div", { className: 'theia-card-meta' },
|
|
61
|
+
React.createElement("span", { className: 'theia-card-timestamp' },
|
|
62
|
+
core_1.nls.localize('theia/ai/history/communication-card/timestamp', 'Timestamp'),
|
|
63
|
+
": ",
|
|
64
|
+
formatTimestamp(entry.timestamp)),
|
|
65
|
+
entry.responseTime !== undefined && (React.createElement("span", { className: 'theia-card-response-time' },
|
|
66
|
+
core_1.nls.localize('theia/ai/history/communication-card/responseTime', 'Response Time'),
|
|
67
|
+
": ",
|
|
68
|
+
entry.responseTime,
|
|
69
|
+
"ms")))));
|
|
73
70
|
exports.CommunicationCard = CommunicationCard;
|
|
74
71
|
//# sourceMappingURL=ai-history-communication-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-history-communication-card.js","sourceRoot":"","sources":["../../src/browser/ai-history-communication-card.tsx"],"names":[],"mappings":";;;AAgBA,sCAAkC;AAClC,kDAAkD;
|
|
1
|
+
{"version":3,"file":"ai-history-communication-card.js","sourceRoot":"","sources":["../../src/browser/ai-history-communication-card.tsx"],"names":[],"mapp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AC,mCAAmC,IAC5C,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,4BAAI,GAAG,EAAE,WAAW,KAAK,CAAC,SAAS,IAAI,KAAK,EAAE,EAAE,SAAS,EAAC,cAAc;wBACpE,6BAAK,SAAS,EAAC,iBAAiB,IAAE,UAAU,CAAC,OAAO,CAAC,CAAO,CAC3D,CACR,CAAC,CACD,CACH,CACA,CACR,CACT,CACC;IACN,6BAAK,SAAS,EAAC,iBAAiB;QAC5B,8BAAM,SAAS,EAAC,sBAAsB;YACjC,UAAG,CAAC,QAAQ,CAAC,+CAA+C,EAAE,WAAW,CAAC;;YAAI,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAC5G;QACN,KAAK,CAAC,YAAY,KAAK,SAAS,IAAI,CACjC,8BAAM,SAAS,EAAC,0BAA0B;YACrC,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAAE,eAAe,CAAC;;YAAI,KAAK,CAAC,YAAY;iBACrG,CACV,CACC,CACJ,CACT,CAAC;AA3DO,QAAA,iBAAiB,qBA2DxB"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-history",
|
|
3
|
-
"version": "1.61.
|
|
3
|
+
"version": "1.61.1",
|
|
4
4
|
"description": "Theia - AI communication history",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/ai-core": "1.61.
|
|
7
|
-
"@theia/core": "1.61.
|
|
8
|
-
"@theia/filesystem": "1.61.
|
|
9
|
-
"@theia/output": "1.61.
|
|
10
|
-
"@theia/workspace": "1.61.
|
|
6
|
+
"@theia/ai-core": "1.61.1",
|
|
7
|
+
"@theia/core": "1.61.1",
|
|
8
|
+
"@theia/filesystem": "1.61.1",
|
|
9
|
+
"@theia/output": "1.61.1",
|
|
10
|
+
"@theia/workspace": "1.61.1",
|
|
11
11
|
"minimatch": "^5.1.0",
|
|
12
12
|
"tslib": "^2.6.2"
|
|
13
13
|
},
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"watch": "theiaext watch"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@theia/ext-scripts": "1.
|
|
48
|
+
"@theia/ext-scripts": "1.61.1"
|
|
49
49
|
},
|
|
50
50
|
"nyc": {
|
|
51
51
|
"extends": "../../configs/nyc.json"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5ea3cf6111aded4ccf1d5ccaf67b04e6588a6dea"
|
|
54
54
|
}
|
|
@@ -20,31 +20,28 @@ import * as React from '@theia/core/shared/react';
|
|
|
20
20
|
export interface CommunicationCardProps {
|
|
21
21
|
entry: CommunicationHistoryEntry;
|
|
22
22
|
}
|
|
23
|
+
// Format JSON with error handling
|
|
24
|
+
const formatJson = (data: unknown): React.ReactNode => {
|
|
25
|
+
try {
|
|
26
|
+
return JSON.stringify(data, undefined, 2).split(/(?:\\r)?\\n/).flatMap((stringChunk, i) => [stringChunk, <br key={stringChunk + i}/>]);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error('Error formatting JSON:', error);
|
|
29
|
+
return 'Error formatting data';
|
|
30
|
+
}
|
|
31
|
+
};
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Format the timestamp for better readability
|
|
36
|
-
const formatTimestamp = (timestamp: number): string =>
|
|
37
|
-
new Date(timestamp).toLocaleString(undefined, {
|
|
38
|
-
year: 'numeric',
|
|
39
|
-
month: 'short',
|
|
40
|
-
day: 'numeric',
|
|
41
|
-
hour: '2-digit',
|
|
42
|
-
minute: '2-digit',
|
|
43
|
-
second: '2-digit'
|
|
44
|
-
});
|
|
45
|
-
;
|
|
33
|
+
// Format the timestamp for better readability
|
|
34
|
+
const formatTimestamp = (timestamp: number): string =>
|
|
35
|
+
new Date(timestamp).toLocaleString(undefined, {
|
|
36
|
+
year: 'numeric',
|
|
37
|
+
month: 'short',
|
|
38
|
+
day: 'numeric',
|
|
39
|
+
hour: '2-digit',
|
|
40
|
+
minute: '2-digit',
|
|
41
|
+
second: '2-digit'
|
|
42
|
+
});
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
export const CommunicationCard: React.FC<CommunicationCardProps> = ({ entry }) => (
|
|
48
45
|
<div className='theia-card' role="article" aria-label={`Communication log for request ${entry.requestId}`}>
|
|
49
46
|
<div className='theia-card-meta'>
|
|
50
47
|
<span className='theia-card-request-id'>{nls.localize('theia/ai/history/communication-card/requestId', 'Request ID')}: {entry.requestId}</span>
|
|
@@ -104,4 +101,3 @@ export const CommunicationCard: React.FC<CommunicationCardProps> = ({ entry }) =
|
|
|
104
101
|
</div>
|
|
105
102
|
</div>
|
|
106
103
|
);
|
|
107
|
-
};
|