@adhdev/daemon-core 0.6.10 → 0.6.12

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 (74) hide show
  1. package/dist/index.js +16 -0
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/providers/_builtin/.github/workflows/generate-registry.yml +19 -0
  5. package/providers/_builtin/cli/claude-cli/provider.json +1 -4
  6. package/providers/_builtin/{ide/cursor/scripts/0.49 → extension/cline/scripts/1.0}/scripts.js +27 -23
  7. package/providers/_builtin/extension/roo-code/scripts/1.0/scripts.js +74 -651
  8. package/providers/_builtin/ide/antigravity/provider.json +2 -3
  9. package/providers/_builtin/ide/cursor/provider.json +2 -2
  10. package/providers/_builtin/ide/pearai/provider.json +7 -3
  11. package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +82 -0
  12. package/providers/_builtin/ide/trae/provider.json +7 -3
  13. package/providers/_builtin/ide/trae/scripts/1.0/scripts.js +82 -0
  14. package/providers/_builtin/ide/vscode/provider.json +6 -0
  15. package/providers/_builtin/ide/vscode-insiders/provider.json +6 -0
  16. package/providers/_builtin/ide/vscodium/provider.json +6 -0
  17. package/providers/_builtin/ide/windsurf/provider.json +7 -5
  18. package/providers/_builtin/ide/windsurf/scripts/1.0/scripts.js +82 -0
  19. package/providers/_builtin/registry.json +44 -8
  20. package/src/boot/daemon-lifecycle.ts +19 -0
  21. package/src/daemon/scaffold-template.ts +1 -0
  22. package/providers/_builtin/ide/antigravity/scripts/1.106/list_models.js +0 -38
  23. package/providers/_builtin/ide/antigravity/scripts/1.106/list_modes.js +0 -48
  24. package/providers/_builtin/ide/antigravity/scripts/1.106/read_chat.js +0 -290
  25. package/providers/_builtin/ide/antigravity/scripts/1.106/scripts.js +0 -57
  26. package/providers/_builtin/ide/antigravity/scripts/1.106/set_mode.js +0 -34
  27. package/providers/_builtin/ide/antigravity/scripts/1.106/set_model.js +0 -47
  28. package/providers/_builtin/ide/antigravity/scripts/1.107/focus_editor.js +0 -20
  29. package/providers/_builtin/ide/antigravity/scripts/1.107/list_chats.js +0 -137
  30. package/providers/_builtin/ide/antigravity/scripts/1.107/new_session.js +0 -75
  31. package/providers/_builtin/ide/antigravity/scripts/1.107/resolve_action.js +0 -63
  32. package/providers/_builtin/ide/antigravity/scripts/1.107/send_message.js +0 -56
  33. package/providers/_builtin/ide/antigravity/scripts/1.107/switch_session.js +0 -114
  34. package/providers/_builtin/ide/cursor/scripts/0.49/dismiss_notification.js +0 -30
  35. package/providers/_builtin/ide/cursor/scripts/0.49/focus_editor.js +0 -13
  36. package/providers/_builtin/ide/cursor/scripts/0.49/list_models.js +0 -78
  37. package/providers/_builtin/ide/cursor/scripts/0.49/list_modes.js +0 -40
  38. package/providers/_builtin/ide/cursor/scripts/0.49/list_notifications.js +0 -23
  39. package/providers/_builtin/ide/cursor/scripts/0.49/new_session.js +0 -20
  40. package/providers/_builtin/ide/cursor/scripts/0.49/open_panel.js +0 -23
  41. package/providers/_builtin/ide/cursor/scripts/0.49/resolve_action.js +0 -19
  42. package/providers/_builtin/ide/cursor/scripts/0.49/send_message.js +0 -23
  43. package/providers/_builtin/ide/cursor/scripts/0.49/set_mode.js +0 -38
  44. package/providers/_builtin/ide/cursor/scripts/0.49/set_model.js +0 -81
  45. package/providers/_builtin/ide/cursor/scripts/0.49/switch_session.js +0 -28
  46. package/providers/_builtin/ide/cursor/scripts/0.49.bak/list_sessions.js +0 -42
  47. package/providers/_builtin/ide/cursor/scripts/0.49.bak/read_chat.js +0 -79
  48. /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/focus_editor.js +0 -0
  49. /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/list_chats.js +0 -0
  50. /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/list_models.js +0 -0
  51. /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/list_modes.js +0 -0
  52. /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/new_session.js +0 -0
  53. /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/read_chat.js +0 -0
  54. /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/resolve_action.js +0 -0
  55. /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/scripts.js +0 -0
  56. /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/send_message.js +0 -0
  57. /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/set_mode.js +0 -0
  58. /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/set_model.js +0 -0
  59. /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/switch_session.js +0 -0
  60. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/dismiss_notification.js +0 -0
  61. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/focus_editor.js +0 -0
  62. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/list_models.js +0 -0
  63. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/list_modes.js +0 -0
  64. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/list_notifications.js +0 -0
  65. /package/providers/_builtin/ide/cursor/scripts/{0.49 → 1.0}/list_sessions.js +0 -0
  66. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/new_session.js +0 -0
  67. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/open_panel.js +0 -0
  68. /package/providers/_builtin/ide/cursor/scripts/{0.49 → 1.0}/read_chat.js +0 -0
  69. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/resolve_action.js +0 -0
  70. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/scripts.js +0 -0
  71. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/send_message.js +0 -0
  72. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/set_mode.js +0 -0
  73. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/set_model.js +0 -0
  74. /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/switch_session.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,3 +55,22 @@ jobs:
55
55
  git add registry.json
56
56
  git diff --cached --quiet || git commit -m "chore: auto-generate registry.json"
57
57
  git push
