zilmate 1.7.2 → 1.7.5
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/.env.example +36 -36
- package/README.md +503 -503
- package/SDK.md +320 -320
- package/agent-docs.md +276 -276
- package/dist/agents/automation-planner.agent.d.ts.map +1 -1
- package/dist/agents/coding.agent.d.ts +18 -0
- package/dist/agents/coding.agent.d.ts.map +1 -1
- package/dist/agents/finance.agent.d.ts +60 -0
- package/dist/agents/finance.agent.d.ts.map +1 -0
- package/dist/agents/finance.agent.js +30 -0
- package/dist/agents/finance.agent.js.map +1 -0
- package/dist/agents/manager.d.ts +94 -1
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/manager.js +102 -36
- package/dist/agents/manager.js.map +1 -1
- package/dist/agents/swarm/engineering/qa.d.ts +3 -0
- package/dist/agents/swarm/engineering/qa.d.ts.map +1 -0
- package/dist/agents/swarm/engineering/qa.js +19 -0
- package/dist/agents/swarm/engineering/qa.js.map +1 -0
- package/dist/agents/swarm/growth/seo.d.ts +3 -0
- package/dist/agents/swarm/growth/seo.d.ts.map +1 -0
- package/dist/agents/swarm/growth/seo.js +19 -0
- package/dist/agents/swarm/growth/seo.js.map +1 -0
- package/dist/agents/swarm/main.d.ts +22 -0
- package/dist/agents/swarm/main.d.ts.map +1 -0
- package/dist/agents/swarm/main.js +65 -0
- package/dist/agents/swarm/main.js.map +1 -0
- package/dist/agents/swarm/operations/finance.d.ts +3 -0
- package/dist/agents/swarm/operations/finance.d.ts.map +1 -0
- package/dist/agents/swarm/operations/finance.js +19 -0
- package/dist/agents/swarm/operations/finance.js.map +1 -0
- package/dist/agents/swarm/registry.d.ts +4 -0
- package/dist/agents/swarm/registry.d.ts.map +1 -0
- package/dist/agents/swarm/registry.js +361 -0
- package/dist/agents/swarm/registry.js.map +1 -0
- package/dist/cli/composer.d.ts.map +1 -1
- package/dist/cli/composer.js +54 -4
- package/dist/cli/composer.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +13 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +46 -24
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/interactive.d.ts.map +1 -1
- package/dist/cli/interactive.js +47 -3
- package/dist/cli/interactive.js.map +1 -1
- package/dist/cli/render.d.ts.map +1 -1
- package/dist/cli/render.js +18 -9
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/setup.d.ts +1 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +74 -2
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/swarm.d.ts +4 -0
- package/dist/cli/swarm.d.ts.map +1 -0
- package/dist/cli/swarm.js +21 -0
- package/dist/cli/swarm.js.map +1 -0
- package/dist/cli/theme.d.ts +9 -0
- package/dist/cli/theme.d.ts.map +1 -1
- package/dist/cli/theme.js +36 -0
- package/dist/cli/theme.js.map +1 -1
- package/dist/cli/tunnel.d.ts.map +1 -1
- package/dist/cli/tunnel.js +2 -1
- package/dist/cli/tunnel.js.map +1 -1
- package/dist/cli/voice.js +11 -11
- package/dist/cli/welcome.d.ts.map +1 -1
- package/dist/cli/welcome.js +2 -0
- package/dist/cli/welcome.js.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/jobs/anomaly.js +5 -5
- package/dist/memory/heal.js +43 -43
- package/dist/observability/doctor.d.ts +3 -0
- package/dist/observability/doctor.d.ts.map +1 -0
- package/dist/observability/doctor.js +33 -0
- package/dist/observability/doctor.js.map +1 -0
- package/dist/observability/usage.d.ts +13 -0
- package/dist/observability/usage.d.ts.map +1 -0
- package/dist/observability/usage.js +34 -0
- package/dist/observability/usage.js.map +1 -0
- package/dist/runtime/confirm.d.ts.map +1 -1
- package/dist/runtime/confirm.js +12 -2
- package/dist/runtime/confirm.js.map +1 -1
- package/dist/runtime/prompts/builder.d.ts +11 -0
- package/dist/runtime/prompts/builder.d.ts.map +1 -0
- package/dist/runtime/prompts/builder.js +29 -0
- package/dist/runtime/prompts/builder.js.map +1 -0
- package/dist/runtime/registry.d.ts +14 -0
- package/dist/runtime/registry.d.ts.map +1 -0
- package/dist/runtime/registry.js +39 -0
- package/dist/runtime/registry.js.map +1 -0
- package/dist/runtime/storage/interface.d.ts +16 -0
- package/dist/runtime/storage/interface.d.ts.map +1 -0
- package/dist/runtime/storage/interface.js +19 -0
- package/dist/runtime/storage/interface.js.map +1 -0
- package/dist/runtime/storage/local.d.ts +12 -0
- package/dist/runtime/storage/local.d.ts.map +1 -0
- package/dist/runtime/storage/local.js +48 -0
- package/dist/runtime/storage/local.js.map +1 -0
- package/dist/runtime/storage/redis.d.ts +11 -0
- package/dist/runtime/storage/redis.d.ts.map +1 -0
- package/dist/runtime/storage/redis.js +21 -0
- package/dist/runtime/storage/redis.js.map +1 -0
- package/dist/runtime/swarm/reports.d.ts +9 -0
- package/dist/runtime/swarm/reports.d.ts.map +1 -0
- package/dist/runtime/swarm/reports.js +43 -0
- package/dist/runtime/swarm/reports.js.map +1 -0
- package/dist/runtime/swarm.d.ts +37 -0
- package/dist/runtime/swarm.d.ts.map +1 -0
- package/dist/runtime/swarm.js +90 -0
- package/dist/runtime/swarm.js.map +1 -0
- package/dist/runtime/telemetry.d.ts +15 -0
- package/dist/runtime/telemetry.d.ts.map +1 -0
- package/dist/runtime/telemetry.js +25 -0
- package/dist/runtime/telemetry.js.map +1 -0
- package/dist/runtime/tool-utils.d.ts +12 -0
- package/dist/runtime/tool-utils.d.ts.map +1 -0
- package/dist/runtime/tool-utils.js +31 -0
- package/dist/runtime/tool-utils.js.map +1 -0
- package/dist/tools/browser.tool.d.ts +54 -0
- package/dist/tools/browser.tool.d.ts.map +1 -0
- package/dist/tools/browser.tool.js +193 -0
- package/dist/tools/browser.tool.js.map +1 -0
- package/dist/tools/business-apps.tool.d.ts +18 -0
- package/dist/tools/business-apps.tool.d.ts.map +1 -0
- package/dist/tools/business-apps.tool.js +43 -0
- package/dist/tools/business-apps.tool.js.map +1 -0
- package/dist/tools/computer-use.tool.js +66 -66
- package/dist/tools/cross-app-ledger.tool.d.ts +7 -0
- package/dist/tools/cross-app-ledger.tool.d.ts.map +1 -0
- package/dist/tools/cross-app-ledger.tool.js +70 -0
- package/dist/tools/cross-app-ledger.tool.js.map +1 -0
- package/dist/tools/desktop.tool.js +10 -10
- package/dist/tools/documents.tool.js +5 -5
- package/dist/tools/finance.tool.d.ts +18 -0
- package/dist/tools/finance.tool.d.ts.map +1 -0
- package/dist/tools/finance.tool.js +88 -0
- package/dist/tools/finance.tool.js.map +1 -0
- package/dist/tools/image-intelligence.tool.d.ts +12 -0
- package/dist/tools/image-intelligence.tool.d.ts.map +1 -0
- package/dist/tools/image-intelligence.tool.js +62 -0
- package/dist/tools/image-intelligence.tool.js.map +1 -0
- package/dist/tools/notify.tool.js +8 -8
- package/dist/tools/osint-install.tool.js +8 -8
- package/dist/tools/pentest-install.tool.js +6 -6
- package/dist/tools/setup-assistant.tool.d.ts +1 -1
- package/dist/tools/shell.tool.d.ts +18 -0
- package/dist/tools/shell.tool.d.ts.map +1 -1
- package/dist/tools/shell.tool.js +34 -0
- package/dist/tools/shell.tool.js.map +1 -1
- package/dist/tools/triggers.tool.d.ts.map +1 -1
- package/dist/tools/web-intelligence.tool.d.ts +12 -0
- package/dist/tools/web-intelligence.tool.d.ts.map +1 -0
- package/dist/tools/web-intelligence.tool.js +27 -0
- package/dist/tools/web-intelligence.tool.js.map +1 -0
- package/dist/workspace/init.js +18 -18
- package/dist/workspace/output-paths.d.ts +1 -1
- package/dist/workspace/output-paths.d.ts.map +1 -1
- package/dist/workspace/output-paths.js +1 -0
- package/dist/workspace/output-paths.js.map +1 -1
- package/dist/workspace/paths.d.ts +1 -0
- package/dist/workspace/paths.d.ts.map +1 -1
- package/dist/workspace/paths.js +1 -0
- package/dist/workspace/paths.js.map +1 -1
- package/install.ps1 +62 -62
- package/package.json +106 -103
- package/scripts/postinstall.mjs +42 -42
- package/scripts/release-github.mjs +91 -91
- package/src/doc/README.md +49 -49
- package/src/doc/admin-tools-and-sms-campaigns.md +99 -99
- package/src/doc/escalation-checklist.md +97 -97
- package/src/doc/payments-and-payouts.md +82 -82
- package/src/doc/shift-lifecycle-and-disputes.md +95 -95
- package/src/doc/support-macros.md +40 -40
- package/src/doc/venue-support-playbook.md +145 -145
- package/src/doc/verification-and-trust.md +88 -88
- package/src/doc/worker-support-playbook.md +159 -159
|
@@ -82,18 +82,18 @@ export const mouseTool = {
|
|
|
82
82
|
if (!approved)
|
|
83
83
|
throw new Error('Blocked mouse action.');
|
|
84
84
|
emitProgress({ type: 'tool:start', label: `Mouse ${action}`, detail: `(${x}, ${y})` });
|
|
85
|
-
const script = `
|
|
86
|
-
import pyautogui
|
|
87
|
-
import time
|
|
88
|
-
pyautogui.FAILSAFE = True
|
|
89
|
-
pyautogui.PAUSE = 0.05
|
|
90
|
-
|
|
91
|
-
${action === 'move' ? `pyautogui.moveTo(${x}, ${y}, duration=${duration})` : ''}
|
|
92
|
-
${action === 'click' ? `pyautogui.click(${x}, ${y}, duration=${duration})` : ''}
|
|
93
|
-
${action === 'doubleClick' ? `pyautogui.doubleClick(${x}, ${y}, duration=${duration})` : ''}
|
|
94
|
-
${action === 'rightClick' ? `pyautogui.rightClick(${x}, ${y}, duration=${duration})` : ''}
|
|
95
|
-
${action === 'scroll' ? `pyautogui.moveTo(${x}, ${y})\npyautogui.scroll(${scrollDirection === 'down' ? -(scrollAmount ?? 3) : (scrollAmount ?? 3)})` : ''}
|
|
96
|
-
print("done")
|
|
85
|
+
const script = `
|
|
86
|
+
import pyautogui
|
|
87
|
+
import time
|
|
88
|
+
pyautogui.FAILSAFE = True
|
|
89
|
+
pyautogui.PAUSE = 0.05
|
|
90
|
+
|
|
91
|
+
${action === 'move' ? `pyautogui.moveTo(${x}, ${y}, duration=${duration})` : ''}
|
|
92
|
+
${action === 'click' ? `pyautogui.click(${x}, ${y}, duration=${duration})` : ''}
|
|
93
|
+
${action === 'doubleClick' ? `pyautogui.doubleClick(${x}, ${y}, duration=${duration})` : ''}
|
|
94
|
+
${action === 'rightClick' ? `pyautogui.rightClick(${x}, ${y}, duration=${duration})` : ''}
|
|
95
|
+
${action === 'scroll' ? `pyautogui.moveTo(${x}, ${y})\npyautogui.scroll(${scrollDirection === 'down' ? -(scrollAmount ?? 3) : (scrollAmount ?? 3)})` : ''}
|
|
96
|
+
print("done")
|
|
97
97
|
`.trim();
|
|
98
98
|
const out = await runPython(script);
|
|
99
99
|
emitProgress({ type: 'tool:end', label: `Mouse ${action} complete` });
|
|
@@ -129,15 +129,15 @@ export const keyboardTool = {
|
|
|
129
129
|
emitProgress({ type: 'tool:start', label: `Keyboard ${action}` });
|
|
130
130
|
// Escape backslashes and quotes for safe embedding in Python string
|
|
131
131
|
const escapedText = (text ?? '').replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
|
132
|
-
const script = `
|
|
133
|
-
import pyautogui
|
|
134
|
-
pyautogui.FAILSAFE = True
|
|
135
|
-
pyautogui.PAUSE = 0.05
|
|
136
|
-
|
|
137
|
-
${action === 'type' ? `pyautogui.typewrite('${escapedText}', interval=${interval})` : ''}
|
|
138
|
-
${action === 'press' ? `pyautogui.press('${key}')` : ''}
|
|
139
|
-
${action === 'hotkey' ? `pyautogui.hotkey(${hotkey.map((k) => `'${k}'`).join(', ')})` : ''}
|
|
140
|
-
print("done")
|
|
132
|
+
const script = `
|
|
133
|
+
import pyautogui
|
|
134
|
+
pyautogui.FAILSAFE = True
|
|
135
|
+
pyautogui.PAUSE = 0.05
|
|
136
|
+
|
|
137
|
+
${action === 'type' ? `pyautogui.typewrite('${escapedText}', interval=${interval})` : ''}
|
|
138
|
+
${action === 'press' ? `pyautogui.press('${key}')` : ''}
|
|
139
|
+
${action === 'hotkey' ? `pyautogui.hotkey(${hotkey.map((k) => `'${k}'`).join(', ')})` : ''}
|
|
140
|
+
print("done")
|
|
141
141
|
`.trim();
|
|
142
142
|
const out = await runPython(script);
|
|
143
143
|
emitProgress({ type: 'tool:end', label: `Keyboard ${action} complete` });
|
|
@@ -165,11 +165,11 @@ export const screenReadTool = {
|
|
|
165
165
|
const regionArg = region
|
|
166
166
|
? `region=(${region.x}, ${region.y}, ${region.width}, ${region.height})`
|
|
167
167
|
: '';
|
|
168
|
-
const script = `
|
|
169
|
-
import pyautogui
|
|
170
|
-
img = pyautogui.screenshot(${regionArg})
|
|
171
|
-
img.save('${outFile.replace(/\\/g, '\\\\')}')
|
|
172
|
-
print(f"{img.width}x{img.height}")
|
|
168
|
+
const script = `
|
|
169
|
+
import pyautogui
|
|
170
|
+
img = pyautogui.screenshot(${regionArg})
|
|
171
|
+
img.save('${outFile.replace(/\\/g, '\\\\')}')
|
|
172
|
+
print(f"{img.width}x{img.height}")
|
|
173
173
|
`.trim();
|
|
174
174
|
const out = await runPython(script);
|
|
175
175
|
const [w, h] = out.trim().split('x').map(Number);
|
|
@@ -200,28 +200,28 @@ export const windowTool = {
|
|
|
200
200
|
if (!approved)
|
|
201
201
|
throw new Error('Blocked window action.');
|
|
202
202
|
emitProgress({ type: 'tool:start', label: `Window ${action}`, detail: title ?? '' });
|
|
203
|
-
const script = `
|
|
204
|
-
import pygetwindow as gw
|
|
205
|
-
import json
|
|
206
|
-
|
|
207
|
-
${action === 'list' ? `
|
|
208
|
-
wins = gw.getAllWindows()
|
|
209
|
-
print(json.dumps([{"title": w.title, "width": w.width, "height": w.height, "x": w.left, "y": w.top, "visible": w.visible} for w in wins if w.title.strip()]))
|
|
210
|
-
` : ''}
|
|
211
|
-
${action !== 'list' ? `
|
|
212
|
-
wins = gw.getWindowsWithTitle('${title}')
|
|
213
|
-
if not wins:
|
|
214
|
-
print(json.dumps({"error": "Window not found: ${title}"}))
|
|
215
|
-
else:
|
|
216
|
-
w = wins[0]
|
|
217
|
-
${action === 'focus' ? 'w.activate()' : ''}
|
|
218
|
-
${action === 'minimize' ? 'w.minimize()' : ''}
|
|
219
|
-
${action === 'maximize' ? 'w.maximize()' : ''}
|
|
220
|
-
${action === 'close' ? 'w.close()' : ''}
|
|
221
|
-
${action === 'resize' && width && height ? `w.resizeTo(${width}, ${height})` : ''}
|
|
222
|
-
${action === 'resize' && x !== undefined && y !== undefined ? `w.moveTo(${x}, ${y})` : ''}
|
|
223
|
-
print(json.dumps({"title": w.title, "action": "${action}", "done": True}))
|
|
224
|
-
` : ''}
|
|
203
|
+
const script = `
|
|
204
|
+
import pygetwindow as gw
|
|
205
|
+
import json
|
|
206
|
+
|
|
207
|
+
${action === 'list' ? `
|
|
208
|
+
wins = gw.getAllWindows()
|
|
209
|
+
print(json.dumps([{"title": w.title, "width": w.width, "height": w.height, "x": w.left, "y": w.top, "visible": w.visible} for w in wins if w.title.strip()]))
|
|
210
|
+
` : ''}
|
|
211
|
+
${action !== 'list' ? `
|
|
212
|
+
wins = gw.getWindowsWithTitle('${title}')
|
|
213
|
+
if not wins:
|
|
214
|
+
print(json.dumps({"error": "Window not found: ${title}"}))
|
|
215
|
+
else:
|
|
216
|
+
w = wins[0]
|
|
217
|
+
${action === 'focus' ? 'w.activate()' : ''}
|
|
218
|
+
${action === 'minimize' ? 'w.minimize()' : ''}
|
|
219
|
+
${action === 'maximize' ? 'w.maximize()' : ''}
|
|
220
|
+
${action === 'close' ? 'w.close()' : ''}
|
|
221
|
+
${action === 'resize' && width && height ? `w.resizeTo(${width}, ${height})` : ''}
|
|
222
|
+
${action === 'resize' && x !== undefined && y !== undefined ? `w.moveTo(${x}, ${y})` : ''}
|
|
223
|
+
print(json.dumps({"title": w.title, "action": "${action}", "done": True}))
|
|
224
|
+
` : ''}
|
|
225
225
|
`.trim();
|
|
226
226
|
const out = await runPython(script);
|
|
227
227
|
try {
|
|
@@ -258,19 +258,19 @@ export const findElementTool = {
|
|
|
258
258
|
throw new Error('Blocked findOnScreen.');
|
|
259
259
|
emitProgress({ type: 'tool:start', label: 'Locating element on screen' });
|
|
260
260
|
const regionArg = region ? `region=(${region.x}, ${region.y}, ${region.width}, ${region.height})` : '';
|
|
261
|
-
const script = `
|
|
262
|
-
import pyautogui
|
|
263
|
-
import json
|
|
264
|
-
|
|
265
|
-
try:
|
|
266
|
-
loc = pyautogui.locateOnScreen('${referenceImagePath.replace(/\\/g, '\\\\')}', confidence=${confidence}${regionArg ? ', ' + regionArg : ''})
|
|
267
|
-
if loc:
|
|
268
|
-
center = pyautogui.center(loc)
|
|
269
|
-
print(json.dumps({"found": True, "x": center.x, "y": center.y, "box": {"left": loc.left, "top": loc.top, "width": loc.width, "height": loc.height}}))
|
|
270
|
-
else:
|
|
271
|
-
print(json.dumps({"found": False}))
|
|
272
|
-
except Exception as e:
|
|
273
|
-
print(json.dumps({"found": False, "error": str(e)}))
|
|
261
|
+
const script = `
|
|
262
|
+
import pyautogui
|
|
263
|
+
import json
|
|
264
|
+
|
|
265
|
+
try:
|
|
266
|
+
loc = pyautogui.locateOnScreen('${referenceImagePath.replace(/\\/g, '\\\\')}', confidence=${confidence}${regionArg ? ', ' + regionArg : ''})
|
|
267
|
+
if loc:
|
|
268
|
+
center = pyautogui.center(loc)
|
|
269
|
+
print(json.dumps({"found": True, "x": center.x, "y": center.y, "box": {"left": loc.left, "top": loc.top, "width": loc.width, "height": loc.height}}))
|
|
270
|
+
else:
|
|
271
|
+
print(json.dumps({"found": False}))
|
|
272
|
+
except Exception as e:
|
|
273
|
+
print(json.dumps({"found": False, "error": str(e)}))
|
|
274
274
|
`.trim();
|
|
275
275
|
const out = await runPython(script);
|
|
276
276
|
const result = JSON.parse(out.trim());
|
|
@@ -296,11 +296,11 @@ export const dragTool = {
|
|
|
296
296
|
if (!approved)
|
|
297
297
|
throw new Error('Blocked drag action.');
|
|
298
298
|
emitProgress({ type: 'tool:start', label: 'Dragging', detail: `(${fromX},${fromY}) → (${toX},${toY})` });
|
|
299
|
-
const script = `
|
|
300
|
-
import pyautogui
|
|
301
|
-
pyautogui.FAILSAFE = True
|
|
302
|
-
pyautogui.dragTo(${toX}, ${toY}, duration=${duration}, startX=${fromX}, startY=${fromY}, button='${button}')
|
|
303
|
-
print("done")
|
|
299
|
+
const script = `
|
|
300
|
+
import pyautogui
|
|
301
|
+
pyautogui.FAILSAFE = True
|
|
302
|
+
pyautogui.dragTo(${toX}, ${toY}, duration=${duration}, startX=${fromX}, startY=${fromY}, button='${button}')
|
|
303
|
+
print("done")
|
|
304
304
|
`.trim();
|
|
305
305
|
const out = await runPython(script);
|
|
306
306
|
emitProgress({ type: 'tool:end', label: 'Drag complete' });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-app-ledger.tool.d.ts","sourceRoot":"","sources":["../../src/tools/cross-app-ledger.tool.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB;;;;;CA2D/B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { tool } from 'ai';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { emitProgress } from '../runtime/progress.js';
|
|
4
|
+
import { Composio } from '@composio/core';
|
|
5
|
+
import { VercelProvider } from '@composio/vercel';
|
|
6
|
+
import { env } from '../config/env.js';
|
|
7
|
+
import { loadComposioSession } from '../memory/composio-session.js';
|
|
8
|
+
async function getComposioSession(chatSessionId) {
|
|
9
|
+
const composio = new Composio({
|
|
10
|
+
provider: new VercelProvider(),
|
|
11
|
+
apiKey: env.composioApiKey ?? null,
|
|
12
|
+
});
|
|
13
|
+
const saved = await loadComposioSession(chatSessionId);
|
|
14
|
+
if (!saved?.sessionId)
|
|
15
|
+
return null;
|
|
16
|
+
return composio.use(saved.sessionId);
|
|
17
|
+
}
|
|
18
|
+
export const crossAppLedgerTools = {
|
|
19
|
+
correlateBusinessData: tool({
|
|
20
|
+
description: 'Correlate data across Stripe (Revenue), HubSpot (Deals), and GitHub (PRs) to provide a single source of truth for business ROI.',
|
|
21
|
+
inputSchema: z.object({
|
|
22
|
+
query: z.string().describe('The search query to match (e.g., customer email, name, or project keyword).'),
|
|
23
|
+
sessionId: z.string().optional().default('default').describe('The chat session ID to reuse Composio credentials.'),
|
|
24
|
+
}),
|
|
25
|
+
execute: async ({ query, sessionId }) => {
|
|
26
|
+
emitProgress({ type: 'tool:start', label: 'Correlating business data', detail: query });
|
|
27
|
+
const session = await getComposioSession(sessionId);
|
|
28
|
+
if (!session) {
|
|
29
|
+
return { error: 'Composio session not found. Please ensure Composio is setup and a session is active.' };
|
|
30
|
+
}
|
|
31
|
+
const results = {
|
|
32
|
+
query,
|
|
33
|
+
hubspot: null,
|
|
34
|
+
stripe: null,
|
|
35
|
+
github: null,
|
|
36
|
+
summary: '',
|
|
37
|
+
};
|
|
38
|
+
try {
|
|
39
|
+
// 1. Search HubSpot Contacts
|
|
40
|
+
emitProgress({ type: 'step', label: 'Searching HubSpot CRM', detail: query });
|
|
41
|
+
const hubspotResult = await session.execute('HUBSPOT_SEARCH_CONTACTS', { query }).catch(() => null);
|
|
42
|
+
results.hubspot = hubspotResult;
|
|
43
|
+
// 2. Search Stripe Customers
|
|
44
|
+
emitProgress({ type: 'step', label: 'Searching Stripe Payments', detail: query });
|
|
45
|
+
// Stripe query usually needs a field, if it's an email we use email~
|
|
46
|
+
const stripeQuery = query.includes('@') ? `email~'${query}'` : `name~'${query}'`;
|
|
47
|
+
const stripeResult = await session.execute('STRIPE_SEARCH_CUSTOMERS', { query: stripeQuery }).catch(() => null);
|
|
48
|
+
results.stripe = stripeResult;
|
|
49
|
+
// 3. Search GitHub Issues/PRs
|
|
50
|
+
emitProgress({ type: 'step', label: 'Searching GitHub Engineering', detail: query });
|
|
51
|
+
const githubResult = await session.execute('GITHUB_SEARCH_ISSUES_AND_PULL_REQUESTS', { q: query }).catch(() => null);
|
|
52
|
+
results.github = githubResult;
|
|
53
|
+
// Aggregate Summary
|
|
54
|
+
const contact = hubspotResult?.data?.[0] || {};
|
|
55
|
+
const customer = stripeResult?.data?.[0] || {};
|
|
56
|
+
const prs = githubResult?.data?.total_count || 0;
|
|
57
|
+
const name = contact.firstname || 'unknown';
|
|
58
|
+
const customerId = customer.id || 'none';
|
|
59
|
+
results.summary = `Found ${name} in HubSpot, linked to Stripe customer ${customerId}. Engineering activity: ${prs} related issues/PRs found.`;
|
|
60
|
+
emitProgress({ type: 'tool:end', label: 'Correlation complete' });
|
|
61
|
+
return results;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
emitProgress({ type: 'tool:error', label: 'Correlation failed', detail: String(error) });
|
|
65
|
+
return { ...results, error: String(error) };
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=cross-app-ledger.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-app-ledger.tool.js","sourceRoot":"","sources":["../../src/tools/cross-app-ledger.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,KAAK,UAAU,kBAAkB,CAAC,aAAqB;IACrD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC;QAC5B,QAAQ,EAAE,IAAI,cAAc,EAAE;QAC9B,MAAM,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI;KACnC,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACvD,IAAI,CAAC,KAAK,EAAE,SAAS;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,QAAQ,CAAC,GAAG,CAAC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,OAAO,GAAG,SAAS,IAAI,0CAA0C,UAAU,2BAA2B,GAAG,4BAA4B,CAAC;gBAE9I,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC;gBAClE,OAAO,OAAO,CAAC;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACzF,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9C,CAAC;QACH,CAAC;KACF,CAAC;CACH,CAAC"}
|
|
@@ -112,16 +112,16 @@ async function captureScreenshot() {
|
|
|
112
112
|
await mkdir(screenshotDir, { recursive: true });
|
|
113
113
|
const target = path.join(screenshotDir, `zilmate-screen-${Date.now()}.png`);
|
|
114
114
|
if (process.platform === 'win32') {
|
|
115
|
-
const script = `
|
|
116
|
-
Add-Type -AssemblyName System.Windows.Forms
|
|
117
|
-
Add-Type -AssemblyName System.Drawing
|
|
118
|
-
$bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds
|
|
119
|
-
$bitmap = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height
|
|
120
|
-
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
|
|
121
|
-
$graphics.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size)
|
|
122
|
-
$bitmap.Save('${safeShellText(target)}', [System.Drawing.Imaging.ImageFormat]::Png)
|
|
123
|
-
$graphics.Dispose()
|
|
124
|
-
$bitmap.Dispose()
|
|
115
|
+
const script = `
|
|
116
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
117
|
+
Add-Type -AssemblyName System.Drawing
|
|
118
|
+
$bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds
|
|
119
|
+
$bitmap = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height
|
|
120
|
+
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
|
|
121
|
+
$graphics.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size)
|
|
122
|
+
$bitmap.Save('${safeShellText(target)}', [System.Drawing.Imaging.ImageFormat]::Png)
|
|
123
|
+
$graphics.Dispose()
|
|
124
|
+
$bitmap.Dispose()
|
|
125
125
|
`;
|
|
126
126
|
await execFileAsync('powershell.exe', ['-NoProfile', '-Command', script], { windowsHide: true, timeout: 20_000 });
|
|
127
127
|
return target;
|
|
@@ -8,11 +8,11 @@ import { generateSlideDeck } from '../documents/slides.js';
|
|
|
8
8
|
async function expandContent(kind, title, content, audience) {
|
|
9
9
|
const result = await generateText({
|
|
10
10
|
model: models.manager,
|
|
11
|
-
prompt: `Create ${kind === 'slides' ? 'a slide deck' : 'a document'} titled "${title}".
|
|
12
|
-
Audience: ${audience || 'general'}
|
|
13
|
-
Source notes:
|
|
14
|
-
${content}
|
|
15
|
-
|
|
11
|
+
prompt: `Create ${kind === 'slides' ? 'a slide deck' : 'a document'} titled "${title}".
|
|
12
|
+
Audience: ${audience || 'general'}
|
|
13
|
+
Source notes:
|
|
14
|
+
${content}
|
|
15
|
+
|
|
16
16
|
${kind === 'slides'
|
|
17
17
|
? 'Return markdown with slides separated by --- lines. Each slide: # title then bullet points. 6-12 slides.'
|
|
18
18
|
: 'Return polished markdown with # title, ## sections, paragraphs, and bullet lists.'}`,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const financeTools: {
|
|
2
|
+
getTickerQuote: import("ai").Tool<{
|
|
3
|
+
symbol: string;
|
|
4
|
+
}, any>;
|
|
5
|
+
getHistoricalData: import("ai").Tool<{
|
|
6
|
+
symbol: string;
|
|
7
|
+
period1: string;
|
|
8
|
+
interval: "1d" | "1wk" | "1mo";
|
|
9
|
+
period2?: string | undefined;
|
|
10
|
+
}, any>;
|
|
11
|
+
searchCompany: import("ai").Tool<{
|
|
12
|
+
query: string;
|
|
13
|
+
}, any>;
|
|
14
|
+
getTickerSummary: import("ai").Tool<{
|
|
15
|
+
symbol: string;
|
|
16
|
+
}, any>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=finance.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finance.tool.d.ts","sourceRoot":"","sources":["../../src/tools/finance.tool.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAiFxB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { tool } from 'ai';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import yahooFinance from 'yahoo-finance2';
|
|
4
|
+
import { emitProgress } from '../runtime/progress.js';
|
|
5
|
+
export const financeTools = {
|
|
6
|
+
getTickerQuote: tool({
|
|
7
|
+
description: 'Get live stock/crypto ticker quotes, price, change, and market cap using Yahoo Finance.',
|
|
8
|
+
inputSchema: z.object({
|
|
9
|
+
symbol: z.string().describe('Ticker symbol, e.g. AAPL, BTC-USD, TSLA.'),
|
|
10
|
+
}),
|
|
11
|
+
execute: async ({ symbol }) => {
|
|
12
|
+
emitProgress({ type: 'tool:start', label: 'Fetching ticker quote', detail: symbol });
|
|
13
|
+
try {
|
|
14
|
+
const quote = await yahooFinance.quote(symbol);
|
|
15
|
+
emitProgress({ type: 'tool:end', label: 'Ticker quote retrieved' });
|
|
16
|
+
return quote;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
emitProgress({ type: 'tool:error', label: 'Ticker quote failed', detail: String(error) });
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
getHistoricalData: tool({
|
|
25
|
+
description: 'Get historical price data for a ticker over a period (daily, weekly, monthly).',
|
|
26
|
+
inputSchema: z.object({
|
|
27
|
+
symbol: z.string().describe('Ticker symbol.'),
|
|
28
|
+
period1: z.string().describe('Start date (YYYY-MM-DD).'),
|
|
29
|
+
period2: z.string().optional().describe('End date (YYYY-MM-DD), default is today.'),
|
|
30
|
+
interval: z.enum(['1d', '1wk', '1mo']).optional().default('1d'),
|
|
31
|
+
}),
|
|
32
|
+
execute: async ({ symbol, period1, period2, interval }) => {
|
|
33
|
+
emitProgress({ type: 'tool:start', label: 'Fetching historical data', detail: symbol });
|
|
34
|
+
try {
|
|
35
|
+
const history = await yahooFinance.historical(symbol, {
|
|
36
|
+
period1,
|
|
37
|
+
period2: period2 || new Date().toISOString().split('T')[0],
|
|
38
|
+
interval: interval,
|
|
39
|
+
});
|
|
40
|
+
emitProgress({ type: 'tool:end', label: 'Historical data retrieved' });
|
|
41
|
+
return history;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
emitProgress({ type: 'tool:error', label: 'Historical data failed', detail: String(error) });
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
searchCompany: tool({
|
|
50
|
+
description: 'Search for ticker symbols and company information on Yahoo Finance.',
|
|
51
|
+
inputSchema: z.object({
|
|
52
|
+
query: z.string().describe('Company name or search term.'),
|
|
53
|
+
}),
|
|
54
|
+
execute: async ({ query }) => {
|
|
55
|
+
emitProgress({ type: 'tool:start', label: 'Searching company', detail: query });
|
|
56
|
+
try {
|
|
57
|
+
const result = await yahooFinance.search(query);
|
|
58
|
+
emitProgress({ type: 'tool:end', label: 'Company search complete' });
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
emitProgress({ type: 'tool:error', label: 'Company search failed', detail: String(error) });
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
getTickerSummary: tool({
|
|
68
|
+
description: 'Get a comprehensive summary of a ticker including fundamentals, asset profile, and price history.',
|
|
69
|
+
inputSchema: z.object({
|
|
70
|
+
symbol: z.string().describe('Ticker symbol.'),
|
|
71
|
+
}),
|
|
72
|
+
execute: async ({ symbol }) => {
|
|
73
|
+
emitProgress({ type: 'tool:start', label: 'Fetching ticker summary', detail: symbol });
|
|
74
|
+
try {
|
|
75
|
+
const summary = await yahooFinance.quoteSummary(symbol, {
|
|
76
|
+
modules: ['price', 'summaryDetail', 'assetProfile', 'financialData'],
|
|
77
|
+
});
|
|
78
|
+
emitProgress({ type: 'tool:end', label: 'Ticker summary retrieved' });
|
|
79
|
+
return summary;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
emitProgress({ type: 'tool:error', label: 'Ticker summary failed', detail: String(error) });
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=finance.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finance.tool.js","sourceRoot":"","sources":["../../src/tools/finance.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,cAAc,EAAE,IAAI,CAAC;QACnB,WAAW,EAAE,yFAAyF;QACtG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;SACxE,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAC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CAAC,CAAC;gBAC5F,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;IAEF,gBAAgB,EAAE,IAAI,CAAC;QACrB,WAAW,EAAE,mGAAmG;QAChH,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;SAC9C,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YACvF,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE;oBACtD,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,CAAC;iBACrE,CAAC,CAAC;gBACH,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;gBACtE,OAAO,OAAc,CAAC;YACxB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC5F,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const imageIntelligenceTools: {
|
|
2
|
+
removeBackground: import("ai").Tool<{
|
|
3
|
+
imagePath: string;
|
|
4
|
+
outputFileName?: string | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
inputPath: string;
|
|
7
|
+
outputPath: string;
|
|
8
|
+
format: string;
|
|
9
|
+
status: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=image-intelligence.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/tools/image-intelligence.tool.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,sBAAsB;;;;;;;;;;CA4BlC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { writeFile, mkdir } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { tool } from 'ai';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { emitProgress } from '../runtime/progress.js';
|
|
8
|
+
import { getOutputDir } from '../workspace/output-paths.js';
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
const execFileAsync = promisify(execFile);
|
|
11
|
+
const outputDir = getOutputDir('images');
|
|
12
|
+
async function runRembg(inputPath, outputPath) {
|
|
13
|
+
const pyScript = `
|
|
14
|
+
from rembg import remove
|
|
15
|
+
from PIL import Image
|
|
16
|
+
import os
|
|
17
|
+
|
|
18
|
+
input_path = '${inputPath.replace(/\\/g, '\\\\')}'
|
|
19
|
+
output_path = '${outputPath.replace(/\\/g, '\\\\')}'
|
|
20
|
+
|
|
21
|
+
with open(input_path, 'rb') as i:
|
|
22
|
+
input_data = i.read()
|
|
23
|
+
output_data = remove(input_data)
|
|
24
|
+
with open(output_path, 'wb') as o:
|
|
25
|
+
o.write(output_data)
|
|
26
|
+
`.trim();
|
|
27
|
+
const tempScriptPath = path.join(outputDir, `rembg-${Date.now()}.py`);
|
|
28
|
+
await writeFile(tempScriptPath, pyScript, 'utf8');
|
|
29
|
+
try {
|
|
30
|
+
const py = process.platform === 'win32' ? 'python' : 'python3';
|
|
31
|
+
await execFileAsync(py, [tempScriptPath], { timeout: 60000 });
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
// Note: In production we might want to keep logs or cleanup
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const imageIntelligenceTools = {
|
|
38
|
+
removeBackground: tool({
|
|
39
|
+
description: 'Remove the background from an image using professional-grade AI (rembg). Supports local files and returns a transparent PNG.',
|
|
40
|
+
inputSchema: z.object({
|
|
41
|
+
imagePath: z.string().describe('Absolute path to the input image file (JPG, PNG, etc.).'),
|
|
42
|
+
outputFileName: z.string().optional().describe('Optional custom name for the output file (without extension).'),
|
|
43
|
+
}),
|
|
44
|
+
execute: async ({ imagePath, outputFileName }) => {
|
|
45
|
+
if (!existsSync(imagePath))
|
|
46
|
+
throw new Error(`Input image not found: ${imagePath}`);
|
|
47
|
+
emitProgress({ type: 'tool:start', label: 'Removing background', detail: imagePath });
|
|
48
|
+
await mkdir(outputDir, { recursive: true });
|
|
49
|
+
const name = outputFileName || `nobg-${path.basename(imagePath, path.extname(imagePath))}`;
|
|
50
|
+
const outputPath = path.join(outputDir, `${name}-${Date.now()}.png`);
|
|
51
|
+
await runRembg(imagePath, outputPath);
|
|
52
|
+
emitProgress({ type: 'tool:end', label: 'Background removed', detail: outputPath });
|
|
53
|
+
return {
|
|
54
|
+
inputPath: imagePath,
|
|
55
|
+
outputPath,
|
|
56
|
+
format: 'transparent-png',
|
|
57
|
+
status: 'success'
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=image-intelligence.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-intelligence.tool.js","sourceRoot":"","sources":["../../src/tools/image-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,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,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;YACzF,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;SAChH,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE;YAC/C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,SAAS,EAAE,CAAC,CAAC;YAEnF,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;YAEtF,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5C,MAAM,IAAI,GAAG,cAAc,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAC3F,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAErE,MAAM,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAEtC,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;YAEpF,OAAO;gBACL,SAAS,EAAE,SAAS;gBACpB,UAAU;gBACV,MAAM,EAAE,iBAAiB;gBACzB,MAAM,EAAE,SAAS;aAClB,CAAC;QACJ,CAAC;KACF,CAAC;CACH,CAAC"}
|
|
@@ -8,14 +8,14 @@ async function sendDesktopNotification(title, message, urgency = 'normal') {
|
|
|
8
8
|
const safeTitle = title.slice(0, 120);
|
|
9
9
|
const safeMessage = message.slice(0, 500);
|
|
10
10
|
if (process.platform === 'win32') {
|
|
11
|
-
const script = `
|
|
12
|
-
Add-Type -AssemblyName System.Windows.Forms
|
|
13
|
-
$notify = New-Object System.Windows.Forms.NotifyIcon
|
|
14
|
-
$notify.Icon = [System.Drawing.SystemIcons]::Information
|
|
15
|
-
$notify.Visible = $true
|
|
16
|
-
$notify.ShowBalloonTip(8000, '${safeTitle.replace(/'/g, "''")}', '${safeMessage.replace(/'/g, "''")}', [System.Windows.Forms.ToolTipIcon]::Info)
|
|
17
|
-
Start-Sleep -Seconds 2
|
|
18
|
-
$notify.Dispose()
|
|
11
|
+
const script = `
|
|
12
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
13
|
+
$notify = New-Object System.Windows.Forms.NotifyIcon
|
|
14
|
+
$notify.Icon = [System.Drawing.SystemIcons]::Information
|
|
15
|
+
$notify.Visible = $true
|
|
16
|
+
$notify.ShowBalloonTip(8000, '${safeTitle.replace(/'/g, "''")}', '${safeMessage.replace(/'/g, "''")}', [System.Windows.Forms.ToolTipIcon]::Info)
|
|
17
|
+
Start-Sleep -Seconds 2
|
|
18
|
+
$notify.Dispose()
|
|
19
19
|
`.trim();
|
|
20
20
|
await execFileAsync('powershell.exe', ['-NoProfile', '-Command', script], { windowsHide: true, timeout: 15_000 });
|
|
21
21
|
return { platform: 'windows', delivered: true };
|
|
@@ -146,14 +146,14 @@ const OSINT_TOOLS = [
|
|
|
146
146
|
return runInstallCommand('powershell.exe', [
|
|
147
147
|
'-NoProfile',
|
|
148
148
|
'-Command',
|
|
149
|
-
`
|
|
150
|
-
$dir = "$env:USERPROFILE\\bin"
|
|
151
|
-
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
|
152
|
-
$url = "https://github.com/sundowndev/phoneinfoga/releases/latest/download/phoneinfoga_Windows_x86_64.zip"
|
|
153
|
-
$zip = "$env:TEMP\\phoneinfoga.zip"
|
|
154
|
-
Invoke-WebRequest -Uri $url -OutFile $zip
|
|
155
|
-
Expand-Archive -Path $zip -DestinationPath $dir -Force
|
|
156
|
-
Write-Output "PhoneInfoga extracted to $dir — ensure $dir is on your PATH"
|
|
149
|
+
`
|
|
150
|
+
$dir = "$env:USERPROFILE\\bin"
|
|
151
|
+
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
|
152
|
+
$url = "https://github.com/sundowndev/phoneinfoga/releases/latest/download/phoneinfoga_Windows_x86_64.zip"
|
|
153
|
+
$zip = "$env:TEMP\\phoneinfoga.zip"
|
|
154
|
+
Invoke-WebRequest -Uri $url -OutFile $zip
|
|
155
|
+
Expand-Archive -Path $zip -DestinationPath $dir -Force
|
|
156
|
+
Write-Output "PhoneInfoga extracted to $dir — ensure $dir is on your PATH"
|
|
157
157
|
`.trim(),
|
|
158
158
|
]);
|
|
159
159
|
}
|
|
@@ -65,12 +65,12 @@ const PENTEST_TOOLS = [
|
|
|
65
65
|
return runInstall('go', ['install', '-v', 'github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest']);
|
|
66
66
|
}
|
|
67
67
|
if (IS_WIN) {
|
|
68
|
-
return runInstall('powershell.exe', ['-NoProfile', '-Command', `
|
|
69
|
-
$dir = "$env:USERPROFILE\\bin"
|
|
70
|
-
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
|
71
|
-
Invoke-WebRequest -Uri "https://github.com/projectdiscovery/nuclei/releases/latest/download/nuclei_windows_amd64.zip" -OutFile "$env:TEMP\\nuclei.zip"
|
|
72
|
-
Expand-Archive -Path "$env:TEMP\\nuclei.zip" -DestinationPath $dir -Force
|
|
73
|
-
Write-Output "nuclei extracted to $dir"
|
|
68
|
+
return runInstall('powershell.exe', ['-NoProfile', '-Command', `
|
|
69
|
+
$dir = "$env:USERPROFILE\\bin"
|
|
70
|
+
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
|
71
|
+
Invoke-WebRequest -Uri "https://github.com/projectdiscovery/nuclei/releases/latest/download/nuclei_windows_amd64.zip" -OutFile "$env:TEMP\\nuclei.zip"
|
|
72
|
+
Expand-Archive -Path "$env:TEMP\\nuclei.zip" -DestinationPath $dir -Force
|
|
73
|
+
Write-Output "nuclei extracted to $dir"
|
|
74
74
|
`.trim()]);
|
|
75
75
|
}
|
|
76
76
|
return 'Install Go or download nuclei from https://github.com/projectdiscovery/nuclei/releases';
|
|
@@ -24,7 +24,7 @@ export declare const setupAssistantTools: {
|
|
|
24
24
|
secureSetupHint: string;
|
|
25
25
|
}>;
|
|
26
26
|
launchSecureSetup: import("ai").Tool<{
|
|
27
|
-
section?: "gateway" | "redis" | "jobs" | "all" | "
|
|
27
|
+
section?: "gateway" | "redis" | "jobs" | "all" | "tavily" | "composio" | "qstash" | "voice" | "workspace" | undefined;
|
|
28
28
|
}, {
|
|
29
29
|
instruction: string;
|
|
30
30
|
command: string;
|
|
@@ -11,6 +11,24 @@ export declare const shellTools: {
|
|
|
11
11
|
stderr: any;
|
|
12
12
|
command: string;
|
|
13
13
|
}>;
|
|
14
|
+
executeAndSelfHeal: import("ai").Tool<{
|
|
15
|
+
command: string;
|
|
16
|
+
context?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
success: boolean;
|
|
19
|
+
stdout: string;
|
|
20
|
+
command: string;
|
|
21
|
+
error?: never;
|
|
22
|
+
diagnosisHint?: never;
|
|
23
|
+
context?: never;
|
|
24
|
+
} | {
|
|
25
|
+
success: boolean;
|
|
26
|
+
command: string;
|
|
27
|
+
error: any;
|
|
28
|
+
diagnosisHint: string;
|
|
29
|
+
context: string;
|
|
30
|
+
stdout?: never;
|
|
31
|
+
}>;
|
|
14
32
|
installDependencies: import("ai").Tool<{
|
|
15
33
|
command: string;
|
|
16
34
|
manager?: "npm" | "pnpm" | "yarn" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.tool.d.ts","sourceRoot":"","sources":["../../src/tools/shell.tool.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"shell.tool.d.ts","sourceRoot":"","sources":["../../src/tools/shell.tool.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8YtB,CAAC"}
|