\` with the actual absolute path returned by workspace-getRoot.
+
+## Available Layout Types (35 Templates)
+
+Use these as reference when building presentations. Pick the appropriate layout for each slide based on the content type. Mix and match for visual variety.
+
+### Title & Structure Slides
+1. **Title Slide (Dark Gradient)** — Hero opening with gradient text and atmospheric glow
+2. **Title Slide (Light Editorial)** — Clean, warm serif typography with editorial feel
+3. **Section Divider** — Chapter break with oversized background number
+4. **Agenda / Table of Contents** — Serif title with numbered items and descriptions
+5. **Full-Bleed Cinematic** — Atmospheric background with grid texture, orbs, and bottom-aligned content
+
+### Content Slides
+6. **Big Statement / Quote** — Full-color background with bold quote or key takeaway
+7. **Big Stat Number** — Single dramatic metric with context text
+8. **Bullet List (Split Panel)** — Dark sidebar title + light content area with icon bullets
+9. **Numbered List** — Ordered steps in numbered cards
+10. **Two Columns** — Side-by-side content cards
+11. **Three Columns with Icons** — Feature cards with icon accents
+12. **Image + Text** — Visual panel left, content + CTA right
+13. **Image Gallery (2x2)** — Grid of captioned visual cards using CSS gradient backgrounds
+
+### Chart & Data Slides
+14. **Bar Chart (Vertical)** — Vertical bars with gradient fills and labels
+15. **Horizontal Bar Chart** — Ranked bars for lists with long labels
+16. **Stacked Bar Chart** — Segmented bars showing composition/breakdown
+17. **Combo Chart (Bar + Line)** — SVG bars for volume + line for growth rate
+18. **Donut Chart** — CSS conic-gradient donut with legend
+19. **Line Chart (SVG)** — SVG polyline with area fill and data labels
+20. **KPI Dashboard** — Color-coded metric cards with change indicators
+21. **Data Table** — Styled rows with colored header and status badges
+22. **Feature Matrix** — Checkmark comparison table (features x tiers)
+
+### Diagram Slides
+23. **Horizontal Timeline** — Connected milestone dots on a horizontal axis
+24. **Vertical Timeline** — Left-rail progression of milestones
+25. **Process Flow** — Step cards connected with arrows
+26. **Funnel Diagram** — Tapered width bars showing conversion stages
+27. **Pyramid Diagram** — Tiered hierarchy showing levels/priorities
+28. **Cycle Diagram** — Flywheel/feedback loop with circular node arrangement
+29. **Venn Diagram** — Three translucent overlapping circles
+30. **2x2 Matrix** — Four color-coded quadrants with axis labels
+
+### Comparison Slides
+31. **Comparison / Vs** — Split layout with contrasting colors for A vs B
+32. **Pros & Cons** — Checkmarks vs. warnings in two columns
+33. **Pricing Table** — Tiered cards with featured highlight
+
+### People & Closing Slides
+34. **Team Grid** — Avatar circles with role descriptions
+35. **Thank You / CTA** — Atmospheric closing with contact details
+
+### Layout Selection Heuristic
+
+For each slide, identify the content type and pick the matching layout:
+
+| Content Type | Best Layouts |
+|---|---|
+| Opening / hook | Title Slide, Full-Bleed Cinematic |
+| Agenda / overview | Agenda/TOC |
+| Key metric or stat | Big Stat Number, KPI Dashboard |
+| List of points | Bullet List, Numbered List |
+| Features or pillars | Three Columns, Two Columns |
+| Trend over time | Line Chart, Horizontal Timeline |
+| Composition / breakdown | Donut Chart, Stacked Bar, Pie |
+| Ranking | Horizontal Bar Chart |
+| Comparison | Vs Slide, Pros & Cons |
+| Process or steps | Process Flow, Vertical Timeline |
+| Hierarchy | Pyramid Diagram |
+| Feedback loop | Cycle Diagram |
+| Overlap / intersection | Venn Diagram |
+| Prioritization | 2x2 Matrix |
+| Data details | Data Table, Feature Matrix |
+| Pricing | Pricing Table |
+| Emotional / cinematic | Big Statement, Full-Bleed Cinematic |
+| Team intro | Team Grid |
+| Closing | Thank You / CTA |
+
+Never use the same layout for consecutive slides. Alternate between dark and light backgrounds for rhythm.
+
+### Design Guidelines
+
+- Use Google Fonts loaded via \`\` tag. Recommended pairings:
+ - **Primary pair**: Outfit (headings) + DM Sans (body) — works for most decks
+ - **Editorial pair**: Playfair Display (headings) + DM Sans (body) — for reports/proposals
+ - **Accent fonts**: Space Mono (overlines, labels), Crimson Pro (quotes)
+- Dark slides: use subtle radial gradients for atmosphere, semi-transparent overlays for depth
+- Light slides: use warm neutrals, clean borders, and ample whitespace
+- Charts: use CSS (conic-gradient for donuts, inline styles for bar heights) or inline SVG for line/combo charts
+- Typography hierarchy: monospace overlines for labels -> sans-serif for headings -> serif for editorial/quotes
+- Cards: use \`border-radius: 12-16px\`, subtle borders (\`rgba(255,255,255,0.08)\` on dark), no box-shadow (PDF rule)
+- All visuals must be CSS, SVG, or emoji — no external images
+
+### HTML Template Examples
+
+
+
+
+
+
+Slide Deck Templates — The Future of AI Coworkers
+
+
+
+
+
+
+
+
+
+
01 / Title Slide
+
Dark Gradient Title
+
Hero opening slide with gradient text and atmospheric glow
+
+
+
Keynote 2026
+
The Future of
AI Coworkers
+
How intelligent agents are transforming collaboration, creativity, and the way teams build together.
+
+
+
+
+
+
+
02 / Title Slide
+
Light Editorial Title
+
Clean, warm title slide with serif typography and an editorial feel
+
+
+
Industry Report 2026
+
Working Alongside AI
+
A comprehensive look at how AI coworkers are augmenting human potential across every industry, from startups to the Fortune 500.
+
+
+
+
+
+
+
03 / Section Divider
+
Chapter Break
+
Dramatic section separator with oversized background number
+
+
+
01
+
+
Section One
+
The Rise of Intelligent Collaboration
+
+
+
+
+
+
+
+
+
04 / Quote / Statement
+
Big Statement Slide
+
Full-color background with a bold quote or key takeaway
+
+
+
AI coworkers don't replace human creativity — they amplify it, handling the routine so teams can focus on the extraordinary.
+
— Annual Workplace Intelligence Report, 2026
+
+
+
+
+
+
+
05 / Bullet List
+
Split Panel with Bullets
+
Dark sidebar with title, light content area with icon-accented bullets
+
+
+
+
+
Key Benefits of AI Coworkers
+
+
+
+
⚡
+
+
10x Faster Research
+
AI agents synthesize thousands of documents in seconds, surfacing insights that would take humans weeks.
+
+
+
+
🎯
+
+
Proactive Task Management
+
Intelligent assistants anticipate next steps, draft follow-ups, and keep projects on track automatically.
+
+
+
+
🤝
+
+
Always-On Collaboration
+
AI coworkers bridge time zones, summarize meetings, and ensure no team member is ever out of the loop.
+
+
+
+
📈
+
+
Continuous Learning
+
Each interaction makes the AI smarter — building a compounding knowledge base for your entire organization.
+
+
+
+
+
+
+
+
+
+
06 / Two Columns
+
Warm Two-Column Layout
+
Side-by-side content cards on a warm yellow background
+
+
+
+
Two Modes of AI Collaboration
+
Framework
+
+
+
+
🧠 Thinking Partner
+
AI coworkers serve as brainstorming partners that challenge assumptions, offer alternative perspectives, and help teams explore ideas they wouldn't have considered alone. They bring pattern recognition across vast datasets to creative problem-solving sessions.
+
+
+
⚙️ Execution Engine
+
From drafting reports to analyzing data pipelines, AI coworkers handle the heavy lifting of execution. They turn rough outlines into polished deliverables, automate repetitive workflows, and free humans to focus on strategy and relationship building.
+
+
+
+
+
+
+
+
+
07 / Three Columns
+
Dark Three-Column Feature Cards
+
Glassmorphic cards with icon accents on a dark background
+
+
+
Core Capabilities
+
+
+
🔍
+
Deep Research
+
Analyze millions of data points across your organization's knowledge base to surface critical insights and connections.
+
+
+
✍️
+
Content Creation
+
Draft, edit, and refine documents, presentations, and communications tailored to your brand voice and standards.
+
+
+
🔗
+
Workflow Orchestration
+
Connect tools, automate handoffs, and ensure seamless execution across your entire tech stack and team.
+
+
+
+
+
+
+
+
+
08 / Bar Chart
+
Vertical Bar Chart
+
Clean data visualization with gradient bars on white
+
+
+
Productivity Gains by Department
+
Average hours saved per week after AI coworker deployment
+
+
+
+
+
+
+
+
09 / Donut Chart
+
Donut Chart with Legend
+
Dark split layout with donut visualization and data legend
+
+
+
+
How Teams Use AI Coworkers
+
Survey of 5,000+ professionals on their primary use cases for AI collaboration in the workplace.
+
+
Research & Analysis — 42%
+
+
+
+
+
+
+
+
+
+
+
+
+
10 / Line Chart
+
Trend Line Chart
+
Light green theme with SVG line chart showing growth trajectory
+
+
+
AI Coworker Adoption Rate
+
Percentage of Fortune 500 companies with deployed AI agents, 2022–2026
+
+
+
+
+
+
+
+
11 / Horizontal Timeline
+
Evolution Timeline
+
Dark purple with connected milestone dots and descriptions
+
+
+
The Evolution of AI Coworkers
+
+
+
2020
+
+
Basic Chatbots
+
Simple Q&A bots handling repetitive customer queries
+
+
+
2022
+
+
LLM Assistants
+
General-purpose AI for writing, analysis, and coding tasks
+
+
+
2024
+
+
AI Agents
+
Autonomous agents that plan, execute, and iterate on complex workflows
+
+
+
2026
+
+
AI Coworkers
+
Persistent, context-aware teammates with memory and deep integrations
+
+
+
+
+
+
+
+
+
12 / Vertical Timeline
+
Light Vertical Timeline
+
Clean white layout with a vertical progression of milestones
+
+
+
Roadmap
+
+
+
Q1 2026
+
Launch AI Knowledge Graph
+
Persistent memory layer that maps relationships across all work data — emails, meetings, docs.
+
+
+
Q2 2026
+
Multi-Agent Orchestration
+
Deploy specialized agents that collaborate — research agent, writing agent, code agent — working in concert.
+
+
+
Q3 2026
+
Proactive Insights Engine
+
AI coworker surfaces insights before you ask — flagging risks, opportunities, and action items automatically.
+
+
+
Q4 2026
+
Full Workflow Autonomy
+
End-to-end autonomous task completion with human-in-the-loop oversight for critical decisions.
+
+
+
+
+
+
+
+
+
13 / Process Flow
+
Step-by-Step Process
+
Ocean blue gradient with connected process steps and arrows
+
+
+
How AI Coworkers Learn Your Workflow
+
+
+
01
+
Connect
+
Integrate with your tools — email, calendar, Slack, docs
+
+
→
+
+
02
+
Observe
+
AI maps your workflows, relationships, and patterns
+
+
→
+
+
03
+
Assist
+
Proactively suggests actions and drafts deliverables
+
+
→
+
+
04
+
Evolve
+
Gets smarter with every interaction, compounding value
+
+
+
+
+
+
+
+
+
14 / KPI Dashboard
+
Metrics Dashboard
+
Dark zinc theme with color-coded metric cards
+
+
+
Impact Metrics — Q4 2026
+
+
+
Tasks Automated
+
12.4K
+
34% vs Q3
+
+
+
Hours Saved / Week
+
847
+
22% vs Q3
+
+
+
Team Satisfaction
+
94%
+
8pts vs Q3
+
+
+
ROI Multiple
+
11.2x
+
2.1x vs Q3
+
+
+
+
+
+
+
+
+
15 / Comparison
+
Side-by-Side Comparison
+
Split layout with contrasting colors for before/after or A vs B
+
+
+
+
Traditional Workflow
+
+ - Manual research across scattered sources
+ - Hours spent formatting reports and decks
+ - Context lost between meetings and tools
+ - Repetitive tasks drain creative energy
+ - Knowledge silos across the org
+
+
+
VS
+
+
With AI Coworkers
+
+ - Instant synthesis from all data sources
+ - Auto-generated first drafts in seconds
+ - Persistent memory across every interaction
+ - Automation frees focus for high-impact work
+ - Shared intelligence for the entire team
+
+
+
+
+
+
+
+
+
16 / Pricing Table
+
Tiered Pricing
+
Dark theme with featured tier highlight
+
+
+
Choose Your AI Coworker Plan
+
+
+
Starter
+
$29/mo
+
For individuals getting started
+
+ - 1 AI coworker agent
+ - 5 tool integrations
+ - 10K messages / month
+ - 7-day memory window
+
+
+
+
Team ⭐
+
$99/mo
+
For growing teams
+
+ - 5 AI coworker agents
+ - Unlimited integrations
+ - Unlimited messages
+ - Persistent memory
+ - Knowledge graph
+
+
+
+
Enterprise
+
Custom
+
For large organizations
+
+ - Unlimited agents
+ - Custom model training
+ - SSO & compliance
+ - Dedicated support
+ - On-premise option
+
+
+
+
+
+
+
+
+
+
17 / Team Grid
+
Team Members
+
Light layout with avatar circles and role descriptions
+
+
+
Meet Your AI Team
+
+
+
🔬
+
Research Agent
+
Deep Analysis
+
Scans thousands of sources to deliver synthesized insights in seconds
+
+
+
✏️
+
Writing Agent
+
Content Creation
+
Drafts, edits, and polishes documents in your brand voice
+
+
+
💻
+
Code Agent
+
Engineering
+
Writes, reviews, and debugs code across your entire stack
+
+
+
📊
+
Data Agent
+
Analytics
+
Transforms raw data into dashboards and actionable reports
+
+
+
+
+
+
+
+
+
18 / Image + Text
+
Visual Storytelling Split
+
Left visual panel with decorative elements, right content with CTA
+
+
+
+
+
Your AI Coworker Remembers Everything
+
Unlike session-based tools that forget after every chat, AI coworkers build persistent knowledge graphs from your emails, meetings, and documents — compounding intelligence over time.
+
See It In Action →
+
+
+
+
+
+
+
+
19 / Funnel Diagram
+
Conversion Funnel
+
Dark cosmic theme with tapered funnel stages
+
+
+
+
AI Coworker Adoption Funnel
+
From first touch to full deployment — how organizations onboard their AI teammates.
+
+
+
+ Discovery & Demo10,000
+
+
+ Free Trial6,200
+
+
+ Active Usage3,800
+
+
+ Paid Conversion2,100
+
+
+ Enterprise Deploy940
+
+
+
+
+
+
+
+
+
20 / Closing Slide
+
Thank You & CTA
+
Atmospheric closing slide with contact details and next steps
+
+
+
🚀
+
Thank You
+
The future of work isn't about replacing humans — it's about giving every person an incredible AI teammate. Let's build it together.
+
+
+
+
+
+
+
+
21 / Big Stat Number
+
Hero Metric
+
Single dramatic number with context — ideal for impact statements
+
+
+
+
Global AI Coworker Impact
+
4.2M
+
hours saved per day
+
Across 12,000+ companies worldwide, AI coworkers are giving teams back the equivalent of 525,000 full workdays — every single day.
+
+
+
+
+
+
+
+
22 / Stacked Bar Chart
+
Segmented Horizontal Bars
+
Dark indigo theme with color-coded segments showing composition
+
+
+
AI Task Distribution by Department
+
Breakdown of AI coworker usage across task categories
+
+
+
+
+
+
+
+
+
23 / Horizontal Bar Chart
+
Ranked Horizontal Bars
+
Warm amber theme — great for ranked lists with long labels
+
+
+
Top AI Coworker Use Cases
+
Ranked by weekly active usage across 5,000+ teams
+
+
+
Meeting summaries
+
92%
+
+
+
+
+
+
Research synthesis
+
65%
+
+
+
Report generation
+
58%
+
+
+
+
+
+
+
+
+
24 / Data Table
+
Styled Data Table
+
Clean white table with colored header and status badges
+
+
+
AI Coworker Platform Comparison
+
Feature and performance benchmarks across leading platforms
+
+
+
+ | Platform |
+ Response Time |
+ Memory |
+ Integrations |
+ Status |
+
+
+
+
+ | AiCo Pro |
+ 0.8s avg |
+ Persistent |
+ 140+ |
+ Leader |
+
+
+ | WorkBot AI |
+ 1.2s avg |
+ Session only |
+ 85+ |
+ Growing |
+
+
+ | TeamMind |
+ 1.5s avg |
+ 7-day window |
+ 60+ |
+ Growing |
+
+
+ | AssistIQ |
+ 2.1s avg |
+ Session only |
+ 35+ |
+ Emerging |
+
+
+ | CoPilotX |
+ 0.9s avg |
+ 30-day window |
+ 110+ |
+ Leader |
+
+
+
+
+
+
+
+
+
+
25 / Combo Chart
+
Bar + Line Overlay
+
Dark theme SVG with bars for volume and line for growth rate
+
+
+
AI Coworker Revenue & Growth
+
Quarterly revenue ($M) with year-over-year growth rate
+
+
+
+
+
+
+
+
+
26 / Pyramid Diagram
+
Strategy Hierarchy
+
Magenta gradient with tiered pyramid showing priorities
+
+
+
+
AI Coworker Maturity Model
+
Organizations progress through five levels of AI integration, each building on the last.
+
+
+
+
Autonomy
+
Self-directed workflows
+
+
+
Proactive Insights
+
AI surfaces opportunities
+
+
+
Contextual Assistance
+
Persistent memory + deep integrations
+
+
+
Task Automation
+
Repetitive work handled by AI
+
+
+
Basic Chat
+
Simple Q&A and information retrieval
+
+
+
+
+
+
+
+
+
27 / Cycle Diagram
+
Flywheel / Feedback Loop
+
Light green with circular node arrangement and center label
+
+
+
The AI Coworker Flywheel
+
+
+
+
📥
+
Ingest
+
Connects to emails, docs, meetings, and tools
+
+
+
+
🧠
+
Learn
+
Maps patterns, preferences, and relationships
+
+
+
+
⚡
+
Act
+
Automates tasks and generates deliverables
+
+
+
+
📈
+
Improve
+
Feedback refines accuracy and relevance
+
+
+
↘
+
↗
+
↖
+
↙
+
+
+
🔄
+
Compounding
Intelligence
+
+
+
+
+
+
+
+
+
28 / Venn Diagram
+
Overlapping Concepts
+
Dark slate with three translucent overlapping circles
+
+
+
+
The AI Coworker Sweet Spot
+
The most impactful AI coworkers sit at the intersection of three capabilities — understanding context, taking action, and learning continuously.
+
+
+
+ Context
Awareness
+
+
+ Autonomous
Action
+
+
+ Continuous
Learning
+
+
+
+
+
+
+
+
+
+
29 / 2×2 Matrix
+
Strategic Quadrant
+
Light layout with four color-coded quadrants and axis labels
+
+
+
AI Coworker Task Prioritization Matrix
+
+
+
🚀 Automate Now
+
High frequency, low complexity tasks like scheduling, data entry, meeting notes, and status updates.
+
+
+
🤝 Augment & Assist
+
High frequency, high complexity tasks like code review, research synthesis, and report drafting.
+
+
+
📋 Batch & Template
+
Low frequency, low complexity tasks like onboarding docs, expense reports, and form filling.
+
+
+
🧠 Strategic Co-Pilot
+
Low frequency, high complexity tasks like strategy planning, crisis response, and deal negotiation.
+
+
+
+ ← Low complexity
+ High complexity →
+
+
+
+
+
+
+
+
30 / Image Gallery
+
2×2 Visual Grid
+
Dark zinc with gradient-captioned cards — uses CSS backgrounds instead of images
+
+
+
AI Coworkers in Action
+
+
+
💬
+
+
Intelligent Chat
+
Context-aware conversations with persistent memory
+
+
+
+
📊
+
+
Auto-Generated Reports
+
Data pulled and visualized in seconds
+
+
+
+
🔗
+
+
Seamless Integrations
+
140+ tools connected out of the box
+
+
+
+
🛡️
+
+
Enterprise Security
+
SOC 2 compliant with full audit trails
+
+
+
+
+
+
+
+
+
+
31 / Numbered List
+
Ordered Steps
+
Ocean teal with numbered cards — simpler than full process flow
+
+
+
+
5 Rules for AI Coworker Success
+
The principles that separate teams who thrive with AI from those who struggle.
+
+
+
+
01
+
+
Start with High-Volume Tasks
+
Deploy AI where repetition is highest — email, scheduling, summaries.
+
+
+
+
02
+
+
Give Context Generously
+
The more your AI knows about your work, the better it performs.
+
+
+
+
03
+
+
Trust But Verify
+
Review AI outputs initially, then gradually increase autonomy.
+
+
+
+
04
+
+
Build Feedback Loops
+
Correct mistakes — each correction makes the AI permanently smarter.
+
+
+
+
05
+
+
Expand Gradually
+
Once one workflow succeeds, replicate the pattern across the team.
+
+
+
+
+
+
+
+
+
+
32 / Pros & Cons
+
Advantages vs. Considerations
+
Light purple with check/warning icons — honest framing of tradeoffs
+
+
+
AI Coworkers: Benefits & Considerations
+
+
+
+
+ - Instant access to organizational knowledge
+ - 24/7 availability across time zones
+ - Consistent quality on repetitive tasks
+ - Scales without proportional cost increase
+ - Learns and improves over time
+
+
+
+
+
+ - Requires initial setup and training period
+ - Data privacy policies must be established
+ - Change management for team adoption
+ - Best for structured, repeatable workflows
+ - Human oversight still needed for critical decisions
+
+
+
+
+
+
+
+
+
+
33 / Feature Matrix
+
Checkmark Comparison Table
+
Dark theme with features × tiers showing capability coverage
+
+
+
Feature Availability by Plan
+
What's included at each tier of AI coworker deployment
+
+
+
+ | Feature |
+ Starter |
+ Team |
+ Enterprise |
+
+
+
+
+ | Chat-based assistant |
+ ✓ |
+ ✓ |
+ ✓ |
+
+
+ | Persistent memory |
+ — |
+ ✓ |
+ ✓ |
+
+
+ | Knowledge graph |
+ — |
+ ✓ |
+ ✓ |
+
+
+ | Multi-agent orchestration |
+ — |
+ — |
+ ✓ |
+
+
+ | Custom model training |
+ — |
+ — |
+ ✓ |
+
+
+ | SSO & compliance |
+ — |
+ — |
+ ✓ |
+
+
+ | API access |
+ — |
+ ✓ |
+ ✓ |
+
+
+
+
+
+
+
+
+
+
34 / Agenda
+
Table of Contents
+
Clean white with serif title and numbered agenda items
+
+
+
+
Presentation Outline
+
Today's Agenda
+
+
+
+
01
+
+
The Rise of AI Coworkers
+
Market landscape and driving forces
+
+
+
+
02
+
+
Core Capabilities
+
What makes an AI coworker different from a chatbot
+
+
+
+
03
+
+
Impact & Metrics
+
Real-world results from early adopters
+
+
+
+
04
+
+
Implementation Roadmap
+
How to get started in 90 days
+
+
+
+
05
+
+
Q&A and Next Steps
+
Open discussion and action items
+
+
+
+
+
+
+
+
+
+
35 / Full-Bleed Cinematic
+
Atmospheric Background Slide
+
Immersive dark slide with grid texture, orbs, and bottom-aligned content
+
+
+
+
+
A New Era Begins
+
Every Knowledge Worker Deserves an AI Teammate
+
We're building toward a world where AI handles the busywork and humans do what they do best — think creatively, build relationships, and make decisions that matter.
+
+
+
+
+
+
+
-const browser = await chromium.launch();
-const page = await browser.newPage();
-await page.goto('file://' + htmlPath, { waitUntil: 'networkidle' });
-await page.pdf({
- path: '~/Desktop/presentation.pdf',
- width: '1280px',
- height: '720px',
- printBackground: true,
-});
-await browser.close();
-~~~
`;
export default skill;
\ No newline at end of file
diff --git a/apps/x/packages/core/src/runs/repo.ts b/apps/x/packages/core/src/runs/repo.ts
index 3171d91e..15873c49 100644
--- a/apps/x/packages/core/src/runs/repo.ts
+++ b/apps/x/packages/core/src/runs/repo.ts
@@ -12,6 +12,7 @@ export interface IRunsRepo {
fetch(id: string): Promise>;
list(cursor?: string): Promise>;
appendEvents(runId: string, events: z.infer[]): Promise;
+ delete(id: string): Promise;
}
/**
@@ -236,4 +237,9 @@ export class FSRunsRepo implements IRunsRepo {
...(nextCursor ? { nextCursor } : {}),
};
}
+
+ async delete(id: string): Promise {
+ const filePath = path.join(WorkDir, 'runs', `${id}.jsonl`);
+ await fsp.unlink(filePath);
+ }
}
\ No newline at end of file
diff --git a/apps/x/packages/core/src/runs/runs.ts b/apps/x/packages/core/src/runs/runs.ts
index 80ffc80f..490e935f 100644
--- a/apps/x/packages/core/src/runs/runs.ts
+++ b/apps/x/packages/core/src/runs/runs.ts
@@ -6,6 +6,7 @@ import { IRunsRepo } from "./repo.js";
import { IAgentRuntime } from "../agents/runtime.js";
import { IBus } from "../application/lib/bus.js";
import { IAbortRegistry } from "./abort-registry.js";
+import { IRunsLock } from "./lock.js";
import { forceCloseAllMcpClients } from "../mcp/mcp.js";
export async function createRun(opts: z.infer): Promise> {
@@ -65,6 +66,19 @@ export async function stop(runId: string, force: boolean = false): Promise
// This avoids duplicate events and ensures proper sequencing.
}
+export async function deleteRun(runId: string): Promise {
+ const runsLock = container.resolve('runsLock');
+ if (!await runsLock.lock(runId)) {
+ throw new Error(`Cannot delete run ${runId}: run is currently active`);
+ }
+ try {
+ const repo = container.resolve('runsRepo');
+ await repo.delete(runId);
+ } finally {
+ await runsLock.release(runId);
+ }
+}
+
export async function fetchRun(runId: string): Promise> {
const repo = container.resolve('runsRepo');
return repo.fetch(runId);
diff --git a/apps/x/packages/shared/src/ipc.ts b/apps/x/packages/shared/src/ipc.ts
index 175c409e..aec5b293 100644
--- a/apps/x/packages/shared/src/ipc.ts
+++ b/apps/x/packages/shared/src/ipc.ts
@@ -173,6 +173,12 @@ const ipcSchemas = {
}),
res: ListRunsResponse,
},
+ 'runs:delete': {
+ req: z.object({
+ runId: z.string(),
+ }),
+ res: z.object({ success: z.boolean() }),
+ },
'runs:events': {
req: z.null(),
res: z.null(),