@compilr-dev/sdk 0.4.1 → 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 "## Active Anchors (Critical Information)"
94
- * before BeforeLLM hooks run. We need to preserve it when rebuilding.
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
- const anchorMarker = '## Active Anchors (Critical Information)';
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.1",
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",