@hasna/skills 0.5.5 → 0.5.7

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/storage.js CHANGED
@@ -1031,11 +1031,15 @@ function normalizeHeaders(headers) {
1031
1031
  }
1032
1032
  return result;
1033
1033
  }
1034
+ function encodeAwsUriComponent(value) {
1035
+ return encodeURIComponent(value).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
1036
+ }
1034
1037
  function canonicalizeQuery(params) {
1035
- return [...params.entries()].sort(([aKey, aValue], [bKey, bValue]) => aKey.localeCompare(bKey) || aValue.localeCompare(bValue)).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&");
1038
+ const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
1039
+ return [...params.entries()].map(([key, value]) => [encodeAwsUriComponent(key), encodeAwsUriComponent(value)]).sort(([aKey, aValue], [bKey, bValue]) => compare(aKey, bKey) || compare(aValue, bValue)).map(([key, value]) => `${key}=${value}`).join("&");
1036
1040
  }
1037
1041
  function encodeUriPath(pathname) {
1038
- return pathname.split("/").map((segment) => encodeURIComponent(decodeURIComponent(segment)).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`)).join("/");
1042
+ return pathname.split("/").map((segment) => encodeAwsUriComponent(decodeURIComponent(segment))).join("/");
1039
1043
  }
1040
1044
  function toAmzDate(date) {
1041
1045
  return date.toISOString().replace(/[:-]|\.\d{3}/g, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/skills",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Skills library for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {