portable-agent-layer 0.57.0 → 0.57.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/assets/STATUSLINE.md +8 -4
- package/package.json +1 -1
- package/src/targets/lib.ts +19 -3
package/assets/STATUSLINE.md
CHANGED
|
@@ -71,18 +71,22 @@ On Cursor, session cost and rate limits are usually absent from stdin — the sc
|
|
|
71
71
|
|
|
72
72
|
### On Windows
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
The installer does this automatically. To wire it manually, copy `statusline.ps1` to
|
|
75
|
+
`~/.claude/statusline.ps1` and add to `~/.claude/settings.json`:
|
|
75
76
|
```json
|
|
76
77
|
{
|
|
77
78
|
"statusLine": {
|
|
78
79
|
"type": "command",
|
|
79
|
-
"command": "powershell -NoProfile -
|
|
80
|
+
"command": "powershell -NoProfile -ExecutionPolicy Bypass -File ~/.claude/statusline.ps1",
|
|
80
81
|
"padding": 2
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
```
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
`-ExecutionPolicy Bypass` (which must precede `-File`) lets the unsigned script run under a
|
|
87
|
+
`Restricted`/`AllSigned` machine policy — the common reason the status line silently fails to
|
|
88
|
+
appear. It does **not** override a policy enforced via Group Policy (`MachinePolicy`/`UserPolicy`);
|
|
89
|
+
run `Get-ExecutionPolicy -List` to check the scope, and if it's a GPO scope, that case needs IT.
|
|
86
90
|
|
|
87
91
|
The statusline script is at: `portable-agent-layer/assets/statusline.ps1`
|
|
88
92
|
|
|
@@ -104,7 +108,7 @@ The statusline script is at: `portable-agent-layer/assets/statusline.ps1`
|
|
|
104
108
|
## Dependencies
|
|
105
109
|
|
|
106
110
|
- **macOS/Linux:** `bash`, `jq`, `git` (for branch detection)
|
|
107
|
-
- **Windows:** PowerShell 7
|
|
111
|
+
- **Windows:** Windows PowerShell 5.1 (invoked as `powershell`; the script is 5.1-compatible) or PowerShell 7, `git` (for branch detection)
|
|
108
112
|
|
|
109
113
|
## Customization
|
|
110
114
|
|
package/package.json
CHANGED
package/src/targets/lib.ts
CHANGED
|
@@ -1042,7 +1042,7 @@ function statuslineCommand(target: StatuslineTarget): string {
|
|
|
1042
1042
|
: "~/.cursor/statusline.sh";
|
|
1043
1043
|
}
|
|
1044
1044
|
return isPlatformWin32
|
|
1045
|
-
? "powershell -NoProfile -File ~/.claude/statusline.ps1"
|
|
1045
|
+
? "powershell -NoProfile -ExecutionPolicy Bypass -File ~/.claude/statusline.ps1"
|
|
1046
1046
|
: "~/.claude/statusline.sh";
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
@@ -1105,6 +1105,23 @@ export function removeStatusline(target: StatuslineTarget = "claude"): boolean {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
1107
|
|
|
1108
|
+
function isOldGetContentClaudeCommand(cmd: string): boolean {
|
|
1109
|
+
return cmd.includes("Get-Content -Raw");
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
function isPalWindowsClaudeCommandMissingBypass(cmd: string): boolean {
|
|
1113
|
+
return (
|
|
1114
|
+
process.platform === "win32" &&
|
|
1115
|
+
isPalStatuslineCommand(cmd, "claude") &&
|
|
1116
|
+
cmd.includes("powershell") &&
|
|
1117
|
+
!cmd.includes("-ExecutionPolicy Bypass")
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
function claudeStatuslineNeedsRefresh(cmd: string): boolean {
|
|
1122
|
+
return isOldGetContentClaudeCommand(cmd) || isPalWindowsClaudeCommandMissingBypass(cmd);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1108
1125
|
/** Add statusLine config if not already present or if using an old broken command */
|
|
1109
1126
|
export function addStatuslineConfig(
|
|
1110
1127
|
settings: Record<string, unknown>,
|
|
@@ -1115,8 +1132,7 @@ export function addStatuslineConfig(
|
|
|
1115
1132
|
if (statusLine && typeof statusLine === "object" && statusLine.command) {
|
|
1116
1133
|
const cmd = statusLine.command as string;
|
|
1117
1134
|
if (target === "claude") {
|
|
1118
|
-
|
|
1119
|
-
if (!cmd.includes("Get-Content -Raw")) {
|
|
1135
|
+
if (!claudeStatuslineNeedsRefresh(cmd)) {
|
|
1120
1136
|
return settings;
|
|
1121
1137
|
}
|
|
1122
1138
|
} else if (!isPalStatuslineCommand(cmd, "cursor")) {
|