@astratra/ai 1.15.0 → 1.16.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/package.json +6 -6
- package/src/agentLoop.js +0 -1
- package/src/answerText.js +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astratra/ai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "Generic AI provider routing, tool registry, and agent loop utilities for Astratra, plus agent guards (@astratra/ai/guards): outbound masking, prompt-injection handling for untrusted tool results, reply checks.",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22"
|
|
7
7
|
},
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"types": "src/index.d.ts",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.32.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"@astratra/rag": ">=1.0.0",
|
|
44
|
+
"redis": ">=4"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"redis": {
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@astratra/rag": "^1.0.0",
|
|
55
56
|
"@astratra/resilience": "^1.0.0",
|
|
56
57
|
"jest": "30.4.2",
|
|
57
|
-
"redis": "^
|
|
58
|
-
"@astratra/rag": "^1.0.0"
|
|
58
|
+
"redis": "^6.3.1"
|
|
59
59
|
},
|
|
60
60
|
"exports": {
|
|
61
61
|
".": {
|
package/src/agentLoop.js
CHANGED
|
@@ -134,7 +134,6 @@ async function runAgentLoop({
|
|
|
134
134
|
if (typeof confirmTool === 'function') approved = await confirmTool(toolCall, ctx);
|
|
135
135
|
else if (pendingActions && typeof pendingActions.propose === 'function') {
|
|
136
136
|
const proposed = await pendingActions.propose({ action: tool.name, payload: toolCall.params, description: `Appel ${tool.name} (${tool.risk || 'UNKNOWN'})`, proposedBy: ctx.userId, tenant: ctx.tenantId });
|
|
137
|
-
approved = false;
|
|
138
137
|
messages.push({ role: 'assistant', content: response }, { role: 'tool', content: `<tool_result name="${tool.name}">${JSON.stringify({ pending: true, actionId: proposed.action.id })}</tool_result>` });
|
|
139
138
|
continue;
|
|
140
139
|
} else approved = false;
|
package/src/answerText.js
CHANGED
|
@@ -120,7 +120,7 @@ async function verifyQuotations(text, options = {}) {
|
|
|
120
120
|
const end = match.index + match[0].length;
|
|
121
121
|
const reference = references.find((found) => found.start >= end && BETWEEN.test(source.slice(end, found.start)));
|
|
122
122
|
if (!reference) continue;
|
|
123
|
-
let truth
|
|
123
|
+
let truth;
|
|
124
124
|
try {
|
|
125
125
|
truth = await options.resolve(reference.refs);
|
|
126
126
|
} catch (_error) {
|