@compilr-dev/sdk 0.1.25 → 0.1.27

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.
@@ -18,11 +18,12 @@ export function generateCapabilityCatalog(catalog, loadedPackIds) {
18
18
  const lines = [
19
19
  '## Available Capabilities',
20
20
  '',
21
- 'Call `load_capability("name")` to activate additional tools:',
21
+ 'These tools are available but not yet loaded. Just call any tool by name it will auto-load:',
22
22
  ];
23
23
  for (const entry of catalog) {
24
24
  const readOnlySuffix = entry.readOnly ? ', read-only' : '';
25
- lines.push(`- ${entry.id}: ${entry.label} (${String(entry.toolCount)} tools${readOnlySuffix})`);
25
+ const toolList = entry.tools.join(', ');
26
+ lines.push(`- **${entry.label}** (${entry.id}${readOnlySuffix}): ${toolList}`);
26
27
  }
27
28
  if (loadedPackIds.length > 0) {
28
29
  lines.push('');
@@ -158,6 +158,7 @@ export class CapabilityManager {
158
158
  label: pack.label,
159
159
  toolCount: pack.tools.length,
160
160
  readOnly: pack.readOnly,
161
+ tools: pack.tools,
161
162
  });
162
163
  }
163
164
  }
@@ -49,6 +49,8 @@ export interface CapabilityCatalogEntry {
49
49
  label: string;
50
50
  toolCount: number;
51
51
  readOnly: boolean;
52
+ /** Tool names in this pack (for agent awareness — enables auto-load on first call) */
53
+ tools: readonly string[];
52
54
  }
53
55
  /**
54
56
  * Result of attempting to load capabilities (e.g., for a skill invocation).
@@ -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.27",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",