@inkeep/agents-core 0.22.0 → 0.22.2

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.cjs CHANGED
@@ -213511,7 +213511,6 @@ var projects = sqliteCore.sqliteTable(
213511
213511
  ...uiProperties,
213512
213512
  models: sqliteCore.text("models", { mode: "json" }).$type(),
213513
213513
  stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
213514
- sandboxConfig: sqliteCore.text("sandbox_config", { mode: "json" }).$type(),
213515
213514
  ...timestamps
213516
213515
  },
213517
213516
  (table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.id] })]
@@ -214367,12 +214366,6 @@ var ProjectModelSchema = zodOpenapi.z.object({
214367
214366
  structuredOutput: ModelSettingsSchema.optional(),
214368
214367
  summarizer: ModelSettingsSchema.optional()
214369
214368
  }).openapi("ProjectModel");
214370
- var SandboxConfigSchema = zodOpenapi.z.object({
214371
- provider: zodOpenapi.z.enum(["vercel", "local"]),
214372
- runtime: zodOpenapi.z.enum(["node22", "typescript"]),
214373
- timeout: zodOpenapi.z.number().min(1e3).max(3e5).optional(),
214374
- vcpus: zodOpenapi.z.number().min(1).max(8).optional()
214375
- }).openapi("SandboxConfig");
214376
214369
  var FunctionToolConfigSchema = zodOpenapi.z.object({
214377
214370
  name: zodOpenapi.z.string(),
214378
214371
  description: zodOpenapi.z.string(),
@@ -214392,15 +214385,9 @@ var SubAgentInsertSchema = drizzleZod.createInsertSchema(subAgents).extend({
214392
214385
  models: ModelSchema.optional()
214393
214386
  });
214394
214387
  var SubAgentUpdateSchema = SubAgentInsertSchema.partial();
214395
- var SubAgentApiSelectSchema = createAgentScopedApiSchema(SubAgentSelectSchema).openapi(
214396
- "SubAgent"
214397
- );
214398
- var SubAgentApiInsertSchema = createAgentScopedApiInsertSchema(
214399
- SubAgentInsertSchema
214400
- ).openapi("SubAgentCreate");
214401
- var SubAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(
214402
- SubAgentUpdateSchema
214403
- ).openapi("SubAgentUpdate");
214388
+ var SubAgentApiSelectSchema = createAgentScopedApiSchema(SubAgentSelectSchema).openapi("SubAgent");
214389
+ var SubAgentApiInsertSchema = createAgentScopedApiInsertSchema(SubAgentInsertSchema).openapi("SubAgentCreate");
214390
+ var SubAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(SubAgentUpdateSchema).openapi("SubAgentUpdate");
214404
214391
  var SubAgentRelationSelectSchema = drizzleZod.createSelectSchema(subAgentRelations);
214405
214392
  var SubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
214406
214393
  id: resourceIdSchema,
@@ -214469,9 +214456,7 @@ var AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi("Agent");
214469
214456
  var AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema).extend({
214470
214457
  id: resourceIdSchema
214471
214458
  }).openapi("AgentCreate");
214472
- var AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi(
214473
- "AgentUpdate"
214474
- );
214459
+ var AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi("AgentUpdate");
214475
214460
  var TaskSelectSchema = drizzleZod.createSelectSchema(tasks);
214476
214461
  var TaskInsertSchema = drizzleZod.createInsertSchema(tasks).extend({
214477
214462
  id: resourceIdSchema,
@@ -214556,15 +214541,9 @@ var ConversationInsertSchema = drizzleZod.createInsertSchema(conversations).exte
214556
214541
  contextConfigId: resourceIdSchema.optional()
214557
214542
  });
214558
214543
  var ConversationUpdateSchema = ConversationInsertSchema.partial();
214559
- var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema).openapi(
214560
- "Conversation"
214561
- );
214562
- var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema).openapi(
214563
- "ConversationCreate"
214564
- );
214565
- var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema).openapi(
214566
- "ConversationUpdate"
214567
- );
214544
+ var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema).openapi("Conversation");
214545
+ var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema).openapi("ConversationCreate");
214546
+ var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema).openapi("ConversationUpdate");
214568
214547
  var MessageSelectSchema = drizzleZod.createSelectSchema(messages);
214569
214548
  var MessageInsertSchema = drizzleZod.createInsertSchema(messages).extend({
214570
214549
  id: resourceIdSchema,
@@ -214573,12 +214552,8 @@ var MessageInsertSchema = drizzleZod.createInsertSchema(messages).extend({
214573
214552
  });
214574
214553
  var MessageUpdateSchema = MessageInsertSchema.partial();
214575
214554
  var MessageApiSelectSchema = createApiSchema(MessageSelectSchema).openapi("Message");
214576
- var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema).openapi(
214577
- "MessageCreate"
214578
- );
214579
- var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema).openapi(
214580
- "MessageUpdate"
214581
- );
214555
+ var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema).openapi("MessageCreate");
214556
+ var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema).openapi("MessageUpdate");
214582
214557
  var ContextCacheSelectSchema = drizzleZod.createSelectSchema(contextCache);
