@juicesharp/rpiv-ask-user-question 1.2.1 → 1.3.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.
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  import { displayLabel } from "./state/i18n-bridge.js";
3
3
  import { QuestionnaireSession } from "./state/questionnaire-session.js";
4
4
  import { sentinelsToAppend } from "./state/row-intent.js";
package/index.ts CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  import { readFileSync } from "node:fs";
19
19
  import { fileURLToPath } from "node:url";
20
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
20
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
21
21
  import { registerAskUserQuestionTool } from "./ask-user-question.js";
22
22
  import { I18N_NAMESPACE } from "./state/i18n-bridge.js";
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-ask-user-question",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Pi extension. A structured questionnaire the model can put to you when it would otherwise guess, with typed options instead of free-form replies.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -72,8 +72,8 @@
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@juicesharp/rpiv-i18n": "*",
75
- "@mariozechner/pi-coding-agent": "*",
76
- "@mariozechner/pi-tui": "*",
75
+ "@earendil-works/pi-coding-agent": "*",
76
+ "@earendil-works/pi-tui": "*",
77
77
  "typebox": "*"
78
78
  },
79
79
  "peerDependenciesMeta": {
@@ -1,5 +1,5 @@
1
- import { getMarkdownTheme, type Theme } from "@mariozechner/pi-coding-agent";
2
- import { Input } from "@mariozechner/pi-tui";
1
+ import { getMarkdownTheme, type Theme } from "@earendil-works/pi-coding-agent";
2
+ import { Input } from "@earendil-works/pi-tui";
3
3
  import type { QuestionData } from "../tool/types.js";
4
4
  import {
5
5
  type BoundGlobalBinding,
@@ -1,4 +1,4 @@
1
- import { Key, matchesKey } from "@mariozechner/pi-tui";
1
+ import { Key, matchesKey } from "@earendil-works/pi-tui";
2
2
  import type { QuestionAnswer } from "../tool/types.js";
3
3
  import { ROW_INTENT_META } from "./row-intent.js";
4
4
  import type { QuestionnaireRuntime, QuestionnaireState } from "./state.js";
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import { getKeybindings, type Input } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import { getKeybindings, type Input } from "@earendil-works/pi-tui";
3
3
  import type { QuestionData, QuestionnaireResult, QuestionParams } from "../tool/types.js";
4
4
  import type { WrappingSelectItem } from "../view/components/wrapping-select.js";
5
5
  import type { QuestionnairePropsAdapter } from "../view/props-adapter.js";
@@ -1,4 +1,4 @@
1
- import type { Component } from "@mariozechner/pi-tui";
1
+ import type { Component } from "@earendil-works/pi-tui";
2
2
 
3
3
  /**
4
4
  * Emits `max(0, getMax(width) - getCurrent(width))` empty rows. Used in
@@ -1,4 +1,4 @@
1
- import type { Component } from "@mariozechner/pi-tui";
1
+ import type { Component } from "@earendil-works/pi-tui";
2
2
  import type { StatefulView } from "../stateful-view.js";
3
3
  import { WrappingSelect, type WrappingSelectItem, type WrappingSelectTheme } from "./wrapping-select.js";
4
4
 
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
3
3
  import { displayLabel } from "../../state/i18n-bridge.js";
4
4
  import type { QuestionData } from "../../tool/types.js";
5
5
  import type { StatefulView } from "../stateful-view.js";
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import { Markdown, type MarkdownTheme, visibleWidth } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import { Markdown, type MarkdownTheme, visibleWidth } from "@earendil-works/pi-tui";
3
3
  import { t } from "../../../state/i18n-bridge.js";
4
4
  import type { QuestionData } from "../../../tool/types.js";
5
5
  import { stripFenceMarkers } from "./preview-box-renderer.js";
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import type { MarkdownTheme } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import type { MarkdownTheme } from "@earendil-works/pi-tui";
3
3
  import { t } from "../../../state/i18n-bridge.js";
4
4
  import type { QuestionData } from "../../../tool/types.js";
5
5
  import {
@@ -1,4 +1,4 @@
1
- import { truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
1
+ import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
2
2
 
3
3
  const ANSI_SGR_RE = /\x1b\[[0-9;]*m/g;
4
4
  const ANSI_OSC8_RE = /\x1b\]8;[^\x07\x1b]*(?:\x07|\x1b\\)/g;
@@ -1,4 +1,4 @@
1
- import { visibleWidth } from "@mariozechner/pi-tui";
1
+ import { visibleWidth } from "@earendil-works/pi-tui";
2
2
  import type { QuestionData } from "../../../tool/types.js";
3
3
  import type { WrappingSelectItem } from "../wrapping-select.js";
4
4
  import { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL } from "./preview-box-renderer.js";
@@ -1,4 +1,4 @@
1
- import { type Component, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
1
+ import { type Component, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
2
2
  import type { QuestionData } from "../../../tool/types.js";
3
3
  import type { StatefulView } from "../../stateful-view.js";
4
4
  import type { OptionListView } from "../option-list-view.js";
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import { truncateToWidth } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import { truncateToWidth } from "@earendil-works/pi-tui";
3
3
  import { t } from "../../state/i18n-bridge.js";
4
4
  import type { StatefulView } from "../stateful-view.js";
5
5
 
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import { truncateToWidth } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import { truncateToWidth } from "@earendil-works/pi-tui";
3
3
  import type { StatefulView } from "../stateful-view.js";
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import type { Component } from "@mariozechner/pi-tui";
2
- import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
1
+ import type { Component } from "@earendil-works/pi-tui";
2
+ import { visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
3
3
 
4
4
  /**
5
5
  * Row-intent discriminated union. `kind` is the single discriminator —
@@ -173,7 +173,7 @@ export class WrappingSelect implements Component {
173
173
  const contentWidth = Math.max(WrappingSelect.MIN_CONTENT_WIDTH, width - visibleWidth(rowPrefix));
174
174
 
175
175
  if (this.shouldRenderAsInlineInput(item, isActive)) {
176
- return [this.renderInlineInputRow(rowPrefix, width)];
176
+ return this.renderInlineInputRow(rowPrefix, continuationPrefix, contentWidth);
177
177
  }
178
178
 
179
179
  // Confirmed row gets a trailing ` ✔` and accent+bold styling; pointer is independent
@@ -205,9 +205,24 @@ export class WrappingSelect implements Component {
205
205
  return item.kind === "other" && isActive;
206
206
  }
207
207
 
208
- private renderInlineInputRow(rowPrefix: string, width: number): string {
209
- const raw = `${rowPrefix}${this.inputBuffer}${WrappingSelect.INPUT_CURSOR}`;
210
- return truncateToWidth(this.theme.selectedText(raw), width, "");
208
+ /**
209
+ * Render the inline input row across one or more lines, wrapping at `contentWidth`
210
+ * so long input doesn't run off the right edge or trip the parent renderer's
211
+ * width invariant. Mirrors `renderLabelBlock`'s contract: first line carries
212
+ * `rowPrefix`, continuation lines carry `continuationPrefix` (spaces), and every
213
+ * emitted line passes through `theme.selectedText`. The trailing cursor glyph
214
+ * `▌` is appended to the buffer pre-wrap so it lands at the visual end of the
215
+ * input — `Input` only exposes `getValue()` (cursor offset is private), so
216
+ * cursor-mid-string is intentionally not rendered here; that would require
217
+ * either an `Input.getCursorOffset()` API or delegating to `Input.render`.
218
+ */
219
+ private renderInlineInputRow(rowPrefix: string, continuationPrefix: string, contentWidth: number): string[] {
220
+ const raw = `${this.inputBuffer}${WrappingSelect.INPUT_CURSOR}`;
221
+ const wrapped = wrapTextWithAnsi(raw, contentWidth);
222
+ return wrapped.map((segment, index) => {
223
+ const prefix = index === 0 ? rowPrefix : continuationPrefix;
224
+ return this.theme.selectedText(`${prefix}${segment}`);
225
+ });
211
226
  }
212
227
 
213
228
  private renderLabelBlock(
@@ -1,5 +1,5 @@
1
- import { DynamicBorder, type Theme } from "@mariozechner/pi-coding-agent";
2
- import { type Component, Container, type Input, Spacer } from "@mariozechner/pi-tui";
1
+ import { DynamicBorder, type Theme } from "@earendil-works/pi-coding-agent";
2
+ import { type Component, Container, type Input, Spacer } from "@earendil-works/pi-tui";
3
3
  import type { QuestionnaireState } from "../state/state.js";
4
4
  import type { QuestionData } from "../tool/types.js";
5
5
  import { BodyResidualSpacer } from "./body-residual-spacer.js";
@@ -1,4 +1,4 @@
1
- import type { Input } from "@mariozechner/pi-tui";
1
+ import type { Input } from "@earendil-works/pi-tui";
2
2
  import type { BindingContext, PerTabBindingContext } from "../state/selectors/contract.js";
3
3
  import { selectActivePreviewPaneIndex } from "../state/selectors/derivations.js";
4
4
  import { selectActiveView } from "../state/selectors/focus.js";
@@ -1,4 +1,4 @@
1
- import type { Component } from "@mariozechner/pi-tui";
1
+ import type { Component } from "@earendil-works/pi-tui";
2
2
 
3
3
  /**
4
4
  * Generic prop-driven component contract. Every renderable owns its own `P` shape;
@@ -1,5 +1,5 @@
1
- import type { Theme } from "@mariozechner/pi-coding-agent";
2
- import { type Component, Container, type Input, Spacer, Text } from "@mariozechner/pi-tui";
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import { type Component, Container, type Input, Spacer, Text } from "@earendil-works/pi-tui";
3
3
  import { t } from "../state/i18n-bridge.js";
4
4
  import { formatAnswerScalar } from "../tool/format-answer.js";
5
5
  import type { QuestionData } from "../tool/types.js";