@bermudi/pi-delegate 0.1.13 → 0.1.15
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 +14 -17
- package/delegate.ts +0 -8
- package/dispatch.ts +25 -2
- package/extension.ts +14 -6
- package/file-tracking.ts +286 -15
- package/format.ts +107 -21
- package/isolated-workspace.ts +550 -62
- package/key-hints.ts +38 -0
- package/lifecycle.ts +559 -80
- package/manual.ts +1 -1
- package/model.ts +6 -1
- package/package.json +13 -9
- package/pool.ts +37 -6
- package/quiescence.ts +19 -6
- package/render-branches.ts +243 -85
- package/render-result.ts +116 -16
- package/runner.ts +361 -82
- package/session-quarantine.ts +266 -0
- package/spill.ts +93 -22
- package/task-resolution.ts +63 -50
- package/telemetry.ts +1 -1
- package/ticket-format.ts +15 -9
- package/tickets.ts +36 -14
- package/tools.ts +5 -4
- package/types.ts +92 -8
- package/utils.ts +123 -2
- package/workspace.ts +133 -0
- package/settings.ts +0 -418
package/key-hints.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as piCodingAgent from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
type KeyText = (action: string) => string | undefined;
|
|
4
|
+
|
|
5
|
+
// Keep this lookup on the namespace object. A named ESM import makes the whole
|
|
6
|
+
// extension fail to load on older Pi hosts that do not export optional
|
|
7
|
+
// `keyText`, before the rendering fallback below can run.
|
|
8
|
+
const hostKeyText = (
|
|
9
|
+
piCodingAgent as typeof piCodingAgent & { keyText?: KeyText }
|
|
10
|
+
).keyText;
|
|
11
|
+
|
|
12
|
+
/** Effective host keybinding for expanding tool output.
|
|
13
|
+
*
|
|
14
|
+
* Pi publishes `keyText`, which reads the live global keybinding manager and
|
|
15
|
+
* therefore follows user remaps. Older/incompatible hosts omit the hint
|
|
16
|
+
* rather than advertising a shortcut that may be wrong.
|
|
17
|
+
*/
|
|
18
|
+
export function toolExpandHint(
|
|
19
|
+
verb = "expand",
|
|
20
|
+
getKeyText: KeyText | undefined = hostKeyText,
|
|
21
|
+
): string {
|
|
22
|
+
try {
|
|
23
|
+
if (typeof getKeyText === "function") {
|
|
24
|
+
const key = getKeyText("app.tools.expand");
|
|
25
|
+
if (key) {
|
|
26
|
+
const displayKey = key.replace(
|
|
27
|
+
/(^|[+/])([a-z])/g,
|
|
28
|
+
(_m, sep, char) => `${sep}${char.toUpperCase()}`,
|
|
29
|
+
);
|
|
30
|
+
return `${displayKey} ${verb}`;
|
|
31
|
+
}
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
} catch {
|
|
35
|
+
// Rendering must remain available when an older host lacks keybindings.
|
|
36
|
+
}
|
|
37
|
+
return "";
|
|
38
|
+
}
|