chore: initial branch commit

This commit is contained in:
Björn Otgaar
2026-01-07 15:44:56 +01:00
parent 4e07b95722
commit ad8111d6c2
2 changed files with 34 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ export type Plan = {
}
export type PlanElement = Goal | Action
export type PlanElementTypes = ActionTypes | "goal"
export type Goal = {
id: string,
@@ -20,7 +21,7 @@ export type SpeechAction = { id: string, text: string, type:"speech" }
export type GestureAction = { id: string, gesture: string, isTag: boolean, type:"gesture" }
export type LLMAction = { id: string, goal: string, type:"llm" }
export type ActionTypes = "speech" | "gesture" | "llm";
export type ActionTypes = "speech" | "gesture" | "llm"
// Extract the wanted information from a plan within the reducing of nodes
@@ -75,7 +76,7 @@ function StepReduce(planElement: PlanElement) {
export function DoesPlanIterate(plan?: Plan) : boolean {
// TODO: should recursively check plans that have goals (and thus more plans) in them.
if (!plan) return false
return plan.steps.filter((step) => step.type == "llm").length > 0;
return plan.steps.filter((step) => step.type == "llm").length > 0 || (plan.steps.filter((x) => x.type == "goal").map((x) => DoesPlanIterate(x.plan))).includes(true);
}
/**