@inkeep/agents-core 0.0.0-dev-20260121225854 → 0.0.0-dev-20260121234635

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.
@@ -855,31 +855,33 @@ const updateFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
855
855
  triggerCount: Object.keys(typedAgentDefinition.triggers).length
856
856
  }, "All triggers updated successfully");
857
857
  }
858
- const incomingTriggerIds = new Set(typedAgentDefinition.triggers ? Object.keys(typedAgentDefinition.triggers) : []);
859
- const existingTriggers = await listTriggers(db)({ scopes: {
860
- tenantId,
861
- projectId,
862
- agentId: finalAgentId
863
- } });
864
- let deletedTriggerCount = 0;
865
- for (const trigger of existingTriggers) if (!incomingTriggerIds.has(trigger.id)) try {
866
- await deleteTrigger(db)({
867
- scopes: {
868
- tenantId,
869
- projectId,
870
- agentId: finalAgentId
871
- },
872
- triggerId: trigger.id
873
- });
874
- deletedTriggerCount++;
875
- logger.info({ triggerId: trigger.id }, "Deleted orphaned trigger");
876
- } catch (error) {
877
- logger.error({
878
- triggerId: trigger.id,
879
- error
880
- }, "Failed to delete orphaned trigger");
858
+ if (typedAgentDefinition.triggers !== void 0) {
859
+ const incomingTriggerIds = new Set(Object.keys(typedAgentDefinition.triggers));
860
+ const existingTriggers = await listTriggers(db)({ scopes: {
861
+ tenantId,
862
+ projectId,
863
+ agentId: finalAgentId
864
+ } });
865
+ let deletedTriggerCount = 0;
866
+ for (const trigger of existingTriggers) if (!incomingTriggerIds.has(trigger.id)) try {
867
+ await deleteTrigger(db)({
868
+ scopes: {
869
+ tenantId,
870
+ projectId,
871
+ agentId: finalAgentId
872
+ },
873
+ triggerId: trigger.id
874
+ });
875
+ deletedTriggerCount++;
876
+ logger.info({ triggerId: trigger.id }, "Deleted orphaned trigger");
877
+ } catch (error) {
878
+ logger.error({
879
+ triggerId: trigger.id,
880
+ error
881
+ }, "Failed to delete orphaned trigger");
882
+ }
883
+ if (deletedTriggerCount > 0) logger.info({ deletedTriggerCount }, "Deleted orphaned triggers from agent");
881
884
  }
882
- if (deletedTriggerCount > 0) logger.info({ deletedTriggerCount }, "Deleted orphaned triggers from agent");
883
885
  const subAgentPromises = Object.entries(typedAgentDefinition.subAgents).map(async ([subAgentId, agentData$1]) => {
884
886
  const subAgent = agentData$1;
885
887
  let existingSubAgent = null;
@@ -69,8 +69,8 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
69
69
  id: string;
70
70
  agentId: string;
71
71
  createdAt: string;
72
- subAgentId: string;
73
72
  dataComponentId: string;
73
+ subAgentId: string;
74
74
  }>;
75
75
  /**
76
76
  * Remove association between data component and agent
@@ -111,8 +111,8 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
111
111
  id: string;
112
112
  agentId: string;
113
113
  createdAt: string;
114
- subAgentId: string;
115
114
  dataComponentId: string;
115
+ subAgentId: string;
116
116
  } | null>;
117
117
  /**
118
118
  * Count data components for a tenant/project
@@ -25,7 +25,7 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
25
25
  userId: string | null;
26
26
  metadata: ConversationMetadata | null;
27
27
  ref: {
28
- type: "commit" | "tag" | "branch";
28
+ type: "tag" | "commit" | "branch";
29
29
  name: string;
30
30
  hash: string;
31
31
  } | null;
@@ -43,7 +43,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
43
43
  agentId: string | null;
44
44
  activeSubAgentId: string;
45
45
  ref: {
46
- type: "commit" | "tag" | "branch";
46
+ type: "tag" | "commit" | "branch";
47
47
  name: string;
48
48
  hash: string;
49
49
  } | null;
@@ -69,7 +69,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
69
69
  agentId: string | null;
70
70
  activeSubAgentId: string;
71
71
  ref: {
72
- type: "commit" | "tag" | "branch";
72
+ type: "tag" | "commit" | "branch";
73
73
  name: string;
74
74
  hash: string;
75
75
  } | null;
@@ -94,7 +94,7 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
94
94
  userId: string | null;
95
95
  metadata: ConversationMetadata | null;
96
96
  ref: {
97
- type: "commit" | "tag" | "branch";
97
+ type: "tag" | "commit" | "branch";
98
98
  name: string;
99
99
  hash: string;
100
100
  } | null;
@@ -107,7 +107,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
107
107
  tenantId: string;
108
108
  id: string;
109
109
  ref: {
110
- type: "commit" | "tag" | "branch";
110
+ type: "tag" | "commit" | "branch";
111
111
  name: string;
112
112
  hash: string;
113
113
  };
@@ -130,7 +130,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
130
130
  userId: string | null;
131
131
  metadata: ConversationMetadata | null;
132
132
  ref: {
133
- type: "commit" | "tag" | "branch";
133
+ type: "tag" | "commit" | "branch";
134
134
  name: string;
135
135
  hash: string;
136
136
  } | null;
@@ -162,7 +162,7 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
162
162
  userId: string | null;
163
163
  metadata: ConversationMetadata | null;
164
164
  ref: {
165
- type: "commit" | "tag" | "branch";
165
+ type: "tag" | "commit" | "branch";
166
166
  name: string;
167
167
  hash: string;
168
168
  } | null;
@@ -14,7 +14,7 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
14
14
  updatedAt: string;
15
15
  metadata: TaskMetadataConfig | null;
16
16
  ref: {
17
- type: "commit" | "tag" | "branch";
17
+ type: "tag" | "commit" | "branch";
18
18
  name: string;
19
19
  hash: string;
20
20
  } | null;
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
36
36
  updatedAt: string;
37
37
  contextId: string;
38
38
  ref: {
39
- type: "commit" | "tag" | "branch";
39
+ type: "tag" | "commit" | "branch";
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;