@groeponline/pi-wishcraft 1.4.8 → 1.4.9
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 +2 -0
- package/bash-mode/editor.ts +21 -4
- package/docs/bash-mode.md +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bash-mode/editor.ts
CHANGED
|
@@ -279,17 +279,34 @@ export class BashModeEditor extends CustomEditor {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
if (
|
|
282
|
-
bashMode &&
|
|
282
|
+
(bashMode || oneOffBashCommand) &&
|
|
283
283
|
this.keybindingsRef.matches(data, "tui.input.submit") &&
|
|
284
284
|
!this.keybindingsRef.matches(data, "tui.input.newLine")
|
|
285
285
|
) {
|
|
286
|
+
// One-off bang prompts run the text after the prefix (mirrors pi's
|
|
287
|
+
// own !/!! handling in interactive-mode.js); anything else submits
|
|
288
|
+
// verbatim. Without the strip the bang would hit bash history
|
|
289
|
+
// expansion (`!cmd` = replay a previous command) instead of `cmd`.
|
|
290
|
+
const raw = this.getExpandedText().trim();
|
|
291
|
+
const oneOff = getOneOffBashCommandContext(raw);
|
|
292
|
+
const command = oneOff ? oneOff.command.trim() : raw;
|
|
293
|
+
if (!command) {
|
|
294
|
+
// Bash-off bare `!`: fall back to pi's own submit handling, whose
|
|
295
|
+
// `if (command)` guard turns an empty command into a normal prompt
|
|
296
|
+
// (pre-interception behavior). Full bash mode keeps the return.
|
|
297
|
+
// This must run before the shell-running guard: a bare `!` while a
|
|
298
|
+
// managed shell job runs should still delegate to pi, not be
|
|
299
|
+
// swallowed by the "already running" warning.
|
|
300
|
+
if (!bashMode) {
|
|
301
|
+
super.handleInput(data);
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
|
|
286
306
|
if (this.optionsRef.isShellRunning()) {
|
|
287
307
|
this.optionsRef.onNotify("Shell command already running", "warning");
|
|
288
308
|
return;
|
|
289
309
|
}
|
|
290
|
-
|
|
291
|
-
const command = this.getExpandedText().trim();
|
|
292
|
-
if (!command) return;
|
|
293
310
|
this.clearGhostSuggestion();
|
|
294
311
|
resetShellHistoryBrowse(this);
|
|
295
312
|
this.optionsRef.onEditorSubmit?.();
|
package/docs/bash-mode.md
CHANGED
|
@@ -32,6 +32,8 @@ At command position, short stems first resolve from the newest successful local
|
|
|
32
32
|
|
|
33
33
|
If the bash prompt is empty, bash mode shows the newest successful project-history ghost suggestion immediately when one exists, including right after mode entry or after the prompt is cleared again. One-off `!command` and `!!command` prompts reuse the same shell prediction pipeline, including ghost text. Right Arrow or Tab accepts ghost text into the editor, and Enter runs the current shell command. Mode entry stays quiet: there is no automatic or manual dropdown completion surface, and ghost suggestions do not run shell-native completion probes.
|
|
34
34
|
|
|
35
|
+
One-off `!command` and `!!command` prompts also work when bash mode is off: Enter routes them through the managed shell with the prefix stripped, so `!cmd` runs `cmd` (in a real PTY) instead of a headless shell failing on TUI programs or hitting bash history expansion. Output lands in the transcript below the editor, not in the model conversation — pi's own `!`-prefix bash (headless, context-injected) is superseded while this extension's editor is active. Full bash mode (`ctrl+shift+b`) is only needed for running plain commands or keeping the shell session visible in the footer.
|
|
36
|
+
|
|
35
37
|
## Configuration
|
|
36
38
|
|
|
37
39
|
In `~/.pi/agent/settings.json` (or under `PI_CODING_AGENT_DIR` when that environment variable is set):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groeponline/pi-wishcraft",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Operator cockpit for Pi: live powerline status, searchable skills, idea queue, sticky Bash, hooks, policy controls, and session UX.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|