Skip to content

Commit

Permalink
feat: merge v0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tegokokook committed Feb 13, 2025
1 parent 7f5c8fb commit 37578d1
Show file tree
Hide file tree
Showing 238 changed files with 648 additions and 646 deletions.
4 changes: 2 additions & 2 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1531,12 +1531,12 @@ if (
parseBooleanFromText(process.env.PREVENT_UNHANDLED_EXIT)
) {
// Handle uncaught exceptions to prevent the process from crashing
process.on("uncaughtException", function (err) {
process.on("uncaughtException", (err) => {
console.error("uncaughtException", err);
});

// Handle unhandled rejections to prevent the process from crashing
process.on("unhandledRejection", function (err) {
process.on("unhandledRejection", (err) => {
console.error("unhandledRejection", err);
});
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "bash ./scripts/test.sh",
"smokeTests": "bash ./scripts/smokeTests.sh",
"integrationTests": "bash ./scripts/integrationTests.sh",
"upnews": "node ./scripts/update-new-knowledge.js"
"upnews": "node ./scripts/update-new-knowledge.js"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { inject, injectable } from "inversify";
import {
Service,
ServiceType,
type ServiceType,
type IAgentRuntime,
elizaLogger,
stringToUuid,
Memory,
State,
type Memory,
type State,
} from "@elizaos/core";
import { globalContainer } from "@elizaos/plugin-di";

Expand Down
2 changes: 1 addition & 1 deletion packages/_examples/plugin/src/services/sampleService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Service,
ServiceType,
type ServiceType,
type IAgentRuntime,
// Memory,
// State,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MongoClient } from 'mongodb';
import { MongoDBDatabaseAdapter } from '../index';
import { v4 as uuidv4 } from 'uuid';
import { RAGKnowledgeItem, type UUID } from '@elizaos/core';
import type { RAGKnowledgeItem, UUID } from '@elizaos/core';

describe('MongoDBAdapter', () => {
let adapter: MongoDBDatabaseAdapter;
Expand Down
16 changes: 8 additions & 8 deletions packages/adapter-mongodb/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { MongoClient } from 'mongodb';
import type { MongoClient } from 'mongodb';
import {
DatabaseAdapter,
RAGKnowledgeItem,
IDatabaseCacheAdapter,
Account,
Actor,
GoalStatus,
Participant,
type RAGKnowledgeItem,
type IDatabaseCacheAdapter,
type Account,
type Actor,
type GoalStatus,
type Participant,
type Goal,
type Memory,
type Relationship,
Expand Down Expand Up @@ -42,7 +42,7 @@ export class MongoDBDatabaseAdapter
private database: any;
private databaseName: string;
private hasVectorSearch: boolean;
private isConnected: boolean = false;
private isConnected = false;
private isVectorSearchIndexComputable: boolean;
public db: MongoClient;

Expand Down
22 changes: 11 additions & 11 deletions packages/adapter-qdrant/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { v4,v5 } from "uuid";
import { QdrantClient } from "@qdrant/js-client-rest";
import {
Account,
Actor,
GoalStatus,
IDatabaseCacheAdapter,
UUID,
type Account,
type Actor,
type GoalStatus,
type IDatabaseCacheAdapter,
type UUID,
elizaLogger,
RAGKnowledgeItem,
type RAGKnowledgeItem,
DatabaseAdapter,
Participant,
type Participant,
type Memory,
type Goal,
type Relationship,
Expand All @@ -18,8 +18,8 @@ import {

export class QdrantDatabaseAdapter extends DatabaseAdapter<QdrantClient> implements IDatabaseCacheAdapter {
db: QdrantClient;
collectionName: string = 'collection';
qdrantV5UUIDNamespace: string = "00000000-0000-0000-0000-000000000000";
collectionName = 'collection';
qdrantV5UUIDNamespace = "00000000-0000-0000-0000-000000000000";
cacheM: Map<string, string> = new Map<string, string>();
vectorSize: number;
constructor(url: string, apiKey: string, port: number, vectorSize: number) {
Expand Down Expand Up @@ -372,8 +372,8 @@ export class QdrantDatabaseAdapter extends DatabaseAdapter<QdrantClient> imple
key: string;
agentId: UUID;
}): Promise<string | undefined> {
let key = this.buildKey(params.agentId, params.key);
let result = this.cacheM.get(key);
const key = this.buildKey(params.agentId, params.key);
const result = this.cacheM.get(key);
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client-alexa/src/alexa-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { elizaLogger, IAgentRuntime } from "@elizaos/core";
import { elizaLogger, type IAgentRuntime } from "@elizaos/core";
import { DefaultApiClient } from "ask-sdk-core";
import { services } from "ask-sdk-model";
import axios from "axios";
Expand Down
2 changes: 1 addition & 1 deletion packages/client-alexa/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, IAgentRuntime, elizaLogger } from "@elizaos/core";
import { type Client, type IAgentRuntime, elizaLogger } from "@elizaos/core";
import { AlexaClient } from "./alexa-client";

export const AlexaClientInterface: Client = {
Expand Down
4 changes: 2 additions & 2 deletions packages/client-deva/src/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { elizaLogger, IAgentRuntime } from "@elizaos/core";
import { DevaPersona, DevaPost } from "./types";
import { elizaLogger, type IAgentRuntime } from "@elizaos/core";
import type { DevaPersona, DevaPost } from "./types";

export class ClientBase {
private readonly runtime: IAgentRuntime;
Expand Down
14 changes: 7 additions & 7 deletions packages/client-deva/src/controller.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
composeContext,
Content,
type Content,
elizaLogger,
generateText,
getEmbeddingZeroVector,
IAgentRuntime,
type IAgentRuntime,
ModelClass,
parseBooleanFromText,
State,
type State,
stringToUuid,
} from "@elizaos/core";
import { ClientBase } from "./base";
import { DevaPersona, DevaPost } from "./types";
import type { ClientBase } from "./base";
import type { DevaPersona, DevaPost } from "./types";
import { DEVA_POST_TEMPLATE } from "./templates.ts";

export class DevaController {
Expand Down Expand Up @@ -165,9 +165,9 @@ export class DevaController {
: 0;

const minMinutes =
parseInt(this.runtime.getSetting("POST_INTERVAL_MIN")) || 90;
Number.parseInt(this.runtime.getSetting("POST_INTERVAL_MIN")) || 90;
const maxMinutes =
parseInt(this.runtime.getSetting("POST_INTERVAL_MAX")) || 180;
Number.parseInt(this.runtime.getSetting("POST_INTERVAL_MAX")) || 180;
const randomMinutes =
Math.floor(Math.random() * (maxMinutes - minMinutes + 1)) +
minMinutes;
Expand Down
2 changes: 1 addition & 1 deletion packages/client-deva/src/devaClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime, elizaLogger } from "@elizaos/core";
import { type IAgentRuntime, elizaLogger } from "@elizaos/core";
import { ClientBase } from "./base.ts";
import { DevaController } from "./controller";

Expand Down
2 changes: 1 addition & 1 deletion packages/client-deva/src/enviroment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime } from "@elizaos/core";
import type { IAgentRuntime } from "@elizaos/core";
import { z } from "zod";

export const devaEnvSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion packages/client-deva/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime, Client, elizaLogger } from "@elizaos/core";
import { type IAgentRuntime, type Client, elizaLogger } from "@elizaos/core";
import { DevaClient } from "./devaClient.ts";
import { validateDevaConfig } from "./enviroment.ts";

Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/actions/control_device.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
Action,
ActionExample,
Content,
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/actions/discover_devices.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
Action,
ActionExample,
Content,
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/capabilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime } from "@elizaos/core";
import type { IAgentRuntime } from "@elizaos/core";

// Define SmartThings capability interfaces
export interface SmartThingsCapability {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/entities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime } from "@elizaos/core";
import type { IAgentRuntime } from "@elizaos/core";
import { SmartThingsApi } from "./services/smart_things_api";
import { CAPABILITY_MAPPINGS } from "./config";

Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/environment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime } from "@elizaos/core";
import type { IAgentRuntime } from "@elizaos/core";
import { z } from "zod";

export const homeConfigSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/handlers/device_handlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SmartThingsApi } from "../services/smart_things_api";
import type { SmartThingsApi } from "../services/smart_things_api";
import { DeviceState } from "../providers/device_state";

export class DeviceHandlers {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/handlers/room_handlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SmartThingsApi } from "../services/smart_things_api";
import type { SmartThingsApi } from "../services/smart_things_api";

export class RoomHandlers {
constructor(private api: SmartThingsApi) {}
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/handlers/scene_handlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SmartThingsApi } from "../services/smart_things_api";
import type { SmartThingsApi } from "../services/smart_things_api";

export class SceneHandlers {
constructor(private api: SmartThingsApi) {}
Expand Down
6 changes: 3 additions & 3 deletions packages/client-eliza-home/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { EventEmitter } from "events";
import {
IAgentRuntime,
Client as ElizaClient,
type IAgentRuntime,
type Client as ElizaClient,
elizaLogger,
stringToUuid,
getEmbeddingZeroVector,
Memory,
type Memory,
Content,
} from "@elizaos/core";
import { validateHomeConfig } from "./environment.ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime, Provider } from "@elizaos/core";
import type { IAgentRuntime, Provider } from "@elizaos/core";

export const automationStateProvider: Provider = {
name: "automation-state",
Expand Down
6 changes: 3 additions & 3 deletions packages/client-eliza-home/src/providers/device_state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IAgentRuntime } from "@elizaos/core";
import { Provider } from "@elizaos/core";
import type { IAgentRuntime } from "@elizaos/core";
import type { Provider } from "@elizaos/core";
import { EntityManager } from "../entities.ts";
import { SmartThingsCapability } from '../capabilities';
import type { SmartThingsCapability } from '../capabilities';

export interface DeviceState {
id: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/client-eliza-home/src/services/device_discovery.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SmartThingsApi } from './smart_things_api';
import { SmartThingsDevice } from '../types/smart_things';
import type { SmartThingsApi } from './smart_things_api';
import type { SmartThingsDevice } from '../types/smart_things';
import { DEVICE_CLASSES } from '../config';

export class DeviceDiscoveryService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime } from "@elizaos/core";
import type { IAgentRuntime } from "@elizaos/core";
import { retryWithBackoff } from "../utils";

export class SmartThingsApi {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/smart_home.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime, elizaLogger } from "@elizaos/core";
import { type IAgentRuntime, elizaLogger } from "@elizaos/core";
import { SmartThingsApi } from "./services/smart_things_api";
import { CommandParser } from "./utils/command_parser";
import { homeShouldRespondTemplate, homeMessageHandlerTemplate } from "./templates";
Expand Down
2 changes: 1 addition & 1 deletion packages/client-eliza-home/src/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAgentRuntime, Provider } from "@elizaos/core";
import type { IAgentRuntime, Provider } from "@elizaos/core";
import { Entity } from "./entities.ts";

export class StateManager {
Expand Down
4 changes: 2 additions & 2 deletions packages/client-eliza-home/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { elizaLogger } from "@elizaos/core";

export async function retryWithBackoff<T>(
operation: () => Promise<T>,
maxRetries: number = 3,
baseDelay: number = 1000
maxRetries = 3,
baseDelay = 1000
): Promise<T> {
let lastError: Error;

Expand Down
6 changes: 3 additions & 3 deletions packages/client-eliza-home/src/utils/command_parser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DeviceCommand } from '../types/smart_things';
import type { DeviceCommand } from '../types/smart_things';

export class CommandParser {
private static readonly COMMAND_PATTERNS = {
Expand Down Expand Up @@ -37,13 +37,13 @@ export class CommandParser {
return {
capability: 'switchLevel',
command: 'setLevel',
arguments: [parseInt(args.value)]
arguments: [Number.parseInt(args.value)]
};
case 'setTemperature':
return {
capability: 'thermostat',
command: 'setTemperature',
arguments: [parseInt(args.value)]
arguments: [Number.parseInt(args.value)]
};
case 'setColor':
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-instagram/src/services/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class InstagramPostService {
try {
elizaLogger.log("Generating image for Instagram post");

let imageSettings = this.runtime.character.settings.imageSettings || {};
const imageSettings = this.runtime.character.settings.imageSettings || {};

const result = await generateImage(
{
Expand Down
2 changes: 1 addition & 1 deletion packages/client-simsai/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JeeterPostClient } from "./jeeter/post.ts";
import { JeeterSearchClient } from "./jeeter/search.ts";
import { JeeterInteractionClient } from "./jeeter/interactions.ts";
import { IAgentRuntime, Client, elizaLogger } from "@elizaos/core";
import { type IAgentRuntime, type Client, elizaLogger } from "@elizaos/core";
import { validateJeeterConfig } from "./jeeter/environment.ts";
import { ClientBase } from "./jeeter/base.ts";

Expand Down
Loading

0 comments on commit 37578d1

Please sign in to comment.