@sonnechasser/ntrp 2.4.0 → 2.4.1
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 +181 -105
- package/dist/mcp/server.js +3 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1584,7 +1584,7 @@ function printGuideCatalogLine(slide) {
|
|
|
1584
1584
|
function printDeepdiveHint(metricId, label) {
|
|
1585
1585
|
const name = label ?? metricId;
|
|
1586
1586
|
console.log(
|
|
1587
|
-
" " + chalk3.dim(`Ask what ${name.toLowerCase()} means \u2014 or `) + paint("accent", `/tour ${metricId}`) + chalk3.dim("
|
|
1587
|
+
" " + chalk3.dim(`Ask what ${name.toLowerCase()} means \u2014 or `) + paint("accent", `/tour ${metricId}`) + chalk3.dim(" if you want the card.")
|
|
1588
1588
|
);
|
|
1589
1589
|
console.log();
|
|
1590
1590
|
}
|
|
@@ -25950,12 +25950,9 @@ var init_ghost_hints = __esm({
|
|
|
25950
25950
|
init_suggested_asks();
|
|
25951
25951
|
PHASE_GHOST_HINTS = {
|
|
25952
25952
|
orient: [
|
|
25953
|
-
'try "pipeline health"',
|
|
25954
25953
|
'try "how healthy is the pipeline?"',
|
|
25955
|
-
'try "what
|
|
25956
|
-
'try "
|
|
25957
|
-
'try "what is the most expensive problem to solve?"',
|
|
25958
|
-
'try "board deck on Q3"'
|
|
25954
|
+
'try "what does freshness mean?"',
|
|
25955
|
+
'try "what should I do next?"'
|
|
25959
25956
|
],
|
|
25960
25957
|
awaiting_data: [
|
|
25961
25958
|
'try "use demo data"',
|
|
@@ -36764,7 +36761,7 @@ async function handler19(args, ctx) {
|
|
|
36764
36761
|
console.log(chalk51.dim(` Trigger: ${triggerLabel} \u2014 ${play.trigger_condition}`));
|
|
36765
36762
|
if (play.trigger_vital_sign) {
|
|
36766
36763
|
console.log(
|
|
36767
|
-
chalk51.dim(" Ask what ") + chalk51.dim(play.trigger_vital_sign.replace(/_/g, " ")) + chalk51.dim(" means \u2014 or ") + paint("accent", `/tour ${play.trigger_vital_sign}`) + chalk51.dim("
|
|
36764
|
+
chalk51.dim(" Ask what ") + chalk51.dim(play.trigger_vital_sign.replace(/_/g, " ")) + chalk51.dim(" means \u2014 or ") + paint("accent", `/tour ${play.trigger_vital_sign}`) + chalk51.dim(" if you want the card.")
|
|
36768
36765
|
);
|
|
36769
36766
|
}
|
|
36770
36767
|
console.log();
|
|
@@ -40495,7 +40492,7 @@ function getDeepdiveNudge(ctx) {
|
|
|
40495
40492
|
if (!hasAnalysisForDeepdiveNudge(ctx)) return null;
|
|
40496
40493
|
return {
|
|
40497
40494
|
text: "Ask how healthy the pipeline looks",
|
|
40498
|
-
tip: "Or /tour
|
|
40495
|
+
tip: "We check if the number is real \u2014 then where deals stick, leak, or go thin. Two checks use our names. Or /tour if you want the deck.",
|
|
40499
40496
|
command: "/tour"
|
|
40500
40497
|
};
|
|
40501
40498
|
}
|
|
@@ -40831,16 +40828,12 @@ var init_metric_tour = __esm({
|
|
|
40831
40828
|
TOUR_SKIPPED_KEY = "metrics-tour-skipped";
|
|
40832
40829
|
HOME_NUDGE_SEEN_KEY = "metrics-tour-home-nudge-seen";
|
|
40833
40830
|
METRICS_TOUR_MILESTONE_ID = "metrics_tour";
|
|
40834
|
-
TOUR_INTRO_TITLE = "
|
|
40831
|
+
TOUR_INTRO_TITLE = "Are these pipeline numbers trustworthy \u2014 and where money leaks?";
|
|
40835
40832
|
TOUR_CLOSE_TITLE = "Curious? Start listening";
|
|
40836
40833
|
TOUR_INTRO_LINES = [
|
|
40837
|
-
"
|
|
40838
|
-
"",
|
|
40839
|
-
"
|
|
40840
|
-
"",
|
|
40841
|
-
"Vital signs (after) \u2014 Freshness, Flow Rate, Drop Rate, Signal:Noise, Thread Depth. These are our stethoscope: each score has a dollar translation, and we read them in layer order so an upstream red doesn't get papered over by a prettier downstream number.",
|
|
40842
|
-
"",
|
|
40843
|
-
"How to use NTRP (after vitals) \u2014 ask in English, peek at the glossary without a key, teach your desktop AI an inbox once, then stay in diagnose \u2192 plan \u2192 review."
|
|
40834
|
+
"Read in order: Freshness (is the number true?) \u2192 Flow + Drop (stuck / handoff) \u2192 Signal + Thread (busywork / thin deals).",
|
|
40835
|
+
"Freshness, Flow, and Drop feel familiar. Signal:Noise and Thread Depth are NTRP names.",
|
|
40836
|
+
"Then ask: what should I do next?"
|
|
40844
40837
|
];
|
|
40845
40838
|
TOUR_CLOSE_LINES = [
|
|
40846
40839
|
"A good first loop: ask something you actually care about \u2192 confirm the scope \u2192 load data (demo is fine) \u2192 let the formulas run. Then poke around:",
|
|
@@ -45775,12 +45768,89 @@ var init_health_chat = __esm({
|
|
|
45775
45768
|
}
|
|
45776
45769
|
});
|
|
45777
45770
|
|
|
45771
|
+
// src/conversation/next-move-chat.ts
|
|
45772
|
+
var next_move_chat_exports = {};
|
|
45773
|
+
__export(next_move_chat_exports, {
|
|
45774
|
+
NEXT_MOVE_EMPTY_LINE: () => NEXT_MOVE_EMPTY_LINE,
|
|
45775
|
+
everydayPlayReason: () => everydayPlayReason,
|
|
45776
|
+
isNextMoveChatPhase: () => isNextMoveChatPhase,
|
|
45777
|
+
isNextMoveIntent: () => isNextMoveIntent,
|
|
45778
|
+
resolveNextMove: () => resolveNextMove,
|
|
45779
|
+
tryNextMoveChat: () => tryNextMoveChat
|
|
45780
|
+
});
|
|
45781
|
+
import chalk95 from "chalk";
|
|
45782
|
+
function isNextMoveIntent(line) {
|
|
45783
|
+
const text = line.trim();
|
|
45784
|
+
if (!text) return false;
|
|
45785
|
+
if (/^(\/strategy|strategy)\b/i.test(text)) return false;
|
|
45786
|
+
return NEXT_MOVE_INTENT_RE.test(text);
|
|
45787
|
+
}
|
|
45788
|
+
function isNextMoveChatPhase(ctx) {
|
|
45789
|
+
const phase = resolveConversationPhase(ctx);
|
|
45790
|
+
return phase === "explore" || phase === "orient" && isAnalysisReady(ctx);
|
|
45791
|
+
}
|
|
45792
|
+
function everydayPlayReason(why) {
|
|
45793
|
+
const plain = why.replace(/\s+/g, " ").trim();
|
|
45794
|
+
if (!plain) return "";
|
|
45795
|
+
const match = plain.match(/^(.+?[.!?])(\s|$)/);
|
|
45796
|
+
const sentence = (match ? match[1] : plain).trim();
|
|
45797
|
+
return sentence.endsWith(".") || sentence.endsWith("!") || sentence.endsWith("?") ? sentence : `${sentence}.`;
|
|
45798
|
+
}
|
|
45799
|
+
function resolveNextMove(ctx) {
|
|
45800
|
+
const aggregate = ctx.snapshot.computeResult?.aggregate;
|
|
45801
|
+
if (!aggregate?.gating_vital_sign) return null;
|
|
45802
|
+
const gating = aggregate.gating_vital_sign;
|
|
45803
|
+
const play = getPlaysForVitalSign(gating)[0];
|
|
45804
|
+
if (!play) return null;
|
|
45805
|
+
const reason = everydayPlayReason(play.why);
|
|
45806
|
+
if (!reason) return null;
|
|
45807
|
+
return {
|
|
45808
|
+
playId: play.id,
|
|
45809
|
+
playName: play.name,
|
|
45810
|
+
reason,
|
|
45811
|
+
gatingVital: VITAL_SIGN_LABELS[gating] ?? gating
|
|
45812
|
+
};
|
|
45813
|
+
}
|
|
45814
|
+
function tryNextMoveChat(ctx, line) {
|
|
45815
|
+
if (!isNextMoveIntent(line)) return false;
|
|
45816
|
+
if (!isNextMoveChatPhase(ctx)) return false;
|
|
45817
|
+
const move = resolveNextMove(ctx);
|
|
45818
|
+
console.log();
|
|
45819
|
+
if (!move) {
|
|
45820
|
+
console.log(" " + NEXT_MOVE_EMPTY_LINE);
|
|
45821
|
+
console.log();
|
|
45822
|
+
recordMessage(ctx, "user", line);
|
|
45823
|
+
recordMessage(ctx, "agent", NEXT_MOVE_EMPTY_LINE);
|
|
45824
|
+
saveSessionState(ctx);
|
|
45825
|
+
return true;
|
|
45826
|
+
}
|
|
45827
|
+
console.log(" " + chalk95.bold(move.playName));
|
|
45828
|
+
console.log(" " + move.reason);
|
|
45829
|
+
console.log();
|
|
45830
|
+
recordMessage(ctx, "user", line);
|
|
45831
|
+
recordMessage(ctx, "agent", `${move.playName} \u2014 ${move.reason}`);
|
|
45832
|
+
saveSessionState(ctx);
|
|
45833
|
+
return true;
|
|
45834
|
+
}
|
|
45835
|
+
var NEXT_MOVE_EMPTY_LINE, NEXT_MOVE_INTENT_RE;
|
|
45836
|
+
var init_next_move_chat = __esm({
|
|
45837
|
+
"src/conversation/next-move-chat.ts"() {
|
|
45838
|
+
"use strict";
|
|
45839
|
+
init_context2();
|
|
45840
|
+
init_playbook();
|
|
45841
|
+
init_formatters();
|
|
45842
|
+
init_phase();
|
|
45843
|
+
NEXT_MOVE_EMPTY_LINE = "Nothing clear to recommend yet. Ask how healthy the pipeline looks.";
|
|
45844
|
+
NEXT_MOVE_INTENT_RE = /\b((what\s+should\s+i\s+do\s+next)|((what'?s|whats|what\s+is)\s+(the\s+)?next\s+move)|((what'?s|whats|what\s+is)\s+my\s+next\s+move))\b/i;
|
|
45845
|
+
}
|
|
45846
|
+
});
|
|
45847
|
+
|
|
45778
45848
|
// src/conversation/router.ts
|
|
45779
45849
|
var router_exports = {};
|
|
45780
45850
|
__export(router_exports, {
|
|
45781
45851
|
conversationRouter: () => conversationRouter
|
|
45782
45852
|
});
|
|
45783
|
-
import
|
|
45853
|
+
import chalk96 from "chalk";
|
|
45784
45854
|
function popModalState(ctx) {
|
|
45785
45855
|
const popped = [];
|
|
45786
45856
|
if (ctx.strategistState) {
|
|
@@ -45813,7 +45883,7 @@ function handleBackNavigation(ctx, line) {
|
|
|
45813
45883
|
}
|
|
45814
45884
|
if (phase === "scope") {
|
|
45815
45885
|
console.log();
|
|
45816
|
-
console.log(" " +
|
|
45886
|
+
console.log(" " + chalk96.dim("What should we focus on instead?"));
|
|
45817
45887
|
ctx.scope = void 0;
|
|
45818
45888
|
clearPendingAsk(ctx);
|
|
45819
45889
|
saveSessionState(ctx);
|
|
@@ -45833,7 +45903,7 @@ function handleBackNavigation(ctx, line) {
|
|
|
45833
45903
|
printScopeProposal(ctx);
|
|
45834
45904
|
if (hadData || hadAnalysis) {
|
|
45835
45905
|
console.log(
|
|
45836
|
-
" " +
|
|
45906
|
+
" " + chalk96.dim(
|
|
45837
45907
|
"Focus gate rewound \u2014 loaded data and any analysis stay. `b` does not unload demo data or undo compute."
|
|
45838
45908
|
)
|
|
45839
45909
|
);
|
|
@@ -45849,7 +45919,7 @@ function handleBackNavigation(ctx, line) {
|
|
|
45849
45919
|
recordMessage(ctx, "user", line);
|
|
45850
45920
|
recordMessage(ctx, "agent", "Strategy objective adjust (back)");
|
|
45851
45921
|
console.log();
|
|
45852
|
-
console.log(" " +
|
|
45922
|
+
console.log(" " + chalk96.dim("What is the objective? State a finish line."));
|
|
45853
45923
|
console.log();
|
|
45854
45924
|
return { handled: true, summary: "Awaiting objective" };
|
|
45855
45925
|
}
|
|
@@ -45861,7 +45931,7 @@ function handleBackNavigation(ctx, line) {
|
|
|
45861
45931
|
const backTo = formatPhaseLabel(resolveConversationPhase(ctx));
|
|
45862
45932
|
console.log();
|
|
45863
45933
|
console.log(
|
|
45864
|
-
" " +
|
|
45934
|
+
" " + chalk96.dim(`Back \u2014 dropped ${popped.join(" and ")}. At `) + chalk96.cyan(backTo) + chalk96.dim(".")
|
|
45865
45935
|
);
|
|
45866
45936
|
console.log();
|
|
45867
45937
|
return { handled: true, summary: "Back" };
|
|
@@ -45875,7 +45945,7 @@ function handleBackNavigation(ctx, line) {
|
|
|
45875
45945
|
const backTo = formatPhaseLabel(resolveConversationPhase(ctx));
|
|
45876
45946
|
console.log();
|
|
45877
45947
|
console.log(
|
|
45878
|
-
" " +
|
|
45948
|
+
" " + chalk96.dim(`Back \u2014 dropped ${popped.join(" and ")}. At `) + chalk96.cyan(backTo) + chalk96.dim(".")
|
|
45879
45949
|
);
|
|
45880
45950
|
console.log();
|
|
45881
45951
|
return { handled: true, summary: "Back" };
|
|
@@ -45919,7 +45989,7 @@ async function conversationRouter(input, ctx) {
|
|
|
45919
45989
|
if (!ok) {
|
|
45920
45990
|
console.log();
|
|
45921
45991
|
console.log(
|
|
45922
|
-
" " +
|
|
45992
|
+
" " + chalk96.dim("Staying on this session. Type ") + chalk96.cyan("/home") + chalk96.dim(" for the dashboard.")
|
|
45923
45993
|
);
|
|
45924
45994
|
console.log();
|
|
45925
45995
|
return { handled: true };
|
|
@@ -45934,7 +46004,7 @@ async function conversationRouter(input, ctx) {
|
|
|
45934
46004
|
}
|
|
45935
46005
|
console.log();
|
|
45936
46006
|
console.log(
|
|
45937
|
-
" " +
|
|
46007
|
+
" " + chalk96.dim("Start a fresh analysis with ") + chalk96.cyan("/new") + chalk96.dim(" \u2014 or ") + chalk96.cyan("/home") + chalk96.dim(" for the dashboard.")
|
|
45938
46008
|
);
|
|
45939
46009
|
console.log();
|
|
45940
46010
|
return { handled: true };
|
|
@@ -45948,7 +46018,7 @@ async function conversationRouter(input, ctx) {
|
|
|
45948
46018
|
const backTo = formatPhaseLabel(resolveConversationPhase(ctx));
|
|
45949
46019
|
console.log();
|
|
45950
46020
|
console.log(
|
|
45951
|
-
" " +
|
|
46021
|
+
" " + chalk96.dim(`Cancelled \u2014 dropped ${popped.join(" and ")}. Back to `) + chalk96.cyan(backTo) + chalk96.dim(".")
|
|
45952
46022
|
);
|
|
45953
46023
|
console.log();
|
|
45954
46024
|
return { handled: true, summary: "Cancelled" };
|
|
@@ -45998,6 +46068,12 @@ async function conversationRouter(input, ctx) {
|
|
|
45998
46068
|
return { handled: true, summary: "Pipeline health" };
|
|
45999
46069
|
}
|
|
46000
46070
|
}
|
|
46071
|
+
if (phase === "explore" || phase === "orient" && isAnalysisReady(ctx)) {
|
|
46072
|
+
const { tryNextMoveChat: tryNextMoveChat2 } = await Promise.resolve().then(() => (init_next_move_chat(), next_move_chat_exports));
|
|
46073
|
+
if (tryNextMoveChat2(ctx, line)) {
|
|
46074
|
+
return { handled: true, summary: "Next move" };
|
|
46075
|
+
}
|
|
46076
|
+
}
|
|
46001
46077
|
if (phase === "think") {
|
|
46002
46078
|
const summary = await handleThinkFlow(line, ctx) ?? void 0;
|
|
46003
46079
|
return { handled: true, summary };
|
|
@@ -46036,7 +46112,7 @@ async function conversationRouter(input, ctx) {
|
|
|
46036
46112
|
}
|
|
46037
46113
|
if (phase === "compute") {
|
|
46038
46114
|
console.log();
|
|
46039
|
-
console.log(" " +
|
|
46115
|
+
console.log(" " + chalk96.dim("Analysis running \u2014 wait for it to finish before typing another question."));
|
|
46040
46116
|
console.log();
|
|
46041
46117
|
return { handled: true };
|
|
46042
46118
|
}
|
|
@@ -46092,7 +46168,7 @@ __export(dispatch_exports, {
|
|
|
46092
46168
|
dispatch: () => dispatch,
|
|
46093
46169
|
replayPendingBlockedLine: () => replayPendingBlockedLine
|
|
46094
46170
|
});
|
|
46095
|
-
import
|
|
46171
|
+
import chalk97 from "chalk";
|
|
46096
46172
|
function printLicenseRequired(command) {
|
|
46097
46173
|
printLicenseBlocked(command);
|
|
46098
46174
|
}
|
|
@@ -46110,7 +46186,7 @@ async function replayPendingBlockedLine(ctx) {
|
|
|
46110
46186
|
if (!hasValidLicense()) return false;
|
|
46111
46187
|
ctx.pendingBlockedLine = void 0;
|
|
46112
46188
|
console.log();
|
|
46113
|
-
console.log(" " +
|
|
46189
|
+
console.log(" " + chalk97.dim("Picking up where you left off\u2026"));
|
|
46114
46190
|
console.log();
|
|
46115
46191
|
await dispatch(line, ctx);
|
|
46116
46192
|
return true;
|
|
@@ -46180,7 +46256,7 @@ async function dispatch(input, ctx) {
|
|
|
46180
46256
|
if (tokens.length === 1) {
|
|
46181
46257
|
if (/^\d$/.test(first)) {
|
|
46182
46258
|
console.log(
|
|
46183
|
-
" " +
|
|
46259
|
+
" " + chalk97.dim("Looks like a menu pick \u2014 run ") + paint("accent", "/new") + chalk97.dim(" to start (pick Demo, then choose your analysis type).")
|
|
46184
46260
|
);
|
|
46185
46261
|
return { kind: "handled" };
|
|
46186
46262
|
}
|
|
@@ -46203,19 +46279,19 @@ async function dispatch(input, ctx) {
|
|
|
46203
46279
|
return { kind: "handled", summary };
|
|
46204
46280
|
}
|
|
46205
46281
|
console.log(
|
|
46206
|
-
" " +
|
|
46282
|
+
" " + chalk97.dim("Not in Q&A yet. Confirm the scope, load data, and run analysis first. Type ") + paint("accent", "/home") + chalk97.dim(" for status.")
|
|
46207
46283
|
);
|
|
46208
46284
|
return { kind: "handled" };
|
|
46209
46285
|
}
|
|
46210
46286
|
console.log(
|
|
46211
|
-
" " +
|
|
46287
|
+
" " + chalk97.dim("Natural-language questions run inside ntrp. Start with ") + paint("accent", "ntrp") + chalk97.dim(" and type a question after analysis.")
|
|
46212
46288
|
);
|
|
46213
46289
|
return { kind: "handled" };
|
|
46214
46290
|
}
|
|
46215
46291
|
async function runSlashCommand(name, args, ctx) {
|
|
46216
46292
|
const handler54 = await resolveHandler(name);
|
|
46217
46293
|
if (!handler54) {
|
|
46218
|
-
console.error(
|
|
46294
|
+
console.error(chalk97.red(` Unknown command: /${name}`));
|
|
46219
46295
|
return void 0;
|
|
46220
46296
|
}
|
|
46221
46297
|
const result = await handler54(args, ctx);
|
|
@@ -46252,7 +46328,7 @@ var init_inline_suggestion = __esm({
|
|
|
46252
46328
|
});
|
|
46253
46329
|
|
|
46254
46330
|
// src/conversation/loop-guard.ts
|
|
46255
|
-
import
|
|
46331
|
+
import chalk98 from "chalk";
|
|
46256
46332
|
function createLoopGuardState() {
|
|
46257
46333
|
return { phase: null, stuckTurns: 0 };
|
|
46258
46334
|
}
|
|
@@ -46284,10 +46360,10 @@ function printLoopEscalation(phase) {
|
|
|
46284
46360
|
if (!guide) return;
|
|
46285
46361
|
console.log();
|
|
46286
46362
|
console.log(
|
|
46287
|
-
" " +
|
|
46363
|
+
" " + chalk98.yellow("We seem to be going in circles \u2014 you're in ") + paint("accent", guide.mode) + chalk98.yellow(" mode.")
|
|
46288
46364
|
);
|
|
46289
|
-
console.log(" " +
|
|
46290
|
-
console.log(" " +
|
|
46365
|
+
console.log(" " + chalk98.dim("Right now I can only accept: ") + guide.accepts);
|
|
46366
|
+
console.log(" " + chalk98.dim("To leave: ") + guide.leave);
|
|
46291
46367
|
console.log();
|
|
46292
46368
|
}
|
|
46293
46369
|
var LOOP_GUARD_THRESHOLD, MODAL_PHASES, PHASE_GUIDES;
|
|
@@ -46331,7 +46407,7 @@ __export(welcome_exports, {
|
|
|
46331
46407
|
resolveWelcomeNextAction: () => resolveWelcomeNextAction,
|
|
46332
46408
|
staleProcessHomeNotice: () => staleProcessHomeNotice
|
|
46333
46409
|
});
|
|
46334
|
-
import
|
|
46410
|
+
import chalk99 from "chalk";
|
|
46335
46411
|
function formatHomeEntityCounts(counts) {
|
|
46336
46412
|
const parts = [];
|
|
46337
46413
|
const people = counts.people ?? 0;
|
|
@@ -46345,11 +46421,11 @@ function formatHomeEntityCounts(counts) {
|
|
|
46345
46421
|
return parts.join(" \xB7 ");
|
|
46346
46422
|
}
|
|
46347
46423
|
function formatEmptyDataHomeHint(savedSessionCount, opts = {}) {
|
|
46348
|
-
const onboard = opts.includeOnboard === true ?
|
|
46424
|
+
const onboard = opts.includeOnboard === true ? chalk99.dim(", or ") + paint("accent", "/onboard") + chalk99.dim(" to calibrate") : "";
|
|
46349
46425
|
if (savedSessionCount > 0) {
|
|
46350
|
-
return
|
|
46426
|
+
return chalk99.dim("Drop a CSV or type ") + paint("accent", "use demo data") + chalk99.dim(" to load a sample") + onboard + chalk99.dim(". Type ") + paint("accent", "/session") + chalk99.dim(" to open a saved session");
|
|
46351
46427
|
}
|
|
46352
|
-
return
|
|
46428
|
+
return chalk99.dim("Drop a CSV or type ") + paint("accent", "use demo data") + chalk99.dim(" to load a sample pipeline") + onboard;
|
|
46353
46429
|
}
|
|
46354
46430
|
function staleProcessHomeNotice() {
|
|
46355
46431
|
const running = getInstalledVersion();
|
|
@@ -46391,19 +46467,19 @@ function sessionSummaryText(s) {
|
|
|
46391
46467
|
summary: s.summary,
|
|
46392
46468
|
dataset: s.dataset
|
|
46393
46469
|
});
|
|
46394
|
-
return summary === NO_SUMMARY ?
|
|
46470
|
+
return summary === NO_SUMMARY ? chalk99.dim(summary) : summary;
|
|
46395
46471
|
}
|
|
46396
46472
|
function formatLastSessionLine(s, colW, ctx, opts) {
|
|
46397
46473
|
const phase = sessionPhaseLabel(s, ctx);
|
|
46398
|
-
const current = opts?.markCurrent && s.id === ctx?.sessionId ?
|
|
46399
|
-
const meta = `${formatSessionId(s.id, s.name)} ${
|
|
46474
|
+
const current = opts?.markCurrent && s.id === ctx?.sessionId ? chalk99.dim(" \xB7 current") : "";
|
|
46475
|
+
const meta = `${formatSessionId(s.id, s.name)} ${chalk99.dim("\xB7")} ${chalk99.dim(lensBadgeLabel(s.analysis))} ${chalk99.dim("\xB7")} ${paint("accent", phase)} ${chalk99.dim("\xB7")} ${sessionSummaryText(s)}${current}`;
|
|
46400
46476
|
return truncateVisible(` ${meta}`, colW);
|
|
46401
46477
|
}
|
|
46402
46478
|
function formatActiveSessionLine(s, colW, ctx, opts) {
|
|
46403
46479
|
const indent = " ";
|
|
46404
46480
|
const idPart = formatSessionId(s.id, s.name);
|
|
46405
|
-
const status =
|
|
46406
|
-
const current = opts?.markCurrent && s.id === ctx?.sessionId ?
|
|
46481
|
+
const status = chalk99.dim(` \xB7 ${sessionStatusSuffix(s)}`);
|
|
46482
|
+
const current = opts?.markCurrent && s.id === ctx?.sessionId ? chalk99.dim(" \xB7 current") : "";
|
|
46407
46483
|
const suffix = `${status}${current}`;
|
|
46408
46484
|
const summaryBudget = Math.max(8, colW - visibleWidth(indent) - visibleWidth(idPart) - visibleWidth(suffix) - 2);
|
|
46409
46485
|
const summaryPart = truncateVisible(sessionSummaryText(s), summaryBudget);
|
|
@@ -46444,13 +46520,13 @@ function buildSystemLines(colW, statusRows, recent) {
|
|
|
46444
46520
|
lines.push(sectionHeading("System"));
|
|
46445
46521
|
const labelW = Math.max(...statusRows.map((r) => r.label.length), "last used".length);
|
|
46446
46522
|
for (const item of statusRows) {
|
|
46447
|
-
const label =
|
|
46523
|
+
const label = chalk99.dim(padRight(item.label, labelW));
|
|
46448
46524
|
const state2 = padRight(item.state, 10);
|
|
46449
46525
|
const detailW = Math.max(1, colW - labelW - 13);
|
|
46450
|
-
lines.push(`${label} ${state2} ${
|
|
46526
|
+
lines.push(`${label} ${state2} ${chalk99.dim(truncateVisible(item.detail, detailW))}`);
|
|
46451
46527
|
}
|
|
46452
46528
|
if (recent) {
|
|
46453
|
-
lines.push(`${
|
|
46529
|
+
lines.push(`${chalk99.dim(padRight("last used", labelW))} ${chalk99.dim(recent)}`);
|
|
46454
46530
|
}
|
|
46455
46531
|
return lines;
|
|
46456
46532
|
}
|
|
@@ -46458,10 +46534,10 @@ function buildLastSessionLines(colW, ctx, lastSession, nextAction, emptyDataHint
|
|
|
46458
46534
|
const lines = [""];
|
|
46459
46535
|
lines.push(sectionHeading("Last Session"));
|
|
46460
46536
|
if (!lastSession) {
|
|
46461
|
-
lines.push(` ${
|
|
46537
|
+
lines.push(` ${chalk99.dim("(none)")}`);
|
|
46462
46538
|
lines.push(
|
|
46463
46539
|
truncateVisible(
|
|
46464
|
-
` ${nextAction.command ? actionHint(nextAction.label, nextAction.command, nextAction.detail) : `${
|
|
46540
|
+
` ${nextAction.command ? actionHint(nextAction.label, nextAction.command, nextAction.detail) : `${chalk99.dim(nextAction.label)} ${chalk99.dim(nextAction.detail)}`}`,
|
|
46465
46541
|
colW
|
|
46466
46542
|
)
|
|
46467
46543
|
);
|
|
@@ -46475,7 +46551,7 @@ function buildLastSessionLines(colW, ctx, lastSession, nextAction, emptyDataHint
|
|
|
46475
46551
|
if (!isCurrent) {
|
|
46476
46552
|
lines.push(
|
|
46477
46553
|
truncateVisible(
|
|
46478
|
-
` ${
|
|
46554
|
+
` ${chalk99.dim("Resume:")} ${paint("accent", `/session ${lastSession.id.slice(-4)}`)}`,
|
|
46479
46555
|
colW
|
|
46480
46556
|
)
|
|
46481
46557
|
);
|
|
@@ -46484,7 +46560,7 @@ function buildLastSessionLines(colW, ctx, lastSession, nextAction, emptyDataHint
|
|
|
46484
46560
|
truncateVisible(` ${actionHint(nextAction.label, nextAction.command, nextAction.detail)}`, colW)
|
|
46485
46561
|
);
|
|
46486
46562
|
} else {
|
|
46487
|
-
lines.push(truncateVisible(` ${
|
|
46563
|
+
lines.push(truncateVisible(` ${chalk99.dim(nextAction.label)} ${chalk99.dim(nextAction.detail)}`, colW));
|
|
46488
46564
|
}
|
|
46489
46565
|
if (isCurrent && emptyDataHint) {
|
|
46490
46566
|
lines.push(truncateVisible(` ${emptyDataHint}`, colW));
|
|
@@ -46495,14 +46571,14 @@ function buildActiveSessionsLines(colW, ctx, activeSessions) {
|
|
|
46495
46571
|
const lines = [""];
|
|
46496
46572
|
lines.push(sectionHeading("Active Sessions"));
|
|
46497
46573
|
if (activeSessions.length === 0) {
|
|
46498
|
-
lines.push(` ${
|
|
46574
|
+
lines.push(` ${chalk99.dim("(none in progress)")}`);
|
|
46499
46575
|
return lines;
|
|
46500
46576
|
}
|
|
46501
46577
|
for (const s of activeSessions.slice(0, 5)) {
|
|
46502
46578
|
lines.push(formatActiveSessionLine(s, colW, ctx, { markCurrent: true }));
|
|
46503
46579
|
}
|
|
46504
46580
|
if (activeSessions.length > 5) {
|
|
46505
|
-
lines.push(` ${
|
|
46581
|
+
lines.push(` ${chalk99.dim(`+${activeSessions.length - 5} more \xB7 `)}${paint("accent", "/session")}`);
|
|
46506
46582
|
}
|
|
46507
46583
|
return lines;
|
|
46508
46584
|
}
|
|
@@ -46590,7 +46666,7 @@ async function printWelcome(ctx, version) {
|
|
|
46590
46666
|
const gap = Math.max(0, innerW - versionTag.length);
|
|
46591
46667
|
const gapL = Math.floor(gap / 2);
|
|
46592
46668
|
push(
|
|
46593
|
-
border(`\u256D${"\u2500".repeat(gapL)}`) +
|
|
46669
|
+
border(`\u256D${"\u2500".repeat(gapL)}`) + chalk99.dim(versionTag) + border(`${"\u2500".repeat(gap - gapL)}\u256E`)
|
|
46594
46670
|
);
|
|
46595
46671
|
if (useWideLayout) {
|
|
46596
46672
|
const leftLines = systemLines;
|
|
@@ -46617,7 +46693,7 @@ async function printWelcome(ctx, version) {
|
|
|
46617
46693
|
push(border(`\u2570${"\u2500".repeat(innerW)}\u256F`));
|
|
46618
46694
|
push(
|
|
46619
46695
|
truncateVisible(
|
|
46620
|
-
license.valid ? ` ${paint("accent", "/help")}${
|
|
46696
|
+
license.valid ? ` ${paint("accent", "/help")}${chalk99.dim(" commands \xB7 ")}${paint("accent", "/tour")}${chalk99.dim(" tour \xB7 ")}${paint("accent", "/progress")}${chalk99.dim(" hours \xB7 ")}${paint("accent", "/session")}${chalk99.dim(" resume")}` : ` ${paint("accent", "/help")}${chalk99.dim(" commands \xB7 ")}${paint("accent", "/activate")}${chalk99.dim(" paste a key \xB7 ")}${paint("accent", "/checkout")}${chalk99.dim(" signup \xB7 ")}${paint("accent", "/progress")}${chalk99.dim(" hours")}`,
|
|
46621
46697
|
cardW
|
|
46622
46698
|
)
|
|
46623
46699
|
);
|
|
@@ -46628,7 +46704,7 @@ async function printWelcome(ctx, version) {
|
|
|
46628
46704
|
if (strategyNudge) {
|
|
46629
46705
|
push(
|
|
46630
46706
|
truncateVisible(
|
|
46631
|
-
` ${paint("warning", "\u2691")} ${
|
|
46707
|
+
` ${paint("warning", "\u2691")} ${chalk99.dim(strategyNudge.text)} ${chalk99.dim("\xB7")} ${paint("accent", strategyNudge.command)}`,
|
|
46632
46708
|
cardW
|
|
46633
46709
|
)
|
|
46634
46710
|
);
|
|
@@ -46636,7 +46712,7 @@ async function printWelcome(ctx, version) {
|
|
|
46636
46712
|
const tip = deepdiveNudge.tip ?? deepdiveNudge.command;
|
|
46637
46713
|
push(
|
|
46638
46714
|
truncateVisible(
|
|
46639
|
-
tip ? ` ${paint("warning", "\u2691")} ${
|
|
46715
|
+
tip ? ` ${paint("warning", "\u2691")} ${chalk99.dim(deepdiveNudge.text)} ${chalk99.dim("\xB7")} ${chalk99.dim(tip)}` : ` ${paint("warning", "\u2691")} ${chalk99.dim(deepdiveNudge.text)}`,
|
|
46640
46716
|
cardW
|
|
46641
46717
|
)
|
|
46642
46718
|
);
|
|
@@ -46644,7 +46720,7 @@ async function printWelcome(ctx, version) {
|
|
|
46644
46720
|
} else if (voiceNudge) {
|
|
46645
46721
|
push(
|
|
46646
46722
|
truncateVisible(
|
|
46647
|
-
` ${paint("warning", "\u2691")} ${
|
|
46723
|
+
` ${paint("warning", "\u2691")} ${chalk99.dim(voiceNudge.text)} ${chalk99.dim("\xB7")} ${paint("accent", voiceNudge.command)}`,
|
|
46648
46724
|
cardW
|
|
46649
46725
|
)
|
|
46650
46726
|
);
|
|
@@ -46832,7 +46908,7 @@ __export(repl_exports, {
|
|
|
46832
46908
|
});
|
|
46833
46909
|
import { createInterface as createInterface2 } from "readline/promises";
|
|
46834
46910
|
import { clearLine as clearLine2, cursorTo as cursorTo2 } from "readline";
|
|
46835
|
-
import
|
|
46911
|
+
import chalk100 from "chalk";
|
|
46836
46912
|
import { join as join42 } from "path";
|
|
46837
46913
|
function buildPrompt(ctx) {
|
|
46838
46914
|
return buildConversationPrompt(ctx);
|
|
@@ -46924,12 +47000,12 @@ function renderInlineSuggestion(rl, prompt, ctx) {
|
|
|
46924
47000
|
suggestionPainted = suffix !== null;
|
|
46925
47001
|
clearLine2(process.stdout, 0);
|
|
46926
47002
|
cursorTo2(process.stdout, 0);
|
|
46927
|
-
process.stdout.write(prompt + line + (suffix ?
|
|
47003
|
+
process.stdout.write(prompt + line + (suffix ? chalk100.dim(suffix) : ""));
|
|
46928
47004
|
cursorTo2(process.stdout, promptWidth + cursor);
|
|
46929
47005
|
}
|
|
46930
47006
|
function appendTurnLine(current, promptLabel, currentSummary) {
|
|
46931
|
-
const currentLine = currentSummary ? `${promptLabel} ${current} ${
|
|
46932
|
-
console.log(" " +
|
|
47007
|
+
const currentLine = currentSummary ? `${promptLabel} ${current} ${chalk100.white("\u2192")} ${currentSummary}` : `${promptLabel} ${current}`;
|
|
47008
|
+
console.log(" " + chalk100.dim(currentLine));
|
|
46933
47009
|
console.log();
|
|
46934
47010
|
}
|
|
46935
47011
|
async function goHome(ctx, version, history, opts) {
|
|
@@ -46939,7 +47015,7 @@ async function goHome(ctx, version, history, opts) {
|
|
|
46939
47015
|
clearTerminalHome();
|
|
46940
47016
|
if (opts?.banner) {
|
|
46941
47017
|
console.log();
|
|
46942
|
-
console.log(" " + paint("accent", "\u2713") + " " +
|
|
47018
|
+
console.log(" " + paint("accent", "\u2713") + " " + chalk100.dim(opts.banner));
|
|
46943
47019
|
}
|
|
46944
47020
|
await printWelcome(ctx, version);
|
|
46945
47021
|
}
|
|
@@ -46962,11 +47038,11 @@ async function handleDispatchResult(result, ctx, version, history) {
|
|
|
46962
47038
|
case "unknown":
|
|
46963
47039
|
if (result.suggestion) {
|
|
46964
47040
|
console.log(
|
|
46965
|
-
" " +
|
|
47041
|
+
" " + chalk100.red(`Unknown command: ${result.token}.`) + chalk100.dim(" Did you mean ") + paint("accent", result.suggestion) + chalk100.dim("?")
|
|
46966
47042
|
);
|
|
46967
47043
|
} else {
|
|
46968
47044
|
console.log(
|
|
46969
|
-
" " +
|
|
47045
|
+
" " + chalk100.red(`Unknown command: ${result.token}`) + chalk100.dim(" Type ") + paint("accent", "/help") + chalk100.dim(" to see available commands.")
|
|
46970
47046
|
);
|
|
46971
47047
|
}
|
|
46972
47048
|
break;
|
|
@@ -46990,7 +47066,7 @@ async function runRepl(ctx, version) {
|
|
|
46990
47066
|
});
|
|
46991
47067
|
ctx.rl = rl;
|
|
46992
47068
|
console.log();
|
|
46993
|
-
console.log(" " +
|
|
47069
|
+
console.log(" " + chalk100.dim("What do you want to look at?"));
|
|
46994
47070
|
console.log();
|
|
46995
47071
|
if (ctx.pendingUpdateCheck) {
|
|
46996
47072
|
void ctx.pendingUpdateCheck.then((result) => {
|
|
@@ -47032,7 +47108,7 @@ async function runRepl(ctx, version) {
|
|
|
47032
47108
|
return;
|
|
47033
47109
|
}
|
|
47034
47110
|
sigintPrimed = true;
|
|
47035
|
-
console.log("\n " +
|
|
47111
|
+
console.log("\n " + chalk100.dim("Type /exit to quit, or press Ctrl+C again."));
|
|
47036
47112
|
};
|
|
47037
47113
|
rl.on("SIGINT", sigintHandler);
|
|
47038
47114
|
function shutdownRepl() {
|
|
@@ -47069,7 +47145,7 @@ async function runRepl(ctx, version) {
|
|
|
47069
47145
|
if (!typed && !enterAction) {
|
|
47070
47146
|
clearGhostRowAfterSubmit();
|
|
47071
47147
|
const coach = consumeOrientEmptyEnterCoach(ctx);
|
|
47072
|
-
if (coach) console.log(" " +
|
|
47148
|
+
if (coach) console.log(" " + chalk100.dim(coach));
|
|
47073
47149
|
continue;
|
|
47074
47150
|
}
|
|
47075
47151
|
const line = typed || enterAction.submit;
|
|
@@ -47120,11 +47196,11 @@ async function runRepl(ctx, version) {
|
|
|
47120
47196
|
ctx.wizardDepth = 0;
|
|
47121
47197
|
ctx.secretInputActive = false;
|
|
47122
47198
|
if (err instanceof Error && err.message === "Cancelled") {
|
|
47123
|
-
console.log(" " +
|
|
47199
|
+
console.log(" " + chalk100.dim("Cancelled."));
|
|
47124
47200
|
} else {
|
|
47125
47201
|
const { tryRecoverLlmAuthFailure: tryRecoverLlmAuthFailure2 } = await Promise.resolve().then(() => (init_auth_recovery(), auth_recovery_exports));
|
|
47126
47202
|
if (!await tryRecoverLlmAuthFailure2(ctx, err)) {
|
|
47127
|
-
console.error(" " +
|
|
47203
|
+
console.error(" " + chalk100.red("Error: " + String(err.message ?? err)));
|
|
47128
47204
|
}
|
|
47129
47205
|
}
|
|
47130
47206
|
}
|
|
@@ -47151,10 +47227,10 @@ async function runRepl(ctx, version) {
|
|
|
47151
47227
|
await closeSession(ctx);
|
|
47152
47228
|
}
|
|
47153
47229
|
if (isTranscriptActive(ctx.sessionId)) {
|
|
47154
|
-
console.log(" " +
|
|
47155
|
-
console.log(" " +
|
|
47230
|
+
console.log(" " + chalk100.dim("Transcript: ") + chalk100.dim(transcriptPathForSession(ctx.sessionId)));
|
|
47231
|
+
console.log(" " + chalk100.dim("Context brief: ") + chalk100.dim(contextDocPathForSession(ctx.sessionId)));
|
|
47156
47232
|
}
|
|
47157
|
-
console.log(" " +
|
|
47233
|
+
console.log(" " + chalk100.dim(randomGoodbye()));
|
|
47158
47234
|
}
|
|
47159
47235
|
function printHelpOneShot() {
|
|
47160
47236
|
printHelp();
|
|
@@ -47162,43 +47238,43 @@ function printHelpOneShot() {
|
|
|
47162
47238
|
function printHelp() {
|
|
47163
47239
|
console.log();
|
|
47164
47240
|
console.log(" " + sectionHeading("Conversation"));
|
|
47165
|
-
console.log(" " +
|
|
47166
|
-
console.log(" " +
|
|
47167
|
-
console.log(" " +
|
|
47168
|
-
console.log(" " +
|
|
47169
|
-
console.log(" " +
|
|
47170
|
-
console.log(" " +
|
|
47241
|
+
console.log(" " + chalk100.dim("Type the question. You do not need a slash command."));
|
|
47242
|
+
console.log(" " + chalk100.dim("Paste a CSV path or type ") + paint("accent", '"use demo data"') + chalk100.dim(" to load data."));
|
|
47243
|
+
console.log(" " + chalk100.dim("After analysis, type questions in English."));
|
|
47244
|
+
console.log(" " + chalk100.dim("Type ") + paint("accent", '"how should we fix this?"') + chalk100.dim(" to make a strategy. Type ") + paint("accent", "keep going") + chalk100.dim(" at confirm to keep working until the plan is ready."));
|
|
47245
|
+
console.log(" " + chalk100.dim("Type ") + paint("accent", '"ship a board deck"') + chalk100.dim(" to write a handoff."));
|
|
47246
|
+
console.log(" " + chalk100.dim("The ") + paint("accent", "\u203A") + chalk100.dim(" prompt shows brief or deep after analysis. Brief is the default."));
|
|
47171
47247
|
console.log();
|
|
47172
47248
|
console.log(" " + sectionHeading("Keys"));
|
|
47173
47249
|
console.log(
|
|
47174
|
-
" " + paint("accent", "\u23CE") +
|
|
47250
|
+
" " + paint("accent", "\u23CE") + chalk100.dim(
|
|
47175
47251
|
" Accepts the default. At the main prompt it runs the armed action (yes, use demo data, go ahead, /connect, /update, keep going)."
|
|
47176
47252
|
)
|
|
47177
47253
|
);
|
|
47178
47254
|
console.log(
|
|
47179
|
-
" " +
|
|
47255
|
+
" " + chalk100.dim(
|
|
47180
47256
|
" On yes/no questions and menus it accepts yes (or the recommended option). Type something else to decline or pick another path."
|
|
47181
47257
|
)
|
|
47182
47258
|
);
|
|
47183
47259
|
console.log(
|
|
47184
|
-
" " + paint("accent", "b") +
|
|
47260
|
+
" " + paint("accent", "b") + chalk100.dim(" / ") + paint("accent", "back") + chalk100.dim(" Steps back one confirm gate, or leaves a modal. Does not unload data or undo compute.")
|
|
47185
47261
|
);
|
|
47186
47262
|
console.log(
|
|
47187
|
-
" " +
|
|
47263
|
+
" " + chalk100.dim("On ") + paint("accent", "/settings") + chalk100.dim(" menus, ") + paint("accent", "b") + chalk100.dim(" leaves the hub (same as Done).")
|
|
47188
47264
|
);
|
|
47189
47265
|
console.log(
|
|
47190
|
-
" " + paint("accent", "more") +
|
|
47266
|
+
" " + paint("accent", "more") + chalk100.dim(" Shows the full strategy brief after the short summary.")
|
|
47191
47267
|
);
|
|
47192
47268
|
console.log(
|
|
47193
|
-
" " + paint("accent", "expand") +
|
|
47269
|
+
" " + paint("accent", "expand") + chalk100.dim(
|
|
47194
47270
|
" After a short Q&A answer, shows more reasoning for that same answer. With no last answer, expands the strategy brief when one is on screen."
|
|
47195
47271
|
)
|
|
47196
47272
|
);
|
|
47197
47273
|
console.log(
|
|
47198
|
-
" " + paint("accent", "cancel") +
|
|
47274
|
+
" " + paint("accent", "cancel") + chalk100.dim(" Drops the current modal overlay (strategy, think, ship, unconfirmed scope).")
|
|
47199
47275
|
);
|
|
47200
47276
|
console.log(
|
|
47201
|
-
" " +
|
|
47277
|
+
" " + chalk100.dim("On ") + paint("accent", "/tour") + chalk100.dim(" slides, ") + paint("accent", "b") + chalk100.dim(" moves to the previous slide.")
|
|
47202
47278
|
);
|
|
47203
47279
|
console.log();
|
|
47204
47280
|
console.log(" " + sectionHeading("Shortcuts"));
|
|
@@ -47226,11 +47302,11 @@ function printHelp() {
|
|
|
47226
47302
|
];
|
|
47227
47303
|
const maxW = Math.max(...shortcuts.map(([c]) => c.length)) + 2;
|
|
47228
47304
|
for (const [cmd, desc] of shortcuts) {
|
|
47229
|
-
console.log(` ${paint("accent", padRight(cmd, maxW))} ${
|
|
47305
|
+
console.log(` ${paint("accent", padRight(cmd, maxW))} ${chalk100.dim(desc)}`);
|
|
47230
47306
|
}
|
|
47231
47307
|
console.log();
|
|
47232
47308
|
console.log(" " + sectionHeading("Teach NTRP"));
|
|
47233
|
-
console.log(" " +
|
|
47309
|
+
console.log(" " + chalk100.dim("NTRP learns your business over time. There are three ways to teach it:"));
|
|
47234
47310
|
const teach = [
|
|
47235
47311
|
["/remember <fact>", "Store a fact, a decision, or a preference"],
|
|
47236
47312
|
["/recall [topic]", "Show what NTRP stores about your business"],
|
|
@@ -47239,13 +47315,13 @@ function printHelp() {
|
|
|
47239
47315
|
];
|
|
47240
47316
|
const teachMaxW = Math.max(...teach.map(([c]) => c.length)) + 2;
|
|
47241
47317
|
for (const [cmd, desc] of teach) {
|
|
47242
|
-
console.log(` ${paint("accent", padRight(cmd, teachMaxW))} ${
|
|
47318
|
+
console.log(` ${paint("accent", padRight(cmd, teachMaxW))} ${chalk100.dim(desc)}`);
|
|
47243
47319
|
}
|
|
47244
|
-
console.log(" " +
|
|
47320
|
+
console.log(" " + chalk100.dim("When a key is connected, NTRP stores a small number of facts when you close a session."));
|
|
47245
47321
|
console.log();
|
|
47246
|
-
console.log(" " +
|
|
47322
|
+
console.log(" " + chalk100.dim("Factory reset: type ") + paint("accent", "/scratch") + chalk100.dim("."));
|
|
47247
47323
|
console.log();
|
|
47248
|
-
console.log(" " +
|
|
47324
|
+
console.log(" " + chalk100.dim("These commands also work: ") + paint("accent", "/new") + chalk100.dim(", ") + paint("accent", "/diagnose") + chalk100.dim(", ") + paint("accent", "/metrics") + chalk100.dim(", ") + paint("accent", "/session") + chalk100.dim("."));
|
|
47249
47325
|
console.log();
|
|
47250
47326
|
}
|
|
47251
47327
|
var REPL_BUILTINS, ANSI_PATTERN, GOODBYES, GHOST_HINTS, ghostHintTurn, activeGhostHint, suggestionPainted;
|
|
@@ -47345,7 +47421,7 @@ init_errors();
|
|
|
47345
47421
|
init_diagnostics();
|
|
47346
47422
|
init_types();
|
|
47347
47423
|
init_version();
|
|
47348
|
-
import
|
|
47424
|
+
import chalk101 from "chalk";
|
|
47349
47425
|
var VERSION = getInstalledVersion();
|
|
47350
47426
|
function exitIfVersionFlag(argv) {
|
|
47351
47427
|
const rest = argv.slice(2).filter((a) => a === "--version" || a === "-v");
|
|
@@ -47383,7 +47459,7 @@ async function main() {
|
|
|
47383
47459
|
debug: args.globals.debug
|
|
47384
47460
|
});
|
|
47385
47461
|
if (!ctx.execution.color) {
|
|
47386
|
-
|
|
47462
|
+
chalk101.level = 0;
|
|
47387
47463
|
}
|
|
47388
47464
|
fatalReporting = {
|
|
47389
47465
|
command: firstToken(args.input) || "ntrp",
|
|
@@ -47400,16 +47476,16 @@ async function main() {
|
|
|
47400
47476
|
if (isStructuredOutput(ctx.execution)) {
|
|
47401
47477
|
emitError(cmd || "ntrp", new NtrpError("license_invalid", lic.message, 3 /* Auth */));
|
|
47402
47478
|
}
|
|
47403
|
-
console.error(
|
|
47479
|
+
console.error(chalk101.red(`
|
|
47404
47480
|
${lic.message}`));
|
|
47405
|
-
console.error(
|
|
47481
|
+
console.error(chalk101.dim(" Trial's over \u2014 /upgrade and paste your key.\n"));
|
|
47406
47482
|
process.exit(1);
|
|
47407
47483
|
}
|
|
47408
47484
|
}
|
|
47409
47485
|
const PROFILE_HINT_SKIP = /* @__PURE__ */ new Set(["onboard", "setup", "config", "connect", "activate", "help", "home", "exit", "quit", "clear", "profile", "progress", "deepdive", "tour", "settings", "voice", "logs"]);
|
|
47410
47486
|
if (!isProfileConfigured() && !PROFILE_HINT_SKIP.has(cmd) && !ctx.execution.quiet) {
|
|
47411
47487
|
console.error(
|
|
47412
|
-
" " +
|
|
47488
|
+
" " + chalk101.dim("Tip: run ") + paint("accent", "ntrp") + chalk101.dim(" interactively to set up your company profile for richer answers.")
|
|
47413
47489
|
);
|
|
47414
47490
|
}
|
|
47415
47491
|
const result = await dispatch(args.input, ctx);
|
|
@@ -47421,12 +47497,12 @@ async function main() {
|
|
|
47421
47497
|
}
|
|
47422
47498
|
if (result.suggestion) {
|
|
47423
47499
|
console.error(
|
|
47424
|
-
|
|
47500
|
+
chalk101.red(` Unknown command: ${result.token}.`) + chalk101.dim(" Did you mean ") + paint("accent", result.suggestion) + chalk101.dim("?")
|
|
47425
47501
|
);
|
|
47426
47502
|
} else {
|
|
47427
|
-
console.error(
|
|
47503
|
+
console.error(chalk101.red(` Unknown command: ${result.token}`));
|
|
47428
47504
|
}
|
|
47429
|
-
console.error(
|
|
47505
|
+
console.error(chalk101.dim(" Run 'ntrp' for the interactive prompt."));
|
|
47430
47506
|
process.exit(1);
|
|
47431
47507
|
break;
|
|
47432
47508
|
case "help":
|
|
@@ -47479,7 +47555,7 @@ async function main() {
|
|
|
47479
47555
|
if (justUpdated) {
|
|
47480
47556
|
clearTerminalHome();
|
|
47481
47557
|
console.log();
|
|
47482
|
-
console.log(" " + paint("accent", "\u2713") + " " +
|
|
47558
|
+
console.log(" " + paint("accent", "\u2713") + " " + chalk101.dim(`Now running v${justUpdated.to}`));
|
|
47483
47559
|
}
|
|
47484
47560
|
await printWelcome2(ctx, VERSION);
|
|
47485
47561
|
await runRepl(ctx, VERSION);
|
|
@@ -47493,9 +47569,9 @@ async function die(err, scope) {
|
|
|
47493
47569
|
if (fatalReporting.structured) {
|
|
47494
47570
|
emitError(fatalReporting.command, err);
|
|
47495
47571
|
}
|
|
47496
|
-
console.error(
|
|
47572
|
+
console.error(chalk101.red(` ${describeError(err)}`));
|
|
47497
47573
|
if (!(err instanceof NtrpError) && err instanceof Error && err.stack) {
|
|
47498
|
-
console.error(
|
|
47574
|
+
console.error(chalk101.dim(err.stack.split("\n").slice(1).join("\n")));
|
|
47499
47575
|
}
|
|
47500
47576
|
process.exit(err instanceof NtrpError ? err.exitCode : 1 /* RuntimeError */);
|
|
47501
47577
|
}
|
package/dist/mcp/server.js
CHANGED
|
@@ -1088,7 +1088,7 @@ import chalk3 from "chalk";
|
|
|
1088
1088
|
function printDeepdiveHint(metricId, label) {
|
|
1089
1089
|
const name = label ?? metricId;
|
|
1090
1090
|
console.log(
|
|
1091
|
-
" " + chalk3.dim(`Ask what ${name.toLowerCase()} means \u2014 or `) + paint("accent", `/tour ${metricId}`) + chalk3.dim("
|
|
1091
|
+
" " + chalk3.dim(`Ask what ${name.toLowerCase()} means \u2014 or `) + paint("accent", `/tour ${metricId}`) + chalk3.dim(" if you want the card.")
|
|
1092
1092
|
);
|
|
1093
1093
|
console.log();
|
|
1094
1094
|
}
|
|
@@ -24670,12 +24670,9 @@ var init_ghost_hints = __esm({
|
|
|
24670
24670
|
init_suggested_asks();
|
|
24671
24671
|
PHASE_GHOST_HINTS = {
|
|
24672
24672
|
orient: [
|
|
24673
|
-
'try "pipeline health"',
|
|
24674
24673
|
'try "how healthy is the pipeline?"',
|
|
24675
|
-
'try "what
|
|
24676
|
-
'try "
|
|
24677
|
-
'try "what is the most expensive problem to solve?"',
|
|
24678
|
-
'try "board deck on Q3"'
|
|
24674
|
+
'try "what does freshness mean?"',
|
|
24675
|
+
'try "what should I do next?"'
|
|
24679
24676
|
],
|
|
24680
24677
|
awaiting_data: [
|
|
24681
24678
|
'try "use demo data"',
|