@compilr-dev/sdk 0.4.0 → 0.4.2
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.
|
@@ -89,12 +89,16 @@ export function createCapabilityHook(ctx, basePrompt, config) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
|
-
* Extract the anchors block from a system prompt.
|
|
93
|
-
* The agents library injects "##
|
|
94
|
-
*
|
|
92
|
+
* Extract the pins/anchors block from a system prompt.
|
|
93
|
+
* The agents library injects pins as "## Pinned Context (Critical Information)"
|
|
94
|
+
* (or legacy "## Active Anchors (Critical Information)") before BeforeLLM hooks run.
|
|
95
|
+
* We must preserve it when rebuilding the prompt.
|
|
95
96
|
*/
|
|
96
97
|
function extractAnchorsBlock(systemPrompt) {
|
|
97
|
-
|
|
98
|
+
// Try current marker first, then legacy
|
|
99
|
+
const pinMarker = '## Pinned Context (Critical Information)';
|
|
100
|
+
const legacyMarker = '## Active Anchors (Critical Information)';
|
|
101
|
+
const anchorMarker = systemPrompt.includes(pinMarker) ? pinMarker : legacyMarker;
|
|
98
102
|
const anchorIdx = systemPrompt.indexOf(anchorMarker);
|
|
99
103
|
if (anchorIdx <= 0)
|
|
100
104
|
return '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Universal agent runtime for building AI-powered applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
70
|
-
"@compilr-dev/agents": "^0.3.
|
|
70
|
+
"@compilr-dev/agents": "^0.3.27",
|
|
71
71
|
"@compilr-dev/agents-coding": "^1.0.2",
|
|
72
72
|
"@eslint/js": "^9.39.1",
|
|
73
73
|
"@opentelemetry/api": "^1.9.0",
|