@adhdev/daemon-core 0.5.25 → 0.5.27

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.
Files changed (109) hide show
  1. package/dist/index.js +33 -28
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/providers/_builtin/COMPATIBILITY.md +1 -1
  5. package/providers/_builtin/README.md +1 -1
  6. package/providers/_builtin/cli/claude-cli/provider.json +2 -1
  7. package/providers/_builtin/docs/PROVIDER_GUIDE.md +3 -3
  8. package/providers/_builtin/extension/cline/provider.json +4 -2
  9. package/providers/_builtin/extension/codex/provider.json +4 -2
  10. package/providers/_builtin/extension/codex/scripts/{list_models.js → 1.0/list_models.js} +1 -0
  11. package/providers/_builtin/extension/codex/scripts/{read_chat.js → 1.0/read_chat.js} +36 -11
  12. package/providers/_builtin/extension/codex/scripts/{send_message.js → 1.0/send_message.js} +1 -1
  13. package/providers/_builtin/extension/codex/scripts/list_modes.js +138 -0
  14. package/providers/_builtin/extension/codex/scripts/set_mode.js +165 -0
  15. package/providers/_builtin/extension/roo-code/provider.json +4 -2
  16. package/providers/_builtin/ide/antigravity/scripts/1.106/read_chat.js +2 -1
  17. package/providers/_builtin/ide/antigravity/scripts/1.107/read_chat.js +2 -1
  18. package/providers/_builtin/ide/cursor/provider.json +1 -70
  19. package/providers/_builtin/ide/cursor/provider.json.bak +70 -0
  20. package/providers/_builtin/ide/cursor/scripts/0.49/list_sessions.js +1 -1
  21. package/providers/_builtin/ide/cursor/scripts/0.49/read_chat.js +1 -1
  22. package/providers/_builtin/ide/kiro/provider.json +4 -2
  23. package/providers/_builtin/ide/pearai/provider.json +4 -2
  24. package/providers/_builtin/ide/trae/provider.json +4 -2
  25. package/providers/_builtin/ide/windsurf/provider.json +4 -2
  26. package/providers/_builtin/ide/windsurf/scripts/{read_chat.js → 1.0/read_chat.js} +2 -1
  27. package/providers/_builtin/registry.json +1 -12
  28. package/src/cli-adapters/provider-cli-adapter.ts +42 -35
  29. package/providers/_builtin/extension/cline/scripts.js +0 -73
  30. package/providers/_builtin/extension/codex/scripts.js +0 -94
  31. package/providers/_builtin/ide/kiro/scripts.js +0 -62
  32. package/providers/_builtin/ide/pearai/scripts.js +0 -74
  33. package/providers/_builtin/ide/trae/scripts.js +0 -57
  34. package/providers/_builtin/ide/windsurf/scripts.js +0 -57
  35. /package/providers/_builtin/extension/cline/scripts/{focus_editor.js → 1.0/focus_editor.js} +0 -0
  36. /package/providers/_builtin/extension/cline/scripts/{list_chats.js → 1.0/list_chats.js} +0 -0
  37. /package/providers/_builtin/extension/cline/scripts/{list_models.js → 1.0/list_models.js} +0 -0
  38. /package/providers/_builtin/extension/cline/scripts/{list_modes.js → 1.0/list_modes.js} +0 -0
  39. /package/providers/_builtin/extension/cline/scripts/{new_session.js → 1.0/new_session.js} +0 -0
  40. /package/providers/_builtin/extension/cline/scripts/{open_panel.js → 1.0/open_panel.js} +0 -0
  41. /package/providers/_builtin/extension/cline/scripts/{read_chat.js → 1.0/read_chat.js} +0 -0
  42. /package/providers/_builtin/extension/cline/scripts/{resolve_action.js → 1.0/resolve_action.js} +0 -0
  43. /package/providers/_builtin/extension/cline/scripts/{send_message.js → 1.0/send_message.js} +0 -0
  44. /package/providers/_builtin/extension/cline/scripts/{set_mode.js → 1.0/set_mode.js} +0 -0
  45. /package/providers/_builtin/extension/cline/scripts/{set_model.js → 1.0/set_model.js} +0 -0
  46. /package/providers/_builtin/extension/cline/scripts/{switch_session.js → 1.0/switch_session.js} +0 -0
  47. /package/providers/_builtin/extension/codex/scripts/{click_conversation_webview.js → 1.0/click_conversation_webview.js} +0 -0
  48. /package/providers/_builtin/extension/codex/scripts/{explore_chat_webview.js → 1.0/explore_chat_webview.js} +0 -0
  49. /package/providers/_builtin/extension/codex/scripts/{explore_controls_webview.js → 1.0/explore_controls_webview.js} +0 -0
  50. /package/providers/_builtin/extension/codex/scripts/{explore_dom.js → 1.0/explore_dom.js} +0 -0
  51. /package/providers/_builtin/extension/codex/scripts/{explore_dropdown_webview.js → 1.0/explore_dropdown_webview.js} +0 -0
  52. /package/providers/_builtin/extension/codex/scripts/{inspect_code_webview.js → 1.0/inspect_code_webview.js} +0 -0
  53. /package/providers/_builtin/extension/codex/scripts/{message_structure_webview.js → 1.0/message_structure_webview.js} +0 -0
  54. /package/providers/_builtin/extension/codex/scripts/{new_session.js → 1.0/new_session.js} +0 -0
  55. /package/providers/_builtin/extension/codex/scripts/{resolve_action.js → 1.0/resolve_action.js} +0 -0
  56. /package/providers/_builtin/extension/codex/scripts/{set_model.js → 1.0/set_model.js} +0 -0
  57. /package/providers/_builtin/extension/roo-code/{scripts.js → scripts/1.0/scripts.js} +0 -0
  58. /package/providers/_builtin/ide/kiro/scripts/{focus_editor.js → 1.0/focus_editor.js} +0 -0
  59. /package/providers/_builtin/ide/kiro/scripts/{open_panel.js → 1.0/open_panel.js} +0 -0
  60. /package/providers/_builtin/ide/kiro/scripts/{resolve_action.js → 1.0/resolve_action.js} +0 -0
  61. /package/providers/_builtin/ide/kiro/scripts/{send_message.js → 1.0/send_message.js} +0 -0
  62. /package/providers/_builtin/ide/kiro/scripts/{webview_list_models.js → 1.0/webview_list_models.js} +0 -0
  63. /package/providers/_builtin/ide/kiro/scripts/{webview_list_modes.js → 1.0/webview_list_modes.js} +0 -0
  64. /package/providers/_builtin/ide/kiro/scripts/{webview_list_sessions.js → 1.0/webview_list_sessions.js} +0 -0
  65. /package/providers/_builtin/ide/kiro/scripts/{webview_new_session.js → 1.0/webview_new_session.js} +0 -0
  66. /package/providers/_builtin/ide/kiro/scripts/{webview_read_chat.js → 1.0/webview_read_chat.js} +0 -0
  67. /package/providers/_builtin/ide/kiro/scripts/{webview_send_message.js → 1.0/webview_send_message.js} +0 -0
  68. /package/providers/_builtin/ide/kiro/scripts/{webview_set_mode.js → 1.0/webview_set_mode.js} +0 -0
  69. /package/providers/_builtin/ide/kiro/scripts/{webview_set_model.js → 1.0/webview_set_model.js} +0 -0
  70. /package/providers/_builtin/ide/kiro/scripts/{webview_switch_session.js → 1.0/webview_switch_session.js} +0 -0
  71. /package/providers/_builtin/ide/pearai/scripts/{focus_editor.js → 1.0/focus_editor.js} +0 -0
  72. /package/providers/_builtin/ide/pearai/scripts/{list_sessions.js → 1.0/list_sessions.js} +0 -0
  73. /package/providers/_builtin/ide/pearai/scripts/{new_session.js → 1.0/new_session.js} +0 -0
  74. /package/providers/_builtin/ide/pearai/scripts/{open_panel.js → 1.0/open_panel.js} +0 -0
  75. /package/providers/_builtin/ide/pearai/scripts/{resolve_action.js → 1.0/resolve_action.js} +0 -0
  76. /package/providers/_builtin/ide/pearai/scripts/{send_message.js → 1.0/send_message.js} +0 -0
  77. /package/providers/_builtin/ide/pearai/scripts/{webview_list_models.js → 1.0/webview_list_models.js} +0 -0
  78. /package/providers/_builtin/ide/pearai/scripts/{webview_list_modes.js → 1.0/webview_list_modes.js} +0 -0
  79. /package/providers/_builtin/ide/pearai/scripts/{webview_list_sessions.js → 1.0/webview_list_sessions.js} +0 -0
  80. /package/providers/_builtin/ide/pearai/scripts/{webview_new_session.js → 1.0/webview_new_session.js} +0 -0
  81. /package/providers/_builtin/ide/pearai/scripts/{webview_read_chat.js → 1.0/webview_read_chat.js} +0 -0
  82. /package/providers/_builtin/ide/pearai/scripts/{webview_resolve_action.js → 1.0/webview_resolve_action.js} +0 -0
  83. /package/providers/_builtin/ide/pearai/scripts/{webview_send_message.js → 1.0/webview_send_message.js} +0 -0
  84. /package/providers/_builtin/ide/pearai/scripts/{webview_set_mode.js → 1.0/webview_set_mode.js} +0 -0
  85. /package/providers/_builtin/ide/pearai/scripts/{webview_set_model.js → 1.0/webview_set_model.js} +0 -0
  86. /package/providers/_builtin/ide/pearai/scripts/{webview_switch_session.js → 1.0/webview_switch_session.js} +0 -0
  87. /package/providers/_builtin/ide/trae/scripts/{focus_editor.js → 1.0/focus_editor.js} +0 -0
  88. /package/providers/_builtin/ide/trae/scripts/{list_chats.js → 1.0/list_chats.js} +0 -0
  89. /package/providers/_builtin/ide/trae/scripts/{list_models.js → 1.0/list_models.js} +0 -0
  90. /package/providers/_builtin/ide/trae/scripts/{list_modes.js → 1.0/list_modes.js} +0 -0
  91. /package/providers/_builtin/ide/trae/scripts/{new_session.js → 1.0/new_session.js} +0 -0
  92. /package/providers/_builtin/ide/trae/scripts/{open_panel.js → 1.0/open_panel.js} +0 -0
  93. /package/providers/_builtin/ide/trae/scripts/{read_chat.js → 1.0/read_chat.js} +0 -0
  94. /package/providers/_builtin/ide/trae/scripts/{resolve_action.js → 1.0/resolve_action.js} +0 -0
  95. /package/providers/_builtin/ide/trae/scripts/{send_message.js → 1.0/send_message.js} +0 -0
  96. /package/providers/_builtin/ide/trae/scripts/{set_mode.js → 1.0/set_mode.js} +0 -0
  97. /package/providers/_builtin/ide/trae/scripts/{set_model.js → 1.0/set_model.js} +0 -0
  98. /package/providers/_builtin/ide/trae/scripts/{switch_session.js → 1.0/switch_session.js} +0 -0
  99. /package/providers/_builtin/ide/windsurf/scripts/{focus_editor.js → 1.0/focus_editor.js} +0 -0
  100. /package/providers/_builtin/ide/windsurf/scripts/{list_chats.js → 1.0/list_chats.js} +0 -0
  101. /package/providers/_builtin/ide/windsurf/scripts/{list_models.js → 1.0/list_models.js} +0 -0
  102. /package/providers/_builtin/ide/windsurf/scripts/{list_modes.js → 1.0/list_modes.js} +0 -0
  103. /package/providers/_builtin/ide/windsurf/scripts/{new_session.js → 1.0/new_session.js} +0 -0
  104. /package/providers/_builtin/ide/windsurf/scripts/{open_panel.js → 1.0/open_panel.js} +0 -0
  105. /package/providers/_builtin/ide/windsurf/scripts/{resolve_action.js → 1.0/resolve_action.js} +0 -0
  106. /package/providers/_builtin/ide/windsurf/scripts/{send_message.js → 1.0/send_message.js} +0 -0
  107. /package/providers/_builtin/ide/windsurf/scripts/{set_mode.js → 1.0/set_mode.js} +0 -0
  108. /package/providers/_builtin/ide/windsurf/scripts/{set_model.js → 1.0/set_model.js} +0 -0
  109. /package/providers/_builtin/ide/windsurf/scripts/{switch_session.js → 1.0/switch_session.js} +0 -0
