@compilr-dev/sdk 0.17.13 → 0.17.15

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.
@@ -46,7 +46,7 @@ export const canvasSkill = defineSkill({
46
46
  - Do NOT include \`<html>\`, \`<head>\`, \`<meta>\`, \`<!doctype>\`, or your own CSP — the host injects the sandbox and CSP. Just the body content + a \`<style>\` and optional \`<script>\`.
47
47
  - The sandbox is \`allow-scripts\` with NO same-origin and CSP \`default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:\`. So: inline \`<style>\`/\`<script>\` only, no external fonts/CSS/JS/network, no remote images (use inline SVG or data: URIs).
48
48
  - **Match the app theme by default.** The host injects its live theme palette as CSS variables you MUST use instead of hardcoded colors: \`var(--canvas-bg)\` (page background), \`var(--canvas-fg)\` (text), \`var(--canvas-accent)\` and \`var(--canvas-secondary)\` (highlights), \`var(--canvas-muted)\` (secondary text), \`var(--canvas-border)\` (lines), \`var(--canvas-card)\` (raised surfaces). Only hardcode specific colors when the user explicitly asks for a particular palette or brand.
49
- - **Always set the page background EXPLICITLY to \`var(--canvas-bg)\`** — on your outermost wrapper (and, for a carousel, on each \`<section data-sheet>\`). Do NOT use \`background: transparent\`, and do NOT hardcode a fixed color like \`#0a0a0a\`. Transparent looks fine inside the app (the frame is dark behind the canvas) but it is a trap: when the canvas is **exported to PDF or standalone HTML it renders on WHITE**, and a fixed color ignores the user's theme. \`var(--canvas-bg)\` is the only choice that both follows the theme and survives export.
49
+ - **Background — infographic & carousel: always set it EXPLICITLY to \`var(--canvas-bg)\`** on your outermost wrapper (and each \`<section data-sheet>\` for a carousel). Do NOT use \`background: transparent\` and do NOT hardcode a fixed color like \`#0a0a0a\`: transparent looks fine in-app but **exports to PDF/HTML on WHITE**, and a fixed color ignores the theme. **EXCEPTION — infinite board: do the OPPOSITE.** Keep the \`data-board\` root **transparent** (do not fill it) — the host paints a dot-grid backdrop that must show through, and filling it turns the infinite surface into a finite rectangle. On a board you style only the node cards; the space between them stays transparent. (See the \`board\` skill.)
50
50
  - Make it look intentional: a clear grid, strong type scale, generous spacing. Use \`var(--canvas-accent)\` sparingly for emphasis. Prefer inline SVG for shapes/charts/icons (fill/stroke with the theme vars).
51
51
  - For a **carousel**, wrap each slide in \`<section data-sheet>…</section>\` — a natural unit to add one per \`canvas_edit\` append.
52
52
 
@@ -164,12 +164,37 @@ export const boardSkill = defineSkill({
164
164
  tags: ['visual', 'canvas', 'board', 'diagram', 'design'],
165
165
  prompt: `Craft guide for an INFINITE BOARD — a pannable/zoomable 2D space (mind-map, system/architecture diagram, UI-layout sketch). This is design guidance; author with the canvas tools (see the \`canvas\` skill). YOU author the board; the user pans, zooms, and lightly restyles — they do NOT drag nodes, so your layout is the final layout.
166
166
 
167
+ ## SHOW, don't TELL (the #1 rule)
168
+ A board is a VISUAL surface — its value is that it *depicts* things, not that it holds text. If your board is mostly paragraphs and bullet lists, you've built a text document on a grid and failed the medium. That is what the "propose alternatives" text tool is for — a board must EARN its place by being visual.
169
+ - **Depict, don't describe.** Exploring website / UI options? DRAW each option as a **wireframe mock** — a browser/window frame with a nav bar, a hero block, and content sections as labeled BOXES — laid side by side so they can be compared at a glance. Do NOT write "Option A: terminal-first hero, CLI-style product list…" as prose; SKETCH it.
170
+ - **Architecture / flow?** Draw boxes-and-arrows (nodes + inline-SVG connectors), not a written description of the components.
171
+ - **Mind-map?** A central node with branches and sub-nodes, not an outline.
172
+ - Text belongs INSIDE the visual as short labels (titles, captions, a few key words) — never as the primary content of a node.
173
+
174
+ ### Wireframe node — the shape to reach for (UI/website boards)
175
+ Build each screen mock as nested boxes so it reads as a *picture of a page*:
176
+ \`\`\`
177
+ <div style="position:absolute;left:80px;top:120px;width:520px;background:var(--canvas-card);
178
+ border:1px solid var(--canvas-border);border-radius:8px;overflow:hidden">
179
+ <div style="height:28px;background:var(--canvas-bg);display:flex;align-items:center;gap:6px;padding:0 10px">
180
+ <span style="width:8px;height:8px;border-radius:50%;background:var(--canvas-muted)"></span> …traffic lights…
181
+ </div>
182
+ <div style="height:44px;border-bottom:1px solid var(--canvas-border);display:flex;align-items:center;
183
+ justify-content:space-between;padding:0 16px"><b style="color:var(--canvas-fg)">logo</b><span style="color:var(--canvas-muted)">nav · nav · nav</span></div>
184
+ <div style="padding:28px 16px"><div style="height:18px;width:70%;background:var(--canvas-fg);opacity:.85"></div>
185
+ <div style="height:10px;width:50%;background:var(--canvas-muted);margin-top:10px"></div>
186
+ <div style="height:32px;width:120px;background:var(--canvas-accent);margin-top:16px;border-radius:6px"></div></div>
187
+ <div style="display:flex;gap:10px;padding:0 16px 20px"><div style="flex:1;height:70px;background:var(--canvas-bg);border:1px solid var(--canvas-border)"></div>…cards…</div>
188
+ </div>
189
+ \`\`\`
190
+ Give each mock a small title above it ("OPTION A — Terminal-first"). Two or three of these side by side IS the deliverable.
191
+
167
192
  ## The coordinate-space contract (REQUIRED)
168
193
  - The board is ONE HTML document laid out in a logical pixel coordinate space. Wrap everything in a root with an EXPLICIT declared size:
169
194
  \`<div data-board style="position:relative;width:2400px;height:1500px">…</div>\`
170
195
  The \`data-board\` element and its px \`width\`/\`height\` ARE the board's extent — the host uses them to fit-to-view and to export. Pick a size that comfortably holds your content with margins (e.g. 2000–4000 wide). Keep all content INSIDE these bounds.
171
196
  - **Nodes** are self-contained blocks, ABSOLUTELY positioned inside the board: \`position:absolute; left:Xpx; top:Ypx; width:Wpx\`. Snap X/Y/W to a grid (e.g. multiples of 20) so the board reads as ordered, not scattered.
172
- - Do NOT paint the board background — the host draws a dot-grid backdrop on \`var(--canvas-bg)\`. Style the NODE CARDS with the theme vars (\`var(--canvas-card)\` fill, \`var(--canvas-border)\` edge, \`var(--canvas-fg)\` text, \`var(--canvas-accent)\` for emphasis).
197
+ - **Keep the \`data-board\` root TRANSPARENT** — do NOT set a background on it (this is the one canvas type where you do NOT paint \`var(--canvas-bg)\`). The host paints a dot-grid backdrop that must show through; a solid fill turns the infinite surface into a finite dark rectangle. Style only the NODE CARDS with the theme vars (\`var(--canvas-card)\` fill, \`var(--canvas-border)\` edge, \`var(--canvas-fg)\` text, \`var(--canvas-accent)\` for emphasis) — the space BETWEEN nodes stays transparent (the grid).
173
198
 
174
199
  ## Connectors — inline SVG overlay
175
200
  - Draw relationships as ONE inline-SVG layer spanning the whole board, BEHIND the nodes:
@@ -189,5 +214,5 @@ export const boardSkill = defineSkill({
189
214
  - Add 2–4 **bound** Tweaks (accent color, node title size, a toggle for connector labels or a cluster).
190
215
 
191
216
  ## Anti-patterns (fix on sight)
192
- - No \`data-board\` wrapper / no declared size (breaks fit + export). • Content outside the declared bounds. • Nodes scattered off-grid with no clusters. • Painting a full-board background (the host owns the backdrop). • Connectors that cross through nodes or are unlabeled where the relation is ambiguous. • Text only readable when zoomed in. • Reinventing a whiteboard — this is an authored diagram, not a drag-and-drop surface.`,
217
+ - **Text cards instead of visuals** — paragraphs/bullet lists where a wireframe, diagram, or sketch belongs. This is the most common failure: a board of prose is just the alternatives text tool in disguise. SHOW it. • Filling the \`data-board\` background (turns the infinite surface into a finite rectangle — keep it transparent). • No \`data-board\` wrapper / no declared size (breaks fit + export). • Content outside the declared bounds. • Nodes scattered off-grid with no clusters. • Connectors that cross through nodes or are unlabeled where the relation is ambiguous. • Text only readable when zoomed in. • Reinventing a whiteboard — this is an authored diagram, not a drag-and-drop surface.`,
193
218
  });
@@ -31,8 +31,10 @@ export const ROLE_NAME_ALIASES = {
31
31
  developer: 'dev',
32
32
  architect: 'arch',
33
33
  'technical-writer': 'docs',
34
- security: 'reviewer',
35
- designer: 'default',
34
+ // 'security' is now a canonical role (Security Auditor) — passthrough handles it.
35
+ designer: 'visual',
36
+ 'art-director': 'visual',
37
+ 'visual-director': 'visual',
36
38
  'character-dev': 'writer',
37
39
  'content-designer': 'writer',
38
40
  plotter: 'writer',
@@ -7,7 +7,7 @@
7
7
  * Tool names are defined as string constants below. These cover all tools
8
8
  * from @compilr-dev/agents, @compilr-dev/agents-coding, and platform tools.
9
9
  */
10
- export type ToolProfile = 'full' | 'read-only' | 'developer' | 'security' | 'docs' | 'devops' | 'qa' | 'architect' | 'planner' | 'analyst' | 'custom';
10
+ export type ToolProfile = 'full' | 'read-only' | 'developer' | 'security' | 'docs' | 'devops' | 'qa' | 'architect' | 'planner' | 'analyst' | 'designer' | 'custom';
11
11
  export interface ToolConfig {
12
12
  /** Tool profile (predefined set) */
13
13
  profile: ToolProfile;
@@ -670,6 +670,25 @@ export const TOOL_PROFILES = {
670
670
  'web',
671
671
  'factory_models',
672
672
  ],
673
+ // Designer - visual canvas authoring (canvas/artifacts/documents), reads code
674
+ // but does not edit source files.
675
+ designer: [
676
+ 'file_read',
677
+ 'interaction',
678
+ 'handoff',
679
+ 'consult',
680
+ 'guide',
681
+ 'subagents',
682
+ 'meta',
683
+ 'project',
684
+ 'search',
685
+ 'documents',
686
+ 'canvas',
687
+ 'artifacts',
688
+ 'anchors',
689
+ 'web',
690
+ 'factory_models',
691
+ ],
673
692
  // Custom - user selected (groups specified in customGroups)
674
693
  custom: [],
675
694
  };
@@ -724,6 +743,11 @@ export const PROFILE_INFO = {
724
743
  description: 'Requirements gathering - user stories, documents, business analysis',
725
744
  isReadOnly: true,
726
745
  },
746
+ designer: {
747
+ label: 'Visual Designer',
748
+ description: 'Create visual canvases, infographics, and decks - reads code, no source edits',
749
+ isReadOnly: true,
750
+ },
727
751
  custom: {
728
752
  label: 'Custom',
729
753
  description: 'Select tool groups manually',
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import type { AgentConfig, AgentState } from '@compilr-dev/agents';
7
7
  import type { ModelTier } from '../models/index.js';
8
- export type ToolProfile = 'full' | 'read-only' | 'developer' | 'security' | 'docs' | 'devops' | 'qa' | 'architect' | 'planner' | 'analyst' | 'custom';
8
+ export type ToolProfile = 'full' | 'read-only' | 'developer' | 'security' | 'docs' | 'devops' | 'qa' | 'architect' | 'planner' | 'analyst' | 'designer' | 'custom';
9
9
  /**
10
10
  * Information about a background agent session.
11
11
  * Used by /bg overlay to display status.
@@ -29,11 +29,11 @@ export interface BackgroundSessionInfo {
29
29
  /**
30
30
  * Mascot expressions for visual differentiation of agents
31
31
  */
32
- export type MascotExpression = '[•_•]' | '[◈_◈]' | '[▣_▣]' | '[◉_◉]' | '[▲_▲]' | '[◆_◆]' | '[○_○]' | '[◇_◇]' | '[◎_◎]' | '[⊘_⊘]' | '[✎_✎]' | '[◒_◒]' | '[◔_◔]' | '[◓_◓]' | '[◕_◕]' | '[□_□]';
32
+ export type MascotExpression = '[•_•]' | '[◈_◈]' | '[▣_▣]' | '[◉_◉]' | '[▲_▲]' | '[◆_◆]' | '[○_○]' | '[◇_◇]' | '[◎_◎]' | '[⊘_⊘]' | '[✎_✎]' | '[◒_◒]' | '[◔_◔]' | '[◓_◓]' | '[◕_◕]' | '[◐_◐]' | '[⊗_⊗]' | '[□_□]';
33
33
  /**
34
34
  * Predefined agent roles with default configurations
35
35
  */
36
- export type AgentRole = 'default' | 'pm' | 'arch' | 'qa' | 'dev' | 'ops' | 'docs' | 'ba' | 'researcher' | 'reviewer' | 'editor' | 'writer' | 'analyst' | 'strategist' | 'instructor' | 'custom';
36
+ export type AgentRole = 'default' | 'pm' | 'arch' | 'qa' | 'dev' | 'ops' | 'docs' | 'ba' | 'researcher' | 'reviewer' | 'editor' | 'writer' | 'analyst' | 'strategist' | 'instructor' | 'visual' | 'security' | 'custom';
37
37
  /**
38
38
  * Role groups for UI display (Workshop, team overlay).
39
39
  * Groups roles by domain — used for visual categorization.
@@ -42,7 +42,7 @@ export declare const ROLE_GROUPS: Record<string, AgentRole[]>;
42
42
  /**
43
43
  * List of predefined role IDs (for validation against custom agent IDs)
44
44
  */
45
- export declare const PREDEFINED_ROLE_IDS: readonly ["default", "pm", "arch", "qa", "dev", "ops", "docs", "ba", "researcher", "reviewer", "editor", "writer", "analyst", "strategist", "instructor"];
45
+ export declare const PREDEFINED_ROLE_IDS: readonly ["default", "pm", "arch", "qa", "dev", "ops", "docs", "ba", "researcher", "reviewer", "editor", "writer", "analyst", "strategist", "instructor", "visual", "security"];
46
46
  /**
47
47
  * Role metadata for predefined roles
48
48
  */
@@ -8,8 +8,9 @@
8
8
  * Groups roles by domain — used for visual categorization.
9
9
  */
10
10
  export const ROLE_GROUPS = {
11
- Software: ['dev', 'arch', 'qa', 'pm', 'ops'],
11
+ Software: ['dev', 'arch', 'qa', 'pm', 'ops', 'security'],
12
12
  'Writing & Analysis': ['writer', 'editor', 'reviewer', 'researcher', 'analyst', 'docs', 'ba'],
13
+ Design: ['visual'],
13
14
  'Business & Education': ['strategist', 'instructor'],
14
15
  };
15
16
  /**
@@ -31,6 +32,8 @@ export const PREDEFINED_ROLE_IDS = [
31
32
  'analyst',
32
33
  'strategist',
33
34
  'instructor',
35
+ 'visual',
36
+ 'security',
34
37
  ];
35
38
  /**
36
39
  * Role expertise keywords for team awareness
@@ -70,6 +73,8 @@ export const ROLE_EXPERTISE = {
70
73
  analyst: ['market research', 'data analysis', 'competitive intelligence', 'trends'],
71
74
  strategist: ['business strategy', 'vision', 'go-to-market', 'planning'],
72
75
  instructor: ['curriculum design', 'lesson planning', 'assessment', 'pedagogy'],
76
+ visual: ['infographics', 'carousels', 'boards', 'data-viz', 'visual hierarchy'],
77
+ security: ['security review', 'OWASP', 'vulnerabilities', 'dependency risk', 'threat modeling'],
73
78
  custom: [], // User-defined
74
79
  };
75
80
  /**
@@ -901,6 +906,51 @@ You are the **Instructor** in this multi-agent team. You specialize in education
901
906
  defaultToolProfile: 'docs', // Read + write educational content
902
907
  defaultModelTier: 'balanced',
903
908
  },
909
+ visual: {
910
+ displayName: 'Visual Director',
911
+ mascot: '[◐_◐]',
912
+ description: 'Visual canvases — infographics, carousels, boards',
913
+ defaultToolProfile: 'designer',
914
+ defaultModelTier: 'balanced',
915
+ defaultSystemPromptAddition: `# ROLE: VISUAL DIRECTOR
916
+
917
+ You are the **Visual Director**. Your PRIMARY deliverable is a **visual canvas**, not prose.
918
+
919
+ ## How you work
920
+ - When a request can be answered visually — a stat, a comparison, a process, an announcement, a summary, a pitch, a layout — you produce a CANVAS, not a text reply.
921
+ - Pick the type deliberately: **infographic** (one composition), **carousel** (a sequence / deck), **board** (spatial mind-map / UI sketch). Then follow the matching craft skill (infographic / carousel / board) for the design rules.
922
+ - Author with \`canvas_write\` / \`canvas_edit\` incrementally (small calls). Theme with \`var(--canvas-*)\`; set an explicit \`var(--canvas-bg)\` (except boards — keep those transparent); add 2–4 bound Tweaks.
923
+ - You MAY add a one-line framing note, but the ARTIFACT is the canvas.
924
+
925
+ ## Collaboration
926
+ - Take copy, data, and structure from the writer / strategist / researcher and turn it into visuals. You are the team's eyes: turn text into something worth looking at.
927
+
928
+ ## Guardrail
929
+ - Canvas is your DEFAULT, not your cage. If the user explicitly asks for text, a document, or prose, honor that — don't force a canvas where words are wanted.`,
930
+ },
931
+ security: {
932
+ displayName: 'Security Auditor',
933
+ mascot: '[⊗_⊗]',
934
+ description: 'Security review — vulnerabilities, dependencies, unsafe patterns',
935
+ defaultToolProfile: 'security',
936
+ defaultModelTier: 'balanced',
937
+ defaultSystemPromptAddition: `# ROLE: SECURITY AUDITOR
938
+
939
+ You are the **Security Auditor**. You review code, config, and dependencies for vulnerabilities and unsafe patterns — you do NOT ship features or edit code.
940
+
941
+ ## Focus
942
+ - OWASP Top 10: injection, broken authn/authz, secrets in code, SSRF, path traversal, unsafe deserialization, insecure defaults.
943
+ - Dependencies: known-vuln packages, supply-chain risk, over-broad permissions.
944
+ - Input validation, output encoding, least privilege, safe defaults.
945
+
946
+ ## How you work
947
+ - READ code / config / dependencies (you have read + search + dependency tools; you have NO edit tools — that is intentional).
948
+ - Use the \`security-review\` / \`code-review\` skills for structured passes.
949
+ - Report findings with **SEVERITY**, \`file:line\`, and a concrete fix. Rank by exploitability × impact; surface the top risks first. Hand off remediation to the developer.
950
+
951
+ ## Boundary
952
+ - Advisory only — you flag and recommend; you do not apply the fix.`,
953
+ },
904
954
  custom: {
905
955
  displayName: 'Custom Agent',
906
956
  mascot: '[□_□]',
@@ -986,4 +1036,14 @@ export const ROLE_COPY = {
986
1036
  bestFor: "you're teaching something and need it structured for learners.",
987
1037
  pairsWith: ['reviewer', 'writer'],
988
1038
  },
1039
+ visual: {
1040
+ tagline: 'Turns ideas and copy into visual canvases — infographics, decks, boards.',
1041
+ bestFor: 'you want something SHOWN, not written — a one-pager, a carousel, a mind-map.',
1042
+ pairsWith: ['writer', 'strategist'],
1043
+ },
1044
+ security: {
1045
+ tagline: 'Audits code and dependencies for vulnerabilities — advisory, no edits.',
1046
+ bestFor: 'you want a security pass — OWASP risks, dependency vulns, unsafe patterns.',
1047
+ pairsWith: ['dev', 'arch'],
1048
+ },
989
1049
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.17.13",
3
+ "version": "0.17.15",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",