@compilr-dev/sdk 0.2.9 → 0.2.11

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 CHANGED
@@ -121,7 +121,7 @@ class CompilrAgentImpl {
121
121
  contextManager,
122
122
  autoContextManagement: contextManager !== undefined,
123
123
  hooks: config?.hooks,
124
- anchors: {},
124
+ pins: {},
125
125
  permissions: {
126
126
  defaultLevel: permissionsConfig.defaultLevel,
127
127
  onPermissionRequest: permissionsConfig.onPermissionRequest,
@@ -202,10 +202,14 @@ class CompilrAgentImpl {
202
202
  this.agent.registerTool(tool);
203
203
  return this;
204
204
  }
205
- addAnchor(input) {
206
- this.agent.addAnchor(input);
205
+ addPin(input) {
206
+ this.agent.addPin(input);
207
207
  return this;
208
208
  }
209
+ /** @deprecated Use addPin() instead */
210
+ addAnchor(input) {
211
+ return this.addPin(input);
212
+ }
209
213
  getHistory() {
210
214
  return this.agent.getHistory();
211
215
  }
package/dist/config.d.ts CHANGED
@@ -158,7 +158,9 @@ export interface CompilrAgent {
158
158
  chat(message: string, options?: RunOptions): Promise<RunResult>;
159
159
  /** Add a tool at runtime */
160
160
  addTool(tool: Tool): this;
161
- /** Add an anchor (critical info that survives compaction) */
161
+ /** Add a pin (critical info that survives compaction) */
162
+ addPin(input: AnchorInput): this;
163
+ /** @deprecated Use addPin() instead */
162
164
  addAnchor(input: AnchorInput): this;
163
165
  /** Get conversation history */
164
166
  getHistory(): Message[];
@@ -201,10 +201,10 @@ export class TeamAgent {
201
201
  this._agent = await agentFactory(this.agentConfig, finalSystemPromptAddition || undefined, this.useMinimalSystemPrompt, this.noTools, this.toolFilter, // Pass tool filter to factory
202
202
  this._modelTier // Pass model tier to factory
203
203
  );
204
- // Set the team roster as an anchor (dynamically re-injected on every LLM call).
204
+ // Set the team roster as a pin (dynamically re-injected on every LLM call).
205
205
  // This ensures roster updates (agent added/removed) are always visible.
206
- if (sharedContext && sharedContext.hasTeamRoster() && this._agent.hasAnchors()) {
207
- this._agent.addAnchor({
206
+ if (sharedContext && sharedContext.hasTeamRoster() && this._agent.hasPins()) {
207
+ this._agent.addPin({
208
208
  id: 'team-roster',
209
209
  content: sharedContext.formatTeamRoster(),
210
210
  priority: 'info',
package/dist/team/team.js CHANGED
@@ -152,6 +152,15 @@ export class AgentTeam {
152
152
  if (defaultTeamAgent) {
153
153
  defaultTeamAgent.setAgent(agent);
154
154
  }
155
+ // Inject current team roster into the new agent's pins
156
+ if (this._sharedContext.hasTeamRoster() && agent.hasPins()) {
157
+ agent.addPin({
158
+ id: 'team-roster',
159
+ content: this._sharedContext.formatTeamRoster(),
160
+ priority: 'info',
161
+ scope: 'session',
162
+ });
163
+ }
155
164
  }
156
165
  /**
157
166
  * Check if an agent exists in the team
@@ -568,14 +577,14 @@ export class AgentTeam {
568
577
  updateTeamRoster() {
569
578
  const roster = this.buildTeamRoster();
570
579
  this._sharedContext.updateTeamRoster(roster);
571
- // Push updated roster to all initialized agents via anchors.
572
- // Anchors are re-injected on every LLM call, so agents always see the latest roster.
580
+ // Push updated roster to all initialized agents via pins.
581
+ // Pins are re-injected on every LLM call, so agents always see the latest roster.
573
582
  if (this._sharedContext.hasTeamRoster()) {
574
583
  const rosterContent = this._sharedContext.formatTeamRoster();
575
584
  for (const [, teamAgent] of this.agents) {
576
585
  const agent = teamAgent.agent;
577
- if (agent && agent.hasAnchors()) {
578
- agent.addAnchor({
586
+ if (agent && agent.hasPins()) {
587
+ agent.addPin({
579
588
  id: 'team-roster',
580
589
  content: rosterContent,
581
590
  priority: 'info',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
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.25",
70
+ "@compilr-dev/agents": "^0.3.26",
71
71
  "@compilr-dev/agents-coding": "^1.0.2",
72
72
  "@eslint/js": "^9.39.1",
73
73
  "@opentelemetry/api": "^1.9.0",