@@ -0,0 +1,70 @@
1
+ {
2
+ "type": "cursor",
3
+ "name": "Cursor",
4
+ "category": "ide",
5
+ "displayName": "Cursor",
6
+ "icon": "⚡",
7
+ "cli": "cursor",
8
+ "cdpPorts": [
9
+ 9333,
10
+ 9334
11
+ ],
12
+ "targetFilter": {
13
+ "urlIncludes": "workbench.html",
14
+ "urlExcludes": ["agent"],
15
+ "titleExcludes": "extension-output|ADHDev CDP|Debug Console|Output\\s*$|Launchpad"
16
+ },
17
+ "processNames": {
18
+ "darwin": "Cursor",
19
+ "win32": [
20
+ "Cursor.exe"
21
+ ]
22
+ },
23
+ "paths": {
24
+ "darwin": [
25
+ "/Applications/Cursor.app"
26
+ ],
27
+ "win32": [
28
+ "C:\\Users\\*\\AppData\\Local\\Programs\\cursor\\Cursor.exe"
29
+ ],
30
+ "linux": [
31
+ "/opt/Cursor",
32
+ "/usr/share/cursor"
33
+ ]
34
+ },
35
+ "inputMethod": "cdp-type-and-send",
36
+ "inputSelector": ".aislash-editor-input[contenteditable=\"true\"]",
37
+ "versionCommand": "cursor --version",
38
+ "providerVersion": "1.0.0",
39
+ "compatibility": [
40
+ { "ideVersion": ">=0.49.0", "scriptDir": "scripts/0.49" }
41
+ ],
42
+ "defaultScriptDir": "scripts/0.49",
43
+ "vscodeCommands": {
44
+ "changeModel": "cursor.model"
45
+ },
46
+ "settings": {
47
+ "approvalAlert": {
48
+ "type": "boolean",
49
+ "default": true,
50
+ "public": true,
51
+ "label": "Approval Notifications",
52
+ "description": "Show notification when approval is needed"
53
+ },
54
+ "longGeneratingAlert": {
55
+ "type": "boolean",
56
+ "default": true,
57
+ "public": true,
58
+ "label": "Long Generation Alert",
59
+ "description": "Alert when generation takes too long"
60
+ },
61
+ "longGeneratingThresholdSec": {
62
+ "type": "number",
63
+ "default": 180,
64
+ "public": true,
65
+ "label": "Long Generation Threshold (sec)",
66
+ "min": 30,
67
+ "max": 600
68
+ }
69
+ }
70
+ }
@@ -30,7 +30,7 @@
30
30
  if (sessions.length === 0 && activeComposer) {
31
31
  sessions.push({
32
32
  id: activeId,
33
- title: document.title.split(' — ')[0],
33
+ title: (() => { const p = document.title.split(' — '); return p.length >= 2 ? p[p.length - 1] : p[0]; })(),
34
34
  active: true,
35
35
  index: 0,
36
36
  });
@@ -309,7 +309,7 @@
309
309
 
310
310
  // ─── Title ───
311
311
  const titleParts = document.title.split(' — ');
312
- const projectTitle = (titleParts.length >= 2 ? titleParts[titleParts.length - 2] : titleParts[0] || '').trim();
312
+ const projectTitle = (titleParts.length >= 2 ? titleParts[titleParts.length - 1] : titleParts[0] || '').trim();
313
313
 
314
314
  return JSON.stringify({ id, status, title: projectTitle, messages, inputContent, activeModal });
315
315
  } catch(e) {
@@ -63,5 +63,7 @@
63
63
  "min": 30,
64
64
  "max": 600
65
65
  }
