pi-goal-x 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,69 @@
1
+ export const SISYPHUS_STEP_TOOL_NAME = "step_complete";
2
+ export const TWEAK_APPLY_TOOL_NAME = "apply_goal_tweak";
3
+ export const PROPOSE_DRAFT_TOOL_NAME = "propose_goal_draft";
4
+ export const CREATE_GOAL_TOOL_NAME = "create_goal";
5
+ export const QUESTION_TOOL_NAME = "goal_question";
6
+ export const QUESTIONNAIRE_TOOL_NAME = "goal_questionnaire";
7
+ export const ABORT_GOAL_TOOL_NAME = "abort_goal";
8
+
9
+ export const ACTIVE_GOAL_TOOL_NAMES = ["get_goal", "update_goal", "pause_goal", ABORT_GOAL_TOOL_NAME] as const;
10
+ export const PAUSED_GOAL_TOOL_NAMES = ["get_goal", "update_goal", ABORT_GOAL_TOOL_NAME] as const;
11
+ export const NO_FOCUSED_GOAL_TOOL_NAMES = ["get_goal"] as const;
12
+
13
+ export const GOAL_WORK_TOOL_NAMES = [
14
+ "update_goal",
15
+ "pause_goal",
16
+ ABORT_GOAL_TOOL_NAME,
17
+ TWEAK_APPLY_TOOL_NAME,
18
+ CREATE_GOAL_TOOL_NAME,
19
+ PROPOSE_DRAFT_TOOL_NAME,
20
+ QUESTION_TOOL_NAME,
21
+ QUESTIONNAIRE_TOOL_NAME,
22
+ "get_goal",
23
+ "write",
24
+ "edit",
25
+ "bash",
26
+ "read",
27
+ "grep",
28
+ "find",
29
+ "ls",
30
+ ] as const;
31
+
32
+ export const GOAL_PROGRESS_TOOL_NAMES = [
33
+ "update_goal",
34
+ "pause_goal",
35
+ ABORT_GOAL_TOOL_NAME,
36
+ TWEAK_APPLY_TOOL_NAME,
37
+ "write",
38
+ "edit",
39
+ "bash",
40
+ "read",
41
+ "grep",
42
+ "find",
43
+ "ls",
44
+ ] as const;
45
+
46
+ export const POST_STOP_ALLOWED_TOOLS = ["get_goal"] as const;
47
+
48
+ export type GoalToolStatus = "active" | "paused" | "complete" | null | undefined;
49
+
50
+
51
+ export type GoalToolPhase = "normal" | "drafting" | "tweakDrafting";
52
+
53
+ export function lifecycleToolNamesForGoalStatus(status: GoalToolStatus, phase: GoalToolPhase = "normal"): readonly string[] {
54
+ if (phase === "drafting" || phase === "tweakDrafting") return NO_FOCUSED_GOAL_TOOL_NAMES;
55
+ if (status === "active") return ACTIVE_GOAL_TOOL_NAMES;
56
+ if (status === "paused") return PAUSED_GOAL_TOOL_NAMES;
57
+ return NO_FOCUSED_GOAL_TOOL_NAMES;
58
+ }
59
+
60
+ export function isQuestionLikeToolName(toolName: string): boolean {
61
+ const lower = toolName.toLowerCase();
62
+ return lower === QUESTION_TOOL_NAME
63
+ || lower === QUESTIONNAIRE_TOOL_NAME
64
+ || lower.includes("question")
65
+ || lower.includes("questionnaire")
66
+ || lower.includes("ask")
67
+ || lower.includes("clarify")
68
+ || lower.includes("confirm");
69
+ }