@jait/gateway 0.1.856 → 0.1.857
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/dist/surfaces/shell-integration/pwsh.ps1 +19 -1
- package/dist/surfaces/shell-integration-assets.d.ts +1 -1
- package/dist/surfaces/shell-integration-assets.d.ts.map +1 -1
- package/dist/surfaces/shell-integration-assets.js +20 -2
- package/dist/surfaces/shell-integration-assets.js.map +1 -1
- package/package.json +1 -1
|
@@ -27,7 +27,25 @@ function Global:__JaitOSC([string]$Payload) {
|
|
|
27
27
|
$Global:__JaitOrigPrompt = $function:prompt
|
|
28
28
|
|
|
29
29
|
function Global:prompt {
|
|
30
|
-
|
|
30
|
+
# Read the completion state first — anything else in this function (or the
|
|
31
|
+
# prompt it invokes) would overwrite it.
|
|
32
|
+
#
|
|
33
|
+
# $LASTEXITCODE only tracks native (external) programs, so a cmdlet such as
|
|
34
|
+
# `echo` never clears it. Reporting it unconditionally made every command
|
|
35
|
+
# after `cmd /c exit 7` look like it failed with 7. $? on the other hand
|
|
36
|
+
# reflects cmdlets and scripts but carries no exit code, so combine both.
|
|
37
|
+
$succeeded = $global:?
|
|
38
|
+
$nativeExitCode = $global:LASTEXITCODE
|
|
39
|
+
|
|
40
|
+
if ($succeeded) {
|
|
41
|
+
$exitCode = 0
|
|
42
|
+
} elseif ($nativeExitCode -is [int] -and $nativeExitCode -ne 0) {
|
|
43
|
+
# Native command failure: its own exit code is the real result.
|
|
44
|
+
$exitCode = $nativeExitCode
|
|
45
|
+
} else {
|
|
46
|
+
# Cmdlet/script failure without a native exit code.
|
|
47
|
+
$exitCode = 1
|
|
48
|
+
}
|
|
31
49
|
|
|
32
50
|
# D — previous command finished with exit code
|
|
33
51
|
$out = (__JaitOSC "D;$exitCode")
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
export declare const BASH_INTEGRATION_SCRIPT: string;
|
|
20
20
|
/** Contents of `shell-integration/zsh.sh` (1229 bytes). */
|
|
21
21
|
export declare const ZSH_INTEGRATION_SCRIPT: string;
|
|
22
|
-
/** Contents of `shell-integration/pwsh.ps1` (
|
|
22
|
+
/** Contents of `shell-integration/pwsh.ps1` (3202 bytes). */
|
|
23
23
|
export declare const PWSH_INTEGRATION_SCRIPT: string;
|
|
24
24
|
/** Map of integration script filename → embedded contents. */
|
|
25
25
|
export declare const SHELL_INTEGRATION_ASSETS: Readonly<Record<string, string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-integration-assets.d.ts","sourceRoot":"","sources":["../../src/surfaces/shell-integration-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,EAAE,MAoE1B,CAAC;AAEb,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,EAAE,MA2CzB,CAAC;AAEb,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"shell-integration-assets.d.ts","sourceRoot":"","sources":["../../src/surfaces/shell-integration-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,EAAE,MAoE1B,CAAC;AAEb,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,EAAE,MA2CzB,CAAC;AAEb,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,EAAE,MA4F1B,CAAC;AAEb,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIrE,CAAC"}
|
|
@@ -130,7 +130,7 @@ export const ZSH_INTEGRATION_SCRIPT = [
|
|
|
130
130
|
"}",
|
|
131
131
|
"",
|
|
132
132
|
].join("\n");
|
|
133
|
-
/** Contents of `shell-integration/pwsh.ps1` (
|
|
133
|
+
/** Contents of `shell-integration/pwsh.ps1` (3202 bytes). */
|
|
134
134
|
export const PWSH_INTEGRATION_SCRIPT = [
|
|
135
135
|
"# Jait Terminal Shell Integration — PowerShell",
|
|
136
136
|
"# Emits OSC 633 sequences so the host can detect prompt boundaries,",
|
|
@@ -161,7 +161,25 @@ export const PWSH_INTEGRATION_SCRIPT = [
|
|
|
161
161
|
"$Global:__JaitOrigPrompt = $function:prompt",
|
|
162
162
|
"",
|
|
163
163
|
"function Global:prompt {",
|
|
164
|
-
"
|
|
164
|
+
" # Read the completion state first — anything else in this function (or the",
|
|
165
|
+
" # prompt it invokes) would overwrite it.",
|
|
166
|
+
" #",
|
|
167
|
+
" # $LASTEXITCODE only tracks native (external) programs, so a cmdlet such as",
|
|
168
|
+
" # `echo` never clears it. Reporting it unconditionally made every command",
|
|
169
|
+
" # after `cmd /c exit 7` look like it failed with 7. $? on the other hand",
|
|
170
|
+
" # reflects cmdlets and scripts but carries no exit code, so combine both.",
|
|
171
|
+
" $succeeded = $global:?",
|
|
172
|
+
" $nativeExitCode = $global:LASTEXITCODE",
|
|
173
|
+
"",
|
|
174
|
+
" if ($succeeded) {",
|
|
175
|
+
" $exitCode = 0",
|
|
176
|
+
" } elseif ($nativeExitCode -is [int] -and $nativeExitCode -ne 0) {",
|
|
177
|
+
" # Native command failure: its own exit code is the real result.",
|
|
178
|
+
" $exitCode = $nativeExitCode",
|
|
179
|
+
" } else {",
|
|
180
|
+
" # Cmdlet/script failure without a native exit code.",
|
|
181
|
+
" $exitCode = 1",
|
|
182
|
+
" }",
|
|
165
183
|
"",
|
|
166
184
|
" # D — previous command finished with exit code",
|
|
167
185
|
" $out = (__JaitOSC \"D;$exitCode\")",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-integration-assets.js","sourceRoot":"","sources":["../../src/surfaces/shell-integration-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,uBAAuB,GAAW;IAC7C,aAAa;IACb,0CAA0C;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,oBAAoB;IACpB,GAAG;IACH,EAAE;IACF,sEAAsE;IACtE,oBAAoB;IACpB,oBAAoB;IACpB,yEAAyE;IACzE,4EAA4E;IAC5E,6BAA6B;IAC7B,oBAAoB;IACpB,GAAG;IACH,EAAE;IACF,iBAAiB;IACjB,2BAA2B;IAC3B,mCAAmC;IACnC,qCAAqC;IACrC,EAAE;IACF,gCAAgC;IAChC,uCAAuC;IACvC,uBAAuB;IACvB,4EAA4E;IAC5E,qCAAqC;IACrC,GAAG;IACH,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,6DAA6D;AAC7D,MAAM,CAAC,MAAM,uBAAuB,GAAW;IAC7C,gDAAgD;IAChD,qEAAqE;IACrE,0EAA0E;IAC1E,GAAG;IACH,kEAAkE;IAClE,oCAAoC;IACpC,uDAAuD;IACvD,iDAAiD;IACjD,4DAA4D;IAC5D,gEAAgE;IAChE,yDAAyD;IACzD,EAAE;IACF,iCAAiC;IACjC,sDAAsD;IACtD,8CAA8C;IAC9C,mCAAmC;IACnC,EAAE;IACF,4DAA4D;IAC5D,gCAAgC;IAChC,gCAAgC;IAChC,EAAE;IACF,+CAA+C;IAC/C,gEAAgE;IAChE,GAAG;IACH,EAAE;IACF,sCAAsC;IACtC,6CAA6C;IAC7C,EAAE;IACF,0BAA0B;IAC1B,
|
|
1
|
+
{"version":3,"file":"shell-integration-assets.js","sourceRoot":"","sources":["../../src/surfaces/shell-integration-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,uBAAuB,GAAW;IAC7C,aAAa;IACb,0CAA0C;IAC1C,qEAAqE;IACrE,0EAA0E;IAC1E,EAAE;IACF,mFAAmF;IACnF,6GAA6G;IAC7G,iCAAiC;IACjC,EAAE;IACF,gBAAgB;IAChB,iCAAiC;IACjC,GAAG;IACH,EAAE;IACF,sEAAsE;IACtE,yEAAyE;IACzE,EAAE;IACF,uBAAu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