MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / sourceForTurn

Function sourceForTurn

projects/openade-module/src/node.ts:60–76  ·  view source on GitHub ↗
(type: OpenADETurnStartRequest["type"], label?: string)

Source from the content-addressed store, hash-verified

58}
59
60function sourceForTurn(type: OpenADETurnStartRequest["type"], label?: string): OpenADEActionEventSource {
61 const userLabel = label || type
62 switch (type) {
63 case "plan":
64 return { type: "plan", userLabel }
65 case "do":
66 return { type: "do", userLabel }
67 case "ask":
68 return { type: "ask", userLabel }
69 case "revise":
70 return { type: "revise", userLabel, parentEventId: "headless" }
71 case "run_plan":
72 return { type: "run_plan", userLabel, planEventId: "headless" }
73 case "hyperplan":
74 return { type: "hyperplan", userLabel, strategyId: "headless" }
75 }
76}
77
78function fallbackTitle(input: string): string {
79 const cleaned = input.replace(/\s+/g, " ").trim()

Callers 1

startTurnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected