@aeye/cletus 0.1.3 → 0.1.4

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 (3) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +2044 -355
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -372029,7 +372029,7 @@ import { Box as Box7, Static, Text as Text9, useInput as useInput3 } from "ink";
372029
372029
  import TextInput2 from "ink-text-input";
372030
372030
  import path11 from "path";
372031
372031
  import events from "events";
372032
- import React9, { useEffect as useEffect5, useRef as useRef4, useState as useState5 } from "react";
372032
+ import React9, { useEffect as useEffect5, useRef as useRef3, useState as useState5 } from "react";
372033
372033
 
372034
372034
  // ../ai/src/modelDetection.ts
372035
372035
  function detectTier(name) {
@@ -372200,11 +372200,11 @@ function getTotalTokens(usage) {
372200
372200
  function getModel(input) {
372201
372201
  return typeof input === "string" ? { id: input } : input;
372202
372202
  }
372203
- function getResponseFromChunks(chunks) {
372203
+ function getResponseFromChunks(chunks, model = "unknown") {
372204
372204
  const resp = {
372205
372205
  content: "",
372206
372206
  finishReason: "stop",
372207
- model: "unknown"
372207
+ model
372208
372208
  };
372209
372209
  for (const chunk3 of chunks) {
372210
372210
  if (chunk3.content) {
@@ -385348,8 +385348,8 @@ var Prompt = class _Prompt {
385348
385348
  } : (ev) => ev;
385349
385349
  const emitTool = (ev) => emit(ev);
385350
385350
  while (iterations < maxIterations) {
385351
- const toolCalls = [];
385352
- const toolCallMap = /* @__PURE__ */ new Map();
385351
+ const toolExecutors = [];
385352
+ const toolExecutorMap = /* @__PURE__ */ new Map();
385353
385353
  const toolErrorsPrevious = toolCallErrors + toolParseErrors;
385354
385354
  const toolParseErrorsPrevious = toolParseErrors;
385355
385355
  let finishReason = void 0;
@@ -385391,33 +385391,33 @@ var Prompt = class _Prompt {
385391
385391
  yield emit({ type: "reasonPartial", content: chunk3.reasoning, request });
385392
385392
  }
385393
385393
  if (chunk3.toolCallNamed) {
385394
- const toolCall = newToolExecution(ctx, chunk3.toolCallNamed, toolMap.get(chunk3.toolCallNamed.name));
385395
- toolCalls.push(toolCall);
385396
- toolCallMap.set(chunk3.toolCallNamed.id, toolCall);
385397
- if (toolCall.tool) {
385398
- yield emit({ type: "toolParseName", tool: toolCall.tool, request });
385394
+ const toolExecutor = newToolExecution(ctx, chunk3.toolCallNamed, toolMap.get(chunk3.toolCallNamed.name));
385395
+ toolExecutors.push(toolExecutor);
385396
+ toolExecutorMap.set(chunk3.toolCallNamed.id, toolExecutor);
385397
+ if (toolExecutor.tool) {
385398
+ yield emit({ type: "toolParseName", tool: toolExecutor.tool, request });
385399
385399
  } else {
385400
- streamController.abort(toolCall.error);
385400
+ streamController.abort(toolExecutor.error);
385401
385401
  break;
385402
385402
  }
385403
385403
  }
385404
385404
  if (chunk3.toolCallArguments) {
385405
- const toolCall = toolCallMap.get(chunk3.toolCallArguments.id);
385406
- toolCall.toolCall = chunk3.toolCallArguments;
385407
- yield emit({ type: "toolParseArguments", tool: toolCall.tool, args: chunk3.toolCallArguments.arguments, request });
385405
+ const toolExecutor = toolExecutorMap.get(chunk3.toolCallArguments.id);
385406
+ toolExecutor.toolCall = chunk3.toolCallArguments;
385407
+ yield emit({ type: "toolParseArguments", tool: toolExecutor.tool, args: chunk3.toolCallArguments.arguments, request });
385408
385408
  }
385409
385409
  if (chunk3.toolCall) {
385410
- const toolCall = toolCallMap.get(chunk3.toolCall.id);
385411
- toolCall.toolCall = chunk3.toolCall;
385410
+ const toolExecutor = toolExecutorMap.get(chunk3.toolCall.id);
385411
+ toolExecutor.toolCall = chunk3.toolCall;
385412
385412
  if (toolMode === "immediate") {
385413
- setImmediate(toolCall.run);
385413
+ setImmediate(toolExecutor.run);
385414
385414
  }
385415
385415
  }
385416
385416
  if (chunk3.finishReason) {
385417
385417
  finishReason = chunk3.finishReason;
385418
385418
  }
385419
385419
  if (toolMode === "immediate") {
385420
- for (const toolCall of toolCalls) {
385420
+ for (const toolCall of toolExecutors) {
385421
385421
  if (toolCall.emitStart()) {
385422
385422
  yield emitTool({ type: "toolStart", tool: toolCall.tool, args: toolCall.args, request });
385423
385423
  }
@@ -385458,72 +385458,72 @@ var Prompt = class _Prompt {
385458
385458
  if (content2.length > 0) {
385459
385459
  yield emit({ type: "text", content: content2, request });
385460
385460
  }
385461
- if (finishReason === "tool_calls" || toolCalls.length) {
385461
+ if (finishReason === "tool_calls" || toolExecutors.length) {
385462
385462
  request.messages.push({
385463
385463
  role: "assistant",
385464
385464
  content: content2,
385465
- toolCalls: toolCalls.map((tc) => tc.toolCall)
385465
+ toolCalls: toolExecutors.map((te) => te.toolCall)
385466
385466
  });
385467
385467
  let skip = false;
385468
- for (const toolCall of toolCalls) {
385469
- if (toolCall.error) {
385468
+ for (const toolExecutor of toolExecutors) {
385469
+ if (toolExecutor.error) {
385470
385470
  skip = true;
385471
385471
  } else {
385472
- toolCall.parse();
385472
+ toolExecutor.parse();
385473
385473
  }
385474
- if (toolCall.emitStart()) {
385475
- yield emitTool({ type: "toolStart", tool: toolCall.tool, args: toolCall.args, request });
385474
+ if (toolExecutor.emitStart()) {
385475
+ yield emitTool({ type: "toolStart", tool: toolExecutor.tool, args: toolExecutor.args, request });
385476
385476
  }
385477
- if (toolCall.emitError()) {
385478
- yield emitTool({ type: "toolError", tool: toolCall.tool, args: toolCall.args, error: toolCall.error, request });
385477
+ if (toolExecutor.emitError()) {
385478
+ yield emitTool({ type: "toolError", tool: toolExecutor.tool, args: toolExecutor.args, error: toolExecutor.error, request });
385479
385479
  }
385480
385480
  }
385481
385481
  const iterationMode = skip ? "skip" : toolMode;
385482
385482
  switch (iterationMode) {
385483
385483
  case "sequential":
385484
- for (const toolCall of toolCalls) {
385485
- await toolCall.parse();
385486
- if (toolCall.emitStart()) {
385487
- yield emitTool({ type: "toolStart", tool: toolCall.tool, args: toolCall.args, request });
385484
+ for (const toolExecutor of toolExecutors) {
385485
+ await toolExecutor.parse();
385486
+ if (toolExecutor.emitStart()) {
385487
+ yield emitTool({ type: "toolStart", tool: toolExecutor.tool, args: toolExecutor.args, request });
385488
385488
  }
385489
- await toolCall.run();
385490
- if (toolCall.emitOutput()) {
385491
- yield emitTool({ type: "toolOutput", tool: toolCall.tool, args: toolCall.args, result: toolCall.result, request });
385489
+ await toolExecutor.run();
385490
+ if (toolExecutor.emitOutput()) {
385491
+ yield emitTool({ type: "toolOutput", tool: toolExecutor.tool, args: toolExecutor.args, result: toolExecutor.result, request });
385492
385492
  }
385493
- if (toolCall.emitError()) {
385494
- yield emitTool({ type: "toolError", tool: toolCall.tool, args: toolCall.args, error: toolCall.error, request });
385493
+ if (toolExecutor.emitError()) {
385494
+ yield emitTool({ type: "toolError", tool: toolExecutor.tool, args: toolExecutor.args, error: toolExecutor.error, request });
385495
385495
  }
385496
385496
  }
385497
385497
  break;
385498
385498
  case "parallel":
385499
385499
  case "immediate":
385500
- const parseRuns = toolCalls.map((tc) => [tc.parse(), tc.run()]).flat();
385500
+ const parseRuns = toolExecutors.map((tc) => [tc.parse(), tc.run()]).flat();
385501
385501
  for await (const { result: toolCallPromise } of yieldAll(parseRuns)) {
385502
- const toolCall = await toolCallPromise;
385503
- if (toolCall.emitStart()) {
385504
- yield emitTool({ type: "toolStart", tool: toolCall.tool, args: toolCall.args, request });
385502
+ const toolExecutor = await toolCallPromise;
385503
+ if (toolExecutor.emitStart()) {
385504
+ yield emitTool({ type: "toolStart", tool: toolExecutor.tool, args: toolExecutor.args, request });
385505
385505
  }
385506
- if (toolCall.emitOutput()) {
385507
- yield emitTool({ type: "toolOutput", tool: toolCall.tool, args: toolCall.args, result: toolCall.result, request });
385506
+ if (toolExecutor.emitOutput()) {
385507
+ yield emitTool({ type: "toolOutput", tool: toolExecutor.tool, args: toolExecutor.args, result: toolExecutor.result, request });
385508
385508
  }
385509
- if (toolCall.emitError()) {
385510
- yield emitTool({ type: "toolError", tool: toolCall.tool, args: toolCall.args, error: toolCall.error, request });
385509
+ if (toolExecutor.emitError()) {
385510
+ yield emitTool({ type: "toolError", tool: toolExecutor.tool, args: toolExecutor.args, error: toolExecutor.error, request });
385511
385511
  }
385512
385512
  }
385513
385513
  break;
385514
385514
  }
385515
- for (const toolCall of toolCalls) {
385516
- const content3 = toolCall.error ? toolCall.error : toolCall.result ? typeof toolCall.result === "string" ? toolCall.result : JSON.stringify(toolCall.result) : "";
385515
+ for (const toolExecutor of toolExecutors) {
385516
+ const content3 = toolExecutor.error ? toolExecutor.error : toolExecutor.result ? typeof toolExecutor.result === "string" ? toolExecutor.result : JSON.stringify(toolExecutor.result) : "";
385517
385517
  request.messages.push({
385518
385518
  role: "tool",
385519
385519
  content: content3,
385520
- toolCallId: toolCall.toolCall.id
385520
+ toolCallId: toolExecutor.toolCall.id
385521
385521
  });
385522
- if (toolCall.status === "invalid") {
385522
+ if (toolExecutor.status === "invalid") {
385523
385523
  toolParseErrors++;
385524
- } else if (toolCall.status === "error") {
385524
+ } else if (toolExecutor.status === "error") {
385525
385525
  toolCallErrors++;
385526
- } else if (toolCall.status === "success") {
385526
+ } else if (toolExecutor.status === "success") {
385527
385527
  toolSuccesses++;
385528
385528
  }
385529
385529
  }
@@ -385539,7 +385539,7 @@ var Prompt = class _Prompt {
385539
385539
  const hitMax = this.input.toolsMax && toolSuccesses >= this.input.toolsMax;
385540
385540
  if (onlyTools) {
385541
385541
  const successWithoutNewErrors = toolSuccesses > 0 && !hadToolErrors;
385542
- const noTools = toolCalls.length === 0;
385542
+ const noTools = toolExecutors.length === 0;
385543
385543
  if (hitMax || successWithoutNewErrors || noTools) {
385544
385544
  lastError = void 0;
385545
385545
  break;
@@ -385892,12 +385892,12 @@ function newToolExecution(ctx, toolCall, toolInfo) {
385892
385892
  return execution;
385893
385893
  }
385894
385894
  try {
385895
- execution.args = await toolInfo.tool.parse(ctx, toolCall.arguments, toolInfo.definition.parameters);
385895
+ execution.args = await toolInfo.tool.parse(ctx, execution.toolCall.arguments, toolInfo.definition.parameters);
385896
385896
  execution.status = "parsed";
385897
385897
  start.ready = true;
385898
385898
  } catch (e3) {
385899
385899
  execution.status = "invalid";
385900
- execution.error = `Error parsing tool arguments: ${e3.message}, args: ${toolCall.arguments}`;
385900
+ execution.error = `Error parsing tool arguments: ${e3.message}, args: ${execution.toolCall.arguments}`;
385901
385901
  error47.ready = true;
385902
385902
  }
385903
385903
  return execution;
@@ -386130,7 +386130,7 @@ var BaseAPI = class {
386130
386130
  finished = true;
386131
386131
  } finally {
386132
386132
  const cost = this.calculateStreamCost(accumulatedUsage, finalSelected);
386133
- const response = this.chunksToResponse(chunks, finalSelected.model.id);
386133
+ const response = this.chunksToResponse(chunks, finalSelected);
386134
386134
  await hooks.afterRequest?.(fullCtx, request, response, finished, finalSelected, accumulatedUsage, cost);
386135
386135
  }
386136
386136
  } catch (error47) {
@@ -386239,14 +386239,14 @@ var BaseAPI = class {
386239
386239
  for await (const chunk3 of streamerMethod(request, ctx)) {
386240
386240
  chunks.push(chunk3);
386241
386241
  }
386242
- return this.chunksToResponse(chunks, selected.model.id);
386242
+ return this.chunksToResponse(chunks, selected);
386243
386243
  }
386244
386244
  if (this.hasProviderStreamer(selected)) {
386245
386245
  const chunks = [];
386246
386246
  for await (const chunk3 of this.executeStreamRequest(request, selected, ctx)) {
386247
386247
  chunks.push(chunk3);
386248
386248
  }
386249
- return this.chunksToResponse(chunks, selected.model.id);
386249
+ return this.chunksToResponse(chunks, selected);
386250
386250
  }
386251
386251
  throw new Error(
386252
386252
  `Provider "${selected.model.provider}" does not support non-streaming requests for this operation and no fallback is available`
@@ -386262,24 +386262,22 @@ var BaseAPI = class {
386262
386262
  async *streamRequestWithFallback(request, selected, ctx, handler) {
386263
386263
  const handlerMethod = this.getHandlerStreamMethod(handler);
386264
386264
  if (handlerMethod) {
386265
- yield* handlerMethod(request, ctx);
386266
- return;
386265
+ return yield* handlerMethod(request, ctx);
386267
386266
  }
386268
386267
  if (this.hasProviderStreamer(selected)) {
386269
- yield* this.executeStreamRequest(request, selected, ctx);
386270
- return;
386268
+ return yield* this.executeStreamRequest(request, selected, ctx);
386271
386269
  }
386272
386270
  const getMethod = this.getHandlerGetMethod(handler);
386273
386271
  if (getMethod) {
386274
386272
  const response = await getMethod(request, ctx);
386275
- for (const chunk3 of this.responseToChunks(response)) {
386273
+ for (const chunk3 of this.responseToChunks(response, selected)) {
386276
386274
  yield chunk3;
386277
386275
  }
386278
386276
  return;
386279
386277
  }
386280
386278
  if (this.hasProviderExecutor(selected)) {
386281
386279
  const response = await this.executeRequest(request, selected, ctx);
386282
- for (const chunk3 of this.responseToChunks(response)) {
386280
+ for (const chunk3 of this.responseToChunks(response, selected)) {
386283
386281
  yield chunk3;
386284
386282
  }
386285
386283
  return;
@@ -386402,13 +386400,13 @@ var ChatAPI = class extends BaseAPI {
386402
386400
  throw new Error(`Provider ${selected.provider.name} does not support chat streaming`);
386403
386401
  }
386404
386402
  const streamer = selected.provider.createStreamer(selected.providerConfig);
386405
- yield* streamer(request, ctx, ctx.metadata);
386403
+ return yield* streamer(request, ctx, ctx.metadata);
386406
386404
  }
386407
- responseToChunks(response) {
386405
+ responseToChunks(response, model) {
386408
386406
  return getChunksFromResponse(response);
386409
386407
  }
386410
386408
  chunksToResponse(chunks, model) {
386411
- return getResponseFromChunks(chunks);
386409
+ return getResponseFromChunks(chunks, model?.model);
386412
386410
  }
386413
386411
  getHandlerGetMethod(handler) {
386414
386412
  return handler?.chat?.get;
@@ -386451,7 +386449,7 @@ var ChatAPI = class extends BaseAPI {
386451
386449
  yield chunk3;
386452
386450
  chunks.push(chunk3);
386453
386451
  }
386454
- return chatAPI.chunksToResponse(chunks, "unknown");
386452
+ return chatAPI.chunksToResponse(chunks);
386455
386453
  };
386456
386454
  }
386457
386455
  };
@@ -386586,7 +386584,7 @@ var ImageGenerateAPI = class extends BaseAPI {
386586
386584
  );
386587
386585
  }
386588
386586
  async *executeStreamRequest(request, selected, ctx) {
386589
- yield* selected.provider.generateImageStream(
386587
+ return yield* selected.provider.generateImageStream(
386590
386588
  request,
386591
386589
  ctx,
386592
386590
  selected.providerConfig
@@ -386605,7 +386603,7 @@ var ImageGenerateAPI = class extends BaseAPI {
386605
386603
  const images2 = chunks.filter((c3) => c3.image).map((c3) => c3.image);
386606
386604
  return {
386607
386605
  images: images2,
386608
- model: chunks.find((c3) => c3.model)?.model || model,
386606
+ model: chunks.find((c3) => c3.model)?.model || model?.model,
386609
386607
  usage: chunks.find((c3) => c3.usage)?.usage
386610
386608
  };
386611
386609
  }
@@ -386681,7 +386679,7 @@ var ImageEditAPI = class extends BaseAPI {
386681
386679
  );
386682
386680
  }
386683
386681
  async *executeStreamRequest(request, selected, ctx) {
386684
- yield* selected.provider.editImageStream(
386682
+ return yield* selected.provider.editImageStream(
386685
386683
  request,
386686
386684
  ctx,
386687
386685
  selected.providerConfig
@@ -386700,7 +386698,7 @@ var ImageEditAPI = class extends BaseAPI {
386700
386698
  const images2 = chunks.filter((c3) => c3.image).map((c3) => c3.image);
386701
386699
  return {
386702
386700
  images: images2,
386703
- model: chunks.find((c3) => c3.model)?.model || model,
386701
+ model: chunks.find((c3) => c3.model)?.model || model?.model,
386704
386702
  usage: chunks.find((c3) => c3.usage)?.usage
386705
386703
  };
386706
386704
  }
@@ -386779,13 +386777,13 @@ var ImageAnalyzeAPI = class extends BaseAPI {
386779
386777
  async *executeStreamRequest(request, selected, ctx) {
386780
386778
  const chatRequest = this.convertToChatRequest(request);
386781
386779
  const streamer = selected.provider.createStreamer(selected.providerConfig);
386782
- yield* streamer(chatRequest, ctx, ctx.metadata);
386780
+ return yield* streamer(chatRequest, ctx, ctx.metadata);
386783
386781
  }
386784
386782
  responseToChunks(response) {
386785
386783
  return getChunksFromResponse(response);
386786
386784
  }
386787
386785
  chunksToResponse(chunks, model) {
386788
- return getResponseFromChunks(chunks);
386786
+ return getResponseFromChunks(chunks, model?.model);
386789
386787
  }
386790
386788
  getHandlerGetMethod(handler) {
386791
386789
  return handler?.imageAnalyze?.get;
@@ -387030,7 +387028,7 @@ var TranscribeAPI = class extends BaseAPI {
387030
387028
  if (!selected.provider.transcribeStream) {
387031
387029
  throw new Error(`Provider ${selected.model.provider} does not support streaming transcription`);
387032
387030
  }
387033
- yield* selected.provider.transcribeStream(
387031
+ return yield* selected.provider.transcribeStream(
387034
387032
  request,
387035
387033
  ctx,
387036
387034
  selected.providerConfig
@@ -387045,7 +387043,7 @@ var TranscribeAPI = class extends BaseAPI {
387045
387043
  }
387046
387044
  chunksToResponse(chunks, givenModel) {
387047
387045
  let text = "";
387048
- let model = givenModel;
387046
+ let model = givenModel.model;
387049
387047
  let usage;
387050
387048
  for (const chunk3 of chunks) {
387051
387049
  if (chunk3.model) {
@@ -404414,11 +404412,1425 @@ var replicateModels = [{
404414
404412
  }
404415
404413
  }];
404416
404414
 
404415
+ // ../models/src/models/aws.ts
404416
+ var awsModels = [{
404417
+ id: "stability.stable-fast-upscale-v1:0",
404418
+ provider: "aws",
404419
+ name: "Stable Image Fast Upscale",
404420
+ contextWindow: 0,
404421
+ tier: "efficient",
404422
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404423
+ pricing: {},
404424
+ metadata: {
404425
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-fast-upscale-v1:0",
404426
+ providerName: "Stability AI",
404427
+ responseStreamingSupported: false,
404428
+ customizationsSupported: [],
404429
+ inferenceTypesSupported: [
404430
+ "INFERENCE_PROFILE"
404431
+ ],
404432
+ inputModalities: [
404433
+ "TEXT",
404434
+ "IMAGE"
404435
+ ],
404436
+ outputModalities: [
404437
+ "IMAGE"
404438
+ ]
404439
+ }
404440
+ }, {
404441
+ id: "anthropic.claude-sonnet-4-20250514-v1:0",
404442
+ provider: "aws",
404443
+ name: "Claude Sonnet 4",
404444
+ contextWindow: 2e5,
404445
+ maxOutputTokens: 16384,
404446
+ tier: "efficient",
404447
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
404448
+ pricing: {
404449
+ text: {
404450
+ input: 3,
404451
+ output: 15
404452
+ }
404453
+ },
404454
+ metadata: {
404455
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-sonnet-4-20250514-v1:0",
404456
+ providerName: "Anthropic",
404457
+ responseStreamingSupported: true,
404458
+ customizationsSupported: [],
404459
+ inferenceTypesSupported: [
404460
+ "INFERENCE_PROFILE"
404461
+ ],
404462
+ inputModalities: [
404463
+ "TEXT",
404464
+ "IMAGE"
404465
+ ],
404466
+ outputModalities: [
404467
+ "TEXT"
404468
+ ]
404469
+ }
404470
+ }, {
404471
+ id: "anthropic.claude-haiku-4-5-20251001-v1:0",
404472
+ provider: "aws",
404473
+ name: "Claude Haiku 4.5",
404474
+ contextWindow: 2e5,
404475
+ maxOutputTokens: 16384,
404476
+ tier: "efficient",
404477
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
404478
+ pricing: {
404479
+ text: {
404480
+ input: 1,
404481
+ output: 5
404482
+ }
404483
+ },
404484
+ metadata: {
404485
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-haiku-4-5-20251001-v1:0",
404486
+ providerName: "Anthropic",
404487
+ responseStreamingSupported: true,
404488
+ customizationsSupported: [],
404489
+ inferenceTypesSupported: [
404490
+ "INFERENCE_PROFILE"
404491
+ ],
404492
+ inputModalities: [
404493
+ "TEXT",
404494
+ "IMAGE"
404495
+ ],
404496
+ outputModalities: [
404497
+ "TEXT"
404498
+ ]
404499
+ }
404500
+ }, {
404501
+ id: "stability.stable-image-erase-object-v1:0",
404502
+ provider: "aws",
404503
+ name: "Stable Image Erase Object",
404504
+ contextWindow: 0,
404505
+ tier: "efficient",
404506
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404507
+ pricing: {},
404508
+ metadata: {
404509
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-erase-object-v1:0",
404510
+ providerName: "Stability AI",
404511
+ responseStreamingSupported: false,
404512
+ customizationsSupported: [],
404513
+ inferenceTypesSupported: [
404514
+ "INFERENCE_PROFILE"
404515
+ ],
404516
+ inputModalities: [
404517
+ "TEXT",
404518
+ "IMAGE"
404519
+ ],
404520
+ outputModalities: [
404521
+ "IMAGE"
404522
+ ]
404523
+ }
404524
+ }, {
404525
+ id: "qwen.qwen3-235b-a22b-2507-v1:0",
404526
+ provider: "aws",
404527
+ name: "Qwen3 235B A22B 2507",
404528
+ contextWindow: 0,
404529
+ tier: "efficient",
404530
+ capabilities: /* @__PURE__ */ new Set([]),
404531
+ pricing: {},
404532
+ metadata: {
404533
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/qwen.qwen3-235b-a22b-2507-v1:0",
404534
+ providerName: "Qwen",
404535
+ responseStreamingSupported: true,
404536
+ customizationsSupported: [],
404537
+ inferenceTypesSupported: [
404538
+ "ON_DEMAND"
404539
+ ],
404540
+ inputModalities: [
404541
+ "TEXT"
404542
+ ],
404543
+ outputModalities: [
404544
+ "TEXT"
404545
+ ]
404546
+ }
404547
+ }, {
404548
+ id: "stability.stable-image-control-structure-v1:0",
404549
+ provider: "aws",
404550
+ name: "Stable Image Control Structure",
404551
+ contextWindow: 0,
404552
+ tier: "efficient",
404553
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404554
+ pricing: {},
404555
+ metadata: {
404556
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-control-structure-v1:0",
404557
+ providerName: "Stability AI",
404558
+ responseStreamingSupported: false,
404559
+ customizationsSupported: [],
404560
+ inferenceTypesSupported: [
404561
+ "INFERENCE_PROFILE"
404562
+ ],
404563
+ inputModalities: [
404564
+ "TEXT",
404565
+ "IMAGE"
404566
+ ],
404567
+ outputModalities: [
404568
+ "IMAGE"
404569
+ ]
404570
+ }
404571
+ }, {
404572
+ id: "openai.gpt-oss-120b-1:0",
404573
+ provider: "aws",
404574
+ name: "gpt-oss-120b",
404575
+ contextWindow: 0,
404576
+ tier: "efficient",
404577
+ capabilities: /* @__PURE__ */ new Set([]),
404578
+ pricing: {},
404579
+ metadata: {
404580
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/openai.gpt-oss-120b-1:0",
404581
+ providerName: "OpenAI",
404582
+ responseStreamingSupported: true,
404583
+ customizationsSupported: [],
404584
+ inferenceTypesSupported: [
404585
+ "ON_DEMAND"
404586
+ ],
404587
+ inputModalities: [
404588
+ "TEXT"
404589
+ ],
404590
+ outputModalities: [
404591
+ "TEXT"
404592
+ ]
404593
+ }
404594
+ }, {
404595
+ id: "anthropic.claude-sonnet-4-5-20250929-v1:0",
404596
+ provider: "aws",
404597
+ name: "Claude Sonnet 4.5",
404598
+ contextWindow: 0,
404599
+ tier: "efficient",
404600
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
404601
+ pricing: {
404602
+ text: {
404603
+ input: 3,
404604
+ output: 15
404605
+ }
404606
+ },
404607
+ metadata: {
404608
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-sonnet-4-5-20250929-v1:0",
404609
+ providerName: "Anthropic",
404610
+ responseStreamingSupported: true,
404611
+ customizationsSupported: [],
404612
+ inferenceTypesSupported: [
404613
+ "INFERENCE_PROFILE"
404614
+ ],
404615
+ inputModalities: [
404616
+ "TEXT",
404617
+ "IMAGE"
404618
+ ],
404619
+ outputModalities: [
404620
+ "TEXT"
404621
+ ]
404622
+ }
404623
+ }, {
404624
+ id: "stability.stable-creative-upscale-v1:0",
404625
+ provider: "aws",
404626
+ name: "Stable Image Creative Upscale",
404627
+ contextWindow: 0,
404628
+ tier: "efficient",
404629
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404630
+ pricing: {},
404631
+ metadata: {
404632
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-creative-upscale-v1:0",
404633
+ providerName: "Stability AI",
404634
+ responseStreamingSupported: false,
404635
+ customizationsSupported: [],
404636
+ inferenceTypesSupported: [
404637
+ "INFERENCE_PROFILE"
404638
+ ],
404639
+ inputModalities: [
404640
+ "TEXT",
404641
+ "IMAGE"
404642
+ ],
404643
+ outputModalities: [
404644
+ "IMAGE"
404645
+ ]
404646
+ }
404647
+ }, {
404648
+ id: "stability.stable-outpaint-v1:0",
404649
+ provider: "aws",
404650
+ name: "Stable Image Outpaint",
404651
+ contextWindow: 0,
404652
+ tier: "efficient",
404653
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404654
+ pricing: {},
404655
+ metadata: {
404656
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-outpaint-v1:0",
404657
+ providerName: "Stability AI",
404658
+ responseStreamingSupported: false,
404659
+ customizationsSupported: [],
404660
+ inferenceTypesSupported: [
404661
+ "INFERENCE_PROFILE"
404662
+ ],
404663
+ inputModalities: [
404664
+ "TEXT",
404665
+ "IMAGE"
404666
+ ],
404667
+ outputModalities: [
404668
+ "IMAGE"
404669
+ ]
404670
+ }
404671
+ }, {
404672
+ id: "stability.stable-image-inpaint-v1:0",
404673
+ provider: "aws",
404674
+ name: "Stable Image Inpaint",
404675
+ contextWindow: 0,
404676
+ tier: "efficient",
404677
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404678
+ pricing: {},
404679
+ metadata: {
404680
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-inpaint-v1:0",
404681
+ providerName: "Stability AI",
404682
+ responseStreamingSupported: false,
404683
+ customizationsSupported: [],
404684
+ inferenceTypesSupported: [
404685
+ "INFERENCE_PROFILE"
404686
+ ],
404687
+ inputModalities: [
404688
+ "TEXT",
404689
+ "IMAGE"
404690
+ ],
404691
+ outputModalities: [
404692
+ "IMAGE"
404693
+ ]
404694
+ }
404695
+ }, {
404696
+ id: "anthropic.claude-opus-4-1-20250805-v1:0",
404697
+ provider: "aws",
404698
+ name: "Claude Opus 4.1",
404699
+ contextWindow: 2e5,
404700
+ maxOutputTokens: 16384,
404701
+ tier: "flagship",
404702
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
404703
+ pricing: {
404704
+ text: {
404705
+ input: 15,
404706
+ output: 75
404707
+ }
404708
+ },
404709
+ metadata: {
404710
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-opus-4-1-20250805-v1:0",
404711
+ providerName: "Anthropic",
404712
+ responseStreamingSupported: true,
404713
+ customizationsSupported: [],
404714
+ inferenceTypesSupported: [
404715
+ "INFERENCE_PROFILE"
404716
+ ],
404717
+ inputModalities: [
404718
+ "TEXT",
404719
+ "IMAGE"
404720
+ ],
404721
+ outputModalities: [
404722
+ "TEXT"
404723
+ ]
404724
+ }
404725
+ }, {
404726
+ id: "amazon.nova-pro-v1:0",
404727
+ provider: "aws",
404728
+ name: "Nova Pro",
404729
+ contextWindow: 0,
404730
+ tier: "efficient",
404731
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
404732
+ pricing: {},
404733
+ metadata: {
404734
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-pro-v1:0",
404735
+ providerName: "Amazon",
404736
+ responseStreamingSupported: true,
404737
+ customizationsSupported: [],
404738
+ inferenceTypesSupported: [
404739
+ "INFERENCE_PROFILE"
404740
+ ],
404741
+ inputModalities: [
404742
+ "TEXT",
404743
+ "IMAGE",
404744
+ "VIDEO"
404745
+ ],
404746
+ outputModalities: [
404747
+ "TEXT"
404748
+ ]
404749
+ }
404750
+ }, {
404751
+ id: "stability.stable-image-remove-background-v1:0",
404752
+ provider: "aws",
404753
+ name: "Stable Image Remove Background",
404754
+ contextWindow: 0,
404755
+ tier: "efficient",
404756
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404757
+ pricing: {},
404758
+ metadata: {
404759
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-remove-background-v1:0",
404760
+ providerName: "Stability AI",
404761
+ responseStreamingSupported: false,
404762
+ customizationsSupported: [],
404763
+ inferenceTypesSupported: [
404764
+ "INFERENCE_PROFILE"
404765
+ ],
404766
+ inputModalities: [
404767
+ "TEXT",
404768
+ "IMAGE"
404769
+ ],
404770
+ outputModalities: [
404771
+ "IMAGE"
404772
+ ]
404773
+ }
404774
+ }, {
404775
+ id: "qwen.qwen3-coder-480b-a35b-v1:0",
404776
+ provider: "aws",
404777
+ name: "Qwen3 Coder 480B A35B Instruct",
404778
+ contextWindow: 0,
404779
+ tier: "efficient",
404780
+ capabilities: /* @__PURE__ */ new Set([]),
404781
+ pricing: {},
404782
+ metadata: {
404783
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/qwen.qwen3-coder-480b-a35b-v1:0",
404784
+ providerName: "Qwen",
404785
+ responseStreamingSupported: true,
404786
+ customizationsSupported: [],
404787
+ inferenceTypesSupported: [
404788
+ "ON_DEMAND"
404789
+ ],
404790
+ inputModalities: [
404791
+ "TEXT"
404792
+ ],
404793
+ outputModalities: [
404794
+ "TEXT"
404795
+ ]
404796
+ }
404797
+ }, {
404798
+ id: "stability.stable-image-style-guide-v1:0",
404799
+ provider: "aws",
404800
+ name: "Stable Image Style Guide",
404801
+ contextWindow: 0,
404802
+ tier: "efficient",
404803
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404804
+ pricing: {},
404805
+ metadata: {
404806
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-style-guide-v1:0",
404807
+ providerName: "Stability AI",
404808
+ responseStreamingSupported: false,
404809
+ customizationsSupported: [],
404810
+ inferenceTypesSupported: [
404811
+ "INFERENCE_PROFILE"
404812
+ ],
404813
+ inputModalities: [
404814
+ "TEXT",
404815
+ "IMAGE"
404816
+ ],
404817
+ outputModalities: [
404818
+ "IMAGE"
404819
+ ]
404820
+ }
404821
+ }, {
404822
+ id: "stability.stable-image-control-sketch-v1:0",
404823
+ provider: "aws",
404824
+ name: "Stable Image Control Sketch",
404825
+ contextWindow: 0,
404826
+ tier: "efficient",
404827
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404828
+ pricing: {},
404829
+ metadata: {
404830
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-control-sketch-v1:0",
404831
+ providerName: "Stability AI",
404832
+ responseStreamingSupported: false,
404833
+ customizationsSupported: [],
404834
+ inferenceTypesSupported: [
404835
+ "INFERENCE_PROFILE"
404836
+ ],
404837
+ inputModalities: [
404838
+ "TEXT",
404839
+ "IMAGE"
404840
+ ],
404841
+ outputModalities: [
404842
+ "IMAGE"
404843
+ ]
404844
+ }
404845
+ }, {
404846
+ id: "stability.stable-conservative-upscale-v1:0",
404847
+ provider: "aws",
404848
+ name: "Stable Image Conservative Upscale",
404849
+ contextWindow: 0,
404850
+ tier: "efficient",
404851
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404852
+ pricing: {},
404853
+ metadata: {
404854
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-conservative-upscale-v1:0",
404855
+ providerName: "Stability AI",
404856
+ responseStreamingSupported: false,
404857
+ customizationsSupported: [],
404858
+ inferenceTypesSupported: [
404859
+ "INFERENCE_PROFILE"
404860
+ ],
404861
+ inputModalities: [
404862
+ "TEXT",
404863
+ "IMAGE"
404864
+ ],
404865
+ outputModalities: [
404866
+ "IMAGE"
404867
+ ]
404868
+ }
404869
+ }, {
404870
+ id: "stability.stable-image-search-recolor-v1:0",
404871
+ provider: "aws",
404872
+ name: "Stable Image Search and Recolor",
404873
+ contextWindow: 0,
404874
+ tier: "efficient",
404875
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404876
+ pricing: {},
404877
+ metadata: {
404878
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-search-recolor-v1:0",
404879
+ providerName: "Stability AI",
404880
+ responseStreamingSupported: false,
404881
+ customizationsSupported: [],
404882
+ inferenceTypesSupported: [
404883
+ "INFERENCE_PROFILE"
404884
+ ],
404885
+ inputModalities: [
404886
+ "TEXT",
404887
+ "IMAGE"
404888
+ ],
404889
+ outputModalities: [
404890
+ "IMAGE"
404891
+ ]
404892
+ }
404893
+ }, {
404894
+ id: "twelvelabs.pegasus-1-2-v1:0",
404895
+ provider: "aws",
404896
+ name: "Pegasus v1.2",
404897
+ contextWindow: 0,
404898
+ tier: "efficient",
404899
+ capabilities: /* @__PURE__ */ new Set([]),
404900
+ pricing: {},
404901
+ metadata: {
404902
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/twelvelabs.pegasus-1-2-v1:0",
404903
+ providerName: "TwelveLabs",
404904
+ responseStreamingSupported: true,
404905
+ customizationsSupported: [],
404906
+ inferenceTypesSupported: [
404907
+ "INFERENCE_PROFILE"
404908
+ ],
404909
+ inputModalities: [
404910
+ "TEXT",
404911
+ "VIDEO"
404912
+ ],
404913
+ outputModalities: [
404914
+ "TEXT"
404915
+ ]
404916
+ }
404917
+ }, {
404918
+ id: "stability.stable-style-transfer-v1:0",
404919
+ provider: "aws",
404920
+ name: "Stable Image Style Transfer",
404921
+ contextWindow: 0,
404922
+ tier: "efficient",
404923
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404924
+ pricing: {},
404925
+ metadata: {
404926
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-style-transfer-v1:0",
404927
+ providerName: "Stability AI",
404928
+ responseStreamingSupported: false,
404929
+ customizationsSupported: [],
404930
+ inferenceTypesSupported: [
404931
+ "INFERENCE_PROFILE"
404932
+ ],
404933
+ inputModalities: [
404934
+ "TEXT",
404935
+ "IMAGE"
404936
+ ],
404937
+ outputModalities: [
404938
+ "IMAGE"
404939
+ ]
404940
+ }
404941
+ }, {
404942
+ id: "cohere.embed-v4:0",
404943
+ provider: "aws",
404944
+ name: "Embed v4",
404945
+ contextWindow: 0,
404946
+ tier: "efficient",
404947
+ capabilities: /* @__PURE__ */ new Set(["embedding"]),
404948
+ pricing: {},
404949
+ metadata: {
404950
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/cohere.embed-v4:0",
404951
+ providerName: "Cohere",
404952
+ responseStreamingSupported: false,
404953
+ customizationsSupported: [],
404954
+ inferenceTypesSupported: [
404955
+ "INFERENCE_PROFILE"
404956
+ ],
404957
+ inputModalities: [
404958
+ "TEXT",
404959
+ "IMAGE"
404960
+ ],
404961
+ outputModalities: [
404962
+ "EMBEDDING"
404963
+ ]
404964
+ }
404965
+ }, {
404966
+ id: "deepseek.v3-v1:0",
404967
+ provider: "aws",
404968
+ name: "DeepSeek-V3.1",
404969
+ contextWindow: 0,
404970
+ tier: "efficient",
404971
+ capabilities: /* @__PURE__ */ new Set([]),
404972
+ pricing: {},
404973
+ metadata: {
404974
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/deepseek.v3-v1:0",
404975
+ providerName: "DeepSeek",
404976
+ responseStreamingSupported: true,
404977
+ customizationsSupported: [],
404978
+ inferenceTypesSupported: [
404979
+ "ON_DEMAND"
404980
+ ],
404981
+ inputModalities: [
404982
+ "TEXT"
404983
+ ],
404984
+ outputModalities: [
404985
+ "TEXT"
404986
+ ]
404987
+ }
404988
+ }, {
404989
+ id: "stability.stable-image-search-replace-v1:0",
404990
+ provider: "aws",
404991
+ name: "Stable Image Search and Replace",
404992
+ contextWindow: 0,
404993
+ tier: "efficient",
404994
+ capabilities: /* @__PURE__ */ new Set(["image"]),
404995
+ pricing: {},
404996
+ metadata: {
404997
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/stability.stable-image-search-replace-v1:0",
404998
+ providerName: "Stability AI",
404999
+ responseStreamingSupported: false,
405000
+ customizationsSupported: [],
405001
+ inferenceTypesSupported: [
405002
+ "INFERENCE_PROFILE"
405003
+ ],
405004
+ inputModalities: [
405005
+ "TEXT",
405006
+ "IMAGE"
405007
+ ],
405008
+ outputModalities: [
405009
+ "IMAGE"
405010
+ ]
405011
+ }
405012
+ }, {
405013
+ id: "qwen.qwen3-coder-30b-a3b-v1:0",
405014
+ provider: "aws",
405015
+ name: "Qwen3-Coder-30B-A3B-Instruct",
405016
+ contextWindow: 0,
405017
+ tier: "efficient",
405018
+ capabilities: /* @__PURE__ */ new Set([]),
405019
+ pricing: {},
405020
+ metadata: {
405021
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/qwen.qwen3-coder-30b-a3b-v1:0",
405022
+ providerName: "Qwen",
405023
+ responseStreamingSupported: true,
405024
+ customizationsSupported: [],
405025
+ inferenceTypesSupported: [
405026
+ "ON_DEMAND"
405027
+ ],
405028
+ inputModalities: [
405029
+ "TEXT"
405030
+ ],
405031
+ outputModalities: [
405032
+ "TEXT"
405033
+ ]
405034
+ }
405035
+ }, {
405036
+ id: "qwen.qwen3-32b-v1:0",
405037
+ provider: "aws",
405038
+ name: "Qwen3 32B (dense)",
405039
+ contextWindow: 0,
405040
+ tier: "efficient",
405041
+ capabilities: /* @__PURE__ */ new Set([]),
405042
+ pricing: {},
405043
+ metadata: {
405044
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/qwen.qwen3-32b-v1:0",
405045
+ providerName: "Qwen",
405046
+ responseStreamingSupported: true,
405047
+ customizationsSupported: [],
405048
+ inferenceTypesSupported: [
405049
+ "ON_DEMAND"
405050
+ ],
405051
+ inputModalities: [
405052
+ "TEXT"
405053
+ ],
405054
+ outputModalities: [
405055
+ "TEXT"
405056
+ ]
405057
+ }
405058
+ }, {
405059
+ id: "openai.gpt-oss-20b-1:0",
405060
+ provider: "aws",
405061
+ name: "gpt-oss-20b",
405062
+ contextWindow: 0,
405063
+ tier: "efficient",
405064
+ capabilities: /* @__PURE__ */ new Set([]),
405065
+ pricing: {},
405066
+ metadata: {
405067
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/openai.gpt-oss-20b-1:0",
405068
+ providerName: "OpenAI",
405069
+ responseStreamingSupported: true,
405070
+ customizationsSupported: [],
405071
+ inferenceTypesSupported: [
405072
+ "ON_DEMAND"
405073
+ ],
405074
+ inputModalities: [
405075
+ "TEXT"
405076
+ ],
405077
+ outputModalities: [
405078
+ "TEXT"
405079
+ ]
405080
+ }
405081
+ }, {
405082
+ id: "amazon.titan-embed-text-v2:0",
405083
+ provider: "aws",
405084
+ name: "Titan Text Embeddings V2",
405085
+ contextWindow: 0,
405086
+ tier: "efficient",
405087
+ capabilities: /* @__PURE__ */ new Set(["embedding"]),
405088
+ pricing: {},
405089
+ metadata: {
405090
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.titan-embed-text-v2:0",
405091
+ providerName: "Amazon",
405092
+ responseStreamingSupported: false,
405093
+ customizationsSupported: [],
405094
+ inferenceTypesSupported: [
405095
+ "ON_DEMAND"
405096
+ ],
405097
+ inputModalities: [
405098
+ "TEXT"
405099
+ ],
405100
+ outputModalities: [
405101
+ "EMBEDDING"
405102
+ ]
405103
+ }
405104
+ }, {
405105
+ id: "amazon.nova-premier-v1:0:8k",
405106
+ provider: "aws",
405107
+ name: "Nova Premier",
405108
+ contextWindow: 0,
405109
+ tier: "efficient",
405110
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
405111
+ pricing: {},
405112
+ metadata: {
405113
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-premier-v1:0:8k",
405114
+ providerName: "Amazon",
405115
+ responseStreamingSupported: true,
405116
+ customizationsSupported: [],
405117
+ inferenceTypesSupported: [],
405118
+ inputModalities: [
405119
+ "TEXT",
405120
+ "IMAGE",
405121
+ "VIDEO"
405122
+ ],
405123
+ outputModalities: [
405124
+ "TEXT"
405125
+ ]
405126
+ }
405127
+ }, {
405128
+ id: "amazon.nova-premier-v1:0:20k",
405129
+ provider: "aws",
405130
+ name: "Nova Premier",
405131
+ contextWindow: 0,
405132
+ tier: "efficient",
405133
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
405134
+ pricing: {},
405135
+ metadata: {
405136
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-premier-v1:0:20k",
405137
+ providerName: "Amazon",
405138
+ responseStreamingSupported: true,
405139
+ customizationsSupported: [],
405140
+ inferenceTypesSupported: [],
405141
+ inputModalities: [
405142
+ "TEXT",
405143
+ "IMAGE",
405144
+ "VIDEO"
405145
+ ],
405146
+ outputModalities: [
405147
+ "TEXT"
405148
+ ]
405149
+ }
405150
+ }, {
405151
+ id: "amazon.nova-premier-v1:0:1000k",
405152
+ provider: "aws",
405153
+ name: "Nova Premier",
405154
+ contextWindow: 0,
405155
+ tier: "efficient",
405156
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
405157
+ pricing: {},
405158
+ metadata: {
405159
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-premier-v1:0:1000k",
405160
+ providerName: "Amazon",
405161
+ responseStreamingSupported: true,
405162
+ customizationsSupported: [],
405163
+ inferenceTypesSupported: [],
405164
+ inputModalities: [
405165
+ "TEXT",
405166
+ "IMAGE",
405167
+ "VIDEO"
405168
+ ],
405169
+ outputModalities: [
405170
+ "TEXT"
405171
+ ]
405172
+ }
405173
+ }, {
405174
+ id: "amazon.nova-premier-v1:0:mm",
405175
+ provider: "aws",
405176
+ name: "Nova Premier",
405177
+ contextWindow: 0,
405178
+ tier: "efficient",
405179
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
405180
+ pricing: {},
405181
+ metadata: {
405182
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-premier-v1:0:mm",
405183
+ providerName: "Amazon",
405184
+ responseStreamingSupported: true,
405185
+ customizationsSupported: [],
405186
+ inferenceTypesSupported: [],
405187
+ inputModalities: [
405188
+ "TEXT",
405189
+ "IMAGE",
405190
+ "VIDEO"
405191
+ ],
405192
+ outputModalities: [
405193
+ "TEXT"
405194
+ ]
405195
+ }
405196
+ }, {
405197
+ id: "amazon.nova-premier-v1:0",
405198
+ provider: "aws",
405199
+ name: "Nova Premier",
405200
+ contextWindow: 0,
405201
+ tier: "efficient",
405202
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
405203
+ pricing: {},
405204
+ metadata: {
405205
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-premier-v1:0",
405206
+ providerName: "Amazon",
405207
+ responseStreamingSupported: true,
405208
+ customizationsSupported: [],
405209
+ inferenceTypesSupported: [
405210
+ "INFERENCE_PROFILE"
405211
+ ],
405212
+ inputModalities: [
405213
+ "TEXT",
405214
+ "IMAGE",
405215
+ "VIDEO"
405216
+ ],
405217
+ outputModalities: [
405218
+ "TEXT"
405219
+ ]
405220
+ }
405221
+ }, {
405222
+ id: "amazon.nova-lite-v1:0",
405223
+ provider: "aws",
405224
+ name: "Nova Lite",
405225
+ contextWindow: 0,
405226
+ tier: "efficient",
405227
+ capabilities: /* @__PURE__ */ new Set(["vision"]),
405228
+ pricing: {},
405229
+ metadata: {
405230
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-lite-v1:0",
405231
+ providerName: "Amazon",
405232
+ responseStreamingSupported: true,
405233
+ customizationsSupported: [],
405234
+ inferenceTypesSupported: [
405235
+ "INFERENCE_PROFILE"
405236
+ ],
405237
+ inputModalities: [
405238
+ "TEXT",
405239
+ "IMAGE",
405240
+ "VIDEO"
405241
+ ],
405242
+ outputModalities: [
405243
+ "TEXT"
405244
+ ]
405245
+ }
405246
+ }, {
405247
+ id: "amazon.nova-micro-v1:0",
405248
+ provider: "aws",
405249
+ name: "Nova Micro",
405250
+ contextWindow: 0,
405251
+ tier: "efficient",
405252
+ capabilities: /* @__PURE__ */ new Set([]),
405253
+ pricing: {},
405254
+ metadata: {
405255
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/amazon.nova-micro-v1:0",
405256
+ providerName: "Amazon",
405257
+ responseStreamingSupported: true,
405258
+ customizationsSupported: [],
405259
+ inferenceTypesSupported: [
405260
+ "INFERENCE_PROFILE"
405261
+ ],
405262
+ inputModalities: [
405263
+ "TEXT"
405264
+ ],
405265
+ outputModalities: [
405266
+ "TEXT"
405267
+ ]
405268
+ }
405269
+ }, {
405270
+ id: "anthropic.claude-3-5-sonnet-20240620-v1:0",
405271
+ provider: "aws",
405272
+ name: "Claude 3.5 Sonnet",
405273
+ contextWindow: 2e5,
405274
+ maxOutputTokens: 8192,
405275
+ tier: "efficient",
405276
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
405277
+ pricing: {
405278
+ text: {
405279
+ input: 3,
405280
+ output: 15
405281
+ }
405282
+ },
405283
+ metadata: {
405284
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0",
405285
+ providerName: "Anthropic",
405286
+ responseStreamingSupported: true,
405287
+ customizationsSupported: [],
405288
+ inferenceTypesSupported: [
405289
+ "INFERENCE_PROFILE"
405290
+ ],
405291
+ inputModalities: [
405292
+ "TEXT",
405293
+ "IMAGE"
405294
+ ],
405295
+ outputModalities: [
405296
+ "TEXT"
405297
+ ]
405298
+ }
405299
+ }, {
405300
+ id: "anthropic.claude-3-7-sonnet-20250219-v1:0",
405301
+ provider: "aws",
405302
+ name: "Claude 3.7 Sonnet",
405303
+ contextWindow: 2e5,
405304
+ maxOutputTokens: 8192,
405305
+ tier: "efficient",
405306
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
405307
+ pricing: {
405308
+ text: {
405309
+ input: 3,
405310
+ output: 15
405311
+ }
405312
+ },
405313
+ metadata: {
405314
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-7-sonnet-20250219-v1:0",
405315
+ providerName: "Anthropic",
405316
+ responseStreamingSupported: true,
405317
+ customizationsSupported: [],
405318
+ inferenceTypesSupported: [
405319
+ "INFERENCE_PROFILE"
405320
+ ],
405321
+ inputModalities: [
405322
+ "TEXT",
405323
+ "IMAGE"
405324
+ ],
405325
+ outputModalities: [
405326
+ "TEXT"
405327
+ ]
405328
+ }
405329
+ }, {
405330
+ id: "anthropic.claude-3-haiku-20240307-v1:0:200k",
405331
+ provider: "aws",
405332
+ name: "Claude 3 Haiku",
405333
+ contextWindow: 0,
405334
+ tier: "efficient",
405335
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
405336
+ pricing: {},
405337
+ metadata: {
405338
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-haiku-20240307-v1:0:200k",
405339
+ providerName: "Anthropic",
405340
+ responseStreamingSupported: true,
405341
+ customizationsSupported: [],
405342
+ inferenceTypesSupported: [],
405343
+ inputModalities: [
405344
+ "TEXT",
405345
+ "IMAGE"
405346
+ ],
405347
+ outputModalities: [
405348
+ "TEXT"
405349
+ ]
405350
+ }
405351
+ }, {
405352
+ id: "anthropic.claude-3-haiku-20240307-v1:0",
405353
+ provider: "aws",
405354
+ name: "Claude 3 Haiku",
405355
+ contextWindow: 2e5,
405356
+ maxOutputTokens: 4096,
405357
+ tier: "efficient",
405358
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
405359
+ pricing: {
405360
+ text: {
405361
+ input: 0.25,
405362
+ output: 1.25
405363
+ }
405364
+ },
405365
+ metadata: {
405366
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-haiku-20240307-v1:0",
405367
+ providerName: "Anthropic",
405368
+ responseStreamingSupported: true,
405369
+ customizationsSupported: [],
405370
+ inferenceTypesSupported: [
405371
+ "INFERENCE_PROFILE"
405372
+ ],
405373
+ inputModalities: [
405374
+ "TEXT",
405375
+ "IMAGE"
405376
+ ],
405377
+ outputModalities: [
405378
+ "TEXT"
405379
+ ]
405380
+ }
405381
+ }, {
405382
+ id: "anthropic.claude-3-5-sonnet-20241022-v2:0",
405383
+ provider: "aws",
405384
+ name: "Claude 3.5 Sonnet v2",
405385
+ contextWindow: 2e5,
405386
+ maxOutputTokens: 8192,
405387
+ tier: "efficient",
405388
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
405389
+ pricing: {
405390
+ text: {
405391
+ input: 3,
405392
+ output: 15
405393
+ }
405394
+ },
405395
+ metadata: {
405396
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
405397
+ providerName: "Anthropic",
405398
+ responseStreamingSupported: true,
405399
+ customizationsSupported: [],
405400
+ inferenceTypesSupported: [
405401
+ "INFERENCE_PROFILE"
405402
+ ],
405403
+ inputModalities: [
405404
+ "TEXT",
405405
+ "IMAGE"
405406
+ ],
405407
+ outputModalities: [
405408
+ "TEXT"
405409
+ ]
405410
+ }
405411
+ }, {
405412
+ id: "anthropic.claude-3-5-haiku-20241022-v1:0",
405413
+ provider: "aws",
405414
+ name: "Claude 3.5 Haiku",
405415
+ contextWindow: 2e5,
405416
+ maxOutputTokens: 8192,
405417
+ tier: "efficient",
405418
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "tools"]),
405419
+ pricing: {},
405420
+ metadata: {
405421
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-5-haiku-20241022-v1:0",
405422
+ providerName: "Anthropic",
405423
+ responseStreamingSupported: true,
405424
+ customizationsSupported: [],
405425
+ inferenceTypesSupported: [
405426
+ "INFERENCE_PROFILE"
405427
+ ],
405428
+ inputModalities: [
405429
+ "TEXT"
405430
+ ],
405431
+ outputModalities: [
405432
+ "TEXT"
405433
+ ]
405434
+ }
405435
+ }, {
405436
+ id: "anthropic.claude-opus-4-20250514-v1:0",
405437
+ provider: "aws",
405438
+ name: "Claude Opus 4",
405439
+ contextWindow: 2e5,
405440
+ maxOutputTokens: 16384,
405441
+ tier: "flagship",
405442
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision", "tools"]),
405443
+ pricing: {},
405444
+ metadata: {
405445
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-opus-4-20250514-v1:0",
405446
+ providerName: "Anthropic",
405447
+ responseStreamingSupported: true,
405448
+ customizationsSupported: [],
405449
+ inferenceTypesSupported: [
405450
+ "INFERENCE_PROFILE"
405451
+ ],
405452
+ inputModalities: [
405453
+ "TEXT",
405454
+ "IMAGE"
405455
+ ],
405456
+ outputModalities: [
405457
+ "TEXT"
405458
+ ]
405459
+ }
405460
+ }, {
405461
+ id: "deepseek.r1-v1:0",
405462
+ provider: "aws",
405463
+ name: "DeepSeek-R1",
405464
+ contextWindow: 0,
405465
+ tier: "efficient",
405466
+ capabilities: /* @__PURE__ */ new Set([]),
405467
+ pricing: {},
405468
+ metadata: {
405469
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/deepseek.r1-v1:0",
405470
+ providerName: "DeepSeek",
405471
+ responseStreamingSupported: true,
405472
+ customizationsSupported: [],
405473
+ inferenceTypesSupported: [
405474
+ "INFERENCE_PROFILE"
405475
+ ],
405476
+ inputModalities: [
405477
+ "TEXT"
405478
+ ],
405479
+ outputModalities: [
405480
+ "TEXT"
405481
+ ]
405482
+ }
405483
+ }, {
405484
+ id: "mistral.pixtral-large-2502-v1:0",
405485
+ provider: "aws",
405486
+ name: "Pixtral Large (25.02)",
405487
+ contextWindow: 0,
405488
+ tier: "flagship",
405489
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision"]),
405490
+ pricing: {},
405491
+ metadata: {
405492
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/mistral.pixtral-large-2502-v1:0",
405493
+ providerName: "Mistral AI",
405494
+ responseStreamingSupported: true,
405495
+ customizationsSupported: [],
405496
+ inferenceTypesSupported: [
405497
+ "INFERENCE_PROFILE"
405498
+ ],
405499
+ inputModalities: [
405500
+ "TEXT",
405501
+ "IMAGE"
405502
+ ],
405503
+ outputModalities: [
405504
+ "TEXT"
405505
+ ]
405506
+ }
405507
+ }, {
405508
+ id: "meta.llama3-1-8b-instruct-v1:0:128k",
405509
+ provider: "aws",
405510
+ name: "Llama 3.1 8B Instruct",
405511
+ contextWindow: 0,
405512
+ tier: "efficient",
405513
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405514
+ pricing: {},
405515
+ metadata: {
405516
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-1-8b-instruct-v1:0:128k",
405517
+ providerName: "Meta",
405518
+ responseStreamingSupported: true,
405519
+ customizationsSupported: [],
405520
+ inferenceTypesSupported: [],
405521
+ inputModalities: [
405522
+ "TEXT"
405523
+ ],
405524
+ outputModalities: [
405525
+ "TEXT"
405526
+ ]
405527
+ }
405528
+ }, {
405529
+ id: "meta.llama3-1-8b-instruct-v1:0",
405530
+ provider: "aws",
405531
+ name: "Llama 3.1 8B Instruct",
405532
+ contextWindow: 128e3,
405533
+ maxOutputTokens: 2048,
405534
+ tier: "efficient",
405535
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405536
+ pricing: {
405537
+ text: {
405538
+ input: 0.3,
405539
+ output: 0.6
405540
+ }
405541
+ },
405542
+ metadata: {
405543
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-1-8b-instruct-v1:0",
405544
+ providerName: "Meta",
405545
+ responseStreamingSupported: true,
405546
+ customizationsSupported: [],
405547
+ inferenceTypesSupported: [
405548
+ "INFERENCE_PROFILE"
405549
+ ],
405550
+ inputModalities: [
405551
+ "TEXT"
405552
+ ],
405553
+ outputModalities: [
405554
+ "TEXT"
405555
+ ]
405556
+ }
405557
+ }, {
405558
+ id: "meta.llama3-1-70b-instruct-v1:0:128k",
405559
+ provider: "aws",
405560
+ name: "Llama 3.1 70B Instruct",
405561
+ contextWindow: 0,
405562
+ tier: "efficient",
405563
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405564
+ pricing: {},
405565
+ metadata: {
405566
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-1-70b-instruct-v1:0:128k",
405567
+ providerName: "Meta",
405568
+ responseStreamingSupported: true,
405569
+ customizationsSupported: [],
405570
+ inferenceTypesSupported: [],
405571
+ inputModalities: [
405572
+ "TEXT"
405573
+ ],
405574
+ outputModalities: [
405575
+ "TEXT"
405576
+ ]
405577
+ }
405578
+ }, {
405579
+ id: "meta.llama3-1-70b-instruct-v1:0",
405580
+ provider: "aws",
405581
+ name: "Llama 3.1 70B Instruct",
405582
+ contextWindow: 128e3,
405583
+ maxOutputTokens: 2048,
405584
+ tier: "efficient",
405585
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405586
+ pricing: {
405587
+ text: {
405588
+ input: 2.65,
405589
+ output: 3.5
405590
+ }
405591
+ },
405592
+ metadata: {
405593
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-1-70b-instruct-v1:0",
405594
+ providerName: "Meta",
405595
+ responseStreamingSupported: true,
405596
+ customizationsSupported: [],
405597
+ inferenceTypesSupported: [
405598
+ "INFERENCE_PROFILE"
405599
+ ],
405600
+ inputModalities: [
405601
+ "TEXT"
405602
+ ],
405603
+ outputModalities: [
405604
+ "TEXT"
405605
+ ]
405606
+ }
405607
+ }, {
405608
+ id: "meta.llama3-1-405b-instruct-v1:0",
405609
+ provider: "aws",
405610
+ name: "Llama 3.1 405B Instruct",
405611
+ contextWindow: 128e3,
405612
+ maxOutputTokens: 4096,
405613
+ tier: "flagship",
405614
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405615
+ pricing: {
405616
+ text: {
405617
+ input: 5.32,
405618
+ output: 16
405619
+ }
405620
+ },
405621
+ metadata: {
405622
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-1-405b-instruct-v1:0",
405623
+ providerName: "Meta",
405624
+ responseStreamingSupported: true,
405625
+ customizationsSupported: [],
405626
+ inferenceTypesSupported: [
405627
+ "INFERENCE_PROFILE"
405628
+ ],
405629
+ inputModalities: [
405630
+ "TEXT"
405631
+ ],
405632
+ outputModalities: [
405633
+ "TEXT"
405634
+ ]
405635
+ }
405636
+ }, {
405637
+ id: "meta.llama3-2-11b-instruct-v1:0",
405638
+ provider: "aws",
405639
+ name: "Llama 3.2 11B Instruct",
405640
+ contextWindow: 128e3,
405641
+ maxOutputTokens: 2048,
405642
+ tier: "efficient",
405643
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision"]),
405644
+ pricing: {
405645
+ text: {
405646
+ input: 0.35,
405647
+ output: 0.35
405648
+ }
405649
+ },
405650
+ metadata: {
405651
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-2-11b-instruct-v1:0",
405652
+ providerName: "Meta",
405653
+ responseStreamingSupported: true,
405654
+ customizationsSupported: [],
405655
+ inferenceTypesSupported: [
405656
+ "INFERENCE_PROFILE"
405657
+ ],
405658
+ inputModalities: [
405659
+ "TEXT",
405660
+ "IMAGE"
405661
+ ],
405662
+ outputModalities: [
405663
+ "TEXT"
405664
+ ]
405665
+ }
405666
+ }, {
405667
+ id: "meta.llama3-2-90b-instruct-v1:0",
405668
+ provider: "aws",
405669
+ name: "Llama 3.2 90B Instruct",
405670
+ contextWindow: 128e3,
405671
+ maxOutputTokens: 2048,
405672
+ tier: "flagship",
405673
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision"]),
405674
+ pricing: {
405675
+ text: {
405676
+ input: 2.65,
405677
+ output: 2.65
405678
+ }
405679
+ },
405680
+ metadata: {
405681
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-2-90b-instruct-v1:0",
405682
+ providerName: "Meta",
405683
+ responseStreamingSupported: true,
405684
+ customizationsSupported: [],
405685
+ inferenceTypesSupported: [
405686
+ "INFERENCE_PROFILE"
405687
+ ],
405688
+ inputModalities: [
405689
+ "TEXT",
405690
+ "IMAGE"
405691
+ ],
405692
+ outputModalities: [
405693
+ "TEXT"
405694
+ ]
405695
+ }
405696
+ }, {
405697
+ id: "meta.llama3-2-1b-instruct-v1:0",
405698
+ provider: "aws",
405699
+ name: "Llama 3.2 1B Instruct",
405700
+ contextWindow: 128e3,
405701
+ maxOutputTokens: 2048,
405702
+ tier: "efficient",
405703
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405704
+ pricing: {
405705
+ text: {
405706
+ input: 0.1,
405707
+ output: 0.1
405708
+ }
405709
+ },
405710
+ metadata: {
405711
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-2-1b-instruct-v1:0",
405712
+ providerName: "Meta",
405713
+ responseStreamingSupported: true,
405714
+ customizationsSupported: [],
405715
+ inferenceTypesSupported: [
405716
+ "INFERENCE_PROFILE"
405717
+ ],
405718
+ inputModalities: [
405719
+ "TEXT"
405720
+ ],
405721
+ outputModalities: [
405722
+ "TEXT"
405723
+ ]
405724
+ }
405725
+ }, {
405726
+ id: "meta.llama3-2-3b-instruct-v1:0",
405727
+ provider: "aws",
405728
+ name: "Llama 3.2 3B Instruct",
405729
+ contextWindow: 128e3,
405730
+ maxOutputTokens: 2048,
405731
+ tier: "efficient",
405732
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405733
+ pricing: {
405734
+ text: {
405735
+ input: 0.15,
405736
+ output: 0.15
405737
+ }
405738
+ },
405739
+ metadata: {
405740
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-2-3b-instruct-v1:0",
405741
+ providerName: "Meta",
405742
+ responseStreamingSupported: true,
405743
+ customizationsSupported: [],
405744
+ inferenceTypesSupported: [
405745
+ "INFERENCE_PROFILE"
405746
+ ],
405747
+ inputModalities: [
405748
+ "TEXT"
405749
+ ],
405750
+ outputModalities: [
405751
+ "TEXT"
405752
+ ]
405753
+ }
405754
+ }, {
405755
+ id: "meta.llama3-3-70b-instruct-v1:0",
405756
+ provider: "aws",
405757
+ name: "Llama 3.3 70B Instruct",
405758
+ contextWindow: 0,
405759
+ tier: "efficient",
405760
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming"]),
405761
+ pricing: {},
405762
+ metadata: {
405763
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama3-3-70b-instruct-v1:0",
405764
+ providerName: "Meta",
405765
+ responseStreamingSupported: true,
405766
+ customizationsSupported: [],
405767
+ inferenceTypesSupported: [
405768
+ "ON_DEMAND",
405769
+ "INFERENCE_PROFILE"
405770
+ ],
405771
+ inputModalities: [
405772
+ "TEXT"
405773
+ ],
405774
+ outputModalities: [
405775
+ "TEXT"
405776
+ ]
405777
+ }
405778
+ }, {
405779
+ id: "meta.llama4-scout-17b-instruct-v1:0",
405780
+ provider: "aws",
405781
+ name: "Llama 4 Scout 17B Instruct",
405782
+ contextWindow: 0,
405783
+ tier: "efficient",
405784
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision"]),
405785
+ pricing: {},
405786
+ metadata: {
405787
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama4-scout-17b-instruct-v1:0",
405788
+ providerName: "Meta",
405789
+ responseStreamingSupported: true,
405790
+ customizationsSupported: [],
405791
+ inferenceTypesSupported: [
405792
+ "INFERENCE_PROFILE"
405793
+ ],
405794
+ inputModalities: [
405795
+ "TEXT",
405796
+ "IMAGE"
405797
+ ],
405798
+ outputModalities: [
405799
+ "TEXT"
405800
+ ]
405801
+ }
405802
+ }, {
405803
+ id: "meta.llama4-maverick-17b-instruct-v1:0",
405804
+ provider: "aws",
405805
+ name: "Llama 4 Maverick 17B Instruct",
405806
+ contextWindow: 0,
405807
+ tier: "efficient",
405808
+ capabilities: /* @__PURE__ */ new Set(["chat", "streaming", "vision"]),
405809
+ pricing: {},
405810
+ metadata: {
405811
+ modelArn: "arn:aws:bedrock:us-east-2::foundation-model/meta.llama4-maverick-17b-instruct-v1:0",
405812
+ providerName: "Meta",
405813
+ responseStreamingSupported: true,
405814
+ customizationsSupported: [],
405815
+ inferenceTypesSupported: [
405816
+ "INFERENCE_PROFILE"
405817
+ ],
405818
+ inputModalities: [
405819
+ "TEXT",
405820
+ "IMAGE"
405821
+ ],
405822
+ outputModalities: [
405823
+ "TEXT"
405824
+ ]
405825
+ }
405826
+ }];
405827
+
404417
405828
  // ../models/src/models/index.ts
404418
405829
  var models = [
404419
405830
  ...openaiModels,
404420
405831
  ...openrouterModels,
404421
- ...replicateModels
405832
+ ...replicateModels,
405833
+ ...awsModels
404422
405834
  ];
404423
405835
 
404424
405836
  // ../openai/src/openai.ts
@@ -412131,88 +413543,91 @@ var OpenAIProvider = class {
412131
413543
  let accumulatedContent = "";
412132
413544
  let finalUsage = void 0;
412133
413545
  let finishReason = void 0;
412134
- for await (const chunk3 of stream5) {
412135
- if (signal?.aborted) {
412136
- throw new Error("Request aborted");
412137
- }
412138
- const choice = chunk3?.choices[0];
412139
- const delta = choice?.delta;
412140
- const yieldChunk = {
412141
- content: delta?.content || void 0,
412142
- finishReason: choice?.finish_reason,
412143
- refusal: delta?.refusal ?? void 0,
412144
- usage: chunk3.usage ? convertOpenAIUsage(chunk3.usage) : void 0
412145
- };
412146
- if (delta?.content) {
412147
- accumulatedContent += delta.content;
412148
- }
412149
- if (chunk3.usage) {
412150
- finalUsage = convertOpenAIUsage(chunk3.usage);
412151
- }
412152
- if (choice?.finish_reason) {
412153
- finishReason = choice.finish_reason;
412154
- }
412155
- for (const toolCall of toolCalls) {
412156
- toolCall.updated = false;
412157
- }
412158
- if (delta?.tool_calls) {
412159
- for (const tc of delta.tool_calls) {
412160
- const existing = toolCallsMap.get(tc.index);
412161
- const toolCall = existing || { id: "", name: "", arguments: "", named: false, finished: false, updated: true };
412162
- if (tc.id) {
412163
- toolCall.id = tc.id;
412164
- toolCall.updated = true;
412165
- }
412166
- if (tc.function?.name) {
412167
- toolCall.name = tc.function.name;
412168
- toolCall.updated = true;
412169
- }
412170
- if (tc.function?.arguments) {
412171
- toolCall.arguments += tc.function.arguments;
412172
- toolCall.updated = true;
412173
- }
412174
- if (!existing) {
412175
- toolCallsMap.set(tc.index, toolCall);
412176
- toolCalls.push(toolCall);
412177
- }
412178
- if (toolCall.arguments) {
412179
- if (!toolCall.named) {
412180
- yieldChunk.toolCallNamed = existing;
412181
- toolCall.named = true;
412182
- } else {
412183
- yieldChunk.toolCallArguments = existing;
413546
+ try {
413547
+ for await (const chunk3 of stream5) {
413548
+ if (signal?.aborted) {
413549
+ throw new Error("Request aborted");
413550
+ }
413551
+ const choice = chunk3?.choices[0];
413552
+ const delta = choice?.delta;
413553
+ const yieldChunk = {
413554
+ content: delta?.content || void 0,
413555
+ finishReason: choice?.finish_reason,
413556
+ refusal: delta?.refusal ?? void 0,
413557
+ usage: chunk3.usage ? convertOpenAIUsage(chunk3.usage) : void 0
413558
+ };
413559
+ if (delta?.content) {
413560
+ accumulatedContent += delta.content;
413561
+ }
413562
+ if (chunk3.usage) {
413563
+ finalUsage = convertOpenAIUsage(chunk3.usage);
413564
+ }
413565
+ if (choice?.finish_reason) {
413566
+ finishReason = choice.finish_reason;
413567
+ }
413568
+ for (const toolCall of toolCalls) {
413569
+ toolCall.updated = false;
413570
+ }
413571
+ if (delta?.tool_calls) {
413572
+ for (const tc of delta.tool_calls) {
413573
+ const existing = toolCallsMap.get(tc.index);
413574
+ const toolCall = existing || { id: "", name: "", arguments: "", named: false, finished: false, updated: true };
413575
+ if (tc.id) {
413576
+ toolCall.id = tc.id;
413577
+ toolCall.updated = true;
413578
+ }
413579
+ if (tc.function?.name) {
413580
+ toolCall.name = tc.function.name;
413581
+ toolCall.updated = true;
413582
+ }
413583
+ if (tc.function?.arguments) {
413584
+ toolCall.arguments += tc.function.arguments;
413585
+ toolCall.updated = true;
413586
+ }
413587
+ if (!existing) {
413588
+ toolCallsMap.set(tc.index, toolCall);
413589
+ toolCalls.push(toolCall);
413590
+ }
413591
+ if (toolCall.arguments) {
413592
+ if (!toolCall.named) {
413593
+ yieldChunk.toolCallNamed = existing;
413594
+ toolCall.named = true;
413595
+ } else {
413596
+ yieldChunk.toolCallArguments = existing;
413597
+ }
412184
413598
  }
412185
413599
  }
412186
413600
  }
413601
+ for (const toolCall of toolCalls) {
413602
+ if (!toolCall.updated && !toolCall.finished) {
413603
+ toolCall.finished = true;
413604
+ yieldChunk.toolCall = toolCall;
413605
+ }
413606
+ }
413607
+ this.augmentChatChunk(chunk3, yieldChunk, effectiveConfig);
413608
+ yield yieldChunk;
412187
413609
  }
413610
+ } finally {
412188
413611
  for (const toolCall of toolCalls) {
412189
- if (!toolCall.updated && !toolCall.finished) {
413612
+ if (!toolCall.finished) {
412190
413613
  toolCall.finished = true;
412191
- yieldChunk.toolCall = toolCall;
413614
+ const chunk3 = { choices: [], created: 0, id: "", model: "", object: "chat.completion.chunk" };
413615
+ const yieldChunk = { toolCall };
413616
+ this.augmentChatChunk(chunk3, yieldChunk, effectiveConfig);
413617
+ yield { toolCall };
412192
413618
  }
412193
413619
  }
412194
- this.augmentChatChunk(chunk3, yieldChunk, effectiveConfig);
412195
- yield yieldChunk;
412196
- }
412197
- for (const toolCall of toolCalls) {
412198
- if (!toolCall.finished) {
412199
- toolCall.finished = true;
412200
- const chunk3 = { choices: [], created: 0, id: "", model: "", object: "chat.completion.chunk" };
412201
- const yieldChunk = { toolCall };
412202
- this.augmentChatChunk(chunk3, yieldChunk, effectiveConfig);
412203
- yield { toolCall };
413620
+ if (effectiveConfig.hooks?.chat?.afterRequest) {
413621
+ const finalResponse = {
413622
+ content: accumulatedContent,
413623
+ toolCalls: toolCalls.map((tc) => ({ id: tc.id, name: tc.name, arguments: tc.arguments })),
413624
+ finishReason: finishReason || "stop",
413625
+ model,
413626
+ usage: finalUsage
413627
+ };
413628
+ await effectiveConfig.hooks.chat.afterRequest(request, params, finalResponse, ctx, metadata);
412204
413629
  }
412205
413630
  }
412206
- if (effectiveConfig.hooks?.chat?.afterRequest) {
412207
- const finalResponse = {
412208
- content: accumulatedContent,
412209
- toolCalls: toolCalls.map((tc) => ({ id: tc.id, name: tc.name, arguments: tc.arguments })),
412210
- finishReason: finishReason || "stop",
412211
- model,
412212
- usage: finalUsage
412213
- };
412214
- await effectiveConfig.hooks.chat.afterRequest(request, params, finalResponse, ctx, metadata);
412215
- }
412216
413631
  }.bind(this);
412217
413632
  }
412218
413633
  /**
@@ -413688,6 +415103,149 @@ var ReplicateProvider = class {
413688
415103
  var import_client_bedrock = __toESM(require_dist_cjs53(), 1);
413689
415104
  var import_client_bedrock_runtime = __toESM(require_dist_cjs66(), 1);
413690
415105
 
415106
+ // ../aws/src/common.ts
415107
+ function detectAWSFamily(modelId) {
415108
+ if (modelId.startsWith("anthropic.")) return "anthropic";
415109
+ if (modelId.startsWith("meta.")) return "meta";
415110
+ if (modelId.startsWith("mistral.")) return "mistral";
415111
+ if (modelId.startsWith("cohere.")) return "cohere";
415112
+ if (modelId.startsWith("ai21.")) return "ai21";
415113
+ if (modelId.startsWith("amazon.")) return "amazon";
415114
+ if (modelId.startsWith("stability.")) return "stability";
415115
+ return "unknown";
415116
+ }
415117
+ function detectAWSCapabilities(model) {
415118
+ const capabilities = /* @__PURE__ */ new Set();
415119
+ const modelId = model.modelId || "";
415120
+ const family = detectAWSFamily(modelId);
415121
+ if (model.inputModalities?.includes("TEXT") && model.outputModalities?.includes("TEXT")) {
415122
+ if (family === "anthropic" || family === "meta" || family === "mistral" || family === "cohere" || family === "ai21" || family === "amazon" && modelId.includes("text")) {
415123
+ capabilities.add("chat");
415124
+ if (model.responseStreamingSupported) {
415125
+ capabilities.add("streaming");
415126
+ }
415127
+ }
415128
+ }
415129
+ if (model.inputModalities?.includes("TEXT") && model.outputModalities?.includes("IMAGE")) {
415130
+ capabilities.add("image");
415131
+ }
415132
+ if (model.inputModalities?.includes("IMAGE") && model.outputModalities?.includes("TEXT")) {
415133
+ capabilities.add("vision");
415134
+ }
415135
+ if (family === "amazon" && modelId.includes("embed")) {
415136
+ capabilities.add("embedding");
415137
+ }
415138
+ if (family === "cohere" && modelId.includes("embed")) {
415139
+ capabilities.add("embedding");
415140
+ }
415141
+ if (family === "anthropic" && modelId.includes("claude")) {
415142
+ capabilities.add("tools");
415143
+ }
415144
+ return capabilities;
415145
+ }
415146
+ function detectAWSTier(family, modelId) {
415147
+ let tier = "efficient";
415148
+ if (family === "anthropic" && modelId.includes("opus")) {
415149
+ tier = "flagship";
415150
+ } else if (family === "anthropic" && modelId.includes("sonnet")) {
415151
+ tier = "efficient";
415152
+ } else if (family === "anthropic" && modelId.includes("haiku")) {
415153
+ tier = "efficient";
415154
+ } else if (family === "meta" && (modelId.includes("405b") || modelId.includes("90b"))) {
415155
+ tier = "flagship";
415156
+ } else if (family === "meta" && (modelId.includes("70b") || modelId.includes("13b"))) {
415157
+ tier = "efficient";
415158
+ } else if (family === "meta" && (modelId.includes("8b") || modelId.includes("7b") || modelId.includes("3b") || modelId.includes("1b"))) {
415159
+ tier = "efficient";
415160
+ } else if (family === "mistral" && modelId.includes("large")) {
415161
+ tier = "flagship";
415162
+ } else if (family === "mistral" && modelId.includes("mixtral")) {
415163
+ tier = "efficient";
415164
+ } else if (family === "mistral" && modelId.includes("7b")) {
415165
+ tier = "efficient";
415166
+ } else if (family === "cohere" && modelId.includes("plus")) {
415167
+ tier = "flagship";
415168
+ } else {
415169
+ tier = "efficient";
415170
+ }
415171
+ return tier;
415172
+ }
415173
+ function convertAWSModel(model) {
415174
+ const modelId = model.modelId;
415175
+ if (!modelId) return null;
415176
+ const family = detectAWSFamily(modelId);
415177
+ const capabilities = detectAWSCapabilities(model);
415178
+ const tier = detectAWSTier(family, modelId);
415179
+ const metadata = MODEL_METADATA[modelId] || {};
415180
+ return {
415181
+ provider: "aws",
415182
+ id: modelId,
415183
+ name: model.modelName || modelId,
415184
+ capabilities,
415185
+ tier,
415186
+ contextWindow: 0,
415187
+ pricing: {},
415188
+ ...metadata,
415189
+ metadata: {
415190
+ modelArn: model.modelArn,
415191
+ providerName: model.providerName,
415192
+ responseStreamingSupported: model.responseStreamingSupported,
415193
+ customizationsSupported: model.customizationsSupported,
415194
+ inferenceTypesSupported: model.inferenceTypesSupported,
415195
+ inputModalities: model.inputModalities,
415196
+ outputModalities: model.outputModalities
415197
+ }
415198
+ };
415199
+ }
415200
+ var MODEL_METADATA = {
415201
+ // Anthropic Claude Sonnet
415202
+ "anthropic.claude-3-sonnet-20240229-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 4096 },
415203
+ "anthropic.claude-3-5-sonnet-20240620-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415204
+ "anthropic.claude-3-5-sonnet-20241022-v2:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415205
+ "anthropic.claude-3-7-sonnet-20250219-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415206
+ "anthropic.claude-sonnet-4-20250514-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415207
+ "anthropic.claude-sonnet-4-5-20250929-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415208
+ // Anthropic Claude Haiku
415209
+ "anthropic.claude-3-haiku-20240307-v1:0": { pricing: { text: { input: 0.25, output: 1.25 } }, contextWindow: 2e5, maxOutputTokens: 4096 },
415210
+ "anthropic.claude-3-haiku-20240307-v1:0:48k": { pricing: { text: { input: 0.25, output: 1.25 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415211
+ "anthropic.claude-haiku-4-5-20251001-v1:0": { pricing: { text: { input: 1, output: 5 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415212
+ // Anthropic Claude Opus
415213
+ "anthropic.claude-3-opus-20240229-v1:0": { pricing: { text: { input: 15, output: 75 } }, contextWindow: 2e5, maxOutputTokens: 4096 },
415214
+ "anthropic.claude-opus-4-20250514-v1:0": { pricing: { text: { input: 15, output: 75 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415215
+ "anthropic.claude-opus-4-1-20250805-v1:0": { pricing: { text: { input: 15, output: 75 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415216
+ // Anthropic Claude 2.x
415217
+ "anthropic.claude-v2:1": { pricing: { text: { input: 8, output: 24 } }, contextWindow: 1e5, maxOutputTokens: 4096 },
415218
+ "anthropic.claude-v2": { pricing: { text: { input: 8, output: 24 } }, contextWindow: 1e5, maxOutputTokens: 4096 },
415219
+ "anthropic.claude-instant-v1": { pricing: { text: { input: 0.8, output: 2.4 } }, contextWindow: 1e5, maxOutputTokens: 4096 },
415220
+ // Meta Llama 3.2
415221
+ "meta.llama3-2-1b-instruct-v1:0": { pricing: { text: { input: 0.1, output: 0.1 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415222
+ "meta.llama3-2-3b-instruct-v1:0": { pricing: { text: { input: 0.15, output: 0.15 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415223
+ "meta.llama3-2-11b-instruct-v1:0": { pricing: { text: { input: 0.35, output: 0.35 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415224
+ "meta.llama3-2-90b-instruct-v1:0": { pricing: { text: { input: 2.65, output: 2.65 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415225
+ // Meta Llama 3.1
415226
+ "meta.llama3-1-8b-instruct-v1:0": { pricing: { text: { input: 0.3, output: 0.6 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415227
+ "meta.llama3-1-70b-instruct-v1:0": { pricing: { text: { input: 2.65, output: 3.5 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415228
+ "meta.llama3-1-405b-instruct-v1:0": { pricing: { text: { input: 5.32, output: 16 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415229
+ // Meta Llama 3
415230
+ "meta.llama3-8b-instruct-v1:0": { pricing: { text: { input: 0.3, output: 0.6 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415231
+ "meta.llama3-70b-instruct-v1:0": { pricing: { text: { input: 2.65, output: 3.5 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415232
+ // Meta Llama 2
415233
+ "meta.llama2-13b-chat-v1": { pricing: { text: { input: 0.75, output: 1 } }, contextWindow: 128e3, maxOutputTokens: 4096 },
415234
+ "meta.llama2-70b-chat-v1": { pricing: { text: { input: 1.95, output: 2.56 } }, contextWindow: 128e3, maxOutputTokens: 4096 },
415235
+ // Mistral AI
415236
+ "mistral.mistral-7b-instruct-v0:2": { pricing: { text: { input: 0.15, output: 0.2 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415237
+ "mistral.mixtral-8x7b-instruct-v0:1": { pricing: { text: { input: 0.45, output: 0.7 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415238
+ "mistral.mistral-large-2402-v1:0": { pricing: { text: { input: 4, output: 12 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415239
+ "mistral.mistral-large-2407-v1:0": { pricing: { text: { input: 3, output: 9 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415240
+ // Cohere
415241
+ "cohere.command-text-v14": { pricing: { text: { input: 1.5, output: 2 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415242
+ "cohere.command-light-text-v14": { pricing: { text: { input: 0.3, output: 0.6 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415243
+ "cohere.command-r-v1:0": { pricing: { text: { input: 0.5, output: 1.5 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415244
+ "cohere.command-r-plus-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415245
+ // Amazon Titan Text
415246
+ "amazon.titan-embed-text-v2:0": { pricing: { embeddings: { cost: 0.135 } }, contextWindow: 8e3, maxOutputTokens: 0 }
415247
+ };
415248
+
413691
415249
  // ../aws/src/types.ts
413692
415250
  var AWSError = class extends Error {
413693
415251
  constructor(message, cause) {
@@ -413724,7 +415282,7 @@ var AWSContextWindowError = class extends AWSError {
413724
415282
  };
413725
415283
 
413726
415284
  // ../aws/src/aws.ts
413727
- var AWSBedrockProvider = class {
415285
+ var AWSBedrockProvider = class _AWSBedrockProvider {
413728
415286
  name = "aws-bedrock";
413729
415287
  config;
413730
415288
  defaultMetadata;
@@ -413732,72 +415290,28 @@ var AWSBedrockProvider = class {
413732
415290
  bedrockRuntimeClient;
413733
415291
  constructor(config3) {
413734
415292
  this.config = config3;
413735
- const clientConfig = {
413736
- region: config3.region || process.env.AWS_REGION || "us-east-1",
413737
- credentials: config3.credentials
413738
- };
415293
+ const clientConfig = _AWSBedrockProvider.convertConfig(config3);
413739
415294
  this.bedrockClient = new import_client_bedrock.BedrockClient(clientConfig);
413740
415295
  this.bedrockRuntimeClient = new import_client_bedrock_runtime.BedrockRuntimeClient(clientConfig);
413741
415296
  }
413742
- // ============================================================================
413743
- // Model Information & Detection
413744
- // ============================================================================
413745
415297
  /**
413746
- * Detect model family from model ID
413747
- */
413748
- detectModelFamily(modelId) {
413749
- if (modelId.startsWith("anthropic.")) return "anthropic";
413750
- if (modelId.startsWith("amazon.")) return "amazon";
413751
- if (modelId.startsWith("meta.")) return "meta";
413752
- if (modelId.startsWith("mistral.")) return "mistral";
413753
- if (modelId.startsWith("cohere.")) return "cohere";
413754
- if (modelId.startsWith("ai21.")) return "ai21";
413755
- if (modelId.startsWith("stability.")) return "stability";
413756
- return "unknown";
413757
- }
413758
- /**
413759
- * Convert AWS Bedrock model to @aeye ModelInfo format
415298
+ * Convert AWSBedrockConfig to BedrockClientConfig
415299
+ *
415300
+ * @param config
415301
+ * @returns
413760
415302
  */
413761
- convertModel(model) {
413762
- const modelId = model.modelId || "";
413763
- const family = this.detectModelFamily(modelId);
413764
- const tier = detectTier(modelId);
413765
- const capabilities = /* @__PURE__ */ new Set();
413766
- if (family === "anthropic" || family === "meta" || family === "mistral" || family === "cohere" || family === "ai21") {
413767
- capabilities.add("chat");
413768
- capabilities.add("streaming");
413769
- }
413770
- if (modelId.includes("claude-3") || modelId.includes("claude-3-5")) {
413771
- capabilities.add("vision");
413772
- }
413773
- if (family === "anthropic" && (modelId.includes("claude-3") || modelId.includes("claude-3-5"))) {
413774
- capabilities.add("tools");
413775
- }
413776
- if (family === "stability") {
413777
- capabilities.add("image");
413778
- }
413779
- if (family === "amazon" && modelId.includes("embed")) {
413780
- capabilities.add("embedding");
413781
- }
413782
- return {
413783
- provider: this.name,
413784
- id: modelId,
413785
- name: model.modelName || modelId,
413786
- capabilities,
413787
- tier,
413788
- pricing: {},
413789
- contextWindow: 0,
413790
- // Will need to be populated from external sources
413791
- maxOutputTokens: void 0,
413792
- metadata: {
413793
- modelArn: model.modelArn,
413794
- responseStreamingSupported: model.responseStreamingSupported,
413795
- customizationsSupported: model.customizationsSupported,
413796
- inferenceTypesSupported: model.inferenceTypesSupported,
413797
- inputModalities: model.inputModalities,
413798
- outputModalities: model.outputModalities
413799
- }
415303
+ static convertConfig(config3) {
415304
+ const clientConfig = {
415305
+ region: config3.region || process.env.AWS_REGION || "us-east-1"
413800
415306
  };
415307
+ if (config3.credentials && config3.credentials.accessKeyId && config3.credentials.secretAccessKey) {
415308
+ clientConfig.credentials = {
415309
+ accessKeyId: config3.credentials.accessKeyId,
415310
+ secretAccessKey: config3.credentials.secretAccessKey,
415311
+ sessionToken: config3.credentials.sessionToken
415312
+ };
415313
+ }
415314
+ return clientConfig;
413801
415315
  }
413802
415316
  // ============================================================================
413803
415317
  // Provider Interface Implementation
@@ -413807,12 +415321,13 @@ var AWSBedrockProvider = class {
413807
415321
  */
413808
415322
  async listModels(config3) {
413809
415323
  try {
415324
+ const client2 = config3 && JSON.stringify(config3) !== JSON.stringify(this.config) ? new import_client_bedrock.BedrockClient(_AWSBedrockProvider.convertConfig(config3)) : this.bedrockClient;
413810
415325
  const command = new import_client_bedrock.ListFoundationModelsCommand({});
413811
- const response = await this.bedrockClient.send(command);
415326
+ const response = await client2.send(command);
413812
415327
  if (!response.modelSummaries) {
413813
415328
  return [];
413814
415329
  }
413815
- return response.modelSummaries.filter((m3) => m3.modelId).map((m3) => this.convertModel(m3));
415330
+ return response.modelSummaries.filter((m3) => m3.modelId).map((m3) => convertAWSModel(m3)).filter((m3) => !!m3);
413816
415331
  } catch (error47) {
413817
415332
  throw new AWSError("Failed to list models", error47);
413818
415333
  }
@@ -413822,8 +415337,9 @@ var AWSBedrockProvider = class {
413822
415337
  */
413823
415338
  async checkHealth(config3) {
413824
415339
  try {
415340
+ const client2 = config3 && JSON.stringify(config3) !== JSON.stringify(this.config) ? new import_client_bedrock.BedrockClient(_AWSBedrockProvider.convertConfig(config3)) : this.bedrockClient;
413825
415341
  const command = new import_client_bedrock.ListFoundationModelsCommand({});
413826
- await this.bedrockClient.send(command);
415342
+ await client2.send(command);
413827
415343
  return true;
413828
415344
  } catch {
413829
415345
  return false;
@@ -413834,18 +415350,20 @@ var AWSBedrockProvider = class {
413834
415350
  */
413835
415351
  createExecutor(config3) {
413836
415352
  const effectiveConfig = { ...this.config, ...config3 };
415353
+ const self2 = this;
413837
415354
  return async (request, ctx, metadata) => {
413838
- const model = getModel(request.model || ctx.metadata?.model || metadata?.model || effectiveConfig.defaultModels?.chat);
413839
- if (!model) {
415355
+ const modelInput = request.model || ctx.metadata?.model || metadata?.model || effectiveConfig.defaultModels?.chat;
415356
+ if (!modelInput) {
413840
415357
  throw new AWSError("Model is required for AWS Bedrock requests");
413841
415358
  }
413842
- const family = this.detectModelFamily(model.id);
415359
+ const model = getModel(modelInput);
415360
+ const family = detectAWSFamily(model.id);
413843
415361
  if (family === "anthropic") {
413844
- return this.executeAnthropicModel(model.id, request, ctx);
415362
+ return self2.executeAnthropicModel(modelInput, request, ctx);
413845
415363
  } else if (family === "meta" || family === "mistral") {
413846
- return this.executeLlamaStyleModel(model.id, request, ctx);
415364
+ return self2.executeLlamaStyleModel(model.id, request, ctx);
413847
415365
  } else if (family === "cohere") {
413848
- return this.executeCohereModel(model.id, request, ctx);
415366
+ return self2.executeCohereModel(model.id, request, ctx);
413849
415367
  } else {
413850
415368
  throw new AWSError(`Unsupported model family: ${family}`);
413851
415369
  }
@@ -413856,18 +415374,19 @@ var AWSBedrockProvider = class {
413856
415374
  */
413857
415375
  createStreamer(config3) {
413858
415376
  const effectiveConfig = { ...this.config, ...config3 };
415377
+ const self2 = this;
413859
415378
  return async function* (request, ctx, metadata) {
413860
415379
  const model = getModel(request.model || ctx.metadata?.model || metadata?.model || effectiveConfig.defaultModels?.chat);
413861
415380
  if (!model) {
413862
415381
  throw new AWSError("Model is required for AWS Bedrock requests");
413863
415382
  }
413864
- const family = this.detectModelFamily(model.id);
415383
+ const family = detectAWSFamily(model.id);
413865
415384
  if (family === "anthropic") {
413866
- yield* this.streamAnthropicModel(model.id, request, ctx);
415385
+ return yield* self2.streamAnthropicModel(model.id, request, ctx);
413867
415386
  } else if (family === "meta" || family === "mistral") {
413868
- yield* this.streamLlamaStyleModel(model.id, request, ctx);
415387
+ return yield* self2.streamLlamaStyleModel(model.id, request, ctx);
413869
415388
  } else if (family === "cohere") {
413870
- yield* this.streamCohereModel(model.id, request, ctx);
415389
+ return yield* self2.streamCohereModel(model.id, request, ctx);
413871
415390
  } else {
413872
415391
  throw new AWSError(`Unsupported model family for streaming: ${family}`);
413873
415392
  }
@@ -413900,23 +415419,36 @@ var AWSBedrockProvider = class {
413900
415419
  }
413901
415420
  return void 0;
413902
415421
  }
413903
- async executeAnthropicModel(modelId, request, ctx) {
415422
+ convertRequestToAnthropic(model, request) {
413904
415423
  const messages = this.convertMessagesToAnthropic(request);
413905
- const systemMessages = request.messages.filter((m3) => m3.role === "system");
413906
- const system = systemMessages.length > 0 ? systemMessages.map((m3) => typeof m3.content === "string" ? m3.content : "").join("\n\n") : void 0;
413907
415424
  const tools = this.convertToolsToAnthropic(request);
413908
415425
  const tool_choice = tools ? this.convertToolChoiceToAnthropic(request) : void 0;
413909
- const body = {
413910
- anthropic_version: "bedrock-2023-05-31",
413911
- max_tokens: request.maxTokens || 4096,
415426
+ const systemMessages = request.messages.filter((m3) => m3.role === "system");
415427
+ const system = systemMessages.length > 0 ? systemMessages.map((m3) => ({
415428
+ type: "text",
415429
+ text: typeof m3.content === "string" ? m3.content : m3.content.map((m4) => m4.content).join("\n")
415430
+ })) : void 0;
415431
+ const modelMax = isModelInfo(model) ? model.maxOutputTokens : void 0;
415432
+ return {
415433
+ anthropic_version: this.config.anthropic?.version ?? "bedrock-2023-05-31",
415434
+ anthropic_beta: this.config.anthropic?.beta,
415435
+ max_tokens: modelMax || 4096,
413912
415436
  messages,
413913
415437
  system,
413914
415438
  temperature: request.temperature,
413915
415439
  top_p: request.topP,
413916
- stop_sequences: request.stop,
415440
+ stop_sequences: request.stop ? Array.isArray(request.stop) ? request.stop : [request.stop] : void 0,
413917
415441
  tools,
413918
- tool_choice
415442
+ tool_choice,
415443
+ metadata: {
415444
+ user_id: request.userKey || void 0
415445
+ },
415446
+ ...request.extra
413919
415447
  };
415448
+ }
415449
+ async executeAnthropicModel(model, request, ctx) {
415450
+ const body = this.convertRequestToAnthropic(model, request);
415451
+ const modelId = getModel(model)?.id || "";
413920
415452
  try {
413921
415453
  const command = new import_client_bedrock_runtime.InvokeModelCommand({
413922
415454
  modelId,
@@ -413928,8 +415460,9 @@ var AWSBedrockProvider = class {
413928
415460
  const response = await this.bedrockRuntimeClient.send(command);
413929
415461
  const responseBody = JSON.parse(new TextDecoder().decode(response.body));
413930
415462
  let content = "";
415463
+ let reasoning = void 0;
413931
415464
  const toolCalls = [];
413932
- if (responseBody.content && Array.isArray(responseBody.content)) {
415465
+ if (responseBody.content) {
413933
415466
  for (const block of responseBody.content) {
413934
415467
  if (block.type === "text") {
413935
415468
  content += block.text;
@@ -413939,14 +415472,17 @@ var AWSBedrockProvider = class {
413939
415472
  name: block.name,
413940
415473
  arguments: JSON.stringify(block.input)
413941
415474
  });
415475
+ } else if (block.type === "thinking") {
415476
+ reasoning = (reasoning || "") + block.thinking;
413942
415477
  }
413943
415478
  }
413944
415479
  }
413945
415480
  const result2 = {
413946
415481
  content,
415482
+ reasoning,
413947
415483
  toolCalls: toolCalls.length > 0 ? toolCalls : void 0,
413948
415484
  finishReason: this.mapAnthropicStopReason(responseBody.stop_reason),
413949
- model: { id: modelId },
415485
+ model,
413950
415486
  usage: {
413951
415487
  text: {
413952
415488
  input: responseBody.usage?.input_tokens ?? -1,
@@ -413961,23 +415497,9 @@ var AWSBedrockProvider = class {
413961
415497
  throw error47;
413962
415498
  }
413963
415499
  }
413964
- async *streamAnthropicModel(modelId, request, ctx) {
413965
- const messages = this.convertMessagesToAnthropic(request);
413966
- const systemMessages = request.messages.filter((m3) => m3.role === "system");
413967
- const system = systemMessages.length > 0 ? systemMessages.map((m3) => typeof m3.content === "string" ? m3.content : "").join("\n\n") : void 0;
413968
- const tools = this.convertToolsToAnthropic(request);
413969
- const tool_choice = tools ? this.convertToolChoiceToAnthropic(request) : void 0;
413970
- const body = {
413971
- anthropic_version: "bedrock-2023-05-31",
413972
- max_tokens: request.maxTokens || 4096,
413973
- messages,
413974
- system,
413975
- temperature: request.temperature,
413976
- top_p: request.topP,
413977
- stop_sequences: request.stop,
413978
- tools,
413979
- tool_choice
413980
- };
415500
+ async *streamAnthropicModel(model, request, ctx) {
415501
+ const body = this.convertRequestToAnthropic(model, request);
415502
+ const modelId = getModel(model)?.id || "";
413981
415503
  try {
413982
415504
  const command = new import_client_bedrock_runtime.InvokeModelWithResponseStreamCommand({
413983
415505
  modelId,
@@ -413993,105 +415515,129 @@ var AWSBedrockProvider = class {
413993
415515
  let inputTokens = 0;
413994
415516
  let outputTokens = 0;
413995
415517
  let accumulatedContent = "";
415518
+ let accumulatedReasoning = "";
413996
415519
  let finishReason = void 0;
413997
415520
  const toolCallsMap = /* @__PURE__ */ new Map();
413998
- for await (const event of response.body) {
413999
- if (event.chunk) {
414000
- const chunk3 = JSON.parse(new TextDecoder().decode(event.chunk.bytes));
414001
- if (chunk3.type === "content_block_delta" && chunk3.delta?.text) {
414002
- accumulatedContent += chunk3.delta.text;
414003
- yield {
414004
- content: chunk3.delta.text,
414005
- finishReason: void 0
414006
- };
414007
- } else if (chunk3.type === "content_block_start" && chunk3.content_block?.type === "tool_use") {
414008
- const index = chunk3.index;
414009
- const toolCall = {
414010
- id: chunk3.content_block.id,
414011
- name: chunk3.content_block.name,
414012
- arguments: "",
414013
- named: true,
414014
- finished: false
414015
- };
414016
- toolCallsMap.set(index, toolCall);
414017
- yield {
414018
- toolCallNamed: {
414019
- id: toolCall.id,
414020
- name: toolCall.name,
414021
- arguments: toolCall.arguments
415521
+ try {
415522
+ for await (const event of response.body) {
415523
+ if (event.chunk) {
415524
+ const chunk3 = JSON.parse(new TextDecoder().decode(event.chunk.bytes));
415525
+ if (chunk3.type === "content_block_delta" && chunk3.delta) {
415526
+ switch (chunk3.delta.type) {
415527
+ case "text_delta":
415528
+ accumulatedContent += chunk3.delta.text;
415529
+ yield {
415530
+ content: chunk3.delta.text,
415531
+ finishReason: void 0
415532
+ };
415533
+ break;
415534
+ case "thinking_delta":
415535
+ accumulatedReasoning += chunk3.delta.thinking;
415536
+ yield {
415537
+ reasoning: chunk3.delta.thinking
415538
+ };
415539
+ break;
415540
+ case "input_json_delta":
415541
+ const index = chunk3.index;
415542
+ const toolCall = toolCallsMap.get(index);
415543
+ if (toolCall && chunk3.delta.partial_json) {
415544
+ if (toolCall.arguments === "{}") {
415545
+ toolCall.arguments = "";
415546
+ }
415547
+ toolCall.arguments += chunk3.delta.partial_json;
415548
+ yield {
415549
+ toolCallArguments: {
415550
+ id: toolCall.id,
415551
+ name: toolCall.name,
415552
+ arguments: toolCall.arguments
415553
+ }
415554
+ };
415555
+ }
415556
+ break;
414022
415557
  }
414023
- };
414024
- } else if (chunk3.type === "content_block_delta" && chunk3.delta?.type === "input_json_delta") {
414025
- const index = chunk3.index;
414026
- const toolCall = toolCallsMap.get(index);
414027
- if (toolCall) {
414028
- toolCall.arguments += chunk3.delta.partial_json;
414029
- yield {
414030
- toolCallArguments: {
414031
- id: toolCall.id,
414032
- name: toolCall.name,
414033
- arguments: toolCall.arguments
414034
- }
415558
+ } else if (chunk3.type === "content_block_start" && chunk3.content_block?.type === "tool_use") {
415559
+ const index = chunk3.index;
415560
+ const toolCall = {
415561
+ id: chunk3.content_block.id,
415562
+ name: chunk3.content_block.name,
415563
+ arguments: chunk3.content_block.input ? JSON.stringify(chunk3.content_block.input) : "",
415564
+ named: true,
415565
+ finished: false
414035
415566
  };
414036
- }
414037
- } else if (chunk3.type === "content_block_stop") {
414038
- const index = chunk3.index;
414039
- const toolCall = toolCallsMap.get(index);
414040
- if (toolCall && !toolCall.finished) {
414041
- toolCall.finished = true;
415567
+ toolCallsMap.set(index, toolCall);
414042
415568
  yield {
414043
- toolCall: {
415569
+ toolCallNamed: {
414044
415570
  id: toolCall.id,
414045
415571
  name: toolCall.name,
414046
415572
  arguments: toolCall.arguments
414047
415573
  }
414048
415574
  };
414049
- }
414050
- } else if (chunk3.type === "message_start" && chunk3.message?.usage) {
414051
- inputTokens = chunk3.message.usage.input_tokens || 0;
414052
- } else if (chunk3.type === "message_delta") {
414053
- if (chunk3.delta?.stop_reason) {
414054
- finishReason = this.mapAnthropicStopReason(chunk3.delta.stop_reason);
414055
- outputTokens = chunk3.usage?.output_tokens || 0;
414056
- yield {
414057
- content: void 0,
414058
- finishReason,
414059
- usage: {
414060
- text: {
414061
- input: inputTokens,
414062
- output: outputTokens
415575
+ } else if (chunk3.type === "content_block_stop") {
415576
+ const index = chunk3.index;
415577
+ const toolCall = toolCallsMap.get(index);
415578
+ if (toolCall && !toolCall.finished) {
415579
+ toolCall.finished = true;
415580
+ yield {
415581
+ toolCall: {
415582
+ id: toolCall.id,
415583
+ name: toolCall.name,
415584
+ arguments: toolCall.arguments
414063
415585
  }
414064
- }
414065
- };
415586
+ };
415587
+ }
415588
+ } else if (chunk3.type === "message_start" && chunk3.message?.usage) {
415589
+ inputTokens = chunk3.message.usage.input_tokens || 0;
415590
+ } else if (chunk3.type === "message_delta") {
415591
+ if (chunk3.delta?.stop_reason) {
415592
+ finishReason = this.mapAnthropicStopReason(chunk3.delta.stop_reason);
415593
+ yield {
415594
+ finishReason,
415595
+ usage: {
415596
+ text: {
415597
+ input: chunk3.usage.input_tokens || inputTokens || void 0,
415598
+ output: chunk3.usage.output_tokens || void 0,
415599
+ cached: chunk3.usage.cache_read_input_tokens || void 0
415600
+ }
415601
+ }
415602
+ };
415603
+ }
414066
415604
  }
414067
415605
  }
414068
415606
  }
414069
- }
414070
- const toolCalls = Array.from(toolCallsMap.values()).map((tc) => ({
414071
- id: tc.id,
414072
- name: tc.name,
414073
- arguments: tc.arguments
414074
- }));
414075
- const accumulatedResponse = {
414076
- content: accumulatedContent,
414077
- toolCalls: toolCalls.length > 0 ? toolCalls : void 0,
414078
- finishReason,
414079
- model: { id: modelId },
414080
- usage: {
414081
- text: {
414082
- input: inputTokens,
414083
- output: outputTokens
415607
+ } finally {
415608
+ const toolCalls = Array.from(toolCallsMap.values()).map((tc) => ({
415609
+ id: tc.id,
415610
+ name: tc.name,
415611
+ arguments: tc.arguments
415612
+ }));
415613
+ const accumulatedResponse = {
415614
+ content: accumulatedContent,
415615
+ toolCalls: toolCalls.length > 0 ? toolCalls : void 0,
415616
+ finishReason,
415617
+ model,
415618
+ usage: {
415619
+ text: {
415620
+ input: inputTokens,
415621
+ output: outputTokens
415622
+ }
414084
415623
  }
414085
- }
414086
- };
414087
- await this.config.hooks?.chat?.afterRequest?.(request, command, accumulatedResponse, ctx);
415624
+ };
415625
+ await this.config.hooks?.chat?.afterRequest?.(request, command, accumulatedResponse, ctx);
415626
+ }
414088
415627
  } catch (error47) {
414089
415628
  this.handleAWSError(error47);
414090
415629
  throw error47;
414091
415630
  }
414092
415631
  }
414093
415632
  convertMessagesToAnthropic(request) {
414094
- return request.messages.filter((m3) => m3.role !== "system").map((msg) => {
415633
+ const toContent = (part) => {
415634
+ if (typeof part === "string") {
415635
+ return [{ type: "text", text: part }];
415636
+ } else {
415637
+ return part;
415638
+ }
415639
+ };
415640
+ const messages = request.messages.filter((m3) => m3.role !== "system").map((msg) => {
414095
415641
  if (msg.role === "assistant") {
414096
415642
  if (msg.toolCalls && msg.toolCalls.length > 0) {
414097
415643
  const content = [];
@@ -414103,7 +415649,13 @@ var AWSBedrockProvider = class {
414103
415649
  type: "tool_use",
414104
415650
  id: toolCall.id,
414105
415651
  name: toolCall.name,
414106
- input: JSON.parse(toolCall.arguments)
415652
+ input: (() => {
415653
+ try {
415654
+ return JSON.parse(toolCall.arguments);
415655
+ } catch (e3) {
415656
+ return { badArguments: toolCall.arguments };
415657
+ }
415658
+ })()
414107
415659
  });
414108
415660
  }
414109
415661
  return {
@@ -414113,7 +415665,7 @@ var AWSBedrockProvider = class {
414113
415665
  }
414114
415666
  return {
414115
415667
  role: "assistant",
414116
- content: typeof msg.content === "string" ? msg.content : ""
415668
+ content: typeof msg.content === "string" ? msg.content : msg.content.map((m3) => m3.content).join("\n\n")
414117
415669
  };
414118
415670
  } else if (msg.role === "tool") {
414119
415671
  return {
@@ -414147,15 +415699,27 @@ var AWSBedrockProvider = class {
414147
415699
  media_type: match2[1],
414148
415700
  data: match2[2]
414149
415701
  };
415702
+ } else if (part.content.startsWith("http")) {
415703
+ source = {
415704
+ type: "url",
415705
+ url: part.content
415706
+ };
414150
415707
  }
414151
- } else if (part.content.startsWith("http")) {
415708
+ } else {
414152
415709
  source = {
414153
415710
  type: "url",
414154
415711
  url: part.content
414155
415712
  };
414156
415713
  }
415714
+ } else if (part.content instanceof URL) {
415715
+ source = {
415716
+ type: "url",
415717
+ url: part.content.toString()
415718
+ };
415719
+ }
415720
+ if (source) {
415721
+ return { type: "image", source };
414157
415722
  }
414158
- return { type: "image", source };
414159
415723
  }
414160
415724
  return { type: "text", text: "[Unsupported content type]" };
414161
415725
  });
@@ -414167,11 +415731,51 @@ var AWSBedrockProvider = class {
414167
415731
  }
414168
415732
  return {
414169
415733
  role: "user",
414170
- content: ""
415734
+ content: "<unsupported role>"
414171
415735
  };
414172
415736
  });
415737
+ const nonEmptyMessages = messages.filter((m3) => {
415738
+ const contentArray = toContent(m3.content);
415739
+ return contentArray.some((c3) => c3.type === "text" ? c3.text.trim().length > 0 : true);
415740
+ });
415741
+ const joinedMessages = [];
415742
+ let lastMessage = null;
415743
+ for (const msg of nonEmptyMessages) {
415744
+ if (lastMessage && lastMessage.role === msg.role) {
415745
+ const lastContent = toContent(lastMessage.content);
415746
+ const newContent = toContent(msg.content);
415747
+ const allContent = lastContent.concat(newContent);
415748
+ lastMessage.content = allContent;
415749
+ } else {
415750
+ if (lastMessage) {
415751
+ joinedMessages.push(lastMessage);
415752
+ }
415753
+ lastMessage = msg;
415754
+ }
415755
+ }
415756
+ if (lastMessage) {
415757
+ joinedMessages.push(lastMessage);
415758
+ }
415759
+ for (const msg of joinedMessages) {
415760
+ const contentArray = toContent(msg.content);
415761
+ if (contentArray.every((c3) => c3.type === "text")) {
415762
+ msg.content = contentArray.map((c3) => c3.text).join("\n\n");
415763
+ }
415764
+ }
415765
+ if (joinedMessages.length === 0) {
415766
+ if (this.config.anthropic?.emptyMessage) {
415767
+ joinedMessages.push(this.config.anthropic.emptyMessage);
415768
+ } else {
415769
+ joinedMessages.push({
415770
+ role: "user",
415771
+ content: "Perform the requested operation."
415772
+ });
415773
+ }
415774
+ }
415775
+ return joinedMessages;
414173
415776
  }
414174
415777
  mapAnthropicStopReason(reason) {
415778
+ if (!reason) return "stop";
414175
415779
  switch (reason) {
414176
415780
  case "end_turn":
414177
415781
  return "stop";
@@ -448108,8 +449712,8 @@ var ReplicateConfigSchema = external_exports.object({
448108
449712
  var AWSBedrockConfigSchema = external_exports.object({
448109
449713
  region: external_exports.string().optional(),
448110
449714
  credentials: external_exports.object({
448111
- accessKeyId: external_exports.string(),
448112
- secretAccessKey: external_exports.string(),
449715
+ accessKeyId: external_exports.string().optional(),
449716
+ secretAccessKey: external_exports.string().optional(),
448113
449717
  sessionToken: external_exports.string().optional()
448114
449718
  }).optional(),
448115
449719
  modelFamilies: external_exports.record(external_exports.string(), external_exports.object({
@@ -456335,7 +457939,21 @@ ${JSON.stringify(params, null, 2)}`);
456335
457939
  }) } : {},
456336
457940
  // AWS Bedrock
456337
457941
  ...config3.providers.aws ? { aws: new AWSBedrockProvider({
456338
- ...config3.providers.aws
457942
+ ...config3.providers.aws,
457943
+ hooks: {
457944
+ chat: {
457945
+ beforeRequest: (request, params, ctx) => {
457946
+ logger.log(`AWS Chat beforeRequest:
457947
+ ${JSON.stringify(params, null, 2)}`);
457948
+ },
457949
+ afterRequest: (request, response, responseComplete, ctx) => {
457950
+ logger.log(`AWS Chat afterRequest:
457951
+ ${JSON.stringify(response, null, 2)}
457952
+
457953
+ ${JSON.stringify(responseComplete, null, 2)}`);
457954
+ }
457955
+ }
457956
+ }
456339
457957
  }) } : {}
456340
457958
  };
456341
457959
  const jsonReplacer = (_key, value) => {
@@ -456819,7 +458437,7 @@ var MessageDisplay = ({ message, ai, showInput = false, showOutput = false }) =>
456819
458437
  // src/components/ModelSelector.tsx
456820
458438
  import { Box as Box5, Text as Text7, useInput } from "ink";
456821
458439
  import TextInput from "ink-text-input";
456822
- import React7, { useState as useState2, useEffect as useEffect2 } from "react";
458440
+ import React7, { useEffect as useEffect2, useState as useState2 } from "react";
456823
458441
  var ModelSelector = ({
456824
458442
  ai,
456825
458443
  baseMetadata = {},
@@ -457226,7 +458844,7 @@ var ModelSelector = ({
457226
458844
 
457227
458845
  // src/components/OperationApprovalMenu.tsx
457228
458846
  import { Box as Box6, Text as Text8, useInput as useInput2 } from "ink";
457229
- import React8, { useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
458847
+ import React8, { useEffect as useEffect3, useRef, useState as useState3 } from "react";
457230
458848
  var OperationApprovalMenu = ({
457231
458849
  message,
457232
458850
  ai,
@@ -457246,7 +458864,7 @@ var OperationApprovalMenu = ({
457246
458864
  const [isProcessing, setIsProcessing] = useState3(false);
457247
458865
  const [elapsedTime, setElapsedTime] = useState3(0);
457248
458866
  const [completionResult, setCompletionResult] = useState3(null);
457249
- const startTimeRef = useRef2(0);
458867
+ const startTimeRef = useRef(0);
457250
458868
  const approvableOperations = (message.operations || []).map((op2, idx) => ({ op: op2, idx })).filter(({ op: op2 }) => op2.status === "analyzed");
457251
458869
  const hasMultipleOperations = approvableOperations.length > 1;
457252
458870
  const updateMessageContent = (op2, operationIndex) => {
@@ -458874,6 +460492,9 @@ You can:
458874
460492
  ];
458875
460493
  }
458876
460494
 
460495
+ // markdown:C:\Users\pdiff\Documents\GitHub\aits\packages\cletus\src\tools\ABOUT.md
460496
+ var ABOUT_default = "# About Cletus\r\n\r\n**Cletus** is an interactive CLI assistant that demonstrates the powerful capabilities of the @aeye library. Built with TypeScript and React/Ink, Cletus provides a beautiful terminal user interface for interacting with AI-powered tools across multiple domains.\r\n\r\n## What is Cletus?\r\n\r\nCletus is a sophisticated AI assistant that lives in your terminal. It combines:\r\n\r\n- \u{1F916} **Specialized AI Agents** - Domain-specific assistants for different tasks (file management, data operations, image generation, web search, and more)\r\n- \u{1F4BE} **Persistent Storage** - Remembers your conversations, preferences, and custom data\r\n- \u{1F3A8} **Beautiful TUI** - Modern, interactive terminal interface powered by React/Ink\r\n- \u26A1 **Autonomous Mode** - Can execute multiple operations without constant approval\r\n- \u{1F527} **Customizable** - Create custom assistants, data types, and workflows\r\n\r\n## Specialized Agents\r\n\r\nCletus organizes its capabilities through specialized agents:\r\n\r\n- **Architect** - Manages custom data type definitions\r\n- **Artist** - Handles image generation, editing, analysis, and search\r\n- **Clerk** - Performs file operations, searching, and indexing\r\n- **DBA** - Database-like operations on typed data with full CRUD support\r\n- **Internet** - Web search, page scraping, and REST API calls\r\n- **Librarian** - Knowledge base management with semantic search\r\n- **Planner** - Todo list management and task tracking\r\n- **Secretary** - Assistant persona management and user memory\r\n\r\n## About @aeye\r\n\r\n**@aeye** (AI TypeScript) is a modern, type-safe AI library for Node.js and TypeScript applications. It provides a unified interface for working with multiple AI providers with automatic model selection, cost tracking, and comprehensive capabilities.\r\n\r\n### Key Features\r\n\r\n- \u{1F3AF} **Multi-Provider Support** - Single interface for OpenAI, OpenRouter, Replicate, AWS Bedrock, and custom providers\r\n- \u{1F916} **Intelligent Model Selection** - Automatic model selection based on capabilities, cost, speed, and quality\r\n- \u{1F4B0} **Cost Tracking** - Built-in token usage and cost calculation\r\n- \u{1F504} **Streaming Support** - Full streaming support across all compatible capabilities\r\n- \u{1F6E1}\uFE0F **Type-Safe** - Strongly-typed context and metadata with compiler validation\r\n- \u{1F3A8} **Comprehensive APIs** - Chat, Image Generation, Speech Synthesis, Transcription, Embeddings\r\n- \u{1F50C} **Extensible** - Custom providers, model handlers, and transformers\r\n- \u{1F4CA} **Model Registry** - Centralized model management with external sources\r\n\r\n### Architecture\r\n\r\n@aeye features a clean, modular architecture that separates concerns:\r\n\r\n- **Core Package** - Foundational types and interfaces\r\n- **AI Package** - Main library with model selection and context management\r\n- **Provider Packages** - OpenAI, OpenRouter, Replicate, AWS Bedrock implementations\r\n- **Models Package** - Centralized model registry and definitions\r\n\r\n## About the Author\r\n\r\n**ClickerMonkey** is the creator and maintainer of @aeye and Cletus. This open-source project represents a commitment to building developer-friendly AI tools that are both powerful and accessible.\r\n\r\n- **GitHub**: [@ClickerMonkey](https://github.com/ClickerMonkey)\r\n- **Repository**: [github.com/ClickerMonkey/aeye](https://github.com/ClickerMonkey/aeye)\r\n- **License**: MIT\r\n\r\nThe project emphasizes:\r\n- Type safety and developer experience\r\n- Extensibility and customization\r\n- Multi-provider support for flexibility\r\n- Cost transparency and tracking\r\n- Beautiful, intuitive interfaces\r\n\r\n## Getting Started\r\n\r\nInstall Cletus globally:\r\n\r\n```bash\r\nnpm install -g @aeye/cletus\r\n```\r\n\r\nThen simply run:\r\n\r\n```bash\r\ncletus\r\n```\r\n\r\nOn first launch, you'll be guided through an interactive setup to configure your AI providers and preferences.\r\n\r\n## Learn More\r\n\r\n- **Main Repository**: [github.com/ClickerMonkey/aeye](https://github.com/ClickerMonkey/aeye)\r\n- **Documentation**: [README.md](https://github.com/ClickerMonkey/aeye#readme)\r\n- **Issues & Support**: [GitHub Issues](https://github.com/ClickerMonkey/aeye/issues)\r\n- **Cletus Package**: [@aeye/cletus](https://www.npmjs.com/package/@aeye/cletus)\r\n\r\n---\r\n\r\n## Future Additions\r\n\r\n_This section is reserved for additional information about Cletus, new features, community contributions, and other updates._\r\n\r\n### Planned Features\r\n- Enhanced autonomous capabilities\r\n- Additional AI providers\r\n- More specialized agents\r\n- Plugin system for custom tools\r\n- Collaborative features\r\n\r\n### Community\r\n- Contributions are welcome!\r\n- See the repository for contribution guidelines\r\n- Join discussions on GitHub\r\n\r\n---\r\n\r\n**Made with \u2764\uFE0F and TypeScript** | **MIT Licensed** | **Open Source**\r\n";
460497
+
458877
460498
  // src/tools/utility.ts
458878
460499
  function createUtilityTools(ai) {
458879
460500
  const getOperationOutput = ai.tool({
@@ -458904,8 +460525,24 @@ function createUtilityTools(ai) {
458904
460525
  return operation2.message;
458905
460526
  }
458906
460527
  });
460528
+ const about = ai.tool({
460529
+ name: "about",
460530
+ description: "Provides information about Cletus, the @aeye library, and the author",
460531
+ instructions: `Use this tool when users ask about:
460532
+ - What Cletus is or can do
460533
+ - Information about the @aeye library
460534
+ - Who created Cletus
460535
+ - Project background and details
460536
+ - How to get started`,
460537
+ schema: external_exports.object({}),
460538
+ call: async (_3, __, { chatStatus }) => {
460539
+ chatStatus("Retrieving about information...");
460540
+ return ABOUT_default;
460541
+ }
460542
+ });
458907
460543
  return [
458908
- getOperationOutput
460544
+ getOperationOutput,
460545
+ about
458909
460546
  ];
458910
460547
  }
458911
460548
 
@@ -459028,7 +460665,7 @@ Use the 'simulateMode' parameter to override the operation mode for this delegat
459028
460665
  }
459029
460666
  })();
459030
460667
  ctx.chatStatus(`Processing ${agent} results...`);
459031
- const agentInstructions = !tools?.length ? `The ${agent} agent could not find any appropriate tools to handle the request. You should try a different agent or provide more details in the request and try again.` : effectiveOps.automatedOperations(operationProgress) ? `The ${agent} agent was able to complete all operations without user approval. The agent loop will continue - DO NOT RESPOND to the user yet. No questions. You will enter an automated loop until interrupted.` : effectiveOps.needsUserInput(operationProgress) ? `The ${agent} is handing operations off to the user for approval before proceeding. Present the operations clearly for approval - be concise but don't leave out any important details. DO NOT ask questions, the user will automatically be prompted for permission.` : `The ${agent} agent is in a state where it needs user input before proceeding. Wait for the user to respond. Ask questions that are needed to get tool calls correct.`;
460668
+ const agentInstructions = !tools?.length ? `The ${agent} agent could not find any appropriate tools to handle the request. You should try a different agent or provide more details in the request and try again.` : effectiveOps.automatedOperations(operationProgress) ? `The ${agent} agent was able to complete all operations without user approval. The agent loop will continue - DO NOT RESPOND to the user yet. No questions. You will enter an automated loop until interrupted. Do not comment about the automated loop. If you want you can make a brief comment on the results so far.` : effectiveOps.needsUserInput(operationProgress) ? `The ${agent} is handing operations off to the user for approval before proceeding. Present the operations clearly for approval - be concise but don't leave out any important details. DO NOT ask questions, the user will automatically be prompted for permission.` : `The ${agent} agent is in a state where it needs user input before proceeding. Wait for the user to respond. Ask questions that are needed to get tool calls correct.`;
459032
460669
  const chatMessage = ctx.chatMessage;
459033
460670
  if (chatMessage) {
459034
460671
  if (!chatMessage.requests) {
@@ -459521,10 +461158,10 @@ async function runChatOrchestrator(options2, onEvent) {
459521
461158
  }
459522
461159
 
459523
461160
  // src/hooks.ts
459524
- import { useCallback, useEffect as useEffect4, useRef as useRef3, useState as useState4 } from "react";
461161
+ import { useCallback, useEffect as useEffect4, useRef as useRef2, useState as useState4 } from "react";
459525
461162
  function useSyncedState(initialValue) {
459526
461163
  const [state2, setState] = useState4(initialValue);
459527
- const stateRef = useRef3(initialValue);
461164
+ const stateRef = useRef2(initialValue);
459528
461165
  const setSyncedState = useCallback((value) => {
459529
461166
  const newValue = typeof value === "function" ? value(stateRef.current) : value;
459530
461167
  stateRef.current = newValue;
@@ -459543,9 +461180,9 @@ function useAdaptiveDebounce(callback, options2 = {}) {
459543
461180
  sampleSize = 10
459544
461181
  } = options2;
459545
461182
  const [delay, setDelay] = useState4(initialDelay);
459546
- const renderTimes = useRef3([]);
459547
- const timeoutRef = useRef3(null);
459548
- const callbackRef = useRef3(callback);
461183
+ const renderTimes = useRef2([]);
461184
+ const timeoutRef = useRef2(null);
461185
+ const callbackRef = useRef2(callback);
459549
461186
  useEffect4(() => {
459550
461187
  callbackRef.current = callback;
459551
461188
  }, [callback]);
@@ -459643,12 +461280,12 @@ var ChatUI = ({ chat, config: config3, messages, onExit, onChatUpdate }) => {
459643
461280
  const [renderKey2, setRenderKey] = useState5(0);
459644
461281
  const [accumulatedUsage, setAccumulatedUsage] = useState5({});
459645
461282
  const [accumulatedCost, setAccumulatedCost] = useState5(0);
459646
- const interceptingRef = useRef4(false);
459647
- const abortControllerRef = useRef4(void 0);
459648
- const requestStartTimeRef = useRef4(0);
459649
- const chatFileRef = useRef4(new ChatFile(chat.id));
459650
- const transcriptionAbortRef = useRef4(void 0);
459651
- const firstMessageRef = useRef4(Math.max(0, chatMessages.length - 20));
461283
+ const interceptingRef = useRef3(false);
461284
+ const abortControllerRef = useRef3(void 0);
461285
+ const requestStartTimeRef = useRef3(0);
461286
+ const chatFileRef = useRef3(new ChatFile(chat.id));
461287
+ const transcriptionAbortRef = useRef3(void 0);
461288
+ const firstMessageRef = useRef3(Math.max(0, chatMessages.length - 20));
459652
461289
  const [ai, _3] = useState5(() => createCletusAI(config3));
459653
461290
  const [chatAgent, __] = useState5(() => createChatAgent(ai));
459654
461291
  const addMessage = (message) => {
@@ -461075,7 +462712,7 @@ import React13, { useState as useState9, useEffect as useEffect9 } from "react";
461075
462712
  import { Box as Box10, Text as Text12, useInput as useInput5 } from "ink";
461076
462713
  import SelectInput2 from "ink-select-input";
461077
462714
  import TextInput4 from "ink-text-input";
461078
- import React12, { useState as useState8, useEffect as useEffect8 } from "react";
462715
+ import React12, { useState as useState8, useEffect as useEffect8, useCallback as useCallback2 } from "react";
461079
462716
  import fs9 from "fs/promises";
461080
462717
  var InkSettingsMenu = ({ config: config3, onExit }) => {
461081
462718
  const [view, setView] = useState8("menu");
@@ -461096,6 +462733,37 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461096
462733
  const [maxIterationsInput, setMaxIterationsInput] = useState8("");
461097
462734
  const [timeoutInput, setTimeoutInput] = useState8("");
461098
462735
  const [inputError, setInputError] = useState8(null);
462736
+ const [awsTestStatus, setAwsTestStatus] = useState8("idle");
462737
+ const [awsTestMessage, setAwsTestMessage] = useState8("");
462738
+ const testAWSCredentials = useCallback2(async () => {
462739
+ setAwsTestStatus("testing");
462740
+ setAwsTestMessage("Testing AWS credentials...");
462741
+ try {
462742
+ const awsProvider = new AWSBedrockProvider({
462743
+ region: process.env.AWS_REGION || "us-east-1"
462744
+ });
462745
+ const isHealthy = await awsProvider.checkHealth();
462746
+ if (isHealthy) {
462747
+ setAwsTestStatus("success");
462748
+ setAwsTestMessage("\u2713 AWS credentials detected and working!");
462749
+ return true;
462750
+ } else {
462751
+ setAwsTestStatus("error");
462752
+ setAwsTestMessage("\u26A0\uFE0F AWS credentials test failed.");
462753
+ return false;
462754
+ }
462755
+ } catch (error47) {
462756
+ setAwsTestStatus("error");
462757
+ if (error47.name === "CredentialsProviderError" || error47.name === "UnrecognizedClientException") {
462758
+ setAwsTestMessage("\u26A0\uFE0F No AWS credentials found. Please configure manually.");
462759
+ } else if (error47.name === "AccessDeniedException") {
462760
+ setAwsTestMessage("\u2713 AWS credentials found but no Bedrock access. Check IAM permissions.");
462761
+ } else {
462762
+ setAwsTestMessage(`\u26A0\uFE0F AWS test failed: ${error47.message || "Unknown error"}`);
462763
+ }
462764
+ return false;
462765
+ }
462766
+ }, []);
461099
462767
  useEffect8(() => {
461100
462768
  process.stdout.write("\x1B]0;Cletus: Settings\x07");
461101
462769
  return () => {
@@ -461121,6 +462789,11 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461121
462789
  } else if (view === "manage-provider-input") {
461122
462790
  setApiKeyInput("");
461123
462791
  setInputError(null);
462792
+ if (providerKey === "aws") {
462793
+ setAwsTestStatus("idle");
462794
+ setAwsTestMessage("");
462795
+ testAWSCredentials();
462796
+ }
461124
462797
  } else if (view === "change-max-iterations") {
461125
462798
  const current = config3.getData().user.autonomous?.maxIterations ?? AUTONOMOUS.DEFAULT_MAX_ITERATIONS;
461126
462799
  setMaxIterationsInput(current.toString());
@@ -461130,7 +462803,7 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461130
462803
  setTimeoutInput(Math.round(current / AUTONOMOUS.MS_PER_MINUTE).toString());
461131
462804
  setInputError(null);
461132
462805
  }
461133
- }, [view]);
462806
+ }, [view, providerKey, testAWSCredentials]);
461134
462807
  useInput5((input, key) => {
461135
462808
  if (key.escape && view === "add-memory") {
461136
462809
  handleBack();
@@ -461768,11 +463441,13 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461768
463441
  }
461769
463442
  if (view === "manage-provider-input" && providerKey) {
461770
463443
  if (providerKey === "aws") {
461771
- return /* @__PURE__ */ React12.createElement(Box10, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { bold: true, color: "cyan" }, "AWS Bedrock Configuration")), /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, "AWS Bedrock uses credentials from your environment or IAM roles."), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, "Set the following environment variables:"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, " - AWS_REGION (e.g., us-east-1)"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, " - AWS_ACCESS_KEY_ID"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, " - AWS_SECRET_ACCESS_KEY"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, "Or use IAM roles when running on AWS (EC2, ECS, Lambda).")), /* @__PURE__ */ React12.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, null, "Currently configured: ", config3.getData().providers.aws ? "Yes" : "No")), /* @__PURE__ */ React12.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
463444
+ return /* @__PURE__ */ React12.createElement(Box10, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { bold: true, color: "cyan" }, "AWS Bedrock Configuration")), /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, "AWS Bedrock can use credentials from multiple sources:"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, " - Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, " - Shared credentials file (~/.aws/credentials)"), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true }, " - IAM roles (when running on EC2, ECS, Lambda)")), /* @__PURE__ */ React12.createElement(Box10, { marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, null, "Currently configured: ", config3.getData().providers.aws ? "Yes" : "No")), awsTestStatus === "testing" && /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "yellow" }, awsTestMessage)), awsTestStatus === "success" && /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, awsTestMessage)), awsTestStatus === "error" && /* @__PURE__ */ React12.createElement(Box10, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "yellow" }, awsTestMessage)), awsTestStatus !== "testing" && /* @__PURE__ */ React12.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
461772
463445
  SelectInput2,
461773
463446
  {
461774
463447
  items: [
461775
- { label: "Use environment credentials", value: "env" },
463448
+ ...awsTestStatus === "success" || awsTestStatus === "error" ? [{ label: "Enable with auto-detected credentials", value: "auto" }] : [],
463449
+ { label: "Configure with explicit environment variables", value: "env" },
463450
+ { label: "Test credentials again", value: "test" },
461776
463451
  { label: "\u2190 Back", value: "__back__" }
461777
463452
  ],
461778
463453
  onSelect: async (item) => {
@@ -461780,6 +463455,20 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461780
463455
  setView("manage-provider-action");
461781
463456
  return;
461782
463457
  }
463458
+ if (item.value === "test") {
463459
+ await testAWSCredentials();
463460
+ return;
463461
+ }
463462
+ if (item.value === "auto") {
463463
+ await config3.save((data2) => {
463464
+ data2.providers.aws = {
463465
+ region: process.env.AWS_REGION
463466
+ };
463467
+ });
463468
+ setMessage("\u2713 AWS configured with auto-detected credentials!");
463469
+ setView("manage-providers");
463470
+ return;
463471
+ }
461783
463472
  if (item.value === "env") {
461784
463473
  const awsRegion = process.env.AWS_REGION;
461785
463474
  const awsAccessKeyId = process.env.AWS_ACCESS_KEY_ID;
@@ -461794,7 +463483,7 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461794
463483
  }
461795
463484
  };
461796
463485
  });
461797
- setMessage("\u2713 AWS configured with environment credentials!");
463486
+ setMessage("\u2713 AWS configured with explicit environment credentials!");
461798
463487
  } else {
461799
463488
  setMessage("\u26A0\uFE0F AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY not found in environment");
461800
463489
  }