chrome-devtools-mcp-for-extension 0.10.1 → 0.10.3
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.
|
@@ -24,7 +24,7 @@ function getDefaultBookmarks() {
|
|
|
24
24
|
'localhost': 'http://localhost:3000',
|
|
25
25
|
'localhost8080': 'http://localhost:8080',
|
|
26
26
|
'suno': 'https://suno.com/create',
|
|
27
|
-
'chatgpt': 'https://chatgpt.com'
|
|
27
|
+
'chatgpt': 'https://chatgpt.com/?model=gpt-5-thinking'
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -113,18 +113,31 @@ async function saveConversationLog(projectName, question, response, metadata) {
|
|
|
113
113
|
.replace(/[^a-z0-9\u3040-\u309f\u30a0-\u30ff\u4e00-\u9faf]+/gi, '-')
|
|
114
114
|
.toLowerCase()
|
|
115
115
|
.slice(0, 30);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
// If chatId is provided, save in chat-specific folder
|
|
117
|
+
let logPath;
|
|
118
|
+
if (metadata.chatId) {
|
|
119
|
+
const conversationNum = String(metadata.conversationNumber || 1).padStart(3, '0');
|
|
120
|
+
const filename = `${conversationNum}-${timestamp}-${topicSlug}.md`;
|
|
121
|
+
const logDir = path.join('docs/ask/chatgpt', metadata.chatId);
|
|
122
|
+
logPath = path.join(process.cwd(), logDir, filename);
|
|
123
|
+
// Ensure chat directory exists
|
|
124
|
+
await fs.promises.mkdir(path.join(process.cwd(), logDir), { recursive: true });
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// Fallback to old format (flat structure)
|
|
128
|
+
const filename = `${timestamp}-${projectName}-${topicSlug}.md`;
|
|
129
|
+
const logDir = 'docs/ask/chatgpt';
|
|
130
|
+
logPath = path.join(process.cwd(), logDir, filename);
|
|
131
|
+
// Ensure directory exists
|
|
132
|
+
await fs.promises.mkdir(path.dirname(logPath), { recursive: true });
|
|
133
|
+
}
|
|
121
134
|
const content = `# ${topicSlug}
|
|
122
135
|
|
|
123
136
|
## 📅 メタ情報
|
|
124
137
|
- **日時**: ${now.toLocaleString('ja-JP')}
|
|
125
138
|
- **プロジェクト**: ${projectName}
|
|
126
139
|
- **AIモデル**: ${metadata.model || 'ChatGPT'}
|
|
127
|
-
${metadata.thinkingTime ? `- **思考時間**: ${metadata.thinkingTime}s\n` : ''}${metadata.chatUrl ? `- **チャットURL**: ${metadata.chatUrl}\n` : ''}
|
|
140
|
+
${metadata.chatId ? `- **チャットID**: ${metadata.chatId}\n` : ''}${metadata.conversationNumber ? `- **会話番号**: ${metadata.conversationNumber}\n` : ''}${metadata.thinkingTime ? `- **思考時間**: ${metadata.thinkingTime}s\n` : ''}${metadata.chatUrl ? `- **チャットURL**: ${metadata.chatUrl}\n` : ''}
|
|
128
141
|
## ❓ 質問
|
|
129
142
|
|
|
130
143
|
${question}
|
|
@@ -172,7 +185,7 @@ export const askChatGPTWeb = defineTool({
|
|
|
172
185
|
try {
|
|
173
186
|
// Step 1: Navigate to ChatGPT
|
|
174
187
|
response.appendResponseLine('ChatGPTに接続中...');
|
|
175
|
-
await page.goto('https://chatgpt.com
|
|
188
|
+
await page.goto('https://chatgpt.com/?model=gpt-5-thinking', { waitUntil: 'networkidle2' });
|
|
176
189
|
// Check if logged in
|
|
177
190
|
const currentUrl = page.url();
|
|
178
191
|
if (currentUrl.includes('auth') || currentUrl.includes('login')) {
|
|
@@ -498,10 +511,17 @@ export const askChatGPTWeb = defineTool({
|
|
|
498
511
|
const modelName = useDeepResearch
|
|
499
512
|
? 'ChatGPT DeepResearch'
|
|
500
513
|
: 'ChatGPT 5 Thinking';
|
|
514
|
+
// Get current conversation count
|
|
515
|
+
const sessions = await loadChatSessions();
|
|
516
|
+
const projectSessions = sessions[project] || [];
|
|
517
|
+
const currentSession = projectSessions.find(s => s.chatId === sessionChatId);
|
|
518
|
+
const conversationNum = currentSession?.conversationCount || 1;
|
|
501
519
|
const logPath = await saveConversationLog(project, sanitizedQuestion, status.text || '', {
|
|
502
520
|
thinkingTime: status.thinkingTime,
|
|
503
521
|
chatUrl,
|
|
504
522
|
model: modelName,
|
|
523
|
+
chatId: sessionChatId,
|
|
524
|
+
conversationNumber: conversationNum,
|
|
505
525
|
});
|
|
506
526
|
response.appendResponseLine(`📝 会話ログ保存: ${logPath}`);
|
|
507
527
|
response.appendResponseLine(`🔗 チャットURL: ${chatUrl}`);
|
|
@@ -110,17 +110,29 @@ async function saveConversationLog(projectName, question, response, metadata) {
|
|
|
110
110
|
.replace(/[^a-z0-9\u3040-\u309f\u30a0-\u30ff\u4e00-\u9faf]+/gi, '-')
|
|
111
111
|
.toLowerCase()
|
|
112
112
|
.slice(0, 30);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
// If chatId is provided, save in chat-specific folder
|
|
114
|
+
let logPath;
|
|
115
|
+
if (metadata.chatId) {
|
|
116
|
+
const conversationNum = String(metadata.conversationNumber || 1).padStart(3, '0');
|
|
117
|
+
const filename = `${conversationNum}-${timestamp}-deepresearch-${topicSlug}.md`;
|
|
118
|
+
const logDir = path.join('docs/ask/chatgpt', metadata.chatId);
|
|
119
|
+
logPath = path.join(process.cwd(), logDir, filename);
|
|
120
|
+
await fs.promises.mkdir(path.join(process.cwd(), logDir), { recursive: true });
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
// Fallback to old format
|
|
124
|
+
const filename = `${timestamp}-${projectName}-deepresearch-${topicSlug}.md`;
|
|
125
|
+
const logDir = 'docs/ask/chatgpt';
|
|
126
|
+
logPath = path.join(process.cwd(), logDir, filename);
|
|
127
|
+
await fs.promises.mkdir(path.dirname(logPath), { recursive: true });
|
|
128
|
+
}
|
|
117
129
|
const content = `# ${topicSlug}
|
|
118
130
|
|
|
119
131
|
## 📅 メタ情報
|
|
120
132
|
- **日時**: ${now.toLocaleString('ja-JP')}
|
|
121
133
|
- **プロジェクト**: ${projectName}
|
|
122
134
|
- **AIモデル**: ${metadata.model || 'ChatGPT DeepResearch'}
|
|
123
|
-
${metadata.researchTime ? `- **リサーチ時間**: ${metadata.researchTime}秒\n` : ''}${metadata.chatUrl ? `- **チャットURL**: ${metadata.chatUrl}\n` : ''}
|
|
135
|
+
${metadata.chatId ? `- **チャットID**: ${metadata.chatId}\n` : ''}${metadata.conversationNumber ? `- **会話番号**: ${metadata.conversationNumber}\n` : ''}${metadata.researchTime ? `- **リサーチ時間**: ${metadata.researchTime}秒\n` : ''}${metadata.chatUrl ? `- **チャットURL**: ${metadata.chatUrl}\n` : ''}
|
|
124
136
|
## ❓ リサーチテーマ
|
|
125
137
|
|
|
126
138
|
${question}
|
|
@@ -484,7 +496,7 @@ async function handleConversationLoop(page, response, maxTurns = 5) {
|
|
|
484
496
|
*/
|
|
485
497
|
async function monitorResearch(page, response, startTime) {
|
|
486
498
|
response.appendResponseLine('⏳ DeepResearchを実行中... (数分かかる場合があります)');
|
|
487
|
-
const MAX_WAIT_TIME =
|
|
499
|
+
const MAX_WAIT_TIME = 60 * 60 * 1000; // 60 minutes max
|
|
488
500
|
let progressCounter = 0;
|
|
489
501
|
while (Date.now() - startTime < MAX_WAIT_TIME) {
|
|
490
502
|
await new Promise((resolve) => setTimeout(resolve, 5000));
|
|
@@ -537,7 +549,7 @@ async function monitorResearch(page, response, startTime) {
|
|
|
537
549
|
}
|
|
538
550
|
return {
|
|
539
551
|
completed: false,
|
|
540
|
-
error: 'リサーチがタイムアウトしました(
|
|
552
|
+
error: 'リサーチがタイムアウトしました(60分経過)',
|
|
541
553
|
};
|
|
542
554
|
}
|
|
543
555
|
export const deepResearchChatGPT = defineTool({
|
|
@@ -670,8 +682,10 @@ export const deepResearchChatGPT = defineTool({
|
|
|
670
682
|
// Phase 8: Save results
|
|
671
683
|
const chatUrl = page.url();
|
|
672
684
|
const chatIdMatch = chatUrl.match(/\/c\/([a-f0-9-]+)/);
|
|
685
|
+
let savedChatId;
|
|
673
686
|
if (chatIdMatch) {
|
|
674
687
|
const chatId = chatIdMatch[1];
|
|
688
|
+
savedChatId = chatId;
|
|
675
689
|
const now = new Date().toISOString();
|
|
676
690
|
await saveChatSession(project, {
|
|
677
691
|
chatId,
|
|
@@ -688,6 +702,8 @@ export const deepResearchChatGPT = defineTool({
|
|
|
688
702
|
researchTime: Math.floor((Date.now() - startTime) / 1000),
|
|
689
703
|
chatUrl,
|
|
690
704
|
model: 'ChatGPT DeepResearch',
|
|
705
|
+
chatId: savedChatId,
|
|
706
|
+
conversationNumber: 1,
|
|
691
707
|
});
|
|
692
708
|
response.appendResponseLine(`📝 リサーチログ保存: ${logPath}`);
|
|
693
709
|
response.appendResponseLine(`🔗 チャットURL: ${chatUrl}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "MCP server for Chrome extension development with Web Store automation. Fork of chrome-devtools-mcp with extension-specific tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./build/src/index.js",
|