@compilr-dev/sdk 0.7.9 → 0.7.11

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
@@ -256,6 +256,7 @@ class CompilrAgentImpl {
256
256
  enabled: guardrailsConfig.enabled,
257
257
  includeDefaults: guardrailsConfig.includeDefaults,
258
258
  },
259
+ delegation: config?.delegation,
259
260
  onEvent: (event) => {
260
261
  // Track usage from events
261
262
  if (event.type === 'usage_recorded') {
@@ -256,6 +256,38 @@ export const CAPABILITY_PACKS = {
256
256
  estimatedPromptTokens: 120,
257
257
  estimatedToolTokens: 900,
258
258
  },
259
+ // ============= FACTORY TOOL PACKS =============
260
+ factory_models: {
261
+ id: 'factory_models',
262
+ label: 'Structured Models',
263
+ tools: [
264
+ 'app_model_get', 'app_model_update', 'app_model_validate',
265
+ 'research_model_get', 'research_model_update', 'research_model_validate',
266
+ 'bibliography_generate', 'bibtex_import',
267
+ 'business_model_get', 'business_model_update', 'business_model_validate',
268
+ 'brand_model_get', 'brand_model_update', 'brand_model_validate',
269
+ 'curriculum_model_get', 'curriculum_model_update', 'curriculum_model_validate',
270
+ 'book_model_get', 'book_model_update', 'book_model_validate',
271
+ ],
272
+ readOnly: false,
273
+ promptModules: ['factory-tool-hints'],
274
+ promptSnippet: 'Structured models: use *_model_get to read, *_model_update with semantic ops to modify. Each model type (app, research, business, brand, curriculum, book) has get/update/validate tools.',
275
+ estimatedPromptTokens: 150,
276
+ estimatedToolTokens: 3000,
277
+ },
278
+ factory_scaffold: {
279
+ id: 'factory_scaffold',
280
+ label: 'Code Scaffolding',
281
+ tools: [
282
+ 'factory_scaffold', 'factory_list_toolkits',
283
+ 'research_scaffold', 'business_scaffold', 'content_scaffold', 'book_scaffold',
284
+ ],
285
+ readOnly: false,
286
+ promptModules: ['factory-tool-hints'],
287
+ promptSnippet: 'Scaffolding: factory_scaffold generates project files from app models. factory_list_toolkits shows available templates. Domain-specific scaffolds (research_, business_, content_, book_) generate from their respective models.',
288
+ estimatedPromptTokens: 120,
289
+ estimatedToolTokens: 1200,
290
+ },
259
291
  };
260
292
  /**
261
293
  * Mapping from forbidden pack IDs to suggested agent roles.
@@ -276,6 +308,8 @@ export const FORBIDDEN_PACK_SUGGESTIONS = {
276
308
  artifacts: '$pm',
277
309
  anchors: '$pm',
278
310
  project_db: '$pm',
311
+ factory_models: '$default',
312
+ factory_scaffold: '$dev',
279
313
  };
280
314
  /**
281
315
  * Get the total number of defined capability packs.
package/dist/config.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * SDK configuration types
3
3
  */
4
- import type { LLMProvider, Message, Tool, ToolPermission, HooksConfig, AnchorInput, AgentEvent, ToolExecutionResult } from '@compilr-dev/agents';
4
+ import type { LLMProvider, Message, Tool, ToolPermission, HooksConfig, AnchorInput, AgentEvent, ToolExecutionResult, DelegationConfig } from '@compilr-dev/agents';
5
5
  import type { Preset } from './presets/types.js';
6
6
  import type { ToolProfile } from './team/tool-config.js';
7
7
  import type { ConditionalModule } from './capabilities/hook.js';
@@ -192,6 +192,8 @@ export interface CompilrAgentConfig {
192
192
  hooks?: HooksConfig;
193
193
  /** Context management configuration */
194
194
  context?: ContextConfig;
195
+ /** Tool result delegation — auto-summarize large results to conserve context */
196
+ delegation?: DelegationConfig;
195
197
  /**
196
198
  * Callback for the suggest tool. When provided, the default no-op suggest
197
199
  * tool is replaced with one that calls this callback.
@@ -37,7 +37,7 @@ export const MODEL_REGISTRY = [
37
37
  defaultTier: 'balanced',
38
38
  thinkingFormat: 'claude',
39
39
  status: 'supported',
40
- contextWindow: 200000,
40
+ contextWindow: 1000000,
41
41
  },
42
42
  {
43
43
  id: 'claude-opus-4-6',
@@ -47,7 +47,7 @@ export const MODEL_REGISTRY = [
47
47
  defaultTier: 'powerful',
48
48
  thinkingFormat: 'claude',
49
49
  status: 'supported',
50
- contextWindow: 200000,
50
+ contextWindow: 1000000,
51
51
  },
52
52
  // Legacy Claude models (still supported)
53
53
  {
@@ -302,6 +302,32 @@ export const TOOL_GROUPS = {
302
302
  tier: 'direct',
303
303
  note: 'Delegate tasks to specialized subagents',
304
304
  },
305
+ // Factory tools (from @compilr-dev/factory) — structured models + scaffolding
306
+ factory_models: {
307
+ label: 'Structured Models',
308
+ tools: [
309
+ 'app_model_get', 'app_model_update', 'app_model_validate',
310
+ 'research_model_get', 'research_model_update', 'research_model_validate',
311
+ 'bibliography_generate', 'bibtex_import',
312
+ 'business_model_get', 'business_model_update', 'business_model_validate',
313
+ 'brand_model_get', 'brand_model_update', 'brand_model_validate',
314
+ 'curriculum_model_get', 'curriculum_model_update', 'curriculum_model_validate',
315
+ 'book_model_get', 'book_model_update', 'book_model_validate',
316
+ ],
317
+ readOnly: false,
318
+ tier: 'meta',
319
+ note: 'Structured project models (app, research, business, brand, curriculum, book)',
320
+ },
321
+ factory_scaffold: {
322
+ label: 'Code Scaffolding',
323
+ tools: [
324
+ 'factory_scaffold', 'factory_list_toolkits',
325
+ 'research_scaffold', 'business_scaffold', 'content_scaffold', 'book_scaffold',
326
+ ],
327
+ readOnly: false,
328
+ tier: 'meta',
329
+ note: 'Generate project files from structured models',
330
+ },
305
331
  };
306
332
  // =============================================================================
307
333
  // Tool Profiles
@@ -347,6 +373,8 @@ export const TOOL_PROFILES = {
347
373
  'plans',
348
374
  'artifacts',
349
375
  'anchors',
376
+ 'factory_models',
377
+ 'factory_scaffold',
350
378
  ],
351
379
  // Security - security audits
352
380
  security: [
@@ -362,7 +390,7 @@ export const TOOL_PROFILES = {
362
390
  'dependencies',
363
391
  ],
364
392
  // Docs - documentation only
365
- docs: ['file_read', 'file_write', 'interaction', 'handoff', 'guide', 'meta', 'project', 'search'],
393
+ docs: ['file_read', 'file_write', 'interaction', 'handoff', 'guide', 'meta', 'project', 'search', 'factory_models'],
366
394
  // DevOps - CI/CD tasks
367
395
  devops: [
368
396
  'file_read',
@@ -412,6 +440,7 @@ export const TOOL_PROFILES = {
412
440
  'plans',
413
441
  'artifacts',
414
442
  'anchors',
443
+ 'factory_models',
415
444
  ],
416
445
  // Planner (PM) - project management (no code modification)
417
446
  planner: [
@@ -430,6 +459,7 @@ export const TOOL_PROFILES = {
430
459
  'plans',
431
460
  'artifacts',
432
461
  'anchors',
462
+ 'factory_models',
433
463
  ],
434
464
  // Analyst (BA) - requirements gathering (minimal technical tools)
435
465
  analyst: [
@@ -445,6 +475,7 @@ export const TOOL_PROFILES = {
445
475
  'documents',
446
476
  'artifacts',
447
477
  'anchors',
478
+ 'factory_models',
448
479
  ],
449
480
  // Custom - user selected (groups specified in customGroups)
450
481
  custom: [],
@@ -696,7 +696,7 @@ You are the **Researcher** in this multi-agent research team. You specialize in
696
696
  - Argument structure questions → "$default or $reviewer can assess the outline"
697
697
  - Writing/style questions → "$editor can review the prose"
698
698
  - Planning questions → "$default can help with project planning"`,
699
- defaultToolProfile: 'full',
699
+ defaultToolProfile: 'analyst', // Read + search + docs + project (no file writes)
700
700
  defaultModelTier: 'balanced',
701
701
  },
702
702
  reviewer: {
@@ -747,7 +747,7 @@ You are the **Reviewer** in this multi-agent research team. You specialize in va
747
747
  - Source analysis needed → "$researcher can analyze the sources"
748
748
  - Writing quality → "$editor can improve the prose"
749
749
  - Structural changes → "$default can update the outline"`,
750
- defaultToolProfile: 'full',
750
+ defaultToolProfile: 'analyst', // Read-only analysis, no direct editing
751
751
  defaultModelTier: 'balanced',
752
752
  },
753
753
  editor: {
@@ -802,7 +802,7 @@ You are the **Editor** in this multi-agent research team. You specialize in impr
802
802
  - Argument issues → "$reviewer should check the logic here"
803
803
  - Source questions → "$researcher can verify this citation"
804
804
  - Structural changes → "$default can update the outline"`,
805
- defaultToolProfile: 'full',
805
+ defaultToolProfile: 'docs', // Read + write docs, no shell/git
806
806
  defaultModelTier: 'balanced',
807
807
  },
808
808
  writer: {
@@ -823,7 +823,7 @@ You are the **Writer** in this multi-agent team. You specialize in creating comp
823
823
  - Always match the project's established tone and voice
824
824
  - Ask about audience and purpose before writing if not clear
825
825
  - Provide drafts, not final copy — let the Editor refine`,
826
- defaultToolProfile: 'full',
826
+ defaultToolProfile: 'docs', // Read + write docs
827
827
  defaultModelTier: 'balanced',
828
828
  },
829
829
  analyst: {
@@ -844,7 +844,7 @@ You are the **Analyst** in this multi-agent team. You specialize in research, da
844
844
  - Lead with key insights, support with data
845
845
  - Use tables and bullet points for comparisons
846
846
  - Always cite sources and note confidence levels`,
847
- defaultToolProfile: 'full',
847
+ defaultToolProfile: 'analyst', // Read + search + project (read-only analysis)
848
848
  defaultModelTier: 'balanced',
849
849
  },
850
850
  strategist: {
@@ -866,7 +866,7 @@ You are the **Strategist** in this multi-agent team. You specialize in business
866
866
  - Think in frameworks (Porter's Five Forces, Business Model Canvas, etc.)
867
867
  - Always consider market context and competitive landscape
868
868
  - Balance ambition with feasibility`,
869
- defaultToolProfile: 'full',
869
+ defaultToolProfile: 'planner', // Strategy + planning + backlog + docs (read-only)
870
870
  defaultModelTier: 'balanced',
871
871
  },
872
872
  instructor: {
@@ -889,7 +889,7 @@ You are the **Instructor** in this multi-agent team. You specialize in education
889
889
  - Build knowledge progressively — prerequisites first
890
890
  - Include hands-on exercises for every concept
891
891
  - Consider different learning styles`,
892
- defaultToolProfile: 'full',
892
+ defaultToolProfile: 'docs', // Read + write educational content
893
893
  defaultModelTier: 'balanced',
894
894
  },
895
895
  custom: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",