@solidstarters/solid-core 1.2.161 → 1.2.163
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/commands/ingest.command.d.ts +16 -0
- package/dist/commands/ingest.command.d.ts.map +1 -0
- package/dist/commands/ingest.command.js +50 -0
- package/dist/commands/ingest.command.js.map +1 -0
- package/dist/commands/refresh-module.command.d.ts.map +1 -1
- package/dist/commands/refresh-module.command.js.map +1 -1
- package/dist/controllers/service.controller.d.ts +16 -1
- package/dist/controllers/service.controller.d.ts.map +1 -1
- package/dist/controllers/service.controller.js +55 -2
- package/dist/controllers/service.controller.js.map +1 -1
- package/dist/controllers/test.controller.d.ts +6 -1
- package/dist/controllers/test.controller.d.ts.map +1 -1
- package/dist/controllers/test.controller.js +21 -3
- package/dist/controllers/test.controller.js.map +1 -1
- package/dist/entities/common.entity.d.ts.map +1 -1
- package/dist/entities/common.entity.js +14 -2
- package/dist/entities/common.entity.js.map +1 -1
- package/dist/entities/user.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.js +11 -1
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/helpers/error-mapper.service.d.ts +8 -0
- package/dist/helpers/error-mapper.service.d.ts.map +1 -0
- package/dist/helpers/error-mapper.service.js +108 -0
- package/dist/helpers/error-mapper.service.js.map +1 -0
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +4 -2
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +21 -0
- package/dist/services/genai/ingest-metadata.service.d.ts +38 -0
- package/dist/services/genai/ingest-metadata.service.d.ts.map +1 -0
- package/dist/services/genai/ingest-metadata.service.js +530 -0
- package/dist/services/genai/ingest-metadata.service.js.map +1 -0
- package/dist/services/genai/r2r-helper.service.d.ts +7 -0
- package/dist/services/genai/r2r-helper.service.d.ts.map +1 -0
- package/dist/services/genai/r2r-helper.service.js +36 -0
- package/dist/services/genai/r2r-helper.service.js.map +1 -0
- package/dist/services/setting.service.d.ts.map +1 -1
- package/dist/services/setting.service.js +38 -20
- package/dist/services/setting.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +8 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/commands/ingest-rag-chunking-strategy-for.md +224 -0
- package/src/commands/ingest.command.ts +36 -0
- package/src/commands/refresh-module.command.ts +0 -1
- package/src/controllers/service.controller.ts +66 -3
- package/src/controllers/test.controller.ts +15 -3
- package/src/entities/common.entity.ts +10 -0
- package/src/entities/user.entity.ts +33 -1
- package/src/helpers/error-mapper.service.ts +214 -0
- package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +4 -2
- package/src/seeders/seed-data/solid-core-metadata.json +21 -0
- package/src/services/genai/ingest-metadata.service.ts +695 -0
- package/src/services/genai/r2r-helper.service.ts +33 -0
- package/src/services/setting.service.ts +46 -22
- package/src/solid-core.module.ts +8 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// src/common/errors/error-mapper.service.ts
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
|
|
4
|
+
export const ERROR_CODES = [
|
|
5
|
+
'bedrock-throttling-error',
|
|
6
|
+
'bedrock-access-denied',
|
|
7
|
+
'bedrock-input-too-long',
|
|
8
|
+
'bedrock-validation-error',
|
|
9
|
+
'bedrock-model-not-found',
|
|
10
|
+
'db-duplicate-key',
|
|
11
|
+
'db-foreign-key-error',
|
|
12
|
+
'metadata-extraction-date-parsing-failed',
|
|
13
|
+
'metadata-extraction-missing-s3-file',
|
|
14
|
+
'solidx-mcp-server-unavailable',
|
|
15
|
+
'unknown-error',
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
export type ErrorCode = typeof ERROR_CODES[number];
|
|
19
|
+
|
|
20
|
+
@Injectable()
|
|
21
|
+
export class ErrorMapperService {
|
|
22
|
+
/**
|
|
23
|
+
* Given an error/exception, return a mapped error code string.
|
|
24
|
+
* Default: "unknown-error"
|
|
25
|
+
*/
|
|
26
|
+
mapException(exc: unknown): ErrorCode {
|
|
27
|
+
const combined = this.combineErrorText(exc);
|
|
28
|
+
|
|
29
|
+
// AiInteraction - mcp server down.
|
|
30
|
+
// {
|
|
31
|
+
// "success": false,
|
|
32
|
+
// "errors": [
|
|
33
|
+
// "unhandled errors in a TaskGroup (1 sub-exception)"
|
|
34
|
+
// ],
|
|
35
|
+
// "error_trace": [
|
|
36
|
+
// "Traceback (most recent call last):",
|
|
37
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/mcp/client/sse.py\", line 47, in sse_client\n async with aconnect_sse(\n ^^^^^^^^^^^^^",
|
|
38
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 210, in __aenter__\n return await anext(self.gen)\n ^^^^^^^^^^^^^^^^^^^^^",
|
|
39
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx_sse/_api.py\", line 69, in aconnect_sse\n async with client.stream(method, url, headers=headers, **kwargs) as response:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
40
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 210, in __aenter__\n return await anext(self.gen)\n ^^^^^^^^^^^^^^^^^^^^^",
|
|
41
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1583, in stream\n response = await self.send(\n ^^^^^^^^^^^^^^^^",
|
|
42
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1629, in send\n response = await self._send_handling_auth(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
43
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1657, in _send_handling_auth\n response = await self._send_handling_redirects(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
44
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1694, in _send_handling_redirects\n response = await self._send_single_request(request)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
45
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1730, in _send_single_request\n response = await transport.handle_async_request(request)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
46
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_transports/default.py\", line 393, in handle_async_request\n with map_httpcore_exceptions():\n ^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
47
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 158, in __exit__\n self.gen.throw(value)",
|
|
48
|
+
// "File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_transports/default.py\", line 118, in map_httpcore_exceptions\n raise mapped_exc(message) from exc",
|
|
49
|
+
// "httpx.ConnectError: All connection attempts failed",
|
|
50
|
+
// "During handling of the above exception, another exception occurred:",
|
|
51
|
+
// "+ Exception Group Traceback (most recent call last):",
|
|
52
|
+
// "| File \"/Users/harishpatel/mcp/clients/solidx_mcp_client/client_sse_nochat.py\", line 239, in main\n | await client.connect_to_sse_server()",
|
|
53
|
+
// "| File \"/Users/harishpatel/mcp/clients/solidx_mcp_client/client_sse_nochat.py\", line 49, in connect_to_sse_server\n | streams = await self._streams_context.__aenter__()\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
54
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 210, in __aenter__\n | return await anext(self.gen)\n | ^^^^^^^^^^^^^^^^^^^^^",
|
|
55
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/mcp/client/sse.py\", line 43, in sse_client\n | async with anyio.create_task_group() as tg:\n | ^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
56
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/anyio/_backends/_asyncio.py\", line 767, in __aexit__\n | raise BaseExceptionGroup(",
|
|
57
|
+
// "| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)",
|
|
58
|
+
// "+-+---------------- 1 ----------------",
|
|
59
|
+
// "| Traceback (most recent call last):",
|
|
60
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_transports/default.py\", line 101, in map_httpcore_exceptions\n | yield",
|
|
61
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_transports/default.py\", line 394, in handle_async_request\n | resp = await self._pool.handle_async_request(req)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
62
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_async/connection_pool.py\", line 256, in handle_async_request\n | raise exc from None",
|
|
63
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_async/connection_pool.py\", line 236, in handle_async_request\n | response = await connection.handle_async_request(\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
64
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_async/connection.py\", line 101, in handle_async_request\n | raise exc",
|
|
65
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_async/connection.py\", line 78, in handle_async_request\n | stream = await self._connect(request)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
66
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_async/connection.py\", line 124, in _connect\n | stream = await self._network_backend.connect_tcp(**kwargs)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
67
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_backends/auto.py\", line 31, in connect_tcp\n | return await self._backend.connect_tcp(\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
68
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_backends/anyio.py\", line 113, in connect_tcp\n | with map_exceptions(exc_map):\n | ^^^^^^^^^^^^^^^^^^^^^^^",
|
|
69
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 158, in __exit__\n | self.gen.throw(value)",
|
|
70
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpcore/_exceptions.py\", line 14, in map_exceptions\n | raise to_exc(exc) from exc",
|
|
71
|
+
// "| httpcore.ConnectError: All connection attempts failed",
|
|
72
|
+
// "| \n | The above exception was the direct cause of the following exception:\n |",
|
|
73
|
+
// "| Traceback (most recent call last):",
|
|
74
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/mcp/client/sse.py\", line 47, in sse_client\n | async with aconnect_sse(\n | ^^^^^^^^^^^^^",
|
|
75
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 210, in __aenter__\n | return await anext(self.gen)\n | ^^^^^^^^^^^^^^^^^^^^^",
|
|
76
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx_sse/_api.py\", line 69, in aconnect_sse\n | async with client.stream(method, url, headers=headers, **kwargs) as response:\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
77
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 210, in __aenter__\n | return await anext(self.gen)\n | ^^^^^^^^^^^^^^^^^^^^^",
|
|
78
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1583, in stream\n | response = await self.send(\n | ^^^^^^^^^^^^^^^^",
|
|
79
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1629, in send\n | response = await self._send_handling_auth(\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
80
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1657, in _send_handling_auth\n | response = await self._send_handling_redirects(\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
81
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1694, in _send_handling_redirects\n | response = await self._send_single_request(request)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
82
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_client.py\", line 1730, in _send_single_request\n | response = await transport.handle_async_request(request)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
83
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_transports/default.py\", line 393, in handle_async_request\n | with map_httpcore_exceptions():\n | ^^^^^^^^^^^^^^^^^^^^^^^^^",
|
|
84
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/lib/python3.12/contextlib.py\", line 158, in __exit__\n | self.gen.throw(value)",
|
|
85
|
+
// "| File \"/Users/harishpatel/.pyenv/versions/3.12.7/envs/solid_mcp_client/lib/python3.12/site-packages/httpx/_transports/default.py\", line 118, in map_httpcore_exceptions\n | raise mapped_exc(message) from exc",
|
|
86
|
+
// "| httpx.ConnectError: All connection attempts failed",
|
|
87
|
+
// "+------------------------------------"
|
|
88
|
+
// ],
|
|
89
|
+
// "request": "\"Can you do 1 + 1\""
|
|
90
|
+
// }
|
|
91
|
+
if (combined.includes("all connection attempts failed") && combined.includes("unhandled errors in a taskgroup (1 sub-exception)")) {
|
|
92
|
+
return 'solidx-mcp-server-unavailable';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// --- Bedrock errors ---
|
|
96
|
+
// Throttling: "ThrottlingException" or "Too many tokens"
|
|
97
|
+
if (
|
|
98
|
+
combined.includes('throttlingexception') ||
|
|
99
|
+
combined.includes('too many tokens')
|
|
100
|
+
) {
|
|
101
|
+
return 'bedrock-throttling-error';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (combined.includes('accessdeniedexception')) {
|
|
105
|
+
return 'bedrock-access-denied';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (
|
|
109
|
+
combined.includes('validationexception') &&
|
|
110
|
+
combined.includes('input is too long')
|
|
111
|
+
) {
|
|
112
|
+
return 'bedrock-input-too-long';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (combined.includes('validationexception')) {
|
|
116
|
+
return 'bedrock-validation-error';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (combined.includes('modelnotfoundexception')) {
|
|
120
|
+
return 'bedrock-model-not-found';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// --- DB errors ---
|
|
124
|
+
if (
|
|
125
|
+
combined.includes('unique constraint') ||
|
|
126
|
+
combined.includes('duplicate key')
|
|
127
|
+
) {
|
|
128
|
+
return 'db-duplicate-key';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (combined.includes('foreign key')) {
|
|
132
|
+
return 'db-foreign-key-error';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// --- OpenSearch errors ---
|
|
136
|
+
// mapper_parsing_exception on specific fields
|
|
137
|
+
if (
|
|
138
|
+
combined.includes('mapper_parsing_exception') &&
|
|
139
|
+
(combined.includes('failed to parse field [metadata.properties.dates]') ||
|
|
140
|
+
combined.includes(
|
|
141
|
+
'failed to parse field [metadata.properties.date_authored]',
|
|
142
|
+
))
|
|
143
|
+
) {
|
|
144
|
+
return 'metadata-extraction-date-parsing-failed';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// --- S3 errors ---
|
|
148
|
+
// NoSuchKey during GetObject
|
|
149
|
+
if (combined.includes('nosuchkey') && combined.includes('getobject')) {
|
|
150
|
+
return 'metadata-extraction-missing-s3-file';
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// --- Catch-all ---
|
|
154
|
+
return 'unknown-error';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Same mapping, but takes raw strings instead of an Exception object.
|
|
159
|
+
*/
|
|
160
|
+
mapMessage(message: string, trace?: string): ErrorCode {
|
|
161
|
+
const combined = `${message ?? ''}\n${trace ?? ''}`.toLowerCase();
|
|
162
|
+
return this.mapException(combined);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ---- helpers ----
|
|
166
|
+
|
|
167
|
+
private combineErrorText(exc: unknown): string {
|
|
168
|
+
// If caller passed us a pre-lowered string (e.g. from mapMessage), use it
|
|
169
|
+
if (typeof exc === 'string') {
|
|
170
|
+
return exc.toLowerCase();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Standard Error
|
|
174
|
+
if (exc instanceof Error) {
|
|
175
|
+
const message = exc.message ?? '';
|
|
176
|
+
// Many libs set .stack to "Error: message\n<stack>"
|
|
177
|
+
// We still include it in case upstream mutated it.
|
|
178
|
+
const stack = exc.stack ?? '';
|
|
179
|
+
return `${message}\n${stack}`.toLowerCase();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Some SDKs throw objects (e.g., { name, message, code, $metadata, ... })
|
|
183
|
+
if (exc && typeof exc === 'object') {
|
|
184
|
+
try {
|
|
185
|
+
const maybeAny = exc as Record<string, unknown>;
|
|
186
|
+
const msg =
|
|
187
|
+
String(maybeAny.message ?? '') ||
|
|
188
|
+
String(maybeAny['Message'] ?? '') ||
|
|
189
|
+
'';
|
|
190
|
+
const name =
|
|
191
|
+
String(maybeAny.name ?? '') ||
|
|
192
|
+
String(maybeAny['__type'] ?? '') ||
|
|
193
|
+
'';
|
|
194
|
+
const stack = String((maybeAny as any).stack ?? '');
|
|
195
|
+
// Also fold in a JSON snapshot as a last resort
|
|
196
|
+
const json = safeJsonStringify(maybeAny);
|
|
197
|
+
return `${name}\n${msg}\n${stack}\n${json}`.toLowerCase();
|
|
198
|
+
} catch {
|
|
199
|
+
// fall through
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Fallback
|
|
204
|
+
return String(exc ?? '').toLowerCase();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function safeJsonStringify(obj: unknown): string {
|
|
209
|
+
try {
|
|
210
|
+
return JSON.stringify(obj);
|
|
211
|
+
} catch {
|
|
212
|
+
return '';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -68,7 +68,8 @@ export class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<Trigg
|
|
|
68
68
|
modelUsed: aiResponse.model,
|
|
69
69
|
responseTimeMs: aiResponse.duration_ms,
|
|
70
70
|
metadata: JSON.stringify(aiResponse),
|
|
71
|
-
isApplied: aiInteraction.isApplied
|
|
71
|
+
isApplied: aiInteraction.isApplied,
|
|
72
|
+
status: aiResponse.success ? 'succeeded' : 'failed'
|
|
72
73
|
});
|
|
73
74
|
|
|
74
75
|
// update the job entry with failure... raising an error will lead the job to be marked as failed...
|
|
@@ -88,7 +89,8 @@ export class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<Trigg
|
|
|
88
89
|
modelUsed: aiResponse.model,
|
|
89
90
|
responseTimeMs: aiResponse.duration_ms,
|
|
90
91
|
metadata: JSON.stringify(aiResponse),
|
|
91
|
-
isApplied: aiInteraction.isApplied
|
|
92
|
+
isApplied: aiInteraction.isApplied,
|
|
93
|
+
status: aiResponse.success ? 'succeeded' : 'failed'
|
|
92
94
|
});
|
|
93
95
|
|
|
94
96
|
// If the human interaction was with isAutoApply=true, then we can go ahead and autoApply.
|
|
@@ -5583,6 +5583,19 @@
|
|
|
5583
5583
|
"viewUserKey": "",
|
|
5584
5584
|
"moduleUserKey": "solid-core",
|
|
5585
5585
|
"modelUserKey": "setting"
|
|
5586
|
+
},
|
|
5587
|
+
{
|
|
5588
|
+
"displayName": "Ai settings",
|
|
5589
|
+
"name": "ai-settings-action",
|
|
5590
|
+
"type": "custom",
|
|
5591
|
+
"domain": "",
|
|
5592
|
+
"context": "",
|
|
5593
|
+
"customComponent": "/admin/core/solid-core/settings/ai-settings",
|
|
5594
|
+
"customIsModal": true,
|
|
5595
|
+
"serverEndpoint": "",
|
|
5596
|
+
"viewUserKey": "",
|
|
5597
|
+
"moduleUserKey": "solid-core",
|
|
5598
|
+
"modelUserKey": "setting"
|
|
5586
5599
|
},
|
|
5587
5600
|
{
|
|
5588
5601
|
"displayName": "Misc",
|
|
@@ -5951,6 +5964,14 @@
|
|
|
5951
5964
|
"actionUserKey": "authentication-settings-action",
|
|
5952
5965
|
"moduleUserKey": "solid-core",
|
|
5953
5966
|
"parentMenuItemUserKey": "settings-menu-item"
|
|
5967
|
+
},
|
|
5968
|
+
{
|
|
5969
|
+
"displayName": "Ai Settings",
|
|
5970
|
+
"name": "ai-settings-menu-item",
|
|
5971
|
+
"sequenceNumber": 3,
|
|
5972
|
+
"actionUserKey": "ai-settings-action",
|
|
5973
|
+
"moduleUserKey": "solid-core",
|
|
5974
|
+
"parentMenuItemUserKey": "settings-menu-item"
|
|
5954
5975
|
},
|
|
5955
5976
|
{
|
|
5956
5977
|
"displayName": "Misc",
|