diff --git a/package.json b/package.json index beef574..616bfea 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint": "eslint --ext .ts --ext .js . --fix", "shell": "node --no-warnings scripts/shell.mjs", "shell:dev": "node --no-warnings scripts/shell.mjs --dev", - "concat": "node ./scripts/concat.ts", + "concat": "node ./scripts/concat.mjs", "dev": "wrangler dev --log-level error & npm run shell:dev", "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest", "test:dev": "jest --watchAll", diff --git a/scripts/concat.mjs b/scripts/concat.mjs index c772a82..cc95044 100644 --- a/scripts/concat.mjs +++ b/scripts/concat.mjs @@ -2,7 +2,7 @@ import fs from 'fs' import path, { dirname } from 'path' import { fileURLToPath } from 'url' -const instructions = 'The above code was taken from the Cojourney codebase at https://github.com/cojourneyai/cojourney. You are writing tests and documentation for the Cojourney codebase. Please use the above code as a reference. Tests should be written with Jest and Typescript. Do not use mocks or stubs. Keep it very simple and straightforward.' +const instructions = 'The above code was taken from the Cojourney codebase at https://github.com/lalalune/bgent. You are writing tests and documentation for the Cojourney codebase. Please use the above code as a reference. Tests should be written with Jest and Typescript. Do not use mocks or stubs. Keep it very simple and straightforward.' // Patterns to ignore const ignorePatterns = ['messageExamples.ts', 'goal', 'goals', 'utils', 'logger', 'index', 'data', 'constants', 'templates', 'worker'] @@ -12,7 +12,7 @@ const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) // The directory containing the TypeScript files -const directoryPath = path.join(__dirname, 'src') +const directoryPath = path.join(__dirname, '../src') // The file to which all TypeScript content will be written const outputFile = path.join(__dirname, 'concatenated-output.ts') @@ -24,7 +24,7 @@ const shouldIgnore = (filePath) => { // Function to recursively read through directories and concatenate .ts files const readDirectory = (dirPath) => { - let concatenatedContent = '# START COJOURNEY CODEBASE' + let concatenatedContent = '# START MY CODEBASE' fs.readdirSync(dirPath).forEach(file => { const filePath = path.join(dirPath, file) @@ -54,5 +54,5 @@ const readDirectory = (dirPath) => { const concatenatedContent = readDirectory(directoryPath) // Write the concatenated content to the output file -fs.writeFileSync(outputFile, concatenatedContent + '# END COJOURNEY CODEBASE\n\n' + instructions) +fs.writeFileSync(outputFile, concatenatedContent + '# END MY CODEBASE\n\n' + instructions) console.log('TypeScript files have been concatenated into:', outputFile) diff --git a/src/lib/messages.ts b/src/lib/messages.ts index 9aa43bb..f77ed38 100644 --- a/src/lib/messages.ts +++ b/src/lib/messages.ts @@ -42,9 +42,6 @@ export function formatMessageActors({ actors }: { actors: Actor[] }) { return finalActorStrings; } -/** get random conversation examples - * return an array of random conversation examples from the messageExamples array - */ export const getRandomMessageExamples = (count: number) => { const examples: Array< Array< diff --git a/src/lib/relationships.ts b/src/lib/relationships.ts index 4a5bdd8..f8a4270 100644 --- a/src/lib/relationships.ts +++ b/src/lib/relationships.ts @@ -2,9 +2,6 @@ import { type SupabaseClient } from "@supabase/supabase-js"; import { type UUID } from "crypto"; import { type Relationship } from "./types"; -/** create a connection - * @todo This should only be allowable by the current user if they are connected to both userA and userB - */ export async function createRelationship({ supabase, userA, @@ -67,31 +64,6 @@ export async function getRelationships({ return data as Relationship[]; } -/** - * custom function to query relationships by embedding - * pull all actors in scene and compare their embeddings to the user's rolodex to draw in relevant matches - * @todo Implement this function - * @param {object} options - * @param {object} options.supabase - * @param {string} options.userId - * @param {object} options.embedding - */ -// export async function searchRelationships({ supabase, userId, embedding }) { -// } - -// export async function createProfileEmbedding({ supabase, agent, runtime }: { supabase: SupabaseClient, agent: Actor, runtime: BgentRuntime }) { -// if (runtime.debugMode) { -// console.log(`Creating profile embedding for ${agent.name}`); -// } -// const embedding = await runtime.embed(agent.description); -// const { data, error } = await supabase.from("accounts").update({ profile_embedding: embedding }).eq("id", agent.id); -// if (error) { -// throw new Error(error.message); -// } - -// return data; -// } - export async function formatRelationships({ supabase, userId, diff --git a/src/lib/runtime.ts b/src/lib/runtime.ts index 24bbe10..eeff721 100644 --- a/src/lib/runtime.ts +++ b/src/lib/runtime.ts @@ -46,14 +46,6 @@ export interface AgentRuntimeOpts { evaluators?: Evaluator[]; // Optional custom evaluators } -/** - * @class BgentRuntime - * @param {object} opts - * @param {number} opts.recentMessageCount - * @param {string} opts.token - JWT token - * @param {object} opts.supabase - Supabase client - * @param {boolean} opts.debugMode - If true, will log debug messages - */ export class BgentRuntime { readonly #recentMessageCount = 32 as number; serverUrl = "http://localhost:7998";