214583
214558
  var ContextCacheInsertSchema = drizzleZod.createInsertSchema(contextCache);
214584
214559
  var ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();
@@ -214594,15 +214569,9 @@ var DataComponentBaseSchema = DataComponentInsertSchema.omit({
214594
214569
  updatedAt: true
214595
214570
  });
214596
214571
  var DataComponentUpdateSchema = DataComponentInsertSchema.partial();
214597
- var DataComponentApiSelectSchema = createApiSchema(
214598
- DataComponentSelectSchema
214599
- ).openapi("DataComponent");
214600
- var DataComponentApiInsertSchema = createApiInsertSchema(
214601
- DataComponentInsertSchema
214602
- ).openapi("DataComponentCreate");
214603
- var DataComponentApiUpdateSchema = createApiUpdateSchema(
214604
- DataComponentUpdateSchema
214605
- ).openapi("DataComponentUpdate");
214572
+ var DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema).openapi("DataComponent");
214573
+ var DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema).openapi("DataComponentCreate");
214574
+ var DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema).openapi("DataComponentUpdate");
214606
214575
  var SubAgentDataComponentSelectSchema = drizzleZod.createSelectSchema(subAgentDataComponents);
214607
214576
  var SubAgentDataComponentInsertSchema = drizzleZod.createInsertSchema(subAgentDataComponents);
214608
214577
  var SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();
@@ -214664,15 +214633,9 @@ var ExternalAgentInsertSchema = drizzleZod.createInsertSchema(externalAgents).ex
214664
214633
  id: resourceIdSchema
214665
214634
  });
214666
214635
  var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
214667
- var ExternalAgentApiSelectSchema = createAgentScopedApiSchema(
214668
- ExternalAgentSelectSchema
214669
- ).openapi("ExternalAgent");
214670
- var ExternalAgentApiInsertSchema = createAgentScopedApiInsertSchema(
214671
- ExternalAgentInsertSchema
214672
- ).openapi("ExternalAgentCreate");
214673
- var ExternalAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(
214674
- ExternalAgentUpdateSchema
214675
- ).openapi("ExternalAgentUpdate");
214636
+ var ExternalAgentApiSelectSchema = createAgentScopedApiSchema(ExternalAgentSelectSchema).openapi("ExternalAgent");
214637
+ var ExternalAgentApiInsertSchema = createAgentScopedApiInsertSchema(ExternalAgentInsertSchema).openapi("ExternalAgentCreate");
214638
+ var ExternalAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(ExternalAgentUpdateSchema).openapi("ExternalAgentUpdate");
214676
214639
  var AllAgentSchema = zodOpenapi.z.discriminatedUnion("type", [
214677
214640
  SubAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("internal") }),
214678
214641
  ExternalAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("external") })
@@ -214735,9 +214698,7 @@ var CredentialReferenceInsertSchema = drizzleZod.createInsertSchema(credentialRe
214735
214698
  retrievalParams: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).nullish()
214736
214699
  });
214737
214700
  var CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
214738
- var CredentialReferenceApiSelectSchema = createApiSchema(
214739
- CredentialReferenceSelectSchema
214740
- ).extend({
214701
+ var CredentialReferenceApiSelectSchema = createApiSchema(CredentialReferenceSelectSchema).extend({
214741
214702
  type: zodOpenapi.z.enum(CredentialStoreType),
214742
214703
  tools: zodOpenapi.z.array(ToolSelectSchema).optional()
214743
214704
  }).openapi("CredentialReference");
@@ -214787,27 +214748,17 @@ var FunctionToolInsertSchema = drizzleZod.createInsertSchema(functionTools).exte
214787
214748
  id: resourceIdSchema
214788
214749
  });
214789
214750
  var FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
214790
- var FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema).openapi(
214791
- "FunctionTool"
214792
- );
214793
- var FunctionToolApiInsertSchema = createAgentScopedApiInsertSchema(
214794
- FunctionToolInsertSchema
214795
- ).openapi("FunctionToolCreate");
214796
- var FunctionToolApiUpdateSchema = createApiUpdateSchema(
214797
- FunctionToolUpdateSchema
214798
- ).openapi("FunctionToolUpdate");
214751
+ var FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema).openapi("FunctionTool");
214752
+ var FunctionToolApiInsertSchema = createAgentScopedApiInsertSchema(FunctionToolInsertSchema).openapi("FunctionToolCreate");
214753
+ var FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema).openapi("FunctionToolUpdate");
214799
214754
  var FunctionSelectSchema = drizzleZod.createSelectSchema(functions);
214800
214755
  var FunctionInsertSchema = drizzleZod.createInsertSchema(functions).extend({
214801
214756
  id: resourceIdSchema
214802
214757
  });
214803
214758
  var FunctionUpdateSchema = FunctionInsertSchema.partial();
214804
214759
  var FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema).openapi("Function");
