@henryqw/pi-prompt-creator 3.1.5 → 3.1.7
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/CONTEXT.md +16 -18
- package/README.md +32 -32
- package/package.json +1 -1
package/CONTEXT.md
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pi Prompt Creator
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pi Prompt Creator finds reusable prompt ideas in the current conversation. Main and the user review each idea before the user approves a new global prompt.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Language
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Current Conversation**:
|
|
8
|
+
The model-visible conversation on the active branch, including its retained summary and effective user and completed assistant text. Inactive branches, removed context, tool traffic, and thinking are not prompt-analysis evidence.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **Prompt Candidate**: One unsaved, editable prompt template proposed from the strongest Signal. A session has at most one pending Prompt Candidate; the user may explicitly request another after the pending candidate is shown or dismissed.
|
|
12
|
-
- **Prompt Review**: Conversational refinement of a Prompt Candidate by the user and Main.
|
|
13
|
-
- **Final Prompt Draft**: Complete prompt-template Markdown authored by Main after Prompt Review. A Prompt Candidate is not a Final Prompt Draft.
|
|
14
|
-
- **Approved Prompt**: A Final Prompt Draft the user explicitly accepts for creation as a global Pi prompt. Approval never authorizes replacing an existing prompt.
|
|
10
|
+
**Signal**:
|
|
11
|
+
Evidence that a reusable prompt could help: explicit recurrence language, requests with the same intent, or repeated corrections of Main's behavior.
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
**Prompt Candidate**:
|
|
14
|
+
One unsaved prompt template proposed from a Signal. A pending candidate is untrusted review material, not an approved prompt.
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| Cross-session evidence and historical search | `@henryqw/pi-session-recall` |
|
|
21
|
-
| Scripts, Skills, and other automation | Their owning package or repository |
|
|
22
|
-
| User config load rules and launch reporting | `@henryqw/pi-config-store` ([ADR 004](../../docs/adr/004-extension-config-safety.md)) |
|
|
23
|
-
| This extension | Current-conversation Signal detection, Prompt Candidate generation, and Prompt Review |
|
|
16
|
+
**Prompt Review**:
|
|
17
|
+
Conversational refinement of a displayed Prompt Candidate by the user and Main.
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
**Final Prompt Draft**:
|
|
20
|
+
The complete prompt-template Markdown in Main's latest valid retained review reply after the candidate was displayed. A Prompt Candidate is not a Final Prompt Draft.
|
|
21
|
+
|
|
22
|
+
**Approved Prompt**:
|
|
23
|
+
A Final Prompt Draft that the user explicitly accepts for creation as a new global Pi prompt. Approval does not permit replacement of an existing prompt.
|
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# `@henryqw/pi-prompt-creator`
|
|
2
2
|
|
|
3
|
-
Turn repeated requests or corrections in the
|
|
3
|
+
Turn repeated requests or corrections in the Current Conversation into a reviewed global Pi prompt. A child with no tools drafts one Prompt Candidate. Main and the user control Prompt Review and the save.
|
|
4
4
|
|
|
5
|
-
Automatic analysis only prepares a
|
|
5
|
+
Automatic analysis only prepares a Prompt Candidate. The extension never saves it without your approval.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
This package requires Pi 1.1.0 or later in the 1.x series.
|
|
9
|
+
This package requires Pi 1.1.0 or later in the 1.x series. It no longer supports older Pi releases.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
pi install npm:@henryqw/pi-task-models
|
|
13
13
|
pi install npm:@henryqw/pi-prompt-creator
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-prompt-creator/draft`. Open `/task-models` again
|
|
16
|
+
Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-prompt-creator/draft`. Open `/task-models` again. Verify the saved route or task assignment.
|
|
17
17
|
|
|
18
18
|
## Works with
|
|
19
19
|
|
|
@@ -25,11 +25,11 @@ Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-pr
|
|
|
25
25
|
|
|
26
26
|
Run `/promptor` in the interactive TUI after a repeated request or correction appears:
|
|
27
27
|
|
|
28
|
-
1. Run `/promptor`. The completed
|
|
29
|
-
2. Ask Main to refine it
|
|
30
|
-
3. Run `/promptor save` to save under the suggested name,
|
|
28
|
+
1. Run `/promptor`. The completed Prompt Candidate appears automatically.
|
|
29
|
+
2. Ask Main to refine it. Ask Main to return only the complete Final Prompt Draft.
|
|
30
|
+
3. Run `/promptor save` to save under the suggested name. Alternatively, run `/promptor save <name>` to rename it.
|
|
31
31
|
|
|
32
|
-
The
|
|
32
|
+
The extension creates the prompt at `~/.pi/agent/prompts/<name>.md`. Then Pi reloads its resources. You do not need a selection menu or name prompt.
|
|
33
33
|
|
|
34
34
|
| Surface | Type | Purpose |
|
|
35
35
|
| --- | --- | --- |
|
|
@@ -49,39 +49,39 @@ Automatic mode waits for the configured number of non-empty user inputs. The def
|
|
|
49
49
|
|
|
50
50
|
It starts at the next idle `agent_settled` event that is not aborted. It starts at most one time per extension runtime.
|
|
51
51
|
|
|
52
|
-
An aborted run does not start automatic analysis. It keeps the input count and
|
|
52
|
+
An aborted run does not start automatic analysis. It keeps the input count and permits later automatic analysis. A later normal settlement can start analysis if it meets the conditions. `aborted: false` does not prove that the provider completed successfully.
|
|
53
53
|
|
|
54
|
-
Explicit `/promptor analyze` remains available after cancellation. A manual analysis
|
|
54
|
+
Explicit `/promptor analyze` remains available after cancellation. A manual analysis prevents later automatic analysis in that extension runtime.
|
|
55
55
|
|
|
56
|
-
Branch changes reset the input counter. Automatic analysis and
|
|
56
|
+
Branch changes reset the input counter. Automatic analysis and Prompt Candidate widgets require the interactive TUI.
|
|
57
57
|
|
|
58
|
-
Only one analysis can run at a time. A pending
|
|
58
|
+
Only one analysis can run at a time. A pending Prompt Candidate blocks another analysis.
|
|
59
59
|
|
|
60
|
-
Manual and automatic analysis send Pi's current model-visible session context to the child model
|
|
60
|
+
Manual and automatic analysis send Pi's current model-visible session context to the child model that you configure through `/task-models`. Analysis applies session context edits that omit or replace messages. It does not send original text that these edits removed from model context to the child. It does not include request-local `context` and `context_with_system` transformations.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
The payload includes the active compaction or branch summary, user text, successfully completed assistant text, and effective prompt names and descriptions.
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
The extension disables project context files and prompt templates for the child. It excludes tool traffic, thinking, images, custom messages, and inactive branches.
|
|
65
65
|
|
|
66
|
-
Analysis asks a
|
|
66
|
+
Analysis asks a child with no tools for one JSON response. The child has no user extensions, Skills, or saved session. The extension does not try failed analysis again.
|
|
67
67
|
|
|
68
68
|
New user input does not stop a running child. Branch navigation discards its old result without stopping the child.
|
|
69
69
|
|
|
70
70
|
### Review and save
|
|
71
71
|
|
|
72
|
-
A manually requested analysis displays its completed
|
|
72
|
+
A manually requested analysis displays its completed Prompt Candidate immediately. Automatic analysis shows a running widget. It then keeps a completed Prompt Candidate behind the `Prompt ready — /promptor` widget until you run `/promptor` or `/promptor dismiss`. Background work never interrupts the conversation.
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
The extension displays Prompt Candidates as visible messages that it marks as untrusted.
|
|
75
75
|
|
|
76
|
-
Refine the
|
|
76
|
+
Refine the Prompt Candidate with Main. Ask Main to return only the complete Final Prompt Draft. Then save it with `/promptor save [name]`.
|
|
77
77
|
|
|
78
|
-
You can save only after you show a
|
|
78
|
+
You can save only after you show a Prompt Candidate and Main then completes a valid Markdown review reply. The save uses that latest retained Main reply as the entire file. You cannot save replies before the active compaction or branch summary.
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
You cannot save an interrupted, failed, empty, or tool-use reply. The extension never uses an older reply instead.
|
|
81
81
|
|
|
82
|
-
A successful save ends that
|
|
82
|
+
A successful save ends that Prompt Review. Show another Prompt Candidate. Complete another Main review reply before you save again.
|
|
83
83
|
|
|
84
|
-
`/promptor save` uses the suggested
|
|
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
85
|
|
|
86
86
|
A successful save reloads Pi resources. If reload fails, the prompt remains saved and `/reload` can load it.
|
|
87
87
|
|
|
@@ -104,15 +104,15 @@ Edit either field. Then run `/reload` to apply the change. Omitted fields use th
|
|
|
104
104
|
|
|
105
105
|
A missing file quietly uses both defaults. Startup never creates or rewrites the file.
|
|
106
106
|
|
|
107
|
-
At session start, Pi shows a warning
|
|
107
|
+
At session start, Pi shows a warning for an unknown key or an invalid value. The warning includes the file path and each problem. Pi ignores the unknown key. A misspelled key near a missing field, such as `automatc`, counts as an invalid value of that field. An invalid `inputThreshold` uses the default `3`.
|
|
108
108
|
|
|
109
|
-
Automatic analysis stays off for the session when `automatic` is invalid or misspelled
|
|
109
|
+
Automatic analysis stays off for the session when `automatic` is invalid or misspelled. It also stays off when the file has malformed JSON, invalid UTF-8, more than 64 KiB, a read error, or a non-object root. Startup leaves the file unchanged.
|
|
110
110
|
|
|
111
|
-
Only `/promptor automatic on` or `/promptor automatic off` writes the config. A toggle reads the file again and keeps its current `inputThreshold`, also when another session changed it. A toggle also replaces a file with problems
|
|
111
|
+
Only `/promptor automatic on` or `/promptor automatic off` writes the config. A toggle reads the file again and keeps its current `inputThreshold`, also when another session changed it. A toggle also replaces a file with problems. It first shows the problems, then keeps the usable values and removes unknown keys. If another session changes that file before the write, the toggle stops and writes nothing.
|
|
112
112
|
|
|
113
113
|
## State and storage
|
|
114
114
|
|
|
115
|
-
A pending
|
|
115
|
+
A pending Prompt Candidate stays in memory only. The extension saves automatic mode, but not counters or Prompt Candidates.
|
|
116
116
|
|
|
117
117
|
Saved prompts are at `~/.pi/agent/prompts/<name>.md`. A save never replaces an existing file.
|
|
118
118
|
|
|
@@ -122,15 +122,15 @@ The child payload stays within 30,000 characters, including its JSON envelope an
|
|
|
122
122
|
|
|
123
123
|
It gives priority to the active summary, then to the newest complete messages. It omits excess prompt metadata before conversation context.
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
Analysis can omit old messages. It never cuts individual messages.
|
|
126
126
|
|
|
127
|
-
Generated
|
|
127
|
+
Generated Prompt Candidate names use lowercase kebab-case and stay within 64 ASCII characters.
|
|
128
128
|
|
|
129
|
-
Candidate and Final Prompt Draft Markdown must be non-empty and at most 16 KiB.
|
|
129
|
+
Prompt Candidate and Final Prompt Draft Markdown must be non-empty and at most 16 KiB.
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
The extension rejects NUL and other terminal controls in Prompt Candidate and saved Markdown. It permits ordinary tabs and line feeds.
|
|
132
132
|
|
|
133
|
-
If analysis finds no
|
|
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.
|
|
134
134
|
|
|
135
135
|
The failure widget clears after the next non-empty user input. Analysis has a two-minute idle timeout and five-minute hard timeout.
|
|
136
136
|
|