stackmem 1.0.19 → 1.0.21
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/cli.js +8 -0
- package/package.json +1 -1
- package/src/cli.ts +11 -0
package/dist/cli.js
CHANGED
|
@@ -355,6 +355,9 @@ async function cmdSave(project, type, content, force = false) {
|
|
|
355
355
|
if (!MEMORY_TYPES.includes(type)) {
|
|
356
356
|
fail(`Invalid memory type '${type}'. Valid types: decision, constraint, discovery, rejection.`);
|
|
357
357
|
}
|
|
358
|
+
if (content.length > 500) {
|
|
359
|
+
fail(`Memory content too long (${content.length} chars). Keep memories under 500 characters — they should be concise facts, not paragraphs.`);
|
|
360
|
+
}
|
|
358
361
|
const { data: existingRows, error: existingError } = await supabase
|
|
359
362
|
.from("memories")
|
|
360
363
|
.select("id, content")
|
|
@@ -459,6 +462,9 @@ async function cmdCompress(project) {
|
|
|
459
462
|
}
|
|
460
463
|
// --- cm fix --------------------------------------------------------------
|
|
461
464
|
async function cmdFix(project, problem, solution) {
|
|
465
|
+
if (problem.trim().length === 0 || solution.trim().length === 0) {
|
|
466
|
+
fail("Problem and solution cannot be empty.");
|
|
467
|
+
}
|
|
462
468
|
const { error } = await supabase
|
|
463
469
|
.from("execution_log")
|
|
464
470
|
.insert({ project, problem, solution, resolved: false, device_id: getDeviceId() });
|
|
@@ -947,6 +953,8 @@ dist/
|
|
|
947
953
|
.DS_Store
|
|
948
954
|
*.log
|
|
949
955
|
coverage/
|
|
956
|
+
*-memories.json
|
|
957
|
+
*.db
|
|
950
958
|
`;
|
|
951
959
|
// Returns true if the file was created, false if it already existed
|
|
952
960
|
// (and was left untouched).
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -414,6 +414,11 @@ async function cmdSave(project: string, type: string, content: string, force = f
|
|
|
414
414
|
fail(`Invalid memory type '${type}'. Valid types: decision, constraint, discovery, rejection.`);
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
+
if (content.length > 500) {
|
|
418
|
+
fail(
|
|
419
|
+
`Memory content too long (${content.length} chars). Keep memories under 500 characters — they should be concise facts, not paragraphs.`
|
|
420
|
+
);
|
|
421
|
+
}
|
|
417
422
|
|
|
418
423
|
const { data: existingRows, error: existingError } = await supabase
|
|
419
424
|
.from("memories")
|
|
@@ -544,6 +549,10 @@ async function cmdCompress(project: string) {
|
|
|
544
549
|
// --- cm fix --------------------------------------------------------------
|
|
545
550
|
|
|
546
551
|
async function cmdFix(project: string, problem: string, solution: string) {
|
|
552
|
+
if (problem.trim().length === 0 || solution.trim().length === 0) {
|
|
553
|
+
fail("Problem and solution cannot be empty.");
|
|
554
|
+
}
|
|
555
|
+
|
|
547
556
|
const { error } = await supabase
|
|
548
557
|
.from("execution_log")
|
|
549
558
|
.insert({ project, problem, solution, resolved: false, device_id: getDeviceId() });
|
|
@@ -1078,6 +1087,8 @@ dist/
|
|
|
1078
1087
|
.DS_Store
|
|
1079
1088
|
*.log
|
|
1080
1089
|
coverage/
|
|
1090
|
+
*-memories.json
|
|
1091
|
+
*.db
|
|
1081
1092
|
`;
|
|
1082
1093
|
|
|
1083
1094
|
// Returns true if the file was created, false if it already existed
|