@inkeep/agents-core 0.47.4 → 0.48.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/README.md +1 -1
- package/dist/auth/auth-validation-schemas.d.ts +17 -17
- package/dist/auth/auth.d.ts +1 -1
- package/dist/client-exports.d.ts +13 -2
- package/dist/client-exports.js +5 -4
- package/dist/data-access/index.d.ts +6 -1
- package/dist/data-access/index.js +6 -1
- package/dist/data-access/manage/agentFull.js +154 -1
- package/dist/data-access/manage/agents.d.ts +4 -4
- package/dist/data-access/manage/agents.js +56 -4
- package/dist/data-access/manage/artifactComponents.d.ts +41 -5
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +3 -3
- package/dist/data-access/manage/projectFull.js +97 -0
- package/dist/data-access/manage/scheduledTriggers.d.ts +80 -0
- package/dist/data-access/manage/scheduledTriggers.js +76 -0
- package/dist/data-access/manage/scheduledWorkflows.d.ts +29 -0
- package/dist/data-access/manage/scheduledWorkflows.js +32 -0
- package/dist/data-access/manage/skills.d.ts +109 -0
- package/dist/data-access/manage/skills.js +122 -0
- package/dist/data-access/manage/subAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/tools.d.ts +4 -4
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/conversations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +233 -0
- package/dist/data-access/runtime/scheduledTriggerInvocations.js +226 -0
- package/dist/data-access/runtime/tasks.d.ts +2 -2
- package/dist/data-access/runtime/workAppSlack.d.ts +55 -0
- package/dist/data-access/runtime/workAppSlack.js +146 -0
- package/dist/db/manage/manage-schema.d.ts +1440 -510
- package/dist/db/manage/manage-schema.js +240 -15
- package/dist/db/runtime/runtime-schema.d.ts +1236 -234
- package/dist/db/runtime/runtime-schema.js +108 -3
- package/dist/index.d.ts +15 -6
- package/dist/index.js +13 -5
- package/dist/types/entities.d.ts +15 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.ts +5 -2
- package/dist/utils/index.js +5 -2
- package/dist/utils/slack-link-token.d.ts +57 -0
- package/dist/utils/slack-link-token.js +112 -0
- package/dist/utils/slack-user-token.d.ts +65 -0
- package/dist/utils/slack-user-token.js +129 -0
- package/dist/utils/sse-parser.d.ts +35 -0
- package/dist/utils/sse-parser.js +71 -0
- package/dist/utils/tracer-factory.d.ts +11 -2
- package/dist/utils/tracer-factory.js +24 -5
- package/dist/utils/tracer.d.ts +2 -2
- package/dist/utils/tracer.js +2 -2
- package/dist/utils/trigger-auth.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/extend-schemas.d.ts +34 -0
- package/dist/validation/extend-schemas.js +33 -0
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/json-schemas.d.ts +28 -0
- package/dist/validation/json-schemas.js +56 -0
- package/dist/validation/schemas.d.ts +5875 -2585
- package/dist/validation/schemas.js +159 -38
- package/dist/validation/stream-event-schemas.d.ts +0 -2
- package/dist/validation/stream-event-schemas.js +1 -2
- package/drizzle/manage/0007_nice_lilandra.sql +3 -0
- package/drizzle/manage/0008_friendly_mentallo.sql +32 -0
- package/drizzle/manage/0009_chilly_old_lace.sql +39 -0
- package/drizzle/manage/meta/0007_snapshot.json +3148 -0
- package/drizzle/manage/meta/0008_snapshot.json +3391 -0
- package/drizzle/manage/meta/0009_snapshot.json +3670 -0
- package/drizzle/manage/meta/_journal.json +21 -0
- package/drizzle/runtime/0012_greedy_hulk.sql +84 -0
- package/drizzle/runtime/0013_huge_white_queen.sql +19 -0
- package/drizzle/runtime/meta/0007_snapshot.json +1 -1
- package/drizzle/runtime/meta/0012_snapshot.json +3622 -0
- package/drizzle/runtime/meta/0013_snapshot.json +3746 -0
- package/drizzle/runtime/meta/_journal.json +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { AgentScopeConfig, PaginationConfig } from "../../types/utility.js";
|
|
2
|
+
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
3
|
+
import { ScheduledTriggerInvocation, ScheduledTriggerInvocationInsert, ScheduledTriggerInvocationStatus, ScheduledTriggerInvocationUpdate } from "../../validation/schemas.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-access/runtime/scheduledTriggerInvocations.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Get a scheduled trigger invocation by ID (agent-scoped)
|
|
9
|
+
*/
|
|
10
|
+
declare const getScheduledTriggerInvocationById: (db: AgentsRunDatabaseClient) => (params: {
|
|
11
|
+
scopes: AgentScopeConfig;
|
|
12
|
+
scheduledTriggerId: string;
|
|
13
|
+
invocationId: string;
|
|
14
|
+
}) => Promise<ScheduledTriggerInvocation | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Get a scheduled trigger invocation by idempotency key
|
|
17
|
+
* Used to check if an invocation already exists for a given schedule
|
|
18
|
+
*/
|
|
19
|
+
declare const getScheduledTriggerInvocationByIdempotencyKey: (db: AgentsRunDatabaseClient) => (params: {
|
|
20
|
+
idempotencyKey: string;
|
|
21
|
+
}) => Promise<ScheduledTriggerInvocation | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* List scheduled trigger invocations with optional filtering (agent-scoped)
|
|
24
|
+
*/
|
|
25
|
+
declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
26
|
+
scopes: AgentScopeConfig;
|
|
27
|
+
scheduledTriggerId: string;
|
|
28
|
+
pagination?: PaginationConfig;
|
|
29
|
+
filters?: {
|
|
30
|
+
status?: ScheduledTriggerInvocationStatus;
|
|
31
|
+
from?: string;
|
|
32
|
+
to?: string;
|
|
33
|
+
};
|
|
34
|
+
}) => Promise<{
|
|
35
|
+
data: {
|
|
36
|
+
scheduledTriggerId: string;
|
|
37
|
+
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
38
|
+
scheduledFor: string;
|
|
39
|
+
startedAt: string | null;
|
|
40
|
+
completedAt: string | null;
|
|
41
|
+
resolvedPayload: Record<string, unknown> | null;
|
|
42
|
+
conversationIds: string[] | null;
|
|
43
|
+
attemptNumber: number;
|
|
44
|
+
idempotencyKey: string;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
agentId: string;
|
|
47
|
+
projectId: string;
|
|
48
|
+
tenantId: string;
|
|
49
|
+
id: string;
|
|
50
|
+
}[];
|
|
51
|
+
pagination: {
|
|
52
|
+
page: number;
|
|
53
|
+
limit: number;
|
|
54
|
+
total: number;
|
|
55
|
+
pages: number;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* List pending invocations for a trigger, ordered by scheduledFor (earliest first)
|
|
60
|
+
* Used by workflow to get the next invocation to execute
|
|
61
|
+
*/
|
|
62
|
+
declare const listPendingScheduledTriggerInvocations: (db: AgentsRunDatabaseClient) => (params: {
|
|
63
|
+
scopes: AgentScopeConfig;
|
|
64
|
+
scheduledTriggerId: string;
|
|
65
|
+
limit?: number;
|
|
66
|
+
}) => Promise<ScheduledTriggerInvocation[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Delete all pending invocations for a trigger
|
|
69
|
+
* Used when cron expression changes or trigger is disabled
|
|
70
|
+
*/
|
|
71
|
+
declare const deletePendingInvocationsForTrigger: (db: AgentsRunDatabaseClient) => (params: {
|
|
72
|
+
scopes: AgentScopeConfig;
|
|
73
|
+
scheduledTriggerId: string;
|
|
74
|
+
}) => Promise<number>;
|
|
75
|
+
/**
|
|
76
|
+
* Create a new scheduled trigger invocation (agent-scoped)
|
|
77
|
+
*/
|
|
78
|
+
declare const createScheduledTriggerInvocation: (db: AgentsRunDatabaseClient) => (params: ScheduledTriggerInvocationInsert) => Promise<ScheduledTriggerInvocation>;
|
|
79
|
+
/**
|
|
80
|
+
* Update scheduled trigger invocation status (agent-scoped)
|
|
81
|
+
*/
|
|
82
|
+
declare const updateScheduledTriggerInvocationStatus: (db: AgentsRunDatabaseClient) => (params: {
|
|
83
|
+
scopes: AgentScopeConfig;
|
|
84
|
+
scheduledTriggerId: string;
|
|
85
|
+
invocationId: string;
|
|
86
|
+
data: ScheduledTriggerInvocationUpdate;
|
|
87
|
+
}) => Promise<ScheduledTriggerInvocation>;
|
|
88
|
+
/**
|
|
89
|
+
* Mark invocation as running
|
|
90
|
+
*/
|
|
91
|
+
declare const markScheduledTriggerInvocationRunning: (db: AgentsRunDatabaseClient) => (params: {
|
|
92
|
+
scopes: AgentScopeConfig;
|
|
93
|
+
scheduledTriggerId: string;
|
|
94
|
+
invocationId: string;
|
|
95
|
+
}) => Promise<ScheduledTriggerInvocation>;
|
|
96
|
+
/**
|
|
97
|
+
* Mark invocation as completed
|
|
98
|
+
* Note: Will not update if status is already 'cancelled' to respect user cancellation
|
|
99
|
+
*/
|
|
100
|
+
declare const markScheduledTriggerInvocationCompleted: (db: AgentsRunDatabaseClient) => (params: {
|
|
101
|
+
scopes: AgentScopeConfig;
|
|
102
|
+
scheduledTriggerId: string;
|
|
103
|
+
invocationId: string;
|
|
104
|
+
}) => Promise<ScheduledTriggerInvocation | undefined>;
|
|
105
|
+
/**
|
|
106
|
+
* Mark invocation as failed
|
|
107
|
+
* Note: Will not update if status is already 'cancelled' to respect user cancellation
|
|
108
|
+
*/
|
|
109
|
+
declare const markScheduledTriggerInvocationFailed: (db: AgentsRunDatabaseClient) => (params: {
|
|
110
|
+
scopes: AgentScopeConfig;
|
|
111
|
+
scheduledTriggerId: string;
|
|
112
|
+
invocationId: string;
|
|
113
|
+
}) => Promise<ScheduledTriggerInvocation | undefined>;
|
|
114
|
+
/**
|
|
115
|
+
* Add a conversation ID to the invocation's conversationIds array
|
|
116
|
+
* Used to track all conversations created during retries
|
|
117
|
+
*/
|
|
118
|
+
declare const addConversationIdToInvocation: (db: AgentsRunDatabaseClient) => (params: {
|
|
119
|
+
scopes: AgentScopeConfig;
|
|
120
|
+
scheduledTriggerId: string;
|
|
121
|
+
invocationId: string;
|
|
122
|
+
conversationId: string;
|
|
123
|
+
}) => Promise<ScheduledTriggerInvocation | undefined>;
|
|
124
|
+
/**
|
|
125
|
+
* Mark invocation as cancelled
|
|
126
|
+
*/
|
|
127
|
+
declare const markScheduledTriggerInvocationCancelled: (db: AgentsRunDatabaseClient) => (params: {
|
|
128
|
+
scopes: AgentScopeConfig;
|
|
129
|
+
scheduledTriggerId: string;
|
|
130
|
+
invocationId: string;
|
|
131
|
+
}) => Promise<ScheduledTriggerInvocation>;
|
|
132
|
+
/**
|
|
133
|
+
* Cancel all pending invocations for a trigger
|
|
134
|
+
* Used when a trigger is deleted
|
|
135
|
+
*/
|
|
136
|
+
declare const cancelPendingInvocationsForTrigger: (db: AgentsRunDatabaseClient) => (params: {
|
|
137
|
+
scopes: AgentScopeConfig;
|
|
138
|
+
scheduledTriggerId: string;
|
|
139
|
+
}) => Promise<number>;
|
|
140
|
+
/**
|
|
141
|
+
* Cancel only PAST pending invocations for a trigger (scheduledFor <= now)
|
|
142
|
+
* Used when a trigger is disabled - keeps future invocations pending
|
|
143
|
+
*/
|
|
144
|
+
declare const cancelPastPendingInvocationsForTrigger: (db: AgentsRunDatabaseClient) => (params: {
|
|
145
|
+
scopes: AgentScopeConfig;
|
|
146
|
+
scheduledTriggerId: string;
|
|
147
|
+
}) => Promise<number>;
|
|
148
|
+
/**
|
|
149
|
+
* Get run info for multiple scheduled triggers in a single query
|
|
150
|
+
* Returns last run (completed/failed) and next pending run for each trigger
|
|
151
|
+
*/
|
|
152
|
+
declare const getScheduledTriggerRunInfoBatch: (db: AgentsRunDatabaseClient) => (params: {
|
|
153
|
+
scopes: Omit<AgentScopeConfig, "agentId">;
|
|
154
|
+
triggerIds: Array<{
|
|
155
|
+
agentId: string;
|
|
156
|
+
triggerId: string;
|
|
157
|
+
}>;
|
|
158
|
+
}) => Promise<Map<string, {
|
|
159
|
+
lastRunAt: string | null;
|
|
160
|
+
lastRunStatus: "completed" | "failed" | null;
|
|
161
|
+
lastRunConversationIds: string[];
|
|
162
|
+
nextRunAt: string | null;
|
|
163
|
+
}>>;
|
|
164
|
+
/**
|
|
165
|
+
* List upcoming invocations across ALL triggers for an agent with pagination
|
|
166
|
+
* Used for the upcoming runs dashboard with full pagination support
|
|
167
|
+
*/
|
|
168
|
+
declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
169
|
+
scopes: Omit<AgentScopeConfig, "agentId"> & {
|
|
170
|
+
agentId: string;
|
|
171
|
+
};
|
|
172
|
+
pagination?: PaginationConfig;
|
|
173
|
+
includeRunning?: boolean;
|
|
174
|
+
}) => Promise<{
|
|
175
|
+
data: {
|
|
176
|
+
scheduledTriggerId: string;
|
|
177
|
+
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
178
|
+
scheduledFor: string;
|
|
179
|
+
startedAt: string | null;
|
|
180
|
+
completedAt: string | null;
|
|
181
|
+
resolvedPayload: Record<string, unknown> | null;
|
|
182
|
+
conversationIds: string[] | null;
|
|
183
|
+
attemptNumber: number;
|
|
184
|
+
idempotencyKey: string;
|
|
185
|
+
createdAt: string;
|
|
186
|
+
agentId: string;
|
|
187
|
+
projectId: string;
|
|
188
|
+
tenantId: string;
|
|
189
|
+
id: string;
|
|
190
|
+
}[];
|
|
191
|
+
pagination: {
|
|
192
|
+
page: number;
|
|
193
|
+
limit: number;
|
|
194
|
+
total: number;
|
|
195
|
+
pages: number;
|
|
196
|
+
};
|
|
197
|
+
}>;
|
|
198
|
+
/**
|
|
199
|
+
* List all invocations across ALL triggers for a PROJECT with pagination
|
|
200
|
+
* Used for the project-level invocations dashboard
|
|
201
|
+
*/
|
|
202
|
+
declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
203
|
+
scopes: Omit<AgentScopeConfig, "agentId">;
|
|
204
|
+
pagination?: PaginationConfig;
|
|
205
|
+
filters?: {
|
|
206
|
+
status?: ScheduledTriggerInvocationStatus;
|
|
207
|
+
};
|
|
208
|
+
}) => Promise<{
|
|
209
|
+
data: {
|
|
210
|
+
scheduledTriggerId: string;
|
|
211
|
+
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
212
|
+
scheduledFor: string;
|
|
213
|
+
startedAt: string | null;
|
|
214
|
+
completedAt: string | null;
|
|
215
|
+
resolvedPayload: Record<string, unknown> | null;
|
|
216
|
+
conversationIds: string[] | null;
|
|
217
|
+
attemptNumber: number;
|
|
218
|
+
idempotencyKey: string;
|
|
219
|
+
createdAt: string;
|
|
220
|
+
agentId: string;
|
|
221
|
+
projectId: string;
|
|
222
|
+
tenantId: string;
|
|
223
|
+
id: string;
|
|
224
|
+
}[];
|
|
225
|
+
pagination: {
|
|
226
|
+
page: number;
|
|
227
|
+
limit: number;
|
|
228
|
+
total: number;
|
|
229
|
+
pages: number;
|
|
230
|
+
};
|
|
231
|
+
}>;
|
|
232
|
+
//#endregion
|
|
233
|
+
export { addConversationIdToInvocation, cancelPastPendingInvocationsForTrigger, cancelPendingInvocationsForTrigger, createScheduledTriggerInvocation, deletePendingInvocationsForTrigger, getScheduledTriggerInvocationById, getScheduledTriggerInvocationByIdempotencyKey, getScheduledTriggerRunInfoBatch, listPendingScheduledTriggerInvocations, listProjectScheduledTriggerInvocationsPaginated, listScheduledTriggerInvocationsPaginated, listUpcomingInvocationsForAgentPaginated, markScheduledTriggerInvocationCancelled, markScheduledTriggerInvocationCompleted, markScheduledTriggerInvocationFailed, markScheduledTriggerInvocationRunning, updateScheduledTriggerInvocationStatus };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { scheduledTriggerInvocations } from "../../db/runtime/runtime-schema.js";
|
|
2
|
+
import { and, asc, count, desc, eq, gte, inArray, lte, ne, sql } from "drizzle-orm";
|
|
3
|
+
|
|
4
|
+
//#region src/data-access/runtime/scheduledTriggerInvocations.ts
|
|
5
|
+
/**
|
|
6
|
+
* Get a scheduled trigger invocation by ID (agent-scoped)
|
|
7
|
+
*/
|
|
8
|
+
const getScheduledTriggerInvocationById = (db) => async (params) => {
|
|
9
|
+
return await db.query.scheduledTriggerInvocations.findFirst({ where: and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId)) });
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Get a scheduled trigger invocation by idempotency key
|
|
13
|
+
* Used to check if an invocation already exists for a given schedule
|
|
14
|
+
*/
|
|
15
|
+
const getScheduledTriggerInvocationByIdempotencyKey = (db) => async (params) => {
|
|
16
|
+
return await db.query.scheduledTriggerInvocations.findFirst({ where: eq(scheduledTriggerInvocations.idempotencyKey, params.idempotencyKey) });
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* List scheduled trigger invocations with optional filtering (agent-scoped)
|
|
20
|
+
*/
|
|
21
|
+
const listScheduledTriggerInvocationsPaginated = (db) => async (params) => {
|
|
22
|
+
const page = params.pagination?.page || 1;
|
|
23
|
+
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
24
|
+
const offset = (page - 1) * limit;
|
|
25
|
+
const conditions = [
|
|
26
|
+
eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId),
|
|
27
|
+
eq(scheduledTriggerInvocations.projectId, params.scopes.projectId),
|
|
28
|
+
eq(scheduledTriggerInvocations.agentId, params.scopes.agentId),
|
|
29
|
+
eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId)
|
|
30
|
+
];
|
|
31
|
+
if (params.filters?.status) conditions.push(eq(scheduledTriggerInvocations.status, params.filters.status));
|
|
32
|
+
if (params.filters?.from) conditions.push(gte(scheduledTriggerInvocations.scheduledFor, params.filters.from));
|
|
33
|
+
if (params.filters?.to) conditions.push(lte(scheduledTriggerInvocations.scheduledFor, params.filters.to));
|
|
34
|
+
const whereClause = and(...conditions);
|
|
35
|
+
const [data, totalResult] = await Promise.all([db.select().from(scheduledTriggerInvocations).where(whereClause).limit(limit).offset(offset).orderBy(desc(scheduledTriggerInvocations.scheduledFor)), db.select({ count: count() }).from(scheduledTriggerInvocations).where(whereClause)]);
|
|
36
|
+
const total = totalResult[0]?.count || 0;
|
|
37
|
+
return {
|
|
38
|
+
data,
|
|
39
|
+
pagination: {
|
|
40
|
+
page,
|
|
41
|
+
limit,
|
|
42
|
+
total,
|
|
43
|
+
pages: Math.ceil(total / limit)
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* List pending invocations for a trigger, ordered by scheduledFor (earliest first)
|
|
49
|
+
* Used by workflow to get the next invocation to execute
|
|
50
|
+
*/
|
|
51
|
+
const listPendingScheduledTriggerInvocations = (db) => async (params) => {
|
|
52
|
+
const maxLimit = Math.min(params.limit || 10, 100);
|
|
53
|
+
return await db.select().from(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.status, "pending"))).orderBy(asc(scheduledTriggerInvocations.scheduledFor)).limit(maxLimit);
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Delete all pending invocations for a trigger
|
|
57
|
+
* Used when cron expression changes or trigger is disabled
|
|
58
|
+
*/
|
|
59
|
+
const deletePendingInvocationsForTrigger = (db) => async (params) => {
|
|
60
|
+
return (await db.delete(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.status, "pending"))).returning()).length;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Create a new scheduled trigger invocation (agent-scoped)
|
|
64
|
+
*/
|
|
65
|
+
const createScheduledTriggerInvocation = (db) => async (params) => {
|
|
66
|
+
return (await db.insert(scheduledTriggerInvocations).values(params).returning())[0];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Update scheduled trigger invocation status (agent-scoped)
|
|
70
|
+
*/
|
|
71
|
+
const updateScheduledTriggerInvocationStatus = (db) => async (params) => {
|
|
72
|
+
return (await db.update(scheduledTriggerInvocations).set(params.data).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId))).returning())[0];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Mark invocation as running
|
|
76
|
+
*/
|
|
77
|
+
const markScheduledTriggerInvocationRunning = (db) => async (params) => {
|
|
78
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
79
|
+
return (await db.update(scheduledTriggerInvocations).set({
|
|
80
|
+
status: "running",
|
|
81
|
+
startedAt: sql`COALESCE(${scheduledTriggerInvocations.startedAt}, ${now})`
|
|
82
|
+
}).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId))).returning())[0];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Mark invocation as completed
|
|
86
|
+
* Note: Will not update if status is already 'cancelled' to respect user cancellation
|
|
87
|
+
*/
|
|
88
|
+
const markScheduledTriggerInvocationCompleted = (db) => async (params) => {
|
|
89
|
+
return (await db.update(scheduledTriggerInvocations).set({
|
|
90
|
+
status: "completed",
|
|
91
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
92
|
+
}).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId), ne(scheduledTriggerInvocations.status, "cancelled"))).returning())[0];
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Mark invocation as failed
|
|
96
|
+
* Note: Will not update if status is already 'cancelled' to respect user cancellation
|
|
97
|
+
*/
|
|
98
|
+
const markScheduledTriggerInvocationFailed = (db) => async (params) => {
|
|
99
|
+
return (await db.update(scheduledTriggerInvocations).set({
|
|
100
|
+
status: "failed",
|
|
101
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
102
|
+
}).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId), ne(scheduledTriggerInvocations.status, "cancelled"))).returning())[0];
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Add a conversation ID to the invocation's conversationIds array
|
|
106
|
+
* Used to track all conversations created during retries
|
|
107
|
+
*/
|
|
108
|
+
const addConversationIdToInvocation = (db) => async (params) => {
|
|
109
|
+
return (await db.update(scheduledTriggerInvocations).set({ conversationIds: sql`${scheduledTriggerInvocations.conversationIds} || ${JSON.stringify([params.conversationId])}::jsonb` }).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId))).returning())[0];
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Mark invocation as cancelled
|
|
113
|
+
*/
|
|
114
|
+
const markScheduledTriggerInvocationCancelled = (db) => async (params) => {
|
|
115
|
+
return (await db.update(scheduledTriggerInvocations).set({
|
|
116
|
+
status: "cancelled",
|
|
117
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
118
|
+
}).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), eq(scheduledTriggerInvocations.id, params.invocationId))).returning())[0];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Cancel all pending invocations for a trigger
|
|
122
|
+
* Used when a trigger is deleted
|
|
123
|
+
*/
|
|
124
|
+
const cancelPendingInvocationsForTrigger = (db) => async (params) => {
|
|
125
|
+
return (await db.update(scheduledTriggerInvocations).set({
|
|
126
|
+
status: "cancelled",
|
|
127
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
128
|
+
}).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), inArray(scheduledTriggerInvocations.status, ["pending", "running"]))).returning()).length;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Cancel only PAST pending invocations for a trigger (scheduledFor <= now)
|
|
132
|
+
* Used when a trigger is disabled - keeps future invocations pending
|
|
133
|
+
*/
|
|
134
|
+
const cancelPastPendingInvocationsForTrigger = (db) => async (params) => {
|
|
135
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
136
|
+
return (await db.update(scheduledTriggerInvocations).set({
|
|
137
|
+
status: "cancelled",
|
|
138
|
+
completedAt: now
|
|
139
|
+
}).where(and(eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId), eq(scheduledTriggerInvocations.agentId, params.scopes.agentId), eq(scheduledTriggerInvocations.scheduledTriggerId, params.scheduledTriggerId), inArray(scheduledTriggerInvocations.status, ["pending", "running"]), lte(scheduledTriggerInvocations.scheduledFor, now))).returning()).length;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Get run info for multiple scheduled triggers in a single query
|
|
143
|
+
* Returns last run (completed/failed) and next pending run for each trigger
|
|
144
|
+
*/
|
|
145
|
+
const getScheduledTriggerRunInfoBatch = (db) => async (params) => {
|
|
146
|
+
if (params.triggerIds.length === 0) return /* @__PURE__ */ new Map();
|
|
147
|
+
const { tenantId, projectId } = params.scopes;
|
|
148
|
+
const allInvocations = await db.select({
|
|
149
|
+
scheduledTriggerId: scheduledTriggerInvocations.scheduledTriggerId,
|
|
150
|
+
status: scheduledTriggerInvocations.status,
|
|
151
|
+
scheduledFor: scheduledTriggerInvocations.scheduledFor,
|
|
152
|
+
completedAt: scheduledTriggerInvocations.completedAt,
|
|
153
|
+
conversationIds: scheduledTriggerInvocations.conversationIds
|
|
154
|
+
}).from(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, tenantId), eq(scheduledTriggerInvocations.projectId, projectId), inArray(scheduledTriggerInvocations.scheduledTriggerId, params.triggerIds.map((t) => t.triggerId)))).orderBy(desc(scheduledTriggerInvocations.completedAt));
|
|
155
|
+
const result = /* @__PURE__ */ new Map();
|
|
156
|
+
for (const trigger of params.triggerIds) result.set(trigger.triggerId, {
|
|
157
|
+
lastRunAt: null,
|
|
158
|
+
lastRunStatus: null,
|
|
159
|
+
lastRunConversationIds: [],
|
|
160
|
+
nextRunAt: null
|
|
161
|
+
});
|
|
162
|
+
for (const inv of allInvocations) {
|
|
163
|
+
const triggerInfo = result.get(inv.scheduledTriggerId);
|
|
164
|
+
if (!triggerInfo) continue;
|
|
165
|
+
if (inv.status === "pending" && !triggerInfo.nextRunAt) triggerInfo.nextRunAt = inv.scheduledFor;
|
|
166
|
+
if ((inv.status === "completed" || inv.status === "failed") && !triggerInfo.lastRunAt) {
|
|
167
|
+
triggerInfo.lastRunAt = inv.completedAt;
|
|
168
|
+
triggerInfo.lastRunStatus = inv.status;
|
|
169
|
+
triggerInfo.lastRunConversationIds = inv.conversationIds || [];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return result;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* List upcoming invocations across ALL triggers for an agent with pagination
|
|
176
|
+
* Used for the upcoming runs dashboard with full pagination support
|
|
177
|
+
*/
|
|
178
|
+
const listUpcomingInvocationsForAgentPaginated = (db) => async (params) => {
|
|
179
|
+
const page = params.pagination?.page || 1;
|
|
180
|
+
const limit = Math.min(params.pagination?.limit || 20, 100);
|
|
181
|
+
const offset = (page - 1) * limit;
|
|
182
|
+
const statusCondition = params.includeRunning ? inArray(scheduledTriggerInvocations.status, ["pending", "running"]) : eq(scheduledTriggerInvocations.status, "pending");
|
|
183
|
+
const whereClause = and(...[
|
|
184
|
+
eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId),
|
|
185
|
+
eq(scheduledTriggerInvocations.projectId, params.scopes.projectId),
|
|
186
|
+
eq(scheduledTriggerInvocations.agentId, params.scopes.agentId),
|
|
187
|
+
statusCondition
|
|
188
|
+
]);
|
|
189
|
+
const [data, totalResult] = await Promise.all([db.select().from(scheduledTriggerInvocations).where(whereClause).limit(limit).offset(offset).orderBy(asc(scheduledTriggerInvocations.scheduledFor)), db.select({ count: count() }).from(scheduledTriggerInvocations).where(whereClause)]);
|
|
190
|
+
const total = totalResult[0]?.count || 0;
|
|
191
|
+
return {
|
|
192
|
+
data,
|
|
193
|
+
pagination: {
|
|
194
|
+
page,
|
|
195
|
+
limit,
|
|
196
|
+
total,
|
|
197
|
+
pages: Math.ceil(total / limit)
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* List all invocations across ALL triggers for a PROJECT with pagination
|
|
203
|
+
* Used for the project-level invocations dashboard
|
|
204
|
+
*/
|
|
205
|
+
const listProjectScheduledTriggerInvocationsPaginated = (db) => async (params) => {
|
|
206
|
+
const page = params.pagination?.page || 1;
|
|
207
|
+
const limit = Math.min(params.pagination?.limit || 20, 100);
|
|
208
|
+
const offset = (page - 1) * limit;
|
|
209
|
+
const conditions = [eq(scheduledTriggerInvocations.tenantId, params.scopes.tenantId), eq(scheduledTriggerInvocations.projectId, params.scopes.projectId)];
|
|
210
|
+
if (params.filters?.status) conditions.push(eq(scheduledTriggerInvocations.status, params.filters.status));
|
|
211
|
+
const whereClause = and(...conditions);
|
|
212
|
+
const [data, totalResult] = await Promise.all([db.select().from(scheduledTriggerInvocations).where(whereClause).limit(limit).offset(offset).orderBy(desc(scheduledTriggerInvocations.createdAt)), db.select({ count: count() }).from(scheduledTriggerInvocations).where(whereClause)]);
|
|
213
|
+
const total = totalResult[0]?.count || 0;
|
|
214
|
+
return {
|
|
215
|
+
data,
|
|
216
|
+
pagination: {
|
|
217
|
+
page,
|
|
218
|
+
limit,
|
|
219
|
+
total,
|
|
220
|
+
pages: Math.ceil(total / limit)
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
//#endregion
|
|
226
|
+
export { addConversationIdToInvocation, cancelPastPendingInvocationsForTrigger, cancelPendingInvocationsForTrigger, createScheduledTriggerInvocation, deletePendingInvocationsForTrigger, getScheduledTriggerInvocationById, getScheduledTriggerInvocationByIdempotencyKey, getScheduledTriggerRunInfoBatch, listPendingScheduledTriggerInvocations, listProjectScheduledTriggerInvocationsPaginated, listScheduledTriggerInvocationsPaginated, listUpcomingInvocationsForAgentPaginated, markScheduledTriggerInvocationCancelled, markScheduledTriggerInvocationCompleted, markScheduledTriggerInvocationFailed, markScheduledTriggerInvocationRunning, updateScheduledTriggerInvocationStatus };
|
|
@@ -13,14 +13,14 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
|
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
15
|
metadata: TaskMetadataConfig | null;
|
|
16
|
+
status: string;
|
|
17
|
+
subAgentId: string;
|
|
16
18
|
ref: {
|
|
17
19
|
type: "commit" | "tag" | "branch";
|
|
18
20
|
name: string;
|
|
19
21
|
hash: string;
|
|
20
22
|
} | null;
|
|
21
|
-
status: string;
|
|
22
23
|
contextId: string;
|
|
23
|
-
subAgentId: string;
|
|
24
24
|
}>;
|
|
25
25
|
declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
|
|
26
26
|
id: string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { workAppSlackChannelAgentConfigs, workAppSlackUserMappings, workAppSlackWorkspaces } from "../../db/runtime/runtime-schema.js";
|
|
2
|
+
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
3
|
+
|
|
4
|
+
//#region src/data-access/runtime/workAppSlack.d.ts
|
|
5
|
+
type WorkAppSlackWorkspaceInsert = typeof workAppSlackWorkspaces.$inferInsert;
|
|
6
|
+
type WorkAppSlackWorkspaceSelect = typeof workAppSlackWorkspaces.$inferSelect;
|
|
7
|
+
type WorkAppSlackUserMappingInsert = typeof workAppSlackUserMappings.$inferInsert;
|
|
8
|
+
type WorkAppSlackUserMappingSelect = typeof workAppSlackUserMappings.$inferSelect;
|
|
9
|
+
type WorkAppSlackChannelAgentConfigInsert = typeof workAppSlackChannelAgentConfigs.$inferInsert;
|
|
10
|
+
type WorkAppSlackChannelAgentConfigSelect = typeof workAppSlackChannelAgentConfigs.$inferSelect;
|
|
11
|
+
declare const createWorkAppSlackWorkspace: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackWorkspaceInsert, "id" | "createdAt" | "updatedAt">) => Promise<WorkAppSlackWorkspaceSelect>;
|
|
12
|
+
declare const findWorkAppSlackWorkspaceByTeamId: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Find a workspace by Slack team ID only (without tenant filter).
|
|
15
|
+
* Slack team IDs are globally unique, so this is safe for resolving
|
|
16
|
+
* the tenant from an incoming Slack event where tenant is unknown.
|
|
17
|
+
*/
|
|
18
|
+
declare const findWorkAppSlackWorkspaceBySlackTeamId: (db: AgentsRunDatabaseClient) => (slackTeamId: string) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Find a workspace by its Nango connection ID.
|
|
21
|
+
*
|
|
22
|
+
* One Nango connection = one OAuth token = one Slack workspace.
|
|
23
|
+
* The nangoConnectionId should be globally unique (not per-tenant).
|
|
24
|
+
* The schema has a unique constraint on nangoConnectionId ensuring this.
|
|
25
|
+
*/
|
|
26
|
+
declare const findWorkAppSlackWorkspaceByNangoConnectionId: (db: AgentsRunDatabaseClient) => (nangoConnectionId: string) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
27
|
+
declare const listWorkAppSlackWorkspacesByTenant: (db: AgentsRunDatabaseClient) => (tenantId: string) => Promise<WorkAppSlackWorkspaceSelect[]>;
|
|
28
|
+
declare const updateWorkAppSlackWorkspace: (db: AgentsRunDatabaseClient) => (id: string, data: Partial<Pick<WorkAppSlackWorkspaceInsert, "status" | "slackTeamName">>) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
29
|
+
declare const deleteWorkAppSlackWorkspace: (db: AgentsRunDatabaseClient) => (id: string) => Promise<boolean>;
|
|
30
|
+
declare const deleteWorkAppSlackWorkspaceByNangoConnectionId: (db: AgentsRunDatabaseClient) => (nangoConnectionId: string) => Promise<boolean>;
|
|
31
|
+
declare const findWorkAppSlackUserMapping: (db: AgentsRunDatabaseClient) => (tenantId: string, slackUserId: string, slackTeamId: string, clientId?: string) => Promise<WorkAppSlackUserMappingSelect | null>;
|
|
32
|
+
declare const findWorkAppSlackUserMappingByInkeepUserId: (db: AgentsRunDatabaseClient) => (inkeepUserId: string) => Promise<WorkAppSlackUserMappingSelect[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Find a user mapping by Slack user ID and team ID only (ignores tenant).
|
|
35
|
+
* Use this when you need to find the user's tenant from their mapping.
|
|
36
|
+
*/
|
|
37
|
+
declare const findWorkAppSlackUserMappingBySlackUser: (db: AgentsRunDatabaseClient) => (slackUserId: string, slackTeamId: string, clientId?: string) => Promise<WorkAppSlackUserMappingSelect | null>;
|
|
38
|
+
declare const listWorkAppSlackUserMappingsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<WorkAppSlackUserMappingSelect[]>;
|
|
39
|
+
declare const createWorkAppSlackUserMapping: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackUserMappingInsert, "id" | "clientId" | "createdAt" | "updatedAt"> & {
|
|
40
|
+
clientId?: string;
|
|
41
|
+
}) => Promise<WorkAppSlackUserMappingSelect>;
|
|
42
|
+
declare const deleteWorkAppSlackUserMapping: (db: AgentsRunDatabaseClient) => (tenantId: string, slackUserId: string, slackTeamId: string, clientId?: string) => Promise<boolean>;
|
|
43
|
+
declare const deleteAllWorkAppSlackUserMappingsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string, clientId?: string) => Promise<number>;
|
|
44
|
+
declare const createWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackChannelAgentConfigInsert, "id" | "createdAt" | "updatedAt">) => Promise<WorkAppSlackChannelAgentConfigSelect>;
|
|
45
|
+
declare const findWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string, slackChannelId: string) => Promise<WorkAppSlackChannelAgentConfigSelect | null>;
|
|
46
|
+
declare const listWorkAppSlackChannelAgentConfigsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<WorkAppSlackChannelAgentConfigSelect[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Atomic upsert using onConflictDoUpdate to avoid TOCTOU race conditions.
|
|
49
|
+
* Uses the unique constraint on (tenantId, slackTeamId, slackChannelId).
|
|
50
|
+
*/
|
|
51
|
+
declare const upsertWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackChannelAgentConfigInsert, "id" | "createdAt" | "updatedAt">) => Promise<WorkAppSlackChannelAgentConfigSelect>;
|
|
52
|
+
declare const deleteWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string, slackChannelId: string) => Promise<boolean>;
|
|
53
|
+
declare const deleteAllWorkAppSlackChannelAgentConfigsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<number>;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { WorkAppSlackChannelAgentConfigInsert, WorkAppSlackChannelAgentConfigSelect, WorkAppSlackUserMappingInsert, WorkAppSlackUserMappingSelect, WorkAppSlackWorkspaceInsert, WorkAppSlackWorkspaceSelect, createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, updateWorkAppSlackWorkspace, upsertWorkAppSlackChannelAgentConfig };
|