@triedotdev/mcp 1.0.164 → 1.0.165
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/README.md +16 -2
- package/dist/{chunk-62JD7MIS.js → chunk-5LRDF2WB.js} +15 -35
- package/dist/chunk-5LRDF2WB.js.map +1 -0
- package/dist/{chunk-D6E4Q4I6.js → chunk-CDG2GVBP.js} +279 -57
- package/dist/chunk-CDG2GVBP.js.map +1 -0
- package/dist/{chunk-5BYSJ7XT.js → chunk-GTKYBOXL.js} +13 -2
- package/dist/{chunk-5BYSJ7XT.js.map → chunk-GTKYBOXL.js.map} +1 -1
- package/dist/{chunk-ACU3IXZG.js → chunk-HC5P6FZD.js} +7 -7
- package/dist/{chunk-HFVPHQL3.js → chunk-IPNPHPNN.js} +9 -9
- package/dist/{chunk-OKK4QNK3.js → chunk-IS5UBN2R.js} +86 -12
- package/dist/chunk-IS5UBN2R.js.map +1 -0
- package/dist/{chunk-LLDZDU2Y.js → chunk-LR5M4RTN.js} +79 -1
- package/dist/chunk-LR5M4RTN.js.map +1 -0
- package/dist/{chunk-ERMLZJTK.js → chunk-M7HMBZ3R.js} +13 -13
- package/dist/chunk-OBQ74FOU.js +27 -0
- package/dist/chunk-OBQ74FOU.js.map +1 -0
- package/dist/{chunk-5TRCQAOE.js → chunk-RQ6QZBIN.js} +16 -5
- package/dist/chunk-RQ6QZBIN.js.map +1 -0
- package/dist/{chunk-IRZXBQVQ.js → chunk-SS2O3MTC.js} +134 -101
- package/dist/chunk-SS2O3MTC.js.map +1 -0
- package/dist/{chunk-LR46VMIE.js → chunk-WRYQHVPD.js} +5 -5
- package/dist/{chunk-Y4B3VEL7.js → chunk-YAL3SUBG.js} +435 -202
- package/dist/chunk-YAL3SUBG.js.map +1 -0
- package/dist/cli/main.js +215 -57
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +15 -14
- package/dist/cli/yolo-daemon.js.map +1 -1
- package/dist/{fast-analyzer-LLZ6FLP5.js → fast-analyzer-54AHLVO5.js} +3 -3
- package/dist/{goal-manager-D6XKE3FY.js → goal-manager-563BNILQ.js} +5 -5
- package/dist/{goal-validator-4DDL7NBP.js → goal-validator-FJEDIYU7.js} +5 -5
- package/dist/{hypothesis-RI3Q33JB.js → hypothesis-4KC7XRBZ.js} +5 -5
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/{issue-store-DUR5UTYK.js → issue-store-FOS4T736.js} +3 -3
- package/dist/{ledger-ZTR63P3L.js → ledger-EDLPF6SB.js} +8 -2
- package/dist/project-state-AHPA77SM.js +28 -0
- package/dist/server/mcp-server.js +16 -15
- package/dist/sync-M2FSWPBC.js +12 -0
- package/dist/{tiered-storage-FHHAJR4P.js → tiered-storage-OP74NPJY.js} +2 -2
- package/dist/tiered-storage-OP74NPJY.js.map +1 -0
- package/dist/{trie-agent-NYSPGZYS.js → trie-agent-TM6ATSNR.js} +12 -12
- package/dist/trie-agent-TM6ATSNR.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-5TRCQAOE.js.map +0 -1
- package/dist/chunk-62JD7MIS.js.map +0 -1
- package/dist/chunk-D6E4Q4I6.js.map +0 -1
- package/dist/chunk-IRZXBQVQ.js.map +0 -1
- package/dist/chunk-LLDZDU2Y.js.map +0 -1
- package/dist/chunk-OKK4QNK3.js.map +0 -1
- package/dist/chunk-Y4B3VEL7.js.map +0 -1
- /package/dist/{chunk-ACU3IXZG.js.map → chunk-HC5P6FZD.js.map} +0 -0
- /package/dist/{chunk-HFVPHQL3.js.map → chunk-IPNPHPNN.js.map} +0 -0
- /package/dist/{chunk-ERMLZJTK.js.map → chunk-M7HMBZ3R.js.map} +0 -0
- /package/dist/{chunk-LR46VMIE.js.map → chunk-WRYQHVPD.js.map} +0 -0
- /package/dist/{fast-analyzer-LLZ6FLP5.js.map → fast-analyzer-54AHLVO5.js.map} +0 -0
- /package/dist/{goal-manager-D6XKE3FY.js.map → goal-manager-563BNILQ.js.map} +0 -0
- /package/dist/{goal-validator-4DDL7NBP.js.map → goal-validator-FJEDIYU7.js.map} +0 -0
- /package/dist/{hypothesis-RI3Q33JB.js.map → hypothesis-4KC7XRBZ.js.map} +0 -0
- /package/dist/{issue-store-DUR5UTYK.js.map → issue-store-FOS4T736.js.map} +0 -0
- /package/dist/{ledger-ZTR63P3L.js.map → ledger-EDLPF6SB.js.map} +0 -0
- /package/dist/{tiered-storage-FHHAJR4P.js.map → project-state-AHPA77SM.js.map} +0 -0
- /package/dist/{trie-agent-NYSPGZYS.js.map → sync-M2FSWPBC.js.map} +0 -0
package/dist/cli/main.js
CHANGED
|
@@ -13,17 +13,19 @@ import {
|
|
|
13
13
|
} from "../chunk-OLNZJ3XV.js";
|
|
14
14
|
import {
|
|
15
15
|
LearningEngine,
|
|
16
|
-
exportToJson,
|
|
17
16
|
formatFriendlyError,
|
|
18
17
|
handleCheckpointCommand,
|
|
19
|
-
importFromJson,
|
|
20
18
|
isTrieInitialized,
|
|
21
19
|
perceiveCurrentChanges,
|
|
22
20
|
reasonAboutChangesHumanReadable
|
|
23
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-5LRDF2WB.js";
|
|
24
22
|
import {
|
|
25
23
|
measureInitialGoalValue
|
|
26
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-HC5P6FZD.js";
|
|
25
|
+
import {
|
|
26
|
+
exportToJson,
|
|
27
|
+
importFromJson
|
|
28
|
+
} from "../chunk-OBQ74FOU.js";
|
|
27
29
|
import {
|
|
28
30
|
loadConfig,
|
|
29
31
|
saveConfig
|
|
@@ -40,17 +42,17 @@ import {
|
|
|
40
42
|
listTrackedProjects,
|
|
41
43
|
searchGlobalPatterns,
|
|
42
44
|
updateGlobalMemoryMd
|
|
43
|
-
} from "../chunk-
|
|
44
|
-
import
|
|
45
|
-
|
|
46
|
-
} from "../chunk-LLDZDU2Y.js";
|
|
45
|
+
} from "../chunk-IPNPHPNN.js";
|
|
46
|
+
import "../chunk-SY6KQG44.js";
|
|
47
|
+
import "../chunk-OMR4YCBS.js";
|
|
47
48
|
import {
|
|
48
49
|
ContextGraph
|
|
49
50
|
} from "../chunk-VUL52BQL.js";
|
|
50
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-6NLHFIYA.js";
|
|
51
52
|
import {
|
|
52
|
-
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
getStorage
|
|
54
|
+
} from "../chunk-LR5M4RTN.js";
|
|
55
|
+
import "../chunk-FQ45QP5A.js";
|
|
54
56
|
import {
|
|
55
57
|
getDailyLogs,
|
|
56
58
|
getMemoryStats,
|
|
@@ -58,11 +60,11 @@ import {
|
|
|
58
60
|
markIssueResolved,
|
|
59
61
|
purgeIssues,
|
|
60
62
|
searchIssues
|
|
61
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-SS2O3MTC.js";
|
|
64
|
+
import {
|
|
65
|
+
getProjectState
|
|
66
|
+
} from "../chunk-GTKYBOXL.js";
|
|
62
67
|
import "../chunk-EFWVF6TI.js";
|
|
63
|
-
import "../chunk-SY6KQG44.js";
|
|
64
|
-
import "../chunk-OMR4YCBS.js";
|
|
65
|
-
import "../chunk-6NLHFIYA.js";
|
|
66
68
|
import {
|
|
67
69
|
getAutonomyConfig,
|
|
68
70
|
recordBypass,
|
|
@@ -75,23 +77,28 @@ import {
|
|
|
75
77
|
correctLedgerEntries,
|
|
76
78
|
detectLegacyLedger,
|
|
77
79
|
formatAuditLog,
|
|
80
|
+
generateKeyPair,
|
|
78
81
|
getAuditStatistics,
|
|
79
82
|
getCorrectionStats,
|
|
80
83
|
getEntryCorrectionHistory,
|
|
81
84
|
getLedgerBlocks,
|
|
82
85
|
getLedgerSyncStatus,
|
|
86
|
+
getPublicKey,
|
|
83
87
|
getRecentAuditLogs,
|
|
84
88
|
getStagedChanges,
|
|
85
89
|
getStorageStats,
|
|
86
90
|
getUncommittedChanges,
|
|
91
|
+
hasSigningKey,
|
|
87
92
|
initializeSharedLedger,
|
|
88
93
|
isGitRepo,
|
|
94
|
+
loadKeyPair,
|
|
89
95
|
migrateLegacyLedger,
|
|
90
96
|
pushLedgerToShared,
|
|
97
|
+
saveKeyPair,
|
|
91
98
|
shouldCompress,
|
|
92
99
|
syncLedgerFromShared,
|
|
93
100
|
verifyLedger
|
|
94
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-YAL3SUBG.js";
|
|
95
102
|
import "../chunk-43X6JBEM.js";
|
|
96
103
|
import {
|
|
97
104
|
getTrieDirectory,
|
|
@@ -103,10 +110,10 @@ import {
|
|
|
103
110
|
} from "../chunk-DGUM43GV.js";
|
|
104
111
|
|
|
105
112
|
// src/cli/main.ts
|
|
106
|
-
import { resolve
|
|
113
|
+
import { resolve, join as join6, dirname } from "path";
|
|
107
114
|
import { readFileSync as readFileSync2, realpathSync } from "fs";
|
|
108
|
-
import { fileURLToPath
|
|
109
|
-
import
|
|
115
|
+
import { fileURLToPath } from "url";
|
|
116
|
+
import pc10 from "picocolors";
|
|
110
117
|
|
|
111
118
|
// src/hooks/install.ts
|
|
112
119
|
import fs from "fs";
|
|
@@ -339,6 +346,23 @@ Run "trie help" to see all available commands.
|
|
|
339
346
|
console.log("\nGit hooks not installed (no .git directory found).");
|
|
340
347
|
}
|
|
341
348
|
ensureGitignore(workDir);
|
|
349
|
+
const skipKeys = args.includes("--no-keys");
|
|
350
|
+
if (!skipKeys && !hasSigningKey(workDir)) {
|
|
351
|
+
console.log("\nSetting up Ed25519 signing for governance ledger...");
|
|
352
|
+
try {
|
|
353
|
+
const keyPair = await generateKeyPair();
|
|
354
|
+
saveKeyPair(keyPair, workDir);
|
|
355
|
+
console.log(` \u2713 Signing key generated`);
|
|
356
|
+
console.log(` Public key: ${keyPair.publicKey.slice(0, 16)}...${keyPair.publicKey.slice(-8)}`);
|
|
357
|
+
console.log(" All ledger entries will be signed automatically.");
|
|
358
|
+
console.log(" Your private key stays local (never committed to git).");
|
|
359
|
+
} catch (keyError) {
|
|
360
|
+
console.log(` \u26A0 Could not generate signing key: ${keyError}`);
|
|
361
|
+
console.log(' Run "trie keys generate" to set up signing later.');
|
|
362
|
+
}
|
|
363
|
+
} else if (hasSigningKey(workDir)) {
|
|
364
|
+
console.log("\n\u2713 Signing key already configured (ledger entries will be signed)");
|
|
365
|
+
}
|
|
342
366
|
if (!process.env.ANTHROPIC_API_KEY) {
|
|
343
367
|
console.log(`
|
|
344
368
|
Note: Running in pattern-only mode. For AI-powered analysis, set your API key:
|
|
@@ -868,8 +892,6 @@ import { writeFile, mkdir, chmod } from "fs/promises";
|
|
|
868
892
|
import { join } from "path";
|
|
869
893
|
import { existsSync } from "fs";
|
|
870
894
|
import pc2 from "picocolors";
|
|
871
|
-
import { dirname } from "path";
|
|
872
|
-
import { fileURLToPath } from "url";
|
|
873
895
|
async function installGitHooks2() {
|
|
874
896
|
const workDir = getWorkingDirectory(void 0, true);
|
|
875
897
|
const isRepo = await isGitRepo(workDir);
|
|
@@ -949,8 +971,6 @@ async function checkGitHooks() {
|
|
|
949
971
|
postMergeInstalled: existsSync(postMergePath)
|
|
950
972
|
};
|
|
951
973
|
}
|
|
952
|
-
var __filename2 = fileURLToPath(import.meta.url);
|
|
953
|
-
var __dirname2 = dirname(__filename2);
|
|
954
974
|
async function handlePreCommitCommand(_args) {
|
|
955
975
|
console.log(pc2.cyan("\u{1F50D} Running pre-commit hook..."));
|
|
956
976
|
console.log(pc2.dim("Checking ledger for issues in staged files...\n"));
|
|
@@ -974,7 +994,7 @@ async function handlePreCommitCommand(_args) {
|
|
|
974
994
|
console.error(pc2.yellow("\u26A0 Could not get staged files, skipping pre-commit check"));
|
|
975
995
|
process.exit(0);
|
|
976
996
|
}
|
|
977
|
-
const { searchIssues: searchIssues2 } = await import("../issue-store-
|
|
997
|
+
const { searchIssues: searchIssues2 } = await import("../issue-store-FOS4T736.js");
|
|
978
998
|
let criticalIssues = 0;
|
|
979
999
|
let totalIssues = 0;
|
|
980
1000
|
const issuesByFile = /* @__PURE__ */ new Map();
|
|
@@ -1351,10 +1371,10 @@ async function promptUser(question) {
|
|
|
1351
1371
|
input: process.stdin,
|
|
1352
1372
|
output: process.stderr
|
|
1353
1373
|
});
|
|
1354
|
-
return new Promise((
|
|
1374
|
+
return new Promise((resolve2) => {
|
|
1355
1375
|
rl.question(question, (answer) => {
|
|
1356
1376
|
rl.close();
|
|
1357
|
-
|
|
1377
|
+
resolve2(answer.toLowerCase().trim());
|
|
1358
1378
|
});
|
|
1359
1379
|
});
|
|
1360
1380
|
}
|
|
@@ -3195,13 +3215,145 @@ ${pc8.yellow("\u{1F4A1} Tip:")} Run ${pc8.bold("trie ledger compress")} to archi
|
|
|
3195
3215
|
return ledger;
|
|
3196
3216
|
}
|
|
3197
3217
|
|
|
3218
|
+
// src/cli/keys.ts
|
|
3219
|
+
import pc9 from "picocolors";
|
|
3220
|
+
import { join as join5 } from "path";
|
|
3221
|
+
async function handleKeysCommand(args) {
|
|
3222
|
+
const subcommand = args[0]?.toLowerCase() || "status";
|
|
3223
|
+
const workDir = getWorkingDirectory(void 0, true);
|
|
3224
|
+
switch (subcommand) {
|
|
3225
|
+
case "generate":
|
|
3226
|
+
case "create":
|
|
3227
|
+
case "init":
|
|
3228
|
+
await handleKeysGenerate(workDir, args.includes("--force") || args.includes("-f"));
|
|
3229
|
+
break;
|
|
3230
|
+
case "status":
|
|
3231
|
+
case "info":
|
|
3232
|
+
await handleKeysStatus(workDir);
|
|
3233
|
+
break;
|
|
3234
|
+
case "public":
|
|
3235
|
+
case "pubkey":
|
|
3236
|
+
await handleKeysPublic(workDir);
|
|
3237
|
+
break;
|
|
3238
|
+
case "help":
|
|
3239
|
+
case "--help":
|
|
3240
|
+
case "-h":
|
|
3241
|
+
showKeysHelp();
|
|
3242
|
+
break;
|
|
3243
|
+
default:
|
|
3244
|
+
console.error(pc9.red(`Unknown subcommand: ${subcommand}`));
|
|
3245
|
+
showKeysHelp();
|
|
3246
|
+
process.exit(1);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
async function handleKeysGenerate(workDir, force) {
|
|
3250
|
+
const hasKey = hasSigningKey(workDir);
|
|
3251
|
+
if (hasKey && !force) {
|
|
3252
|
+
console.log(pc9.yellow("Signing key already exists."));
|
|
3253
|
+
console.log(pc9.dim("Use --force to regenerate (WARNING: will invalidate existing signatures)"));
|
|
3254
|
+
const pubKey = getPublicKey(workDir);
|
|
3255
|
+
if (pubKey) {
|
|
3256
|
+
console.log(`
|
|
3257
|
+
Public key: ${pc9.cyan(pubKey.slice(0, 16))}...${pc9.cyan(pubKey.slice(-8))}`);
|
|
3258
|
+
}
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
if (hasKey && force) {
|
|
3262
|
+
console.log(pc9.yellow("Regenerating signing key..."));
|
|
3263
|
+
console.log(pc9.red("WARNING: This will invalidate all existing signatures in the ledger."));
|
|
3264
|
+
}
|
|
3265
|
+
console.log("Generating Ed25519 signing key pair...\n");
|
|
3266
|
+
const keyPair = await generateKeyPair();
|
|
3267
|
+
saveKeyPair(keyPair, workDir);
|
|
3268
|
+
const keysDir = join5(getTrieDirectory(workDir), "keys");
|
|
3269
|
+
console.log(pc9.green("\u2713 Signing key generated successfully\n"));
|
|
3270
|
+
console.log(`Location: ${pc9.dim(keysDir)}`);
|
|
3271
|
+
console.log(`Public key: ${pc9.cyan(keyPair.publicKey.slice(0, 16))}...${pc9.cyan(keyPair.publicKey.slice(-8))}`);
|
|
3272
|
+
console.log(`Algorithm: ${pc9.dim("Ed25519")}
|
|
3273
|
+
`);
|
|
3274
|
+
console.log(pc9.bold("What this means:"));
|
|
3275
|
+
console.log(" \u2022 All new ledger entries will be signed automatically");
|
|
3276
|
+
console.log(" \u2022 Signatures prove who created each entry");
|
|
3277
|
+
console.log(" \u2022 Tampering with entries will be detectable");
|
|
3278
|
+
console.log(" \u2022 Your private key stays local (never committed to git)\n");
|
|
3279
|
+
console.log(pc9.yellow("Security notes:"));
|
|
3280
|
+
console.log(" \u2022 The private key is stored in .trie/keys/signing-key.json");
|
|
3281
|
+
console.log(" \u2022 This directory is automatically added to .gitignore");
|
|
3282
|
+
console.log(" \u2022 Back up this key if you need to prove authorship later");
|
|
3283
|
+
console.log(" \u2022 Team members each generate their own keys");
|
|
3284
|
+
}
|
|
3285
|
+
async function handleKeysStatus(workDir) {
|
|
3286
|
+
const hasKey = hasSigningKey(workDir);
|
|
3287
|
+
const keysDir = join5(getTrieDirectory(workDir), "keys");
|
|
3288
|
+
console.log(pc9.bold("Signing Key Status\n"));
|
|
3289
|
+
if (hasKey) {
|
|
3290
|
+
const keyPair = loadKeyPair(workDir);
|
|
3291
|
+
const keyPath = join5(keysDir, "signing-key.json");
|
|
3292
|
+
console.log(`Status: ${pc9.green("\u2713 Active")}`);
|
|
3293
|
+
console.log(`Location: ${pc9.dim(keyPath)}`);
|
|
3294
|
+
if (keyPair) {
|
|
3295
|
+
console.log(`Public key: ${pc9.cyan(keyPair.publicKey.slice(0, 16))}...${pc9.cyan(keyPair.publicKey.slice(-8))}`);
|
|
3296
|
+
}
|
|
3297
|
+
console.log(`Algorithm: ${pc9.dim("Ed25519")}`);
|
|
3298
|
+
console.log(`
|
|
3299
|
+
New ledger entries will be ${pc9.green("signed automatically")}.`);
|
|
3300
|
+
} else {
|
|
3301
|
+
console.log(`Status: ${pc9.yellow("\u25CB Not configured")}`);
|
|
3302
|
+
console.log(`
|
|
3303
|
+
Ledger entries are ${pc9.yellow("not being signed")}.`);
|
|
3304
|
+
console.log(`
|
|
3305
|
+
To enable signing, run:`);
|
|
3306
|
+
console.log(` ${pc9.cyan("trie keys generate")}`);
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
async function handleKeysPublic(workDir) {
|
|
3310
|
+
const pubKey = getPublicKey(workDir);
|
|
3311
|
+
if (!pubKey) {
|
|
3312
|
+
console.error(pc9.yellow("No signing key found."));
|
|
3313
|
+
console.error(`Run ${pc9.cyan("trie keys generate")} to create one.`);
|
|
3314
|
+
process.exit(1);
|
|
3315
|
+
}
|
|
3316
|
+
console.log(pubKey);
|
|
3317
|
+
}
|
|
3318
|
+
function showKeysHelp() {
|
|
3319
|
+
console.log(`
|
|
3320
|
+
${pc9.bold("trie keys")} - Manage Ed25519 signing keys for the governance ledger
|
|
3321
|
+
|
|
3322
|
+
${pc9.bold("USAGE:")}
|
|
3323
|
+
trie keys <command> [options]
|
|
3324
|
+
|
|
3325
|
+
${pc9.bold("COMMANDS:")}
|
|
3326
|
+
generate Generate a new Ed25519 signing key pair
|
|
3327
|
+
status Show current key status (default)
|
|
3328
|
+
public Print the public key (for sharing/verification)
|
|
3329
|
+
help Show this help message
|
|
3330
|
+
|
|
3331
|
+
${pc9.bold("OPTIONS:")}
|
|
3332
|
+
--force, -f Force regenerate key (WARNING: invalidates signatures)
|
|
3333
|
+
|
|
3334
|
+
${pc9.bold("EXAMPLES:")}
|
|
3335
|
+
trie keys # Check if signing is configured
|
|
3336
|
+
trie keys generate # Generate a new signing key
|
|
3337
|
+
trie keys public # Get your public key for verification
|
|
3338
|
+
|
|
3339
|
+
${pc9.bold("ABOUT SIGNING:")}
|
|
3340
|
+
Ed25519 signatures provide:
|
|
3341
|
+
\u2022 ${pc9.green("Authenticity")} - Prove who created each ledger entry
|
|
3342
|
+
\u2022 ${pc9.green("Tamper-evidence")} - Detect if entries are modified
|
|
3343
|
+
\u2022 ${pc9.green("Accountability")} - Track decisions to humans or agents
|
|
3344
|
+
|
|
3345
|
+
Keys are stored locally in .trie/keys/ and never committed to git.
|
|
3346
|
+
Each team member should generate their own key.
|
|
3347
|
+
`);
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3198
3350
|
// src/cli/main.ts
|
|
3199
|
-
var
|
|
3200
|
-
var
|
|
3351
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
3352
|
+
var __dirname2 = dirname(__filename2);
|
|
3201
3353
|
var DEFAULT_VERSION = "0.0.0";
|
|
3202
3354
|
function getCliVersion() {
|
|
3203
3355
|
try {
|
|
3204
|
-
const pkgPath =
|
|
3356
|
+
const pkgPath = resolve(__dirname2, "..", "..", "package.json");
|
|
3205
3357
|
const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
|
|
3206
3358
|
return typeof pkg.version === "string" && pkg.version.trim() ? pkg.version.trim() : DEFAULT_VERSION;
|
|
3207
3359
|
} catch {
|
|
@@ -3255,6 +3407,7 @@ COMMANDS:
|
|
|
3255
3407
|
status Quick health check (project health + memory stats)
|
|
3256
3408
|
project View/manage project info (.trie/PROJECT.md)
|
|
3257
3409
|
setup Configure API key and environment
|
|
3410
|
+
keys Manage Ed25519 signing keys (for ledger signatures)
|
|
3258
3411
|
|
|
3259
3412
|
ci Generate GitHub Actions workflow with memory caching
|
|
3260
3413
|
|
|
@@ -3306,47 +3459,47 @@ async function handleStatusCommand() {
|
|
|
3306
3459
|
const lastScanDate = new Date(state.lastScan.timestamp);
|
|
3307
3460
|
const daysAgo = Math.floor((Date.now() - lastScanDate.getTime()) / (1e3 * 60 * 60 * 24));
|
|
3308
3461
|
console.log(`
|
|
3309
|
-
${
|
|
3310
|
-
console.log(
|
|
3311
|
-
console.log(
|
|
3462
|
+
${pc10.bold("Last Scan:")} ${lastScanDate.toLocaleDateString()} (${daysAgo === 0 ? "today" : daysAgo === 1 ? "yesterday" : `${daysAgo} days ago`})`);
|
|
3463
|
+
console.log(pc10.dim(` Files scanned: ${state.lastScan.filesScanned}`));
|
|
3464
|
+
console.log(pc10.dim(` Issues found: ${state.lastScan.issues.total} (${state.lastScan.issues.critical} critical, ${state.lastScan.issues.serious} serious)`));
|
|
3312
3465
|
} else {
|
|
3313
3466
|
console.log(`
|
|
3314
|
-
${
|
|
3467
|
+
${pc10.bold("Last Scan:")} Never ${pc10.dim("(run `trie watch` to get started)")}`);
|
|
3315
3468
|
}
|
|
3316
3469
|
console.log(`
|
|
3317
|
-
${
|
|
3318
|
-
console.log(
|
|
3319
|
-
console.log(
|
|
3320
|
-
console.log(
|
|
3470
|
+
${pc10.bold("Memory Stats:")}`);
|
|
3471
|
+
console.log(pc10.dim(` Active Issues: ${memoryStats.activeIssues}`));
|
|
3472
|
+
console.log(pc10.dim(` Resolved: ${memoryStats.resolvedCount}`));
|
|
3473
|
+
console.log(pc10.dim(` Total (all-time): ${memoryStats.totalIssues}`));
|
|
3321
3474
|
const cap = memoryStats.capacityInfo;
|
|
3322
|
-
const capIndicator = cap.isAtCap ?
|
|
3323
|
-
console.log(` ${capIndicator} Memory Usage: ${
|
|
3475
|
+
const capIndicator = cap.isAtCap ? pc10.red("\u25CB") : cap.percentFull >= 80 ? pc10.yellow("\u25C9") : pc10.green("\u25CF");
|
|
3476
|
+
console.log(` ${capIndicator} Memory Usage: ${pc10.bold(cap.percentFull + "%")} ${pc10.dim(`(${cap.current}/${cap.max})`)}`);
|
|
3324
3477
|
if (memoryStats.activeIssues > 0) {
|
|
3325
3478
|
console.log(`
|
|
3326
|
-
${
|
|
3479
|
+
${pc10.bold("Active Issues by Severity:")}`);
|
|
3327
3480
|
const severityOrder = ["critical", "serious", "moderate", "low", "info"];
|
|
3328
3481
|
for (const severity of severityOrder) {
|
|
3329
3482
|
const count = memoryStats.activeIssuesBySeverity[severity] || 0;
|
|
3330
3483
|
if (count > 0) {
|
|
3331
|
-
console.log(
|
|
3484
|
+
console.log(pc10.dim(` ${severity}: ${count}`));
|
|
3332
3485
|
}
|
|
3333
3486
|
}
|
|
3334
3487
|
} else if (memoryStats.totalIssues > 0) {
|
|
3335
3488
|
console.log(`
|
|
3336
|
-
${
|
|
3489
|
+
${pc10.green("\u25CF")} All issues have been resolved`);
|
|
3337
3490
|
}
|
|
3338
3491
|
if (cap.isAtCap) {
|
|
3339
3492
|
console.log(`
|
|
3340
|
-
${
|
|
3493
|
+
${pc10.yellow("\u2B22 Warning:")} Memory at capacity - consider running: ${pc10.bold("trie memory purge smart")}`);
|
|
3341
3494
|
} else if (cap.percentFull >= 80) {
|
|
3342
3495
|
console.log(`
|
|
3343
|
-
${
|
|
3496
|
+
${pc10.yellow("\u2B22 Notice:")} Memory usage high - consider running: ${pc10.bold("trie memory purge smart")}`);
|
|
3344
3497
|
}
|
|
3345
3498
|
console.log(`
|
|
3346
|
-
${
|
|
3347
|
-
console.log(
|
|
3348
|
-
console.log(
|
|
3349
|
-
console.log(
|
|
3499
|
+
${pc10.bold("Quick Commands:")}`);
|
|
3500
|
+
console.log(pc10.dim(" trie watch - Start watching for nudges"));
|
|
3501
|
+
console.log(pc10.dim(" trie memory stats - Detailed memory statistics"));
|
|
3502
|
+
console.log(pc10.dim(" trie project - View project information"));
|
|
3350
3503
|
console.log("");
|
|
3351
3504
|
} catch (error) {
|
|
3352
3505
|
console.error("Error loading status:", error);
|
|
@@ -3364,7 +3517,7 @@ async function handleProject(args) {
|
|
|
3364
3517
|
\u2551 PROJECT.md Created \u2551
|
|
3365
3518
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
3366
3519
|
|
|
3367
|
-
${
|
|
3520
|
+
${pc10.bold("Path:")} ${result.path}
|
|
3368
3521
|
|
|
3369
3522
|
A template has been created with sections for:
|
|
3370
3523
|
\u2022 Project Overview
|
|
@@ -3389,7 +3542,7 @@ Next steps:
|
|
|
3389
3542
|
}
|
|
3390
3543
|
if (subcommand === "edit") {
|
|
3391
3544
|
const editor = process.env.EDITOR || process.env.VISUAL || "nano";
|
|
3392
|
-
const projectPath =
|
|
3545
|
+
const projectPath = join6(getTrieDirectory(workDir), "PROJECT.md");
|
|
3393
3546
|
if (!projectInfoExists(workDir)) {
|
|
3394
3547
|
console.log("No PROJECT.md found. Creating one first...");
|
|
3395
3548
|
await initProjectInfo(workDir);
|
|
@@ -3407,7 +3560,7 @@ Next steps:
|
|
|
3407
3560
|
\u2551 Project Information \u2551
|
|
3408
3561
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
3409
3562
|
|
|
3410
|
-
${
|
|
3563
|
+
${pc10.bold("No PROJECT.md found in this project.")}
|
|
3411
3564
|
|
|
3412
3565
|
COMMANDS:
|
|
3413
3566
|
trie project init Create PROJECT.md from template
|
|
@@ -3435,7 +3588,7 @@ This info is available via trie://project MCP resource.
|
|
|
3435
3588
|
\u2551 Project Information \u2551
|
|
3436
3589
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
3437
3590
|
|
|
3438
|
-
${
|
|
3591
|
+
${pc10.bold("Path:")} ${join6(getTrieDirectory(workDir), "PROJECT.md")}
|
|
3439
3592
|
|
|
3440
3593
|
${"-".repeat(68)}
|
|
3441
3594
|
`);
|
|
@@ -3444,10 +3597,10 @@ ${"-".repeat(68)}
|
|
|
3444
3597
|
async function runWatch(args) {
|
|
3445
3598
|
const { spawn } = await import("child_process");
|
|
3446
3599
|
let daemonPath;
|
|
3447
|
-
if (
|
|
3448
|
-
daemonPath =
|
|
3600
|
+
if (__filename2.endsWith(".ts")) {
|
|
3601
|
+
daemonPath = resolve(__dirname2, "yolo-daemon.ts");
|
|
3449
3602
|
} else {
|
|
3450
|
-
daemonPath =
|
|
3603
|
+
daemonPath = resolve(__dirname2, "yolo-daemon.js");
|
|
3451
3604
|
}
|
|
3452
3605
|
const executor = daemonPath.endsWith(".ts") ? "npx" : "node";
|
|
3453
3606
|
const execArgs = daemonPath.endsWith(".ts") ? ["tsx", daemonPath, ...args] : [daemonPath, ...args];
|
|
@@ -3590,10 +3743,15 @@ async function main() {
|
|
|
3590
3743
|
ledgerCommand.parse(["node", "trie", "ledger", ...restArgs], { from: "user" });
|
|
3591
3744
|
}
|
|
3592
3745
|
break;
|
|
3746
|
+
case "keys":
|
|
3747
|
+
case "key":
|
|
3748
|
+
case "signing":
|
|
3749
|
+
await handleKeysCommand(restArgs);
|
|
3750
|
+
break;
|
|
3593
3751
|
default:
|
|
3594
3752
|
if (command.startsWith("-")) {
|
|
3595
3753
|
const { spawn } = __require("child_process");
|
|
3596
|
-
const daemonPath =
|
|
3754
|
+
const daemonPath = resolve(__dirname2, "yolo-daemon.js");
|
|
3597
3755
|
const child = spawn("node", [daemonPath, ...args], {
|
|
3598
3756
|
stdio: "inherit",
|
|
3599
3757
|
env: process.env
|
|
@@ -3613,7 +3771,7 @@ var isEntryPoint = (() => {
|
|
|
3613
3771
|
if (!entry) return false;
|
|
3614
3772
|
try {
|
|
3615
3773
|
const realEntry = realpathSync(entry);
|
|
3616
|
-
const realThis =
|
|
3774
|
+
const realThis = fileURLToPath(import.meta.url);
|
|
3617
3775
|
return realEntry === realThis;
|
|
3618
3776
|
} catch {
|
|
3619
3777
|
return !process.env.VITEST && !process.env.VITEST_WORKER_ID;
|