66
- }
67
- }
66
+ },
67
+ "defaultScriptDir": "scripts/1.0",
68
+ "compatibility": []
69
+ }
@@ -63,5 +63,7 @@
63
63
  "min": 30,
64
64
  "max": 600
65
65
  }
66
- }
67
- }
66
+ },
67
+ "defaultScriptDir": "scripts/1.0",
68
+ "compatibility": []
69
+ }
@@ -62,5 +62,7 @@
62
62
  "min": 30,
63
63
  "max": 600
64
64
  }
65
- }
66
- }
65
+ },
66
+ "defaultScriptDir": "scripts/1.0",
67
+ "compatibility": []
68
+ }
@@ -49,5 +49,7 @@
49
49
  "min": 30,
50
50
  "max": 600
51
51
  }
52
- }
53
- }
52
+ },
53
+ "defaultScriptDir": "scripts/1.0",
54
+ "compatibility": []
55
+ }
@@ -83,7 +83,8 @@
83
83
  }
84
84
  }
85
85
 
86
- const title = document.title.split(' \u2014 ')[0].trim() || 'Cascade';
86
+ const titleParts = document.title.split(' \u2014 ');
87
+ const title = (titleParts.length >= 2 ? titleParts[titleParts.length - 1] : titleParts[0] || '').trim() || 'Cascade';
87
88
 
