@oh-my-pi/pi-ai 18.4.12 → 18.5.0
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
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [18.5.0] - 2026-10-03
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed AWS `credential_process` on Windows stripping backslashes from unquoted paths such as `C:\Users\me\helper.exe`; commands are now split with Windows command-line rules there, matching the AWS CLI.
|
|
10
|
+
|
|
5
11
|
## [18.4.12] - 2026-10-02
|
|
6
12
|
|
|
7
13
|
### Added
|
|
@@ -29,14 +29,10 @@ export interface CredentialResolveOptions {
|
|
|
29
29
|
fetch?: FetchImpl;
|
|
30
30
|
}
|
|
31
31
|
export declare function resolveAwsCredentials(opts?: CredentialResolveOptions): Promise<ResolvedCredentials>;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
* a backslash only escapes `$`, `` ` ``, `"`, and `\` — every other backslash
|
|
37
|
-
* is preserved verbatim, which is what makes Windows paths like
|
|
38
|
-
* `"C:\Program Files\tool\auth.exe"` survive tokenization. */
|
|
39
|
-
export declare function tokenizeCredentialProcessCommand(cmd: string): string[];
|
|
32
|
+
/** Split a `credential_process` command into argv the way botocore's
|
|
33
|
+
* `compat_shell_split` does: Windows command-line (CRT) rules on `win32`,
|
|
34
|
+
* POSIX shell rules everywhere else. */
|
|
35
|
+
export declare function tokenizeCredentialProcessCommand(cmd: string, platform?: NodeJS.Platform): string[];
|
|
40
36
|
/** Test/diagnostic helper — drops cached credentials. */
|
|
41
37
|
export declare function clearAwsCredentialCache(): void;
|
|
42
38
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-ai",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.5.0",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -155,11 +155,11 @@
|
|
|
155
155
|
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
156
156
|
},
|
|
157
157
|
"dependencies": {
|
|
158
|
-
"@oh-my-pi/omptype": "18.
|
|
159
|
-
"@oh-my-pi/pi-catalog": "18.
|
|
160
|
-
"@oh-my-pi/pi-natives": "18.
|
|
161
|
-
"@oh-my-pi/pi-utils": "18.
|
|
162
|
-
"@oh-my-pi/pi-wire": "18.
|
|
158
|
+
"@oh-my-pi/omptype": "18.5.0",
|
|
159
|
+
"@oh-my-pi/pi-catalog": "18.5.0",
|
|
160
|
+
"@oh-my-pi/pi-natives": "18.5.0",
|
|
161
|
+
"@oh-my-pi/pi-utils": "18.5.0",
|
|
162
|
+
"@oh-my-pi/pi-wire": "18.5.0"
|
|
163
163
|
},
|
|
164
164
|
"devDependencies": {
|
|
165
165
|
"@types/bun": "^1.3.14"
|
|
@@ -737,14 +737,74 @@ function isBatchScript(executable: string): boolean {
|
|
|
737
737
|
return lower.endsWith(".cmd") || lower.endsWith(".bat");
|
|
738
738
|
}
|
|
739
739
|
|
|
740
|
+
/** Split a `credential_process` command into argv the way botocore's
|
|
741
|
+
* `compat_shell_split` does: Windows command-line (CRT) rules on `win32`,
|
|
742
|
+
* POSIX shell rules everywhere else. */
|
|
743
|
+
export function tokenizeCredentialProcessCommand(cmd: string, platform: NodeJS.Platform = process.platform): string[] {
|
|
744
|
+
return platform === "win32" ? tokenizeWindowsCommand(cmd) : tokenizePosixCommand(cmd);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/** Windows C-runtime argv rules (botocore `_windows_shell_split`): only space
|
|
748
|
+
* and tab delimit, only double quotes group, and backslashes are literal unless
|
|
749
|
+
* a run of them precedes a `"` — then each pair yields one backslash and an odd
|
|
750
|
+
* trailing backslash escapes the quote. Keeps `C:\path\tool.exe` intact. */
|
|
751
|
+
function tokenizeWindowsCommand(cmd: string): string[] {
|
|
752
|
+
const tokens: string[] = [];
|
|
753
|
+
let current = "";
|
|
754
|
+
let hasToken = false;
|
|
755
|
+
let quoted = false;
|
|
756
|
+
let backslashes = 0;
|
|
757
|
+
for (const ch of cmd) {
|
|
758
|
+
if (ch === "\\") {
|
|
759
|
+
backslashes++;
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
if (ch === '"') {
|
|
763
|
+
current += "\\".repeat(backslashes >> 1);
|
|
764
|
+
hasToken = true;
|
|
765
|
+
const escaped = (backslashes & 1) === 1;
|
|
766
|
+
backslashes = 0;
|
|
767
|
+
if (escaped) current += '"';
|
|
768
|
+
else quoted = !quoted;
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
if (backslashes > 0) {
|
|
772
|
+
current += "\\".repeat(backslashes);
|
|
773
|
+
hasToken = true;
|
|
774
|
+
backslashes = 0;
|
|
775
|
+
}
|
|
776
|
+
if ((ch === " " || ch === "\t") && !quoted) {
|
|
777
|
+
if (hasToken) {
|
|
778
|
+
tokens.push(current);
|
|
779
|
+
current = "";
|
|
780
|
+
hasToken = false;
|
|
781
|
+
}
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
current += ch;
|
|
785
|
+
hasToken = true;
|
|
786
|
+
}
|
|
787
|
+
if (quoted) {
|
|
788
|
+
throw new AIError.AwsCredentialsError(
|
|
789
|
+
"AWS credential_process command has an unterminated quote.",
|
|
790
|
+
"credential-process",
|
|
791
|
+
);
|
|
792
|
+
}
|
|
793
|
+
if (backslashes > 0) {
|
|
794
|
+
current += "\\".repeat(backslashes);
|
|
795
|
+
hasToken = true;
|
|
796
|
+
}
|
|
797
|
+
if (hasToken) tokens.push(current);
|
|
798
|
+
return tokens;
|
|
799
|
+
}
|
|
800
|
+
|
|
740
801
|
/** POSIX-shell-style tokenizer used by the AWS CLI for `credential_process`.
|
|
741
802
|
*
|
|
742
803
|
* Outside quotes a backslash escapes the next character. Inside single quotes
|
|
743
804
|
* everything is literal (no escapes, cannot contain `'`). Inside double quotes
|
|
744
805
|
* a backslash only escapes `$`, `` ` ``, `"`, and `\` — every other backslash
|
|
745
|
-
* is preserved verbatim
|
|
746
|
-
|
|
747
|
-
export function tokenizeCredentialProcessCommand(cmd: string): string[] {
|
|
806
|
+
* is preserved verbatim. */
|
|
807
|
+
function tokenizePosixCommand(cmd: string): string[] {
|
|
748
808
|
const tokens: string[] = [];
|
|
749
809
|
let current = "";
|
|
750
810
|
let hasToken = false;
|