@sonnechasser/ntrp 1.5.1 → 1.5.3
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 +364 -282
- package/dist/mcp/server.js +137 -82
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -10025,7 +10025,9 @@ section: Settings
|
|
|
10025
10025
|
handler: ../commands/update.ts
|
|
10026
10026
|
---
|
|
10027
10027
|
|
|
10028
|
-
Install the latest global NTRP package via npm
|
|
10028
|
+
Install the latest global NTRP package via npm.
|
|
10029
|
+
Interactive confirms with \u23CE yes, then re-execs onto home.
|
|
10030
|
+
One-shot installs immediately and prints a restart hint.`
|
|
10029
10031
|
},
|
|
10030
10032
|
{
|
|
10031
10033
|
name: "resume",
|
|
@@ -10379,7 +10381,7 @@ hidden: true
|
|
|
10379
10381
|
---
|
|
10380
10382
|
|
|
10381
10383
|
Mark every in-progress session as ended. Transcripts and dataset files stay.
|
|
10382
|
-
Interactive ntrp only. Confirm with
|
|
10384
|
+
Interactive ntrp only. Confirm with \u23CE no (type yes to proceed), or pass \`--confirm\` in one-shot.`
|
|
10383
10385
|
},
|
|
10384
10386
|
{
|
|
10385
10387
|
name: "deactivate-demo",
|
|
@@ -13812,6 +13814,8 @@ var init_repl_globals = __esm({
|
|
|
13812
13814
|
var prompts_exports = {};
|
|
13813
13815
|
__export(prompts_exports, {
|
|
13814
13816
|
createPromptSession: () => createPromptSession,
|
|
13817
|
+
formatConfirmDefaultHint: () => formatConfirmDefaultHint,
|
|
13818
|
+
formatEnterDefaultHint: () => formatEnterDefaultHint,
|
|
13815
13819
|
presentRecommendedFirst: () => presentRecommendedFirst,
|
|
13816
13820
|
presentRecommendedMultiFirst: () => presentRecommendedMultiFirst,
|
|
13817
13821
|
resolveAskMultiInput: () => resolveAskMultiInput,
|
|
@@ -13832,17 +13836,29 @@ function secretPromptLine(question) {
|
|
|
13832
13836
|
function stripTerminalArtifacts(input) {
|
|
13833
13837
|
return input.replace(/\x1b\[[0-9;]*[a-zA-Z~]/g, "").replace(/\x1b\][^\x07]*(\x07|\x1b\\)/g, "").replace(/\x1b\[200~/g, "").replace(/\x1b\[201~/g, "");
|
|
13834
13838
|
}
|
|
13839
|
+
function formatEnterDefaultHint(defaultValue) {
|
|
13840
|
+
const lower = defaultValue.trim().toLowerCase();
|
|
13841
|
+
if (lower === "y" || lower === "yes") return "\u23CE yes";
|
|
13842
|
+
if (lower === "n" || lower === "no") return "\u23CE no";
|
|
13843
|
+
return defaultValue;
|
|
13844
|
+
}
|
|
13845
|
+
function formatConfirmDefaultHint(defaultYes = true) {
|
|
13846
|
+
return formatEnterDefaultHint(defaultYes ? "yes" : "no");
|
|
13847
|
+
}
|
|
13835
13848
|
function renderQuestion(question, defaultValue) {
|
|
13836
13849
|
const base = ` ${marker()}${bold(question)}`;
|
|
13837
13850
|
if (defaultValue !== void 0 && defaultValue !== "") {
|
|
13838
|
-
return `${base} ${chalk5.dim(`[${defaultValue}]`)} `;
|
|
13851
|
+
return `${base} ${chalk5.dim(`[${formatEnterDefaultHint(defaultValue)}]`)} `;
|
|
13839
13852
|
}
|
|
13840
13853
|
return `${base} `;
|
|
13841
13854
|
}
|
|
13842
13855
|
function resolveConfirmInput(raw, defaultYes = true) {
|
|
13843
13856
|
const answer = raw.trim().toLowerCase();
|
|
13844
13857
|
if (!answer) return defaultYes;
|
|
13845
|
-
|
|
13858
|
+
if (answer === "y" || answer === "yes" || answer === "yeah" || answer === "yep") {
|
|
13859
|
+
return true;
|
|
13860
|
+
}
|
|
13861
|
+
return false;
|
|
13846
13862
|
}
|
|
13847
13863
|
function presentRecommendedFirst(choices, recommended) {
|
|
13848
13864
|
if (choices.length === 0) return [];
|
|
@@ -13917,8 +13933,7 @@ function createPromptSession(existing, ctx) {
|
|
|
13917
13933
|
}
|
|
13918
13934
|
}
|
|
13919
13935
|
async function confirm(question, defaultYes = true) {
|
|
13920
|
-
const
|
|
13921
|
-
const raw = (await rl2.question(renderQuestion(question, hint))).trim();
|
|
13936
|
+
const raw = (await rl2.question(renderQuestion(question, defaultYes ? "yes" : "no"))).trim();
|
|
13922
13937
|
assertNotGlobalReplCommand(raw);
|
|
13923
13938
|
return resolveConfirmInput(raw, defaultYes);
|
|
13924
13939
|
}
|
|
@@ -14143,6 +14158,77 @@ var init_activation = __esm({
|
|
|
14143
14158
|
}
|
|
14144
14159
|
});
|
|
14145
14160
|
|
|
14161
|
+
// src/config/update-check.ts
|
|
14162
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync19, unlinkSync as unlinkSync3, writeFileSync as writeFileSync14 } from "fs";
|
|
14163
|
+
import { join as join22 } from "path";
|
|
14164
|
+
var init_update_check = __esm({
|
|
14165
|
+
"src/config/update-check.ts"() {
|
|
14166
|
+
"use strict";
|
|
14167
|
+
init_store();
|
|
14168
|
+
}
|
|
14169
|
+
});
|
|
14170
|
+
|
|
14171
|
+
// src/version.ts
|
|
14172
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20 } from "fs";
|
|
14173
|
+
import { dirname as dirname4, join as join23 } from "path";
|
|
14174
|
+
import { fileURLToPath } from "url";
|
|
14175
|
+
function readVersionFromPackageJson(packageJsonPath) {
|
|
14176
|
+
if (!existsSync23(packageJsonPath)) return null;
|
|
14177
|
+
try {
|
|
14178
|
+
const pkg = JSON.parse(readFileSync20(packageJsonPath, "utf-8"));
|
|
14179
|
+
if (typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
|
|
14180
|
+
} catch {
|
|
14181
|
+
}
|
|
14182
|
+
return null;
|
|
14183
|
+
}
|
|
14184
|
+
function readVersionNearEntry(entryPath) {
|
|
14185
|
+
const start = dirname4(entryPath);
|
|
14186
|
+
for (const rel of [join23(start, "..", "package.json"), join23(start, "../..", "package.json")]) {
|
|
14187
|
+
const version = readVersionFromPackageJson(rel);
|
|
14188
|
+
if (version) return version;
|
|
14189
|
+
}
|
|
14190
|
+
return null;
|
|
14191
|
+
}
|
|
14192
|
+
function readInstalledVersionFromDisk() {
|
|
14193
|
+
return readVersionNearEntry(fileURLToPath(import.meta.url));
|
|
14194
|
+
}
|
|
14195
|
+
function getInstalledVersion() {
|
|
14196
|
+
if (cachedVersion) return cachedVersion;
|
|
14197
|
+
cachedVersion = readInstalledVersionFromDisk() ?? "0.0.0";
|
|
14198
|
+
return cachedVersion;
|
|
14199
|
+
}
|
|
14200
|
+
var cachedVersion;
|
|
14201
|
+
var init_version = __esm({
|
|
14202
|
+
"src/version.ts"() {
|
|
14203
|
+
"use strict";
|
|
14204
|
+
}
|
|
14205
|
+
});
|
|
14206
|
+
|
|
14207
|
+
// src/update/registry.ts
|
|
14208
|
+
function parseVersionParts(version) {
|
|
14209
|
+
const cleaned = version.trim().replace(/^v/i, "");
|
|
14210
|
+
const core = cleaned.split("-")[0] ?? cleaned;
|
|
14211
|
+
const parts = core.split(".").map((p) => parseInt(p, 10));
|
|
14212
|
+
return [parts[0] ?? 0, parts[1] ?? 0, parts[2] ?? 0];
|
|
14213
|
+
}
|
|
14214
|
+
function isNewerVersion(latest, current) {
|
|
14215
|
+
const [lMaj, lMin, lPatch] = parseVersionParts(latest);
|
|
14216
|
+
const [cMaj, cMin, cPatch] = parseVersionParts(current);
|
|
14217
|
+
if (lMaj !== cMaj) return lMaj > cMaj;
|
|
14218
|
+
if (lMin !== cMin) return lMin > cMin;
|
|
14219
|
+
return lPatch > cPatch;
|
|
14220
|
+
}
|
|
14221
|
+
function hasAvailableUpdate(update) {
|
|
14222
|
+
return Boolean(update && isNewerVersion(update.latest, update.current));
|
|
14223
|
+
}
|
|
14224
|
+
var init_registry2 = __esm({
|
|
14225
|
+
"src/update/registry.ts"() {
|
|
14226
|
+
"use strict";
|
|
14227
|
+
init_update_check();
|
|
14228
|
+
init_version();
|
|
14229
|
+
}
|
|
14230
|
+
});
|
|
14231
|
+
|
|
14146
14232
|
// src/conversation/recommended-action.ts
|
|
14147
14233
|
function resolveRecommendedAction(ctx) {
|
|
14148
14234
|
if (!hasValidLicense()) return { submit: "/activate", hint: "/activate" };
|
|
@@ -14161,6 +14247,8 @@ function resolveRecommendedAction(ctx) {
|
|
|
14161
14247
|
return ctx.strategistState?.step === "objective_confirm" ? { submit: "yes", hint: "yes" } : null;
|
|
14162
14248
|
case "think":
|
|
14163
14249
|
return null;
|
|
14250
|
+
case "orient":
|
|
14251
|
+
return hasAvailableUpdate(ctx.updateAvailable) ? { submit: "/update", hint: "/update" } : null;
|
|
14164
14252
|
default:
|
|
14165
14253
|
return null;
|
|
14166
14254
|
}
|
|
@@ -14170,6 +14258,7 @@ var init_recommended_action = __esm({
|
|
|
14170
14258
|
"use strict";
|
|
14171
14259
|
init_repl_api();
|
|
14172
14260
|
init_activation();
|
|
14261
|
+
init_registry2();
|
|
14173
14262
|
init_phase();
|
|
14174
14263
|
}
|
|
14175
14264
|
});
|
|
@@ -18853,7 +18942,7 @@ async function handleStrategizeFlow(input, ctx) {
|
|
|
18853
18942
|
" " + chalk17.dim("That looks like a question. A strategy objective is waiting.")
|
|
18854
18943
|
);
|
|
18855
18944
|
console.log(
|
|
18856
|
-
" " + chalk17.dim("
|
|
18945
|
+
" " + chalk17.dim("Confirm? ") + chalk17.cyan("\u23CE yes") + chalk17.dim(" \xB7 ") + chalk17.cyan("b back") + chalk17.dim(" / ") + chalk17.cyan("adjust") + chalk17.dim(" \xB7 ") + chalk17.cyan("cancel") + chalk17.dim(" to answer questions first.")
|
|
18857
18946
|
);
|
|
18858
18947
|
console.log();
|
|
18859
18948
|
return "Awaiting confirm";
|
|
@@ -18866,7 +18955,7 @@ async function handleStrategizeFlow(input, ctx) {
|
|
|
18866
18955
|
}
|
|
18867
18956
|
console.log();
|
|
18868
18957
|
console.log(
|
|
18869
|
-
" " + chalk17.dim("
|
|
18958
|
+
" " + chalk17.dim("Confirm? ") + chalk17.cyan("\u23CE yes") + chalk17.dim(" \xB7 ") + chalk17.cyan("b back") + chalk17.dim(" / ") + chalk17.cyan("adjust") + chalk17.dim(" \xB7 ") + chalk17.cyan("cancel")
|
|
18870
18959
|
);
|
|
18871
18960
|
console.log();
|
|
18872
18961
|
return "Awaiting confirm";
|
|
@@ -19239,7 +19328,9 @@ function buildSituationalAwarenessBlock(ctx, opts = {}) {
|
|
|
19239
19328
|
);
|
|
19240
19329
|
} else if (phase === "orient") {
|
|
19241
19330
|
lines.push("Already done: nothing locked yet");
|
|
19242
|
-
lines.push(
|
|
19331
|
+
lines.push(
|
|
19332
|
+
"Available now: help the user name a focus; CLI will propose scope from their words. If \u23CE /update is armed, the CLI owns the install confirm \u2014 do not re-ask about updating"
|
|
19333
|
+
);
|
|
19243
19334
|
} else if (phase === "think") {
|
|
19244
19335
|
lines.push("Already done: analysis complete; think channel open");
|
|
19245
19336
|
lines.push("Available now: socratic exploration; draft_strategy / draft_handoff when ready to graduate");
|
|
@@ -20156,8 +20247,8 @@ var init_bundle = __esm({
|
|
|
20156
20247
|
});
|
|
20157
20248
|
|
|
20158
20249
|
// src/repositories/markdown.ts
|
|
20159
|
-
import { mkdirSync as
|
|
20160
|
-
import { basename as basename5, dirname as
|
|
20250
|
+
import { mkdirSync as mkdirSync13, writeFileSync as writeFileSync15 } from "fs";
|
|
20251
|
+
import { basename as basename5, dirname as dirname5, join as join24, resolve as resolve8 } from "path";
|
|
20161
20252
|
import { stringify as stringifyYaml2 } from "yaml";
|
|
20162
20253
|
function renderMarkdownFiles(pkg) {
|
|
20163
20254
|
const bundleJson = JSON.stringify(pkg, null, 2) + "\n";
|
|
@@ -20377,12 +20468,12 @@ var init_markdown2 = __esm({
|
|
|
20377
20468
|
write(pkg) {
|
|
20378
20469
|
const root = getRootPath(pkg.target);
|
|
20379
20470
|
const files = renderMarkdownFiles(pkg);
|
|
20380
|
-
|
|
20471
|
+
mkdirSync13(root, { recursive: true });
|
|
20381
20472
|
const written = [];
|
|
20382
20473
|
for (const file of files) {
|
|
20383
|
-
const absolutePath =
|
|
20384
|
-
|
|
20385
|
-
|
|
20474
|
+
const absolutePath = join24(root, file.relativePath);
|
|
20475
|
+
mkdirSync13(dirname5(absolutePath), { recursive: true });
|
|
20476
|
+
writeFileSync15(absolutePath, file.contents, "utf-8");
|
|
20386
20477
|
written.push(absolutePath);
|
|
20387
20478
|
}
|
|
20388
20479
|
return {
|
|
@@ -20485,7 +20576,7 @@ var init_publish = __esm({
|
|
|
20485
20576
|
});
|
|
20486
20577
|
|
|
20487
20578
|
// src/services/smoke-protocol.ts
|
|
20488
|
-
import { join as
|
|
20579
|
+
import { join as join25 } from "path";
|
|
20489
20580
|
function isSmokeProtocolTrigger(input) {
|
|
20490
20581
|
return normalize(input).includes(SMOKE_TRIGGER_PHRASE);
|
|
20491
20582
|
}
|
|
@@ -20521,7 +20612,7 @@ async function runSmokeProtocol(_input, ctx) {
|
|
|
20521
20612
|
});
|
|
20522
20613
|
const proposalResult = await proposeRepositoryExport({
|
|
20523
20614
|
target: "markdown",
|
|
20524
|
-
directory:
|
|
20615
|
+
directory: join25(getExportsDir(), "repository-smoke"),
|
|
20525
20616
|
source: "smoke_protocol",
|
|
20526
20617
|
modelOrFixture: "smoke-protocol-v1"
|
|
20527
20618
|
});
|
|
@@ -21261,7 +21352,7 @@ var init_scenario_fit = __esm({
|
|
|
21261
21352
|
});
|
|
21262
21353
|
|
|
21263
21354
|
// src/conversation/onboard-tiers.ts
|
|
21264
|
-
import { existsSync as
|
|
21355
|
+
import { existsSync as existsSync24, statSync as statSync4 } from "fs";
|
|
21265
21356
|
function flagSet(tier) {
|
|
21266
21357
|
return Boolean(getConfigValue(TIER_CONFIG_KEYS[tier]));
|
|
21267
21358
|
}
|
|
@@ -23884,18 +23975,18 @@ var init_generator = __esm({
|
|
|
23884
23975
|
});
|
|
23885
23976
|
|
|
23886
23977
|
// src/demo/taxonomy-cache.ts
|
|
23887
|
-
import { readFileSync as
|
|
23978
|
+
import { readFileSync as readFileSync21, writeFileSync as writeFileSync16, existsSync as existsSync25, mkdirSync as mkdirSync14, unlinkSync as unlinkSync4 } from "fs";
|
|
23888
23979
|
import { homedir as homedir7 } from "os";
|
|
23889
|
-
import { join as
|
|
23980
|
+
import { join as join26 } from "path";
|
|
23890
23981
|
function ensureDir6() {
|
|
23891
|
-
if (!
|
|
23892
|
-
|
|
23982
|
+
if (!existsSync25(NTRP_DIR4)) {
|
|
23983
|
+
mkdirSync14(NTRP_DIR4, { recursive: true });
|
|
23893
23984
|
}
|
|
23894
23985
|
}
|
|
23895
23986
|
function loadCachedTaxonomy(profile) {
|
|
23896
|
-
if (!
|
|
23987
|
+
if (!existsSync25(TAXONOMY_PATH)) return null;
|
|
23897
23988
|
try {
|
|
23898
|
-
const parsed = JSON.parse(
|
|
23989
|
+
const parsed = JSON.parse(readFileSync21(TAXONOMY_PATH, "utf-8"));
|
|
23899
23990
|
if (!parsed || typeof parsed !== "object") return null;
|
|
23900
23991
|
if (parsed.profile_updated_at !== profile.updated_at) return null;
|
|
23901
23992
|
return parsed;
|
|
@@ -23905,14 +23996,14 @@ function loadCachedTaxonomy(profile) {
|
|
|
23905
23996
|
}
|
|
23906
23997
|
function saveCachedTaxonomy(taxonomy) {
|
|
23907
23998
|
ensureDir6();
|
|
23908
|
-
|
|
23999
|
+
writeFileSync16(TAXONOMY_PATH, JSON.stringify(taxonomy, null, 2) + "\n");
|
|
23909
24000
|
}
|
|
23910
24001
|
var NTRP_DIR4, TAXONOMY_PATH;
|
|
23911
24002
|
var init_taxonomy_cache = __esm({
|
|
23912
24003
|
"src/demo/taxonomy-cache.ts"() {
|
|
23913
24004
|
"use strict";
|
|
23914
|
-
NTRP_DIR4 =
|
|
23915
|
-
TAXONOMY_PATH =
|
|
24005
|
+
NTRP_DIR4 = join26(homedir7(), ".ntrp");
|
|
24006
|
+
TAXONOMY_PATH = join26(NTRP_DIR4, "demo-taxonomy.json");
|
|
23916
24007
|
}
|
|
23917
24008
|
});
|
|
23918
24009
|
|
|
@@ -24370,7 +24461,7 @@ __export(inbox_setup_exports, {
|
|
|
24370
24461
|
shouldOfferInboxSkillSetup: () => shouldOfferInboxSkillSetup
|
|
24371
24462
|
});
|
|
24372
24463
|
import chalk27 from "chalk";
|
|
24373
|
-
import { existsSync as
|
|
24464
|
+
import { existsSync as existsSync26 } from "fs";
|
|
24374
24465
|
function markDemoOffered() {
|
|
24375
24466
|
setConfigValue("ai-inbox-nudge-seen", "true");
|
|
24376
24467
|
}
|
|
@@ -24402,7 +24493,7 @@ function printSkipHint(beat) {
|
|
|
24402
24493
|
async function reuseInboxFolderIfPresent(session, beat, folderPath) {
|
|
24403
24494
|
if (getAiInboxDir()) return false;
|
|
24404
24495
|
const candidates = folderPath ? [folderPath] : [.../* @__PURE__ */ new Set([defaultAiInboxDir(), legacyAiInboxDir()])];
|
|
24405
|
-
const existing = candidates.find((p) =>
|
|
24496
|
+
const existing = candidates.find((p) => existsSync26(p));
|
|
24406
24497
|
if (!existing) return false;
|
|
24407
24498
|
console.log(" " + chalk27.dim("Pickup folder still on disk: ") + existing);
|
|
24408
24499
|
const reuse = await session.confirm("Reuse this pickup folder?", true);
|
|
@@ -24508,7 +24599,7 @@ __export(ingest_exports, {
|
|
|
24508
24599
|
handler: () => handler3
|
|
24509
24600
|
});
|
|
24510
24601
|
import chalk28 from "chalk";
|
|
24511
|
-
import { readFileSync as
|
|
24602
|
+
import { readFileSync as readFileSync22, existsSync as existsSync27 } from "fs";
|
|
24512
24603
|
import { basename as basename6 } from "path";
|
|
24513
24604
|
async function handler3(args, ctx) {
|
|
24514
24605
|
const { positional, flags } = parseArgs(args, [
|
|
@@ -24532,7 +24623,7 @@ async function handler3(args, ctx) {
|
|
|
24532
24623
|
console.error(chalk28.dim(" /ingest --demo [--scenario <name>]"));
|
|
24533
24624
|
process.exit(1);
|
|
24534
24625
|
}
|
|
24535
|
-
if (!
|
|
24626
|
+
if (!existsSync27(file)) {
|
|
24536
24627
|
console.error(chalk28.red(` File not found: ${file}`));
|
|
24537
24628
|
process.exit(1);
|
|
24538
24629
|
}
|
|
@@ -24550,7 +24641,7 @@ async function handler3(args, ctx) {
|
|
|
24550
24641
|
try {
|
|
24551
24642
|
await initSchema();
|
|
24552
24643
|
spinner.text = "Parsing CSV\u2026";
|
|
24553
|
-
const content =
|
|
24644
|
+
const content = readFileSync22(file, "utf-8");
|
|
24554
24645
|
const { rows, headers } = parseCSV(content);
|
|
24555
24646
|
if (rows.length === 0) {
|
|
24556
24647
|
spinner.fail("CSV is empty");
|
|
@@ -24920,8 +25011,8 @@ __export(ingest_chat_exports, {
|
|
|
24920
25011
|
loadDemoFromChat: () => loadDemoFromChat,
|
|
24921
25012
|
looksLikeFilePath: () => looksLikeFilePath
|
|
24922
25013
|
});
|
|
24923
|
-
import { existsSync as
|
|
24924
|
-
import { basename as basename7, join as
|
|
25014
|
+
import { existsSync as existsSync28, readdirSync as readdirSync6, statSync as statSync5 } from "fs";
|
|
25015
|
+
import { basename as basename7, join as join27, resolve as resolve9 } from "path";
|
|
24925
25016
|
import { homedir as homedir8 } from "os";
|
|
24926
25017
|
import chalk30 from "chalk";
|
|
24927
25018
|
function extractFilePath(input) {
|
|
@@ -24943,7 +25034,7 @@ function extractFilePath(input) {
|
|
|
24943
25034
|
if (!candidate) continue;
|
|
24944
25035
|
if (!looksLikePathToken(candidate)) continue;
|
|
24945
25036
|
const p = expandPath(candidate);
|
|
24946
|
-
if (
|
|
25037
|
+
if (existsSync28(p)) {
|
|
24947
25038
|
try {
|
|
24948
25039
|
const st = statSync5(p);
|
|
24949
25040
|
if (st.isFile() || st.isDirectory()) return p;
|
|
@@ -24972,7 +25063,7 @@ function looksLikeFilePath(input) {
|
|
|
24972
25063
|
function listCsvsInFolder(dir) {
|
|
24973
25064
|
try {
|
|
24974
25065
|
if (!statSync5(dir).isDirectory()) return [];
|
|
24975
|
-
return readdirSync6(dir).filter((name) => name.toLowerCase().endsWith(".csv")).map((name) =>
|
|
25066
|
+
return readdirSync6(dir).filter((name) => name.toLowerCase().endsWith(".csv")).map((name) => join27(dir, name)).sort();
|
|
24976
25067
|
} catch {
|
|
24977
25068
|
return [];
|
|
24978
25069
|
}
|
|
@@ -25054,12 +25145,12 @@ async function ingestFromChat(ctx, filePath) {
|
|
|
25054
25145
|
}
|
|
25055
25146
|
const { handler: ingest } = await Promise.resolve().then(() => (init_ingest(), ingest_exports));
|
|
25056
25147
|
const { detectEntityType: detectEntityType2 } = await Promise.resolve().then(() => (init_csv_detect(), csv_detect_exports));
|
|
25057
|
-
const { readFileSync:
|
|
25148
|
+
const { readFileSync: readFileSync24 } = await import("fs");
|
|
25058
25149
|
const { parseCSV: parseCSV2 } = await Promise.resolve().then(() => (init_csv_parse(), csv_parse_exports));
|
|
25059
25150
|
const { getStoredApiKey } = await Promise.resolve().then(() => (init_repl_api(), repl_api_exports));
|
|
25060
25151
|
let headerCheckFailed = false;
|
|
25061
25152
|
try {
|
|
25062
|
-
const raw =
|
|
25153
|
+
const raw = readFileSync24(filePath, "utf-8");
|
|
25063
25154
|
const { headers } = parseCSV2(raw);
|
|
25064
25155
|
const detected = detectEntityType2(headers, "unknown");
|
|
25065
25156
|
if (!detected) headerCheckFailed = true;
|
|
@@ -25972,9 +26063,9 @@ async function handleGetSessionBrief(input) {
|
|
|
25972
26063
|
if (!target) {
|
|
25973
26064
|
return { error: `No session matching "${raw}".` };
|
|
25974
26065
|
}
|
|
25975
|
-
const { existsSync:
|
|
26066
|
+
const { existsSync: existsSync30, readFileSync: readFileSync24 } = await import("fs");
|
|
25976
26067
|
const briefPath = contextDocPathForSession2(target.id);
|
|
25977
|
-
if (!
|
|
26068
|
+
if (!existsSync30(briefPath)) {
|
|
25978
26069
|
return {
|
|
25979
26070
|
session_id: target.id,
|
|
25980
26071
|
error: "No context brief on disk for this session (created before brief storage existed).",
|
|
@@ -25985,7 +26076,7 @@ async function handleGetSessionBrief(input) {
|
|
|
25985
26076
|
return {
|
|
25986
26077
|
session_id: target.id,
|
|
25987
26078
|
security_notice: UNTRUSTED_CONTENT_NOTICE,
|
|
25988
|
-
brief: wrapUntrustedContent(
|
|
26079
|
+
brief: wrapUntrustedContent(readFileSync24(briefPath, "utf-8"))
|
|
25989
26080
|
};
|
|
25990
26081
|
}
|
|
25991
26082
|
function auditDenied(name, input, resultJson, start) {
|
|
@@ -26989,15 +27080,15 @@ var init_ask = __esm({
|
|
|
26989
27080
|
});
|
|
26990
27081
|
|
|
26991
27082
|
// src/services/setup.ts
|
|
26992
|
-
import { existsSync as
|
|
26993
|
-
import { join as
|
|
27083
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync15, readFileSync as readFileSync23, writeFileSync as writeFileSync17 } from "fs";
|
|
27084
|
+
import { join as join28 } from "path";
|
|
26994
27085
|
function setupCheck() {
|
|
26995
27086
|
const home = ntrpHome();
|
|
26996
27087
|
let writable = false;
|
|
26997
27088
|
try {
|
|
26998
|
-
|
|
26999
|
-
const probe =
|
|
27000
|
-
|
|
27089
|
+
mkdirSync15(home, { recursive: true });
|
|
27090
|
+
const probe = join28(home, ".write-check");
|
|
27091
|
+
writeFileSync17(probe, "ok\n");
|
|
27001
27092
|
writable = true;
|
|
27002
27093
|
} catch {
|
|
27003
27094
|
writable = false;
|
|
@@ -27047,42 +27138,6 @@ var init_setup = __esm({
|
|
|
27047
27138
|
}
|
|
27048
27139
|
});
|
|
27049
27140
|
|
|
27050
|
-
// src/version.ts
|
|
27051
|
-
import { existsSync as existsSync28, readFileSync as readFileSync22 } from "fs";
|
|
27052
|
-
import { dirname as dirname5, join as join27 } from "path";
|
|
27053
|
-
import { fileURLToPath } from "url";
|
|
27054
|
-
function readVersionFromPackageJson(packageJsonPath) {
|
|
27055
|
-
if (!existsSync28(packageJsonPath)) return null;
|
|
27056
|
-
try {
|
|
27057
|
-
const pkg = JSON.parse(readFileSync22(packageJsonPath, "utf-8"));
|
|
27058
|
-
if (typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
|
|
27059
|
-
} catch {
|
|
27060
|
-
}
|
|
27061
|
-
return null;
|
|
27062
|
-
}
|
|
27063
|
-
function readVersionNearEntry(entryPath) {
|
|
27064
|
-
const start = dirname5(entryPath);
|
|
27065
|
-
for (const rel of [join27(start, "..", "package.json"), join27(start, "../..", "package.json")]) {
|
|
27066
|
-
const version = readVersionFromPackageJson(rel);
|
|
27067
|
-
if (version) return version;
|
|
27068
|
-
}
|
|
27069
|
-
return null;
|
|
27070
|
-
}
|
|
27071
|
-
function readInstalledVersionFromDisk() {
|
|
27072
|
-
return readVersionNearEntry(fileURLToPath(import.meta.url));
|
|
27073
|
-
}
|
|
27074
|
-
function getInstalledVersion() {
|
|
27075
|
-
if (cachedVersion) return cachedVersion;
|
|
27076
|
-
cachedVersion = readInstalledVersionFromDisk() ?? "0.0.0";
|
|
27077
|
-
return cachedVersion;
|
|
27078
|
-
}
|
|
27079
|
-
var cachedVersion;
|
|
27080
|
-
var init_version = __esm({
|
|
27081
|
-
"src/version.ts"() {
|
|
27082
|
-
"use strict";
|
|
27083
|
-
}
|
|
27084
|
-
});
|
|
27085
|
-
|
|
27086
27141
|
// src/mcp/server.ts
|
|
27087
27142
|
init_context2();
|
|
27088
27143
|
init_diagnosis();
|