@compilr-dev/sdk 0.10.27 → 0.10.28

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.
@@ -188,6 +188,24 @@ export class TeamAgent {
188
188
  }
189
189
  // Build system prompt addition with shared context
190
190
  let finalSystemPromptAddition = this.systemPromptAddition ?? '';
191
+ // Identity preamble — every team agent gets a stable self-reference
192
+ // block at the top of its prompt addition. Without this, the agent
193
+ // knows it's "the PM" from the role prompt but doesn't connect that
194
+ // to `agentId: "pm"` when tools take an agentId parameter. User test
195
+ // 2026-06-04 caught this: $pm called `todo_read(owner="default")`
196
+ // because it didn't know its id was "pm".
197
+ //
198
+ // Uses runtime fields (this.id, this.displayName, this.mascot) so
199
+ // collision-renamed ids (e.g. "pm-2") are correctly stated.
200
+ const identityBlock = `# YOUR IDENTITY IN THIS TEAM\n\n` +
201
+ `You are agent **${this.displayName}** ${this.mascot}.\n\n` +
202
+ `- Your agent ID: \`${this.id}\`\n` +
203
+ `- When tools have an \`agentId\` (or \`owner\`, \`toAgentId\`) parameter referring to YOU, use \`"${this.id}"\`.\n` +
204
+ `- When users mention \`$${this.id}\`, they mean you.\n` +
205
+ `- When asked "who are you?" or "what is your role?", state both your role and your agent ID.`;
206
+ finalSystemPromptAddition = finalSystemPromptAddition
207
+ ? `${identityBlock}\n\n${finalSystemPromptAddition}`
208
+ : identityBlock;
191
209
  // Inject shared context if provided (excluding roster — that goes via anchor for live updates)
192
210
  if (sharedContext) {
193
211
  const sharedContextBlock = sharedContext.format({ excludeRoster: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.10.27",
3
+ "version": "0.10.28",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",