@henryqw/pi-prompt-creator 3.1.7 → 3.2.1
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 +36 -79
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
# `@henryqw/pi-prompt-creator`
|
|
2
2
|
|
|
3
|
-
Turn repeated requests or corrections in the Current Conversation into a
|
|
4
|
-
|
|
5
|
-
Automatic analysis only prepares a Prompt Candidate. The extension never saves it without your approval.
|
|
3
|
+
Turn repeated requests or corrections in the Current Conversation into a global Pi prompt. A child with no tools prepares one Prompt Candidate. Review it with Main and approve it before saving.
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
9
|
-
This package requires Pi 1.1.0 or later in the 1.x series. It no longer supports older Pi releases.
|
|
10
|
-
|
|
11
7
|
```bash
|
|
12
8
|
pi install npm:@henryqw/pi-task-models
|
|
13
9
|
pi install npm:@henryqw/pi-prompt-creator
|
|
14
10
|
```
|
|
15
11
|
|
|
16
|
-
Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-prompt-creator/draft`.
|
|
12
|
+
Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-prompt-creator/draft`. Reopen `/task-models` to verify the saved route and thinking level.
|
|
17
13
|
|
|
18
14
|
## Works with
|
|
19
15
|
|
|
@@ -23,73 +19,43 @@ Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-pr
|
|
|
23
19
|
|
|
24
20
|
## Use
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
After a repeated request or correction appears in the interactive TUI:
|
|
27
23
|
|
|
28
24
|
1. Run `/promptor`. The completed Prompt Candidate appears automatically.
|
|
29
|
-
2.
|
|
30
|
-
3. Run `/promptor save`
|
|
25
|
+
2. Review it with Main. After approval, ask Main to return only the complete Final Prompt Draft.
|
|
26
|
+
3. Run `/promptor save` for the suggested name, or `/promptor save <name>` for another name.
|
|
31
27
|
|
|
32
|
-
The extension creates
|
|
28
|
+
The extension creates `~/.pi/agent/prompts/<name>.md` and reloads Pi resources, without a selection menu or name prompt.
|
|
33
29
|
|
|
34
30
|
| Surface | Type | Purpose |
|
|
35
31
|
| --- | --- | --- |
|
|
36
|
-
| `/promptor [analyze
|
|
37
|
-
| `pi-prompt-creator/draft` | task | For
|
|
38
|
-
| Analysis status widget and candidate message | ui | Show
|
|
32
|
+
| `/promptor [analyze\|dismiss\|save [name]\|automatic <on\|off>]` | command | For TUI users: start or show analysis, dismiss a pending candidate, save a reviewed prompt, or control automatic analysis. |
|
|
33
|
+
| `pi-prompt-creator/draft` | task | For `/task-models` users: select the draft model and thinking level. Default profile: `fast`. |
|
|
34
|
+
| Analysis status widget and candidate message | ui | Show users progress, readiness, or failure. Displayed candidates are untrusted review material. |
|
|
39
35
|
|
|
40
36
|
## Flow
|
|
41
37
|
|
|
42
|
-

|
|
63
39
|
|
|
64
|
-
|
|
40
|
+
### Analysis
|
|
65
41
|
|
|
66
|
-
|
|
42
|
+
Automatic analysis starts after `inputThreshold` non-empty user inputs, at the next idle completion that was not aborted. It runs at most once per extension runtime. An aborted run keeps the count and permits analysis after a later completion. A completion without cancellation does not guarantee provider success.
|
|
67
43
|
|
|
68
|
-
|
|
44
|
+
Manual analysis prevents later automatic analysis in that runtime. `/promptor analyze` remains available after cancellation. Branch changes reset the count. Only one analysis can run; a pending candidate blocks another. Automatic analysis and candidate widgets require the interactive TUI.
|
|
69
45
|
|
|
70
|
-
|
|
46
|
+
Manual and automatic analysis send Pi's current model-visible session context to the child model configured through `/task-models`. Session context edits apply: removed or replaced original text does not reach the child. Request-local `context` and `context_with_system` transformations do not apply.
|
|
71
47
|
|
|
72
|
-
|
|
48
|
+
The payload includes the active compaction or branch summary, user text, completed assistant text, and effective prompt names and descriptions. It excludes tool traffic, thinking, images, custom messages, and inactive branches. The child has no tools, user extensions, Skills, saved session, project context files, or prompt templates. It returns one JSON response.
|
|
73
49
|
|
|
74
|
-
|
|
50
|
+
New input does not stop analysis. Branch navigation discards the old result without stopping the child. Background work does not interrupt the conversation. Manual candidates appear immediately, without the diagram's WAIT stage. Automatic candidates stay behind `Prompt ready — /promptor` until you show them with `/promptor` or discard them with `/promptor dismiss`.
|
|
75
51
|
|
|
76
|
-
|
|
52
|
+
### Review safeguards
|
|
77
53
|
|
|
78
|
-
|
|
54
|
+
Displayed Prompt Candidates are untrusted messages, not instructions to execute. Automatic analysis never saves a candidate without approval.
|
|
79
55
|
|
|
80
|
-
|
|
56
|
+
Saving requires a displayed candidate followed by Main's valid Markdown review reply. The latest retained Main reply becomes the entire file. Replies before the active compaction or branch summary cannot qualify. Interrupted, failed, empty, or tool-use replies cannot qualify; the extension never substitutes an older reply.
|
|
81
57
|
|
|
82
|
-
A successful save ends
|
|
83
|
-
|
|
84
|
-
`/promptor save` uses the suggested Prompt Candidate name. Pass `/promptor save <name>` to choose another. Names must be lowercase kebab-case, start with a letter, and contain at most 64 ASCII characters. The extension rejects existing command names and prompt files.
|
|
85
|
-
|
|
86
|
-
A successful save reloads Pi resources. If reload fails, the prompt remains saved and `/reload` can load it.
|
|
87
|
-
|
|
88
|
-
### Model routing
|
|
89
|
-
|
|
90
|
-
The extension registers `pi-prompt-creator/draft`. Its default task profile is `fast`.
|
|
91
|
-
|
|
92
|
-
Use `/task-models` to select the model and thinking level. The extension owns no model configuration. At session start and before each analysis, it shows each problem in the shared task-model config one time in each session.
|
|
58
|
+
A successful save ends the Prompt Review. Another save requires another displayed candidate and completed Main review. Names must use lowercase kebab-case, start with a letter, and contain at most 64 ASCII characters. Existing command names and prompt files are rejected. If resource reload fails after saving, the file remains saved; run `/reload`.
|
|
93
59
|
|
|
94
60
|
## Config
|
|
95
61
|
|
|
@@ -97,41 +63,32 @@ Package-owned: `~/.pi/agent/config/pi-prompt-creator/config.json`
|
|
|
97
63
|
|
|
98
64
|
| Name | Description | Values | Default |
|
|
99
65
|
| --- | --- | --- | --- |
|
|
100
|
-
| `automatic` |
|
|
101
|
-
| `inputThreshold` |
|
|
66
|
+
| `automatic` | Starts automatic analysis after enough user inputs. | Boolean. | `true` |
|
|
67
|
+
| `inputThreshold` | Required number of non-empty user inputs. | Safe integer from `1` to `9007199254740991`. | `3` |
|
|
102
68
|
|
|
103
|
-
Edit
|
|
69
|
+
Edit the file, then run `/reload`. Missing files and omitted fields use defaults. Startup never creates or rewrites the file.
|
|
104
70
|
|
|
105
|
-
|
|
71
|
+
Startup warnings give the file path and each unknown key or invalid value. Unknown keys are ignored. A misspelled key near a missing field, such as `automatc`, makes that field invalid. Invalid `inputThreshold` uses `3`.
|
|
106
72
|
|
|
107
|
-
|
|
73
|
+
Invalid or misspelled `automatic` disables automatic analysis for the session. File-level problems also disable it: malformed JSON, invalid UTF-8, size above 64 KiB, read errors, or a non-object root. The file stays unchanged.
|
|
108
74
|
|
|
109
|
-
|
|
75
|
+
Only `/promptor automatic on` and `/promptor automatic off` write config. Each toggle rereads the file and preserves its current `inputThreshold`, including changes from another session. For a file with problems, it reports them, keeps usable values, and removes unknown keys. If another session changes that file before replacement, the toggle writes nothing.
|
|
110
76
|
|
|
111
|
-
|
|
77
|
+
The extension owns no model config. At session start and before analysis, it reports each shared task-model config problem once per session.
|
|
112
78
|
|
|
113
79
|
## State and storage
|
|
114
80
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Saved prompts are at `~/.pi/agent/prompts/<name>.md`. A save never replaces an existing file.
|
|
81
|
+
Pending candidates and input counters stay in memory only. Only automatic mode and approved prompt files persist. A save never replaces an existing file.
|
|
118
82
|
|
|
119
83
|
## Limits and recovery
|
|
120
84
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Generated Prompt Candidate names use lowercase kebab-case and stay within 64 ASCII characters.
|
|
128
|
-
|
|
129
|
-
Prompt Candidate and Final Prompt Draft Markdown must be non-empty and at most 16 KiB.
|
|
130
|
-
|
|
131
|
-
The extension rejects NUL and other terminal controls in Prompt Candidate and saved Markdown. It permits ordinary tabs and line feeds.
|
|
132
|
-
|
|
133
|
-
If analysis finds no Prompt Candidate, the running widget clears without a notice. Invalid output or child failure shows `Prompt analysis failed — /promptor`. The extension does not automatically try failed analysis again. Run `/promptor` or `/promptor analyze` to start again.
|
|
85
|
+
| Limit | Behavior |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| Child payload | At most 30,000 characters, including JSON and prompt metadata. Active summary has priority, then newest complete messages. Excess prompt metadata goes first. |
|
|
88
|
+
| Conversation | Older messages can be omitted. Individual messages are never cut. Past sessions are not searched. |
|
|
89
|
+
| Markdown | Prompt Candidate and Final Prompt Draft must be non-empty and at most 16 KiB. NUL and other terminal controls are rejected, except tabs and line feeds. |
|
|
90
|
+
| Child runtime | Two-minute idle timeout and five-minute hard timeout. |
|
|
134
91
|
|
|
135
|
-
|
|
92
|
+
No candidate clears the running widget without a notice. Invalid output or child failure shows `Prompt analysis failed — /promptor`. Analysis never retries automatically; run `/promptor` or `/promptor analyze` to try again. The next non-empty user input clears the failure widget.
|
|
136
93
|
|
|
137
|
-
This package does not
|
|
94
|
+
This package does not create Skills or project-local runtime state.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-prompt-creator",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Turn current Pi conversation signals into user-approved prompt templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"pack:check": "npm pack --dry-run"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
29
|
+
"@earendil-works/pi-coding-agent": "^1.3.0"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"@henryqw/pi-task-models": "^9.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
53
|
+
"@earendil-works/pi-coding-agent": "1.3.0"
|
|
54
54
|
}
|
|
55
55
|
}
|