@compilr-dev/sdk 0.1.26 → 0.1.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.
@@ -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).
@@ -297,7 +297,9 @@ export function createMetaTools(registry, options) {
297
297
  // -------------------------------------------------------------------------
298
298
  // Fallback handler factory
299
299
  // -------------------------------------------------------------------------
300
- function createFallback(options) {
300
+ function createFallback(fallbackOptions) {
301
+ // Inherit options from createMetaTools() if not overridden
302
+ const effectiveOptions = fallbackOptions ?? options;
301
303
  return async (name, input) => {
302
304
  // Check if tool exists in registry
303
305
  const tool = registry.getTool(name);
@@ -307,7 +309,7 @@ export function createMetaTools(registry, options) {
307
309
  // Check tool filter
308
310
  if (!registry.isToolAllowed(name)) {
309
311
  // Give consumer a chance to load the capability and update the filter
310
- if (options?.onFilteredTool?.(name) && registry.isToolAllowed(name)) {
312
+ if (effectiveOptions?.onFilteredTool?.(name) && registry.isToolAllowed(name)) {
311
313
  // Filter updated — fall through to execute
312
314
  }
313
315
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",