@kylewadegrove/cutline-mcp-cli 0.6.0 → 0.6.2

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.
@@ -1,139 +0,0 @@
1
- // ../lib/agent/premortem-handoff.js
2
- function buildBrief(ctx) {
3
- if (!ctx)
4
- return "";
5
- const parts = [];
6
- if (ctx.brief) {
7
- parts.push(ctx.brief);
8
- }
9
- if (ctx.problemSolved && !ctx.brief?.toLowerCase().includes(ctx.problemSolved.toLowerCase().slice(0, 20))) {
10
- parts.push(`Problem: ${ctx.problemSolved}`);
11
- }
12
- if (ctx.uniqueValue && !ctx.brief?.toLowerCase().includes(ctx.uniqueValue.toLowerCase().slice(0, 20))) {
13
- parts.push(`Unique value: ${ctx.uniqueValue}`);
14
- }
15
- if (ctx.targetUser && !ctx.brief?.toLowerCase().includes(ctx.targetUser.toLowerCase().slice(0, 15))) {
16
- parts.push(`Target users: ${ctx.targetUser}`);
17
- }
18
- if (ctx.businessModel && !ctx.brief?.toLowerCase().includes(ctx.businessModel.toLowerCase().slice(0, 15))) {
19
- parts.push(`Business model: ${ctx.businessModel}`);
20
- }
21
- return parts.join(". ").trim() || "No description provided.";
22
- }
23
- function buildReferenceClasses(competitors) {
24
- if (competitors && competitors.length > 0) {
25
- return competitors.filter((c) => c.name && c.name.length > 0).map((c) => c.name).slice(0, 5);
26
- }
27
- return ["General market alternatives"];
28
- }
29
- function buildSeedPersonas(ctx) {
30
- if (!ctx.productContext?.targetUser) {
31
- return void 0;
32
- }
33
- return {
34
- user_personas: [{
35
- name: "Primary User",
36
- description: ctx.productContext.targetUser
37
- // Leave other fields for the personas agent to flesh out
38
- }]
39
- };
40
- }
41
- function buildRunInput(request) {
42
- const { projectName, conversationalContext: ctx, mode = "product", clientContext } = request;
43
- let brief = buildBrief(ctx.productContext);
44
- if (ctx.risks.length > 0) {
45
- const topRisks = ctx.risks.filter((r) => r.severity === "critical" || r.severity === "high").slice(0, 2).map((r) => r.title);
46
- if (topRisks.length > 0) {
47
- brief += ` Key concerns to investigate: ${topRisks.join(", ")}.`;
48
- }
49
- }
50
- if (ctx.verdict?.summary) {
51
- brief += ` Initial assessment: ${ctx.verdict.summary}`;
52
- }
53
- const runInput = {
54
- mode,
55
- project: {
56
- name: projectName,
57
- brief,
58
- reference_classes: buildReferenceClasses(ctx.competitors)
59
- }
60
- };
61
- if (mode === "consulting" && clientContext) {
62
- runInput.client = {
63
- name: clientContext.name,
64
- industry: clientContext.industry,
65
- size: clientContext.size,
66
- stakeholders: clientContext.stakeholders
67
- };
68
- }
69
- const seedPersonas = buildSeedPersonas(ctx);
70
- if (seedPersonas) {
71
- runInput.seed_personas = seedPersonas;
72
- }
73
- if (ctx.risks.length > 0 || ctx.assumptions.length > 0 || ctx.competitors.length > 0) {
74
- runInput.conversational_artifacts = {
75
- risks: ctx.risks.length > 0 ? ctx.risks.map((r) => ({
76
- title: r.title,
77
- description: r.description,
78
- category: r.category,
79
- severity: r.severity,
80
- likelihood: r.likelihood,
81
- impact: r.impact
82
- })) : void 0,
83
- assumptions: ctx.assumptions.length > 0 ? ctx.assumptions.map((a) => ({
84
- statement: a.statement,
85
- category: a.category,
86
- confidence: a.confidence,
87
- importance: a.importance
88
- })) : void 0,
89
- competitors: ctx.competitors.length > 0 ? ctx.competitors.map((c) => ({
90
- name: c.name,
91
- description: c.description,
92
- threat_level: c.threatLevel
93
- })) : void 0,
94
- conversation_summary: ctx.verdict?.summary
95
- };
96
- }
97
- return runInput;
98
- }
99
- function validateForGraduation(ctx) {
100
- const errors = [];
101
- const warnings = [];
102
- if (!ctx.productContext?.brief && !ctx.productContext?.problemSolved) {
103
- errors.push("No product description found. Please describe what you're building first.");
104
- }
105
- if (ctx.assumptions.length === 0) {
106
- warnings.push("No assumptions were surfaced. The full analysis will discover them.");
107
- }
108
- if (ctx.risks.length === 0) {
109
- warnings.push("No risks were identified. The full analysis will analyze risks in depth.");
110
- }
111
- if (ctx.competitors.length === 0) {
112
- warnings.push("No competitors were discussed. Provide reference companies for better analysis.");
113
- }
114
- return {
115
- valid: errors.length === 0,
116
- errors,
117
- warnings
118
- };
119
- }
120
- function buildGraduationMetadata(sessionId, ctx, currentAct) {
121
- return {
122
- sourceType: "conversational_premortem",
123
- sourceSessionId: sessionId,
124
- graduatedAt: Date.now(),
125
- conversationSummary: {
126
- actsCompleted: currentAct,
127
- assumptionsCount: ctx.assumptions.length,
128
- risksCount: ctx.risks.length,
129
- competitorsCount: ctx.competitors.length,
130
- hasVerdict: !!ctx.verdict
131
- }
132
- };
133
- }
134
-
135
- export {
136
- buildRunInput,
137
- validateForGraduation,
138
- buildGraduationMetadata
139
- };