@henryqw/pi-prompt-creator 1.0.2 → 1.0.3
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 +3 -3
- package/extensions/prompt-creator.ts +7 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ The menu adapts to the current state:
|
|
|
49
49
|
|
|
50
50
|
Only one analysis can run at a time. A pending candidate blocks another analysis.
|
|
51
51
|
|
|
52
|
-
Analysis
|
|
52
|
+
Analysis asks a tool-free child for one JSON response. It has no user extensions, Skills, or saved session. The extension does not retry failed analysis.
|
|
53
53
|
|
|
54
54
|
New user input does not stop a running child. Branch navigation discards its old result without stopping the child.
|
|
55
55
|
|
|
@@ -59,10 +59,10 @@ New user input does not stop a running child. Branch navigation discards its old
|
|
|
59
59
|
|
|
60
60
|
| Field | Required | Possible values | Default |
|
|
61
61
|
| --- | --- | --- | --- |
|
|
62
|
-
| `automatic` |
|
|
62
|
+
| `automatic` | No | `true` or `false` | `true` |
|
|
63
63
|
| `inputThreshold` | No | Positive integer | `3` |
|
|
64
64
|
|
|
65
|
-
Edit
|
|
65
|
+
Edit either field, then run `/reload` to apply the change. Omitted fields use their defaults.
|
|
66
66
|
|
|
67
67
|
A missing file quietly uses both defaults. Startup never creates or rewrites the file.
|
|
68
68
|
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { createConfigStore } from "@henryqw/pi-config-store";
|
|
13
13
|
import {
|
|
14
14
|
createEphemeralSubagentExecutor,
|
|
15
|
+
MIN_MAX_TURNS,
|
|
15
16
|
resolveRoleLaunch,
|
|
16
17
|
type EphemeralSubagentExecutor,
|
|
17
18
|
type Role,
|
|
@@ -80,16 +81,16 @@ function exactKeys(value: Record<string, unknown>, keys: readonly string[]): boo
|
|
|
80
81
|
function parseConfig(value: unknown): Config {
|
|
81
82
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Config must be an object.");
|
|
82
83
|
const config = value as Record<string, unknown>;
|
|
83
|
-
const validKeys =
|
|
84
|
-
const
|
|
84
|
+
const validKeys = Object.keys(config).every((key) => key === "automatic" || key === "inputThreshold");
|
|
85
|
+
const { automatic = true, inputThreshold = DEFAULT_INPUT_THRESHOLD } = config;
|
|
85
86
|
if (
|
|
86
87
|
!validKeys
|
|
87
|
-
|| typeof
|
|
88
|
+
|| typeof automatic !== "boolean"
|
|
88
89
|
|| typeof inputThreshold !== "number"
|
|
89
90
|
|| !Number.isSafeInteger(inputThreshold)
|
|
90
91
|
|| inputThreshold < 1
|
|
91
|
-
) throw new Error("Config
|
|
92
|
-
return { automatic
|
|
92
|
+
) throw new Error("Config may contain automatic:boolean and inputThreshold:positive integer.");
|
|
93
|
+
return { automatic, inputThreshold };
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export function isPromptName(value: unknown): value is string {
|
|
@@ -308,7 +309,7 @@ export default function promptCreatorExtension(pi: ExtensionAPI, options: Prompt
|
|
|
308
309
|
};
|
|
309
310
|
const getExecutor = () => executor ??= createEphemeralSubagentExecutor({
|
|
310
311
|
maxConcurrency: 1,
|
|
311
|
-
maxTurns:
|
|
312
|
+
maxTurns: MIN_MAX_TURNS,
|
|
312
313
|
timeout: { idleMs: 2 * 60_000, maxMs: 5 * 60_000 },
|
|
313
314
|
});
|
|
314
315
|
const startAnalysis = (ctx: ExtensionContext, manual: boolean) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-prompt-creator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Turn current Pi conversation signals into user-approved prompt templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@henryqw/pi-config-store": "^1.0.0",
|
|
49
|
-
"@henryqw/pi-subagent": "^
|
|
49
|
+
"@henryqw/pi-subagent": "^14.0.0",
|
|
50
50
|
"@henryqw/pi-task-models": "^5.0.0"
|
|
51
51
|
}
|
|
52
52
|
}
|