214805
- var FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema).openapi(
214806
- "FunctionCreate"
214807
- );
214808
- var FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema).openapi(
214809
- "FunctionUpdate"
214810
- );
214760
+ var FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema).openapi("FunctionCreate");
214761
+ var FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema).openapi("FunctionUpdate");
214811
214762
  var FetchConfigSchema = zodOpenapi.z.object({
214812
214763
  url: zodOpenapi.z.string().min(1, "URL is required"),
214813
214764
  method: zodOpenapi.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
@@ -214962,8 +214913,7 @@ var RemovedResponseSchema = zodOpenapi.z.object({
214962
214913
  var ProjectSelectSchema = drizzleZod.createSelectSchema(projects);
214963
214914
  var ProjectInsertSchema = drizzleZod.createInsertSchema(projects).extend({
214964
214915
  models: ProjectModelSchema,
214965
- stopWhen: StopWhenSchema.optional(),
214966
- sandboxConfig: SandboxConfigSchema.optional()
214916
+ stopWhen: StopWhenSchema.optional()
214967
214917
  }).omit({
214968
214918
  createdAt: true,
214969
214919
  updatedAt: true
@@ -215250,7 +215200,6 @@ var ContextConfigBuilder = class {
215250
215200
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
215251
215201
  };
215252
215202
  }
215253
- // Getter methods
215254
215203
  getId() {
215255
215204
  if (!this.config.id) {
215256
215205
  throw new Error("Context config ID is not set");
@@ -215263,7 +215212,6 @@ var ContextConfigBuilder = class {
215263
215212
  getContextVariables() {
215264
215213
  return this.config.contextVariables || {};
215265
215214
  }
215266
- // Builder methods for fluent API
215267
215215
  withHeadersSchema(schema) {
215268
215216
  this.config.headersSchema = schema;
215269
215217
  return this;
@@ -215272,7 +215220,6 @@ var ContextConfigBuilder = class {
215272
215220
  toTemplate(path2) {
215273
215221
  return `{{${path2}}}`;
215274
215222
  }
215275
- // Validation method
215276
215223
  validate() {
215277
215224
  try {
215278
215225
  const contextVariables = this.config.contextVariables || {};
@@ -215300,7 +215247,6 @@ var ContextConfigBuilder = class {
215300
215247
  return { valid: false, errors: ["Unknown validation error"] };
215301
215248
  }
215302
215249
  }
215303
- // Initialize and save to database
215304
215250
  async init() {
215305
215251
  const validation = this.validate();
215306
215252
  if (!validation.valid) {
@@ -215325,7 +215271,6 @@ var ContextConfigBuilder = class {
215325
215271
  throw error;
215326
215272
  }
215327
215273
  }
215328
- // Private method to upsert context config
215329
215274
  async upsertContextConfig() {
215330
215275
  const configData = {
215331
215276
  id: this.getId(),
@@ -215394,7 +215339,6 @@ var ContextConfigBuilder = class {
215394
215339
  throw new Error(`Network error while upserting context config: ${String(error)}`);
215395
215340
  }
215396
215341
  }
215397
- // Helper method to parse error responses
215398
215342
  async parseErrorResponse(response) {
215399
215343
  try {
215400
215344
  const contentType = response.headers?.get("content-type");
@@ -220824,9 +220768,7 @@ var updateFullAgentServerSide = (db, logger14 = defaultLogger) => async (scopes,
220824
220768
  const modelTypes = ["base", "structuredOutput", "summarizer"];
220825
220769
  const cascadedModels = { ...finalModelSettings };
220826
220770
  for (const modelType of modelTypes) {
220827
- if (subAgentModels[modelType]?.model && existingAgentModels?.[modelType]?.model && subAgentModels[modelType].model === existingAgentModels[modelType].model && agentModels[modelType] && // Model name changed
220828
- (agentModels[modelType].model !== existingAgentModels[modelType]?.model || // OR providerOptions changed
220829
- JSON.stringify(agentModels[modelType].providerOptions) !== JSON.stringify(existingAgentModels[modelType]?.providerOptions))) {
220771
+ if (subAgentModels[modelType]?.model && existingAgentModels?.[modelType]?.model && subAgentModels[modelType].model === existingAgentModels[modelType].model && agentModels[modelType] && (agentModels[modelType].model !== existingAgentModels[modelType]?.model || JSON.stringify(agentModels[modelType].providerOptions) !== JSON.stringify(existingAgentModels[modelType]?.providerOptions))) {
220830
220772
  cascadedModels[modelType] = agentModels[modelType];
220831
220773
  logger14.info(
220832
220774
  {
@@ -225346,7 +225288,6 @@ exports.REDUCE_OPERATIONS = REDUCE_OPERATIONS;
225346
225288
  exports.RemovedResponseSchema = RemovedResponseSchema;
225347
225289
  exports.SPAN_KEYS = SPAN_KEYS;
225348
225290
  exports.SPAN_NAMES = SPAN_NAMES;
225349
- exports.SandboxConfigSchema = SandboxConfigSchema;
225350
225291
  exports.SingleResponseSchema = SingleResponseSchema;
225351
225292
  exports.StatusComponentSchema = StatusComponentSchema;
225352
225293
  exports.StatusUpdateSchema = StatusUpdateSchema;