pi-goal-x 0.18.1 → 0.18.3

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.
@@ -210,7 +210,9 @@ export function goalDraftingPrompt(topic: string, focus: GoalDraftingFocus): str
210
210
  "- If the topic is already concrete, you may proceed directly to propose_goal_draft.",
211
211
  "- The goal contract should make the objective, success criteria, boundaries, constraints, and blocker rule explicit.",
212
212
  "- Keep grilling assumptions until the objective, success criteria, boundaries, constraints, and blocker rule are clear enough to confirm.",
213
- "- After a goal is confirmed, you may call propose_task_list on the first continuation turn if the objective naturally decomposes into trackable milestones. Do not add a task list for simple, single-step goals.",
213
+ "- If the objective naturally decomposes into trackable milestones, you MUST include the task list in the `tasks` parameter of `propose_goal_draft` so the user can accept both goal and tasks in a single confirmation dialog. Do NOT propose the goal without tasks and then call `propose_task_list` separately.",
214
+ "- For simple single-step goals, no task list is required. The `tasks` parameter can be omitted.",
215
+ "- After goal creation, `propose_task_list` is still available for user-requested task additions or structural changes.",
214
216
  "- propose_goal_draft opens the user's Confirm / Continue Chatting dialog. Confirm creates and focuses the goal; Continue Chatting means keep refining through normal proposal cycles.",
215
217
  "- create_goal is not a shortcut. Direct create_goal calls are rejected so the user keeps explicit say in goal creation.",
216
218
  ];
@@ -314,10 +314,13 @@ export async function runGoalQuestionnaire(ctx: ExtensionContext, rawQuestions:
314
314
  * Wraps a pipe-prefixed line and prepends "│ " to continuation lines
315
315
  * so wrapped content stays within the ASCII box.
316
316
  */
317
+ const PIPE_PREFIX = "│ ";
318
+ const PIPE_WIDTH = visibleWidth(PIPE_PREFIX);
317
319
  const addWrappedPipe = (styledLine: string) => {
318
- const wrapped = wrapTextWithAnsi(styledLine, safeWidth);
320
+ const wrapWidth = Math.max(1, safeWidth - PIPE_WIDTH);
321
+ const wrapped = wrapTextWithAnsi(styledLine, wrapWidth);
319
322
  for (let i = 0; i < wrapped.length; i++) {
320
- lines.push(i === 0 ? wrapped[i] : "│ " + wrapped[i]);
323
+ lines.push(i === 0 ? wrapped[i] : PIPE_PREFIX + wrapped[i]);
321
324
  }
322
325
  };
323
326
 
@@ -488,6 +491,12 @@ export async function runGoalQuestionnaire(ctx: ExtensionContext, rawQuestions:
488
491
  add(theme.fg("dim", isMulti ? " Tab/←→ navigate • ↑↓ select • Enter confirm • Esc cancel" + auditorHint : " ↑↓ navigate • Enter select • Esc cancel" + auditorHint));
489
492
  }
490
493
  add(theme.fg("accent", "─".repeat(safeWidth)));
494
+ // Safety net: ensure no returned line exceeds the terminal width
495
+ for (let i = 0; i < lines.length; i++) {
496
+ if (lines[i] && visibleWidth(lines[i]) > safeWidth) {
497
+ lines[i] = truncateToWidth(lines[i], safeWidth);
498
+ }
499
+ }
491
500
  cachedLines = lines;
492
501
  return lines;
493
502
  }
@@ -130,7 +130,11 @@ ${untrustedObjectiveBlock(goal)}
130
130
 
131
131
  Available work tools for pursuing the active goal include write, read, bash, and edit. Use those tools directly for file and shell work; do not call get_goal repeatedly to discover tools.
132
132
 
133
- After goal confirmation, you may call propose_task_list once to set up an initial task list if the objective decomposes into trackable milestones. If a task list already exists, only restructure it when the user asks or the goal structurally changes do not restructure autonomously. Do not add a task list for simple, single-step goals.
133
+ If the objective naturally decomposes into trackable milestones, you MUST include the task list in the tasks parameter of propose_goal_draft so the user can accept both goal and tasks in a single confirmation dialog. Do NOT propose the goal without tasks and then call propose_task_list separately. For simple single-step goals, no task list is required.
134
+
135
+ If a task list already exists, only restructure it when the user asks or the goal structurally changes — do not restructure autonomously.
136
+
137
+ After goal creation, propose_task_list is still available for user-requested task additions or structural changes.
134
138
 
135
139
  [TASK WORKFLOW]
136
140
  Use tasks and subtasks as PROGRESS TRACKERS during your work — not as a post-hoc checklist to batch-mark at the end. As soon as you finish a concrete unit of work that corresponds to a task or subtask, call complete_task immediately with evidence of what you did. The system enforces that all subtasks must be completed (or skipped) before their parent task can be completed, so work from the leaves up: finish subtasks first, then mark the parent task complete. If a subtask is blocked and cannot proceed, call pause_goal rather than skipping it. This keeps the task list accurate and prevents the "all work done, now batch-mark everything" pattern.
@@ -77,7 +77,8 @@ export async function showEscapeDialog(
77
77
 
78
78
  // ── Header ────────────────────────────────────────────────
79
79
  lines.push(accent(`┌${horizLine}┐`));
80
- lines.push(line(p + theme.bold("Audit interrupted by Escape") + dim(" (continue = default)")));
80
+ const headerContent = p + theme.bold("Audit interrupted by Escape") + dim(" (continue = default)");
81
+ lines.push(line(truncateToWidth(headerContent, innerWidth, "…")));
81
82
  const truncatedObjective = truncateToWidth(goalObjective, innerWidth - 14, "…");
82
83
  lines.push(line(p + dim("Goal: ") + dim(truncatedObjective)));
83
84
  lines.push(accent(`├${horizLine}┤`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-x",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "Goal mode extension for pi: persistent long-running objectives, /goal-set drafting, Sisyphus prompt style, autoContinue, and an above-editor status overlay. Fork of @capyup/pi-goal.",
5
5
  "license": "MIT",
6
6
  "author": "pi-goal-x contributors",