@agimon-ai/doompi-user-feedback 0.0.1-alpha.10 → 0.0.1-alpha.11
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/README.md +79 -36
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,61 +1,104 @@
|
|
|
1
1
|
# @agimon-ai/doompi-user-feedback
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Structured, blocking user questions for Pi, with an autonomous-Voice handoff.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
terminal session it opens a blocking questionnaire and returns the selected answer to the
|
|
7
|
-
agent. The question does not get buried in prose and the turn does not continue on a
|
|
8
|
-
guess.
|
|
5
|
+
The `ask_user_question` tool presents concrete options instead of asking the model to continue on a guess.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
plain text, hands them to narration, terminates the turn, and accepts the next spoken reply
|
|
12
|
-
as an ordinary user message.
|
|
7
|
+
> **Alpha:** tool and Voice-handoff contracts may change between releases.
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
packages. It keeps the established `rpiv:ask-user:prompt` and `rpiv:ask-user:blocked`
|
|
16
|
-
channel names so existing Doompi listeners can migrate without being rewritten.
|
|
9
|
+
## Requirements
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
- Node.js 22.19.0 or newer
|
|
12
|
+
- Pi 0.84.2 and Pi TUI 0.84.2
|
|
20
13
|
|
|
21
14
|
## Install
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
npm install @agimon-ai/doompi-user-feedback
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## How it loads
|
|
28
|
-
|
|
29
|
-
Put the bare package name in a layer, then add that layer to a major mode:
|
|
16
|
+
Add the package to a DoomPi layer:
|
|
30
17
|
|
|
31
18
|
```yaml
|
|
32
19
|
layers:
|
|
33
|
-
|
|
20
|
+
feedback:
|
|
34
21
|
packages: ['@agimon-ai/doompi-user-feedback']
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For standalone Pi:
|
|
35
25
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
```bash
|
|
27
|
+
pi install npm:@agimon-ai/doompi-user-feedback
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Ask a question
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"questions": [
|
|
35
|
+
{
|
|
36
|
+
"header": "Storage",
|
|
37
|
+
"question": "Where should session results be stored?",
|
|
38
|
+
"options": [
|
|
39
|
+
{
|
|
40
|
+
"label": "Project files",
|
|
41
|
+
"description": "Easy to inspect and commit, but visible in the repository."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "User state",
|
|
45
|
+
"description": "Keeps generated state outside the repository."
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"multiSelect": false
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
40
52
|
```
|
|
41
53
|
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
A call accepts 1–4 questions. Each question requires 2–4 options. Headers are at most 16 characters; option labels are at most 60 characters. Use `multiSelect: true` when several choices are valid. An option can include a Markdown `preview` for meaningful visual comparison.
|
|
55
|
+
|
|
56
|
+
The tool result contains readable answer text plus structured `details.answers`; cancellation sets `cancelled: true`. Pressing Escape declines the questionnaire. Do not add an `Other` option because the UI supplies a custom-text row.
|
|
57
|
+
|
|
58
|
+
## UI, RPC, and headless behavior
|
|
59
|
+
|
|
60
|
+
The tool requires an interactive UI. It uses the TUI questionnaire when available and can use Pi's dialog/RPC UI bridge. A truly headless context returns a structured `no_ui` cancellation rather than waiting forever.
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
Questionnaires are coordinated one at a time. Cancellation, session replacement, or shutdown aborts the active prompt and settles queued work.
|
|
46
63
|
|
|
47
|
-
|
|
48
|
-
detection, plain-text formatting, and narration handoff to other tools.
|
|
49
|
-
`createVoiceQuestionHandoff()` returns a session-scoped handle; call `dispose()` when its
|
|
50
|
-
session ends so subscriptions do not outlive their owner.
|
|
64
|
+
## Autonomous Voice handoff
|
|
51
65
|
|
|
52
|
-
Voice
|
|
53
|
-
|
|
66
|
+
When autonomous Voice mode is active, the extension formats the questions as plain text, requests narration, and returns `terminate: true`. The current turn ends while waiting; the next spoken answer arrives as a normal user message rather than a synthetic questionnaire selection.
|
|
67
|
+
|
|
68
|
+
Reusable integrations can create a session-scoped handoff:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { createVoiceQuestionHandoff } from '@agimon-ai/doompi-user-feedback/voice-question-handoff';
|
|
72
|
+
import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
73
|
+
|
|
74
|
+
export function installVoiceHandoff(pi: ExtensionAPI, sessionId: string): () => void {
|
|
75
|
+
const handoff = createVoiceQuestionHandoff({
|
|
76
|
+
bus: pi.events,
|
|
77
|
+
source: '@example/review-extension',
|
|
78
|
+
sessionId,
|
|
79
|
+
});
|
|
80
|
+
return () => handoff.dispose();
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Always dispose the handle during shutdown.
|
|
54
85
|
|
|
55
86
|
## Public API
|
|
56
87
|
|
|
57
|
-
|
|
58
|
-
|
|
88
|
+
```ts
|
|
89
|
+
import { registerUserFeedbackExtension } from '@agimon-ai/doompi-user-feedback';
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Event constants are available through `/events`; the Pi adapter is `/extensions/pi`.
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pnpm build
|
|
98
|
+
pnpm typecheck
|
|
99
|
+
pnpm test
|
|
100
|
+
pnpm lint
|
|
101
|
+
```
|
|
59
102
|
|
|
60
103
|
## License
|
|
61
104
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-user-feedback",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.11",
|
|
4
4
|
"description": "Structured user feedback for DoomPi agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"typebox": "1.1.38",
|
|
53
|
-
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.
|
|
54
|
-
"@agimon-ai/doompi-ui": "0.0.1-alpha.
|
|
53
|
+
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.22",
|
|
54
|
+
"@agimon-ai/doompi-ui": "0.0.1-alpha.22"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@earendil-works/pi-coding-agent": "0.84.2",
|