@elevasis/sdk 1.42.0 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1418,6 +1418,18 @@ var ExecutionError2 = class extends Error {
1418
1418
  return false;
1419
1419
  }
1420
1420
  };
1421
+
1422
+ // ../core/src/execution/engine/llm/errors.ts
1423
+ var ModelConfigError = class extends ExecutionError2 {
1424
+ constructor(message, field, model, context) {
1425
+ super(message, { ...context, field, model });
1426
+ this.field = field;
1427
+ this.model = model;
1428
+ }
1429
+ type = "model_config_error";
1430
+ severity = "warning";
1431
+ category = "validation";
1432
+ };
1421
1433
  var GPT5OptionsSchema = z.object({
1422
1434
  reasoning_effort: z.enum(["minimal", "low", "medium", "high"]).optional(),
1423
1435
  verbosity: z.enum(["low", "medium", "high"]).optional()
@@ -1457,19 +1469,6 @@ var OpenRouterConfigSchema = z.object({
1457
1469
  topP: z.number().min(0).max(1).optional(),
1458
1470
  modelOptions: OpenRouterOptionsSchema.optional()
1459
1471
  });
1460
- var GoogleOptionsSchema = z.object({
1461
- /** Thinking level for Gemini 3 models (controls reasoning depth) */
1462
- thinkingLevel: z.enum(["minimal", "low", "medium", "high"]).optional()
1463
- });
1464
- var GoogleConfigSchema = z.object({
1465
- model: z.enum(["gemini-3-flash-preview", "gemini-3.1-flash-lite-preview"]),
1466
- provider: z.literal("google"),
1467
- apiKey: z.string(),
1468
- temperature: z.number().min(0).max(2).optional(),
1469
- maxOutputTokens: z.number().min(500).optional(),
1470
- topP: z.number().min(0).max(1).optional(),
1471
- modelOptions: GoogleOptionsSchema.optional()
1472
- });
1473
1472
  var AnthropicOptionsSchema = z.object({}).strict();
1474
1473
  var AnthropicStandardConfigSchema = z.object({
1475
1474
  model: z.enum(["claude-haiku-4-5-20251001", "claude-haiku-4-5"]),
@@ -1563,31 +1562,6 @@ var MODEL_INFO = {
1563
1562
  category: "standard",
1564
1563
  configSchema: OpenRouterConfigSchema
1565
1564
  },
1566
- // Google Gemini Models (direct SDK access via @google/genai)
1567
- "gemini-3-flash-preview": {
1568
- inputCostPer1M: 50,
1569
- // $0.50 per 1M tokens
1570
- outputCostPer1M: 300,
1571
- // $3.00 per 1M tokens
1572
- minTokens: 4e3,
1573
- recommendedTokens: 8e3,
1574
- maxTokens: 1e6,
1575
- // 1M context window
1576
- category: "standard",
1577
- configSchema: GoogleConfigSchema
1578
- },
1579
- "gemini-3.1-flash-lite-preview": {
1580
- inputCostPer1M: 25,
1581
- // $0.25 per 1M tokens
1582
- outputCostPer1M: 150,
1583
- // $1.50 per 1M tokens
1584
- minTokens: 4e3,
1585
- recommendedTokens: 8e3,
1586
- maxTokens: 1e6,
1587
- // 1M context window
1588
- category: "standard",
1589
- configSchema: GoogleConfigSchema
1590
- },
1591
1565
  // Anthropic Claude Models (direct SDK access via @anthropic-ai/sdk)
1592
1566
  "claude-opus-5": {
1593
1567
  inputCostPer1M: 500,
@@ -1644,29 +1618,18 @@ var MODEL_INFO = {
1644
1618
  configSchema: AnthropicConfigSchema
1645
1619
  }
1646
1620
  };
1621
+ var MODEL_KEYS_BY_SPECIFICITY = Object.keys(MODEL_INFO).sort((a, b) => b.length - a.length);
1647
1622
  function getModelInfo(model) {
1648
1623
  if (model in MODEL_INFO) {
1649
1624
  return MODEL_INFO[model];
1650
1625
  }
1651
- for (const [knownModel, info] of Object.entries(MODEL_INFO)) {
1626
+ for (const knownModel of MODEL_KEYS_BY_SPECIFICITY) {
1652
1627
  if (model.startsWith(knownModel)) {
1653
- return info;
1628
+ return MODEL_INFO[knownModel];
1654
1629
  }
1655
1630
  }
1656
1631
  return void 0;
1657
1632
  }
1658
-
1659
- // ../core/src/execution/engine/llm/errors.ts
1660
- var ModelConfigError = class extends ExecutionError2 {
1661
- constructor(message, field, model, context) {
1662
- super(message, { ...context, field, model });
1663
- this.field = field;
1664
- this.model = model;
1665
- }
1666
- type = "model_config_error";
1667
- severity = "warning";
1668
- category = "validation";
1669
- };
1670
1633
  function validateModelConfig(config) {
1671
1634
  const model = config.model;
1672
1635
  if (!model) {
@@ -5029,7 +4992,6 @@ function serializeDefinition(definition, options) {
5029
4992
  const opts = {
5030
4993
  redactSecrets: true,
5031
4994
  includeToolSchemas: true,
5032
- includeKnowledgeMap: true,
5033
4995
  ...options
5034
4996
  };
5035
4997
  const context = {
@@ -5054,7 +5016,6 @@ function deepSerialize(value, ctx) {
5054
5016
  return value.map((item) => deepSerialize(item, ctx)).filter((item) => item !== void 0);
5055
5017
  }
5056
5018
  if (isToolObject(value)) return serializeTool(value, ctx);
5057
- if (isKnowledgeMapObject(value)) return serializeKnowledgeMap(value, ctx);
5058
5019
  if (isNextConfigObject(value)) return serializeNextConfig(value);
5059
5020
  return serializeObject(value, ctx);
5060
5021
  }
@@ -5090,22 +5051,6 @@ function serializeTool(tool, ctx) {
5090
5051
  }
5091
5052
  return result;
5092
5053
  }
5093
- function serializeKnowledgeMap(km, ctx) {
5094
- if (!ctx.includeKnowledgeMap) return void 0;
5095
- const nodes = km.nodes || {};
5096
- const nodeEntries = Object.entries(nodes).map(([id, node]) => ({
5097
- id,
5098
- description: node.description,
5099
- loaded: node.loaded || false,
5100
- hasPrompt: Boolean(node.prompt)
5101
- // load function automatically omitted
5102
- // prompt content omitted (too large for structure metadata)
5103
- }));
5104
- return {
5105
- nodeCount: nodeEntries.length,
5106
- nodes: nodeEntries
5107
- };
5108
- }
5109
5054
  function serializeNextConfig(nextConfig, _context) {
5110
5055
  if (!nextConfig) return null;
5111
5056
  if (nextConfig.type === StepType2.LINEAR) {
@@ -5162,9 +5107,6 @@ function isZodSchema(value) {
5162
5107
  function isToolObject(value) {
5163
5108
  return value && typeof value === "object" && "name" in value && "description" in value && "execute" in value;
5164
5109
  }
5165
- function isKnowledgeMapObject(value) {
5166
- return value && typeof value === "object" && "nodes" in value && typeof value.nodes === "object";
5167
- }
5168
5110
  function isNextConfigObject(value) {
5169
5111
  return value && typeof value === "object" && "type" in value && (value.type === StepType2.LINEAR || value.type === StepType2.CONDITIONAL);
5170
5112
  }
@@ -5278,7 +5220,6 @@ function serializeOrganization(resources) {
5278
5220
  modelProvider: agent.modelConfig.provider,
5279
5221
  modelId: agent.modelConfig.model,
5280
5222
  toolCount: agent.tools.length,
5281
- hasKnowledgeMap: agent.knowledgeMap !== void 0,
5282
5223
  hasMemory: agent.config.memoryPreferences !== void 0,
5283
5224
  sessionCapable: agent.config.sessionCapable ?? false
5284
5225
  });