claude-code-templates 1.11.0 โ 1.12.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/bin/create-claude-config.js +33 -26
- package/package.json +1 -2
- package/src/agents.js +262 -0
- package/src/analytics/core/ConversationAnalyzer.js +65 -23
- package/src/analytics-web/components/AgentsPage.js +2365 -156
- package/src/analytics-web/components/App.js +11 -0
- package/src/analytics-web/components/DashboardPage.js +4 -0
- package/src/analytics-web/components/ToolDisplay.js +17 -2
- package/src/analytics-web/index.html +3005 -1059
- package/src/analytics.js +342 -3
- package/src/command-scanner.js +5 -5
- package/src/index.js +13 -6
- package/src/prompts.js +40 -3
- package/src/templates.js +1 -4
- package/templates/javascript-typescript/examples/react-app/agents/react-performance-optimization.md +530 -0
- package/templates/javascript-typescript/examples/react-app/agents/react-state-management.md +295 -0
- package/templates/python/examples/django-app/agents/django-api-security.md +642 -0
- package/templates/python/examples/django-app/agents/django-database-optimization.md +752 -0
|
@@ -236,6 +236,11 @@ class App {
|
|
|
236
236
|
if (typeof AgentsPage !== 'undefined') {
|
|
237
237
|
this.components.pages.agents = new AgentsPage(container, this.services);
|
|
238
238
|
await this.components.pages.agents.initialize();
|
|
239
|
+
// Expose agentsPage globally for modal access
|
|
240
|
+
if (typeof window !== 'undefined' && window.claudeAnalyticsApp) {
|
|
241
|
+
window.claudeAnalyticsApp.agentsPage = this.components.pages.agents;
|
|
242
|
+
console.log('โ
Exposed agentsPage globally for modal access');
|
|
243
|
+
}
|
|
239
244
|
} else {
|
|
240
245
|
throw new Error('AgentsPage component not available. Check if components/AgentsPage.js is loaded.');
|
|
241
246
|
}
|
|
@@ -266,6 +271,12 @@ class App {
|
|
|
266
271
|
* Cleanup current page
|
|
267
272
|
*/
|
|
268
273
|
async cleanupCurrentPage() {
|
|
274
|
+
// Clean up global references
|
|
275
|
+
if (this.currentPage === 'agents' && typeof window !== 'undefined' && window.claudeAnalyticsApp) {
|
|
276
|
+
window.claudeAnalyticsApp.agentsPage = undefined;
|
|
277
|
+
console.log('๐งน Cleaned up global agentsPage reference');
|
|
278
|
+
}
|
|
279
|
+
|
|
269
280
|
const currentPageComponent = this.components.pages[this.currentPage];
|
|
270
281
|
if (currentPageComponent && currentPageComponent.onDeactivate) {
|
|
271
282
|
await currentPageComponent.onDeactivate();
|
|
@@ -1127,6 +1127,10 @@ class DashboardPage {
|
|
|
1127
1127
|
const labels = sortedDates.map(date => new Date(date).toLocaleDateString());
|
|
1128
1128
|
const data = sortedDates.map(date => tokensByDate[date]);
|
|
1129
1129
|
|
|
1130
|
+
console.log('๐ Token chart - tokensByDate:', tokensByDate);
|
|
1131
|
+
console.log('๐ Token chart - Labels:', labels);
|
|
1132
|
+
console.log('๐ Token chart - Data:', data);
|
|
1133
|
+
|
|
1130
1134
|
this.components.tokenChart.data.labels = labels;
|
|
1131
1135
|
this.components.tokenChart.data.datasets[0].data = data;
|
|
1132
1136
|
this.components.tokenChart.update();
|
|
@@ -15,14 +15,15 @@ class ToolDisplay {
|
|
|
15
15
|
* @returns {string} Safe HTML string
|
|
16
16
|
*/
|
|
17
17
|
renderToolUse(toolBlock, toolResults = null) {
|
|
18
|
-
const
|
|
18
|
+
const originalToolName = toolBlock.name || 'Unknown';
|
|
19
|
+
const toolName = this.escapeHtml(originalToolName);
|
|
19
20
|
const toolId = toolBlock.id ? toolBlock.id.slice(-8) : 'unknown';
|
|
20
21
|
|
|
21
22
|
// Generate compact command representation
|
|
22
23
|
const commandSummary = this.generateCompactCommand(toolName, toolBlock.input);
|
|
23
24
|
|
|
24
25
|
// For ALL tools, ALWAYS add a "Show details" button
|
|
25
|
-
const contentId =
|
|
26
|
+
const contentId = originalToolName.toLowerCase() + '_' + toolId + '_' + Date.now();
|
|
26
27
|
|
|
27
28
|
// Try to find corresponding tool result in toolResults first
|
|
28
29
|
let matchingResult = null;
|
|
@@ -37,6 +38,20 @@ class ToolDisplay {
|
|
|
37
38
|
if (typeof window !== 'undefined') {
|
|
38
39
|
window.storedContent = window.storedContent || {};
|
|
39
40
|
window.storedContent[contentId] = modalContent;
|
|
41
|
+
|
|
42
|
+
// Store tool data for all supported tools for custom modals
|
|
43
|
+
const supportedTools = ['Read', 'Edit', 'Write', 'Bash', 'Glob', 'Grep', 'TodoWrite'];
|
|
44
|
+
if (supportedTools.includes(originalToolName)) {
|
|
45
|
+
console.log(`๐ง ToolDisplay: Storing ${originalToolName} tool data for contentId:`, contentId);
|
|
46
|
+
window.storedToolData = window.storedToolData || {};
|
|
47
|
+
window.storedToolData[contentId] = {
|
|
48
|
+
name: originalToolName,
|
|
49
|
+
input: toolBlock.input || {},
|
|
50
|
+
id: toolBlock.id,
|
|
51
|
+
isToolDetails: true
|
|
52
|
+
};
|
|
53
|
+
console.log(`๐ง ToolDisplay: Stored tool data:`, window.storedToolData[contentId]);
|
|
54
|
+
}
|
|
40
55
|
}
|
|
41
56
|
|
|
42
57
|
// Always show "Show details" for ALL tools
|