Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The `PdfService` is responsible for parsing PDF files and extracting their text

```typescript
import * as fs from 'node:fs/promises';
import { ServiceType, type IPdfService } from '@elizaos/core'; // Assuming ServiceType and IPdfService are available
import { ServiceType, type IPdfService } from '@elizaos/core-plugin-v2'; // Assuming ServiceType and IPdfService are available

async function extractTextFromPdf(runtime: IAgentRuntime, filePath: string) {
try {
Expand Down
8 changes: 7 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.812.0",
"@aws-sdk/s3-request-presigner": "^3.812.0",
"@elizaos/core": "^1.0.0-beta",
"@elizaos/core-plugin-v2": "^1.0.0-beta.58",
"@types/uuid": "10.0.0",
"capsolver-npm": "2.1.9",
"esbuild-plugin-copy": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Plugin } from "@elizaos/core";
import type { Plugin } from "@elizaos/core-plugin-v2";

import { PdfService } from "./services/pdf";

Expand Down
2 changes: 1 addition & 1 deletion src/services/pdf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAgentRuntime, Service, type ServiceTypeName, ServiceType } from '@elizaos/core';
import { type IAgentRuntime, Service, type ServiceTypeName, ServiceType } from '@elizaos/core-plugin-v2';
import pkg from 'pdfjs-dist';
const { getDocument } = pkg;
import type { TextItem, TextMarkedContent } from 'pdfjs-dist/types/src/display/api';
Expand Down
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
"emitDeclarationOnly": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"allowArbitraryExtensions": true,
"paths": {
"@elizaos/core": ["../core/src"],
"@elizaos/core/*": ["../core/src/*"]
}
"allowArbitraryExtensions": true
},
"include": ["src/**/*.ts"]
}
17 changes: 1 addition & 16 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import path from 'path';
import { defineConfig } from 'tsup';
import { copy } from 'esbuild-plugin-copy';

export default defineConfig({
entry: ['src/index.ts'],
Expand All @@ -9,7 +7,7 @@ export default defineConfig({
sourcemap: true,
clean: true,
format: ['esm'], // Ensure you're targeting CommonJS
dts: true,
dts: false, // Skip DTS generation to avoid external import issues // Ensure you're targeting CommonJS
external: [
'dotenv', // Externalize dotenv to prevent bundling
'fs', // Externalize fs to use Node.js built-in module
Expand All @@ -20,17 +18,4 @@ export default defineConfig({
'agentkeepalive',
'zod',
],
esbuildOptions(options) {
options.alias = {
'@/src': './src',
};
},
esbuildPlugins: [
copy({
assets: {
from: [path.resolve(__dirname, '../../node_modules/pdfjs-dist/legacy/build/pdf.worker.js')],
to: [path.resolve(__dirname, 'dist')],
},
}),
],
});