@pi-kaush/pi-tool-call-markers 0.3.7 → 0.3.8

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/CHANGELOG.md CHANGED
@@ -22,6 +22,13 @@
22
22
  existing `!`-block shape (1/0) come from one code path instead of the body
23
23
  width being hardcoded.
24
24
 
25
+ - Separate asked questions with one painted blank row. Adjacent questions ran
26
+ together as one wall of text; each question/answer pair now gets a blank body
27
+ row between it and the next. A lone question keeps its outcome on the
28
+ following line, and a global outcome (still awaiting, or declined) is
29
+ separated from a multi-question ask so it cannot read as answering only the
30
+ last question.
31
+
25
32
  - Extract the railed prompt shell into `src/prompt-shell.ts`. User `!` blocks
26
33
  and asked-question blocks share one implementation of the inset, rail,
27
34
  surface background, and background repaint instead of two.
package/README.md CHANGED
@@ -55,6 +55,7 @@ A call that asks the user something is a user-input moment, not an execution row
55
55
  ▎
56
56
  ▎ > Which call-site shape should `notifications:` use?
57
57
  ▎ User: Nested within subagent (Recommended)
58
+ ▎
58
59
  ▎ > Which tier should the flag read at runtime?
59
60
  ▎ User: Client only, Client and server
60
61
  ▎
@@ -66,6 +67,7 @@ The block reuses `pi-content-layout`'s submitted-prompt geometry — the same ra
66
67
  - **Answers, not options.** Each question shows its answer: an option label, typed custom text, or multi-select labels joined with commas. A question left blank reads `User: (no answer)`, a decline reads `User declined to answer questions`, and a validation failure keeps Pi's native failure row.
67
68
  - **Quoted questions.** The question is the model's text read inside a user-input shell, so it renders italic under a `>` marker and the answer stays upright: the answer is the user's own words. A theme without italics renders the question plainly.
68
69
  - **Prompt-shell tones.** The rail uses `borderAccent` and the body paints on `userMessageBg`, with the question in `text`, the `User:` label in `muted`, the answer in `userMessageText`, and a live row's `awaiting your answer…` in `warning`.
70
+ - **One blank row per question.** Questions are separated by a painted blank row so a multi-question ask stays scannable. A lone question keeps its outcome on the following line.
69
71
  - **No grouping.** Question blocks never join an adjacent tool group and carry no tool glyph. `Ctrl+O` still restores Pi's native expanded rendering.
70
72
 
71
73
  ## Edit diffs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-kaush/pi-tool-call-markers",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Compact and group Pi tool calls, with a bundled extension for adjacent thinking blocks.",
5
5
  "license": "MIT",
6
6
  "author": "Kaushik Gopal",
@@ -41,7 +41,9 @@ type AnswerEntry = {
41
41
  type QuestionLine =
42
42
  | { kind: "question"; text: string }
43
43
  | { kind: "answer"; text: string }
44
- | { kind: "status"; text: string; tone: "muted" | "warning" };
44
+ | { kind: "status"; text: string; tone: "muted" | "warning" }
45
+ // A painted blank body row; the shell gives it the prompt surface.
46
+ | { kind: "spacer" };
45
47
 
46
48
  // rpiv's canonical decline text, reused verbatim so the transcript says what
47
49
  // the model was told.
@@ -173,30 +175,38 @@ function questionLines(
173
175
  }
174
176
  if (pairs.length === 0) return undefined;
175
177
 
176
- const lines: QuestionLine[] = [];
177
- const questions = pairs.map(
178
- (pair): QuestionLine => ({ kind: "question", text: pair.question }),
179
- );
180
- if (row.isPartial === true) {
181
- return [
182
- ...questions,
183
- { kind: "status", text: AWAITING_TEXT, tone: "warning" },
184
- ];
185
- }
186
- if (
178
+ const pending = row.isPartial === true;
179
+ const declined =
180
+ !pending &&
187
181
  isRecord(details) &&
188
182
  details.cancelled === true &&
189
- pairs.every((pair) => pair.answer === undefined)
190
- ) {
191
- return [
192
- ...questions,
193
- { kind: "status", text: DECLINE_TEXT, tone: "muted" },
194
- ];
195
- }
196
- for (const pair of pairs) {
197
- lines.push({ kind: "question", text: pair.question });
198
- lines.push({ kind: "answer", text: pair.answer ?? NO_ANSWER_TEXT });
183
+ pairs.every((pair) => pair.answer === undefined);
184
+
185
+ // One group per question. Groups are separated by a painted blank row so a
186
+ // multi-question ask stays scannable.
187
+ const groups: QuestionLine[][] = pairs.map((pair) => {
188
+ const group: QuestionLine[] = [{ kind: "question", text: pair.question }];
189
+ if (!pending && !declined) {
190
+ group.push({ kind: "answer", text: pair.answer ?? NO_ANSWER_TEXT });
191
+ }
192
+ return group;
193
+ });
194
+ if (pending || declined) {
195
+ const status: QuestionLine = pending
196
+ ? { kind: "status", text: AWAITING_TEXT, tone: "warning" }
197
+ : { kind: "status", text: DECLINE_TEXT, tone: "muted" };
198
+ // A lone question keeps its outcome on the following line; a
199
+ // multi-question ask separates the global outcome so it cannot read as
200
+ // answering only the last question.
201
+ if (groups.length > 1) groups.push([status]);
202
+ else groups[0]!.push(status);
199
203
  }
204
+
205
+ const lines: QuestionLine[] = [];
206
+ groups.forEach((group, index) => {
207
+ if (index > 0) lines.push({ kind: "spacer" });
208
+ lines.push(...group);
209
+ });
200
210
  return lines;
201
211
  }
202
212
 
@@ -258,6 +268,7 @@ function styleLine(
258
268
  width: number,
259
269
  theme: QuestionTheme,
260
270
  ): string[] {
271
+ if (line.kind === "spacer") return [""];
261
272
  const prefix =
262
273
  line.kind === "question"
263
274
  ? QUESTION_PREFIX