ns-omp-provider-kiro 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +80 -33
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -5,11 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ var __esm = (fn, res, err) => function __init() {
9
+ if (err) throw err[0];
10
+ try {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ } catch (e) {
13
+ throw err = [e], e;
14
+ }
10
15
  };
11
16
  var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ try {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ } catch (e) {
20
+ throw mod = 0, e;
21
+ }
13
22
  };
14
23
  var __export = (target, all) => {
15
24
  for (var name in all)
@@ -1407,6 +1416,30 @@ function profileCacheKey(auth) {
1407
1416
  const tokenHash = createHash2("sha256").update(auth.accessToken).digest("base64url");
1408
1417
  return `${auth.region}:${tokenHash}`;
1409
1418
  }
1419
+ async function getApiKeyProfileArn(accessToken) {
1420
+ const operation = "GetProfile";
1421
+ let response;
1422
+ try {
1423
+ response = await fetch(getKiroEndpoints(API_KEY_REGION).management, {
1424
+ method: "POST",
1425
+ headers: {
1426
+ "Content-Type": "application/x-amz-json-1.0",
1427
+ "X-Amz-Target": GET_PROFILE_TARGET,
1428
+ ...kiroAuthHeaders(accessToken),
1429
+ ...kiroUserAgent("codewhispererruntime", "F,C")
1430
+ },
1431
+ body: "{}"
1432
+ });
1433
+ } catch (error2) {
1434
+ throw new Error(`Kiro management ${operation} request failed in ${API_KEY_REGION}`, { cause: error2 });
1435
+ }
1436
+ const parsed = await parseManagementResponse(response, operation, API_KEY_REGION);
1437
+ const arn = parsed.profile?.arn;
1438
+ if (!arn) {
1439
+ throw new Error(`Kiro management ${operation} returned no profile in ${API_KEY_REGION}`);
1440
+ }
1441
+ return arn;
1442
+ }
1410
1443
  async function parseManagementResponse(response, operation, region) {
1411
1444
  if (!response.ok) {
1412
1445
  const statusText = response.statusText ? ` ${redactSensitiveText(response.statusText)}` : "";
@@ -1442,6 +1475,13 @@ async function resolveKiroProfileArn(auth, providedArn) {
1442
1475
  if (pending)
1443
1476
  return pending;
1444
1477
  const request = (async () => {
1478
+ if (isApiKey(auth.accessToken)) {
1479
+ const arn = await getApiKeyProfileArn(auth.accessToken);
1480
+ profileArnCache.set(key, arn);
1481
+ profileRegionCache.set(key, API_KEY_REGION);
1482
+ debugLog("profile.resolve", { source: "api-key", region: API_KEY_REGION, arn });
1483
+ return arn;
1484
+ }
1445
1485
  let lastResponse;
1446
1486
  let lastHttpError;
1447
1487
  for (const region of candidateManagementRegions(auth.region)) {
@@ -1492,7 +1532,7 @@ async function listAvailableModels(auth, profileArn) {
1492
1532
  }
1493
1533
  async function fetchKiroModelCatalog(auth, providedProfileArn) {
1494
1534
  const profileArn = await resolveKiroProfileArn(auth, providedProfileArn);
1495
- const region = profileRegionCache.get(profileCacheKey(auth)) ?? auth.region;
1535
+ const region = isApiKey(auth.accessToken) ? API_KEY_REGION : profileRegionCache.get(profileCacheKey(auth)) ?? auth.region;
1496
1536
  if (region !== auth.region) {
1497
1537
  return listAvailableModels({ ...auth, region }, profileArn);
1498
1538
  }
@@ -1521,7 +1561,7 @@ async function getUsageLimits(auth, request) {
1521
1561
  }
1522
1562
  return parseManagementResponse(response, operation, auth.region);
1523
1563
  }
1524
- var LIST_PROFILES_PATH, LIST_MODELS_PATH, profileArnCache, pendingProfileRequests, profileRegionCache, CANONICAL_MANAGEMENT_REGIONS, ENV_PROFILE_ARN, KiroManagementHttpError;
1564
+ var LIST_PROFILES_PATH, LIST_MODELS_PATH, GET_PROFILE_TARGET, API_KEY_REGION, profileArnCache, pendingProfileRequests, profileRegionCache, CANONICAL_MANAGEMENT_REGIONS, ENV_PROFILE_ARN, KiroManagementHttpError;
1525
1565
  var init_management = __esm({
1526
1566
  "../kiro-core/dist/management.js"() {
1527
1567
  "use strict";
@@ -1531,6 +1571,8 @@ var init_management = __esm({
1531
1571
  init_token_type();
1532
1572
  LIST_PROFILES_PATH = "List-Available-Profiles";
1533
1573
  LIST_MODELS_PATH = "List-Available-Models";
1574
+ GET_PROFILE_TARGET = "AmazonCodeWhispererService.GetProfile";
1575
+ API_KEY_REGION = "us-east-1";
1534
1576
  profileArnCache = /* @__PURE__ */ new Map();
1535
1577
  pendingProfileRequests = /* @__PURE__ */ new Map();
1536
1578
  profileRegionCache = /* @__PURE__ */ new Map();
@@ -3334,13 +3376,13 @@ var KiroResponseAssembler = class {
3334
3376
  }
3335
3377
  };
3336
3378
 
3337
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/index.js
3379
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/index.js
3338
3380
  import { getRandomValues } from "node:crypto";
3339
3381
 
3340
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js
3382
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js
3341
3383
  var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
3342
3384
 
3343
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-buffer-from/buffer-from.js
3385
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-buffer-from/buffer-from.js
3344
3386
  var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
3345
3387
  if (!isArrayBuffer(input)) {
3346
3388
  throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
@@ -3354,7 +3396,7 @@ var fromString = (input, encoding) => {
3354
3396
  return encoding ? Buffer.from(input, encoding) : Buffer.from(input);
3355
3397
  };
3356
3398
 
3357
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js
3399
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js
3358
3400
  var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
3359
3401
  var fromBase64 = (input) => {
3360
3402
  if (input.length * 3 % 4 !== 0) {
@@ -3367,13 +3409,13 @@ var fromBase64 = (input) => {
3367
3409
  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
3368
3410
  };
3369
3411
 
3370
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.js
3412
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.js
3371
3413
  var fromUtf8 = (input) => {
3372
3414
  const buf = fromString(input, "utf8");
3373
3415
  return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
3374
3416
  };
3375
3417
 
3376
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js
3418
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js
3377
3419
  var toBase64 = (_input) => {
3378
3420
  let input;
3379
3421
  if (typeof _input === "string") {
@@ -3387,7 +3429,7 @@ var toBase64 = (_input) => {
3387
3429
  return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64");
3388
3430
  };
3389
3431
 
3390
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js
3432
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js
3391
3433
  function bindUint8ArrayBlobAdapter(toUtf82, fromUtf82, toBase642, fromBase642) {
3392
3434
  return class Uint8ArrayBlobAdapter2 extends Uint8Array {
3393
3435
  static fromString(source, encoding = "utf-8") {
@@ -3412,7 +3454,7 @@ function bindUint8ArrayBlobAdapter(toUtf82, fromUtf82, toBase642, fromBase642) {
3412
3454
  };
3413
3455
  }
3414
3456
 
3415
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.js
3457
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.js
3416
3458
  var toUtf8 = (input) => {
3417
3459
  if (typeof input === "string") {
3418
3460
  return input;
@@ -3423,7 +3465,7 @@ var toUtf8 = (input) => {
3423
3465
  return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
3424
3466
  };
3425
3467
 
3426
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js
3468
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js
3427
3469
  var decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
3428
3470
  function bindV4(getRandomValues2) {
3429
3471
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
@@ -3438,12 +3480,12 @@ function bindV4(getRandomValues2) {
3438
3480
  };
3439
3481
  }
3440
3482
 
3441
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/hasOwn.js
3483
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/transport/hasOwn.js
3442
3484
  function hasOwn(o, k) {
3443
3485
  return Object.prototype.hasOwnProperty.call(o, k);
3444
3486
  }
3445
3487
 
3446
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js
3488
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js
3447
3489
  var SHORT_TO_HEX = {};
3448
3490
  var HEX_TO_SHORT = {};
3449
3491
  for (let i = 0; i < 256; i++) {
@@ -3477,13 +3519,13 @@ function toHex(bytes) {
3477
3519
  return out;
3478
3520
  }
3479
3521
 
3480
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/index.js
3522
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/serde/index.js
3481
3523
  var Uint8ArrayBlobAdapter = class extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {
3482
3524
  };
3483
3525
  var _getRandomValues = getRandomValues;
3484
3526
  var v4 = bindV4(_getRandomValues);
3485
3527
 
3486
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js
3528
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js
3487
3529
  var CRC32_TABLE = new Uint32Array(256);
3488
3530
  for (let i = 0; i < 256; ++i) {
3489
3531
  let c = i;
@@ -3515,7 +3557,7 @@ var Crc32Js = class {
3515
3557
  }
3516
3558
  };
3517
3559
 
3518
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js
3560
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js
3519
3561
  import * as zlib from "node:zlib";
3520
3562
  var zlibCrc32 = typeof zlib.crc32 === "function" ? zlib.crc32 : void 0;
3521
3563
  var Crc32Node = zlibCrc32 ? buildNativeClass(zlibCrc32) : Crc32Js;
@@ -3540,7 +3582,7 @@ function buildNativeClass(nativeCrc32) {
3540
3582
  };
3541
3583
  }
3542
3584
 
3543
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js
3585
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js
3544
3586
  var Int64 = class _Int64 {
3545
3587
  bytes;
3546
3588
  constructor(bytes) {
@@ -3585,7 +3627,7 @@ function negate(bytes) {
3585
3627
  }
3586
3628
  }
3587
3629
 
3588
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js
3630
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js
3589
3631
  var HeaderMarshaller = class {
3590
3632
  toUtf8;
3591
3633
  fromUtf8;
@@ -3771,7 +3813,7 @@ var TIMESTAMP_TAG = "timestamp";
3771
3813
  var UUID_TAG = "uuid";
3772
3814
  var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
3773
3815
 
3774
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js
3816
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js
3775
3817
  var PRELUDE_MEMBER_LENGTH = 4;
3776
3818
  var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;
3777
3819
  var CHECKSUM_LENGTH = 4;
@@ -3803,7 +3845,7 @@ function splitMessage({ byteLength, byteOffset, buffer }) {
3803
3845
  };
3804
3846
  }
3805
3847
 
3806
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js
3848
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js
3807
3849
  var EventStreamCodec = class {
3808
3850
  headerMarshaller;
3809
3851
  messageBuffer;
@@ -3869,7 +3911,7 @@ var EventStreamCodec = class {
3869
3911
  }
3870
3912
  };
3871
3913
 
3872
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js
3914
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js
3873
3915
  var MessageDecoderStream = class {
3874
3916
  options;
3875
3917
  constructor(options) {
@@ -3886,7 +3928,7 @@ var MessageDecoderStream = class {
3886
3928
  }
3887
3929
  };
3888
3930
 
3889
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js
3931
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js
3890
3932
  var MessageEncoderStream = class {
3891
3933
  options;
3892
3934
  constructor(options) {
@@ -3906,7 +3948,7 @@ var MessageEncoderStream = class {
3906
3948
  }
3907
3949
  };
3908
3950
 
3909
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js
3951
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js
3910
3952
  var SmithyMessageDecoderStream = class {
3911
3953
  options;
3912
3954
  constructor(options) {
@@ -3925,7 +3967,7 @@ var SmithyMessageDecoderStream = class {
3925
3967
  }
3926
3968
  };
3927
3969
 
3928
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js
3970
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js
3929
3971
  var SmithyMessageEncoderStream = class {
3930
3972
  options;
3931
3973
  constructor(options) {
@@ -3942,7 +3984,7 @@ var SmithyMessageEncoderStream = class {
3942
3984
  }
3943
3985
  };
3944
3986
 
3945
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js
3987
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js
3946
3988
  function getChunkedStream(source) {
3947
3989
  let currentMessageTotalLength = 0;
3948
3990
  let currentMessagePendingLength = 0;
@@ -4008,7 +4050,7 @@ function getChunkedStream(source) {
4008
4050
  };
4009
4051
  }
4010
4052
 
4011
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js
4053
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js
4012
4054
  function getMessageUnmarshaller(deserializer, toUtf82) {
4013
4055
  return async function(message) {
4014
4056
  const { value: messageType } = message.headers[":message-type"];
@@ -4040,7 +4082,7 @@ function getMessageUnmarshaller(deserializer, toUtf82) {
4040
4082
  };
4041
4083
  }
4042
4084
 
4043
- // ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js
4085
+ // ../../node_modules/.pnpm/@smithy+core@3.34.1/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js
4044
4086
  var EventStreamMarshaller = class {
4045
4087
  eventStreamCodec;
4046
4088
  utfEncoder;
@@ -4111,7 +4153,7 @@ function readKiroEventStream(body, options) {
4111
4153
  });
4112
4154
  const iterator = eventStream[Symbol.asyncIterator]();
4113
4155
  let gotFirstToken = false;
4114
- const FIRST_TOKEN_SENTINEL = Symbol("firstTokenTimeout");
4156
+ const FIRST_TOKEN_SENTINEL = /* @__PURE__ */ Symbol("firstTokenTimeout");
4115
4157
  try {
4116
4158
  while (true) {
4117
4159
  let iterResult;
@@ -4698,7 +4740,12 @@ async function loginKiro(callbacks) {
4698
4740
  return existing;
4699
4741
  }
4700
4742
  if (!callbacks.onPrompt) throw new Error(NO_SESSION_MESSAGE);
4701
- const apiKey = (await callbacks.onPrompt({ message: NO_SESSION_MESSAGE, placeholder: "ksk_\u2026", allowEmpty: true })).trim();
4743
+ const apiKey = (await callbacks.onPrompt({
4744
+ message: NO_SESSION_MESSAGE,
4745
+ placeholder: "ksk_\u2026",
4746
+ allowEmpty: true,
4747
+ secret: true
4748
+ })).trim();
4702
4749
  if (!apiKey) throw new Error(NO_SESSION_MESSAGE);
4703
4750
  return await loginKiroWithApiKey(apiKey, callbacks.onProgress);
4704
4751
  }
@@ -5065,7 +5112,7 @@ function toUsageReport(provider, usage, fetchedAt = Date.now()) {
5065
5112
  }
5066
5113
  var kiroUsageProvider = {
5067
5114
  id: "kiro",
5068
- async fetchUsage(params) {
5115
+ async fetchUsage(params, _ctx) {
5069
5116
  const token = params.credential.accessToken ?? params.credential.apiKey;
5070
5117
  if (!token) return null;
5071
5118
  const usage = await fetchKiroUsage({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ns-omp-provider-kiro",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "OMP (oh-my-pi) provider plugin: adds Kiro (AWS CodeWhisperer/Q) models via your kiro-cli login",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,11 +37,11 @@
37
37
  "README.md"
38
38
  ],
39
39
  "dependencies": {
40
- "ns-kiro-core": "0.2.2"
40
+ "ns-kiro-core": "0.2.3"
41
41
  },
42
42
  "peerDependencies": {
43
- "@oh-my-pi/pi-ai": ">=18.1.0",
44
- "@oh-my-pi/pi-coding-agent": ">=18.1.0"
43
+ "@oh-my-pi/pi-ai": ">=18.2.0",
44
+ "@oh-my-pi/pi-coding-agent": ">=18.2.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "@oh-my-pi/pi-ai": {
@@ -52,9 +52,9 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@oh-my-pi/pi-ai": "18.1.13",
56
- "@oh-my-pi/pi-coding-agent": "18.1.13",
57
- "@types/node": "^22.10.0"
55
+ "@oh-my-pi/pi-ai": "18.2.7",
56
+ "@oh-my-pi/pi-coding-agent": "18.2.7",
57
+ "@types/node": "^22.20.4"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --banner:js=\"import{createRequire as __kiroCreateRequire}from'node:module';const require=__kiroCreateRequire(import.meta.url);\" --external:@oh-my-pi/pi-ai --external:@oh-my-pi/pi-catalog --external:@oh-my-pi/pi-coding-agent --external:@oh-my-pi/pi-tui && tsc -p tsconfig.json --emitDeclarationOnly",