@compilr-dev/sdk 0.3.0 → 0.3.1

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.
package/dist/agent.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * CompilrAgent — high-level wrapper around @compilr-dev/agents Agent
3
3
  */
4
- import { Agent, ContextManager, } from '@compilr-dev/agents';
4
+ import { Agent, ContextManager, createSuggestTool, } from '@compilr-dev/agents';
5
5
  import { resolveProvider } from './provider.js';
6
6
  import { resolvePreset } from './presets/index.js';
7
7
  import { assembleTools, deduplicateTools } from './tools.js';
@@ -110,7 +110,12 @@ class CompilrAgentImpl {
110
110
  systemPrompt = preset.systemPrompt;
111
111
  }
112
112
  // Assemble all tools from preset + config
113
- const allTools = deduplicateTools(assembleTools(preset, config?.tools));
113
+ let allTools = deduplicateTools(assembleTools(preset, config?.tools));
114
+ // Replace default suggest tool with callback-wired version when onSuggest is provided
115
+ if (config?.onSuggest) {
116
+ const wiredSuggest = createSuggestTool({ onSuggest: config.onSuggest });
117
+ allTools = allTools.map((t) => t.definition.name === 'suggest' ? wiredSuggest : t);
118
+ }
114
119
  // Build context manager if configured
115
120
  let contextManager;
116
121
  if (config?.context) {
package/dist/config.d.ts CHANGED
@@ -190,6 +190,16 @@ export interface CompilrAgentConfig {
190
190
  hooks?: HooksConfig;
191
191
  /** Context management configuration */
192
192
  context?: ContextConfig;
193
+ /**
194
+ * Callback for the suggest tool. When provided, the default no-op suggest
195
+ * tool is replaced with one that calls this callback.
196
+ * The suggestion appears as ghost text in the UI input area.
197
+ */
198
+ onSuggest?: (event: {
199
+ type: 'suggest';
200
+ action: string;
201
+ reason?: string;
202
+ }) => void;
193
203
  /**
194
204
  * Dynamic capability loading configuration.
195
205
  * When enabled, tools are loaded on-demand for token efficiency.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",