88
89
  // ─── 4. HTML → Markdown 변환기 ───
89
90
  const BLOCK_TAGS = new Set(['DIV', 'P', 'BR', 'LI', 'TR', 'SECTION', 'ARTICLE', 'HEADER', 'FOOTER']);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.03.22",
2
+ "version": "2026.03.23",
3
3
  "providers": {
4
4
  "agentpool-acp": {
5
5
  "providerVersion": "0.0.0",
@@ -221,17 +221,6 @@
221
221
  }
222
222
  ]
223
223
  },
224
- "cursor": {
225
- "providerVersion": "1.0.0",
226
- "category": "ide",
227
- "name": "Cursor",
228
- "compatibility": [
229
- {
230
- "ideVersion": ">=0.49.0",
231
- "scriptDir": "scripts/0.49"
232
- }
233
- ]
234
- },
235
224
  "kiro": {
236
225
  "providerVersion": "0.0.0",
237
226
  "category": "ide",
@@ -301,7 +301,7 @@ export class ProviderCliAdapter implements CliAdapter {
301
301
  this.timeouts = {
302
302
  ptyFlush: t.ptyFlush ?? 50,
303
303
  dialogAccept: t.dialogAccept ?? 300,
304
- approvalCooldown: t.approvalCooldown ?? 2000,
304
+ approvalCooldown: t.approvalCooldown ?? 500,
305
305
  generatingIdle: t.generatingIdle ?? 6000,
306
306
  idleFinish: t.idleFinish ?? 5000,
307
307
  maxResponse: t.maxResponse ?? 300000,
@@ -473,39 +473,41 @@ export class ProviderCliAdapter implements CliAdapter {
473
473
  // ─── Phase 2: Approval detect
474
474
  const hasApproval = patterns.approval.some(p => p.test(this.recentOutputBuffer));
475
475
  if (hasApproval && this.currentStatus !== 'waiting_approval') {
476
- if (this.lastApprovalResolvedAt && (Date.now() - this.lastApprovalResolvedAt) < this.timeouts.approvalCooldown) return;
477
-
478
- // Capture context before clearing (recentOutputBuffer still has content here)
479
- const ctxLines = this.recentOutputBuffer.split('\n')
480
- .map(l => l.trim())
481
- .filter(l => l && !/^[─═╭╮╰╯│]+$/.test(l));
482
- this.isWaitingForResponse = true;
483
- this.setStatus('waiting_approval', 'approval_pattern');
484
- this.recentOutputBuffer = '';
485
- this.approvalTransitionBuffer = '';
486
- this.activeModal = {
487
- message: ctxLines.slice(-5).join(' ').slice(0, 200) || 'Approval required',
488
- buttons: this.cliType === 'claude-cli'
489
- ? ['Yes (y)', 'Always allow (a)', 'Deny (Esc)']
490
- : ['Allow once', 'Always allow', 'Deny'],
491
- };
492
- if (this.idleTimeout) clearTimeout(this.idleTimeout);
493
- // Safety timeout — if stuck in waiting_approval, auto-exit after 60s
494
- if (this.approvalExitTimeout) clearTimeout(this.approvalExitTimeout);
495
- this.approvalExitTimeout = setTimeout(() => {
496
- if (this.currentStatus === 'waiting_approval') {
497
- LOG.warn('CLI', `[${this.cliType}] Approval timeout — auto-exiting waiting_approval`);
498
- this.activeModal = null;
499
- this.lastApprovalResolvedAt = Date.now();
500
- this.recentOutputBuffer = '';
501
- this.approvalTransitionBuffer = '';
502
- this.approvalExitTimeout = null;
503
- this.setStatus(this.isWaitingForResponse ? 'generating' : 'idle', 'approval_cleared');
504
- this.onStatusChange?.();
505
- }
506
- }, 60000);
507
- this.onStatusChange?.();
508
- return;
476
+ const inCooldown = this.lastApprovalResolvedAt && (Date.now() - this.lastApprovalResolvedAt) < this.timeouts.approvalCooldown;
477
+ if (!inCooldown) {
478
+ // Capture context before clearing (recentOutputBuffer still has content here)
479
+ const ctxLines = this.recentOutputBuffer.split('\n')
480
+ .map(l => l.trim())
481
+ .filter(l => l && !/^[─═╭╮╰╯│]+$/.test(l));
482
+ this.isWaitingForResponse = true;
483
+ this.setStatus('waiting_approval', 'approval_pattern');
484
+ this.recentOutputBuffer = '';
485
+ this.approvalTransitionBuffer = '';
486
+ this.activeModal = {
487
+ message: ctxLines.slice(-5).join(' ').slice(0, 200) || 'Approval required',
488
+ buttons: this.cliType === 'claude-cli'
489
+ ? ['Yes (y)', 'Always allow (a)', 'Deny (Esc)']
490
+ : ['Allow once', 'Always allow', 'Deny'],
491
+ };
492
+ if (this.idleTimeout) clearTimeout(this.idleTimeout);
493
+ // Safety timeout — if stuck in waiting_approval, auto-exit after 60s
494
+ if (this.approvalExitTimeout) clearTimeout(this.approvalExitTimeout);
495
+ this.approvalExitTimeout = setTimeout(() => {
496
+ if (this.currentStatus === 'waiting_approval') {
497
+ LOG.warn('CLI', `[${this.cliType}] Approval timeout — auto-exiting waiting_approval`);
498
+ this.activeModal = null;
499
+ this.lastApprovalResolvedAt = Date.now();
500
+ this.recentOutputBuffer = '';
501
+ this.approvalTransitionBuffer = '';
502
+ this.approvalExitTimeout = null;
503
+ this.setStatus(this.isWaitingForResponse ? 'generating' : 'idle', 'approval_cleared');
504
+ this.onStatusChange?.();
505
+ }
506
+ }, 60000);
507
+ this.onStatusChange?.();
508
+ return;
509
+ }
510
+ // In cooldown — don't set approval, but DO continue to other phases
509
511
  }
510
512
 
511
513
  // ─── Phase 3: Approval release
@@ -565,7 +567,12 @@ export class ProviderCliAdapter implements CliAdapter {
565
567
  // has '>' in code blocks, shell examples, or mid-response lines.
566
568
  const trailingLines = cleanData.split('\n').slice(-2).join('\n');
567
569
  if (patterns.prompt.some(p => p.test(trailingLines))) {
568
- this.finishResponse();
570
+ // Guard: don't finishResponse if approval text is also present —
571
+ // Claude Code's approval UI can contain prompt-like characters
572
+ const hasApprovalHere = patterns.approval.some(p => p.test(this.recentOutputBuffer));
573
+ if (!hasApprovalHere) {
574
+ this.finishResponse();
575
+ }
569
576
  } else {
570
577
  this.idleTimeout = setTimeout(() => {
571
578
  if (this.isWaitingForResponse && this.responseBuffer.trim()) {
@@ -1,73 +0,0 @@
1
- /**
2
- * CDP Scripts for Cline
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
8
- function loadScript(name) {
9
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
10
- catch { return null; }
11
- }
12
-
13
-
14
- module.exports.readChat = function readChat() {
15
- return loadScript('read_chat.js');
16
- };
17
-
18
- module.exports.sendMessage = function sendMessage(text) {
19
- const script = loadScript('send_message.js');
20
- if (!script) return null;
21
- return script.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text));
22
- };
23
-
24
- module.exports.listSessions = function listSessions() {
25
- return loadScript('list_chats.js');
26
- };
27
-
28
- module.exports.switchSession = function switchSession(sessionId) {
29
- const script = loadScript('switch_session.js');
30
- if (!script) return null;
31
- return script.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId));
32
- };
33
-
34
- module.exports.newSession = function newSession() {
35
- return loadScript('new_session.js');
36
- };
37
-
38
- module.exports.resolveAction = function resolveAction(action) {
39
- const script = loadScript('resolve_action.js');
40
- if (!script) return null;
41
- return script.replace(/\$\{\s*ACTION\s*\}/g, JSON.stringify(action));
42
- };
43
-
44
- module.exports.focusEditor = function focusEditor() {
45
- return loadScript('focus_editor.js');
46
- };
47
-
48
- module.exports.openPanel = function openPanel() {
49
- return loadScript('open_panel.js');
50
- };
51
-
52
- module.exports.listModels = function listModels() {
53
- return loadScript('list_models.js');
54
- };
55
-
56
- module.exports.setModel = function setModel(params) {
57
- const model = params?.model || params;
58
- const script = loadScript('set_model.js');
59
- if (!script) return null;
60
- return script.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model));
61
- };
62
-
63
- module.exports.listModes = function listModes() {
64
- return loadScript('list_modes.js');
65
- };
66
-
67
- module.exports.setMode = function setMode(params) {
68
- const mode = params?.mode || params;
69
- const script = loadScript('set_mode.js');
70
- if (!script) return null;
71
- return script.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode));
72
- };
73
-
@@ -1,94 +0,0 @@
1
- /**
2
- * CDP Scripts for Codex (openai.chatgpt)
3
- *
4
- * All scripts run inside the Codex webview frame via evaluateInWebviewFrame.
5
- * Script names containing "Webview" are automatically routed through
6
- * evaluateInWebviewFrame by DevServer.
7
- *
8
- * For production (ProviderInstance), the AgentStreamAdapter calls
9
- * evaluateInWebviewFrame directly using the provider's webviewMatchText.
10
- */
11
-
12
- const fs = require('fs');
13
- const path = require('path');
14
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
15
- function loadScript(name) {
16
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
17
- catch { return null; }
18
- }
19
-
20
- // ─── Production scripts ───
21
-
22
- module.exports.readChat = function readChat() {
23
- return loadScript('read_chat.js');
24
- };
25
-
26
- module.exports.sendMessage = function sendMessage(text) {
27
- const script = loadScript('send_message.js');
28
- if (!script) return null;
29
- return script.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text));
30
- };
31
-
32
- module.exports.resolveAction = function resolveAction(action) {
33
- const script = loadScript('resolve_action.js');
34
- if (!script) return null;
35
- return script.replace(/\$\{\s*ACTION\s*\}/g, JSON.stringify(action));
36
- };
37
-
38
- module.exports.listModels = function listModels() {
39
- return loadScript('list_models.js');
40
- };
41
-
42
- module.exports.setModel = function setModel(params) {
43
- const model = params?.model || params;
44
- const script = loadScript('set_model.js');
45
- if (!script) return null;
46
- return script.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model));
47
- };
48
-
49
- module.exports.newSession = function newSession() {
50
- return loadScript('new_session.js');
51
- };
52
-
53
- // ─── DevConsole debug helpers (names contain "Webview" for auto-routing) ───
54
-
55
- module.exports.readChatWebview = function readChatWebview() {
56
- return loadScript('read_chat.js');
57
- };
58
-
59
- module.exports.sendMessageWebview = function sendMessageWebview(text) {
60
- const script = loadScript('send_message.js');
61
- if (!script) return null;
62
- return script.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text));
63
- };
64
-
65
- module.exports.listModelsWebview = function listModelsWebview() {
66
- return loadScript('list_models.js');
67
- };
68
-
69
- module.exports.setModelWebview = function setModelWebview(params) {
70
- const model = params?.model || params;
71
- const script = loadScript('set_model.js');
72
- if (!script) return null;
73
- return script.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model));
74
- };
75
-
76
- module.exports.newSessionWebview = function newSessionWebview() {
77
- return loadScript('new_session.js');
78
- };
79
-
80
- module.exports.exploreWebview = function exploreWebview() {
81
- return loadScript('explore_dom.js');
82
- };
83
-
84
- module.exports.exploreControlsWebview = function exploreControlsWebview() {
85
- return loadScript('explore_controls_webview.js');
86
- };
87
-
88
- module.exports.exploreDropdownWebview = function exploreDropdownWebview() {
89
- return loadScript('explore_dropdown_webview.js');
90
- };
91
-
92
- module.exports.inspectCodeWebview = function inspectCodeWebview() {
93
- return loadScript('inspect_code_webview.js');
94
- };
@@ -1,62 +0,0 @@
1
- /**
2
- * CDP Scripts for Kiro
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
8
- function loadScript(name) {
9
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
10
- catch { return null; }
11
- }
12
-
13
-
14
- module.exports.webviewReadChat = function webviewReadChat() { return loadScript('webview_read_chat.js'); };
15
-
16
- module.exports.webviewSendMessage = function webviewSendMessage(text) {
17
- const s = loadScript('webview_send_message.js');
18
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
19
- };
20
-
21
- module.exports.sendMessage = function sendMessage(text) {
22
- const s = loadScript('send_message.js');
23
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
24
- };
25
-
26
- module.exports.resolveAction = function resolveAction(params) {
27
- const action = typeof params === 'string' ? params : params?.action || 'approve';
28
- const buttonText = params?.button || params?.buttonText
29
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
30
- const s = loadScript('resolve_action.js');
31
- return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
32
- };
33
-
34
- module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
35
-
36
- module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
37
-
38
- module.exports.webviewListSessions = function webviewListSessions() { return loadScript('webview_list_sessions.js'); };
39
-
40
- module.exports.webviewNewSession = function webviewNewSession() { return loadScript('webview_new_session.js'); };
41
-
42
- module.exports.webviewSwitchSession = function webviewSwitchSession(sessionId) {
43
- const s = loadScript('webview_switch_session.js');
44
- return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
45
- };
46
-
47
- module.exports.webviewListModels = function webviewListModels() { return loadScript('webview_list_models.js'); };
48
-
49
- module.exports.webviewSetModel = function webviewSetModel(params) {
50
- const model = typeof params === 'string' ? params : params?.model;
51
- const s = loadScript('webview_set_model.js');
52
- return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
53
- };
54
-
55
- module.exports.webviewListModes = function webviewListModes() { return loadScript('webview_list_modes.js'); };
56
-
57
- module.exports.webviewSetMode = function webviewSetMode(params) {
58
- const mode = typeof params === 'string' ? params : params?.mode;
59
- const s = loadScript('webview_set_mode.js');
60
- return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
61
- };
62
-
@@ -1,74 +0,0 @@
1
- /**
2
- * CDP Scripts for PearAI
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
8
- function loadScript(name) {
9
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
10
- catch { return null; }
11
- }
12
-
13
-
14
- module.exports.webviewReadChat = function webviewReadChat() { return loadScript('webview_read_chat.js'); };
15
-
16
- module.exports.webviewSendMessage = function webviewSendMessage(text) {
17
- const s = loadScript('webview_send_message.js');
18
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
19
- };
20
-
21
- module.exports.sendMessage = function sendMessage(text) {
22
- const s = loadScript('send_message.js');
23
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
24
- };
25
-
26
- module.exports.resolveAction = function resolveAction(params) {
27
- const action = typeof params === 'string' ? params : params?.action || 'approve';
28
- const buttonText = params?.button || params?.buttonText
29
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
30
- const s = loadScript('resolve_action.js');
31
- return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
32
- };
33
-
34
- module.exports.webviewResolveAction = function webviewResolveAction(params) {
35
- const action = typeof params === 'string' ? params : params?.action || 'approve';
36
- const buttonText = params?.button || params?.buttonText
37
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
38
- const s = loadScript('webview_resolve_action.js');
39
- return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
40
- };
41
-
42
- module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
43
-
44
- module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
45
-
46
- module.exports.newSession = function newSession() { return loadScript('new_session.js'); };
47
-
48
- module.exports.listSessions = function listSessions() { return loadScript('list_sessions.js'); };
49
-
50
- module.exports.webviewNewSession = function webviewNewSession() { return loadScript('webview_new_session.js'); };
51
-
52
- module.exports.webviewListSessions = function webviewListSessions() { return loadScript('webview_list_sessions.js'); };
53
-
54
- module.exports.webviewSwitchSession = function webviewSwitchSession(sessionId) {
55
- const s = loadScript('webview_switch_session.js');
56
- return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
57
- };
58
-
59
- module.exports.webviewListModels = function webviewListModels() { return loadScript('webview_list_models.js'); };
60
-
61
- module.exports.webviewSetModel = function webviewSetModel(params) {
62
- const model = typeof params === 'string' ? params : params?.model;
63
- const s = loadScript('webview_set_model.js');
64
- return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
65
- };
66
-
67
- module.exports.webviewListModes = function webviewListModes() { return loadScript('webview_list_modes.js'); };
68
-
69
- module.exports.webviewSetMode = function webviewSetMode(params) {
70
- const mode = typeof params === 'string' ? params : params?.mode;
71
- const s = loadScript('webview_set_mode.js');
72
- return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
73
- };
74
-
@@ -1,57 +0,0 @@
1
- /**
2
- * CDP Scripts for Trae
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
8
- function loadScript(name) {
9
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
10
- catch { return null; }
11
- }
12
-
13
-
14
- module.exports.readChat = function readChat() { return loadScript('read_chat.js'); };
15
-
16
- module.exports.sendMessage = function sendMessage(text) {
17
- const s = loadScript('send_message.js');
18
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
19
- };
20
-
21
- module.exports.resolveAction = function resolveAction(params) {
22
- const action = typeof params === 'string' ? params : params?.action || 'approve';
23
- const buttonText = params?.button || params?.buttonText
24
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
25
- const s = loadScript('resolve_action.js');
26
- return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
27
- };
28
-
29
- module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
30
-
31
- module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
32
-
33
- module.exports.newSession = function newSession() { return loadScript('new_session.js'); };
34
-
35
- module.exports.listSessions = function listSessions() { return loadScript('list_chats.js'); };
36
-
37
- module.exports.switchSession = function switchSession(sessionId) {
38
- const s = loadScript('switch_session.js');
39
- return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
40
- };
41
-
42
- module.exports.listModels = function listModels() { return loadScript('list_models.js'); };
43
-
44
- module.exports.setModel = function setModel(params) {
45
- const model = typeof params === 'string' ? params : params?.model;
46
- const s = loadScript('set_model.js');
47
- return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
48
- };
49
-
50
- module.exports.listModes = function listModes() { return loadScript('list_modes.js'); };
51
-
52
- module.exports.setMode = function setMode(params) {
53
- const mode = typeof params === 'string' ? params : params?.mode;
54
- const s = loadScript('set_mode.js');
55
- return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
56
- };
57
-