@sonnechasser/ntrp 0.2.0 → 0.2.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.
@@ -11975,12 +11975,41 @@ function buildPlaybookBlock() {
11975
11975
  Learned plays (added from this team's experience and ingested case studies \u2014 recommend these when they fit):
11976
11976
  ${learned}`;
11977
11977
  }
11978
- var ANALYST_INSTINCT_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, METRICS_BLOCK, FINDINGS_SCHEMA_BLOCK;
11978
+ function buildCommandCatalogBlock() {
11979
+ const GROUP_ANALYSIS = "Analysis & data";
11980
+ const GROUP_SESSION = "Session, memory & outputs";
11981
+ const GROUP_SETTINGS = "Settings & providers";
11982
+ const groupOrder = [GROUP_ANALYSIS, GROUP_SESSION, GROUP_SETTINGS];
11983
+ const groupFor = (section) => {
11984
+ if (section === "Hidden" || section === "Getting Started") return GROUP_ANALYSIS;
11985
+ if (section === "Settings") return GROUP_SETTINGS;
11986
+ return GROUP_SESSION;
11987
+ };
11988
+ const groups = new Map(groupOrder.map((label) => [label, []]));
11989
+ for (const meta of listWorkflows(true)) {
11990
+ if (meta.name === "ask") continue;
11991
+ if (meta.section === "Admin") continue;
11992
+ groups.get(groupFor(meta.section)).push(formatCatalogLine(meta));
11993
+ }
11994
+ groups.get(GROUP_SESSION).push(
11995
+ "- /help \u2014 Show the shortcut list",
11996
+ "- /home \u2014 Show the welcome dashboard and current session status"
11997
+ );
11998
+ return groupOrder.filter((label) => groups.get(label).length > 0).map((label) => `${label}:
11999
+ ${groups.get(label).join("\n")}`).join("\n\n");
12000
+ }
12001
+ function formatCatalogLine(meta) {
12002
+ const args = meta.args?.trim() ? ` ${meta.args.trim()}` : "";
12003
+ const note = DESTRUCTIVE_COMMAND_NOTES[meta.name] ? ` (${DESTRUCTIVE_COMMAND_NOTES[meta.name]})` : "";
12004
+ return `- /${meta.name}${args} \u2014 ${meta.description}${note}`;
12005
+ }
12006
+ var ANALYST_INSTINCT_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, FINDINGS_SCHEMA_BLOCK;
11979
12007
  var init_prompt_parts = __esm({
11980
12008
  "src/ai/prompt-parts.ts"() {
11981
12009
  "use strict";
11982
12010
  init_profile();
11983
12011
  init_playbook();
12012
+ init_registry2();
11984
12013
  ANALYST_INSTINCT_BLOCK = `A search box returns numbers; a world-class analyst returns insight. The instincts below are what separate the two. Bring them PROACTIVELY \u2014 surface the connection, the chain, and the priority without waiting to be asked, because the user often doesn't know to ask.
11985
12014
 
11986
12015
  - ROOT CAUSE OVER SYMPTOM LIST. GTM problems are rarely independent \u2014 they're usually one failure wearing several masks. When two or more vital signs are red or yellow, your first instinct is to ask "is this the same underlying problem showing up in different places?" and, when it is, name the single cause. (Classic shape: a broken lead handoff starves reps of new pipeline \u2192 they work only what they can already see \u2192 everything else ages into stale, zombie deals \u2192 the forecast inflates with deals nobody is touching \u2192 the quarter is quietly at risk. One cause, four symptoms.)
@@ -12003,6 +12032,9 @@ Restraint matters: NTRP is a stethoscope, not a surgeon. Observe, connect, and r
12003
12032
  - "Fix the Handoff Gap" (id: fix-handoff-gap) \u2014 when drop_rate is high
12004
12033
  - "Retarget Misdirected Effort" (id: retarget-effort) \u2014 when signal_to_noise is low
12005
12034
  - "Unstick the Pipeline" (id: unstick-pipeline) \u2014 when flow_rate is low`;
12035
+ DESTRUCTIVE_COMMAND_NOTES = {
12036
+ reset: "destructive \u2014 wipes all data, requires --force"
12037
+ };
12006
12038
  METRICS_BLOCK = `Revenue metrics measure GTM output \u2014 the standard SaaS metrics:
12007
12039
  - ARR: Total closed-won revenue. New ARR + Expansion ARR = growth; Churned + Contraction = leakage.
12008
12040
  - NRR (Net Revenue Retention): >100% means growing from existing customers. Best-in-class: 110%+.
@@ -13949,15 +13981,18 @@ function inferHandoffTarget(input) {
13949
13981
  return "plan";
13950
13982
  }
13951
13983
  function isShipIntent(input) {
13952
- return /\b(handoff|ship|deliver|board memo|export|turn this into|write.?up|action plan)\b/i.test(
13953
- input.trim()
13954
- );
13984
+ const line = input.trim();
13985
+ if (/\?\s*$/.test(line) || QUESTION_LEAD_RE.test(line)) return false;
13986
+ return SHIP_INTENT_RE.test(line);
13955
13987
  }
13988
+ var QUESTION_LEAD_RE, SHIP_INTENT_RE;
13956
13989
  var init_handoff_draft = __esm({
13957
13990
  "src/conversation/handoff-draft.ts"() {
13958
13991
  "use strict";
13959
13992
  init_profile();
13960
13993
  init_session_analysis();
13994
+ QUESTION_LEAD_RE = /^\s*(what|why|how|when|where|who|which|is|are|was|were|do|does|did|explain|tell me|help me understand)\b/i;
13995
+ SHIP_INTENT_RE = /\b(ship|export|deliver|write[- ]?up|board memo|action plan|turn (this|it|that) into|(draft|create|make|build|prepare|generate|send)\s+(me\s+)?(a\s+|the\s+)?hand[- ]?off|hand[- ]?off\s+(prompt|doc|document|plan))\b/i;
13961
13996
  }
13962
13997
  });
13963
13998
 
@@ -14519,6 +14554,16 @@ FORMATTING (brief mode \u2014 scannable, not chunky):
14519
14554
  - No ### headings, no tables, no --- footer, no closing "want me to dig deeper?" question.
14520
14555
  - Single-point answers can stay one sentence \u2014 don't force bullets when one line is enough.
14521
14556
  `;
14557
+ const commandStyleRule = responseMode === "brief" ? '- Style in brief mode: a suggestion is at most ONE short trailing line after your answer (e.g. "`/segment compare enterprise smb` gives the full side-by-side.") \u2014 no heading, no footer.' : "- Style: weave the suggestion naturally into your close \u2014 one sentence with the exact invocation in `inline code`.";
14558
+ const commandSection = `PRESET COMMANDS (slash commands the user can type at the prompt \u2014 you may SUGGEST these; you have no ability to run them):
14559
+ ${buildCommandCatalogBlock()}
14560
+
14561
+ COMMAND SUGGESTION RULES (suggest-only):
14562
+ - Evaluate whether the user's question overlaps a preset command's capability. Answer the question yourself first, from tools and context; suggest a command only when it adds capability beyond your answer \u2014 writing files, opening a wizard, running a heavier analysis, or changing settings.
14563
+ - If the message is primarily a request to DO what a command does (e.g. "export this to my notes"), say plainly that you don't execute commands and give the exact invocation to type, e.g. \`/handoff notes\`.
14564
+ - Never claim a command was run. Never invent flags \u2014 use only the documented arguments above. At most ONE command suggestion per answer; most answers need none.
14565
+ - Only suggest a command that can work right now given the session state you know (e.g. no \`/diagnose\` or \`/export\` before data or a diagnosis exists).
14566
+ ${commandStyleRule}`;
14522
14567
  const outputRules = responseMode === "brief" ? `OUTPUT RULES:
14523
14568
  - Respond in plain text markdown (not JSON). Lead sentence + bullets when helpful \u2014 never a dense paragraph wall.
14524
14569
  - Pull numbers from the completed session analysis or conversation history \u2014 never guess.
@@ -14542,6 +14587,8 @@ ${VITAL_SIGNS_BLOCK}
14542
14587
 
14543
14588
  PLAYBOOK \u2014 recommend these plays when appropriate:
14544
14589
  ${buildPlaybookBlock()}
14590
+
14591
+ ${commandSection}
14545
14592
  ${formattingSection}
14546
14593
  ${outputRules}`;
14547
14594
  }
@@ -24479,19 +24526,6 @@ var init_progress2 = __esm({
24479
24526
  }
24480
24527
  });
24481
24528
 
24482
- // src/whimsy/time-bank-smoke.ts
24483
- init_install();
24484
- init_progress();
24485
- init_store();
24486
- init_scratch_wipe();
24487
- init_time_milestones();
24488
- init_time_perspectives();
24489
- init_time_bank();
24490
- init_perspective_rotation();
24491
- import { existsSync as existsSync23, mkdirSync as mkdirSync13, mkdtempSync, rmSync as rmSync4, writeFileSync as writeFileSync20 } from "fs";
24492
- import { join as join30 } from "path";
24493
- import { tmpdir } from "os";
24494
-
24495
24529
  // src/workflows/registry.ts
24496
24530
  function parseFrontmatter(raw) {
24497
24531
  if (!raw.startsWith("---")) return { meta: {}, body: raw };
@@ -24511,7 +24545,6 @@ function parseFrontmatter(raw) {
24511
24545
  }
24512
24546
  return { meta, body: body.trim() };
24513
24547
  }
24514
- var registry = null;
24515
24548
  function loadRegistry() {
24516
24549
  if (registry) return registry;
24517
24550
  registry = /* @__PURE__ */ new Map();
@@ -24533,6 +24566,10 @@ function loadRegistry() {
24533
24566
  function hasCommand(name) {
24534
24567
  return loadRegistry().has(name);
24535
24568
  }
24569
+ function listWorkflows(includeHidden = false) {
24570
+ const all2 = Array.from(loadRegistry().values()).map((e) => e.meta);
24571
+ return includeHidden ? all2 : all2.filter((m) => !m.hidden);
24572
+ }
24536
24573
  async function resolveHandler(name) {
24537
24574
  const entry = loadRegistry().get(name);
24538
24575
  if (!entry) return null;
@@ -24648,10 +24685,15 @@ async function importHandler(runtimePath) {
24648
24685
  return null;
24649
24686
  }
24650
24687
  }
24651
- var EMBEDDED_WORKFLOWS = [
24652
- {
24653
- name: "new",
24654
- raw: `---
24688
+ var registry, EMBEDDED_WORKFLOWS;
24689
+ var init_registry2 = __esm({
24690
+ "src/workflows/registry.ts"() {
24691
+ "use strict";
24692
+ registry = null;
24693
+ EMBEDDED_WORKFLOWS = [
24694
+ {
24695
+ name: "new",
24696
+ raw: `---
24655
24697
  name: new
24656
24698
  description: Start a new analysis \u2014 one menu picks data + first report
24657
24699
  section: Hidden
@@ -24665,10 +24707,10 @@ health, demo \u2192 metrics, your CSV, or empty. Loads data and runs the first r
24665
24707
  (formulas only \u2014 no AI unless you add \`--findings\` later). Demo metrics works
24666
24708
  without \`/onboard\`; your own CSV needs a profile for metrics calibration.
24667
24709
  After the report, **ask questions in plain English** \u2014 no slash needed.`
24668
- },
24669
- {
24670
- name: "end",
24671
- raw: `---
24710
+ },
24711
+ {
24712
+ name: "end",
24713
+ raw: `---
24672
24714
  name: end
24673
24715
  description: Close the current analysis without a handoff
24674
24716
  section: Start
@@ -24680,10 +24722,10 @@ Mark the current session as finished even when you didn't produce a report or
24680
24722
  other output. It drops off the "in progress" list, saves your transcript and
24681
24723
  dataset anchor for later, and rotates you to a fresh empty session. Use
24682
24724
  \`/handoff\` instead when you want to ship something.`
24683
- },
24684
- {
24685
- name: "session",
24686
- raw: `---
24725
+ },
24726
+ {
24727
+ name: "session",
24728
+ raw: `---
24687
24729
  name: session
24688
24730
  description: Pick up or browse your analyses
24689
24731
  section: Hidden
@@ -24697,10 +24739,10 @@ sessions with unfinished work (reached insight, never delivered) surfaced
24697
24739
  first. Pass a session id (or type the 4-char suffix after listing) to pick it
24698
24740
  back up \u2014 this rebinds its dataset and conversation so you continue exactly
24699
24741
  where you left off. \`new\` starts a fresh analysis.`
24700
- },
24701
- {
24702
- name: "handoff",
24703
- raw: `---
24742
+ },
24743
+ {
24744
+ name: "handoff",
24745
+ raw: `---
24704
24746
  name: handoff
24705
24747
  description: Turn the analysis into an output
24706
24748
  section: Start
@@ -24713,10 +24755,10 @@ receipts, or a repository package \u2014 or generate a ready-to-paste prompt for
24713
24755
  another agent to build a review deck, an Asana project, a Clay table, or an
24714
24756
  action plan from this diagnosis. Producing an output marks the session
24715
24757
  delivered so it stops showing up as unfinished work.`
24716
- },
24717
- {
24718
- name: "onboard",
24719
- raw: `---
24758
+ },
24759
+ {
24760
+ name: "onboard",
24761
+ raw: `---
24720
24762
  name: onboard
24721
24763
  description: Set up your company profile
24722
24764
  section: Settings
@@ -24728,10 +24770,10 @@ two LLM engines (Anthropic and/or OpenAI), then asks
24728
24770
  a few seed questions and uses AI to draft industry, ICP, deal size, and stack
24729
24771
  guesses. Profile is stored at \`~/.ntrp/profile.json\` and flows into every
24730
24772
  AI surface (findings, NL answers, demo generation).`
24731
- },
24732
- {
24733
- name: "sessions",
24734
- raw: `---
24773
+ },
24774
+ {
24775
+ name: "sessions",
24776
+ raw: `---
24735
24777
  name: sessions
24736
24778
  description: Browse past session history
24737
24779
  section: More
@@ -24743,10 +24785,10 @@ hidden: true
24743
24785
  List and inspect past REPL sessions. Shows session dates, AI-generated
24744
24786
  summaries, and exchange counts. Use \`show <id>\` to view the full
24745
24787
  conversation from a specific session.`
24746
- },
24747
- {
24748
- name: "setup",
24749
- raw: `---
24788
+ },
24789
+ {
24790
+ name: "setup",
24791
+ raw: `---
24750
24792
  name: setup
24751
24793
  description: Configure NTRP for headless and agent use
24752
24794
  section: Settings
@@ -24759,10 +24801,10 @@ Validate local readiness or configure NTRP non-interactively for automation.
24759
24801
  directory state. \`setup agent\` accepts a profile JSON file or direct flags \u2014
24760
24802
  \`--llm-key <key>\` auto-detects the provider from any pasted key
24761
24803
  (\`--llm-provider <id>\` to force one).`
24762
- },
24763
- {
24764
- name: "update",
24765
- raw: `---
24804
+ },
24805
+ {
24806
+ name: "update",
24807
+ raw: `---
24766
24808
  name: update
24767
24809
  description: Update NTRP to the latest version
24768
24810
  section: Settings
@@ -24770,10 +24812,10 @@ handler: ../commands/update.ts
24770
24812
  ---
24771
24813
 
24772
24814
  Update the globally installed NTRP package via npm.`
24773
- },
24774
- {
24775
- name: "resume",
24776
- raw: `---
24815
+ },
24816
+ {
24817
+ name: "resume",
24818
+ raw: `---
24777
24819
  name: resume
24778
24820
  description: Continue a previous session
24779
24821
  section: More
@@ -24785,10 +24827,10 @@ hidden: true
24785
24827
  Load a previous session's context so the AI can reference what was
24786
24828
  discussed before. Without an ID, resumes the most recent session.
24787
24829
  Use a full session ID or 4-char suffix.`
24788
- },
24789
- {
24790
- name: "name",
24791
- raw: `---
24830
+ },
24831
+ {
24832
+ name: "name",
24833
+ raw: `---
24792
24834
  name: name
24793
24835
  description: Tag this session with a label
24794
24836
  section: More
@@ -24799,10 +24841,10 @@ handler: ../commands/name.ts
24799
24841
  Give the current session a human-readable name so you can find it
24800
24842
  later. The name appears in the REPL prompt, session list, and
24801
24843
  welcome dashboard. Max 40 characters.`
24802
- },
24803
- {
24804
- name: "switch",
24805
- raw: `---
24844
+ },
24845
+ {
24846
+ name: "switch",
24847
+ raw: `---
24806
24848
  name: switch
24807
24849
  description: Jump to a named session
24808
24850
  section: More
@@ -24814,10 +24856,10 @@ hidden: true
24814
24856
  Save the current session and switch to a named one. If the name
24815
24857
  exists, loads its context and messages. If new, creates a fresh
24816
24858
  session with that name. Without arguments, lists all named sessions.`
24817
- },
24818
- {
24819
- name: "actions",
24820
- raw: `---
24859
+ },
24860
+ {
24861
+ name: "actions",
24862
+ raw: `---
24821
24863
  name: actions
24822
24864
  description: Propose, approve, and execute actions
24823
24865
  section: More
@@ -24830,10 +24872,10 @@ dry-run proposal that exercises the approval and execution lifecycle without
24830
24872
  touching external tools. Execute-class actions require local approval before
24831
24873
  they can run. Use \`/actions continue\` to advance the newest pending or
24832
24874
  approved proposal without copying a handle during the active workflow.`
24833
- },
24834
- {
24835
- name: "diagnose",
24836
- raw: `---
24875
+ },
24876
+ {
24877
+ name: "diagnose",
24878
+ raw: `---
24837
24879
  name: diagnose
24838
24880
  description: Compute vital signs and generate findings
24839
24881
  section: Hidden
@@ -24846,10 +24888,10 @@ Compute the 5 vital signs (freshness, flow rate, drop rate, signal-to-noise,
24846
24888
  thread depth) for either the full dataset or a segment. Companion to \`/metrics\`
24847
24889
  when your session primary is SaaS metrics. Use \`--deep\` to run the agentic
24848
24890
  investigation loop instead of the single-shot findings path.`
24849
- },
24850
- {
24851
- name: "metrics",
24852
- raw: `---
24891
+ },
24892
+ {
24893
+ name: "metrics",
24894
+ raw: `---
24853
24895
  name: metrics
24854
24896
  description: SaaS metrics \u2014 refresh or add the revenue view
24855
24897
  section: Hidden
@@ -24863,10 +24905,10 @@ Win Rate, Pipeline Coverage, and more. Each metric includes a confidence score
24863
24905
  and reliability gate showing what data unlocks the next tier. Use \`--findings\`
24864
24906
  for AI analysis calibrated to your company profile. Revenue ledger CSV format:
24865
24907
  account, period, mrr, event_type.`
24866
- },
24867
- {
24868
- name: "ask",
24869
- raw: `---
24908
+ },
24909
+ {
24910
+ name: "ask",
24911
+ raw: `---
24870
24912
  name: ask
24871
24913
  description: Chat with your pipeline data
24872
24914
  section: Hidden
@@ -24878,10 +24920,10 @@ handler: ../commands/ask.ts
24878
24920
  Ask a plain-English question about your GTM health and SaaS metrics. Free-form
24879
24921
  text at the REPL prompt routes to the same agent. Respects your session primary
24880
24922
  lens; can cross-reference vital signs and revenue metrics via tools.`
24881
- },
24882
- {
24883
- name: "recap",
24884
- raw: `---
24923
+ },
24924
+ {
24925
+ name: "recap",
24926
+ raw: `---
24885
24927
  name: recap
24886
24928
  description: Summarize the current session
24887
24929
  section: More
@@ -24891,10 +24933,10 @@ handler: ../commands/recap.ts
24891
24933
  Summarize the current REPL session using AI. Reads all natural-language
24892
24934
  exchanges from the session and produces a structured overview: key findings,
24893
24935
  dollar impacts, and recommended next steps.`
24894
- },
24895
- {
24896
- name: "remember",
24897
- raw: `---
24936
+ },
24937
+ {
24938
+ name: "remember",
24939
+ raw: `---
24898
24940
  name: remember
24899
24941
  description: Teach the analyst a durable fact
24900
24942
  section: More
@@ -24905,10 +24947,10 @@ handler: ../commands/remember.ts
24905
24947
  Store a durable fact, decision, or preference about your business. Stored
24906
24948
  memory flows into every future analysis so the agent gets to know your
24907
24949
  business better over time \u2014 like a consultant building up a client file.`
24908
- },
24909
- {
24910
- name: "recall",
24911
- raw: `---
24950
+ },
24951
+ {
24952
+ name: "recall",
24953
+ raw: `---
24912
24954
  name: recall
24913
24955
  description: See what the analyst remembers
24914
24956
  section: More
@@ -24920,10 +24962,10 @@ Jog the analyst's memory. With no arguments, lists the durable facts it knows
24920
24962
  and the analyses it has already run. Pass a topic to see what it remembers
24921
24963
  about that subject \u2014 pulled from facts, strategies, wins, and ingested
24922
24964
  knowledge.`
24923
- },
24924
- {
24925
- name: "rate",
24926
- raw: `---
24965
+ },
24966
+ {
24967
+ name: "rate",
24968
+ raw: `---
24927
24969
  name: rate
24928
24970
  description: Give feedback on the last answer
24929
24971
  section: More
@@ -24934,10 +24976,10 @@ handler: ../commands/rate.ts
24934
24976
  Tell the analyst how its last answer landed. \`/rate good\` reinforces the
24935
24977
  approach; \`/rate bad <what was off>\` records a correction. Feedback becomes a
24936
24978
  durable preference so the analyst gets better at working with you over time.`
24937
- },
24938
- {
24939
- name: "knowledge",
24940
- raw: `---
24979
+ },
24980
+ {
24981
+ name: "knowledge",
24982
+ raw: `---
24941
24983
  name: knowledge
24942
24984
  description: Ingest external case studies & frameworks
24943
24985
  section: More
@@ -24949,10 +24991,10 @@ Teach the analyst from work done outside the platform. \`/knowledge add <file>\`
24949
24991
  ingests a markdown, text, or PDF case study, framework, or benchmark report and
24950
24992
  indexes it for retrieval during analysis. \`/knowledge list\` shows what's
24951
24993
  indexed. Drop files into ~/.ntrp/knowledge to stage them.`
24952
- },
24953
- {
24954
- name: "ingest",
24955
- raw: `---
24994
+ },
24995
+ {
24996
+ name: "ingest",
24997
+ raw: `---
24956
24998
  name: ingest
24957
24999
  description: Import CRM CSV exports (or --demo)
24958
25000
  section: Hidden
@@ -24970,10 +25012,10 @@ your company profile. Accepts \`--scenario <name>\` to pick a scenario (else
24970
25012
  random) and \`--regen-taxonomy\` to rebuild the profile-derived market
24971
25013
  taxonomy. Rep names draw from a curated music / sports / film roster for a
24972
25014
  little demo delight; pass \`--no-whimsy\` to use generic names instead.`
24973
- },
24974
- {
24975
- name: "demo",
24976
- raw: `---
25015
+ },
25016
+ {
25017
+ name: "demo",
25018
+ raw: `---
24977
25019
  name: demo
24978
25020
  description: Generate demo scenario data
24979
25021
  section: Getting Started
@@ -24990,10 +25032,10 @@ By default, sales rep names are drawn from a curated music / sports / film
24990
25032
  roster; pass \`--no-whimsy\` for generic placeholder names.
24991
25033
 
24992
25034
  This command is hidden \u2014 prefer \`/ingest --demo\` which delegates here.`
24993
- },
24994
- {
24995
- name: "strategy",
24996
- raw: `---
25035
+ },
25036
+ {
25037
+ name: "strategy",
25038
+ raw: `---
24997
25039
  name: strategy
24998
25040
  description: Ingest and manage GTM strategies
24999
25041
  section: More
@@ -25008,10 +25050,10 @@ creates a strategy from a short pasted description.
25008
25050
  \`/strategy sync --path <folder>\` scans an Obsidian-style local library and
25009
25051
  imports supported strategy documents. Use \`/strategy sources\` to see available
25010
25052
  library connector types.`
25011
- },
25012
- {
25013
- name: "segment",
25014
- raw: `---
25053
+ },
25054
+ {
25055
+ name: "segment",
25056
+ raw: `---
25015
25057
  name: segment
25016
25058
  description: Browse and inspect segments
25017
25059
  section: More
@@ -25022,10 +25064,10 @@ handler: ../commands/segment.ts
25022
25064
  Browse, inspect, and manage data segments. With no arguments, lists all
25023
25065
  segments sorted worst-first. Subcommands: \`show <name>\`, \`compare <a> <b>\`,
25024
25066
  \`create <name> --entity <type> --filter <expr>\`, \`delete <name>\`.`
25025
- },
25026
- {
25027
- name: "report",
25028
- raw: `---
25067
+ },
25068
+ {
25069
+ name: "report",
25070
+ raw: `---
25029
25071
  name: report
25030
25072
  description: Export latest diagnosis
25031
25073
  section: More
@@ -25035,10 +25077,10 @@ handler: ../commands/report.ts
25035
25077
 
25036
25078
  Export the most recent diagnosis as terminal output, markdown, or JSON. Use
25037
25079
  \`--output <file>\` to write to disk instead of stdout.`
25038
- },
25039
- {
25040
- name: "progress",
25041
- raw: `---
25080
+ },
25081
+ {
25082
+ name: "progress",
25083
+ raw: `---
25042
25084
  name: progress
25043
25085
  description: Usage stats and milestone ladder
25044
25086
  section: Navigation
@@ -25049,10 +25091,10 @@ handler: ../commands/progress.ts
25049
25091
  Hours saved, weekly activity trend, session counts, AI token usage, and the
25050
25092
  full milestone ladder with progress bars. Use reset (type "reset" to confirm)
25051
25093
  to clear hours and milestones while keeping this install's identity.`
25052
- },
25053
- {
25054
- name: "status",
25055
- raw: `---
25094
+ },
25095
+ {
25096
+ name: "status",
25097
+ raw: `---
25056
25098
  name: status
25057
25099
  description: Show last diagnosis and entity counts
25058
25100
  section: More
@@ -25061,10 +25103,10 @@ handler: ../commands/status.ts
25061
25103
 
25062
25104
  Show what data you currently have loaded and the result of your last
25063
25105
  diagnosis, if any.`
25064
- },
25065
- {
25066
- name: "scratch",
25067
- raw: `---
25106
+ },
25107
+ {
25108
+ name: "scratch",
25109
+ raw: `---
25068
25110
  name: scratch
25069
25111
  description: Wipe config, profile, and all datasets
25070
25112
  section: Admin
@@ -25079,10 +25121,10 @@ by default. Pass \`--include-progress\` to also wipe install identity and hours.
25079
25121
  Also preserves memory, strategies, wins, knowledge, exports, and audit. Requires
25080
25122
  typing \`scratch\` in the REPL or passing \`--confirm\` one-shot. Triggers
25081
25123
  onboarding on next interactive use.`
25082
- },
25083
- {
25084
- name: "cleanup",
25085
- raw: `---
25124
+ },
25125
+ {
25126
+ name: "cleanup",
25127
+ raw: `---
25086
25128
  name: cleanup
25087
25129
  description: Close all active sessions
25088
25130
  section: Admin
@@ -25093,10 +25135,10 @@ hidden: true
25093
25135
 
25094
25136
  Mark every in-progress session as ended without deleting transcripts or dataset
25095
25137
  files. Interactive REPL only. Confirm with y/N or \`--confirm\` one-shot.`
25096
- },
25097
- {
25098
- name: "deactivate-demo",
25099
- raw: `---
25138
+ },
25139
+ {
25140
+ name: "deactivate-demo",
25141
+ raw: `---
25100
25142
  name: deactivate-demo
25101
25143
  description: Disable demo data generators
25102
25144
  section: Admin
@@ -25107,10 +25149,10 @@ hidden: true
25107
25149
 
25108
25150
  Persistently disable demo generators (\`/ingest --demo\`, \`/new --demo\`, NL
25109
25151
  "use demo data"). Re-enable with \`/config set demo-enabled true\`.`
25110
- },
25111
- {
25112
- name: "reset",
25113
- raw: `---
25152
+ },
25153
+ {
25154
+ name: "reset",
25155
+ raw: `---
25114
25156
  name: reset
25115
25157
  description: Clear all data and start fresh
25116
25158
  section: More
@@ -25120,10 +25162,10 @@ handler: ../commands/reset.ts
25120
25162
 
25121
25163
  Drop all rows from every table in the local DuckDB database. Requires
25122
25164
  \`--force\` to proceed.`
25123
- },
25124
- {
25125
- name: "playbook",
25126
- raw: `---
25165
+ },
25166
+ {
25167
+ name: "playbook",
25168
+ raw: `---
25127
25169
  name: playbook
25128
25170
  description: Show or extend recommended plays
25129
25171
  section: More
@@ -25136,10 +25178,10 @@ play-id to drill into a single play's steps and expected outcome. Run
25136
25178
  \`/playbook add\` and the analyst walks you through capturing a new play, step by
25137
25179
  step \u2014 no flags or quoting needed. Learned plays become recommendable during
25138
25180
  analysis. (Power users can still pass everything as flags in one shot.)`
25139
- },
25140
- {
25141
- name: "export",
25142
- raw: `---
25181
+ },
25182
+ {
25183
+ name: "export",
25184
+ raw: `---
25143
25185
  name: export
25144
25186
  description: Save diagnosis to Obsidian notes
25145
25187
  section: More
@@ -25149,10 +25191,10 @@ handler: ../commands/export.ts
25149
25191
 
25150
25192
  Write the most recent diagnosis to your configured notes directory as
25151
25193
  markdown, ready for Obsidian, Logseq, or any other note tool.`
25152
- },
25153
- {
25154
- name: "publish",
25155
- raw: `---
25194
+ },
25195
+ {
25196
+ name: "publish",
25197
+ raw: `---
25156
25198
  name: publish
25157
25199
  description: Preview and propose repository exports
25158
25200
  section: More
@@ -25165,10 +25207,10 @@ strategies, evidence, and action receipts. \`preview\` shows the write plan;
25165
25207
  \`propose\` creates an approval-gated action proposal. The first executable
25166
25208
  target is local markdown for Obsidian-compatible repositories. Notion,
25167
25209
  Airtable, and GitHub mappings are documented via \`/publish targets\`.`
25168
- },
25169
- {
25170
- name: "backmeup",
25171
- raw: `---
25210
+ },
25211
+ {
25212
+ name: "backmeup",
25213
+ raw: `---
25172
25214
  name: backmeup
25173
25215
  description: Export diagnosis receipts as CSV
25174
25216
  section: More
@@ -25181,10 +25223,10 @@ Slack thread, email, or slide deck. Creates a timestamped folder under
25181
25223
  ~/.ntrp/exports/ containing a cover sheet with headline numbers, a findings
25182
25224
  file, and per-vital-sign evidence CSVs showing exactly which deals, contacts,
25183
25225
  or orgs drove each score. Use --output <dir> to write somewhere else.`
25184
- },
25185
- {
25186
- name: "profile",
25187
- raw: `---
25226
+ },
25227
+ {
25228
+ name: "profile",
25229
+ raw: `---
25188
25230
  name: profile
25189
25231
  description: Set sales motion
25190
25232
  section: Settings
@@ -25194,10 +25236,10 @@ handler: ../commands/profile.ts
25194
25236
 
25195
25237
  Choose a sales motion preset (PLG, SMB Velocity, Mid-Market, Enterprise). Each
25196
25238
  preset adjusts the vital-sign thresholds to match your deal cycle.`
25197
- },
25198
- {
25199
- name: "connect",
25200
- raw: `---
25239
+ },
25240
+ {
25241
+ name: "connect",
25242
+ raw: `---
25201
25243
  name: connect
25202
25244
  description: Connect an AI provider (paste any key)
25203
25245
  section: Settings
@@ -25213,10 +25255,10 @@ Works with Anthropic, OpenAI, Google Gemini, Groq, Mistral, DeepSeek, xAI,
25213
25255
  OpenRouter, Together, and Fireworks out of the box. \`/connect ollama\` wires a
25214
25256
  local Ollama; \`/connect --base-url <url> --id <name>\` registers any other
25215
25257
  OpenAI-compatible endpoint.`
25216
- },
25217
- {
25218
- name: "config",
25219
- raw: `---
25258
+ },
25259
+ {
25260
+ name: "config",
25261
+ raw: `---
25220
25262
  name: config
25221
25263
  description: Get/set config values
25222
25264
  section: Settings
@@ -25231,10 +25273,10 @@ Manage CLI configuration stored at \`~/.ntrp/config.json\`. Useful keys:
25231
25273
 
25232
25274
  Setting a provider key opens a hidden prompt and auto-discovers that
25233
25275
  provider's models. Prefer \`/connect\` \u2014 it detects the provider for you.`
25234
- },
25235
- {
25236
- name: "provider",
25237
- raw: `---
25276
+ },
25277
+ {
25278
+ name: "provider",
25279
+ raw: `---
25238
25280
  name: provider
25239
25281
  description: Switch active LLM engine
25240
25282
  section: Settings
@@ -25246,10 +25288,10 @@ Choose which connected engine answers this session \u2014 any provider added via
25246
25288
  \`/connect\` (anthropic, openai, groq, google, ollama, custom endpoints, ...).
25247
25289
  Session-scoped by default; \`/provider save\` writes the default to config.
25248
25290
  \`/provider failover on\` enables rate-limit auto-failover.`
25249
- },
25250
- {
25251
- name: "tier",
25252
- raw: `---
25291
+ },
25292
+ {
25293
+ name: "tier",
25294
+ raw: `---
25253
25295
  name: tier
25254
25296
  description: Set inference tier (HIGH/MEDIUM/LOW)
25255
25297
  section: Settings
@@ -25260,10 +25302,10 @@ handler: ../commands/tier.ts
25260
25302
  Set quality/cost tier for this REPL session. Agentic surfaces respect your tier;
25261
25303
  some single-shot surfaces keep fixed defaults. \`/tier list\` highlights the
25262
25304
  active stack. Add \`--default\` to persist to config.`
25263
- },
25264
- {
25265
- name: "model",
25266
- raw: `---
25305
+ },
25306
+ {
25307
+ name: "model",
25308
+ raw: `---
25267
25309
  name: model
25268
25310
  description: Override the active LLM model
25269
25311
  section: Settings
@@ -25275,10 +25317,10 @@ handler: ../commands/model.ts
25275
25317
  tier assignments. \`/model refresh\` re-discovers the live list. \`/model set <id>\`
25276
25318
  pins a model on the **active engine**; cross-provider IDs are rejected \u2014
25277
25319
  switch with \`/provider\` first.`
25278
- },
25279
- {
25280
- name: "activate",
25281
- raw: `---
25320
+ },
25321
+ {
25322
+ name: "activate",
25323
+ raw: `---
25282
25324
  name: activate
25283
25325
  description: Enter license key
25284
25326
  section: Settings
@@ -25288,10 +25330,10 @@ handler: ../commands/activate.ts
25288
25330
 
25289
25331
  Activate NTRP with your license key (format: NTRP-XXXX-XXXX-XXXX). Most
25290
25332
  commands require a valid license.`
25291
- },
25292
- {
25293
- name: "upgrade",
25294
- raw: `---
25333
+ },
25334
+ {
25335
+ name: "upgrade",
25336
+ raw: `---
25295
25337
  name: upgrade
25296
25338
  description: Upgrade trial to Pro \u2014 checkout + paste key
25297
25339
  section: Settings
@@ -25300,10 +25342,10 @@ handler: ../commands/upgrade.ts
25300
25342
 
25301
25343
  Open the Pro checkout page and paste your new license key without leaving
25302
25344
  the REPL. Use during trial grace or after cutoff. Flags: --url (print checkout URL only).`
25303
- },
25304
- {
25305
- name: "checkout",
25306
- raw: `---
25345
+ },
25346
+ {
25347
+ name: "checkout",
25348
+ raw: `---
25307
25349
  name: checkout
25308
25350
  description: Open signup checkout in your browser
25309
25351
  section: Settings
@@ -25312,10 +25354,10 @@ handler: ../commands/checkout.ts
25312
25354
 
25313
25355
  Opens the Lemon Squeezy checkout page in your default browser. Use anytime
25314
25356
  you need a trial or Pro license key.`
25315
- },
25316
- {
25317
- name: "feedback",
25318
- raw: `---
25357
+ },
25358
+ {
25359
+ name: "feedback",
25360
+ raw: `---
25319
25361
  name: feedback
25320
25362
  description: Correct your profile in plain English
25321
25363
  section: Settings
@@ -25327,10 +25369,24 @@ Apply natural-language corrections to your company profile. Maps structured
25327
25369
  fields when possible (e.g. "our sales cycle is 6 months" updates
25328
25370
  sales_cycle_days) and merges remaining nuances into a custom_context
25329
25371
  paragraph that flows into all AI surfaces.`
25372
+ }
25373
+ ];
25330
25374
  }
25331
- ];
25375
+ });
25332
25376
 
25333
25377
  // src/whimsy/time-bank-smoke.ts
25378
+ init_install();
25379
+ init_progress();
25380
+ init_store();
25381
+ init_scratch_wipe();
25382
+ init_time_milestones();
25383
+ init_time_perspectives();
25384
+ init_time_bank();
25385
+ init_perspective_rotation();
25386
+ init_registry2();
25387
+ import { existsSync as existsSync23, mkdirSync as mkdirSync13, mkdtempSync, rmSync as rmSync4, writeFileSync as writeFileSync20 } from "fs";
25388
+ import { join as join30 } from "path";
25389
+ import { tmpdir } from "os";
25334
25390
  function assert(condition, message) {
25335
25391
  if (!condition) {
25336
25392
  console.error(`FAIL: ${message}`);