@compilr-dev/sdk 0.9.11 → 0.9.13

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/index.d.ts CHANGED
@@ -36,9 +36,9 @@
36
36
  export { createCompilrAgent } from './agent.js';
37
37
  export type { CompilrAgentConfig, CompilrAgent, RunOptions, RunResult, ToolCallRecord, ToolConfig, UsageInfo, ProviderType, PermissionCallback, GuardrailConfig, ContextConfig, CapabilitiesConfig, } from './config.js';
38
38
  export { AgentTeam, TeamAgent, SharedContextManager, ArtifactStore, DelegationTracker, ContextResolver, } from './team/index.js';
39
- export type { AgentTeamConfig, TeamAgentConfig, ITeamPersistence, IArtifactStorage, ISessionRegistry, CustomAgentDefinition, AgentTemplate, ToolConfig as TeamToolConfig, ToolTier, ToolGroup, ProfileInfo, } from './team/index.js';
39
+ export type { AgentTeamConfig, TeamAgentConfig, ITeamPersistence, IArtifactStorage, ISessionRegistry, CustomAgentDefinition, AgentTemplate, AgentWorkshopData, WorkshopRoleDef, WorkshopToolProfile, WorkshopModelTier, WorkshopSkillDef, ToolConfig as TeamToolConfig, ToolTier, ToolGroup, ProfileInfo, } from './team/index.js';
40
40
  export type { AgentRole, RoleMetadata, ToolProfile, MascotExpression, BackgroundSessionInfo, SerializedTeam, SerializedTeamAgent, TeamMetadata, TeamEvent, TeamEventType, TeamEventHandler, Artifact, ArtifactType as TeamArtifactType, ArtifactSummary as TeamArtifactSummary, CreateArtifactOptions, UpdateArtifactOptions, SerializedArtifact, SharedContext, SharedProjectInfo, SharedTeamInfo, TeamRosterEntry, TeamActivity, TeamActivityType, SharedDecision, TokenBudget, SerializedSharedContext, ParsedMention, ParsedInput, ResolvedMention, ResolveOptions, ResolutionSource, Delegation, DelegationStatus, DelegationResult, CompletionEvent, CreateDelegationOptions, DelegationStats, DelegationTrackerEvents, SkillToolRequirement, } from './team/index.js';
41
- export { ROLE_METADATA, ROLE_EXPERTISE, PREDEFINED_ROLE_IDS, TOOL_GROUPS, TOOL_PROFILES, PROFILE_INFO, SKILL_REQUIREMENTS, CUSTOM_MASCOTS, } from './team/index.js';
41
+ export { ROLE_METADATA, ROLE_EXPERTISE, ROLE_GROUPS, PREDEFINED_ROLE_IDS, TOOL_GROUPS, TOOL_PROFILES, PROFILE_INFO, SKILL_REQUIREMENTS, CUSTOM_MASCOTS, buildAgentWorkshopData, buildSuggestedRolesMap, } from './team/index.js';
42
42
  export { getToolsForProfile, detectProfileFromTools, isProfileReadOnly, generateToolAwarenessPrompt, generateCoordinatorGuidance, generateSpecialistGuidance, createDefaultToolConfig, validateToolConfig, getAllGroupIds, getGroupInfo, getGroupsByTier, getGroupsForProfile, assignMascot, generateCustomAgentSystemPrompt, getCustomAgentToolFilter, getCustomAgentProfileLabel, validateAgentId, isAgentIdTaken, createCustomAgentDefinition, listTemplates, getTemplate, saveTemplate, updateTemplate, deleteTemplate, createAgentFromTemplate, parseInputForMentions, getReferencedAgents, hasReferences, buildMessageWithContext, buildContextMap, findAgentForRole, findAgentById, getAvailableSpecialists, getSpecialistsSummary, hasSpecialists, suggestOwner, suggestOwners, matchesAgentExpertise, wouldCreateLoop, recordAssignment, getAssignmentHistory, clearAssignmentHistory, clearAllAssignmentHistory, canReassign, resolveAgentIdCollision, setActiveSharedContext, getActiveSharedContext, recordTeamActivity, getDefinedSkillNames, getSkillRequirements, checkSkillCompatibility, getCompatibleSkills, getAllRequiredTools, getSkillsByCategory, } from './team/index.js';
