@compilr-dev/sdk 0.1.25 → 0.1.26

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.
@@ -22,8 +22,12 @@ export interface SystemPromptContext {
22
22
  enableMetaTools?: boolean;
23
23
  /** Does the agent have a role-specific identity? (team agents) */
24
24
  hasRoleIdentity?: boolean;
25
- /** Active project name (for explicit identification) */
25
+ /** Active project display name (human-readable, e.g. "Hr Manager") */
26
26
  projectName?: string;
27
+ /** Active project slug (unique identifier, e.g. "hr-manager") */
28
+ projectSlug?: string;
29
+ /** Active project ID (numeric database identifier) */
30
+ projectId?: number;
27
31
  /** Project context from COMPILR.md (appended at end) */
28
32
  projectContext?: string;
29
33
  /** Guided mode context (appended at end) */
@@ -79,6 +83,10 @@ export declare class SystemPromptBuilder {
79
83
  * Build the system prompt based on current context
80
84
  */
81
85
  build(): BuildResult;
86
+ /**
87
+ * Build project metadata lines (name, slug, ID) for the system prompt.
88
+ */
89
+ private buildProjectMeta;
82
90
  /**
83
91
  * Build and return just the prompt string
84
92
  */
@@ -168,10 +168,12 @@ export class SystemPromptBuilder {
168
168
  const projectHeader = this.context.projectName
169
169
  ? `## Project Context (${this.context.projectName})`
170
170
  : '## Project Context';
171
- prompt += `\n\n---\n\n${projectHeader}\n\nThe following is project-specific context loaded from COMPILR.md:\n\n${this.context.projectContext}`;
171
+ const projectMeta = this.buildProjectMeta();
172
+ prompt += `\n\n---\n\n${projectHeader}${projectMeta}\n\nThe following is project-specific context loaded from COMPILR.md:\n\n${this.context.projectContext}`;
172
173
  }
173
174
  else if (this.context.projectName) {
174
- prompt += `\n\n---\n\n## Active Project\n\nThe current project is: **${this.context.projectName}**`;
175
+ const projectMeta = this.buildProjectMeta();
176
+ prompt += `\n\n---\n\n## Active Project${projectMeta}`;
175
177
  }
176
178
  // Append guided mode context if provided
177
179
  if (this.context.guidedModeContext) {
@@ -196,6 +198,22 @@ export class SystemPromptBuilder {
196
198
  estimatedTokens: baseTokens + appendedTokens,
197
199
  };
198
200
  }
201
+ /**
202
+ * Build project metadata lines (name, slug, ID) for the system prompt.
203
+ */
204
+ buildProjectMeta() {
205
+ const lines = [];
206
+ if (this.context.projectName) {
207
+ lines.push(`- **Name:** ${this.context.projectName}`);
208
+ }
209
+ if (this.context.projectSlug) {
210
+ lines.push(`- **Slug:** \`${this.context.projectSlug}\` (unique identifier — use this for tool lookups)`);
211
+ }
212
+ if (this.context.projectId !== undefined) {
213
+ lines.push(`- **ID:** ${String(this.context.projectId)}`);
214
+ }
215
+ return lines.length > 0 ? '\n\n' + lines.join('\n') : '';
216
+ }
199
217
  /**
200
218
  * Build and return just the prompt string
201
219
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",