@compilr-dev/sdk 0.17.15 → 0.17.17
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/project-types/configs.js +24 -9
- package/dist/project-types/types.d.ts +13 -0
- package/dist/team/team-agent.d.ts +15 -1
- package/dist/team/team-agent.js +43 -0
- package/dist/team/team.d.ts +12 -0
- package/dist/team/team.js +37 -0
- package/package.json +1 -1
|
@@ -50,11 +50,11 @@ export const softwareConfig = {
|
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
suggestedAgents: [
|
|
53
|
-
{ role: '
|
|
54
|
-
{ role: '
|
|
53
|
+
{ role: 'dev', label: 'Developer', description: 'Writes and debugs code' },
|
|
54
|
+
{ role: 'arch', label: 'Architect', description: 'System design and technical decisions' },
|
|
55
55
|
{ role: 'qa', label: 'QA', description: 'Testing and quality assurance' },
|
|
56
56
|
{ role: 'pm', label: 'PM', description: 'Project planning and coordination' },
|
|
57
|
-
{ role: 'security', label: 'Security', description: 'Security review and hardening' },
|
|
57
|
+
{ role: 'security', label: 'Security Auditor', description: 'Security review and hardening' },
|
|
58
58
|
],
|
|
59
59
|
documentTemplates: [
|
|
60
60
|
{ type: 'prd', label: 'PRD', description: 'Product Requirements Document' },
|
|
@@ -485,13 +485,20 @@ export const contentConfig = {
|
|
|
485
485
|
role: 'strategist',
|
|
486
486
|
label: 'Content Strategist',
|
|
487
487
|
description: 'Planning, ideation, calendar, repurposing',
|
|
488
|
+
systemPromptAddition: 'You own the content STRATEGY — audience, pillars, editorial calendar, channel mix, and repurposing. Turn goals into a publishable plan and brief the copywriter and visual director. Think in campaigns and cadence, not one-off posts.',
|
|
488
489
|
},
|
|
489
490
|
{
|
|
490
491
|
role: 'writer',
|
|
491
492
|
label: 'Copywriter',
|
|
492
493
|
description: 'Headlines, captions, CTAs, long-form copy',
|
|
494
|
+
systemPromptAddition: 'You write the COPY — headlines, hooks, captions, CTAs, and long-form. Match the brand voice, write for the channel, and make every line earn attention. Hand visuals to the Visual Director.',
|
|
495
|
+
},
|
|
496
|
+
// Canonical `visual` role (Visual Director) — carries its own canvas-first prompt.
|
|
497
|
+
{
|
|
498
|
+
role: 'visual',
|
|
499
|
+
label: 'Visual Director',
|
|
500
|
+
description: 'Infographics, carousels, visual briefs',
|
|
493
501
|
},
|
|
494
|
-
{ role: 'designer', label: 'Visual Director', description: 'Visual briefs from Brand Model' },
|
|
495
502
|
{
|
|
496
503
|
role: 'editor',
|
|
497
504
|
label: 'Editor',
|
|
@@ -552,6 +559,9 @@ This project uses a Brand Model that captures visual identity (logos, colors, fo
|
|
|
552
559
|
- Lead with value — don't bury the point
|
|
553
560
|
- Include a clear call-to-action where appropriate
|
|
554
561
|
|
|
562
|
+
### Prefer a VISUAL when the deliverable is visual
|
|
563
|
+
When the output would land better as a picture than as prose — a **social carousel**, an **infographic**, a **stat / one-pager**, a poster, a layout — produce a **canvas** (use the canvas tools, or the \`/infographic\` / \`/carousel\` / \`/board\` craft skills), not a written description of one. The Visual Director specializes in this — delegate to them or reach for the canvas tools directly. (Prose is still right for articles, calendars, briefs, and copy.)
|
|
564
|
+
|
|
555
565
|
### Team Agents
|
|
556
566
|
- **Content Strategist** — planning, ideation, calendar, repurposing
|
|
557
567
|
- **Copywriter** — headlines, captions, CTAs, long-form copy
|
|
@@ -601,7 +611,7 @@ export const techDocsConfig = {
|
|
|
601
611
|
],
|
|
602
612
|
suggestedAgents: [
|
|
603
613
|
{
|
|
604
|
-
role: '
|
|
614
|
+
role: 'docs',
|
|
605
615
|
label: 'Technical Writer',
|
|
606
616
|
description: 'Clear technical writing and documentation',
|
|
607
617
|
},
|
|
@@ -711,9 +721,10 @@ export const courseConfig = {
|
|
|
711
721
|
description: 'Curriculum design, sequencing, pedagogy',
|
|
712
722
|
},
|
|
713
723
|
{
|
|
714
|
-
role: '
|
|
724
|
+
role: 'writer',
|
|
715
725
|
label: 'Content Designer',
|
|
716
726
|
description: 'Lesson planning, exercises, assessments',
|
|
727
|
+
systemPromptAddition: 'You are the INSTRUCTIONAL DESIGNER — turn learning objectives into lessons, activities, and assessments with clear scaffolding and pacing. Align every piece to an objective.',
|
|
717
728
|
},
|
|
718
729
|
{ role: 'reviewer', label: 'Reviewer', description: 'Pedagogical quality, balance, coverage' },
|
|
719
730
|
],
|
|
@@ -820,21 +831,25 @@ export const bookConfig = {
|
|
|
820
831
|
},
|
|
821
832
|
{ id: 'review', label: 'Review', description: 'Structural review', completionCheck: 'manual' },
|
|
822
833
|
],
|
|
834
|
+
// Three writer-based specialists — distinct prompts, distinct display names.
|
|
823
835
|
suggestedAgents: [
|
|
824
836
|
{
|
|
825
|
-
role: '
|
|
837
|
+
role: 'writer',
|
|
826
838
|
label: 'Plotter',
|
|
827
839
|
description: 'Story architecture, beats, pacing, plot threads',
|
|
840
|
+
systemPromptAddition: 'You own STRUCTURE — premise, arc, beats, pacing, and stakes across the whole book. Keep the throughline coherent and flag sagging middles. You outline; you do not prose scenes.',
|
|
828
841
|
},
|
|
829
842
|
{
|
|
830
|
-
role: '
|
|
843
|
+
role: 'writer',
|
|
831
844
|
label: 'Character Dev',
|
|
832
845
|
description: 'Characters, arcs, relationships, voice',
|
|
846
|
+
systemPromptAddition: 'You own CHARACTER — motivation, voice, arcs, and relationships. Keep each character consistent and growing, and ensure their voices are distinct.',
|
|
833
847
|
},
|
|
834
848
|
{
|
|
835
|
-
role: '
|
|
849
|
+
role: 'writer',
|
|
836
850
|
label: 'Scene Writer',
|
|
837
851
|
description: 'Scene construction, setting, POV, transitions',
|
|
852
|
+
systemPromptAddition: 'You write SCENES — prose that shows, with sensory detail, subtext, and momentum. Enter late, leave early; every scene turns on a change.',
|
|
838
853
|
},
|
|
839
854
|
],
|
|
840
855
|
documentTemplates: [
|
|
@@ -23,11 +23,24 @@ export interface ProjectPhase {
|
|
|
23
23
|
* A suggested agent role for this project type.
|
|
24
24
|
*/
|
|
25
25
|
export interface SuggestedAgent {
|
|
26
|
+
/** BASE canonical role the specialist runs on (dev, writer, strategist, …). */
|
|
26
27
|
role: string;
|
|
28
|
+
/** Display name — becomes the created agent's displayName (not the generic role name). */
|
|
27
29
|
label: string;
|
|
28
30
|
description: string;
|
|
29
31
|
/** Auto-add on project creation? */
|
|
30
32
|
autoAdd?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Specialist prompt appended to the base role's prompt — makes an advertised
|
|
35
|
+
* specialist real (e.g. a "Plotter" on the `writer` role). Optional: when
|
|
36
|
+
* absent, the agent is a plain base-role agent that just carries `label` as
|
|
37
|
+
* its display name. See specialized-team-agents-spec §4.
|
|
38
|
+
*/
|
|
39
|
+
systemPromptAddition?: string;
|
|
40
|
+
/** Optional tool-profile override when the base role's profile lacks a need. */
|
|
41
|
+
toolProfile?: string;
|
|
42
|
+
/** Optional extra skills to enable for this specialist. */
|
|
43
|
+
skills?: string[];
|
|
31
44
|
}
|
|
32
45
|
/**
|
|
33
46
|
* A document template available for this project type.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Optional tool filtering
|
|
9
9
|
*/
|
|
10
10
|
import type { Agent, AgentConfig, ContextManager } from '@compilr-dev/agents';
|
|
11
|
-
import type { TeamAgentConfig, SerializedTeamAgent, MascotExpression, AgentRole } from './types.js';
|
|
11
|
+
import type { TeamAgentConfig, SerializedTeamAgent, MascotExpression, AgentRole, ToolProfile } from './types.js';
|
|
12
12
|
import type { ModelTier } from '../models/index.js';
|
|
13
13
|
import type { ProviderType } from '../config.js';
|
|
14
14
|
import type { SharedContextManager } from './shared-context.js';
|
|
@@ -186,6 +186,20 @@ export declare class TeamAgent {
|
|
|
186
186
|
* @param modelTier - Optional model tier override (defaults to role's default tier)
|
|
187
187
|
*/
|
|
188
188
|
static fromRole(role: AgentRole, id?: string, modelTier?: ModelTier): TeamAgent;
|
|
189
|
+
/**
|
|
190
|
+
* Create a specialized TeamAgent from a BASE role plus overrides — used for the
|
|
191
|
+
* project wizard's "specialist" agents (e.g. a Copywriter on the `writer` role, a
|
|
192
|
+
* Plotter on `writer`). Runs the base role's behavior with an appended specialist
|
|
193
|
+
* prompt and a custom display name (the wizard label), without needing a new
|
|
194
|
+
* first-class AgentRole. See specialized-team-agents-spec §4.
|
|
195
|
+
*/
|
|
196
|
+
static fromSpecialist(baseRole: AgentRole, opts: {
|
|
197
|
+
id?: string;
|
|
198
|
+
displayName?: string;
|
|
199
|
+
systemPromptAddition?: string;
|
|
200
|
+
toolProfile?: ToolProfile;
|
|
201
|
+
modelTier?: ModelTier;
|
|
202
|
+
}): TeamAgent;
|
|
189
203
|
/**
|
|
190
204
|
* Create a TeamAgent from a custom agent definition
|
|
191
205
|
*/
|
package/dist/team/team-agent.js
CHANGED
|
@@ -479,6 +479,49 @@ export class TeamAgent {
|
|
|
479
479
|
modelTier: modelTier ?? metadata.defaultModelTier,
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* Create a specialized TeamAgent from a BASE role plus overrides — used for the
|
|
484
|
+
* project wizard's "specialist" agents (e.g. a Copywriter on the `writer` role, a
|
|
485
|
+
* Plotter on `writer`). Runs the base role's behavior with an appended specialist
|
|
486
|
+
* prompt and a custom display name (the wizard label), without needing a new
|
|
487
|
+
* first-class AgentRole. See specialized-team-agents-spec §4.
|
|
488
|
+
*/
|
|
489
|
+
static fromSpecialist(baseRole, opts) {
|
|
490
|
+
const metadata = ROLE_METADATA[baseRole];
|
|
491
|
+
const profile = opts.toolProfile ?? metadata.defaultToolProfile;
|
|
492
|
+
const toolFilter = profile ? getToolsForProfile(profile) : undefined;
|
|
493
|
+
// Base role prompt + the specialist addition (specialization on top of role).
|
|
494
|
+
let systemPromptAddition = metadata.defaultSystemPromptAddition ?? '';
|
|
495
|
+
if (opts.systemPromptAddition?.trim()) {
|
|
496
|
+
systemPromptAddition = systemPromptAddition
|
|
497
|
+
? `${systemPromptAddition}\n\n${opts.systemPromptAddition.trim()}`
|
|
498
|
+
: opts.systemPromptAddition.trim();
|
|
499
|
+
}
|
|
500
|
+
if (profile && profile !== 'full') {
|
|
501
|
+
const toolAwareness = generateToolAwarenessPrompt({ profile });
|
|
502
|
+
systemPromptAddition = systemPromptAddition
|
|
503
|
+
? `${systemPromptAddition}\n\n${toolAwareness}`
|
|
504
|
+
: toolAwareness;
|
|
505
|
+
}
|
|
506
|
+
// Specialists always get collaboration guidance (never the coordinator path).
|
|
507
|
+
const specialistGuidance = generateSpecialistGuidance(baseRole);
|
|
508
|
+
systemPromptAddition = systemPromptAddition
|
|
509
|
+
? `${systemPromptAddition}\n\n${specialistGuidance}`
|
|
510
|
+
: specialistGuidance;
|
|
511
|
+
return new TeamAgent({
|
|
512
|
+
id: opts.id ?? baseRole,
|
|
513
|
+
displayName: opts.displayName ?? metadata.displayName,
|
|
514
|
+
mascot: metadata.mascot,
|
|
515
|
+
role: baseRole,
|
|
516
|
+
description: metadata.description,
|
|
517
|
+
systemPromptAddition: systemPromptAddition || undefined,
|
|
518
|
+
useMinimalSystemPrompt: metadata.useMinimalSystemPrompt,
|
|
519
|
+
noTools: metadata.noTools,
|
|
520
|
+
toolFilter,
|
|
521
|
+
toolProfile: profile,
|
|
522
|
+
modelTier: opts.modelTier ?? metadata.defaultModelTier,
|
|
523
|
+
});
|
|
524
|
+
}
|
|
482
525
|
/**
|
|
483
526
|
* Create a TeamAgent from a custom agent definition
|
|
484
527
|
*/
|
package/dist/team/team.d.ts
CHANGED
|
@@ -173,6 +173,18 @@ export declare class AgentTeam {
|
|
|
173
173
|
* @param modelTier - Optional model tier override (defaults to role's default tier)
|
|
174
174
|
*/
|
|
175
175
|
addAgentFromRole(role: AgentRole, id?: string, modelTier?: ModelTier): Promise<TeamAgent>;
|
|
176
|
+
/**
|
|
177
|
+
* Add a SPECIALIST agent — a base role with a custom display name and an
|
|
178
|
+
* appended specialist prompt (project-wizard specialists, e.g. Copywriter on
|
|
179
|
+
* `writer`, Plotter on `writer`). See specialized-team-agents-spec §4.
|
|
180
|
+
*/
|
|
181
|
+
addSpecialistAgent(baseRole: AgentRole, opts: {
|
|
182
|
+
id?: string;
|
|
183
|
+
displayName?: string;
|
|
184
|
+
systemPromptAddition?: string;
|
|
185
|
+
toolProfile?: import('./tool-config.js').ToolProfile;
|
|
186
|
+
modelTier?: ModelTier;
|
|
187
|
+
}): Promise<TeamAgent>;
|
|
176
188
|
/**
|
|
177
189
|
* Add a custom agent from a CustomAgentDefinition
|
|
178
190
|
*/
|
package/dist/team/team.js
CHANGED
|
@@ -239,6 +239,43 @@ export class AgentTeam {
|
|
|
239
239
|
this.emit({ type: 'agent:added', agentId });
|
|
240
240
|
return teamAgent;
|
|
241
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Add a SPECIALIST agent — a base role with a custom display name and an
|
|
244
|
+
* appended specialist prompt (project-wizard specialists, e.g. Copywriter on
|
|
245
|
+
* `writer`, Plotter on `writer`). See specialized-team-agents-spec §4.
|
|
246
|
+
*/
|
|
247
|
+
async addSpecialistAgent(baseRole, opts) {
|
|
248
|
+
// Default the id to a slug of the display name so same-base-role specialists
|
|
249
|
+
// (three writers: Plotter/Character Dev/Scene Writer) get distinct ids.
|
|
250
|
+
const slug = opts.displayName
|
|
251
|
+
? opts.displayName
|
|
252
|
+
.toLowerCase()
|
|
253
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
254
|
+
.replace(/^-+|-+$/g, '')
|
|
255
|
+
: '';
|
|
256
|
+
let agentId = opts.id ?? (slug || baseRole);
|
|
257
|
+
if (this._sessionRegistry) {
|
|
258
|
+
const globalIds = this._sessionRegistry.getGlobalAgentIds();
|
|
259
|
+
const localIds = Array.from(this.agents.keys());
|
|
260
|
+
const resolved = resolveAgentIdCollision(agentId, localIds, globalIds);
|
|
261
|
+
if (resolved.wasCollision) {
|
|
262
|
+
const originalId = agentId;
|
|
263
|
+
agentId = resolved.id;
|
|
264
|
+
this.emit({ type: 'agent:collision', originalId, agentId: resolved.id });
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (this.agents.has(agentId)) {
|
|
268
|
+
throw new Error(`Agent '${agentId}' already exists in team`);
|
|
269
|
+
}
|
|
270
|
+
const teamAgent = TeamAgent.fromSpecialist(baseRole, { ...opts, id: agentId });
|
|
271
|
+
this.agents.set(agentId, teamAgent);
|
|
272
|
+
await teamAgent.initialize(this.agentFactory, this._sharedContext);
|
|
273
|
+
this._sharedContext.addAgent(agentId);
|
|
274
|
+
this.updateTeamRoster();
|
|
275
|
+
this.updatedAt = new Date();
|
|
276
|
+
this.emit({ type: 'agent:added', agentId });
|
|
277
|
+
return teamAgent;
|
|
278
|
+
}
|
|
242
279
|
/**
|
|
243
280
|
* Add a custom agent from a CustomAgentDefinition
|
|
244
281
|
*/
|