Skip to content

Commit

Permalink
Add webscraper preload into imported plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Nov 25, 2024
1 parent c3a28b6 commit e385037
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function ImportedSkillConfig({
useEffect(() => {
setHasChanges(
JSON.stringify(inputs) !==
JSON.stringify(inputsFromArgs(selectedSkill.setup_args))
JSON.stringify(inputsFromArgs(selectedSkill.setup_args))
);
}, [inputs]);

Expand Down
3 changes: 3 additions & 0 deletions server/utils/agents/imported.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ const fs = require("fs");
const path = require("path");
const { safeJsonParse } = require("../http");
const { isWithin, normalizePath } = require("../files");
const { CollectorApi } = require("../collectorApi");
const pluginsPath =
process.env.NODE_ENV === "development"
? path.resolve(__dirname, "../../storage/plugins/agent-skills")
: path.resolve(process.env.STORAGE_DIR, "plugins", "agent-skills");
const sharedWebScraper = new CollectorApi();

class ImportedPlugin {
constructor(config) {
Expand Down Expand Up @@ -184,6 +186,7 @@ class ImportedPlugin {
description: this.config.description,
logger: aibitat?.handlerProps?.log || console.log, // Allows plugin to log to the console.
introspect: aibitat?.introspect || console.log, // Allows plugin to display a "thought" the chat window UI.
webScraper: sharedWebScraper,
examples: this.config.examples ?? [],
parameters: {
$schema: "http://json-schema.org/draft-07/schema#",
Expand Down

0 comments on commit e385037

Please sign in to comment.