@sonnechasser/ntrp 1.4.6 → 1.4.7
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.js +78 -15
- package/dist/mcp/server.js +40 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -232,6 +232,30 @@ function severityLabel(severity) {
|
|
|
232
232
|
return severity.toUpperCase();
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
+
function pickGoverningFinding(findings) {
|
|
236
|
+
if (findings.length === 0) return null;
|
|
237
|
+
return findings.find((f) => f.severity === "critical") ?? findings.find((f) => f.severity === "warning") ?? findings[0] ?? null;
|
|
238
|
+
}
|
|
239
|
+
function findingHeadline(findingText) {
|
|
240
|
+
const trimmed = findingText.trim();
|
|
241
|
+
if (!trimmed) return "";
|
|
242
|
+
const match = trimmed.match(/^(.+?[.!?])(?:\s|$)/);
|
|
243
|
+
return (match?.[1] ?? trimmed.split(/\n/)[0] ?? trimmed).trim();
|
|
244
|
+
}
|
|
245
|
+
function formatTheCallSection(findings) {
|
|
246
|
+
const pick3 = pickGoverningFinding(findings);
|
|
247
|
+
if (!pick3) return "";
|
|
248
|
+
const headline = findingHeadline(pick3.finding);
|
|
249
|
+
if (!headline) return "";
|
|
250
|
+
const alreadyHasDollar = /\$[\d.,]+/.test(headline);
|
|
251
|
+
const dollar = !alreadyHasDollar && pick3.dollar_value != null && pick3.dollar_value > 0 ? `**${formatDollarValue(pick3.dollar_value)}** \u2014 ` : "";
|
|
252
|
+
return [
|
|
253
|
+
"## The Call",
|
|
254
|
+
"",
|
|
255
|
+
`${dollar}${headline}`,
|
|
256
|
+
""
|
|
257
|
+
].join("\n");
|
|
258
|
+
}
|
|
235
259
|
var VITAL_SIGN_LABELS, DOLLAR_LABELS;
|
|
236
260
|
var init_formatters = __esm({
|
|
237
261
|
"src/output/formatters.ts"() {
|
|
@@ -20719,7 +20743,7 @@ function buildFindingsFindingHint(prefs) {
|
|
|
20719
20743
|
const voice2 = prefs ?? loadVoicePrefs();
|
|
20720
20744
|
const register = voice2.personality === "robotic" ? "STE-100 sentences. No contractions, slang, or filler." : voice2.personality === "composed" ? "Composed consultant sentences. Light contractions OK." : voice2.personality === "casual" ? "Casual consultant sentences. Warm, still short." : "Loose consultant sentences. Personality in the wrap, not the math.";
|
|
20721
20745
|
const roast = voice2.roast === "light" ? "Light roast: what is working, then what to improve." : voice2.roast === "medium" ? "Medium roast: name the miss. No padding." : voice2.roast === "dark" ? "Dark roast: surgical. Verdict + dollar in one breath." : "Heavy roast: maximum roast after the number, never instead of it.";
|
|
20722
|
-
return `Pyramid-shaped, 2-3 sentences: (1) HEADLINE \u2014 verdict + dollar figure in one short sentence (\u226420 words); (2)
|
|
20746
|
+
return `Pyramid-shaped, 2-3 sentences: (1) HEADLINE \u2014 verdict + dollar figure in one short sentence (\u226420 words); (2) DRIVERS \u2014 the one or two distinct, non-overlapping numbers that prove it; (3) SO-WHAT \u2014 the consequence or the action. ${register} ${roast} Keep dollar figures and play names. Do not invent numbers. An executive should be able to repeat sentence 1 from memory.`;
|
|
20723
20747
|
}
|
|
20724
20748
|
function buildFindingsSchemaBlock(prefs) {
|
|
20725
20749
|
const finding = buildFindingsFindingHint(prefs);
|
|
@@ -21915,10 +21939,10 @@ function wrapForTarget(target, analysisBlock, conversationBlock, openQuestions,
|
|
|
21915
21939
|
const contextLabel = handoffInstructionPrefix(ctx.analysis.primary);
|
|
21916
21940
|
const forWhom = audiencePhrase(ctx.scope?.audience);
|
|
21917
21941
|
const instructions = {
|
|
21918
|
-
deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}.
|
|
21942
|
+
deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}. Pyramid structure: (1) HEADLINE \u2014 the governing number and verdict in one line; (2) DRIVERS \u2014 2\u20133 distinct, non-overlapping risks or causes with dollar impact (not a full scorecard); (3) SO-WHAT \u2014 recommended plays; (4) ASKS / decisions the room must make. Optionally one pipeline-health slide after the headline if it supports the call. Use the Metric definitions appendix so every slide can briefly remind the room what the number means for this audience.`,
|
|
21919
21943
|
asana: `produce an Asana project plan with sections and tasks tied to findings for ${forWhom}. Prioritize by dollar impact. Reference metric definitions when a task owner needs to know what "good" looks like.`,
|
|
21920
21944
|
clay: `produce a Clay table specification to operationalize the highest-impact finding for ${forWhom}.`,
|
|
21921
|
-
plan: `produce a prioritized action plan for ${forWhom} with problem, play, first 3 steps, owner, and leading indicator
|
|
21945
|
+
plan: `produce a prioritized action plan for ${forWhom}, answer-first: open with the governing call (highest-dollar problem), then items each with problem, play, first 3 steps, owner, and leading indicator. Ground indicators in the Metric definitions appendix. End with the sharpest asks / decisions.`
|
|
21922
21946
|
};
|
|
21923
21947
|
const parts = [
|
|
21924
21948
|
`# NTRP handoff \u2192 ${target}`,
|
|
@@ -22825,6 +22849,7 @@ ${opts.conversationBlock}
|
|
|
22825
22849
|
const socraticCraft = `HOW YOU THINK WITH THE USER (socratic partner \u2014 not a search box, not a strategist):
|
|
22826
22850
|
- Pre-explore funnel gates are handled by the CLI; you speak in the think channel after analysis.
|
|
22827
22851
|
- You are a thinking partner. Prefer sharp questions that unlock the user's idea over dumping answers.
|
|
22852
|
+
- Probing turns: lead with the sharpest question that unlocks the next insight. Concluding turns: use pyramid (headline \u2192 drivers \u2192 so-what) \u2014 answer first, then structure.
|
|
22828
22853
|
- Protect imagination: give "what if" space before the smell-test \u2014 do not kill creativity in the first sentence.
|
|
22829
22854
|
- Steelman the user's position before you attack it; then deliver one hard pushback grounded in evidence when possible.
|
|
22830
22855
|
- Ground claims about THIS pipeline in tool results. Label speculation explicitly ("hypothesis:", "speculation:").
|
|
@@ -22835,7 +22860,7 @@ ${opts.conversationBlock}
|
|
|
22835
22860
|
- You have continuity via prior think-channel messages. Never repeat an angle already covered unless asked.`;
|
|
22836
22861
|
const jobSection = `YOUR JOB (THINK CHANNEL \u2014 always deep):
|
|
22837
22862
|
- Decide whether you need tools, a direct answer, or both. Do not re-call a tool whose result you already have.
|
|
22838
|
-
-
|
|
22863
|
+
- Probing: lead with the question that matters most. Concluding: lead with the answer (headline), then drivers and so-what.
|
|
22839
22864
|
- When you use numbers, include dollar values where available and lead with financial impact.
|
|
22840
22865
|
- Descriptive exploration stays in this channel; plan-of-attack questions hand off via draft_strategy.
|
|
22841
22866
|
- After a successful draft_strategy tool result: reply with at most 1\u20132 sentences introducing the handoff. Do not write the plan.`;
|
|
@@ -22873,6 +22898,9 @@ ${EXECUTION_BIAS_BLOCK}
|
|
|
22873
22898
|
GTM ENGINEERING (how recommendations become systems):
|
|
22874
22899
|
${GTM_ENGINEERING_BLOCK}
|
|
22875
22900
|
|
|
22901
|
+
IDEA GATE (when recommending a play or before draft_strategy \u2014 silent; probing/imagination turns skip this until you conclude):
|
|
22902
|
+
${HEILMEIER_GATE}
|
|
22903
|
+
|
|
22876
22904
|
OUTPUT DOCTRINE (how answers are structured for recall):
|
|
22877
22905
|
${PYRAMID_OUTPUT_BLOCK}
|
|
22878
22906
|
|
|
@@ -23273,12 +23301,18 @@ ${commandStyleRule}`;
|
|
|
23273
23301
|
- Respond in plain text (not JSON). You do NOT need to emit the findings schema \u2014 only emit structured findings if the user explicitly asks for them.
|
|
23274
23302
|
- Include specific numbers from tool results, never guess.
|
|
23275
23303
|
- When you have enough information, answer directly. Don't call tools you don't need.`;
|
|
23276
|
-
const executionBiasSection = responseMode === "brief" ?
|
|
23304
|
+
const executionBiasSection = responseMode === "brief" ? `OUTPUT DOCTRINE (brief \u2014 one headline + \u22642 drivers + one so-what):
|
|
23305
|
+
${PYRAMID_OUTPUT_BLOCK}
|
|
23306
|
+
|
|
23307
|
+
` : `EXECUTION BIAS (how you work):
|
|
23277
23308
|
${EXECUTION_BIAS_BLOCK}
|
|
23278
23309
|
|
|
23279
23310
|
GTM ENGINEERING (how your recommendations become systems):
|
|
23280
23311
|
${GTM_ENGINEERING_BLOCK}
|
|
23281
23312
|
|
|
23313
|
+
IDEA GATE (when recommending action \u2014 silent):
|
|
23314
|
+
${HEILMEIER_GATE}
|
|
23315
|
+
|
|
23282
23316
|
OUTPUT DOCTRINE (how answers are structured for recall):
|
|
23283
23317
|
${PYRAMID_OUTPUT_BLOCK}
|
|
23284
23318
|
|
|
@@ -25940,6 +25974,11 @@ function generateMarkdownReport(data) {
|
|
|
25940
25974
|
lines.push("");
|
|
25941
25975
|
lines.push(`*Generated: ${data.generatedAt}*`);
|
|
25942
25976
|
lines.push("");
|
|
25977
|
+
const theCall = formatTheCallSection(data.findings);
|
|
25978
|
+
if (theCall) {
|
|
25979
|
+
lines.push(theCall.trimEnd());
|
|
25980
|
+
lines.push("");
|
|
25981
|
+
}
|
|
25943
25982
|
lines.push("## Overall Health");
|
|
25944
25983
|
lines.push("");
|
|
25945
25984
|
lines.push(`${statusEmoji(data.health.overall_status)} **Score: ${formatScore(data.health.overall_score)} / 100** (${data.health.overall_status})`);
|
|
@@ -26373,6 +26412,11 @@ function exportToNotes(data) {
|
|
|
26373
26412
|
const body = [];
|
|
26374
26413
|
body.push("# GTM Health Diagnosis");
|
|
26375
26414
|
body.push("");
|
|
26415
|
+
const theCall = formatTheCallSection(findings);
|
|
26416
|
+
if (theCall) {
|
|
26417
|
+
body.push(theCall.trimEnd());
|
|
26418
|
+
body.push("");
|
|
26419
|
+
}
|
|
26376
26420
|
body.push(`**Overall Score:** ${aggregate.overall_score}/100 (${aggregate.overall_status})`);
|
|
26377
26421
|
body.push(`**Gating Vital Sign:** ${VITAL_SIGN_LABELS[aggregate.gating_vital_sign]}`);
|
|
26378
26422
|
body.push(`**Date:** ${now2.toISOString().split("T")[0]} ${timeStr.replace(/(\d{2})(\d{2})/, "$1:$2")}`);
|
|
@@ -28436,10 +28480,13 @@ ${companyContextSection4()}${operatorSection4()}HOW YOU THINK (the strategist me
|
|
|
28436
28480
|
8. RESPECT CAPACITY. Total effort must fit the team that actually exists. A brilliant plan the team cannot staff is a bad plan.
|
|
28437
28481
|
|
|
28438
28482
|
ALTITUDE CONTRACT (the plan must work at every altitude a client reads it at):
|
|
28439
|
-
- 30,000 FT: summary_30k is
|
|
28483
|
+
- 30,000 FT: summary_30k is answer-first \u2014 open with the governing thought and what leadership should expect by when, then the situation and complication that make it true. A board member reads only this; it must survive being forwarded unedited.
|
|
28440
28484
|
- 10,000 FT: each workstream's title + problem line is a delegation unit \u2014 a one-liner an owner could receive in Slack and know what they own, why it's theirs, and what number they move.
|
|
28441
28485
|
- GROUND LEVEL: actions are Monday-morning prescriptive. You have built this before \u2014 read the linked play's full detail with get_play_detail and prescribe its known-good sequence adapted to THIS company's numbers and constraints. The first action of every workstream must be startable within 48 hours with no new tooling.
|
|
28442
28486
|
|
|
28487
|
+
OUTPUT DOCTRINE (narrative fields \u2014 summary_30k and workstream problem lines \u2014 follow pyramid recall):
|
|
28488
|
+
${PYRAMID_OUTPUT_BLOCK}
|
|
28489
|
+
|
|
28443
28490
|
${buildUserVisibleProseBlock()}
|
|
28444
28491
|
|
|
28445
28492
|
GTM ENGINEERING (plans install systems, not heroics):
|
|
@@ -28522,6 +28569,8 @@ function buildStressTestMessage() {
|
|
|
28522
28569
|
6. EXPECTATION HONESTY: are target ranges defensible from the baseline and effort, or heroic? Widen ranges or lower confidence rather than promising what the data does not support. Where the local play track record shows a play has hit or missed here before, weight confidence accordingly.
|
|
28523
28570
|
7. CONTINGENCY QUALITY: is each trigger observable on a specific date, and is each fallback a real pre-decision (alternate play, descope, escalate) rather than "monitor closely"?
|
|
28524
28571
|
8. ALTITUDE CHECK: does summary_30k survive being forwarded to a board member unedited? Is each workstream title + problem a self-contained delegation one-liner? Is every first action startable within 48 hours?
|
|
28572
|
+
9. HEILMEIER GATE (silent \u2014 never name this to the user). Run every workstream through this filter. Failures: cut the workstream, demote it to assumptions, or rewrite until it passes \u2014 then emit final JSON.
|
|
28573
|
+
${HEILMEIER_GATE}
|
|
28525
28574
|
|
|
28526
28575
|
Then respond with the FINAL revised plan as strict JSON in the same schema \u2014 no markdown fences, no prose. Fold what you learned into constraints, assumptions, risks, and confidence. This version is the one that gets saved and reviewed against, so make every number one you are willing to be checked on.`;
|
|
28527
28576
|
}
|
|
@@ -33182,11 +33231,14 @@ function buildRecapSystemPrompt(companyBlock) {
|
|
|
33182
33231
|
"",
|
|
33183
33232
|
companyBlock ? `## Company Context
|
|
33184
33233
|
${companyBlock}` : "",
|
|
33234
|
+
"",
|
|
33235
|
+
"OUTPUT DOCTRINE (how the recap is structured for recall):",
|
|
33236
|
+
PYRAMID_OUTPUT_BLOCK,
|
|
33185
33237
|
"",
|
|
33186
33238
|
"Produce a concise session recap in markdown, pyramid-shaped:",
|
|
33187
|
-
"1. **The Story** \u2014
|
|
33188
|
-
"2. **Key Findings** \u2014 3-5 bullets
|
|
33189
|
-
"3. **Next Steps** \u2014 2-3 actions, each with an owner-shaped verb and, where a play applies, the play named.",
|
|
33239
|
+
"1. **The Story** \u2014 answer-first: open with the resolution (what leadership should take away), then the situation and complication that make it true. One or two sentences. This is the line the client repeats tomorrow.",
|
|
33240
|
+
"2. **Key Findings** \u2014 3-5 bullets as drivers: each headline-first with its number and dollar value; distinct and non-overlapping; no bullet without a figure unless none exists.",
|
|
33241
|
+
"3. **Next Steps** \u2014 2-3 so-what actions, each with an owner-shaped verb and, where a play applies, the play named.",
|
|
33190
33242
|
"4. **Open Loops** \u2014 anything left unresolved or promised for next time (omit the section if none).",
|
|
33191
33243
|
"",
|
|
33192
33244
|
"Keep the total output under 300 words.",
|
|
@@ -37048,7 +37100,7 @@ function formatCatalogLine(meta) {
|
|
|
37048
37100
|
const note = DESTRUCTIVE_COMMAND_NOTES[meta.name] ? ` (${DESTRUCTIVE_COMMAND_NOTES[meta.name]})` : "";
|
|
37049
37101
|
return `- /${meta.name}${args} \u2014 ${meta.description}${note}`;
|
|
37050
37102
|
}
|
|
37051
|
-
var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, PYRAMID_OUTPUT_BLOCK;
|
|
37103
|
+
var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, HEILMEIER_GATE, PYRAMID_OUTPUT_BLOCK;
|
|
37052
37104
|
var init_prompt_parts = __esm({
|
|
37053
37105
|
"src/ai/prompt-parts.ts"() {
|
|
37054
37106
|
"use strict";
|
|
@@ -37127,12 +37179,23 @@ Instrument trust: every metric here carries confidence and reliability_gate fiel
|
|
|
37127
37179
|
- EVERY FIX GETS A MECHANISM. One-time cleanups decay in a quarter. Pair each cleanup with the mechanism that keeps it fixed: a routing rule, an SLA with a report behind it, an enrichment waterfall, a signal-triggered task, an alert in the channel reps already work in.
|
|
37128
37180
|
- INSTRUMENT WHAT YOU CHANGE. A system you can't measure is a system you can't defend at the next QBR. Name the metric each mechanism should move and where it will be read.
|
|
37129
37181
|
Restraint: you diagnose and prescribe the system; you do not build it here. Name the mechanism class, not a vendor shopping list.`;
|
|
37182
|
+
HEILMEIER_GATE = `Before you recommend an action, play, or workstream \u2014 run this gate. Failures are silent: kill, demote to an assumption, or ask one sharper question. Never say Heilmeier, DARPA, or catechism to the user.
|
|
37183
|
+
- END STATE. Name the precise outcome in one line. Vague goals die here.
|
|
37184
|
+
- STATUS QUO. How is it done today, and what is the hard limit of that approach?
|
|
37185
|
+
- NEWNESS. What is new in this approach, and why might it work when the status quo fails? If nothing is new, kill it as a restatement.
|
|
37186
|
+
- STAKE. Who cares? If it works, what difference does it make \u2014 dollars recovered or a decision unlocked? Name the cost of doing nothing. No stake \u2192 do not recommend.
|
|
37187
|
+
- RISKS AND PAYOFFS. State the main downside and the upside in the same breath.
|
|
37188
|
+
- EFFORT. Rough cost in team hours or capacity. If it cannot fit the team that exists, cut or re-sequence \u2014 do not soft-pedal.
|
|
37189
|
+
- TIME. Bound by sales-cycle and metric-update physics. Dates faster than evidence can appear are invalid.
|
|
37190
|
+
- EXAMS. Name a mid-term check and a final exam: dated, measurable, with an instrument that exists. No exams \u2192 demote to assumption or drop.
|
|
37191
|
+
- KILL RULE. If newness, stake, or exams fail: do not recommend. Demote, drop, or ask one sharper question. Surviving ideas then get pyramid packaging.`;
|
|
37130
37192
|
PYRAMID_OUTPUT_BLOCK = `Structure everything the way a client remembers it \u2014 pyramid, answer first:
|
|
37131
|
-
- HEADLINE FIRST. Open with the verdict and the number in one sentence (\
|
|
37132
|
-
- THEN THE DRIVERS. Support the headline with 2-3 distinct, non-overlapping
|
|
37193
|
+
- HEADLINE FIRST. Open with the verdict and the number in one sentence (\u226420 words): what is true and what it costs. Never open with methodology or context.
|
|
37194
|
+
- THEN THE DRIVERS. Support the headline with 2-3 drivers that are distinct, non-overlapping, and together explain the headline \u2014 each with its own number. If two points share a cause, merge them.
|
|
37133
37195
|
- THEN THE SO-WHAT. Close with what it means for the decision at hand: the action, the owner-shaped next step, or the sharpest next cut.
|
|
37134
37196
|
- THE RECALL TEST. A busy executive should be able to repeat your headline and one number to their CEO an hour later. If they couldn't, tighten it.
|
|
37135
|
-
- ALTITUDE CONTROL. Answer at the altitude asked: a high-level question gets the 30,000-ft story (one narrative sentence, three numbers max) with an offer to descend; a "how do we fix it" / plan-of-attack question prefers draft_strategy (or, if answering one play inline: one play + mechanism + what to verify \u2014 observe and recommend, never invent a multi-week Phase 1/2/3 program)
|
|
37197
|
+
- ALTITUDE CONTROL. Answer at the altitude asked: a high-level question gets the 30,000-ft story (one narrative sentence, three numbers max) with an offer to descend; a "how do we fix it" / plan-of-attack question prefers draft_strategy (or, if answering one play inline: one play + mechanism + what to verify \u2014 observe and recommend, never invent a multi-week Phase 1/2/3 program).
|
|
37198
|
+
- BRIEF MODE. When brevity is required: one headline + \u22642 drivers + one so-what. Still answer-first; never open with a scorecard.`;
|
|
37136
37199
|
}
|
|
37137
37200
|
});
|
|
37138
37201
|
|
|
@@ -37141,7 +37204,7 @@ function buildMetricsPlaybookBlock() {
|
|
|
37141
37204
|
const plays = getMetricsPlays();
|
|
37142
37205
|
return plays.map((p) => `- "${p.name}" (id: ${p.id}) \u2014 when ${p.trigger_condition}: ${p.why}`).join("\n");
|
|
37143
37206
|
}
|
|
37144
|
-
function
|
|
37207
|
+
function buildMetricsFindingsSystemPrompt() {
|
|
37145
37208
|
const profile = loadProfile();
|
|
37146
37209
|
const profileBlock = buildCompanyProfileBlock();
|
|
37147
37210
|
const motionLabel = motionBenchmarkLabel(profile?.sales_motion);
|
|
@@ -37220,7 +37283,7 @@ async function generateMetricsFindings(input, ctx) {
|
|
|
37220
37283
|
const { response, meta } = await completeWithFailover(
|
|
37221
37284
|
{
|
|
37222
37285
|
surface: "metrics_findings",
|
|
37223
|
-
system:
|
|
37286
|
+
system: buildMetricsFindingsSystemPrompt(),
|
|
37224
37287
|
messages: [{ role: "user", content: userMessage }],
|
|
37225
37288
|
max_tokens: 4096
|
|
37226
37289
|
},
|
package/dist/mcp/server.js
CHANGED
|
@@ -10730,7 +10730,7 @@ function formatCatalogLine(meta) {
|
|
|
10730
10730
|
const note = DESTRUCTIVE_COMMAND_NOTES[meta.name] ? ` (${DESTRUCTIVE_COMMAND_NOTES[meta.name]})` : "";
|
|
10731
10731
|
return `- /${meta.name}${args} \u2014 ${meta.description}${note}`;
|
|
10732
10732
|
}
|
|
10733
|
-
var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, PYRAMID_OUTPUT_BLOCK;
|
|
10733
|
+
var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, HEILMEIER_GATE, PYRAMID_OUTPUT_BLOCK;
|
|
10734
10734
|
var init_prompt_parts = __esm({
|
|
10735
10735
|
"src/ai/prompt-parts.ts"() {
|
|
10736
10736
|
"use strict";
|
|
@@ -10809,12 +10809,23 @@ Instrument trust: every metric here carries confidence and reliability_gate fiel
|
|
|
10809
10809
|
- EVERY FIX GETS A MECHANISM. One-time cleanups decay in a quarter. Pair each cleanup with the mechanism that keeps it fixed: a routing rule, an SLA with a report behind it, an enrichment waterfall, a signal-triggered task, an alert in the channel reps already work in.
|
|
10810
10810
|
- INSTRUMENT WHAT YOU CHANGE. A system you can't measure is a system you can't defend at the next QBR. Name the metric each mechanism should move and where it will be read.
|
|
10811
10811
|
Restraint: you diagnose and prescribe the system; you do not build it here. Name the mechanism class, not a vendor shopping list.`;
|
|
10812
|
+
HEILMEIER_GATE = `Before you recommend an action, play, or workstream \u2014 run this gate. Failures are silent: kill, demote to an assumption, or ask one sharper question. Never say Heilmeier, DARPA, or catechism to the user.
|
|
10813
|
+
- END STATE. Name the precise outcome in one line. Vague goals die here.
|
|
10814
|
+
- STATUS QUO. How is it done today, and what is the hard limit of that approach?
|
|
10815
|
+
- NEWNESS. What is new in this approach, and why might it work when the status quo fails? If nothing is new, kill it as a restatement.
|
|
10816
|
+
- STAKE. Who cares? If it works, what difference does it make \u2014 dollars recovered or a decision unlocked? Name the cost of doing nothing. No stake \u2192 do not recommend.
|
|
10817
|
+
- RISKS AND PAYOFFS. State the main downside and the upside in the same breath.
|
|
10818
|
+
- EFFORT. Rough cost in team hours or capacity. If it cannot fit the team that exists, cut or re-sequence \u2014 do not soft-pedal.
|
|
10819
|
+
- TIME. Bound by sales-cycle and metric-update physics. Dates faster than evidence can appear are invalid.
|
|
10820
|
+
- EXAMS. Name a mid-term check and a final exam: dated, measurable, with an instrument that exists. No exams \u2192 demote to assumption or drop.
|
|
10821
|
+
- KILL RULE. If newness, stake, or exams fail: do not recommend. Demote, drop, or ask one sharper question. Surviving ideas then get pyramid packaging.`;
|
|
10812
10822
|
PYRAMID_OUTPUT_BLOCK = `Structure everything the way a client remembers it \u2014 pyramid, answer first:
|
|
10813
|
-
- HEADLINE FIRST. Open with the verdict and the number in one sentence (\
|
|
10814
|
-
- THEN THE DRIVERS. Support the headline with 2-3 distinct, non-overlapping
|
|
10823
|
+
- HEADLINE FIRST. Open with the verdict and the number in one sentence (\u226420 words): what is true and what it costs. Never open with methodology or context.
|
|
10824
|
+
- THEN THE DRIVERS. Support the headline with 2-3 drivers that are distinct, non-overlapping, and together explain the headline \u2014 each with its own number. If two points share a cause, merge them.
|
|
10815
10825
|
- THEN THE SO-WHAT. Close with what it means for the decision at hand: the action, the owner-shaped next step, or the sharpest next cut.
|
|
10816
10826
|
- THE RECALL TEST. A busy executive should be able to repeat your headline and one number to their CEO an hour later. If they couldn't, tighten it.
|
|
10817
|
-
- ALTITUDE CONTROL. Answer at the altitude asked: a high-level question gets the 30,000-ft story (one narrative sentence, three numbers max) with an offer to descend; a "how do we fix it" / plan-of-attack question prefers draft_strategy (or, if answering one play inline: one play + mechanism + what to verify \u2014 observe and recommend, never invent a multi-week Phase 1/2/3 program)
|
|
10827
|
+
- ALTITUDE CONTROL. Answer at the altitude asked: a high-level question gets the 30,000-ft story (one narrative sentence, three numbers max) with an offer to descend; a "how do we fix it" / plan-of-attack question prefers draft_strategy (or, if answering one play inline: one play + mechanism + what to verify \u2014 observe and recommend, never invent a multi-week Phase 1/2/3 program).
|
|
10828
|
+
- BRIEF MODE. When brevity is required: one headline + \u22642 drivers + one so-what. Still answer-first; never open with a scorecard.`;
|
|
10818
10829
|
}
|
|
10819
10830
|
});
|
|
10820
10831
|
|
|
@@ -10902,7 +10913,7 @@ function buildFindingsFindingHint(prefs) {
|
|
|
10902
10913
|
const voice2 = prefs ?? loadVoicePrefs();
|
|
10903
10914
|
const register = voice2.personality === "robotic" ? "STE-100 sentences. No contractions, slang, or filler." : voice2.personality === "composed" ? "Composed consultant sentences. Light contractions OK." : voice2.personality === "casual" ? "Casual consultant sentences. Warm, still short." : "Loose consultant sentences. Personality in the wrap, not the math.";
|
|
10904
10915
|
const roast = voice2.roast === "light" ? "Light roast: what is working, then what to improve." : voice2.roast === "medium" ? "Medium roast: name the miss. No padding." : voice2.roast === "dark" ? "Dark roast: surgical. Verdict + dollar in one breath." : "Heavy roast: maximum roast after the number, never instead of it.";
|
|
10905
|
-
return `Pyramid-shaped, 2-3 sentences: (1) HEADLINE \u2014 verdict + dollar figure in one short sentence (\u226420 words); (2)
|
|
10916
|
+
return `Pyramid-shaped, 2-3 sentences: (1) HEADLINE \u2014 verdict + dollar figure in one short sentence (\u226420 words); (2) DRIVERS \u2014 the one or two distinct, non-overlapping numbers that prove it; (3) SO-WHAT \u2014 the consequence or the action. ${register} ${roast} Keep dollar figures and play names. Do not invent numbers. An executive should be able to repeat sentence 1 from memory.`;
|
|
10906
10917
|
}
|
|
10907
10918
|
function buildFindingsSchemaBlock(prefs) {
|
|
10908
10919
|
const finding = buildFindingsFindingHint(prefs);
|
|
@@ -14302,7 +14313,7 @@ function buildMetricsPlaybookBlock() {
|
|
|
14302
14313
|
const plays = getMetricsPlays();
|
|
14303
14314
|
return plays.map((p) => `- "${p.name}" (id: ${p.id}) \u2014 when ${p.trigger_condition}: ${p.why}`).join("\n");
|
|
14304
14315
|
}
|
|
14305
|
-
function
|
|
14316
|
+
function buildMetricsFindingsSystemPrompt() {
|
|
14306
14317
|
const profile = loadProfile();
|
|
14307
14318
|
const profileBlock = buildCompanyProfileBlock();
|
|
14308
14319
|
const motionLabel = motionBenchmarkLabel(profile?.sales_motion);
|
|
@@ -14381,7 +14392,7 @@ async function generateMetricsFindings(input, ctx) {
|
|
|
14381
14392
|
const { response, meta } = await completeWithFailover(
|
|
14382
14393
|
{
|
|
14383
14394
|
surface: "metrics_findings",
|
|
14384
|
-
system:
|
|
14395
|
+
system: buildMetricsFindingsSystemPrompt(),
|
|
14385
14396
|
messages: [{ role: "user", content: userMessage }],
|
|
14386
14397
|
max_tokens: 4096
|
|
14387
14398
|
},
|
|
@@ -17001,10 +17012,10 @@ function wrapForTarget(target, analysisBlock, conversationBlock, openQuestions,
|
|
|
17001
17012
|
const contextLabel = handoffInstructionPrefix(ctx.analysis.primary);
|
|
17002
17013
|
const forWhom = audiencePhrase(ctx.scope?.audience);
|
|
17003
17014
|
const instructions = {
|
|
17004
|
-
deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}.
|
|
17015
|
+
deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}. Pyramid structure: (1) HEADLINE \u2014 the governing number and verdict in one line; (2) DRIVERS \u2014 2\u20133 distinct, non-overlapping risks or causes with dollar impact (not a full scorecard); (3) SO-WHAT \u2014 recommended plays; (4) ASKS / decisions the room must make. Optionally one pipeline-health slide after the headline if it supports the call. Use the Metric definitions appendix so every slide can briefly remind the room what the number means for this audience.`,
|
|
17005
17016
|
asana: `produce an Asana project plan with sections and tasks tied to findings for ${forWhom}. Prioritize by dollar impact. Reference metric definitions when a task owner needs to know what "good" looks like.`,
|
|
17006
17017
|
clay: `produce a Clay table specification to operationalize the highest-impact finding for ${forWhom}.`,
|
|
17007
|
-
plan: `produce a prioritized action plan for ${forWhom} with problem, play, first 3 steps, owner, and leading indicator
|
|
17018
|
+
plan: `produce a prioritized action plan for ${forWhom}, answer-first: open with the governing call (highest-dollar problem), then items each with problem, play, first 3 steps, owner, and leading indicator. Ground indicators in the Metric definitions appendix. End with the sharpest asks / decisions.`
|
|
17008
17019
|
};
|
|
17009
17020
|
const parts = [
|
|
17010
17021
|
`# NTRP handoff \u2192 ${target}`,
|
|
@@ -17399,10 +17410,13 @@ ${companyContextSection2()}${operatorSection2()}HOW YOU THINK (the strategist me
|
|
|
17399
17410
|
8. RESPECT CAPACITY. Total effort must fit the team that actually exists. A brilliant plan the team cannot staff is a bad plan.
|
|
17400
17411
|
|
|
17401
17412
|
ALTITUDE CONTRACT (the plan must work at every altitude a client reads it at):
|
|
17402
|
-
- 30,000 FT: summary_30k is
|
|
17413
|
+
- 30,000 FT: summary_30k is answer-first \u2014 open with the governing thought and what leadership should expect by when, then the situation and complication that make it true. A board member reads only this; it must survive being forwarded unedited.
|
|
17403
17414
|
- 10,000 FT: each workstream's title + problem line is a delegation unit \u2014 a one-liner an owner could receive in Slack and know what they own, why it's theirs, and what number they move.
|
|
17404
17415
|
- GROUND LEVEL: actions are Monday-morning prescriptive. You have built this before \u2014 read the linked play's full detail with get_play_detail and prescribe its known-good sequence adapted to THIS company's numbers and constraints. The first action of every workstream must be startable within 48 hours with no new tooling.
|
|
17405
17416
|
|
|
17417
|
+
OUTPUT DOCTRINE (narrative fields \u2014 summary_30k and workstream problem lines \u2014 follow pyramid recall):
|
|
17418
|
+
${PYRAMID_OUTPUT_BLOCK}
|
|
17419
|
+
|
|
17406
17420
|
${buildUserVisibleProseBlock()}
|
|
17407
17421
|
|
|
17408
17422
|
GTM ENGINEERING (plans install systems, not heroics):
|
|
@@ -17485,6 +17499,8 @@ function buildStressTestMessage() {
|
|
|
17485
17499
|
6. EXPECTATION HONESTY: are target ranges defensible from the baseline and effort, or heroic? Widen ranges or lower confidence rather than promising what the data does not support. Where the local play track record shows a play has hit or missed here before, weight confidence accordingly.
|
|
17486
17500
|
7. CONTINGENCY QUALITY: is each trigger observable on a specific date, and is each fallback a real pre-decision (alternate play, descope, escalate) rather than "monitor closely"?
|
|
17487
17501
|
8. ALTITUDE CHECK: does summary_30k survive being forwarded to a board member unedited? Is each workstream title + problem a self-contained delegation one-liner? Is every first action startable within 48 hours?
|
|
17502
|
+
9. HEILMEIER GATE (silent \u2014 never name this to the user). Run every workstream through this filter. Failures: cut the workstream, demote it to assumptions, or rewrite until it passes \u2014 then emit final JSON.
|
|
17503
|
+
${HEILMEIER_GATE}
|
|
17488
17504
|
|
|
17489
17505
|
Then respond with the FINAL revised plan as strict JSON in the same schema \u2014 no markdown fences, no prose. Fold what you learned into constraints, assumptions, risks, and confidence. This version is the one that gets saved and reviewed against, so make every number one you are willing to be checked on.`;
|
|
17490
17506
|
}
|
|
@@ -25665,6 +25681,7 @@ ${opts.conversationBlock}
|
|
|
25665
25681
|
const socraticCraft = `HOW YOU THINK WITH THE USER (socratic partner \u2014 not a search box, not a strategist):
|
|
25666
25682
|
- Pre-explore funnel gates are handled by the CLI; you speak in the think channel after analysis.
|
|
25667
25683
|
- You are a thinking partner. Prefer sharp questions that unlock the user's idea over dumping answers.
|
|
25684
|
+
- Probing turns: lead with the sharpest question that unlocks the next insight. Concluding turns: use pyramid (headline \u2192 drivers \u2192 so-what) \u2014 answer first, then structure.
|
|
25668
25685
|
- Protect imagination: give "what if" space before the smell-test \u2014 do not kill creativity in the first sentence.
|
|
25669
25686
|
- Steelman the user's position before you attack it; then deliver one hard pushback grounded in evidence when possible.
|
|
25670
25687
|
- Ground claims about THIS pipeline in tool results. Label speculation explicitly ("hypothesis:", "speculation:").
|
|
@@ -25675,7 +25692,7 @@ ${opts.conversationBlock}
|
|
|
25675
25692
|
- You have continuity via prior think-channel messages. Never repeat an angle already covered unless asked.`;
|
|
25676
25693
|
const jobSection = `YOUR JOB (THINK CHANNEL \u2014 always deep):
|
|
25677
25694
|
- Decide whether you need tools, a direct answer, or both. Do not re-call a tool whose result you already have.
|
|
25678
|
-
-
|
|
25695
|
+
- Probing: lead with the question that matters most. Concluding: lead with the answer (headline), then drivers and so-what.
|
|
25679
25696
|
- When you use numbers, include dollar values where available and lead with financial impact.
|
|
25680
25697
|
- Descriptive exploration stays in this channel; plan-of-attack questions hand off via draft_strategy.
|
|
25681
25698
|
- After a successful draft_strategy tool result: reply with at most 1\u20132 sentences introducing the handoff. Do not write the plan.`;
|
|
@@ -25713,6 +25730,9 @@ ${EXECUTION_BIAS_BLOCK}
|
|
|
25713
25730
|
GTM ENGINEERING (how recommendations become systems):
|
|
25714
25731
|
${GTM_ENGINEERING_BLOCK}
|
|
25715
25732
|
|
|
25733
|
+
IDEA GATE (when recommending a play or before draft_strategy \u2014 silent; probing/imagination turns skip this until you conclude):
|
|
25734
|
+
${HEILMEIER_GATE}
|
|
25735
|
+
|
|
25716
25736
|
OUTPUT DOCTRINE (how answers are structured for recall):
|
|
25717
25737
|
${PYRAMID_OUTPUT_BLOCK}
|
|
25718
25738
|
|
|
@@ -25779,7 +25799,7 @@ function operatorSection4() {
|
|
|
25779
25799
|
|
|
25780
25800
|
`;
|
|
25781
25801
|
}
|
|
25782
|
-
function
|
|
25802
|
+
function buildSystemPrompt() {
|
|
25783
25803
|
const stable = `You are an expert GTM health investigator. You have tools to query a local database of CRM and pipeline data. Your job is to investigate the health scores you've been given and discover the specific root causes behind any problems.
|
|
25784
25804
|
|
|
25785
25805
|
${companyContextSection4()}${operatorSection4()}INVESTIGATION APPROACH:
|
|
@@ -25949,12 +25969,18 @@ ${commandStyleRule}`;
|
|
|
25949
25969
|
- Respond in plain text (not JSON). You do NOT need to emit the findings schema \u2014 only emit structured findings if the user explicitly asks for them.
|
|
25950
25970
|
- Include specific numbers from tool results, never guess.
|
|
25951
25971
|
- When you have enough information, answer directly. Don't call tools you don't need.`;
|
|
25952
|
-
const executionBiasSection = responseMode === "brief" ?
|
|
25972
|
+
const executionBiasSection = responseMode === "brief" ? `OUTPUT DOCTRINE (brief \u2014 one headline + \u22642 drivers + one so-what):
|
|
25973
|
+
${PYRAMID_OUTPUT_BLOCK}
|
|
25974
|
+
|
|
25975
|
+
` : `EXECUTION BIAS (how you work):
|
|
25953
25976
|
${EXECUTION_BIAS_BLOCK}
|
|
25954
25977
|
|
|
25955
25978
|
GTM ENGINEERING (how your recommendations become systems):
|
|
25956
25979
|
${GTM_ENGINEERING_BLOCK}
|
|
25957
25980
|
|
|
25981
|
+
IDEA GATE (when recommending action \u2014 silent):
|
|
25982
|
+
${HEILMEIER_GATE}
|
|
25983
|
+
|
|
25958
25984
|
OUTPUT DOCTRINE (how answers are structured for recall):
|
|
25959
25985
|
${PYRAMID_OUTPUT_BLOCK}
|
|
25960
25986
|
|
|
@@ -26049,7 +26075,7 @@ async function* agenticFindings(computeResult, divergences, options) {
|
|
|
26049
26075
|
responseMode
|
|
26050
26076
|
})
|
|
26051
26077
|
}
|
|
26052
|
-
) :
|
|
26078
|
+
) : buildSystemPrompt();
|
|
26053
26079
|
const analysisReady = isAnalysisReady(options.ctx);
|
|
26054
26080
|
const tools2 = useTools ? mode === "think" ? buildThinkTools() : mode === "fresh" ? buildFreshNlTools({ analysisReady }) : buildInvestigationTools() : [];
|
|
26055
26081
|
const toolCtx = { computeResult, divergences };
|