@lune_99/pi-ask-question 0.0.0-stage → 0.1.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/CHANGELOG.md +66 -0
- package/LICENSE +21 -0
- package/README.md +101 -2
- package/docs/question-answer-row.png +0 -0
- package/docs/question-answer-row.svg +16 -0
- package/docs/question-dock.png +0 -0
- package/docs/question-dock.svg +8 -0
- package/docs/question-panel.png +0 -0
- package/docs/question-panel.svg +58 -0
- package/package.json +62 -5
- package/src/commands/question.ts +25 -0
- package/src/core/question-delivery.ts +111 -0
- package/src/core/question-format.ts +109 -0
- package/src/core/question-notification.ts +34 -0
- package/src/core/question-types.ts +91 -0
- package/src/core/questionManager.ts +484 -0
- package/src/index.ts +142 -0
- package/src/tools/ask-user-questions.ts +184 -0
- package/src/tui/panel/question-panel-controller.ts +261 -0
- package/src/tui/panel/question-panel-renderer.ts +813 -0
- package/src/tui/panel/question-panel.ts +702 -0
- package/src/tui/preview/preview-box.ts +168 -0
- package/src/tui/preview/preview-layout.ts +116 -0
- package/src/tui/preview/preview-renderer.ts +129 -0
- package/src/tui/question-answer-message.ts +42 -0
- package/src/tui/question-dock-contribution.ts +41 -0
- package/src/tui/question-dock.ts +68 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Optional Lune Dock integration.** Pending request counts join the unified status row when its host is active, and Enter opens the same panel as `/question`. The unified item shows the count, name and status dot without a leading module icon. Without the host, the existing question dock remains available.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Published Core dependency.** Require `@lune_99/pi-lune-core@^0.1.0` from npm instead of a sibling checkout. Core remains a mandatory runtime dependency for shared infrastructure and settings.
|
|
12
|
+
|
|
13
|
+
- **Dock protocol from Core.** Use `createDockContribution` and its types from
|
|
14
|
+
`@lune_99/pi-lune-core/dock` to join the optional shared Dock. Core supplies the
|
|
15
|
+
scoped registry and contributor lifecycle.
|
|
16
|
+
|
|
17
|
+
- **BREAKING: Lune Protocol v1 Draft 3 snapshots.** Publish plugin-styled, single-line base/detail/full Components instead of business summary fields. Idle providers stay registered; Dock owns density, visibility and order, while Enter opens the existing plugin UI. Update the host and both plugins together.
|
|
18
|
+
|
|
19
|
+
- **Simplified Dock integration.** The shared contributor adapter owns registration,
|
|
20
|
+
session UI cleanup, and host-presence switching. The existing independent status bar is
|
|
21
|
+
restored immediately when Lune Dock is disabled through `/dock` or is absent.
|
|
22
|
+
|
|
23
|
+
## [0.1.0] - 2026-10-03
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **Interactive question panel.** `ask_user_questions` opens a centered overlay as soon as the tool call arrives: tabbed questions, numbered options with descriptions, multi-select checkboxes, and a `Type something` row for free-form answers. `displayText` renders as Markdown above the options, and a single-question request submits on the option press while several questions walk through a Submit tab.
|
|
28
|
+
- **Option preview pane.** An option's `preview` renders as Markdown in a bordered pane beside the options while it is focused, side by side on wide terminals and stacked under them on narrow ones. The pane is titled with the option label in its border, trimmed of the blank lines a preview may carry, and only as tall as what is left after trimming. The pane keeps its place with a `No preview available` placeholder for an option without a preview, and steps aside while the free-form editor is open so typing gets the full width. The block is sized to the room the panel actually has - rows that no longer fit are reported in its bottom border instead of being clipped, and on a terminal too short for even that the pane is left out rather than drawn half-height.
|
|
29
|
+
- **Deferred answering, skipping and handover.** Esc closes the panel without settling the request, keeping the focused row and written drafts in `questionManager`, and `⇧S` skips the whole request. The below-editor dock shows `N pending question · <question> · /question to answer`, and `/question` reopens the next pending request with its draft. A request that arrives while a panel is open no longer needs `/question`: answering (or skipping) the current one hands the panel over to the next pending request on its own. A defer is quiet on purpose - it ends the chain and leaves every request pending for `/question` or the next incoming request.
|
|
30
|
+
- **Async answers and restart persistence.** The tool returns while the panel stays open; answering or skipping sends a `lune-ask-question-answer` follow-up message (`triggerTurn`, `deliverAs: "steer"`) so the model resumes, rendered as a "Questions answered" or "Questions skipped" row. The message is sent exactly once per settle, and a delivery that fails outright is reported in the UI instead of dropping the answer silently. Pending questions and drafts are snapshotted with `pi.appendEntry` and restored from the active branch on `session_start` and `session_tree`, so a question survives Esc and a Pi restart.
|
|
31
|
+
- **Real-TUI observer.** `npm run tui:demo` starts Pi with a scripted faux model that asks one question, for watching the panel, Esc, `/question` and `⇧S` by hand; `LAQ_DEMO=two npm run tui:demo` queues a second request while the first panel is open to watch the handover.
|
|
32
|
+
- **README and generated reference images.** `npm run docs:images` renders the README screenshots (`docs/question-panel.png`, `question-dock.png`, `question-answer-row.png`) from the real panel, dock and answer-row renderers against Pi's dark theme palette, and the package declares its gallery image. The images are regenerated by one command instead of re-photographed, so they cannot drift from the UI. Needs `rsvg-convert`.
|
|
33
|
+
- **Mouse support for tabs and the editor.** In pi's fullscreen mode (the default since pi 1.0.0) a click on a tab switches questions and a click in the open editor moves its cursor. Option rows stay keyboard-only: a click neither focuses nor confirms one, and a press that hits no tab or editor is left to pi's text selection, so the panel's text can still be copied.
|
|
34
|
+
- **Wheel scrolling for the body and the preview.** The wheel scrolls the body, so a question or `displayText` taller than the panel can be read from the top instead of only around the focused row, and over the preview pane it scrolls the preview, whose border now reports rows hidden above and below. The next key or a tab switch returns the body to the focused row.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- **`displayText` and `options[].preview` have separate jobs.** `displayText` is the context every option shares - a diff, an excerpt, the values in play - while a preview belongs to one option and changes with focus, so the same block does not have to be written into both. The old wording described the two as equally suitable for code and snippets, which invited the model to duplicate them.
|
|
39
|
+
- **A new question outranks one that was only deferred.** The panel picks the least recently shown pending request, so a question that just arrived surfaces immediately instead of an older one the user dismissed with Esc; requests that were never shown keep their creation order. `/question` and the below-editor dock follow the same order.
|
|
40
|
+
- **BREAKING: every question now needs a short `header`.** `ask_user_questions` requires a subject label per question (`Storage`, `Auth`, `Timeouts`) and the panel shows it as the tab label, on the submit row and on the answer row; the generated `Q1`/`Q2` numbering is gone from the panel, the tool result and the follow-up message. The header is required rather than derived from the question text, because a truncated sentence reads worse in a tab than a label and a number says nothing about where the tab leads.
|
|
41
|
+
- **The panel is only as tall as its content.** The body no longer pads itself to a fixed height or stops at a fixed row cap: a request is rendered whole while the terminal has room for it, and only scrolls when it genuinely does not fit the screen. A short question therefore covers as little of the transcript as possible, and a long one is not clipped to an arbitrary number of rows.
|
|
42
|
+
- **The free-form row no longer mirrors typing.** `Type something` stays in place while the editor is open and the row shows an answer only once it is committed, so it no longer rewrites itself on every keystroke or follows edits to an answer that was already written. The draft is untouched: it still lives in the editor, survives Esc, and is restored with the request.
|
|
43
|
+
- **Typing on the free-form row opens the editor.** Focusing `Type something` and pressing a printable key starts the answer without `Enter` first, and on that row the single-key shortcuts are text while they keep working on the option rows and on the submit tab.
|
|
44
|
+
- **`options[].example` is now `options[].preview`.** The field holds Markdown and renders in a pane beside the options for the focused option instead of as one grey line under every option, which is what makes code, config blocks and mockups comparable before answering. A preview is display input only: it is never echoed into the answer the model receives.
|
|
45
|
+
- **Extension surface.** The scaffold's placeholder `ask-question` tool and `/ask` command are replaced by `ask_user_questions` (model-only, sequential) and `/question`; outside the interactive TUI the tool reports that plain text is required instead of waiting for an answer that can never arrive.
|
|
46
|
+
- **The model-facing tool result is a status line.** `ask_user_questions` no longer echoes the request id or repeats the questions, which are already in the tool call's own arguments; the id stays in the result `details` for the UI.
|
|
47
|
+
- **The answer message stores only what the transcript shows.** `details.questions` carries the header, the prompt and the option labels instead of the whole question, so a `displayText` or an option `preview` no longer stays in the session file forever.
|
|
48
|
+
- **Peer dependencies follow the Pi package contract.** The host-provided packages stay on the `"*"` range Pi requires, and the redundant `peerDependenciesMeta.optional` is gone: Pi already suppresses peer installation, and an extension cannot run without them. `devDependencies` names the versions this release is tested against, currently Pi 1.0.0.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- **An answer survives until the session really carries it.** `pi.sendMessage()` only queues a steered message and can drop it, while the answered request left the durable snapshot the moment it settled - so an answer lost from pi's queue was gone for good. Settled answers and skips now stay in a durable outbox until the session branch holds their `lune-ask-question-answer` message (matched by `requestId`); a restore retries delivery while it is missing and releases the entry once it is there.
|
|
53
|
+
- **The tab strip no longer scrolls out of view.** When a request's content was taller than the panel's height cap, the body scrolled and took the tabs with it, leaving a multi-question panel with no way to see or reach the other questions. The strip is now pinned above the scrolling body, which itself only appears when the content does not fit the terminal.
|
|
54
|
+
- **A large paste survives Esc and a restart.** The draft was captured with `Editor.getText()`, which returns a `[paste #1 +12 lines]` marker for any paste over ten lines or a thousand characters; that marker was what got restored, and the pasted answer was gone. Capture now uses `getExpandedText()`, so a pasted answer comes back whole.
|
|
55
|
+
- **A session start does not render into the session that replaced it.** Listeners were replaced after the state reset, so clearing the old state woke the previous session's still-subscribed listener and drew a dock through its context. They are replaced before any change that would wake them.
|
|
56
|
+
- **A stale panel cannot take over the panel that replaced it.** Overlay ownership was a boolean that a session boundary cleared, so a panel that resolved after `/reload`, `/resume` or `/tree` released - and its loop kept using - the panel of the session that had replaced it. Opening is now guarded by a generation and an owner token, and `session_tree` resets them the way `session_start` does, so `/question` still opens after a tree jump.
|
|
57
|
+
- **Skipping works on a free-form question.** A free-form request opens its editor immediately and the editor turns printable keys into text, so a plain `s` could never reach the skip shortcut - while the footer advertised it. Skip is now `Shift+S`, and a plain `s` is always the letter it is; the one place that asks for `Enter` first is a `Type something` row whose answer starts with a capital `S`.
|
|
58
|
+
- **Shift+S skips on terminals using the Kitty keyboard protocol.** The shortcut only matched the literal `"S"` byte, but a kitty-protocol terminal reports a modified key as a CSI sequence such as `\x1b[115:83;2u` instead, so skip was unreachable there while the footer advertised it. The key is now matched through pi's own key parser, which accepts every spelling of `Shift+S`.
|
|
59
|
+
- **A failed snapshot no longer sticks the panel.** `Esc` wrote the snapshot before closing the overlay, so a throwing `appendEntry` left the panel up with no way out, and the same throw could cut short a shutdown or a tree switch. Persistence now reports the failure instead of raising it, and the overlay closes either way.
|
|
60
|
+
- **The dock follows the request `/question` would reopen.** `markShown` moved a request behind the ones it had already been shown after without emitting an event, so the dock could name one question while `/question` opened another. It now emits `request-shown`, which also writes the new order to the session immediately instead of at the next settle point.
|
|
61
|
+
- **A snapshot that could not be written is reported.** Listener failures were swallowed, which could hide a persistence error while the in-memory state moved on. The manager reports them, and the extension says that the question state could not be saved.
|
|
62
|
+
- **The open editor is no longer clipped while the answer grows.** The body window followed the focused option row, so an answer taller than the room left under the question pushed the editor's bottom border, the `Enter to submit` hint and the cursor past the panel's bottom edge - the newest lines looked like they had left the input box. While the editor owns the keys the window now scrolls to hold the whole editor block, falling back to the cursor line when the block itself cannot fit, and a wheel scroll still pins wherever the reader left it.
|
|
63
|
+
|
|
64
|
+
### Refactored
|
|
65
|
+
|
|
66
|
+
- **The panel's interaction model and renderer are separate modules.** `QuestionPanelController` owns the draft transitions and the row model, `QuestionPanelRenderer` owns the frame, option rows and preview layout, and `QuestionPanel` is left with input routing, editor ownership and overlay lifecycle. The draft stays the single source of interaction state, so existing exports, behavior and persistence are unchanged.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nouvelle-Lune
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Lune Ask Question
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@lune_99/pi-ask-question) [](https://www.npmjs.com/package/@lune_99/pi-ask-question) [](https://github.com/Nouvelle-Lune/lune-pi/blob/main/packages/pi-ask-question/LICENSE)
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**Structured questions for [Pi](https://pi.dev): the model asks, the panel opens, and your answer reaches it when you are ready.**
|
|
8
|
+
|
|
9
|
+
`ask_user_questions` is for the decisions the model should not make on its own. Asking is asynchronous: the question waits in the session while the model keeps working on everything that does not depend on it, and your answer - or a skip - arrives back as a message that resumes it. Read the panel, take your time, and answer when you get to it.
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Install from npm:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pi install npm:@lune_99/pi-ask-question
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Then start Pi normally:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pi
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What it does
|
|
27
|
+
|
|
28
|
+
- **Asks without stopping the turn.** The panel opens over the session the moment a decision is needed, and the model carries on with the parts that do not depend on the answer instead of waiting for you.
|
|
29
|
+
- **Brings the answer back into the session.** Answering or skipping adds a `Questions answered` or `Questions skipped` row to the transcript and resumes the model from there.
|
|
30
|
+
- **A question waits as long as you need.** `Esc` closes the panel without settling anything: a dock below the editor says a question is still pending, and `/question` reopens it with the focused row and your drafts intact.
|
|
31
|
+
- **Survives a restart.** A pending question and what you had written come back after `/reload`, `/resume` or `/tree`.
|
|
32
|
+
- **Compares options before answering.** An option can carry a Markdown preview - a diff, a config block, a mockup - in a pane beside the options, side by side on a wide terminal and stacked under them on a narrow one. A preview is only for you: it never becomes the answer.
|
|
33
|
+
- **Only as tall as its content.** A short question covers as little of the transcript as possible; a long one scrolls, with the tab strip pinned above the body. While you are writing an answer, the body scrolls with you to keep the whole input box - and its cursor - in view instead of clipping the newest lines.
|
|
34
|
+
|
|
35
|
+
## Panel
|
|
36
|
+
|
|
37
|
+
| Key | |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `↑` `↓`, `k` `j` | Move between option rows |
|
|
40
|
+
| `Enter` | Confirm the focused row - on a submit row it submits |
|
|
41
|
+
| `Space` | Toggle the focused option in a multi-select question |
|
|
42
|
+
| `1`–`9` | Pick an option by number |
|
|
43
|
+
| `Tab`, `⇧Tab`, `←` `→` | Switch question tabs and the `✓ Submit` tab |
|
|
44
|
+
| Any printable key except `⇧S` on `Type something` | Open the answer editor with that key |
|
|
45
|
+
| `Enter` in the editor | Submit the written answer |
|
|
46
|
+
| `Esc` in the editor | Back to the options, keeping the draft |
|
|
47
|
+
| `Esc` | Close the panel and leave the request pending |
|
|
48
|
+
| `⇧S` | Skip the whole request; inside the editor `S` is text, so leave it with `Esc` first |
|
|
49
|
+
|
|
50
|
+
A single-question request submits on the option press. Several questions walk through their tabs and meet on the `✓ Submit` tab, and submitting with a gap jumps to the first unanswered question instead of doing nothing.
|
|
51
|
+
|
|
52
|
+
Skip is `Shift+S`, so a plain `s` stays available as the first letter of an answer; on a `Type something` row, an answer that starts with a capital `S` starts with `Enter` instead.
|
|
53
|
+
|
|
54
|
+
In pi's fullscreen mode the panel also takes the mouse:
|
|
55
|
+
|
|
56
|
+
| Mouse | |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| Click a tab | Switch question tabs |
|
|
59
|
+
| Click in the editor | Move the cursor |
|
|
60
|
+
| Wheel over the preview | Scroll the preview |
|
|
61
|
+
| Wheel elsewhere | Scroll the body, including a long question or `displayText` |
|
|
62
|
+
|
|
63
|
+
Option rows stay keyboard-only - a click neither focuses nor confirms one - and a press that hits no tab or editor is left to pi's text selection, so the panel's text can still be copied. Regular mode keeps the terminal's own mouse handling, and every action above also has a key.
|
|
64
|
+
|
|
65
|
+
Answers land in the transcript and resume the model:
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
## Pending questions
|
|
70
|
+
|
|
71
|
+
`Esc` is a defer, not a dismissal: the panel closes, the request stays pending, and the dock under the editor says which question `/question` would show next.
|
|
72
|
+
|
|
73
|
+
With the optional **Lune Dock** host active, this independent row is replaced by a shared one-line dock. Press Down in an empty main editor, select a module with Left/Right, and press Enter to open its panel directly. Closing the panel returns to dock focus. The plugin publishes its own single-line `base`, `detail`, and `full` Components through the Dock protocol in `@lune_99/pi-lune-extensions-core/dock`; `/dock` controls density, visibility and order. Idle state remains available in the shared Dock, and hiding the plugin keeps its snapshots current. Removing the host restores the independent row.
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
A question that just arrived surfaces immediately, while one you only deferred waits its turn. A request that arrives while a panel is open does not need `/question`: answering the current one hands the panel over to the next.
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm install
|
|
83
|
+
npm test
|
|
84
|
+
npm run typecheck
|
|
85
|
+
npm run tui:demo # real pi TUI, scripted model, one question
|
|
86
|
+
LAQ_DEMO=two npm run tui:demo # queue a second request to watch the handover
|
|
87
|
+
LAQ_DEMO=multi npm run tui:demo # one request with three questions, to watch the tabs
|
|
88
|
+
npm run docs:images # regenerate docs/*.svg + docs/*.png (needs rsvg-convert)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`@earendil-works/pi-coding-agent`, `@earendil-works/pi-tui`, and `typebox` are supplied by the Pi host at runtime, so the package declares them as `peerDependencies` with a `"*"` range and never bundles them. They are repeated in `devDependencies` so local typecheck and tests resolve the same modules Pi injects.
|
|
92
|
+
|
|
93
|
+
The Dock contribution comes from `@lune_99/pi-lune-extensions-core/dock`. Core is a required runtime dependency (`@lune_99/pi-lune-extensions-core@^0.1.0` from npm); no sibling checkout or local build is needed. The optional Dock host is separate: without a compatible host, the plugin keeps its independent status bar.
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
|
98
|
+
|
|
99
|
+
Lune Dock can be toggled with `/dock`. Turning it off immediately restores this plugin's
|
|
100
|
+
independent status bar. The choice belongs to Lune Dock and is saved in
|
|
101
|
+
`~/.pi/agent/lune-settings/pi-dock.json` (following `PI_CODING_AGENT_DIR`; a project can
|
|
102
|
+
override it in `<project>/.pi/lune-settings/pi-dock.json`).
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="879" height="167" viewBox="0 0 879 167" font-family="Menlo, ui-monospace, monospace" font-size="14">
|
|
2
|
+
<rect width="879" height="167" rx="10" fill="#21252c"/>
|
|
3
|
+
<rect y="0" width="879" height="34" rx="10" fill="#768186" opacity="0.25"/>
|
|
4
|
+
<circle cx="24" cy="17" r="5" fill="#ff5f57"/><circle cx="42" cy="17" r="5" fill="#febc2e"/><circle cx="60" cy="17" r="5" fill="#28c840"/>
|
|
5
|
+
<text x="80" y="22" fill="#9da5a9" font-size="13">pi — the answer message that resumes the model</text>
|
|
6
|
+
|
|
7
|
+
<text x="18" y="66.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#68b78d" font-weight="600">Questions answered</tspan><tspan> </tspan></text>
|
|
8
|
+
|
|
9
|
+
<text x="18" y="85.4" fill="#dee0e1" xml:space="preserve"><tspan fill="#9da5a9">Storage: </tspan><tspan fill="#dee0e1">Where should the new session index live?</tspan><tspan> </tspan></text>
|
|
10
|
+
|
|
11
|
+
<text x="18" y="104.8" fill="#dee0e1" xml:space="preserve"><tspan> </tspan><tspan fill="#a798d7">selected: 1. SQLite index (Recommended)</tspan><tspan> </tspan></text>
|
|
12
|
+
|
|
13
|
+
<text x="18" y="124.2" fill="#dee0e1" xml:space="preserve"><tspan fill="#9da5a9">Timeouts: </tspan><tspan fill="#dee0e1">How should a stalled shell job be reported?</tspan><tspan> </tspan></text>
|
|
14
|
+
|
|
15
|
+
<text x="18" y="143.6" fill="#dee0e1" xml:space="preserve"><tspan> </tspan><tspan fill="#a798d7">wrote: Warn at 60s, kill at 90s</tspan><tspan> </tspan></text>
|
|
16
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="879" height="89.4" viewBox="0 0 879 89.4" font-family="Menlo, ui-monospace, monospace" font-size="14">
|
|
2
|
+
<rect width="879" height="89.4" rx="10" fill="#21252c"/>
|
|
3
|
+
<rect y="0" width="879" height="34" rx="10" fill="#768186" opacity="0.25"/>
|
|
4
|
+
<circle cx="24" cy="17" r="5" fill="#ff5f57"/><circle cx="42" cy="17" r="5" fill="#febc2e"/><circle cx="60" cy="17" r="5" fill="#28c840"/>
|
|
5
|
+
<text x="80" y="22" fill="#9da5a9" font-size="13">pi — the pending dock below the editor after Esc closed the panel</text>
|
|
6
|
+
|
|
7
|
+
<text x="18" y="66.0" fill="#dee0e1" xml:space="preserve"><tspan> </tspan><tspan fill="#a798d7">1 pending question</tspan><tspan fill="#7e888e"> · </tspan><tspan fill="#9da5a9">Where should the new session index live?</tspan><tspan fill="#7e888e"> · </tspan><tspan fill="#7e888e">/question to answer</tspan><tspan> </tspan></text>
|
|
8
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="980.16" height="574.4" viewBox="0 0 980.16 574.4" font-family="Menlo, ui-monospace, monospace" font-size="14">
|
|
2
|
+
<rect width="980.16" height="574.4" rx="10" fill="#21252c"/>
|
|
3
|
+
<rect y="0" width="980.16" height="34" rx="10" fill="#768186" opacity="0.25"/>
|
|
4
|
+
<circle cx="24" cy="17" r="5" fill="#ff5f57"/><circle cx="42" cy="17" r="5" fill="#febc2e"/><circle cx="60" cy="17" r="5" fill="#28c840"/>
|
|
5
|
+
<text x="80" y="22" fill="#9da5a9" font-size="13">pi — ask_user_questions: 2 questions, the focused option's preview pane</text>
|
|
6
|
+
|
|
7
|
+
<text x="18" y="66.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐</tspan></text>
|
|
8
|
+
|
|
9
|
+
<text x="18" y="85.4" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan font-weight="600">Questions</tspan><tspan> </tspan><tspan fill="#9da5a9">0/2 answered</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
10
|
+
|
|
11
|
+
<text x="18" y="104.8" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤</tspan></text>
|
|
12
|
+
<rect x="51.7" y="110.2" width="92.7" height="19.4" fill="#213b49"/>
|
|
13
|
+
<text x="18" y="124.2" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> ← </tspan><tspan fill="#dee0e1"> □ Storage </tspan><tspan> </tspan><tspan fill="#9da5a9"> □ Timeouts </tspan><tspan> </tspan><tspan fill="#7e888e"> ✓ Submit </tspan><tspan>→ </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
14
|
+
|
|
15
|
+
<text x="18" y="143.6" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
16
|
+
|
|
17
|
+
<text x="18" y="163.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#dee0e1" font-weight="600">Where should the new session index live?</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
18
|
+
|
|
19
|
+
<text x="18" y="182.4" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
20
|
+
|
|
21
|
+
<text x="18" y="201.8" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> The transcript itself stays on disk either way; only the lookup path changes. </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
22
|
+
|
|
23
|
+
<text x="18" y="221.2" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
24
|
+
|
|
25
|
+
<text x="18" y="240.6" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#a798d7">- </tspan><tspan fill="#a798d7">sqlite</tspan><tspan> adds one file next to the config </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
26
|
+
|
|
27
|
+
<text x="18" y="260.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#a798d7">- </tspan><tspan fill="#a798d7">jsonl</tspan><tspan> reuses what already ships </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
28
|
+
|
|
29
|
+
<text x="18" y="279.4" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
30
|
+
|
|
31
|
+
<text x="18" y="298.8" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#a798d7">›</tspan><tspan> </tspan><tspan fill="#7e888e">○</tspan><tspan> </tspan><tspan fill="#a798d7" font-weight="600">1. SQLite index (Recommended)</tspan><tspan> </tspan><tspan fill="#5fa8cc">┌─ SQLite index (Recommended) ─────────────┐</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
32
|
+
|
|
33
|
+
<text x="18" y="318.2" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">One file, constant-time </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#68b78d">sessions/</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
34
|
+
|
|
35
|
+
<text x="18" y="337.6" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">resume, no extra service.</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#68b78d"> index.sqlite</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
36
|
+
|
|
37
|
+
<text x="18" y="357.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#7e888e">○</tspan><tspan> </tspan><tspan fill="#dee0e1">2. Scan every JSONL</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#68b78d"> 4f2a9c.jsonl</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
38
|
+
|
|
39
|
+
<text x="18" y="376.4" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">No new dependency; resume </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
40
|
+
|
|
41
|
+
<text x="18" y="395.8" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">re-reads each session file.</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#a798d7">- </tspan><tspan>a </tspan><tspan fill="#a798d7">WAL</tspan><tspan> file appears beside it </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
42
|
+
|
|
43
|
+
<text x="18" y="415.2" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#7e888e">○</tspan><tspan> </tspan><tspan fill="#dee0e1">3. Rebuild in memory</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#a798d7">- </tspan><tspan>survives a crash mid-write </tspan><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
44
|
+
|
|
45
|
+
<text x="18" y="434.6" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">Nothing on disk; the index </tspan><tspan fill="#5fa8cc">└──────────────────────────────────────────┘</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
46
|
+
|
|
47
|
+
<text x="18" y="454.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">is rebuilt on every start.</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
48
|
+
|
|
49
|
+
<text x="18" y="473.4" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#7e888e">✎</tspan><tspan> </tspan><tspan fill="#dee0e1">Type something</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
50
|
+
|
|
51
|
+
<text x="18" y="492.8" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#9da5a9">write your own answer</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
52
|
+
|
|
53
|
+
<text x="18" y="512.2" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤</tspan></text>
|
|
54
|
+
|
|
55
|
+
<text x="18" y="531.6" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">│</tspan><tspan> </tspan><tspan fill="#7e888e">↑↓ select · Enter confirm · Tab/←→ switch · ⇧S skip · Esc close</tspan><tspan> </tspan><tspan fill="#5fa8cc">│</tspan></text>
|
|
56
|
+
|
|
57
|
+
<text x="18" y="551.0" fill="#dee0e1" xml:space="preserve"><tspan fill="#5fa8cc">└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘</tspan></text>
|
|
58
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@lune_99/pi-ask-question",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Ask the user questions for pi via tool and command",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"src",
|
|
8
|
+
"docs",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"pi": {
|
|
14
|
+
"extensions": [
|
|
15
|
+
"./src/index.ts"
|
|
16
|
+
],
|
|
17
|
+
"image": "./docs/question-panel.png"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "node --experimental-strip-types --test 'test/**/*.test.ts'",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"tui:demo": "node --experimental-strip-types test/tui/launch.ts",
|
|
23
|
+
"docs:images": "node --experimental-strip-types tools/make-doc-images.mjs",
|
|
24
|
+
"prepublishOnly": "npm run typecheck && npm test"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"pi-package",
|
|
28
|
+
"pi",
|
|
29
|
+
"pi-coding-agent",
|
|
30
|
+
"ask",
|
|
31
|
+
"question"
|
|
32
|
+
],
|
|
33
|
+
"author": "Nouvelle-Lune",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/Nouvelle-Lune/lune-pi.git",
|
|
38
|
+
"directory": "packages/pi-ask-question"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/Nouvelle-Lune/lune-pi/tree/main/packages/pi-ask-question#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/Nouvelle-Lune/lune-pi/issues"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22.19.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
49
|
+
"@earendil-works/pi-tui": "*",
|
|
50
|
+
"typebox": "*"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@earendil-works/pi-ai": "1.3.0",
|
|
54
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
55
|
+
"@earendil-works/pi-tui": "1.3.0",
|
|
56
|
+
"@types/node": "^22.20.2",
|
|
57
|
+
"typebox": "1.3.27",
|
|
58
|
+
"typescript": "5.9.3"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@lune_99/pi-lune-extensions-core": "^0.1.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
import { questionManager } from "../core/questionManager.ts";
|
|
4
|
+
import { openQuestionPanel } from "../tui/panel/question-panel.ts";
|
|
5
|
+
|
|
6
|
+
/** Reopen the panel after Esc closed it, without having to ask the model again. */
|
|
7
|
+
export function registerQuestionCommand(pi: ExtensionAPI, persist: (ctx: ExtensionContext) => void): void {
|
|
8
|
+
pi.registerCommand("question", {
|
|
9
|
+
description: "Open the pending question panel",
|
|
10
|
+
handler: (_args, ctx) => openPendingQuestions(ctx, persist),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The dock and slash command share panel selection, draft persistence and mode checks. */
|
|
15
|
+
export async function openPendingQuestions(ctx: ExtensionContext, persist: (ctx: ExtensionContext) => void): Promise<void> {
|
|
16
|
+
if (ctx.mode !== "tui") {
|
|
17
|
+
ctx.ui.notify("Question panel needs interactive mode", "warning");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (questionManager.getPendingRequests().length === 0) {
|
|
21
|
+
ctx.ui.notify("No pending questions", "info");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
await openQuestionPanel(ctx, { onDeferred: () => persist(ctx) });
|
|
25
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
import { formatAnswerMessage } from "./question-format.ts";
|
|
4
|
+
import { questionManager } from "./questionManager.ts";
|
|
5
|
+
import type { AnswerMessageQuestion, AskQuestion, AskQuestionRequest } from "./question-types.ts";
|
|
6
|
+
|
|
7
|
+
/** Custom message type carrying answers (or a skip) back to the model. */
|
|
8
|
+
export const ASK_QUESTION_ANSWER_MESSAGE = "pi-ask-question-answer";
|
|
9
|
+
|
|
10
|
+
export interface QuestionDeliveryOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Called when the answer could not be handed to pi at all.
|
|
13
|
+
*
|
|
14
|
+
* The request stays in the durable outbox either way; without this notice the user would
|
|
15
|
+
* never learn that the model never received the answer.
|
|
16
|
+
*/
|
|
17
|
+
onError?: (error: unknown) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Attempt delivery of one settled request.
|
|
22
|
+
*
|
|
23
|
+
* A normal return is not an acknowledgement: pi can queue a steered message and drop it
|
|
24
|
+
* before it reaches the session. The caller keeps the request in the durable outbox until
|
|
25
|
+
* the branch really contains its message, so this function never mutates the outbox.
|
|
26
|
+
*/
|
|
27
|
+
export function deliverQuestionResult(
|
|
28
|
+
pi: ExtensionAPI,
|
|
29
|
+
request: Readonly<AskQuestionRequest>,
|
|
30
|
+
options: QuestionDeliveryOptions = {},
|
|
31
|
+
): void {
|
|
32
|
+
try {
|
|
33
|
+
pi.sendMessage(
|
|
34
|
+
{
|
|
35
|
+
customType: ASK_QUESTION_ANSWER_MESSAGE,
|
|
36
|
+
content: formatAnswerMessage(request),
|
|
37
|
+
display: true,
|
|
38
|
+
details: {
|
|
39
|
+
requestId: request.id,
|
|
40
|
+
status: request.status,
|
|
41
|
+
questions: request.questions.map(toAnswerMessageQuestion),
|
|
42
|
+
answers: request.answers,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
triggerTurn: true,
|
|
47
|
+
deliverAs: "steer",
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
options.onError?.(error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Reconcile the durable outbox against the session branch of `ctx`.
|
|
57
|
+
*
|
|
58
|
+
* The branch is the only acknowledgement: a settled request whose answer message is really
|
|
59
|
+
* there is released, and the release is persisted; one whose message is missing - never
|
|
60
|
+
* sent, or dropped by pi's queue - is attempted again. Matching is by requestId, so one
|
|
61
|
+
* request's message says nothing about another's.
|
|
62
|
+
*/
|
|
63
|
+
export function reconcileQuestionDeliveries(
|
|
64
|
+
pi: ExtensionAPI,
|
|
65
|
+
ctx: ExtensionContext,
|
|
66
|
+
options: QuestionDeliveryOptions = {},
|
|
67
|
+
): void {
|
|
68
|
+
for (const request of questionManager.getUndeliveredRequests()) {
|
|
69
|
+
if (hasCommittedAnswerMessage(ctx, request.id)) {
|
|
70
|
+
questionManager.acknowledgeDelivery(request.id);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
deliverQuestionResult(pi, request, options);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Whether the active branch really holds this request's answer message. */
|
|
79
|
+
function hasCommittedAnswerMessage(ctx: ExtensionContext, requestId: string): boolean {
|
|
80
|
+
for (const entry of ctx.sessionManager.getBranch()) {
|
|
81
|
+
if (
|
|
82
|
+
entry.type === "custom_message"
|
|
83
|
+
&& entry.customType === ASK_QUESTION_ANSWER_MESSAGE
|
|
84
|
+
&& matchesRequestId(entry.details, requestId)
|
|
85
|
+
) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The stable identity of an answer message; details without a string requestId never match. */
|
|
94
|
+
function matchesRequestId(details: unknown, requestId: string): boolean {
|
|
95
|
+
if (details === null || typeof details !== "object") {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const candidate = details as { requestId?: unknown };
|
|
100
|
+
|
|
101
|
+
return typeof candidate.requestId === "string" && candidate.requestId === requestId;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** The answer row reads the label, the prompt and the option names; previews stay in the panel. */
|
|
105
|
+
function toAnswerMessageQuestion(question: AskQuestion): AnswerMessageQuestion {
|
|
106
|
+
return {
|
|
107
|
+
header: question.header,
|
|
108
|
+
question: question.question,
|
|
109
|
+
options: question.options?.map((option) => ({ label: option.label })),
|
|
110
|
+
};
|
|
111
|
+
}
|