diff --git a/packages/body/src/bodyinterfaces.ts b/packages/body/src/bodyinterfaces.ts index 4c64433..976165f 100644 --- a/packages/body/src/bodyinterfaces.ts +++ b/packages/body/src/bodyinterfaces.ts @@ -1,5 +1,6 @@ import { MapStore } from "nanostores"; import { AgentBrain } from "@agent-smith/brain" +import { AgentJob } from "../../jobs/src/jobsinterfaces.js"; /** * Interface for the specification of an agent. @@ -14,6 +15,7 @@ interface AgentSpec { props?: Record; modules?: Array>; brain?: AgentBrain; + jobs?: Array; } /** @@ -37,7 +39,7 @@ interface AgentInteractions { } interface AgentState { - text: StructuredSerializeOptions, + text: string, component: string, isVisible: boolean, isInteracting: boolean, @@ -52,6 +54,7 @@ interface AgentSmith { interactions: MapStore; // modules brain: AgentBrain; + jobs: Array; // methods show: () => void; hide: () => void; diff --git a/packages/body/src/core.ts b/packages/body/src/core.ts index 945d9c5..e12a500 100644 --- a/packages/body/src/core.ts +++ b/packages/body/src/core.ts @@ -1,14 +1,16 @@ import { map } from 'nanostores' -import { AgentSmith, type AgentSpec, type ConfirmFunction, type ConfirmOptions } from "./bodyinterfaces.js"; +import { AgentSmith, AgentState, type AgentSpec, type ConfirmFunction, type ConfirmOptions } from "./bodyinterfaces.js"; import { AgentBrain } from '@agent-smith/brain'; +import { AgentJob } from "../../jobs/src/jobsinterfaces.js"; const useAgentSmith = (initParams: AgentSpec): AgentSmith => { const name = initParams.name; const props = initParams.props ?? {}; const modules = initParams.modules; - const brain: AgentBrain = initParams.brain ?? {} as AgentBrain; + const brain: AgentBrain = initParams?.brain ?? {} as AgentBrain; + const jobs: Array = initParams?.jobs ?? new Array(); //public state - const state = map({ + const state = map({ text: "", component: "AgentBaseText", isVisible: false, @@ -146,6 +148,7 @@ const useAgentSmith = (initParams: AgentSpec): AgentSmith => { interactions, props, brain, + jobs, show, hide, talk,