@compilr-dev/sdk 0.5.9 → 0.6.0

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
@@ -64,7 +64,8 @@ export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getSt
64
64
  export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './skills/index.js';
65
65
  export { ACTION_REGISTRY, getActionsForContext, getActionById, resolveActionPrompt, buildContextSummary, getSuggestedRole, } from './actions/index.js';
66
66
  export type { ActionContext, ActionDefinition } from './actions/index.js';
67
- export { PROJECT_TYPES, getProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, } from './project-types/index.js';
67
+ export { PROJECT_TYPES, getProjectTypeConfig, getEnrichedProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, ACTION_META_REGISTRY, SKILL_META_REGISTRY, resolveActionMeta, getSkillMeta, getAllSkillMeta, } from './project-types/index.js';
68
+ export type { ActionMeta, SkillMeta } from './project-types/index.js';
68
69
  export type { ProjectTypeConfig, ProjectPhase, SuggestedAgent, DocumentTemplate, } from './project-types/index.js';
69
70
  export { defineTool, createSuccessResult, createErrorResult, mergeHooks, createLoggingHooks, createClaudeProvider, createOpenAIProvider, createGeminiNativeProvider, createOllamaProvider, createTogetherProvider, createGroqProvider, createFireworksProvider, createPerplexityProvider, createOpenRouterProvider, createMockProvider, MockProvider, Agent, ContextManager, DEFAULT_CONTEXT_CONFIG, createTaskTool, createSuggestTool, defaultAgentTypes, TOOL_SETS, BUILTIN_GUARDRAILS, TOOL_NAMES, getDefaultShellManager, builtinSkills, AnchorManager, MCPManager, AgentError, ProviderError, ToolError, ToolTimeoutError, MaxIterationsError, AbortError, } from '@compilr-dev/agents';
70
71
  export type { Tool, HooksConfig, AgentEvent, Message, LLMProvider, AnchorInput, ToolExecutionResult, AgentRunResult, PermissionHandler, ToolPermission, AgentTypeConfig, GuardrailTriggeredHandler, BeforeLLMHookResult, BeforeToolHook, BeforeToolHookResult, AfterToolHook, AgentState, AgentConfig, SessionInfo, Anchor, AnchorScope, AnchorClearOptions, AnchorPriority, AnchorQueryOptions, FileAccessType, FileAccess, GuardrailResult, GuardrailContext, MCPClient, MCPToolDefinition, } from '@compilr-dev/agents';
