@compilr-dev/sdk 0.10.27 → 0.10.29

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,27 @@ 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.\n` +
206
+ `- **Always provide at least a brief text reply to the user — never end a turn with only tool calls.** ` +
207
+ `Even after running tools, summarise the result in plain text so the user sees a response. ` +
208
+ `A silent turn (tool call with no follow-up text) looks like a failure on the user's terminal.`;
209
+ finalSystemPromptAddition = finalSystemPromptAddition
210
+ ? `${identityBlock}\n\n${finalSystemPromptAddition}`
211
+ : identityBlock;
191
212
  // Inject shared context if provided (excluding roster — that goes via anchor for live updates)
192
213
  if (sharedContext) {
193
214
  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.29",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",