@aeye/cletus 0.1.3 → 0.1.5

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 +2054 -362
  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
  /**
@@ -413252,13 +414667,16 @@ var OpenRouterProvider = class extends OpenAIProvider {
413252
414667
  }
413253
414668
  if (config3.defaultParams) {
413254
414669
  const dp = config3.defaultParams;
413255
- params.provider = {
413256
- allow_fallbacks: dp.providers?.allowFallbacks,
413257
- require_parameters: dp.providers?.requireParameters,
413258
- data_collection: dp.providers?.dataCollection,
413259
- max_price: dp.providers?.maxPrice,
413260
- ...dp.providers
413261
- };
414670
+ if (dp.providers) {
414671
+ const { allowFallbacks, requireParameters, dataCollection, maxPrice, ...provider } = dp.providers;
414672
+ params.provider = {
414673
+ allow_fallbacks: allowFallbacks,
414674
+ require_parameters: requireParameters,
414675
+ data_collection: dataCollection,
414676
+ max_price: maxPrice,
414677
+ ...provider
414678
+ };
414679
+ }
413262
414680
  if (dp.transforms) {
413263
414681
  params.transforms = dp.transforms;
413264
414682
  }
@@ -413688,6 +415106,149 @@ var ReplicateProvider = class {
413688
415106
  var import_client_bedrock = __toESM(require_dist_cjs53(), 1);
413689
415107
  var import_client_bedrock_runtime = __toESM(require_dist_cjs66(), 1);
413690
415108
 
415109
+ // ../aws/src/common.ts
415110
+ function detectAWSFamily(modelId) {
415111
+ if (modelId.startsWith("anthropic.")) return "anthropic";
415112
+ if (modelId.startsWith("meta.")) return "meta";
415113
+ if (modelId.startsWith("mistral.")) return "mistral";
415114
+ if (modelId.startsWith("cohere.")) return "cohere";
415115
+ if (modelId.startsWith("ai21.")) return "ai21";
415116
+ if (modelId.startsWith("amazon.")) return "amazon";
415117
+ if (modelId.startsWith("stability.")) return "stability";
415118
+ return "unknown";
415119
+ }
415120
+ function detectAWSCapabilities(model) {
415121
+ const capabilities = /* @__PURE__ */ new Set();
415122
+ const modelId = model.modelId || "";
415123
+ const family = detectAWSFamily(modelId);
415124
+ if (model.inputModalities?.includes("TEXT") && model.outputModalities?.includes("TEXT")) {
415125
+ if (family === "anthropic" || family === "meta" || family === "mistral" || family === "cohere" || family === "ai21" || family === "amazon" && modelId.includes("text")) {
415126
+ capabilities.add("chat");
415127
+ if (model.responseStreamingSupported) {
415128
+ capabilities.add("streaming");
415129
+ }
415130
+ }
415131
+ }
415132
+ if (model.inputModalities?.includes("TEXT") && model.outputModalities?.includes("IMAGE")) {
415133
+ capabilities.add("image");
415134
+ }
415135
+ if (model.inputModalities?.includes("IMAGE") && model.outputModalities?.includes("TEXT")) {
415136
+ capabilities.add("vision");
415137
+ }
415138
+ if (family === "amazon" && modelId.includes("embed")) {
415139
+ capabilities.add("embedding");
415140
+ }
415141
+ if (family === "cohere" && modelId.includes("embed")) {
415142
+ capabilities.add("embedding");
415143
+ }
415144
+ if (family === "anthropic" && modelId.includes("claude")) {
415145
+ capabilities.add("tools");
415146
+ }
415147
+ return capabilities;
415148
+ }
415149
+ function detectAWSTier(family, modelId) {
415150
+ let tier = "efficient";
415151
+ if (family === "anthropic" && modelId.includes("opus")) {
415152
+ tier = "flagship";
415153
+ } else if (family === "anthropic" && modelId.includes("sonnet")) {
415154
+ tier = "efficient";
415155
+ } else if (family === "anthropic" && modelId.includes("haiku")) {
415156
+ tier = "efficient";
415157
+ } else if (family === "meta" && (modelId.includes("405b") || modelId.includes("90b"))) {
415158
+ tier = "flagship";
415159
+ } else if (family === "meta" && (modelId.includes("70b") || modelId.includes("13b"))) {
415160
+ tier = "efficient";
415161
+ } else if (family === "meta" && (modelId.includes("8b") || modelId.includes("7b") || modelId.includes("3b") || modelId.includes("1b"))) {
415162
+ tier = "efficient";
415163
+ } else if (family === "mistral" && modelId.includes("large")) {
415164
+ tier = "flagship";
415165
+ } else if (family === "mistral" && modelId.includes("mixtral")) {
415166
+ tier = "efficient";
415167
+ } else if (family === "mistral" && modelId.includes("7b")) {
415168
+ tier = "efficient";
415169
+ } else if (family === "cohere" && modelId.includes("plus")) {
415170
+ tier = "flagship";
415171
+ } else {
415172
+ tier = "efficient";
415173
+ }
415174
+ return tier;
415175
+ }
415176
+ function convertAWSModel(model) {
415177
+ const modelId = model.modelId;
415178
+ if (!modelId) return null;
415179
+ const family = detectAWSFamily(modelId);
415180
+ const capabilities = detectAWSCapabilities(model);
415181
+ const tier = detectAWSTier(family, modelId);
415182
+ const metadata = MODEL_METADATA[modelId] || {};
415183
+ return {
415184
+ provider: "aws",
415185
+ id: modelId,
415186
+ name: model.modelName || modelId,
415187
+ capabilities,
415188
+ tier,
415189
+ contextWindow: 0,
415190
+ pricing: {},
415191
+ ...metadata,
415192
+ metadata: {
415193
+ modelArn: model.modelArn,
415194
+ providerName: model.providerName,
415195
+ responseStreamingSupported: model.responseStreamingSupported,
415196
+ customizationsSupported: model.customizationsSupported,
415197
+ inferenceTypesSupported: model.inferenceTypesSupported,
415198
+ inputModalities: model.inputModalities,
415199
+ outputModalities: model.outputModalities
415200
+ }
415201
+ };
415202
+ }
415203
+ var MODEL_METADATA = {
415204
+ // Anthropic Claude Sonnet
415205
+ "anthropic.claude-3-sonnet-20240229-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 4096 },
415206
+ "anthropic.claude-3-5-sonnet-20240620-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415207
+ "anthropic.claude-3-5-sonnet-20241022-v2:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415208
+ "anthropic.claude-3-7-sonnet-20250219-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415209
+ "anthropic.claude-sonnet-4-20250514-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415210
+ "anthropic.claude-sonnet-4-5-20250929-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415211
+ // Anthropic Claude Haiku
415212
+ "anthropic.claude-3-haiku-20240307-v1:0": { pricing: { text: { input: 0.25, output: 1.25 } }, contextWindow: 2e5, maxOutputTokens: 4096 },
415213
+ "anthropic.claude-3-haiku-20240307-v1:0:48k": { pricing: { text: { input: 0.25, output: 1.25 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415214
+ "anthropic.claude-haiku-4-5-20251001-v1:0": { pricing: { text: { input: 1, output: 5 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415215
+ // Anthropic Claude Opus
415216
+ "anthropic.claude-3-opus-20240229-v1:0": { pricing: { text: { input: 15, output: 75 } }, contextWindow: 2e5, maxOutputTokens: 4096 },
415217
+ "anthropic.claude-opus-4-20250514-v1:0": { pricing: { text: { input: 15, output: 75 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415218
+ "anthropic.claude-opus-4-1-20250805-v1:0": { pricing: { text: { input: 15, output: 75 } }, contextWindow: 2e5, maxOutputTokens: 16384 },
415219
+ // Anthropic Claude 2.x
415220
+ "anthropic.claude-v2:1": { pricing: { text: { input: 8, output: 24 } }, contextWindow: 1e5, maxOutputTokens: 4096 },
415221
+ "anthropic.claude-v2": { pricing: { text: { input: 8, output: 24 } }, contextWindow: 1e5, maxOutputTokens: 4096 },
415222
+ "anthropic.claude-instant-v1": { pricing: { text: { input: 0.8, output: 2.4 } }, contextWindow: 1e5, maxOutputTokens: 4096 },
415223
+ // Meta Llama 3.2
415224
+ "meta.llama3-2-1b-instruct-v1:0": { pricing: { text: { input: 0.1, output: 0.1 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415225
+ "meta.llama3-2-3b-instruct-v1:0": { pricing: { text: { input: 0.15, output: 0.15 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415226
+ "meta.llama3-2-11b-instruct-v1:0": { pricing: { text: { input: 0.35, output: 0.35 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415227
+ "meta.llama3-2-90b-instruct-v1:0": { pricing: { text: { input: 2.65, output: 2.65 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415228
+ // Meta Llama 3.1
415229
+ "meta.llama3-1-8b-instruct-v1:0": { pricing: { text: { input: 0.3, output: 0.6 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415230
+ "meta.llama3-1-70b-instruct-v1:0": { pricing: { text: { input: 2.65, output: 3.5 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415231
+ "meta.llama3-1-405b-instruct-v1:0": { pricing: { text: { input: 5.32, output: 16 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415232
+ // Meta Llama 3
415233
+ "meta.llama3-8b-instruct-v1:0": { pricing: { text: { input: 0.3, output: 0.6 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415234
+ "meta.llama3-70b-instruct-v1:0": { pricing: { text: { input: 2.65, output: 3.5 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415235
+ // Meta Llama 2
415236
+ "meta.llama2-13b-chat-v1": { pricing: { text: { input: 0.75, output: 1 } }, contextWindow: 128e3, maxOutputTokens: 4096 },
415237
+ "meta.llama2-70b-chat-v1": { pricing: { text: { input: 1.95, output: 2.56 } }, contextWindow: 128e3, maxOutputTokens: 4096 },
415238
+ // Mistral AI
415239
+ "mistral.mistral-7b-instruct-v0:2": { pricing: { text: { input: 0.15, output: 0.2 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415240
+ "mistral.mixtral-8x7b-instruct-v0:1": { pricing: { text: { input: 0.45, output: 0.7 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415241
+ "mistral.mistral-large-2402-v1:0": { pricing: { text: { input: 4, output: 12 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415242
+ "mistral.mistral-large-2407-v1:0": { pricing: { text: { input: 3, output: 9 } }, contextWindow: 2e5, maxOutputTokens: 8192 },
415243
+ // Cohere
415244
+ "cohere.command-text-v14": { pricing: { text: { input: 1.5, output: 2 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415245
+ "cohere.command-light-text-v14": { pricing: { text: { input: 0.3, output: 0.6 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415246
+ "cohere.command-r-v1:0": { pricing: { text: { input: 0.5, output: 1.5 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415247
+ "cohere.command-r-plus-v1:0": { pricing: { text: { input: 3, output: 15 } }, contextWindow: 128e3, maxOutputTokens: 2048 },
415248
+ // Amazon Titan Text
415249
+ "amazon.titan-embed-text-v2:0": { pricing: { embeddings: { cost: 0.135 } }, contextWindow: 8e3, maxOutputTokens: 0 }
415250
+ };
415251
+
413691
415252
  // ../aws/src/types.ts
413692
415253
  var AWSError = class extends Error {
413693
415254
  constructor(message, cause) {
@@ -413724,7 +415285,7 @@ var AWSContextWindowError = class extends AWSError {
413724
415285
  };
413725
415286
 
413726
415287
  // ../aws/src/aws.ts
413727
- var AWSBedrockProvider = class {
415288
+ var AWSBedrockProvider = class _AWSBedrockProvider {
413728
415289
  name = "aws-bedrock";
413729
415290
  config;
413730
415291
  defaultMetadata;
@@ -413732,72 +415293,28 @@ var AWSBedrockProvider = class {
413732
415293
  bedrockRuntimeClient;
413733
415294
  constructor(config3) {
413734
415295
  this.config = config3;
413735
- const clientConfig = {
413736
- region: config3.region || process.env.AWS_REGION || "us-east-1",
413737
- credentials: config3.credentials
413738
- };
415296
+ const clientConfig = _AWSBedrockProvider.convertConfig(config3);
413739
415297
  this.bedrockClient = new import_client_bedrock.BedrockClient(clientConfig);
413740
415298
  this.bedrockRuntimeClient = new import_client_bedrock_runtime.BedrockRuntimeClient(clientConfig);
413741
415299
  }
413742
- // ============================================================================
413743
- // Model Information & Detection
413744
- // ============================================================================
413745
415300
  /**
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
415301
+ * Convert AWSBedrockConfig to BedrockClientConfig
415302
+ *
415303
+ * @param config
415304
+ * @returns
413760
415305
  */
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
- }
415306
+ static convertConfig(config3) {
415307
+ const clientConfig = {
415308
+ region: config3.region || process.env.AWS_REGION || "us-east-1"
413800
415309
  };
415310
+ if (config3.credentials && config3.credentials.accessKeyId && config3.credentials.secretAccessKey) {
415311
+ clientConfig.credentials = {
415312
+ accessKeyId: config3.credentials.accessKeyId,
415313
+ secretAccessKey: config3.credentials.secretAccessKey,
415314
+ sessionToken: config3.credentials.sessionToken
415315
+ };
415316
+ }
415317
+ return clientConfig;
413801
415318
  }
413802
415319
  // ============================================================================
413803
415320
  // Provider Interface Implementation
@@ -413807,12 +415324,13 @@ var AWSBedrockProvider = class {
413807
415324
  */
413808
415325
  async listModels(config3) {
413809
415326
  try {
415327
+ const client2 = config3 && JSON.stringify(config3) !== JSON.stringify(this.config) ? new import_client_bedrock.BedrockClient(_AWSBedrockProvider.convertConfig(config3)) : this.bedrockClient;
413810
415328
  const command = new import_client_bedrock.ListFoundationModelsCommand({});
413811
- const response = await this.bedrockClient.send(command);
415329
+ const response = await client2.send(command);
413812
415330
  if (!response.modelSummaries) {
413813
415331
  return [];
413814
415332
  }
413815
- return response.modelSummaries.filter((m3) => m3.modelId).map((m3) => this.convertModel(m3));
415333
+ return response.modelSummaries.filter((m3) => m3.modelId).map((m3) => convertAWSModel(m3)).filter((m3) => !!m3);
413816
415334
  } catch (error47) {
413817
415335
  throw new AWSError("Failed to list models", error47);
413818
415336
  }
@@ -413822,8 +415340,9 @@ var AWSBedrockProvider = class {
413822
415340
  */
413823
415341
  async checkHealth(config3) {
413824
415342
  try {
415343
+ const client2 = config3 && JSON.stringify(config3) !== JSON.stringify(this.config) ? new import_client_bedrock.BedrockClient(_AWSBedrockProvider.convertConfig(config3)) : this.bedrockClient;
413825
415344
  const command = new import_client_bedrock.ListFoundationModelsCommand({});
413826
- await this.bedrockClient.send(command);
415345
+ await client2.send(command);
413827
415346
  return true;
413828
415347
  } catch {
413829
415348
  return false;
@@ -413834,18 +415353,20 @@ var AWSBedrockProvider = class {
413834
415353
  */
413835
415354
  createExecutor(config3) {
413836
415355
  const effectiveConfig = { ...this.config, ...config3 };
415356
+ const self2 = this;
413837
415357
  return async (request, ctx, metadata) => {
413838
- const model = getModel(request.model || ctx.metadata?.model || metadata?.model || effectiveConfig.defaultModels?.chat);
413839
- if (!model) {
415358
+ const modelInput = request.model || ctx.metadata?.model || metadata?.model || effectiveConfig.defaultModels?.chat;
415359
+ if (!modelInput) {
413840
415360
  throw new AWSError("Model is required for AWS Bedrock requests");
413841
415361
  }
413842
- const family = this.detectModelFamily(model.id);
415362
+ const model = getModel(modelInput);
415363
+ const family = detectAWSFamily(model.id);
413843
415364
  if (family === "anthropic") {
413844
- return this.executeAnthropicModel(model.id, request, ctx);
415365
+ return self2.executeAnthropicModel(modelInput, request, ctx);
413845
415366
  } else if (family === "meta" || family === "mistral") {
413846
- return this.executeLlamaStyleModel(model.id, request, ctx);
415367
+ return self2.executeLlamaStyleModel(model.id, request, ctx);
413847
415368
  } else if (family === "cohere") {
413848
- return this.executeCohereModel(model.id, request, ctx);
415369
+ return self2.executeCohereModel(model.id, request, ctx);
413849
415370
  } else {
413850
415371
  throw new AWSError(`Unsupported model family: ${family}`);
413851
415372
  }
@@ -413856,18 +415377,19 @@ var AWSBedrockProvider = class {
413856
415377
  */
413857
415378
  createStreamer(config3) {
413858
415379
  const effectiveConfig = { ...this.config, ...config3 };
415380
+ const self2 = this;
413859
415381
  return async function* (request, ctx, metadata) {
413860
415382
  const model = getModel(request.model || ctx.metadata?.model || metadata?.model || effectiveConfig.defaultModels?.chat);
413861
415383
  if (!model) {
413862
415384
  throw new AWSError("Model is required for AWS Bedrock requests");
413863
415385
  }
413864
- const family = this.detectModelFamily(model.id);
415386
+ const family = detectAWSFamily(model.id);
413865
415387
  if (family === "anthropic") {
413866
- yield* this.streamAnthropicModel(model.id, request, ctx);
415388
+ return yield* self2.streamAnthropicModel(model.id, request, ctx);
413867
415389
  } else if (family === "meta" || family === "mistral") {
413868
- yield* this.streamLlamaStyleModel(model.id, request, ctx);
415390
+ return yield* self2.streamLlamaStyleModel(model.id, request, ctx);
413869
415391
  } else if (family === "cohere") {
413870
- yield* this.streamCohereModel(model.id, request, ctx);
415392
+ return yield* self2.streamCohereModel(model.id, request, ctx);
413871
415393
  } else {
413872
415394
  throw new AWSError(`Unsupported model family for streaming: ${family}`);
413873
415395
  }
@@ -413900,23 +415422,36 @@ var AWSBedrockProvider = class {
413900
415422
  }
413901
415423
  return void 0;
413902
415424
  }
413903
- async executeAnthropicModel(modelId, request, ctx) {
415425
+ convertRequestToAnthropic(model, request) {
413904
415426
  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
415427
  const tools = this.convertToolsToAnthropic(request);
413908
415428
  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,
415429
+ const systemMessages = request.messages.filter((m3) => m3.role === "system");
415430
+ const system = systemMessages.length > 0 ? systemMessages.map((m3) => ({
415431
+ type: "text",
415432
+ text: typeof m3.content === "string" ? m3.content : m3.content.map((m4) => m4.content).join("\n")
415433
+ })) : void 0;
415434
+ const modelMax = isModelInfo(model) ? model.maxOutputTokens : void 0;
415435
+ return {
415436
+ anthropic_version: this.config.anthropic?.version ?? "bedrock-2023-05-31",
415437
+ anthropic_beta: this.config.anthropic?.beta,
415438
+ max_tokens: modelMax || 4096,
413912
415439
  messages,
413913
415440
  system,
413914
415441
  temperature: request.temperature,
413915
415442
  top_p: request.topP,
413916
- stop_sequences: request.stop,
415443
+ stop_sequences: request.stop ? Array.isArray(request.stop) ? request.stop : [request.stop] : void 0,
413917
415444
  tools,
413918
- tool_choice
415445
+ tool_choice,
415446
+ metadata: {
415447
+ user_id: request.userKey || void 0
415448
+ },
415449
+ ...request.extra
413919
415450
  };
415451
+ }
415452
+ async executeAnthropicModel(model, request, ctx) {
415453
+ const body = this.convertRequestToAnthropic(model, request);
415454
+ const modelId = getModel(model)?.id || "";
413920
415455
  try {
413921
415456
  const command = new import_client_bedrock_runtime.InvokeModelCommand({
413922
415457
  modelId,
@@ -413928,8 +415463,9 @@ var AWSBedrockProvider = class {
413928
415463
  const response = await this.bedrockRuntimeClient.send(command);
413929
415464
  const responseBody = JSON.parse(new TextDecoder().decode(response.body));
413930
415465
  let content = "";
415466
+ let reasoning = void 0;
413931
415467
  const toolCalls = [];
413932
- if (responseBody.content && Array.isArray(responseBody.content)) {
415468
+ if (responseBody.content) {
413933
415469
  for (const block of responseBody.content) {
413934
415470
  if (block.type === "text") {
413935
415471
  content += block.text;
@@ -413939,14 +415475,17 @@ var AWSBedrockProvider = class {
413939
415475
  name: block.name,
413940
415476
  arguments: JSON.stringify(block.input)
413941
415477
  });
415478
+ } else if (block.type === "thinking") {
415479
+ reasoning = (reasoning || "") + block.thinking;
413942
415480
  }
413943
415481
  }
413944
415482
  }
413945
415483
  const result2 = {
413946
415484
  content,
415485
+ reasoning,
413947
415486
  toolCalls: toolCalls.length > 0 ? toolCalls : void 0,
413948
415487
  finishReason: this.mapAnthropicStopReason(responseBody.stop_reason),
413949
- model: { id: modelId },
415488
+ model,
413950
415489
  usage: {
413951
415490
  text: {
413952
415491
  input: responseBody.usage?.input_tokens ?? -1,
@@ -413961,23 +415500,9 @@ var AWSBedrockProvider = class {
413961
415500
  throw error47;
413962
415501
  }
413963
415502
  }
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
- };
415503
+ async *streamAnthropicModel(model, request, ctx) {
415504
+ const body = this.convertRequestToAnthropic(model, request);
415505
+ const modelId = getModel(model)?.id || "";
413981
415506
  try {
413982
415507
  const command = new import_client_bedrock_runtime.InvokeModelWithResponseStreamCommand({
413983
415508
  modelId,
@@ -413993,105 +415518,129 @@ var AWSBedrockProvider = class {
413993
415518
  let inputTokens = 0;
413994
415519
  let outputTokens = 0;
413995
415520
  let accumulatedContent = "";
415521
+ let accumulatedReasoning = "";
413996
415522
  let finishReason = void 0;
413997
415523
  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
415524
+ try {
415525
+ for await (const event of response.body) {
415526
+ if (event.chunk) {
415527
+ const chunk3 = JSON.parse(new TextDecoder().decode(event.chunk.bytes));
415528
+ if (chunk3.type === "content_block_delta" && chunk3.delta) {
415529
+ switch (chunk3.delta.type) {
415530
+ case "text_delta":
415531
+ accumulatedContent += chunk3.delta.text;
415532
+ yield {
415533
+ content: chunk3.delta.text,
415534
+ finishReason: void 0
415535
+ };
415536
+ break;
415537
+ case "thinking_delta":
415538
+ accumulatedReasoning += chunk3.delta.thinking;
415539
+ yield {
415540
+ reasoning: chunk3.delta.thinking
415541
+ };
415542
+ break;
415543
+ case "input_json_delta":
415544
+ const index = chunk3.index;
415545
+ const toolCall = toolCallsMap.get(index);
415546
+ if (toolCall && chunk3.delta.partial_json) {
415547
+ if (toolCall.arguments === "{}") {
415548
+ toolCall.arguments = "";
415549
+ }
415550
+ toolCall.arguments += chunk3.delta.partial_json;
415551
+ yield {
415552
+ toolCallArguments: {
415553
+ id: toolCall.id,
415554
+ name: toolCall.name,
415555
+ arguments: toolCall.arguments
415556
+ }
415557
+ };
415558
+ }
415559
+ break;
414022
415560
  }
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
- }
415561
+ } else if (chunk3.type === "content_block_start" && chunk3.content_block?.type === "tool_use") {
415562
+ const index = chunk3.index;
415563
+ const toolCall = {
415564
+ id: chunk3.content_block.id,
415565
+ name: chunk3.content_block.name,
415566
+ arguments: chunk3.content_block.input ? JSON.stringify(chunk3.content_block.input) : "",
415567
+ named: true,
415568
+ finished: false
414035
415569
  };
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;
415570
+ toolCallsMap.set(index, toolCall);
414042
415571
  yield {
414043
- toolCall: {
415572
+ toolCallNamed: {
414044
415573
  id: toolCall.id,
414045
415574
  name: toolCall.name,
414046
415575
  arguments: toolCall.arguments
414047
415576
  }
414048
415577
  };
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
415578
+ } else if (chunk3.type === "content_block_stop") {
415579
+ const index = chunk3.index;
415580
+ const toolCall = toolCallsMap.get(index);
415581
+ if (toolCall && !toolCall.finished) {
415582
+ toolCall.finished = true;
415583
+ yield {
415584
+ toolCall: {
415585
+ id: toolCall.id,
415586
+ name: toolCall.name,
415587
+ arguments: toolCall.arguments
414063
415588
  }
414064
- }
414065
- };
415589
+ };
415590
+ }
415591
+ } else if (chunk3.type === "message_start" && chunk3.message?.usage) {
415592
+ inputTokens = chunk3.message.usage.input_tokens || 0;
415593
+ } else if (chunk3.type === "message_delta") {
415594
+ if (chunk3.delta?.stop_reason) {
415595
+ finishReason = this.mapAnthropicStopReason(chunk3.delta.stop_reason);
415596
+ yield {
415597
+ finishReason,
415598
+ usage: {
415599
+ text: {
415600
+ input: chunk3.usage.input_tokens || inputTokens || void 0,
415601
+ output: chunk3.usage.output_tokens || void 0,
415602
+ cached: chunk3.usage.cache_read_input_tokens || void 0
415603
+ }
415604
+ }
415605
+ };
415606
+ }
414066
415607
  }
414067
415608
  }
414068
415609
  }
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
415610
+ } finally {
415611
+ const toolCalls = Array.from(toolCallsMap.values()).map((tc) => ({
415612
+ id: tc.id,
415613
+ name: tc.name,
415614
+ arguments: tc.arguments
415615
+ }));
415616
+ const accumulatedResponse = {
415617
+ content: accumulatedContent,
415618
+ toolCalls: toolCalls.length > 0 ? toolCalls : void 0,
415619
+ finishReason,
415620
+ model,
415621
+ usage: {
415622
+ text: {
415623
+ input: inputTokens,
415624
+ output: outputTokens
415625
+ }
414084
415626
  }
414085
- }
414086
- };
414087
- await this.config.hooks?.chat?.afterRequest?.(request, command, accumulatedResponse, ctx);
415627
+ };
415628
+ await this.config.hooks?.chat?.afterRequest?.(request, command, accumulatedResponse, ctx);
415629
+ }
414088
415630
  } catch (error47) {
414089
415631
  this.handleAWSError(error47);
414090
415632
  throw error47;
414091
415633
  }
414092
415634
  }
414093
415635
  convertMessagesToAnthropic(request) {
414094
- return request.messages.filter((m3) => m3.role !== "system").map((msg) => {
415636
+ const toContent = (part) => {
415637
+ if (typeof part === "string") {
415638
+ return [{ type: "text", text: part }];
415639
+ } else {
415640
+ return part;
415641
+ }
415642
+ };
415643
+ const messages = request.messages.filter((m3) => m3.role !== "system").map((msg) => {
414095
415644
  if (msg.role === "assistant") {
414096
415645
  if (msg.toolCalls && msg.toolCalls.length > 0) {
414097
415646
  const content = [];
@@ -414103,7 +415652,13 @@ var AWSBedrockProvider = class {
414103
415652
  type: "tool_use",
414104
415653
  id: toolCall.id,
414105
415654
  name: toolCall.name,
414106
- input: JSON.parse(toolCall.arguments)
415655
+ input: (() => {
415656
+ try {
415657
+ return JSON.parse(toolCall.arguments);
415658
+ } catch (e3) {
415659
+ return { badArguments: toolCall.arguments };
415660
+ }
415661
+ })()
414107
415662
  });
414108
415663
  }
414109
415664
  return {
@@ -414113,7 +415668,7 @@ var AWSBedrockProvider = class {
414113
415668
  }
414114
415669
  return {
414115
415670
  role: "assistant",
414116
- content: typeof msg.content === "string" ? msg.content : ""
415671
+ content: typeof msg.content === "string" ? msg.content : msg.content.map((m3) => m3.content).join("\n\n")
414117
415672
  };
414118
415673
  } else if (msg.role === "tool") {
414119
415674
  return {
@@ -414147,15 +415702,27 @@ var AWSBedrockProvider = class {
414147
415702
  media_type: match2[1],
414148
415703
  data: match2[2]
414149
415704
  };
415705
+ } else if (part.content.startsWith("http")) {
415706
+ source = {
415707
+ type: "url",
415708
+ url: part.content
415709
+ };
414150
415710
  }
414151
- } else if (part.content.startsWith("http")) {
415711
+ } else {
414152
415712
  source = {
414153
415713
  type: "url",
414154
415714
  url: part.content
414155
415715
  };
414156
415716
  }
415717
+ } else if (part.content instanceof URL) {
415718
+ source = {
415719
+ type: "url",
415720
+ url: part.content.toString()
415721
+ };
415722
+ }
415723
+ if (source) {
415724
+ return { type: "image", source };
414157
415725
  }
414158
- return { type: "image", source };
414159
415726
  }
414160
415727
  return { type: "text", text: "[Unsupported content type]" };
414161
415728
  });
@@ -414167,11 +415734,51 @@ var AWSBedrockProvider = class {
414167
415734
  }
414168
415735
  return {
414169
415736
  role: "user",
414170
- content: ""
415737
+ content: "<unsupported role>"
414171
415738
  };
414172
415739
  });
415740
+ const nonEmptyMessages = messages.filter((m3) => {
415741
+ const contentArray = toContent(m3.content);
415742
+ return contentArray.some((c3) => c3.type === "text" ? c3.text.trim().length > 0 : true);
415743
+ });
415744
+ const joinedMessages = [];
415745
+ let lastMessage = null;
415746
+ for (const msg of nonEmptyMessages) {
415747
+ if (lastMessage && lastMessage.role === msg.role) {
415748
+ const lastContent = toContent(lastMessage.content);
415749
+ const newContent = toContent(msg.content);
415750
+ const allContent = lastContent.concat(newContent);
415751
+ lastMessage.content = allContent;
415752
+ } else {
415753
+ if (lastMessage) {
415754
+ joinedMessages.push(lastMessage);
415755
+ }
415756
+ lastMessage = msg;
415757
+ }
415758
+ }
415759
+ if (lastMessage) {
415760
+ joinedMessages.push(lastMessage);
415761
+ }
415762
+ for (const msg of joinedMessages) {
415763
+ const contentArray = toContent(msg.content);
415764
+ if (contentArray.every((c3) => c3.type === "text")) {
415765
+ msg.content = contentArray.map((c3) => c3.text).join("\n\n");
415766
+ }
415767
+ }
415768
+ if (joinedMessages.length === 0) {
415769
+ if (this.config.anthropic?.emptyMessage) {
415770
+ joinedMessages.push(this.config.anthropic.emptyMessage);
415771
+ } else {
415772
+ joinedMessages.push({
415773
+ role: "user",
415774
+ content: "Perform the requested operation."
415775
+ });
415776
+ }
415777
+ }
415778
+ return joinedMessages;
414173
415779
  }
414174
415780
  mapAnthropicStopReason(reason) {
415781
+ if (!reason) return "stop";
414175
415782
  switch (reason) {
414176
415783
  case "end_turn":
414177
415784
  return "stop";
@@ -448108,8 +449715,8 @@ var ReplicateConfigSchema = external_exports.object({
448108
449715
  var AWSBedrockConfigSchema = external_exports.object({
448109
449716
  region: external_exports.string().optional(),
448110
449717
  credentials: external_exports.object({
448111
- accessKeyId: external_exports.string(),
448112
- secretAccessKey: external_exports.string(),
449718
+ accessKeyId: external_exports.string().optional(),
449719
+ secretAccessKey: external_exports.string().optional(),
448113
449720
  sessionToken: external_exports.string().optional()
448114
449721
  }).optional(),
448115
449722
  modelFamilies: external_exports.record(external_exports.string(), external_exports.object({
@@ -456335,7 +457942,21 @@ ${JSON.stringify(params, null, 2)}`);
456335
457942
  }) } : {},
456336
457943
  // AWS Bedrock
456337
457944
  ...config3.providers.aws ? { aws: new AWSBedrockProvider({
456338
- ...config3.providers.aws
457945
+ ...config3.providers.aws,
457946
+ hooks: {
457947
+ chat: {
457948
+ beforeRequest: (request, params, ctx) => {
457949
+ logger.log(`AWS Chat beforeRequest:
457950
+ ${JSON.stringify(params, null, 2)}`);
457951
+ },
457952
+ afterRequest: (request, response, responseComplete, ctx) => {
457953
+ logger.log(`AWS Chat afterRequest:
457954
+ ${JSON.stringify(response, null, 2)}
457955
+
457956
+ ${JSON.stringify(responseComplete, null, 2)}`);
457957
+ }
457958
+ }
457959
+ }
456339
457960
  }) } : {}
456340
457961
  };
456341
457962
  const jsonReplacer = (_key, value) => {
@@ -456819,7 +458440,7 @@ var MessageDisplay = ({ message, ai, showInput = false, showOutput = false }) =>
456819
458440
  // src/components/ModelSelector.tsx
456820
458441
  import { Box as Box5, Text as Text7, useInput } from "ink";
456821
458442
  import TextInput from "ink-text-input";
456822
- import React7, { useState as useState2, useEffect as useEffect2 } from "react";
458443
+ import React7, { useEffect as useEffect2, useState as useState2 } from "react";
456823
458444
  var ModelSelector = ({
456824
458445
  ai,
456825
458446
  baseMetadata = {},
@@ -457226,7 +458847,7 @@ var ModelSelector = ({
457226
458847
 
457227
458848
  // src/components/OperationApprovalMenu.tsx
457228
458849
  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";
458850
+ import React8, { useEffect as useEffect3, useRef, useState as useState3 } from "react";
457230
458851
  var OperationApprovalMenu = ({
457231
458852
  message,
457232
458853
  ai,
@@ -457246,7 +458867,7 @@ var OperationApprovalMenu = ({
457246
458867
  const [isProcessing, setIsProcessing] = useState3(false);
457247
458868
  const [elapsedTime, setElapsedTime] = useState3(0);
457248
458869
  const [completionResult, setCompletionResult] = useState3(null);
457249
- const startTimeRef = useRef2(0);
458870
+ const startTimeRef = useRef(0);
457250
458871
  const approvableOperations = (message.operations || []).map((op2, idx) => ({ op: op2, idx })).filter(({ op: op2 }) => op2.status === "analyzed");
457251
458872
  const hasMultipleOperations = approvableOperations.length > 1;
457252
458873
  const updateMessageContent = (op2, operationIndex) => {
@@ -458874,6 +460495,9 @@ You can:
458874
460495
  ];
458875
460496
  }
458876
460497
 
460498
+ // markdown:C:\Users\pdiff\Documents\GitHub\aits\packages\cletus\src\tools\ABOUT.md
460499
+ 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";
460500
+
458877
460501
  // src/tools/utility.ts
458878
460502
  function createUtilityTools(ai) {
458879
460503
  const getOperationOutput = ai.tool({
@@ -458904,8 +460528,24 @@ function createUtilityTools(ai) {
458904
460528
  return operation2.message;
458905
460529
  }
458906
460530
  });
460531
+ const about = ai.tool({
460532
+ name: "about",
460533
+ description: "Provides information about Cletus, the @aeye library, and the author",
460534
+ instructions: `Use this tool when users ask about:
460535
+ - What Cletus is or can do
460536
+ - Information about the @aeye library
460537
+ - Who created Cletus
460538
+ - Project background and details
460539
+ - How to get started`,
460540
+ schema: external_exports.object({}),
460541
+ call: async (_3, __, { chatStatus }) => {
460542
+ chatStatus("Retrieving about information...");
460543
+ return ABOUT_default;
460544
+ }
460545
+ });
458907
460546
  return [
458908
- getOperationOutput
460547
+ getOperationOutput,
460548
+ about
458909
460549
  ];
458910
460550
  }
458911
460551
 
@@ -459028,7 +460668,7 @@ Use the 'simulateMode' parameter to override the operation mode for this delegat
459028
460668
  }
459029
460669
  })();
459030
460670
  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.`;
460671
+ 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
460672
  const chatMessage = ctx.chatMessage;
459033
460673
  if (chatMessage) {
459034
460674
  if (!chatMessage.requests) {
@@ -459521,10 +461161,10 @@ async function runChatOrchestrator(options2, onEvent) {
459521
461161
  }
459522
461162
 
459523
461163
  // src/hooks.ts
459524
- import { useCallback, useEffect as useEffect4, useRef as useRef3, useState as useState4 } from "react";
461164
+ import { useCallback, useEffect as useEffect4, useRef as useRef2, useState as useState4 } from "react";
459525
461165
  function useSyncedState(initialValue) {
459526
461166
  const [state2, setState] = useState4(initialValue);
459527
- const stateRef = useRef3(initialValue);
461167
+ const stateRef = useRef2(initialValue);
459528
461168
  const setSyncedState = useCallback((value) => {
459529
461169
  const newValue = typeof value === "function" ? value(stateRef.current) : value;
459530
461170
  stateRef.current = newValue;
@@ -459543,9 +461183,9 @@ function useAdaptiveDebounce(callback, options2 = {}) {
459543
461183
  sampleSize = 10
459544
461184
  } = options2;
459545
461185
  const [delay, setDelay] = useState4(initialDelay);
459546
- const renderTimes = useRef3([]);
459547
- const timeoutRef = useRef3(null);
459548
- const callbackRef = useRef3(callback);
461186
+ const renderTimes = useRef2([]);
461187
+ const timeoutRef = useRef2(null);
461188
+ const callbackRef = useRef2(callback);
459549
461189
  useEffect4(() => {
459550
461190
  callbackRef.current = callback;
459551
461191
  }, [callback]);
@@ -459643,12 +461283,12 @@ var ChatUI = ({ chat, config: config3, messages, onExit, onChatUpdate }) => {
459643
461283
  const [renderKey2, setRenderKey] = useState5(0);
459644
461284
  const [accumulatedUsage, setAccumulatedUsage] = useState5({});
459645
461285
  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));
461286
+ const interceptingRef = useRef3(false);
461287
+ const abortControllerRef = useRef3(void 0);
461288
+ const requestStartTimeRef = useRef3(0);
461289
+ const chatFileRef = useRef3(new ChatFile(chat.id));
461290
+ const transcriptionAbortRef = useRef3(void 0);
461291
+ const firstMessageRef = useRef3(Math.max(0, chatMessages.length - 20));
459652
461292
  const [ai, _3] = useState5(() => createCletusAI(config3));
459653
461293
  const [chatAgent, __] = useState5(() => createChatAgent(ai));
459654
461294
  const addMessage = (message) => {
@@ -461075,7 +462715,7 @@ import React13, { useState as useState9, useEffect as useEffect9 } from "react";
461075
462715
  import { Box as Box10, Text as Text12, useInput as useInput5 } from "ink";
461076
462716
  import SelectInput2 from "ink-select-input";
461077
462717
  import TextInput4 from "ink-text-input";
461078
- import React12, { useState as useState8, useEffect as useEffect8 } from "react";
462718
+ import React12, { useState as useState8, useEffect as useEffect8, useCallback as useCallback2 } from "react";
461079
462719
  import fs9 from "fs/promises";
461080
462720
  var InkSettingsMenu = ({ config: config3, onExit }) => {
461081
462721
  const [view, setView] = useState8("menu");
@@ -461096,6 +462736,37 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461096
462736
  const [maxIterationsInput, setMaxIterationsInput] = useState8("");
461097
462737
  const [timeoutInput, setTimeoutInput] = useState8("");
461098
462738
  const [inputError, setInputError] = useState8(null);
462739
+ const [awsTestStatus, setAwsTestStatus] = useState8("idle");
462740
+ const [awsTestMessage, setAwsTestMessage] = useState8("");
462741
+ const testAWSCredentials = useCallback2(async () => {
462742
+ setAwsTestStatus("testing");
462743
+ setAwsTestMessage("Testing AWS credentials...");
462744
+ try {
462745
+ const awsProvider = new AWSBedrockProvider({
462746
+ region: process.env.AWS_REGION || "us-east-1"
462747
+ });
462748
+ const isHealthy = await awsProvider.checkHealth();
462749
+ if (isHealthy) {
462750
+ setAwsTestStatus("success");
462751
+ setAwsTestMessage("\u2713 AWS credentials detected and working!");
462752
+ return true;
462753
+ } else {
462754
+ setAwsTestStatus("error");
462755
+ setAwsTestMessage("\u26A0\uFE0F AWS credentials test failed.");
462756
+ return false;
462757
+ }
462758
+ } catch (error47) {
462759
+ setAwsTestStatus("error");
462760
+ if (error47.name === "CredentialsProviderError" || error47.name === "UnrecognizedClientException") {
462761
+ setAwsTestMessage("\u26A0\uFE0F No AWS credentials found. Please configure manually.");
462762
+ } else if (error47.name === "AccessDeniedException") {
462763
+ setAwsTestMessage("\u2713 AWS credentials found but no Bedrock access. Check IAM permissions.");
462764
+ } else {
462765
+ setAwsTestMessage(`\u26A0\uFE0F AWS test failed: ${error47.message || "Unknown error"}`);
462766
+ }
462767
+ return false;
462768
+ }
462769
+ }, []);
461099
462770
  useEffect8(() => {
461100
462771
  process.stdout.write("\x1B]0;Cletus: Settings\x07");
461101
462772
  return () => {
@@ -461121,6 +462792,11 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461121
462792
  } else if (view === "manage-provider-input") {
461122
462793
  setApiKeyInput("");
461123
462794
  setInputError(null);
462795
+ if (providerKey === "aws") {
462796
+ setAwsTestStatus("idle");
462797
+ setAwsTestMessage("");
462798
+ testAWSCredentials();
462799
+ }
461124
462800
  } else if (view === "change-max-iterations") {
461125
462801
  const current = config3.getData().user.autonomous?.maxIterations ?? AUTONOMOUS.DEFAULT_MAX_ITERATIONS;
461126
462802
  setMaxIterationsInput(current.toString());
@@ -461130,7 +462806,7 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461130
462806
  setTimeoutInput(Math.round(current / AUTONOMOUS.MS_PER_MINUTE).toString());
461131
462807
  setInputError(null);
461132
462808
  }
461133
- }, [view]);
462809
+ }, [view, providerKey, testAWSCredentials]);
461134
462810
  useInput5((input, key) => {
461135
462811
  if (key.escape && view === "add-memory") {
461136
462812
  handleBack();
@@ -461768,11 +463444,13 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461768
463444
  }
461769
463445
  if (view === "manage-provider-input" && providerKey) {
461770
463446
  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(
463447
+ 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
463448
  SelectInput2,
461773
463449
  {
461774
463450
  items: [
461775
- { label: "Use environment credentials", value: "env" },
463451
+ ...awsTestStatus === "success" || awsTestStatus === "error" ? [{ label: "Enable with auto-detected credentials", value: "auto" }] : [],
463452
+ { label: "Configure with explicit environment variables", value: "env" },
463453
+ { label: "Test credentials again", value: "test" },
461776
463454
  { label: "\u2190 Back", value: "__back__" }
461777
463455
  ],
461778
463456
  onSelect: async (item) => {
@@ -461780,6 +463458,20 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461780
463458
  setView("manage-provider-action");
461781
463459
  return;
461782
463460
  }
463461
+ if (item.value === "test") {
463462
+ await testAWSCredentials();
463463
+ return;
463464
+ }
463465
+ if (item.value === "auto") {
463466
+ await config3.save((data2) => {
463467
+ data2.providers.aws = {
463468
+ region: process.env.AWS_REGION
463469
+ };
463470
+ });
463471
+ setMessage("\u2713 AWS configured with auto-detected credentials!");
463472
+ setView("manage-providers");
463473
+ return;
463474
+ }
461783
463475
  if (item.value === "env") {
461784
463476
  const awsRegion = process.env.AWS_REGION;
461785
463477
  const awsAccessKeyId = process.env.AWS_ACCESS_KEY_ID;
@@ -461794,7 +463486,7 @@ var InkSettingsMenu = ({ config: config3, onExit }) => {
461794
463486
  }
461795
463487
  };
461796
463488
  });
461797
- setMessage("\u2713 AWS configured with environment credentials!");
463489
+ setMessage("\u2713 AWS configured with explicit environment credentials!");
461798
463490
  } else {
461799
463491
  setMessage("\u26A0\uFE0F AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY not found in environment");
461800
463492
  }