@elizaos/plugin-dummy-services 1.6.5 → 1.7.0-beta.0
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/browser/service.d.ts.map +1 -1
- package/dist/e2e/scenarios.d.ts.map +1 -1
- package/dist/e2e/test-utils.d.ts.map +1 -1
- package/dist/email/service.d.ts.map +1 -1
- package/dist/index.js +104 -104
- package/dist/index.js.map +13 -13
- package/dist/lp/service.d.ts +6 -6
- package/dist/lp/service.d.ts.map +1 -1
- package/dist/pdf/service.d.ts.map +1 -1
- package/dist/tokenData/service.d.ts +2 -2
- package/dist/tokenData/service.d.ts.map +1 -1
- package/dist/transcription/service.d.ts.map +1 -1
- package/dist/video/service.d.ts.map +1 -1
- package/dist/web-search/service.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -16,10 +16,10 @@ class DummyTokenDataService extends Service {
|
|
|
16
16
|
return service;
|
|
17
17
|
}
|
|
18
18
|
async start() {
|
|
19
|
-
logger.info(`[${this.serviceName}] Service started.`);
|
|
19
|
+
logger.info({ src: "plugin:dummy-services:token-data", serviceName: this.serviceName }, `[${this.serviceName}] Service started.`);
|
|
20
20
|
}
|
|
21
21
|
async stop() {
|
|
22
|
-
logger.info(`[${this.serviceName}] Service stopped.`);
|
|
22
|
+
logger.info({ src: "plugin:dummy-services:token-data", serviceName: this.serviceName }, `[${this.serviceName}] Service stopped.`);
|
|
23
23
|
}
|
|
24
24
|
async getTokenData(tokenAddress) {
|
|
25
25
|
return {
|
|
@@ -222,7 +222,7 @@ class DummyLpService extends Service2 {
|
|
|
222
222
|
tick: 0
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
async getPosition(
|
|
225
|
+
async getPosition(_positionId) {
|
|
226
226
|
return {
|
|
227
227
|
poolAddress: "0xPool",
|
|
228
228
|
tokenA: "0xTokenA",
|
|
@@ -230,7 +230,7 @@ class DummyLpService extends Service2 {
|
|
|
230
230
|
liquidity: BigInt(1000)
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
async addLiquidity(
|
|
233
|
+
async addLiquidity(_params) {
|
|
234
234
|
return {
|
|
235
235
|
success: true,
|
|
236
236
|
transactionId: `dummy-tx-${Date.now()}`,
|
|
@@ -241,7 +241,7 @@ class DummyLpService extends Service2 {
|
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
async removeLiquidity(
|
|
244
|
+
async removeLiquidity(_params) {
|
|
245
245
|
return {
|
|
246
246
|
success: true,
|
|
247
247
|
transactionId: `dummy-tx-${Date.now()}`,
|
|
@@ -251,13 +251,13 @@ class DummyLpService extends Service2 {
|
|
|
251
251
|
]
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
async collectFees(
|
|
254
|
+
async collectFees(_positionId) {
|
|
255
255
|
return {
|
|
256
256
|
hash: "0xDummyHash",
|
|
257
257
|
success: true
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
async getBalances(
|
|
260
|
+
async getBalances(_address) {
|
|
261
261
|
return [
|
|
262
262
|
{
|
|
263
263
|
token: "0xTokenA",
|
|
@@ -340,7 +340,7 @@ class DummyLpService extends Service2 {
|
|
|
340
340
|
}
|
|
341
341
|
return marketData;
|
|
342
342
|
}
|
|
343
|
-
async swap(
|
|
343
|
+
async swap(_tokenIn, _tokenOut, _amountIn, _minAmountOut, _slippage) {
|
|
344
344
|
return {
|
|
345
345
|
hash: "0xDummyHash",
|
|
346
346
|
success: true
|
|
@@ -411,7 +411,7 @@ class DummyWalletService extends Service3 {
|
|
|
411
411
|
const amountBigInt = BigInt(amount);
|
|
412
412
|
const solBalance = this.balances.get("SOL") || BigInt(0);
|
|
413
413
|
if (solBalance < amountBigInt) {
|
|
414
|
-
throw new Error(
|
|
414
|
+
throw new Error("Insufficient SOL balance");
|
|
415
415
|
}
|
|
416
416
|
this.balances.set("SOL", solBalance - amountBigInt);
|
|
417
417
|
return `dummy-tx-${Date.now()}`;
|
|
@@ -455,7 +455,7 @@ class DummyWalletService extends Service3 {
|
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
// src/pdf/service.ts
|
|
458
|
-
import { Service as Service4, ServiceType, logger as
|
|
458
|
+
import { Service as Service4, ServiceType, logger as logger2 } from "@elizaos/core";
|
|
459
459
|
|
|
460
460
|
class DummyPdfService extends Service4 {
|
|
461
461
|
static serviceType = ServiceType.PDF;
|
|
@@ -469,13 +469,13 @@ class DummyPdfService extends Service4 {
|
|
|
469
469
|
return service;
|
|
470
470
|
}
|
|
471
471
|
async initialize() {
|
|
472
|
-
|
|
472
|
+
logger2.info({ src: "plugin:dummy-services:pdf" }, "DummyPdfService initialized");
|
|
473
473
|
}
|
|
474
474
|
async stop() {
|
|
475
|
-
|
|
475
|
+
logger2.info({ src: "plugin:dummy-services:pdf" }, "DummyPdfService stopped");
|
|
476
476
|
}
|
|
477
477
|
async extractText(pdfBuffer) {
|
|
478
|
-
|
|
478
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", bytes: pdfBuffer.length }, `Extracting text from PDF (${pdfBuffer.length} bytes)`);
|
|
479
479
|
return {
|
|
480
480
|
text: "This is dummy extracted text from the PDF document.",
|
|
481
481
|
metadata: {
|
|
@@ -487,25 +487,25 @@ class DummyPdfService extends Service4 {
|
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
489
|
async generatePdf(content, options) {
|
|
490
|
-
|
|
490
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", options }, "Generating PDF");
|
|
491
491
|
const dummyPdf = Buffer.from("dummy-pdf-content");
|
|
492
|
-
|
|
492
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", bytes: dummyPdf.length }, `Generated PDF: ${dummyPdf.length} bytes`);
|
|
493
493
|
return dummyPdf;
|
|
494
494
|
}
|
|
495
495
|
async convertToPdf(input, inputFormat, options) {
|
|
496
|
-
|
|
496
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", inputFormat, options }, `Converting ${inputFormat} to PDF`);
|
|
497
497
|
const dummyPdf = Buffer.from(`dummy-pdf-from-${inputFormat}`);
|
|
498
|
-
|
|
498
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", bytes: dummyPdf.length }, `Converted to PDF: ${dummyPdf.length} bytes`);
|
|
499
499
|
return dummyPdf;
|
|
500
500
|
}
|
|
501
501
|
async mergePdfs(pdfBuffers) {
|
|
502
|
-
|
|
502
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", count: pdfBuffers.length }, `Merging ${pdfBuffers.length} PDFs`);
|
|
503
503
|
const totalSize = pdfBuffers.reduce((sum, buf) => sum + buf.length, 0);
|
|
504
504
|
const mergedPdf = Buffer.from(`dummy-merged-pdf-${totalSize}`);
|
|
505
505
|
return mergedPdf;
|
|
506
506
|
}
|
|
507
507
|
async splitPdf(pdfBuffer, ranges) {
|
|
508
|
-
|
|
508
|
+
logger2.debug({ src: "plugin:dummy-services:pdf", parts: ranges.length }, `Splitting PDF into ${ranges.length} parts`);
|
|
509
509
|
return ranges.map((range, index) => Buffer.from(`dummy-split-pdf-part-${index}-pages-${range[0]}-${range[1]}`));
|
|
510
510
|
}
|
|
511
511
|
getDexName() {
|
|
@@ -514,7 +514,7 @@ class DummyPdfService extends Service4 {
|
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
// src/video/service.ts
|
|
517
|
-
import { Service as Service5, ServiceType as ServiceType2, logger as
|
|
517
|
+
import { Service as Service5, ServiceType as ServiceType2, logger as logger3 } from "@elizaos/core";
|
|
518
518
|
|
|
519
519
|
class DummyVideoService extends Service5 {
|
|
520
520
|
static serviceType = ServiceType2.VIDEO;
|
|
@@ -528,13 +528,13 @@ class DummyVideoService extends Service5 {
|
|
|
528
528
|
return service;
|
|
529
529
|
}
|
|
530
530
|
async initialize() {
|
|
531
|
-
|
|
531
|
+
logger3.info({ src: "plugin:dummy-services:video" }, "DummyVideoService initialized");
|
|
532
532
|
}
|
|
533
533
|
async stop() {
|
|
534
|
-
|
|
534
|
+
logger3.info({ src: "plugin:dummy-services:video" }, "DummyVideoService stopped");
|
|
535
535
|
}
|
|
536
536
|
async getVideoInfo(url) {
|
|
537
|
-
|
|
537
|
+
logger3.debug({ src: "plugin:dummy-services:video", url }, `Getting video info for: ${url}`);
|
|
538
538
|
return {
|
|
539
539
|
title: "Dummy Video Title",
|
|
540
540
|
duration: 300,
|
|
@@ -549,27 +549,27 @@ class DummyVideoService extends Service5 {
|
|
|
549
549
|
};
|
|
550
550
|
}
|
|
551
551
|
async downloadVideo(url, options) {
|
|
552
|
-
|
|
552
|
+
logger3.debug({ src: "plugin:dummy-services:video", url, options }, `Downloading video from: ${url}`);
|
|
553
553
|
const dummyVideo = Buffer.from(`dummy-video-${options?.format || "mp4"}`);
|
|
554
|
-
|
|
554
|
+
logger3.debug({ src: "plugin:dummy-services:video", bytes: dummyVideo.length }, `Downloaded video: ${dummyVideo.length} bytes`);
|
|
555
555
|
return dummyVideo;
|
|
556
556
|
}
|
|
557
557
|
async extractAudio(videoBuffer) {
|
|
558
|
-
|
|
558
|
+
logger3.debug({ src: "plugin:dummy-services:video", bytes: videoBuffer.length }, `Extracting audio from video (${videoBuffer.length} bytes)`);
|
|
559
559
|
return Buffer.from("dummy-audio-from-video");
|
|
560
560
|
}
|
|
561
561
|
async extractFrames(videoBuffer, timestamps) {
|
|
562
|
-
|
|
562
|
+
logger3.debug({ src: "plugin:dummy-services:video", frameCount: timestamps.length }, `Extracting ${timestamps.length} frames from video`);
|
|
563
563
|
return timestamps.map((ts, index) => Buffer.from(`dummy-frame-${index}-at-${ts}s`));
|
|
564
564
|
}
|
|
565
565
|
async processVideo(videoBuffer, options) {
|
|
566
|
-
|
|
566
|
+
logger3.debug({ src: "plugin:dummy-services:video", options }, "Processing video");
|
|
567
567
|
const processedVideo = Buffer.from(`dummy-processed-video-${options.outputFormat || "mp4"}`);
|
|
568
|
-
|
|
568
|
+
logger3.debug({ src: "plugin:dummy-services:video", bytes: processedVideo.length }, `Processed video: ${processedVideo.length} bytes`);
|
|
569
569
|
return processedVideo;
|
|
570
570
|
}
|
|
571
571
|
async getAvailableFormats(url) {
|
|
572
|
-
|
|
572
|
+
logger3.debug({ src: "plugin:dummy-services:video", url }, `Getting available formats for: ${url}`);
|
|
573
573
|
return [
|
|
574
574
|
{
|
|
575
575
|
format: "mp4",
|
|
@@ -597,7 +597,7 @@ class DummyVideoService extends Service5 {
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
// src/browser/service.ts
|
|
600
|
-
import { Service as Service6, ServiceType as ServiceType3, logger as
|
|
600
|
+
import { Service as Service6, ServiceType as ServiceType3, logger as logger4 } from "@elizaos/core";
|
|
601
601
|
|
|
602
602
|
class DummyBrowserService extends Service6 {
|
|
603
603
|
static serviceType = ServiceType3.BROWSER;
|
|
@@ -614,15 +614,15 @@ class DummyBrowserService extends Service6 {
|
|
|
614
614
|
return service;
|
|
615
615
|
}
|
|
616
616
|
async initialize() {
|
|
617
|
-
|
|
617
|
+
logger4.info({ src: "plugin:dummy-services:browser" }, "DummyBrowserService initialized");
|
|
618
618
|
}
|
|
619
619
|
async stop() {
|
|
620
|
-
|
|
620
|
+
logger4.info({ src: "plugin:dummy-services:browser" }, "DummyBrowserService stopped");
|
|
621
621
|
}
|
|
622
622
|
async navigate(url, options) {
|
|
623
|
-
|
|
623
|
+
logger4.debug({ src: "plugin:dummy-services:browser", url }, `Navigating to ${url}`);
|
|
624
624
|
if (options) {
|
|
625
|
-
|
|
625
|
+
logger4.debug({ src: "plugin:dummy-services:browser", options }, "Navigation options");
|
|
626
626
|
}
|
|
627
627
|
this.history.push(url);
|
|
628
628
|
this.historyIndex = this.history.length - 1;
|
|
@@ -630,13 +630,13 @@ class DummyBrowserService extends Service6 {
|
|
|
630
630
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
631
631
|
}
|
|
632
632
|
async screenshot(options) {
|
|
633
|
-
|
|
633
|
+
logger4.debug({ src: "plugin:dummy-services:browser", options }, "Taking screenshot");
|
|
634
634
|
const dummyImage = Buffer.from("dummy-screenshot-data");
|
|
635
|
-
|
|
635
|
+
logger4.debug({ src: "plugin:dummy-services:browser", bytes: dummyImage.length }, `Screenshot taken: ${dummyImage.length} bytes`);
|
|
636
636
|
return dummyImage;
|
|
637
637
|
}
|
|
638
638
|
async extractContent(selectors) {
|
|
639
|
-
|
|
639
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selectors }, "Extracting content");
|
|
640
640
|
const dummyContent = [
|
|
641
641
|
{
|
|
642
642
|
text: "Dummy extracted text",
|
|
@@ -657,63 +657,63 @@ class DummyBrowserService extends Service6 {
|
|
|
657
657
|
return dummyContent;
|
|
658
658
|
}
|
|
659
659
|
async waitForSelector(selector, timeout) {
|
|
660
|
-
|
|
660
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selector: selector.selector, timeout }, `Waiting for selector: ${selector.selector}`);
|
|
661
661
|
const waitTime = Math.min(timeout || 1000, 100);
|
|
662
662
|
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
663
|
-
|
|
663
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selector: selector.selector }, `Selector found: ${selector.selector}`);
|
|
664
664
|
return true;
|
|
665
665
|
}
|
|
666
666
|
async click(selector, options) {
|
|
667
|
-
|
|
667
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selector: selector.selector, options }, `Clicking on: ${selector.selector}`);
|
|
668
668
|
const delay = options?.delay || 50;
|
|
669
669
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
670
|
-
|
|
670
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selector: selector.selector }, `Clicked on: ${selector.selector}`);
|
|
671
671
|
}
|
|
672
672
|
async type(selector, text, options) {
|
|
673
|
-
|
|
673
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selector: selector.selector, options }, `Typing into: ${selector.selector}`);
|
|
674
674
|
const delay = options?.delay || 50;
|
|
675
675
|
await new Promise((resolve) => setTimeout(resolve, text.length * delay));
|
|
676
|
-
|
|
676
|
+
logger4.debug({ src: "plugin:dummy-services:browser", selector: selector.selector, text }, `Typed "${text}" into: ${selector.selector}`);
|
|
677
677
|
}
|
|
678
678
|
async evaluateScript(script) {
|
|
679
|
-
|
|
679
|
+
logger4.debug({ src: "plugin:dummy-services:browser", scriptPreview: script.substring(0, 100) }, `Evaluating script: ${script.substring(0, 100)}...`);
|
|
680
680
|
return { success: true, data: "dummy-script-result" };
|
|
681
681
|
}
|
|
682
682
|
async goBack() {
|
|
683
683
|
if (this.historyIndex > 0) {
|
|
684
684
|
this.historyIndex--;
|
|
685
685
|
this.currentUrl = this.history[this.historyIndex];
|
|
686
|
-
|
|
686
|
+
logger4.debug({ src: "plugin:dummy-services:browser", url: this.currentUrl }, `Navigated back to: ${this.currentUrl}`);
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
689
|
async goForward() {
|
|
690
690
|
if (this.historyIndex < this.history.length - 1) {
|
|
691
691
|
this.historyIndex++;
|
|
692
692
|
this.currentUrl = this.history[this.historyIndex];
|
|
693
|
-
|
|
693
|
+
logger4.debug({ src: "plugin:dummy-services:browser", url: this.currentUrl }, `Navigated forward to: ${this.currentUrl}`);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
async refresh() {
|
|
697
|
-
|
|
697
|
+
logger4.debug({ src: "plugin:dummy-services:browser", url: this.currentUrl }, `Refreshing page: ${this.currentUrl}`);
|
|
698
698
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
699
699
|
}
|
|
700
700
|
async getUrl() {
|
|
701
|
-
|
|
701
|
+
logger4.debug({ src: "plugin:dummy-services:browser", url: this.currentUrl }, `Current URL: ${this.currentUrl}`);
|
|
702
702
|
return this.currentUrl;
|
|
703
703
|
}
|
|
704
704
|
async getTitle() {
|
|
705
|
-
|
|
705
|
+
logger4.debug({ src: "plugin:dummy-services:browser" }, "Getting page title");
|
|
706
706
|
return `Dummy Title - ${this.currentUrl}`;
|
|
707
707
|
}
|
|
708
708
|
async setCookies(cookies) {
|
|
709
|
-
|
|
709
|
+
logger4.debug({ src: "plugin:dummy-services:browser", count: cookies.length }, `Setting ${cookies.length} cookies`);
|
|
710
710
|
}
|
|
711
711
|
async getCookies() {
|
|
712
|
-
|
|
712
|
+
logger4.debug({ src: "plugin:dummy-services:browser" }, "Getting cookies");
|
|
713
713
|
return [];
|
|
714
714
|
}
|
|
715
715
|
async clearCookies() {
|
|
716
|
-
|
|
716
|
+
logger4.debug({ src: "plugin:dummy-services:browser" }, "Clearing cookies");
|
|
717
717
|
}
|
|
718
718
|
getDexName() {
|
|
719
719
|
return "dummy-browser";
|
|
@@ -721,7 +721,7 @@ class DummyBrowserService extends Service6 {
|
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
// src/transcription/service.ts
|
|
724
|
-
import { Service as Service7, ServiceType as ServiceType4, logger as
|
|
724
|
+
import { Service as Service7, ServiceType as ServiceType4, logger as logger5 } from "@elizaos/core";
|
|
725
725
|
|
|
726
726
|
class DummyTranscriptionService extends Service7 {
|
|
727
727
|
static serviceType = ServiceType4.TRANSCRIPTION;
|
|
@@ -735,13 +735,13 @@ class DummyTranscriptionService extends Service7 {
|
|
|
735
735
|
return service;
|
|
736
736
|
}
|
|
737
737
|
async initialize() {
|
|
738
|
-
|
|
738
|
+
logger5.info({ src: "plugin:dummy-services:transcription" }, "DummyTranscriptionService initialized");
|
|
739
739
|
}
|
|
740
740
|
async stop() {
|
|
741
|
-
|
|
741
|
+
logger5.info({ src: "plugin:dummy-services:transcription" }, "DummyTranscriptionService stopped");
|
|
742
742
|
}
|
|
743
743
|
async transcribeAudio(audioBuffer, options) {
|
|
744
|
-
|
|
744
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", bytes: audioBuffer.length, options }, `Transcribing audio (${audioBuffer.length} bytes)`);
|
|
745
745
|
const segments = [
|
|
746
746
|
{
|
|
747
747
|
id: 0,
|
|
@@ -779,35 +779,35 @@ class DummyTranscriptionService extends Service7 {
|
|
|
779
779
|
segments: options?.timestamps ? segments : undefined,
|
|
780
780
|
words: options?.timestamps ? words : undefined
|
|
781
781
|
};
|
|
782
|
-
|
|
782
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", preview: result.text.substring(0, 50) }, `Transcription complete: ${result.text.substring(0, 50)}...`);
|
|
783
783
|
return result;
|
|
784
784
|
}
|
|
785
785
|
async transcribeVideo(videoBuffer, options) {
|
|
786
|
-
|
|
786
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", bytes: videoBuffer.length, options }, `Transcribing video (${videoBuffer.length} bytes)`);
|
|
787
787
|
return this.transcribeAudio(videoBuffer, options);
|
|
788
788
|
}
|
|
789
789
|
async speechToText(audioBuffer, options) {
|
|
790
|
-
|
|
790
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", options }, "Converting speech to text");
|
|
791
791
|
const result = await this.transcribeAudio(audioBuffer, options);
|
|
792
|
-
|
|
792
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", preview: result.text.substring(0, 50) }, `Speech to text complete: ${result.text.substring(0, 50)}...`);
|
|
793
793
|
if (options?.format === "text" || !options?.format) {
|
|
794
794
|
return result.text;
|
|
795
795
|
}
|
|
796
796
|
return result;
|
|
797
797
|
}
|
|
798
798
|
async textToSpeech(text, options) {
|
|
799
|
-
|
|
799
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", textPreview: text.substring(0, 50), options }, `Converting text to speech: "${text.substring(0, 50)}..."`);
|
|
800
800
|
const format = options?.format || "mp3";
|
|
801
801
|
const dummyAudio = Buffer.from(`dummy-audio-${format}-${text.length}-chars`);
|
|
802
|
-
|
|
802
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", format, bytes: dummyAudio.length }, `Generated ${format} audio: ${dummyAudio.length} bytes`);
|
|
803
803
|
return dummyAudio;
|
|
804
804
|
}
|
|
805
805
|
async detectLanguage(audioBuffer) {
|
|
806
|
-
|
|
806
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", bytes: audioBuffer.length }, `Detecting language from audio (${audioBuffer.length} bytes)`);
|
|
807
807
|
return "en";
|
|
808
808
|
}
|
|
809
809
|
async translateAudio(audioBuffer, targetLanguage, sourceLanguage) {
|
|
810
|
-
|
|
810
|
+
logger5.debug({ src: "plugin:dummy-services:transcription", targetLanguage, sourceLanguage }, `Translating audio to ${targetLanguage}`);
|
|
811
811
|
return {
|
|
812
812
|
text: `This is dummy translated text in ${targetLanguage}.`,
|
|
813
813
|
language: targetLanguage,
|
|
@@ -820,7 +820,7 @@ class DummyTranscriptionService extends Service7 {
|
|
|
820
820
|
}
|
|
821
821
|
|
|
822
822
|
// src/web-search/service.ts
|
|
823
|
-
import { Service as Service8, ServiceType as ServiceType5, logger as
|
|
823
|
+
import { Service as Service8, ServiceType as ServiceType5, logger as logger6 } from "@elizaos/core";
|
|
824
824
|
|
|
825
825
|
class DummyWebSearchService extends Service8 {
|
|
826
826
|
static serviceType = ServiceType5.WEB_SEARCH;
|
|
@@ -834,16 +834,16 @@ class DummyWebSearchService extends Service8 {
|
|
|
834
834
|
return service;
|
|
835
835
|
}
|
|
836
836
|
async initialize() {
|
|
837
|
-
|
|
837
|
+
logger6.info({ src: "plugin:dummy-services:web-search" }, "DummyWebSearchService initialized");
|
|
838
838
|
}
|
|
839
839
|
async stop() {
|
|
840
|
-
|
|
840
|
+
logger6.info({ src: "plugin:dummy-services:web-search" }, "DummyWebSearchService stopped");
|
|
841
841
|
}
|
|
842
842
|
async search(options) {
|
|
843
|
-
|
|
843
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", options }, "Performing web search");
|
|
844
844
|
const limit = options.limit || 10;
|
|
845
845
|
const results = [];
|
|
846
|
-
|
|
846
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", limit, query: options.query }, `Generating ${limit} dummy search results for: ${options.query}`);
|
|
847
847
|
for (let i = 0;i < limit; i++) {
|
|
848
848
|
results.push({
|
|
849
849
|
title: `Result ${i + 1}: ${options.query}`,
|
|
@@ -862,10 +862,10 @@ class DummyWebSearchService extends Service8 {
|
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
async searchNews(options) {
|
|
865
|
-
|
|
865
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", options }, "Performing news search");
|
|
866
866
|
const limit = options.limit || 10;
|
|
867
867
|
const results = [];
|
|
868
|
-
|
|
868
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", limit, query: options.query }, `Generating ${limit} dummy news results for: ${options.query}`);
|
|
869
869
|
for (let i = 0;i < limit; i++) {
|
|
870
870
|
results.push({
|
|
871
871
|
title: `News: ${options.query} - Article ${i + 1}`,
|
|
@@ -885,10 +885,10 @@ class DummyWebSearchService extends Service8 {
|
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
887
|
async searchImages(options) {
|
|
888
|
-
|
|
888
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", options }, "Performing image search");
|
|
889
889
|
const limit = options.limit || 10;
|
|
890
890
|
const results = [];
|
|
891
|
-
|
|
891
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", limit, query: options.query }, `Generating ${limit} dummy image results for: ${options.query}`);
|
|
892
892
|
for (let i = 0;i < limit; i++) {
|
|
893
893
|
results.push({
|
|
894
894
|
title: `Image: ${options.query} - ${i + 1}`,
|
|
@@ -908,10 +908,10 @@ class DummyWebSearchService extends Service8 {
|
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
910
|
async searchVideos(options) {
|
|
911
|
-
|
|
911
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", options }, "Performing video search");
|
|
912
912
|
const limit = options.limit || 10;
|
|
913
913
|
const results = [];
|
|
914
|
-
|
|
914
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", limit, query: options.query }, `Generating ${limit} dummy video results for: ${options.query}`);
|
|
915
915
|
for (let i = 0;i < limit; i++) {
|
|
916
916
|
results.push({
|
|
917
917
|
title: `Video: ${options.query} - Part ${i + 1}`,
|
|
@@ -932,7 +932,7 @@ class DummyWebSearchService extends Service8 {
|
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
934
|
async autocomplete(query) {
|
|
935
|
-
|
|
935
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", query }, `Getting autocomplete suggestions for: ${query}`);
|
|
936
936
|
return [
|
|
937
937
|
`${query} tutorial`,
|
|
938
938
|
`${query} examples`,
|
|
@@ -945,7 +945,7 @@ class DummyWebSearchService extends Service8 {
|
|
|
945
945
|
];
|
|
946
946
|
}
|
|
947
947
|
async getTrendingSearches(region) {
|
|
948
|
-
|
|
948
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", region: region || "global" }, `Getting trending searches for region: ${region || "global"}`);
|
|
949
949
|
return [
|
|
950
950
|
"artificial intelligence",
|
|
951
951
|
"machine learning",
|
|
@@ -958,7 +958,7 @@ class DummyWebSearchService extends Service8 {
|
|
|
958
958
|
];
|
|
959
959
|
}
|
|
960
960
|
async getRelatedSearches(query) {
|
|
961
|
-
|
|
961
|
+
logger6.debug({ src: "plugin:dummy-services:web-search", query }, `Getting related searches for: ${query}`);
|
|
962
962
|
return [
|
|
963
963
|
`${query} alternatives`,
|
|
964
964
|
`${query} vs competitors`,
|
|
@@ -976,7 +976,7 @@ class DummyWebSearchService extends Service8 {
|
|
|
976
976
|
}
|
|
977
977
|
|
|
978
978
|
// src/email/service.ts
|
|
979
|
-
import { Service as Service9, ServiceType as ServiceType6, logger as
|
|
979
|
+
import { Service as Service9, ServiceType as ServiceType6, logger as logger7 } from "@elizaos/core";
|
|
980
980
|
|
|
981
981
|
class DummyEmailService extends Service9 {
|
|
982
982
|
static serviceType = ServiceType6.EMAIL;
|
|
@@ -995,16 +995,16 @@ class DummyEmailService extends Service9 {
|
|
|
995
995
|
return service;
|
|
996
996
|
}
|
|
997
997
|
async initialize() {
|
|
998
|
-
|
|
998
|
+
logger7.info({ src: "plugin:dummy-services:email" }, "DummyEmailService initialized");
|
|
999
999
|
}
|
|
1000
1000
|
async stop() {
|
|
1001
|
-
|
|
1001
|
+
logger7.info({ src: "plugin:dummy-services:email" }, "DummyEmailService stopped");
|
|
1002
1002
|
}
|
|
1003
1003
|
async sendEmail(to, subject, body, options) {
|
|
1004
|
-
|
|
1005
|
-
|
|
1004
|
+
logger7.debug({ src: "plugin:dummy-services:email", to, subject }, "Sending email");
|
|
1005
|
+
logger7.debug({ src: "plugin:dummy-services:email", options }, "Email options");
|
|
1006
1006
|
const messageId = `dummy-${Date.now()}@example.com`;
|
|
1007
|
-
|
|
1007
|
+
logger7.info({ src: "plugin:dummy-services:email", messageId }, `Email sent successfully. Message ID: ${messageId}`);
|
|
1008
1008
|
const sentEmail = {
|
|
1009
1009
|
id: messageId,
|
|
1010
1010
|
from: { address: "dummy@example.com", name: "Dummy Sender" },
|
|
@@ -1022,7 +1022,7 @@ class DummyEmailService extends Service9 {
|
|
|
1022
1022
|
return messageId;
|
|
1023
1023
|
}
|
|
1024
1024
|
async searchEmails(options) {
|
|
1025
|
-
|
|
1025
|
+
logger7.debug({ src: "plugin:dummy-services:email", options }, "Searching emails");
|
|
1026
1026
|
let results = this.emails;
|
|
1027
1027
|
if (options) {
|
|
1028
1028
|
if (options.from) {
|
|
@@ -1035,16 +1035,16 @@ class DummyEmailService extends Service9 {
|
|
|
1035
1035
|
results = results.slice(0, options.limit);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
|
|
1038
|
+
logger7.debug({ src: "plugin:dummy-services:email", count: results.length }, `Found ${results.length} emails`);
|
|
1039
1039
|
return results;
|
|
1040
1040
|
}
|
|
1041
1041
|
async getEmail(messageId) {
|
|
1042
|
-
|
|
1042
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId }, `Getting email: ${messageId}`);
|
|
1043
1043
|
const email = this.emails.find((e) => e.id === messageId);
|
|
1044
1044
|
return email || null;
|
|
1045
1045
|
}
|
|
1046
1046
|
async deleteEmail(messageId) {
|
|
1047
|
-
|
|
1047
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId }, `Deleting email: ${messageId}`);
|
|
1048
1048
|
const index = this.emails.findIndex((e) => e.id === messageId);
|
|
1049
1049
|
if (index !== -1) {
|
|
1050
1050
|
this.emails.splice(index, 1);
|
|
@@ -1053,23 +1053,23 @@ class DummyEmailService extends Service9 {
|
|
|
1053
1053
|
return false;
|
|
1054
1054
|
}
|
|
1055
1055
|
async markAsRead(messageId) {
|
|
1056
|
-
|
|
1056
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId }, `Marking email as read: ${messageId}`);
|
|
1057
1057
|
return true;
|
|
1058
1058
|
}
|
|
1059
1059
|
async markAsUnread(messageId) {
|
|
1060
|
-
|
|
1060
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId }, `Marking email as unread: ${messageId}`);
|
|
1061
1061
|
return true;
|
|
1062
1062
|
}
|
|
1063
1063
|
async moveToFolder(messageId, folderPath) {
|
|
1064
|
-
|
|
1064
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId, folderPath }, `Moving email ${messageId} to folder: ${folderPath}`);
|
|
1065
1065
|
return true;
|
|
1066
1066
|
}
|
|
1067
1067
|
async getFolders() {
|
|
1068
|
-
|
|
1068
|
+
logger7.debug({ src: "plugin:dummy-services:email" }, "Getting email folders");
|
|
1069
1069
|
return this.folders;
|
|
1070
1070
|
}
|
|
1071
1071
|
async createFolder(name, parentPath) {
|
|
1072
|
-
|
|
1072
|
+
logger7.debug({ src: "plugin:dummy-services:email", name, parentPath }, `Creating folder: ${name}`);
|
|
1073
1073
|
const path = parentPath ? `${parentPath}/${name}` : name;
|
|
1074
1074
|
const folder = {
|
|
1075
1075
|
name,
|
|
@@ -1081,7 +1081,7 @@ class DummyEmailService extends Service9 {
|
|
|
1081
1081
|
return folder;
|
|
1082
1082
|
}
|
|
1083
1083
|
async deleteFolder(folderPath) {
|
|
1084
|
-
|
|
1084
|
+
logger7.debug({ src: "plugin:dummy-services:email", folderPath }, `Deleting folder: ${folderPath}`);
|
|
1085
1085
|
const index = this.folders.findIndex((f) => f.path === folderPath);
|
|
1086
1086
|
if (index !== -1) {
|
|
1087
1087
|
this.folders.splice(index, 1);
|
|
@@ -1090,15 +1090,15 @@ class DummyEmailService extends Service9 {
|
|
|
1090
1090
|
return false;
|
|
1091
1091
|
}
|
|
1092
1092
|
async replyToEmail(messageId, body, options) {
|
|
1093
|
-
|
|
1093
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId, options }, `Replying to email: ${messageId}`);
|
|
1094
1094
|
const replyMessageId = `dummy-reply-${Date.now()}@example.com`;
|
|
1095
|
-
|
|
1095
|
+
logger7.info({ src: "plugin:dummy-services:email", replyMessageId }, `Reply sent successfully. Message ID: ${replyMessageId}`);
|
|
1096
1096
|
return replyMessageId;
|
|
1097
1097
|
}
|
|
1098
1098
|
async forwardEmail(messageId, to, options) {
|
|
1099
|
-
|
|
1099
|
+
logger7.debug({ src: "plugin:dummy-services:email", messageId, to, options }, `Forwarding email: ${messageId}`);
|
|
1100
1100
|
const forwardMessageId = `dummy-forward-${Date.now()}@example.com`;
|
|
1101
|
-
|
|
1101
|
+
logger7.info({ src: "plugin:dummy-services:email", forwardMessageId }, `Email forwarded successfully. Message ID: ${forwardMessageId}`);
|
|
1102
1102
|
return forwardMessageId;
|
|
1103
1103
|
}
|
|
1104
1104
|
getDexName() {
|
|
@@ -1107,14 +1107,14 @@ class DummyEmailService extends Service9 {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
|
|
1109
1109
|
// src/e2e/scenarios.ts
|
|
1110
|
-
import { logger as
|
|
1110
|
+
import { logger as logger8 } from "@elizaos/core";
|
|
1111
1111
|
var dummyServicesScenariosSuite = {
|
|
1112
1112
|
name: "Dummy Services E2E Tests",
|
|
1113
1113
|
tests: [
|
|
1114
1114
|
{
|
|
1115
1115
|
name: "Dummy test placeholder",
|
|
1116
|
-
async fn(
|
|
1117
|
-
|
|
1116
|
+
async fn(_runtime) {
|
|
1117
|
+
logger8.info({ src: "plugin:dummy-services:e2e" }, "Dummy services test placeholder");
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
1120
|
]
|
|
@@ -1136,7 +1136,7 @@ var dummyServicesPlugin = {
|
|
|
1136
1136
|
DummyEmailService
|
|
1137
1137
|
],
|
|
1138
1138
|
tests: [dummyServicesScenariosSuite],
|
|
1139
|
-
init: async (
|
|
1139
|
+
init: async (_runtime) => {
|
|
1140
1140
|
console.log("Dummy Services Plugin Initialized");
|
|
1141
1141
|
}
|
|
1142
1142
|
};
|
|
@@ -1155,5 +1155,5 @@ export {
|
|
|
1155
1155
|
DummyBrowserService
|
|
1156
1156
|
};
|
|
1157
1157
|
|
|
1158
|
-
//# debugId=
|
|
1158
|
+
//# debugId=EF0ABC99094C4FC864756E2164756E21
|
|
1159
1159
|
//# sourceMappingURL=index.js.map
|