@jwilger/pi-development-system 0.39.0 → 0.40.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jwilger/pi-development-system",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "A pi extension package representing a seasoned approach to software development using a full AI SDLC.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -15,10 +15,15 @@ export function registerCompactionResync(deps: { pi: ExtensionAPI; state: Sessio
15
15
  deps.pi.on("session_compact", () => {
16
16
  const state = deps.state.get();
17
17
  if (state.phase === "idle" && state.openDepartures.length === 0) return;
18
- deps.pi.sendMessage({
19
- customType: RESYNC_ENTRY_TYPE,
20
- content: `[devsys resync] Context was compacted. Current working state:\n\n${renderStateBlock(state)}`,
21
- display: true,
22
- });
18
+ // triggerTurn:false: while a run is active pi would otherwise steer the message, and the queued
19
+ // message would force an extra model turn after automatic compaction.
20
+ deps.pi.sendMessage(
21
+ {
22
+ customType: RESYNC_ENTRY_TYPE,
23
+ content: `[devsys resync] Context was compacted. Current working state:\n\n${renderStateBlock(state)}`,
24
+ display: true,
25
+ },
26
+ { triggerTurn: false },
27
+ );
23
28
  });
24
29
  }
@@ -39,7 +39,10 @@ export function registerModelAdvice(deps: ModelAdviceDeps): void {
39
39
  });
40
40
  if (advice === undefined) return;
41
41
  told.add(key);
42
- deps.pi.sendMessage({ customType: ADVICE_ENTRY_TYPE, content: advice, display: true });
42
+ deps.pi.sendMessage(
43
+ { customType: ADVICE_ENTRY_TYPE, content: advice, display: true },
44
+ { triggerTurn: false },
45
+ );
43
46
  };
44
47
 
45
48
  deps.pi.on("session_start", (_event, ctx) => {
@@ -32,13 +32,14 @@ export function assistantParts(message: AgentMessage): Parts | undefined {
32
32
  const LIST_ITEM = /^(?:\d+[.)]|[-*+])\s/;
33
33
 
34
34
  const QUESTION_END = /\?(?:\s*\([^()]{0,40}\))?[\s)"'*_`]*$/;
35
- /** A lead-in that introduces options ("Want me to:", "Which next:") before a bare list. */
36
- const LEAD_IN = /:\s*$/;
35
+ /** A lead-in that asks for a choice ("Want me to:", "Which next:"), not a status summary ("Changes:"). */
36
+ const CHOICE_LEAD_IN =
37
+ /\b(?:want me to|would you like|should i|shall i|which|do you want|let me know|choose|pick)\b[^\n]*:\s*$/i;
37
38
 
38
39
  /**
39
40
  * True when the message ends by asking the user something: the last non-empty line, or the last line
40
41
  * before an option list, ends with a question mark (optionally followed by a short parenthetical
41
- * like "(y/n)"), or a bare option list follows a colon lead-in.
42
+ * like "(y/n)"), or a bare option list follows a lead-in that asks for a choice. A plain "Summary:" list is not a question.
42
43
  */
43
44
  export function asksUser(text: string): boolean {
44
45
  const lines = text
@@ -50,7 +51,7 @@ export function asksUser(text: string): boolean {
50
51
  if (QUESTION_END.test(last)) return true;
51
52
  const lead = lines.filter((l) => !LIST_ITEM.test(l)).at(-1);
52
53
  if (lead === undefined) return false;
53
- return QUESTION_END.test(lead) || (LIST_ITEM.test(last) && LEAD_IN.test(lead));
54
+ return QUESTION_END.test(lead) || (LIST_ITEM.test(last) && CHOICE_LEAD_IN.test(lead));
54
55
  }
55
56
 
56
57
  /** True when a scope.expansion departure already covers the slice: the remedy the note asks for exists. */