43
43
  export { codingPreset, readOnlyPreset, resolvePreset } from './presets/index.js';
44
44
  export type { Preset } from './presets/index.js';
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ export { createCompilrAgent } from './agent.js';
43
43
  // Core classes
44
44
  export { AgentTeam, TeamAgent, SharedContextManager, ArtifactStore, DelegationTracker, ContextResolver, } from './team/index.js';
45
45
  // Constants
46
- export { ROLE_METADATA, ROLE_EXPERTISE, PREDEFINED_ROLE_IDS, TOOL_GROUPS, TOOL_PROFILES, PROFILE_INFO, SKILL_REQUIREMENTS, CUSTOM_MASCOTS, } from './team/index.js';
46
+ export { ROLE_METADATA, ROLE_EXPERTISE, ROLE_GROUPS, PREDEFINED_ROLE_IDS, TOOL_GROUPS, TOOL_PROFILES, PROFILE_INFO, SKILL_REQUIREMENTS, CUSTOM_MASCOTS, buildAgentWorkshopData, buildSuggestedRolesMap, } from './team/index.js';
47
47
  // Utility functions
48
48
  export {
49
49
  // Tool config
@@ -112,10 +112,10 @@ export function validateAgentId(id) {
112
112
  if (id.length > 20) {
113
113
  return { valid: false, error: 'Agent ID must be 20 characters or less' };
114
114
  }
115
- if (!/^[a-z][a-z0-9_]*$/.test(id)) {
115
+ if (!/^[a-z][a-z0-9_-]*$/.test(id)) {
116
116
  return {
117
117
  valid: false,
118
- error: 'Must be lowercase letters, numbers, underscore (start with letter)',
118
+ error: 'Must be lowercase letters, numbers, underscore, dash (start with letter)',
119
119
  };
120
120
  }
121
121
  return { valid: true };
@@ -12,7 +12,7 @@ export type { SharedContext, SharedProjectInfo, SharedTeamInfo, TeamRosterEntry,
12
12
  export { ArtifactStore } from './artifacts.js';
13
13
  export type { Artifact, ArtifactType, ArtifactSummary, CreateArtifactOptions, UpdateArtifactOptions, SerializedArtifact, } from './artifacts.js';
14
14
  export type { TeamAgentConfig, SerializedTeamAgent, TeamMetadata, SerializedTeam, TeamEvent, TeamEventType, TeamEventHandler, AgentRole, RoleMetadata, MascotExpression, ToolProfile, BackgroundSessionInfo, } from './types.js';
15
- export { ROLE_METADATA, ROLE_EXPERTISE, PREDEFINED_ROLE_IDS } from './types.js';
15
+ export { ROLE_METADATA, ROLE_EXPERTISE, ROLE_GROUPS, PREDEFINED_ROLE_IDS } from './types.js';
16
16
  export { TOOL_GROUPS, TOOL_PROFILES, PROFILE_INFO, getToolsForProfile, detectProfileFromTools, isProfileReadOnly, generateToolAwarenessPrompt, generateCoordinatorGuidance, generateSpecialistGuidance, } from './tool-config.js';
17
17
  export type { ToolConfig, ToolTier, ToolGroup, ProfileInfo } from './tool-config.js';
18
18
  export { createDefaultToolConfig, validateToolConfig, getAllGroupIds, getGroupInfo, getGroupsByTier, getGroupsForProfile, } from './tool-config.js';
@@ -20,6 +20,8 @@ export type { CustomAgentDefinition } from './custom-agents.js';
20
20
  export { CUSTOM_MASCOTS, assignMascot, generateCustomAgentSystemPrompt, getCustomAgentToolFilter, getCustomAgentProfileLabel, validateAgentId, isAgentIdTaken, createCustomAgentDefinition, } from './custom-agents.js';
21
21
  export type { AgentTemplate } from './agent-templates.js';
22
22
  export { listTemplates, getTemplate, saveTemplate, updateTemplate, deleteTemplate, createAgentFromTemplate, } from './agent-templates.js';
23
+ export type { AgentWorkshopData, WorkshopRoleDef, WorkshopToolProfile, WorkshopModelTier, WorkshopSkillDef, } from './workshop-data.js';
24
+ export { buildAgentWorkshopData, buildSuggestedRolesMap } from './workshop-data.js';
23
25
  export type { ITeamPersistence, IArtifactStorage, ISessionRegistry } from './interfaces.js';
24
26
  export type { ParsedMention, ParsedInput } from './mention-parser.js';
25
27
  export { parseInputForMentions, getReferencedAgents, hasReferences, buildMessageWithContext, } from './mention-parser.js';
@@ -9,12 +9,13 @@ export { AgentTeam } from './team.js';
9
9
  export { TeamAgent } from './team-agent.js';
10
10
  export { SharedContextManager } from './shared-context.js';
11
11
  export { ArtifactStore } from './artifacts.js';
12
- export { ROLE_METADATA, ROLE_EXPERTISE, PREDEFINED_ROLE_IDS } from './types.js';
12
+ export { ROLE_METADATA, ROLE_EXPERTISE, ROLE_GROUPS, PREDEFINED_ROLE_IDS } from './types.js';
13
13
  // Tool configuration
14
14
  export { TOOL_GROUPS, TOOL_PROFILES, PROFILE_INFO, getToolsForProfile, detectProfileFromTools, isProfileReadOnly, generateToolAwarenessPrompt, generateCoordinatorGuidance, generateSpecialistGuidance, } from './tool-config.js';
15
15
  export { createDefaultToolConfig, validateToolConfig, getAllGroupIds, getGroupInfo, getGroupsByTier, getGroupsForProfile, } from './tool-config.js';
16
16
  export { CUSTOM_MASCOTS, assignMascot, generateCustomAgentSystemPrompt, getCustomAgentToolFilter, getCustomAgentProfileLabel, validateAgentId, isAgentIdTaken, createCustomAgentDefinition, } from './custom-agents.js';
17
17
  export { listTemplates, getTemplate, saveTemplate, updateTemplate, deleteTemplate, createAgentFromTemplate, } from './agent-templates.js';
18
+ export { buildAgentWorkshopData, buildSuggestedRolesMap } from './workshop-data.js';
18
19
  export { parseInputForMentions, getReferencedAgents, hasReferences, buildMessageWithContext, } from './mention-parser.js';
19
20
  export { ContextResolver, buildContextMap } from './context-resolver.js';
20
21
  // Agent selection
@@ -34,6 +34,11 @@ export type MascotExpression = '[•_•]' | '[◈_◈]' | '[▣_▣]' | '[◉_
34
34
  * Predefined agent roles with default configurations
35
35
  */
36
36
  export type AgentRole = 'default' | 'pm' | 'arch' | 'qa' | 'dev' | 'ops' | 'docs' | 'ba' | 'researcher' | 'reviewer' | 'editor' | 'writer' | 'analyst' | 'strategist' | 'instructor' | 'custom';
37
+ /**
38
+ * Role groups for UI display (Workshop, team overlay).
39
+ * Groups roles by domain — used for visual categorization.
40
+ */
41
+ export declare const ROLE_GROUPS: Record<string, AgentRole[]>;
37
42
  /**
38
43
  * List of predefined role IDs (for validation against custom agent IDs)
39
44
  */
@@ -3,6 +3,15 @@
3
3
  *
4
4
  * Type definitions for the multi-agent team system.
5
5
  */
6
+ /**
7
+ * Role groups for UI display (Workshop, team overlay).
8
+ * Groups roles by domain — used for visual categorization.
9
+ */
10
+ export const ROLE_GROUPS = {
11
+ Software: ['dev', 'arch', 'qa', 'pm', 'ops'],
12
+ 'Writing & Analysis': ['writer', 'editor', 'reviewer', 'researcher', 'analyst', 'docs', 'ba'],
13
+ 'Business & Education': ['strategist', 'instructor'],
14
+ };
6
15
  /**
7
16
  * List of predefined role IDs (for validation against custom agent IDs)
8
17
  */
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Workshop Data Builder — Assembles all agent/skill/tool metadata
3
+ * into a single UI-friendly structure for the Agent Workshop.
4
+ *
5
+ * Used by both Desktop (via IPC) and CLI (direct import).
6
+ * Single source of truth — no hardcoded data in UI components.
7
+ */
8
+ export interface WorkshopRoleDef {
9
+ id: string;
10
+ displayName: string;
11
+ mascot: string;
12
+ description: string;
13
+ group: string;
14
+ expertise: string[];
15
+ defaultToolProfile: string;
16
+ defaultModelTier: string;
17
+ }
18
+ export interface WorkshopToolProfile {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ isReadOnly: boolean;
23
+ }
24
+ export interface WorkshopModelTier {
25
+ id: string;
26
+ label: string;
27
+ description: string;
28
+ }
29
+ export interface WorkshopSkillDef {
30
+ id: string;
31
+ label: string;
32
+ category: string;
33
+ requiredTools: string[];
34
+ optionalTools: string[];
35
+ }
36
+ export interface AgentWorkshopData {
37
+ /** Predefined roles with metadata */
38
+ roles: WorkshopRoleDef[];
39
+ /** Role group names in display order */
40
+ roleGroupOrder: string[];
41
+ /** Suggested role IDs per project type */
42
+ suggestedRoles: Record<string, string[]>;
43
+ /** Available tool profiles */
44
+ toolProfiles: WorkshopToolProfile[];
45
+ /** Model tiers */
46
+ modelTiers: WorkshopModelTier[];
47
+ /** Skills with tool requirements */
48
+ skills: WorkshopSkillDef[];
49
+ /** Skill category names in display order */
50
+ skillCategories: string[];
51
+ }
52
+ /**
53
+ * Build the complete workshop data from SDK constants.
54
+ * This is a pure function — no side effects, fully testable.
55
+ */
56
+ export declare function buildAgentWorkshopData(suggestedRolesMap?: Record<string, string[]>): AgentWorkshopData;
57
+ /**
58
+ * Build the suggested roles map from project type configs.
59
+ * Call this from the host app (needs access to PROJECT_TYPES).
60
+ */
61
+ export declare function buildSuggestedRolesMap(projectTypes: Array<{
62
+ id: string;
63
+ suggestedAgents?: Array<{
64
+ role: string;
65
+ }>;
66
+ }>): Record<string, string[]>;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Workshop Data Builder — Assembles all agent/skill/tool metadata
3
+ * into a single UI-friendly structure for the Agent Workshop.
4
+ *
5
+ * Used by both Desktop (via IPC) and CLI (direct import).
6
+ * Single source of truth — no hardcoded data in UI components.
7
+ */
8
+ import { PREDEFINED_ROLE_IDS, ROLE_METADATA, ROLE_EXPERTISE, ROLE_GROUPS, } from './types.js';
9
+ import { PROFILE_INFO } from './tool-config.js';
10
+ import { SKILL_REQUIREMENTS, getSkillsByCategory } from './skill-requirements.js';
11
+ // =============================================================================
12
+ // Builder
13
+ // =============================================================================
14
+ /**
15
+ * Find which group a role belongs to.
16
+ */
17
+ function getRoleGroup(roleId) {
18
+ for (const [group, roles] of Object.entries(ROLE_GROUPS)) {
19
+ if (roles.includes(roleId))
20
+ return group;
21
+ }
22
+ return 'Other';
23
+ }
24
+ /**
25
+ * Prettify a skill ID into a human-readable label.
26
+ * "code-review" → "Code Review", "prd" → "PRD"
27
+ */
28
+ function skillLabel(id) {
29
+ // Special cases
30
+ const special = { prd: 'PRD' };
31
+ if (special[id])
32
+ return special[id];
33
+ return id.replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
34
+ }
35
+ /**
36
+ * Find which category a skill belongs to.
37
+ */
38
+ function getSkillCategory(skillId, categories) {
39
+ for (const [cat, skills] of Object.entries(categories)) {
40
+ if (skills.includes(skillId)) {
41
+ // Capitalize category name
42
+ return cat.charAt(0).toUpperCase() + cat.slice(1);
43
+ }
44
+ }
45
+ return 'Other';
46
+ }
47
+ /**
48
+ * Build the complete workshop data from SDK constants.
49
+ * This is a pure function — no side effects, fully testable.
50
+ */
51
+ export function buildAgentWorkshopData(suggestedRolesMap) {
52
+ // Roles (exclude 'default' — it's the coordinator, not selectable)
53
+ const roles = PREDEFINED_ROLE_IDS.filter((id) => id !== 'default').map((id) => {
54
+ const meta = ROLE_METADATA[id];
55
+ return {
56
+ id,
57
+ displayName: meta.displayName,
58
+ mascot: meta.mascot,
59
+ description: meta.description,
60
+ group: getRoleGroup(id),
61
+ expertise: ROLE_EXPERTISE[id],
62
+ defaultToolProfile: meta.defaultToolProfile ?? 'full',
63
+ defaultModelTier: meta.defaultModelTier ?? 'balanced',
64
+ };
65
+ });
66
+ // Role groups in display order
67
+ const roleGroupOrder = Object.keys(ROLE_GROUPS);
68
+ // Tool profiles
69
+ const toolProfiles = Object.entries(PROFILE_INFO)
70
+ .filter(([id]) => id !== 'custom') // Custom is handled separately in UI
71
+ .map(([id, info]) => ({
72
+ id,
73
+ label: info.label,
74
+ description: info.description,
75
+ isReadOnly: info.isReadOnly,
76
+ }));
77
+ // Model tiers
78
+ const modelTiers = [
79
+ { id: 'fast', label: 'Fast', description: 'Quick responses, lower cost' },
80
+ {
81
+ id: 'balanced',
82
+ label: 'Balanced',
83
+ description: 'Best mix of speed and capability (default)',
84
+ },
85
+ { id: 'powerful', label: 'Powerful', description: 'Best reasoning for complex tasks' },
86
+ ];
87
+ // Skills
88
+ const categories = getSkillsByCategory();
89
+ const skills = Object.entries(SKILL_REQUIREMENTS).map(([id, req]) => ({
90
+ id,
91
+ label: skillLabel(id),
92
+ category: getSkillCategory(id, categories),
93
+ requiredTools: req.required,
94
+ optionalTools: req.optional ?? [],
95
+ }));
96
+ const skillCategories = Object.keys(categories).map((c) => c.charAt(0).toUpperCase() + c.slice(1));
97
+ return {
98
+ roles,
99
+ roleGroupOrder,
100
+ suggestedRoles: suggestedRolesMap ?? {},
101
+ toolProfiles,
102
+ modelTiers,
103
+ skills,
104
+ skillCategories,
105
+ };
106
+ }
107
+ /**
108
+ * Build the suggested roles map from project type configs.
109
+ * Call this from the host app (needs access to PROJECT_TYPES).
110
+ */
111
+ export function buildSuggestedRolesMap(projectTypes) {
112
+ const map = {};
113
+ for (const pt of projectTypes) {
114
+ if (pt.suggestedAgents) {
115
+ map[pt.id] = pt.suggestedAgents.map((a) => a.role);
116
+ }
117
+ }
118
+ return map;
119
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.9.11",
3
+ "version": "0.9.13",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",