58
+
59
+ - name: Update submodule pointer in parent repo (adhdev-cloud)
60
+ env:
61
+ PAT: ${{ secrets.PARENT_REPO_PAT }}
62
+ run: |
63
+ SUBMODULE_SHA=$(git rev-parse HEAD)
64
+ git clone --depth=1 https://x-access-token:${PAT}@github.com/vilmire/adhdev-cloud.git /tmp/adhdev-cloud
65
+ cd /tmp/adhdev-cloud
66
+ git config user.name "github-actions[bot]"
67
+ git config user.email "github-actions[bot]@users.noreply.github.com"
68
+ git submodule update --init packages/daemon-core/providers/_builtin
69
+ cd packages/daemon-core/providers/_builtin
70
+ git fetch origin main
71
+ git checkout main
72
+ git reset --hard ${SUBMODULE_SHA}
73
+ cd /tmp/adhdev-cloud
74
+ git add packages/daemon-core/providers/_builtin
75
+ git diff --cached --quiet || git commit -m "chore: sync _builtin providers submodule [skip ci]"
76
+ git push
@@ -87,11 +87,8 @@
87
87
  { "source": "\\(y/n\\)", "flags": "i" },
88
88
  { "source": "\\[Y/n\\]", "flags": "i" },
89
89
  { "source": "Run\\s+\\w+\\s+command", "flags": "i" },
90
- { "source": "Allow\\s*tool", "flags": "i" },
91
90
  { "source": "Yes,?\\s*don'?t\\s*ask", "flags": "i" },
92
- { "source": "Deny", "flags": "i" },
93
- { "source": "Do you want to proceed", "flags": "i" },
94
- { "source": "Esc to cancel", "flags": "i" }
91
+ { "source": "\\bDeny\\b", "flags": "i" }
95
92
  ],
96
93
  "ready": [
97
94
  { "source": "for\\s*shortcuts", "flags": "i" },
@@ -1,11 +1,7 @@
1
1
  /**
2
- * Cursor CDP Scripts — Router
2
+ * CDP Scripts — Router
3
3
  *
4
4
  * Version routing is handled by ProviderLoader:
5
- * - provider.json "compatibility" field declares script directory overrides
6
- * - VersionArchive detects installed Cursor version at daemon startup
7
- * - resolve() picks the appropriate scripts/ directory
8
- *
9
5
  * Pattern:
10
6
  * - Scripts WITHOUT params: loaded as-is (self-invoking IIFE)
11
7
  * - Scripts WITH params: loaded as function expression, invoked with params JSON
@@ -22,17 +18,37 @@ function load(name) {
22
18
  catch { return null; }
23
19
  }
24
20
 
25
- /** Wrap a function-expression script with params invocation */
26
21
  function withParams(name, params) {
27
- const script = load(name);
22
+ let script = load(name);
28
23
  if (!script) return null;
24
+
25
+ // For legacy scripts checking MESSAGE, interpolate them manually
26
+ if (script.includes('${ MESSAGE }')) {
27
+ const msg = params?.MESSAGE || params?.text || '';
28
+ return script.replace(/\$\{ MESSAGE \}/g, JSON.stringify(msg));
29
+ }
30
+ if (script.includes('${ BUTTON_TEXT }')) {
31
+ const btn = params?.BUTTON_TEXT || params?.buttonText || '';
32
+ return script.replace(/\$\{ BUTTON_TEXT \}/g, JSON.stringify(btn));
33
+ }
34
+
29
35
  return `(${script})(${JSON.stringify(params)})`;
30
36
  }
31
37
 
32
38
  // ─── Core (no params — IIFE) ───
33
39
 
34
- module.exports.readChat = () => load('read_chat.js');
35
- module.exports.sendMessage = () => load('send_message.js');
40
+ module.exports.readChat = () => load('read_chat.js') || load('webview_read_chat.js');
41
+ module.exports.sendMessage = (params) => {
42
+ let s = load('send_message.js');
43
+ if (!s) s = load('webview_send_message.js');
44
+ if (!s) return null;
45
+ // Legacy template substitution fallback
46
+ if (s.includes('${ MESSAGE }')) {
47
+ const msg = params?.MESSAGE || params?.text || params || '';
48
+ return s.replace(/\$\{ MESSAGE \}/g, JSON.stringify(msg));
49
+ }
50
+ return withParams('send_message.js', params) || withParams('webview_send_message.js', params);
51
+ };
36
52
  module.exports.listSessions = () => load('list_sessions.js');
37
53
  module.exports.newSession = () => load('new_session.js');
38
54
  module.exports.focusEditor = () => load('focus_editor.js');
@@ -51,20 +67,8 @@ module.exports.switchSession = (params) => {
51
67
  module.exports.resolveAction = (params) => {
52
68
  const action = typeof params === 'string' ? params : params?.action || 'approve';
53
69
  const buttonText = params?.button || params?.buttonText
54
- || (action === 'approve' ? 'Run' : action === 'reject' ? 'Skip' : action);
55
- return withParams('resolve_action.js', { buttonText });
56
- };
57
-
58
- module.exports.listNotifications = (params) => {
59
- const filter = typeof params === 'string' ? params : params?.message || null;
60
- return withParams('list_notifications.js', { filter });
61
- };
62
-
63
- module.exports.dismissNotification = (params) => {
64
- const index = typeof params === 'number' ? params : params?.index ?? 0;
65
- const button = typeof params === 'string' ? params : params?.button || null;
66
- const message = params?.message || null;
67
- return withParams('dismiss_notification.js', { index, button, message });
70
+ || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
71
+ return withParams('resolve_action.js', { buttonText, BUTTON_TEXT: buttonText });
68
72
  };
69
73
 
70
74
  module.exports.setModel = (params) => {