@ampt/ai 2.2.0 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.1](https://github.com/getampt/cloud/compare/@ampt/ai-v2.2.0...@ampt/ai-v2.2.1) (2026-11-19)
4
+
5
+ ### Bug Fixes
6
+
7
+ - link the public changelog from every package ([#2947](https://github.com/getampt/cloud/issues/2947)) ([7a4a672](https://github.com/getampt/cloud/commit/7a4a672a4b4bfcb6d99b0eefd8045512044157b6))
8
+
3
9
  ## [2.2.0](https://github.com/getampt/cloud/compare/@ampt/ai-v2.1.0...@ampt/ai-v2.2.0) (2026-11-08)
4
10
 
5
11
  ### Features
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @ampt/ai
2
+
3
+ AI helpers for Ampt apps: chat, embeddings, summarization, and translation.
4
+
5
+ - Docs: https://getampt.com/docs
6
+ - Changelog: https://ampt.dev/changelog?product=%40ampt%2Fai
7
+ - Questions: https://getampt.com/discord
package/dist/index.cjs CHANGED
@@ -20313,7 +20313,7 @@ var AwsClient = class {
20313
20313
  }
20314
20314
  input = url;
20315
20315
  }
20316
- const signer = new AwsV4Signer(Object.assign({ url: input }, init, this, init && init.aws));
20316
+ const signer = new AwsV4Signer(Object.assign({ url: input.toString() }, init, this, init && init.aws));
20317
20317
  const signed = Object.assign({}, init, await signer.sign());
20318
20318
  delete signed.aws;
20319
20319
  try {
@@ -20489,23 +20489,36 @@ async function hmac(key, string) {
20489
20489
  async function hash(content) {
20490
20490
  return crypto.subtle.digest("SHA-256", typeof content === "string" ? encoder.encode(content) : content);
20491
20491
  }
20492
- function buf2hex(buffer) {
20493
- return Array.prototype.map.call(new Uint8Array(buffer), (x8) => ("0" + x8.toString(16)).slice(-2)).join("");
20492
+ var HEX_CHARS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
20493
+ function buf2hex(arrayBuffer) {
20494
+ const buffer = new Uint8Array(arrayBuffer);
20495
+ let out = "";
20496
+ for (let idx = 0; idx < buffer.length; idx++) {
20497
+ const n18 = buffer[idx];
20498
+ out += HEX_CHARS[n18 >>> 4 & 15];
20499
+ out += HEX_CHARS[n18 & 15];
20500
+ }
20501
+ return out;
20494
20502
  }
20495
20503
  function encodeRfc3986(urlEncodedStr) {
20496
20504
  return urlEncodedStr.replace(/[!'()*]/g, (c18) => "%" + c18.charCodeAt(0).toString(16).toUpperCase());
20497
20505
  }
20498
20506
  function guessServiceRegion(url, headers) {
20499
20507
  const { hostname, pathname } = url;
20508
+ if (hostname.endsWith(".on.aws")) {
20509
+ const match2 = hostname.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);
20510
+ return match2 != null ? ["lambda", match2[1] || ""] : ["", ""];
20511
+ }
20500
20512
  if (hostname.endsWith(".r2.cloudflarestorage.com")) {
20501
20513
  return ["s3", "auto"];
20502
20514
  }
20503
20515
  if (hostname.endsWith(".backblazeb2.com")) {
20504
- const match2 = hostname.match(/^(?:[^.]+\.)?s3\.([^.]+)\.backblazeb2\.com$/);
20505
- return match2 != null ? ["s3", match2[1]] : ["", ""];
20516
+ const match2 = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);
20517
+ return match2 != null ? ["s3", match2[1] || ""] : ["", ""];
20506
20518
  }
20507
- const match = hostname.replace("dualstack.", "").match(/([^.]+)\.(?:([^.]*)\.)?amazonaws\.com(?:\.cn)?$/);
20508
- let [service, region3] = (match || ["", ""]).slice(1, 3);
20519
+ const match = hostname.replace("dualstack.", "").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);
20520
+ let service = match && match[1] || "";
20521
+ let region3 = match && match[2];
20509
20522
  if (region3 === "us-gov") {
20510
20523
  region3 = "us-gov-west-1";
20511
20524
  } else if (region3 === "s3" || region3 === "s3-accelerate") {
@@ -20534,7 +20547,7 @@ function guessServiceRegion(url, headers) {
20534
20547
  } else if (region3 && /-\d$/.test(service) && !/-\d$/.test(region3)) {
20535
20548
  [service, region3] = [region3, service];
20536
20549
  }
20537
- return [HOST_SERVICES[service] || service, region3];
20550
+ return [HOST_SERVICES[service] || service, region3 || ""];
20538
20551
  }
20539
20552
 
20540
20553
  // ../../lib/runtime-logging/index.ts
@@ -55785,6 +55798,6 @@ tslib/tslib.es6.js:
55785
55798
  aws4fetch/dist/aws4fetch.esm.mjs:
55786
55799
  (**
55787
55800
  * @license MIT <https://opensource.org/licenses/MIT>
55788
- * @copyright Michael Hart 2022
55801
+ * @copyright Michael Hart 2024
55789
55802
  *)
55790
55803
  */
package/dist/index.js CHANGED
@@ -7242,7 +7242,7 @@ var AwsClient = class {
7242
7242
  }
7243
7243
  input = url;
7244
7244
  }
7245
- const signer = new AwsV4Signer(Object.assign({ url: input }, init, this, init && init.aws));
7245
+ const signer = new AwsV4Signer(Object.assign({ url: input.toString() }, init, this, init && init.aws));
7246
7246
  const signed = Object.assign({}, init, await signer.sign());
7247
7247
  delete signed.aws;
7248
7248
  try {
@@ -7418,23 +7418,36 @@ async function hmac(key, string) {
7418
7418
  async function hash(content) {
7419
7419
  return crypto.subtle.digest("SHA-256", typeof content === "string" ? encoder.encode(content) : content);
7420
7420
  }
7421
- function buf2hex(buffer) {
7422
- return Array.prototype.map.call(new Uint8Array(buffer), (x7) => ("0" + x7.toString(16)).slice(-2)).join("");
7421
+ var HEX_CHARS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
7422
+ function buf2hex(arrayBuffer) {
7423
+ const buffer = new Uint8Array(arrayBuffer);
7424
+ let out = "";
7425
+ for (let idx = 0; idx < buffer.length; idx++) {
7426
+ const n14 = buffer[idx];
7427
+ out += HEX_CHARS[n14 >>> 4 & 15];
7428
+ out += HEX_CHARS[n14 & 15];
7429
+ }
7430
+ return out;
7423
7431
  }
7424
7432
  function encodeRfc3986(urlEncodedStr) {
7425
7433
  return urlEncodedStr.replace(/[!'()*]/g, (c14) => "%" + c14.charCodeAt(0).toString(16).toUpperCase());
7426
7434
  }
7427
7435
  function guessServiceRegion(url, headers) {
7428
7436
  const { hostname, pathname } = url;
7437
+ if (hostname.endsWith(".on.aws")) {
7438
+ const match2 = hostname.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);
7439
+ return match2 != null ? ["lambda", match2[1] || ""] : ["", ""];
7440
+ }
7429
7441
  if (hostname.endsWith(".r2.cloudflarestorage.com")) {
7430
7442
  return ["s3", "auto"];
7431
7443
  }
7432
7444
  if (hostname.endsWith(".backblazeb2.com")) {
7433
- const match2 = hostname.match(/^(?:[^.]+\.)?s3\.([^.]+)\.backblazeb2\.com$/);
7434
- return match2 != null ? ["s3", match2[1]] : ["", ""];
7445
+ const match2 = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);
7446
+ return match2 != null ? ["s3", match2[1] || ""] : ["", ""];
7435
7447
  }
7436
- const match = hostname.replace("dualstack.", "").match(/([^.]+)\.(?:([^.]*)\.)?amazonaws\.com(?:\.cn)?$/);
7437
- let [service, region3] = (match || ["", ""]).slice(1, 3);
7448
+ const match = hostname.replace("dualstack.", "").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);
7449
+ let service = match && match[1] || "";
7450
+ let region3 = match && match[2];
7438
7451
  if (region3 === "us-gov") {
7439
7452
  region3 = "us-gov-west-1";
7440
7453
  } else if (region3 === "s3" || region3 === "s3-accelerate") {
@@ -7463,7 +7476,7 @@ function guessServiceRegion(url, headers) {
7463
7476
  } else if (region3 && /-\d$/.test(service) && !/-\d$/.test(region3)) {
7464
7477
  [service, region3] = [region3, service];
7465
7478
  }
7466
- return [HOST_SERVICES[service] || service, region3];
7479
+ return [HOST_SERVICES[service] || service, region3 || ""];
7467
7480
  }
7468
7481
 
7469
7482
  // ../../lib/runtime-logging/index.ts
@@ -42595,6 +42608,6 @@ tslib/tslib.es6.js:
42595
42608
  aws4fetch/dist/aws4fetch.esm.mjs:
42596
42609
  (**
42597
42610
  * @license MIT <https://opensource.org/licenses/MIT>
42598
- * @copyright Michael Hart 2022
42611
+ * @copyright Michael Hart 2024
42599
42612
  *)
42600
42613
  */
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@ampt/ai",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
+ "homepage": "https://ampt.dev/changelog?product=%40ampt%2Fai",
4
5
  "type": "module",
5
6
  "main": "./dist/index.cjs",
6
7
  "module": "./dist/index.js",