package/dist/index.js CHANGED
@@ -147,7 +147,9 @@ export { ACTION_REGISTRY, getActionsForContext, getActionById, resolveActionProm
147
147
  // =============================================================================
148
148
  // Project Types
149
149
  // =============================================================================
150
- export { PROJECT_TYPES, getProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, } from './project-types/index.js';
150
+ export { PROJECT_TYPES, getProjectTypeConfig, getEnrichedProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig,
151
+ // Action & skill metadata
152
+ ACTION_META_REGISTRY, SKILL_META_REGISTRY, resolveActionMeta, getSkillMeta, getAllSkillMeta, } from './project-types/index.js';
151
153
  // =============================================================================
152
154
  // Re-exports from @compilr-dev/agents (convenience — no need to install separately)
153
155
  // =============================================================================
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Action Metadata
3
+ *
4
+ * Defines UI metadata for project-level and work-item-level actions.
5
+ * Referenced by ProjectTypeConfig.projectActionsMeta / workItemActionsMeta.
6
+ */
7
+ import type { ActionMeta } from './types.js';
8
+ /** All known action metadata, keyed by action/skill ID */
9
+ export declare const ACTION_META_REGISTRY: Record<string, ActionMeta>;
10
+ /**
11
+ * Resolve action IDs to ActionMeta objects.
12
+ * Unknown IDs are returned with a fallback label.
13
+ */
14
+ export declare function resolveActionMeta(actionIds: readonly string[]): ActionMeta[];
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Action Metadata
3
+ *
4
+ * Defines UI metadata for project-level and work-item-level actions.
5
+ * Referenced by ProjectTypeConfig.projectActionsMeta / workItemActionsMeta.
6
+ */
7
+ /** All known action metadata, keyed by action/skill ID */
8
+ export const ACTION_META_REGISTRY = {
9
+ // ── Software project actions ─────────────────────────────────────────────
10
+ 'design': { id: 'design', label: 'Design', icon: 'Wand2', description: 'Design the app' },
11
+ 'prd': { id: 'prd', label: 'PRD', icon: 'FileText', description: 'Write requirements' },
12
+ 'architecture': { id: 'architecture', label: 'Architecture', icon: 'Network', description: 'System architecture' },
13
+ 'refine': { id: 'refine', label: 'Refine', icon: 'RefreshCw', description: 'Refine backlog' },
14
+ 'scaffold': { id: 'scaffold', label: 'Scaffold', icon: 'Layers', description: 'Generate code' },
15
+ 'session-notes': { id: 'session-notes', label: 'Notes', icon: 'StickyNote', description: 'Session summary' },
16
+ // ── Research project actions ─────────────────────────────────────────────
17
+ 'research-scaffold': { id: 'research-scaffold', label: 'New Paper', icon: 'Layers', description: 'Set up from a template' },
18
+ 'outline': { id: 'outline', label: 'Outline', icon: 'BookOpen', description: 'Build paper outline' },
19
+ 'literature-review': { id: 'literature-review', label: 'Lit Review', icon: 'Search', description: 'Analyze sources' },
20
+ 'draft-section': { id: 'draft-section', label: 'Draft', icon: 'PenTool', description: 'Write a section' },
21
+ 'peer-review': { id: 'peer-review', label: 'Review', icon: 'ShieldCheck', description: 'Review the paper' },
22
+ // ── Work item actions ────────────────────────────────────────────────────
23
+ 'build': { id: 'build', label: 'Build', icon: 'Hammer', description: 'Implement this item', category: 'development', suggestedRole: 'developer' },
24
+ 'refine-item': { id: 'refine-item', label: 'Refine', icon: 'RefreshCw', description: 'Add detail to this item', category: 'planning', suggestedRole: 'pm' },
25
+ 'code-review': { id: 'code-review', label: 'Review', icon: 'Search', description: 'Review code for this item', category: 'development', suggestedRole: 'qa' },
26
+ 'explain': { id: 'explain', label: 'Explain', icon: 'BookOpen', description: 'Explain this item', category: 'documentation' },
27
+ };
28
+ /**
29
+ * Resolve action IDs to ActionMeta objects.
30
+ * Unknown IDs are returned with a fallback label.
31
+ */
32
+ export function resolveActionMeta(actionIds) {
33
+ return actionIds.map((id) => ACTION_META_REGISTRY[id] ?? { id, label: id, icon: 'Zap', description: id });
34
+ }
@@ -5,8 +5,10 @@
5
5
  * document templates, and skills. The underlying platform is the same
6
6
  * for all types.
7
7
  */
8
- export type { ProjectTypeConfig, ProjectPhase, SuggestedAgent, DocumentTemplate } from './types.js';
8
+ export type { ProjectTypeConfig, ProjectPhase, SuggestedAgent, DocumentTemplate, ActionMeta, SkillMeta } from './types.js';
9
9
  export { generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, } from './configs.js';
10
+ export { SKILL_META_REGISTRY, getSkillMeta, getAllSkillMeta } from './skill-meta.js';
11
+ export { ACTION_META_REGISTRY, resolveActionMeta } from './action-meta.js';
10
12
  import type { ProjectTypeConfig } from './types.js';
11
13
  /** All registered project types */
12
14
  export declare const PROJECT_TYPES: ProjectTypeConfig[];
@@ -14,3 +16,8 @@ export declare const PROJECT_TYPES: ProjectTypeConfig[];
14
16
  export declare function getProjectTypeConfig(typeId: string): ProjectTypeConfig;
15
17
  /** Get project types grouped by category. */
16
18
  export declare function getProjectTypesByCategory(): Map<string, ProjectTypeConfig[]>;
19
+ /**
20
+ * Get a fully enriched project type config with resolved action metadata.
21
+ * This is the primary API for the desktop app — returns everything needed for UI rendering.
22
+ */
23
+ export declare function getEnrichedProjectTypeConfig(typeId: string): ProjectTypeConfig;
@@ -7,6 +7,10 @@
7
7
  */
8
8
  // Configs
9
9
  export { generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, } from './configs.js';
10
+ // Action & Skill metadata
11
+ export { SKILL_META_REGISTRY, getSkillMeta, getAllSkillMeta } from './skill-meta.js';
12
+ export { ACTION_META_REGISTRY, resolveActionMeta } from './action-meta.js';
13
+ import { resolveActionMeta } from './action-meta.js';
10
14
  import { generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, } from './configs.js';
11
15
  /** All registered project types */
12
16
  export const PROJECT_TYPES = [
@@ -32,3 +36,19 @@ export function getProjectTypesByCategory() {
32
36
  }
33
37
  return groups;
34
38
  }
39
+ /**
40
+ * Get a fully enriched project type config with resolved action metadata.
41
+ * This is the primary API for the desktop app — returns everything needed for UI rendering.
42
+ */
43
+ export function getEnrichedProjectTypeConfig(typeId) {
44
+ const config = getProjectTypeConfig(typeId);
45
+ // Auto-populate *Meta arrays from action IDs if not explicitly set
46
+ if (!config.projectActionsMeta) {
47
+ return {
48
+ ...config,
49
+ projectActionsMeta: resolveActionMeta(config.projectActions),
50
+ workItemActionsMeta: resolveActionMeta(config.workItemActions),
51
+ };
52
+ }
53
+ return config;
54
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Skill Metadata Registry
3
+ *
4
+ * Maps skill IDs to UI metadata (label, icon, category).
5
+ * This is the single source of truth — the desktop reads this via IPC.
6
+ */
7
+ import type { SkillMeta } from './types.js';
8
+ /** All skill UI metadata — platform skills + builtin skills */
9
+ export declare const SKILL_META_REGISTRY: Record<string, SkillMeta>;
10
+ /**
11
+ * Get skill metadata by ID.
12
+ */
13
+ export declare function getSkillMeta(skillId: string): SkillMeta | undefined;
14
+ /**
15
+ * Get all skill metadata entries.
16
+ */
17
+ export declare function getAllSkillMeta(): SkillMeta[];
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Skill Metadata Registry
3
+ *
4
+ * Maps skill IDs to UI metadata (label, icon, category).
5
+ * This is the single source of truth — the desktop reads this via IPC.
6
+ */
7
+ /** All skill UI metadata — platform skills + builtin skills */
8
+ export const SKILL_META_REGISTRY = {
9
+ // ── Platform Skills (SDK) ────────────────────────────────────────────────
10
+ 'design': { id: 'design', label: 'Design App', description: 'Guide through project design', icon: 'Wand2', category: 'design' },
11
+ 'sketch': { id: 'sketch', label: 'Quick Sketch', description: 'Quick project outline', icon: 'Pencil', category: 'design' },
12
+ 'prd': { id: 'prd', label: 'Write PRD', description: 'Product requirements document', icon: 'FileText', category: 'planning' },
13
+ 'refine': { id: 'refine', label: 'Refine Backlog', description: 'Expand and refine requirements', icon: 'RefreshCw', category: 'planning' },
14
+ 'refine-item': { id: 'refine-item', label: 'Refine Item', description: 'Add detail to a work item', icon: 'RefreshCw', category: 'planning' },
15
+ 'architecture': { id: 'architecture', label: 'Architecture', description: 'System architecture design', icon: 'Network', category: 'design' },
16
+ 'session-notes': { id: 'session-notes', label: 'Session Notes', description: 'Summarize work done', icon: 'StickyNote', category: 'documentation' },
17
+ 'build': { id: 'build', label: 'Build', description: 'Implement a feature', icon: 'Hammer', category: 'development' },
18
+ 'scaffold': { id: 'scaffold', label: 'Scaffold', description: 'Generate project code', icon: 'Layers', category: 'development' },
19
+ // ── Research Skills ──────────────────────────────────────────────────────
20
+ 'outline': { id: 'outline', label: 'Paper Outline', description: 'Build paper structure', icon: 'BookOpen', category: 'research' },
21
+ 'literature-review': { id: 'literature-review', label: 'Lit Review', description: 'Analyze sources', icon: 'Search', category: 'research' },
22
+ 'draft-section': { id: 'draft-section', label: 'Draft Section', description: 'Write a paper section', icon: 'PenTool', category: 'research' },
23
+ 'peer-review': { id: 'peer-review', label: 'Peer Review', description: 'Validate argument structure', icon: 'ShieldCheck', category: 'research' },
24
+ 'research-scaffold': { id: 'research-scaffold', label: 'New Paper', description: 'Set up from a template', icon: 'Layers', category: 'research' },
25
+ // ── Builtin Skills (agents library) ──────────────────────────────────────
26
+ 'code-review': { id: 'code-review', label: 'Code Review', description: 'Review code quality', icon: 'Search', category: 'development' },
27
+ 'debug': { id: 'debug', label: 'Debug', description: 'Find and fix bugs', icon: 'Bug', category: 'development' },
28
+ 'explain': { id: 'explain', label: 'Explain', description: 'Explain code or concept', icon: 'BookOpen', category: 'documentation' },
29
+ 'refactor': { id: 'refactor', label: 'Refactor', description: 'Improve code structure', icon: 'Scissors', category: 'development' },
30
+ 'security-review': { id: 'security-review', label: 'Security Review', description: 'Check for vulnerabilities', icon: 'Shield', category: 'analysis' },
31
+ 'planning': { id: 'planning', label: 'Planning', description: 'Plan implementation approach', icon: 'ListTodo', category: 'planning' },
32
+ };
33
+ /**
34
+ * Get skill metadata by ID.
35
+ */
36
+ export function getSkillMeta(skillId) {
37
+ return SKILL_META_REGISTRY[skillId];
38
+ }
39
+ /**
40
+ * Get all skill metadata entries.
41
+ */
42
+ export function getAllSkillMeta() {
43
+ return Object.values(SKILL_META_REGISTRY);
44
+ }
@@ -39,6 +39,30 @@ export interface DocumentTemplate {
39
39
  /** Initial template content (markdown) */
40
40
  template?: string;
41
41
  }
42
+ /**
43
+ * UI metadata for a project-level or work-item-level action.
44
+ */
45
+ export interface ActionMeta {
46
+ id: string;
47
+ label: string;
48
+ /** Lucide icon name */
49
+ icon: string;
50
+ description: string;
51
+ category?: string;
52
+ /** Suggested agent role for this action (work item actions) */
53
+ suggestedRole?: string;
54
+ }
55
+ /**
56
+ * UI metadata for a skill.
57
+ */
58
+ export interface SkillMeta {
59
+ id: string;
60
+ label: string;
61
+ description: string;
62
+ /** Lucide icon name */
63
+ icon: string;
64
+ category: 'design' | 'development' | 'planning' | 'documentation' | 'analysis' | 'research';
65
+ }
42
66
  /**
43
67
  * Full project type configuration.
44
68
  */
@@ -68,6 +92,10 @@ export interface ProjectTypeConfig {
68
92
  short: string;
69
93
  full: string;
70
94
  }>>;
95
+ /** Project-level actions with full UI metadata (replaces projectActions for UI rendering) */
96
+ projectActionsMeta?: ActionMeta[];
97
+ /** Work item actions with full UI metadata (replaces workItemActions for UI rendering) */
98
+ workItemActionsMeta?: ActionMeta[];
71
99
  /** Context line injected into the system prompt (one-liner, deprecated — use systemPromptSection) */
72
100
  systemPromptContext: string;
73
101
  /** Rich multi-line system prompt section for the default agent. Takes precedence over systemPromptContext. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.5.9",
3
+ "version": "0.6.0",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",