@inkeep/agents-core 0.65.2 → 0.66.1
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/_virtual/rolldown_runtime.js +25 -1
- package/dist/auth/auth.d.ts +6 -6
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/constants/index.d.ts +14 -0
- package/dist/constants/index.js +15 -0
- package/dist/constants/relation-types.d.ts +5 -0
- package/dist/constants/relation-types.js +6 -0
- package/dist/constants/session-events.d.ts +13 -0
- package/dist/constants/session-events.js +14 -0
- package/dist/constants/tool-names.d.ts +7 -0
- package/dist/constants/tool-names.js +8 -0
- package/dist/constants/workflow.d.ts +7 -0
- package/dist/constants/workflow.js +8 -0
- package/dist/data-access/index.d.ts +3 -3
- package/dist/data-access/manage/agentFull.d.ts +7 -10
- package/dist/data-access/manage/agentFull.js +26 -28
- package/dist/data-access/manage/agents.d.ts +10 -10
- package/dist/data-access/manage/artifactComponents.d.ts +6 -6
- package/dist/data-access/manage/contextConfigs.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/functionTools.d.ts +8 -8
- package/dist/data-access/manage/projectFull.d.ts +6 -8
- package/dist/data-access/manage/projectFull.js +18 -18
- package/dist/data-access/manage/skills.d.ts +7 -7
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +14 -14
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +6 -6
- package/dist/data-access/manage/tools.d.ts +18 -18
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +12 -12
- package/dist/data-access/runtime/apps.d.ts +10 -10
- package/dist/data-access/runtime/conversations.d.ts +16 -16
- package/dist/data-access/runtime/feedback.d.ts +2 -2
- package/dist/data-access/runtime/messages.d.ts +3 -3
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/db/manage/manage-schema.d.ts +4 -4
- package/dist/db/runtime/runtime-schema.d.ts +373 -373
- package/dist/dolt/ref-middleware.js +2 -2
- package/dist/index.d.ts +7 -3
- package/dist/index.js +5 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +77 -0
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +1356 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1119 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +982 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +3 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +1821 -0
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +171 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +124 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +1334 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +105 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +118 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +455 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +168 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3087 -0
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +384 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +8 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +81 -0
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +51 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +81 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +9 -0
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +125 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +50 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +48 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +2613 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.js +3 -0
- package/dist/test-utils/mocks/index.d.ts +2 -0
- package/dist/test-utils/mocks/index.js +3 -0
- package/dist/test-utils/mocks/logger.d.ts +27 -0
- package/dist/test-utils/mocks/logger.js +48 -0
- package/dist/utils/jwt-helpers.js +1 -1
- package/dist/utils/third-party-mcp-servers/composio-client.js +10 -10
- package/dist/utils/tracer-factory.js +1 -1
- package/dist/validation/schemas/skills.d.ts +51 -51
- package/dist/validation/schemas.d.ts +600 -600
- package/package.json +5 -1
|
@@ -13,8 +13,8 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
13
13
|
tenantId: string;
|
|
14
14
|
projectId: string;
|
|
15
15
|
id: string;
|
|
16
|
-
name: string;
|
|
17
16
|
createdAt: string;
|
|
17
|
+
name: string;
|
|
18
18
|
updatedAt: string;
|
|
19
19
|
description: string | null;
|
|
20
20
|
models: {
|
|
@@ -40,9 +40,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
40
40
|
stopWhen: {
|
|
41
41
|
transferCountIs?: number | undefined;
|
|
42
42
|
} | null;
|
|
43
|
-
prompt: string | null;
|
|
44
43
|
defaultSubAgentId: string | null;
|
|
45
44
|
contextConfigId: string | null;
|
|
45
|
+
prompt: string | null;
|
|
46
46
|
statusUpdates: {
|
|
47
47
|
enabled?: boolean | undefined;
|
|
48
48
|
numEvents?: number | undefined;
|
|
@@ -66,8 +66,8 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
66
66
|
tenantId: string;
|
|
67
67
|
projectId: string;
|
|
68
68
|
id: string;
|
|
69
|
-
name: string;
|
|
70
69
|
createdAt: string;
|
|
70
|
+
name: string;
|
|
71
71
|
updatedAt: string;
|
|
72
72
|
description: string | null;
|
|
73
73
|
models: {
|
|
@@ -93,9 +93,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
93
93
|
stopWhen: {
|
|
94
94
|
transferCountIs?: number | undefined;
|
|
95
95
|
} | null;
|
|
96
|
-
prompt: string | null;
|
|
97
96
|
defaultSubAgentId: string | null;
|
|
98
97
|
contextConfigId: string | null;
|
|
98
|
+
prompt: string | null;
|
|
99
99
|
statusUpdates: {
|
|
100
100
|
enabled?: boolean | undefined;
|
|
101
101
|
numEvents?: number | undefined;
|
|
@@ -115,9 +115,10 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
115
115
|
defaultSubAgent: {
|
|
116
116
|
tenantId: string;
|
|
117
117
|
projectId: string;
|
|
118
|
+
agentId: string;
|
|
118
119
|
id: string;
|
|
119
|
-
name: string;
|
|
120
120
|
createdAt: string;
|
|
121
|
+
name: string;
|
|
121
122
|
updatedAt: string;
|
|
122
123
|
description: string | null;
|
|
123
124
|
models: {
|
|
@@ -143,7 +144,6 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
143
144
|
stopWhen: {
|
|
144
145
|
stepCountIs?: number | undefined;
|
|
145
146
|
} | null;
|
|
146
|
-
agentId: string;
|
|
147
147
|
prompt: string | null;
|
|
148
148
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
149
149
|
} | null;
|
|
@@ -154,8 +154,8 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
154
154
|
tenantId: string;
|
|
155
155
|
projectId: string;
|
|
156
156
|
id: string;
|
|
157
|
-
name: string;
|
|
158
157
|
createdAt: string;
|
|
158
|
+
name: string;
|
|
159
159
|
updatedAt: string;
|
|
160
160
|
description: string | null;
|
|
161
161
|
models: {
|
|
@@ -181,9 +181,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
181
181
|
stopWhen: {
|
|
182
182
|
transferCountIs?: number | undefined;
|
|
183
183
|
} | null;
|
|
184
|
-
prompt: string | null;
|
|
185
184
|
defaultSubAgentId: string | null;
|
|
186
185
|
contextConfigId: string | null;
|
|
186
|
+
prompt: string | null;
|
|
187
187
|
statusUpdates: {
|
|
188
188
|
enabled?: boolean | undefined;
|
|
189
189
|
numEvents?: number | undefined;
|
|
@@ -284,8 +284,8 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
284
284
|
tenantId: string;
|
|
285
285
|
projectId: string;
|
|
286
286
|
id: string;
|
|
287
|
-
name: string;
|
|
288
287
|
createdAt: string;
|
|
288
|
+
name: string;
|
|
289
289
|
updatedAt: string;
|
|
290
290
|
description: string | null;
|
|
291
291
|
models: {
|
|
@@ -311,9 +311,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
311
311
|
stopWhen: {
|
|
312
312
|
transferCountIs?: number | undefined;
|
|
313
313
|
} | null;
|
|
314
|
-
prompt: string | null;
|
|
315
314
|
defaultSubAgentId: string | null;
|
|
316
315
|
contextConfigId: string | null;
|
|
316
|
+
prompt: string | null;
|
|
317
317
|
statusUpdates: {
|
|
318
318
|
enabled?: boolean | undefined;
|
|
319
319
|
numEvents?: number | undefined;
|
|
@@ -12,8 +12,8 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
12
12
|
tenantId: string;
|
|
13
13
|
projectId: string;
|
|
14
14
|
id: string;
|
|
15
|
-
name: string;
|
|
16
15
|
createdAt: string;
|
|
16
|
+
name: string;
|
|
17
17
|
updatedAt: string;
|
|
18
18
|
description: string | null;
|
|
19
19
|
props: {
|
|
@@ -68,8 +68,8 @@ declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (para
|
|
|
68
68
|
tenantId: string;
|
|
69
69
|
projectId: string;
|
|
70
70
|
id: string;
|
|
71
|
-
name: string;
|
|
72
71
|
createdAt: string;
|
|
72
|
+
name: string;
|
|
73
73
|
updatedAt: string;
|
|
74
74
|
description: string | null;
|
|
75
75
|
props: {
|
|
@@ -143,10 +143,10 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
143
143
|
}) => Promise<{
|
|
144
144
|
tenantId: string;
|
|
145
145
|
projectId: string;
|
|
146
|
-
id: string;
|
|
147
|
-
createdAt: string;
|
|
148
146
|
agentId: string;
|
|
149
147
|
subAgentId: string;
|
|
148
|
+
id: string;
|
|
149
|
+
createdAt: string;
|
|
150
150
|
artifactComponentId: string;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -186,10 +186,10 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
186
186
|
}) => Promise<{
|
|
187
187
|
tenantId: string;
|
|
188
188
|
projectId: string;
|
|
189
|
-
id: string;
|
|
190
|
-
createdAt: string;
|
|
191
189
|
agentId: string;
|
|
192
190
|
subAgentId: string;
|
|
191
|
+
id: string;
|
|
192
|
+
createdAt: string;
|
|
193
193
|
artifactComponentId: string;
|
|
194
194
|
} | null>;
|
|
195
195
|
/**
|
|
@@ -11,10 +11,10 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
tenantId: string;
|
|
13
13
|
projectId: string;
|
|
14
|
+
agentId: string;
|
|
14
15
|
id: string;
|
|
15
16
|
createdAt: string;
|
|
16
17
|
updatedAt: string;
|
|
17
|
-
agentId: string;
|
|
18
18
|
headersSchema: unknown;
|
|
19
19
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
20
20
|
} | undefined>;
|
|
@@ -23,10 +23,10 @@ declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
23
23
|
}) => Promise<{
|
|
24
24
|
tenantId: string;
|
|
25
25
|
projectId: string;
|
|
26
|
+
agentId: string;
|
|
26
27
|
id: string;
|
|
27
28
|
createdAt: string;
|
|
28
29
|
updatedAt: string;
|
|
29
|
-
agentId: string;
|
|
30
30
|
headersSchema: unknown;
|
|
31
31
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
32
32
|
}[]>;
|
|
@@ -45,10 +45,10 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
45
45
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
46
46
|
tenantId: string;
|
|
47
47
|
projectId: string;
|
|
48
|
+
agentId: string;
|
|
48
49
|
id: string;
|
|
49
50
|
createdAt: string;
|
|
50
51
|
updatedAt: string;
|
|
51
|
-
agentId: string;
|
|
52
52
|
headersSchema: unknown;
|
|
53
53
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
54
54
|
}>;
|
|
@@ -85,10 +85,10 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
|
|
|
85
85
|
}) => Promise<{
|
|
86
86
|
tenantId: string;
|
|
87
87
|
projectId: string;
|
|
88
|
+
agentId: string;
|
|
88
89
|
id: string;
|
|
89
90
|
createdAt: string;
|
|
90
91
|
updatedAt: string;
|
|
91
|
-
agentId: string;
|
|
92
92
|
headersSchema: unknown;
|
|
93
93
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
94
94
|
}>;
|
|
@@ -67,10 +67,10 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
67
67
|
}) => Promise<{
|
|
68
68
|
tenantId: string;
|
|
69
69
|
projectId: string;
|
|
70
|
-
id: string;
|
|
71
|
-
createdAt: string;
|
|
72
70
|
agentId: string;
|
|
73
71
|
subAgentId: string;
|
|
72
|
+
id: string;
|
|
73
|
+
createdAt: string;
|
|
74
74
|
dataComponentId: string;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
@@ -109,10 +109,10 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
109
109
|
}) => Promise<{
|
|
110
110
|
tenantId: string;
|
|
111
111
|
projectId: string;
|
|
112
|
-
id: string;
|
|
113
|
-
createdAt: string;
|
|
114
112
|
agentId: string;
|
|
115
113
|
subAgentId: string;
|
|
114
|
+
id: string;
|
|
115
|
+
createdAt: string;
|
|
116
116
|
dataComponentId: string;
|
|
117
117
|
} | null>;
|
|
118
118
|
/**
|
|
@@ -55,12 +55,12 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
55
55
|
}) => Promise<{
|
|
56
56
|
tenantId: string;
|
|
57
57
|
projectId: string;
|
|
58
|
+
agentId: string;
|
|
58
59
|
id: string;
|
|
59
|
-
name: string;
|
|
60
60
|
createdAt: string;
|
|
61
|
+
name: string;
|
|
61
62
|
updatedAt: string;
|
|
62
63
|
description: string | null;
|
|
63
|
-
agentId: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -97,12 +97,12 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
97
97
|
}) => Promise<{
|
|
98
98
|
tenantId: string;
|
|
99
99
|
projectId: string;
|
|
100
|
+
agentId: string;
|
|
100
101
|
id: string;
|
|
101
|
-
name: string;
|
|
102
102
|
createdAt: string;
|
|
103
|
+
name: string;
|
|
103
104
|
updatedAt: string;
|
|
104
105
|
description: string | null;
|
|
105
|
-
agentId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -159,11 +159,11 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
159
159
|
}) => Promise<{
|
|
160
160
|
tenantId: string;
|
|
161
161
|
projectId: string;
|
|
162
|
+
agentId: string;
|
|
163
|
+
subAgentId: string;
|
|
162
164
|
id: string;
|
|
163
165
|
createdAt: string;
|
|
164
166
|
updatedAt: string;
|
|
165
|
-
agentId: string;
|
|
166
|
-
subAgentId: string;
|
|
167
167
|
toolPolicies: Record<string, {
|
|
168
168
|
needsApproval?: boolean;
|
|
169
169
|
}> | null;
|
|
@@ -224,11 +224,11 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
224
224
|
}) => Promise<{
|
|
225
225
|
tenantId: string;
|
|
226
226
|
projectId: string;
|
|
227
|
+
agentId: string;
|
|
228
|
+
subAgentId: string;
|
|
227
229
|
id: string;
|
|
228
230
|
createdAt: string;
|
|
229
231
|
updatedAt: string;
|
|
230
|
-
agentId: string;
|
|
231
|
-
subAgentId: string;
|
|
232
232
|
toolPolicies: Record<string, {
|
|
233
233
|
needsApproval?: boolean;
|
|
234
234
|
}> | null;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
|
|
2
2
|
import "../../types/utility.js";
|
|
3
|
-
import { getLogger } from "../../utils/logger.js";
|
|
4
3
|
import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
|
|
5
4
|
import { FullProjectDefinition, FullProjectSelect, FullProjectSelectWithRelationIds } from "../../types/entities.js";
|
|
6
5
|
|
|
7
6
|
//#region src/data-access/manage/projectFull.d.ts
|
|
8
7
|
|
|
9
|
-
type ProjectLogger = ReturnType<typeof getLogger>;
|
|
10
8
|
/**
|
|
11
9
|
* Server-side implementation of createFullProject that performs actual database operations.
|
|
12
10
|
* This function creates a complete project with all agent and their nested resources.
|
|
13
11
|
*/
|
|
14
|
-
declare const createFullProjectServerSide: (db: AgentsManageDatabaseClient
|
|
12
|
+
declare const createFullProjectServerSide: (db: AgentsManageDatabaseClient) => (params: {
|
|
15
13
|
scopes: ProjectScopeConfig;
|
|
16
14
|
projectData: FullProjectDefinition;
|
|
17
15
|
}) => Promise<FullProjectSelect>;
|
|
@@ -19,21 +17,21 @@ declare const createFullProjectServerSide: (db: AgentsManageDatabaseClient, logg
|
|
|
19
17
|
* Server-side implementation of updateFullProject that performs actual database operations.
|
|
20
18
|
* This function updates a complete project with all agent and their nested resources.
|
|
21
19
|
*/
|
|
22
|
-
declare const updateFullProjectServerSide: (db: AgentsManageDatabaseClient
|
|
20
|
+
declare const updateFullProjectServerSide: (db: AgentsManageDatabaseClient) => (params: {
|
|
23
21
|
scopes: ProjectScopeConfig;
|
|
24
22
|
projectData: FullProjectDefinition;
|
|
25
23
|
}) => Promise<FullProjectSelect>;
|
|
26
|
-
declare const getFullProject: (db: AgentsManageDatabaseClient
|
|
24
|
+
declare const getFullProject: (db: AgentsManageDatabaseClient) => (params: {
|
|
27
25
|
scopes: ProjectScopeConfig;
|
|
28
26
|
}) => Promise<FullProjectSelect | null>;
|
|
29
|
-
declare const getFullProjectWithRelationIds: (db: AgentsManageDatabaseClient
|
|
27
|
+
declare const getFullProjectWithRelationIds: (db: AgentsManageDatabaseClient) => (params: {
|
|
30
28
|
scopes: ProjectScopeConfig;
|
|
31
29
|
}) => Promise<FullProjectSelectWithRelationIds | null>;
|
|
32
30
|
/**
|
|
33
31
|
* Delete a complete project and cascade to all related entities
|
|
34
32
|
*/
|
|
35
|
-
declare const deleteFullProject: (db: AgentsManageDatabaseClient
|
|
33
|
+
declare const deleteFullProject: (db: AgentsManageDatabaseClient) => (params: {
|
|
36
34
|
scopes: ProjectScopeConfig;
|
|
37
35
|
}) => Promise<boolean>;
|
|
38
36
|
//#endregion
|
|
39
|
-
export {
|
|
37
|
+
export { createFullProjectServerSide, deleteFullProject, getFullProject, getFullProjectWithRelationIds, updateFullProjectServerSide };
|
|
@@ -11,7 +11,7 @@ import { createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentW
|
|
|
11
11
|
import { createProject, deleteProject, getProject, updateProject } from "./projects.js";
|
|
12
12
|
|
|
13
13
|
//#region src/data-access/manage/projectFull.ts
|
|
14
|
-
const
|
|
14
|
+
const logger = getLogger("projectFull");
|
|
15
15
|
/**
|
|
16
16
|
* Validate and type the project data
|
|
17
17
|
*/
|
|
@@ -22,7 +22,7 @@ function validateAndTypeProjectData(projectData) {
|
|
|
22
22
|
* Server-side implementation of createFullProject that performs actual database operations.
|
|
23
23
|
* This function creates a complete project with all agent and their nested resources.
|
|
24
24
|
*/
|
|
25
|
-
const createFullProjectServerSide = (db
|
|
25
|
+
const createFullProjectServerSide = (db) => async (params) => {
|
|
26
26
|
const { scopes, projectData } = params;
|
|
27
27
|
const { tenantId } = scopes;
|
|
28
28
|
const typed = validateAndTypeProjectData(projectData);
|
|
@@ -306,7 +306,7 @@ const createFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
306
306
|
credentialReferences: typed.credentialReferences || {},
|
|
307
307
|
statusUpdates: agentData.statusUpdates === null ? void 0 : agentData.statusUpdates
|
|
308
308
|
};
|
|
309
|
-
await createFullAgentServerSide(db
|
|
309
|
+
await createFullAgentServerSide(db)({
|
|
310
310
|
tenantId,
|
|
311
311
|
projectId: typed.id
|
|
312
312
|
}, agentDataWithoutSubAgents);
|
|
@@ -349,7 +349,7 @@ const createFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
349
349
|
...agentData,
|
|
350
350
|
subAgents: agentData.subAgents
|
|
351
351
|
};
|
|
352
|
-
await updateFullAgentServerSide(db
|
|
352
|
+
await updateFullAgentServerSide(db)({
|
|
353
353
|
tenantId,
|
|
354
354
|
projectId: typed.id
|
|
355
355
|
}, updateData);
|
|
@@ -380,7 +380,7 @@ const createFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
380
380
|
}, "Phase 2 complete: All sub-agents added successfully");
|
|
381
381
|
}
|
|
382
382
|
logger.info({ projectId: typed.id }, "Full project created successfully");
|
|
383
|
-
const fullProject = await getFullProject(db
|
|
383
|
+
const fullProject = await getFullProject(db)({ scopes: {
|
|
384
384
|
tenantId,
|
|
385
385
|
projectId: typed.id
|
|
386
386
|
} });
|
|
@@ -399,7 +399,7 @@ const createFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
399
399
|
* Server-side implementation of updateFullProject that performs actual database operations.
|
|
400
400
|
* This function updates a complete project with all agent and their nested resources.
|
|
401
401
|
*/
|
|
402
|
-
const updateFullProjectServerSide = (db
|
|
402
|
+
const updateFullProjectServerSide = (db) => async (params) => {
|
|
403
403
|
const { scopes, projectData } = params;
|
|
404
404
|
const { tenantId } = scopes;
|
|
405
405
|
const typed = validateAndTypeProjectData(projectData);
|
|
@@ -415,7 +415,7 @@ const updateFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
415
415
|
projectId: typed.id
|
|
416
416
|
} })) {
|
|
417
417
|
logger.info({ projectId: typed.id }, "Project not found, creating new project");
|
|
418
|
-
return await createFullProjectServerSide(db
|
|
418
|
+
return await createFullProjectServerSide(db)({
|
|
419
419
|
scopes: {
|
|
420
420
|
tenantId,
|
|
421
421
|
projectId: typed.id
|
|
@@ -847,7 +847,7 @@ const updateFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
847
847
|
} });
|
|
848
848
|
let deletedAgentCount = 0;
|
|
849
849
|
for (const agent of existingAgents) if (!incomingAgentIds.has(agent.id)) try {
|
|
850
|
-
await deleteFullAgent(db
|
|
850
|
+
await deleteFullAgent(db)({ scopes: {
|
|
851
851
|
tenantId,
|
|
852
852
|
projectId: typed.id,
|
|
853
853
|
agentId: agent.id
|
|
@@ -885,7 +885,7 @@ const updateFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
885
885
|
credentialReferences: typed.credentialReferences || {},
|
|
886
886
|
statusUpdates: agentData.statusUpdates === null ? void 0 : agentData.statusUpdates
|
|
887
887
|
};
|
|
888
|
-
await updateFullAgentServerSide(db
|
|
888
|
+
await updateFullAgentServerSide(db)({
|
|
889
889
|
tenantId,
|
|
890
890
|
projectId: typed.id
|
|
891
891
|
}, agentDataWithProjectResources);
|
|
@@ -916,7 +916,7 @@ const updateFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
916
916
|
}, "All project agent updated successfully");
|
|
917
917
|
}
|
|
918
918
|
logger.info({ projectId: typed.id }, "Full project updated successfully");
|
|
919
|
-
const fullProject = await getFullProject(db
|
|
919
|
+
const fullProject = await getFullProject(db)({ scopes: {
|
|
920
920
|
tenantId,
|
|
921
921
|
projectId: typed.id
|
|
922
922
|
} });
|
|
@@ -934,7 +934,7 @@ const updateFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
934
934
|
/**
|
|
935
935
|
* Get a complete project definition with all nested resources
|
|
936
936
|
*/
|
|
937
|
-
const getFullProjectInternal = (db
|
|
937
|
+
const getFullProjectInternal = (db) => async (params) => {
|
|
938
938
|
const { scopes, includeRelationIds = false } = params;
|
|
939
939
|
const { tenantId, projectId } = scopes;
|
|
940
940
|
logger.info({
|
|
@@ -1205,16 +1205,16 @@ const getFullProjectInternal = (db, logger = defaultLogger) => async (params) =>
|
|
|
1205
1205
|
throw error;
|
|
1206
1206
|
}
|
|
1207
1207
|
};
|
|
1208
|
-
const getFullProject = (db
|
|
1208
|
+
const getFullProject = (db) => async (params) => {
|
|
1209
1209
|
const { scopes } = params;
|
|
1210
|
-
return getFullProjectInternal(db
|
|
1210
|
+
return getFullProjectInternal(db)({
|
|
1211
1211
|
scopes,
|
|
1212
1212
|
includeRelationIds: false
|
|
1213
1213
|
});
|
|
1214
1214
|
};
|
|
1215
|
-
const getFullProjectWithRelationIds = (db
|
|
1215
|
+
const getFullProjectWithRelationIds = (db) => async (params) => {
|
|
1216
1216
|
const { scopes } = params;
|
|
1217
|
-
return getFullProjectInternal(db
|
|
1217
|
+
return getFullProjectInternal(db)({
|
|
1218
1218
|
scopes,
|
|
1219
1219
|
includeRelationIds: true
|
|
1220
1220
|
});
|
|
@@ -1222,7 +1222,7 @@ const getFullProjectWithRelationIds = (db, logger = defaultLogger) => async (par
|
|
|
1222
1222
|
/**
|
|
1223
1223
|
* Delete a complete project and cascade to all related entities
|
|
1224
1224
|
*/
|
|
1225
|
-
const deleteFullProject = (db
|
|
1225
|
+
const deleteFullProject = (db) => async (params) => {
|
|
1226
1226
|
const { scopes } = params;
|
|
1227
1227
|
const { tenantId, projectId } = scopes;
|
|
1228
1228
|
logger.info({
|
|
@@ -1230,7 +1230,7 @@ const deleteFullProject = (db, logger = defaultLogger) => async (params) => {
|
|
|
1230
1230
|
projectId
|
|
1231
1231
|
}, "Deleting full project and related entities");
|
|
1232
1232
|
try {
|
|
1233
|
-
const project = await getFullProject(db
|
|
1233
|
+
const project = await getFullProject(db)({ scopes: {
|
|
1234
1234
|
tenantId,
|
|
1235
1235
|
projectId
|
|
1236
1236
|
} });
|
|
@@ -1254,7 +1254,7 @@ const deleteFullProject = (db, logger = defaultLogger) => async (params) => {
|
|
|
1254
1254
|
projectId,
|
|
1255
1255
|
agentId
|
|
1256
1256
|
}, "Deleting agent from project");
|
|
1257
|
-
await deleteFullAgent(db
|
|
1257
|
+
await deleteFullAgent(db)({ scopes: {
|
|
1258
1258
|
tenantId,
|
|
1259
1259
|
projectId,
|
|
1260
1260
|
agentId
|
|
@@ -18,12 +18,12 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
18
18
|
tenantId: string;
|
|
19
19
|
projectId: string;
|
|
20
20
|
id: string;
|
|
21
|
-
|
|
21
|
+
content: string;
|
|
22
22
|
createdAt: string;
|
|
23
|
+
name: string;
|
|
23
24
|
updatedAt: string;
|
|
24
25
|
description: string;
|
|
25
26
|
metadata: Record<string, string> | null;
|
|
26
|
-
content: string;
|
|
27
27
|
} | null>;
|
|
28
28
|
declare const getSkillByIdWithFiles: (db: AgentsManageDatabaseClient) => (params: {
|
|
29
29
|
scopes: ProjectScopeConfig;
|
|
@@ -113,12 +113,12 @@ declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiIn
|
|
|
113
113
|
tenantId: string;
|
|
114
114
|
projectId: string;
|
|
115
115
|
id: string;
|
|
116
|
-
|
|
116
|
+
content: string;
|
|
117
117
|
createdAt: string;
|
|
118
|
+
name: string;
|
|
118
119
|
updatedAt: string;
|
|
119
120
|
description: string;
|
|
120
121
|
metadata: Record<string, string> | null;
|
|
121
|
-
content: string;
|
|
122
122
|
}>;
|
|
123
123
|
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
124
124
|
scopes: ProjectScopeConfig;
|
|
@@ -141,14 +141,14 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
141
141
|
}) => Promise<{
|
|
142
142
|
tenantId: string;
|
|
143
143
|
projectId: string;
|
|
144
|
+
agentId: string;
|
|
145
|
+
subAgentId: string;
|
|
144
146
|
id: string;
|
|
147
|
+
skillId: string;
|
|
145
148
|
createdAt: string;
|
|
146
149
|
updatedAt: string;
|
|
147
|
-
agentId: string;
|
|
148
|
-
subAgentId: string;
|
|
149
150
|
index: number;
|
|
150
151
|
alwaysLoaded: boolean;
|
|
151
|
-
skillId: string;
|
|
152
152
|
}>;
|
|
153
153
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
154
154
|
scopes: AgentScopeConfig;
|
|
@@ -11,11 +11,11 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
tenantId: string;
|
|
13
13
|
projectId: string;
|
|
14
|
+
agentId: string;
|
|
15
|
+
subAgentId: string;
|
|
14
16
|
id: string;
|
|
15
17
|
createdAt: string;
|
|
16
18
|
updatedAt: string;
|
|
17
|
-
agentId: string;
|
|
18
|
-
subAgentId: string;
|
|
19
19
|
headers: Record<string, string> | null;
|
|
20
20
|
externalAgentId: string;
|
|
21
21
|
} | undefined>;
|
|
@@ -46,11 +46,11 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
46
46
|
}) => Promise<{
|
|
47
47
|
tenantId: string;
|
|
48
48
|
projectId: string;
|
|
49
|
+
agentId: string;
|
|
50
|
+
subAgentId: string;
|
|
49
51
|
id: string;
|
|
50
52
|
createdAt: string;
|
|
51
53
|
updatedAt: string;
|
|
52
|
-
agentId: string;
|
|
53
|
-
subAgentId: string;
|
|
54
54
|
headers: Record<string, string> | null;
|
|
55
55
|
externalAgentId: string;
|
|
56
56
|
}[]>;
|
|
@@ -59,11 +59,11 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
|
|
|
59
59
|
}) => Promise<{
|
|
60
60
|
tenantId: string;
|
|
61
61
|
projectId: string;
|
|
62
|
+
agentId: string;
|
|
63
|
+
subAgentId: string;
|
|
62
64
|
id: string;
|
|
63
65
|
createdAt: string;
|
|
64
66
|
updatedAt: string;
|
|
65
|
-
agentId: string;
|
|
66
|
-
subAgentId: string;
|
|
67
67
|
headers: Record<string, string> | null;
|
|
68
68
|
externalAgentId: string;
|
|
69
69
|
}[]>;
|
|
@@ -188,11 +188,11 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
188
188
|
}) => Promise<{
|
|
189
189
|
tenantId: string;
|
|
190
190
|
projectId: string;
|
|
191
|
+
agentId: string;
|
|
192
|
+
subAgentId: string;
|
|
191
193
|
id: string;
|
|
192
194
|
createdAt: string;
|
|
193
195
|
updatedAt: string;
|
|
194
|
-
agentId: string;
|
|
195
|
-
subAgentId: string;
|
|
196
196
|
headers: Record<string, string> | null;
|
|
197
197
|
externalAgentId: string;
|
|
198
198
|
}>;
|
|
@@ -205,11 +205,11 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
205
205
|
}) => Promise<{
|
|
206
206
|
tenantId: string;
|
|
207
207
|
projectId: string;
|
|
208
|
+
agentId: string;
|
|
209
|
+
subAgentId: string;
|
|
208
210
|
id: string;
|
|
209
211
|
createdAt: string;
|
|
210
212
|
updatedAt: string;
|
|
211
|
-
agentId: string;
|
|
212
|
-
subAgentId: string;
|
|
213
213
|
headers: Record<string, string> | null;
|
|
214
214
|
externalAgentId: string;
|
|
215
215
|
} | undefined>;
|
|
@@ -226,11 +226,11 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
226
226
|
}) => Promise<{
|
|
227
227
|
tenantId: string;
|
|
228
228
|
projectId: string;
|
|
229
|
+
agentId: string;
|
|
230
|
+
subAgentId: string;
|
|
229
231
|
id: string;
|
|
230
232
|
createdAt: string;
|
|
231
233
|
updatedAt: string;
|
|
232
|
-
agentId: string;
|
|
233
|
-
subAgentId: string;
|
|
234
234
|
headers: Record<string, string> | null;
|
|
235
235
|
externalAgentId: string;
|
|
236
236
|
}>;
|