@compilr-dev/sdk 0.9.17 → 0.9.18
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/agent.js +7 -2
- package/package.json +2 -2
package/dist/agent.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Agent, ContextManager, createSuggestTool, } from '@compilr-dev/agents';
|
|
5
5
|
import { createCompressorHook } from './compressors/index.js';
|
|
6
|
+
import { createInjectionDetectionHook } from '@compilr-dev/agents';
|
|
6
7
|
import { resolveProvider } from './provider.js';
|
|
7
8
|
import { resolvePreset } from './presets/index.js';
|
|
8
9
|
import { assembleTools, deduplicateTools } from './tools.js';
|
|
@@ -242,13 +243,17 @@ class CompilrAgentImpl {
|
|
|
242
243
|
: [];
|
|
243
244
|
mergedHooks.beforeLLM = [...existingHooks, ...capabilityHooks];
|
|
244
245
|
}
|
|
245
|
-
// Add output compressor
|
|
246
|
+
// Add output compressor and injection detection as afterTool hooks
|
|
246
247
|
const existingAfterTool = config?.hooks?.afterTool
|
|
247
248
|
? Array.isArray(config.hooks.afterTool)
|
|
248
249
|
? config.hooks.afterTool
|
|
249
250
|
: [config.hooks.afterTool]
|
|
250
251
|
: [];
|
|
251
|
-
mergedHooks.afterTool = [
|
|
252
|
+
mergedHooks.afterTool = [
|
|
253
|
+
createCompressorHook(),
|
|
254
|
+
createInjectionDetectionHook(), // Scan tool results for prompt injection
|
|
255
|
+
...existingAfterTool,
|
|
256
|
+
];
|
|
252
257
|
// Build observation mask config — SDK defaults include platform tools
|
|
253
258
|
const observationMask = config?.context?.observationMask !== false
|
|
254
259
|
? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.18",
|
|
4
4
|
"description": "Universal agent runtime for building AI-powered applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"node": ">=22.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@compilr-dev/agents": "^0.5.
|
|
56
|
+
"@compilr-dev/agents": "^0.5.4",
|
|
57
57
|
"@compilr-dev/logger": "^0.1.0",
|
|
58
58
|
"ajv": "^6.14.0"
|
|
59
59
|
},
|