@adhdev/daemon-core 0.6.10 → 0.6.11
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/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/providers/_builtin/.github/workflows/generate-registry.yml +19 -0
- package/providers/_builtin/cli/claude-cli/provider.json +1 -4
- package/providers/_builtin/extension/cline/scripts/1.0/scripts.js +82 -0
- package/providers/_builtin/extension/roo-code/scripts/1.0/scripts.js +74 -651
- package/providers/_builtin/ide/pearai/provider.json +7 -3
- package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +82 -0
- package/providers/_builtin/ide/trae/provider.json +7 -3
- package/providers/_builtin/ide/trae/scripts/1.0/scripts.js +82 -0
- package/providers/_builtin/ide/vscode/provider.json +6 -0
- package/providers/_builtin/ide/vscode-insiders/provider.json +6 -0
- package/providers/_builtin/ide/vscodium/provider.json +6 -0
- package/providers/_builtin/ide/windsurf/provider.json +7 -5
- package/providers/_builtin/ide/windsurf/scripts/1.0/scripts.js +82 -0
- package/providers/_builtin/registry.json +44 -8
- package/src/boot/daemon-lifecycle.ts +17 -0
- package/src/daemon/scaffold-template.ts +1 -0
package/package.json
CHANGED
|
@@ -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": "
|
|
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" },
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDP Scripts — Router
|
|
3
|
+
*
|
|
4
|
+
* Version routing is handled by ProviderLoader:
|
|
5
|
+
* Pattern:
|
|
6
|
+
* - Scripts WITHOUT params: loaded as-is (self-invoking IIFE)
|
|
7
|
+
* - Scripts WITH params: loaded as function expression, invoked with params JSON
|
|
8
|
+
* e.g. `(${script})(${JSON.stringify(params)})`
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
function load(name) {
|
|
17
|
+
try { return fs.readFileSync(path.join(__dirname, name), 'utf-8'); }
|
|
18
|
+
catch { return null; }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function withParams(name, params) {
|
|
22
|
+
let script = load(name);
|
|
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
|
+
|
|
35
|
+
return `(${script})(${JSON.stringify(params)})`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ─── Core (no params — IIFE) ───
|
|
39
|
+
|
|
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
|
+
};
|
|
52
|
+
module.exports.listSessions = () => load('list_sessions.js');
|
|
53
|
+
module.exports.newSession = () => load('new_session.js');
|
|
54
|
+
module.exports.focusEditor = () => load('focus_editor.js');
|
|
55
|
+
module.exports.openPanel = () => load('open_panel.js');
|
|
56
|
+
module.exports.listModels = () => load('list_models.js');
|
|
57
|
+
module.exports.listModes = () => load('list_modes.js');
|
|
58
|
+
|
|
59
|
+
// ─── With params (function expression) ───
|
|
60
|
+
|
|
61
|
+
module.exports.switchSession = (params) => {
|
|
62
|
+
const index = typeof params === 'number' ? params : params?.index ?? 0;
|
|
63
|
+
const title = typeof params === 'string' ? params : params?.title || null;
|
|
64
|
+
return withParams('switch_session.js', { index, title });
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
module.exports.resolveAction = (params) => {
|
|
68
|
+
const action = typeof params === 'string' ? params : params?.action || 'approve';
|
|
69
|
+
const buttonText = params?.button || params?.buttonText
|
|
70
|
+
|| (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
|
|
71
|
+
return withParams('resolve_action.js', { buttonText, BUTTON_TEXT: buttonText });
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
module.exports.setModel = (params) => {
|
|
75
|
+
const model = typeof params === 'string' ? params : params?.model;
|
|
76
|
+
return withParams('set_model.js', { model });
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
module.exports.setMode = (params) => {
|
|
80
|
+
const mode = typeof params === 'string' ? params : params?.mode;
|
|
81
|
+
return withParams('set_mode.js', { mode });
|
|
82
|
+
};
|