notesoup 0.60.0 → 0.61.0
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 +5 -4
- package/dist/src/boot/render.d.ts +5 -0
- package/dist/src/boot/render.js +48 -19
- package/dist/src/boot/text.d.ts +1 -3
- package/dist/src/boot/text.js +10 -11
- package/dist/src/budget/text.d.ts +1 -1
- package/dist/src/budget/text.js +1 -1
- package/dist/src/dream/git.js +12 -13
- package/dist/src/notes/errors.d.ts +1 -1
- package/dist/src/notes/frontmatter.d.ts +6 -0
- package/dist/src/notes/frontmatter.js +17 -1
- package/dist/src/notes/policy.js +1 -1
- package/dist/src/notes/project-namespace.js +39 -73
- package/dist/src/notes/store.d.ts +2 -0
- package/dist/src/notes/store.js +30 -5
- package/dist/src/sqlite-lock.d.ts +2 -0
- package/dist/src/sqlite-lock.js +17 -0
- package/dist/src/tools/dream.d.ts +4 -4
- package/dist/src/tools/dream.js +15 -16
- package/dist/src/tools/notes.d.ts +10 -0
- package/dist/src/tools/notes.js +14 -8
- package/dist/test/dream-tools.test.js +42 -14
- package/dist/test/host-neutral.test.js +1 -1
- package/dist/test/note-policy.test.js +122 -8
- package/dist/test/notes.integration.test.js +3 -7
- package/dist/test/project-namespace.test.js +33 -88
- package/docs/dsh.md +2 -2
- package/docs/notes-library.md +10 -4
- package/docs/reset-lifecycle.md +1 -1
- package/docs/skills.md +2 -6
- package/docs/tool-results.md +1 -1
- package/package.json +1 -1
- package/playbook.md +3 -3
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +150 -103
- package/plugins/claude/playbook.md +3 -3
- package/plugins/claude/skills/dream/SKILL.md +2 -2
- package/plugins/claude/skills/memory/SKILL.md +1 -1
- package/plugins/codex/dist/codex/notesoup.js +149 -102
- package/skills/dream/SKILL.md +2 -2
- package/skills/memory/SKILL.md +1 -1
- package/src/boot/render.ts +48 -17
- package/src/boot/text.ts +10 -11
- package/src/budget/text.ts +1 -1
- package/src/dream/git.ts +11 -11
- package/src/notes/errors.ts +1 -1
- package/src/notes/frontmatter.ts +19 -1
- package/src/notes/policy.ts +1 -1
- package/src/notes/project-namespace.ts +37 -59
- package/src/notes/store.ts +25 -7
- package/src/sqlite-lock.ts +14 -0
- package/src/tools/dream.ts +15 -14
- package/src/tools/notes.ts +14 -8
- package/dist/src/dream/lock.d.ts +0 -14
- package/dist/src/dream/lock.js +0 -29
- package/src/dream/lock.ts +0 -28
|
@@ -7893,7 +7893,7 @@ function eventDocument(event) {
|
|
|
7893
7893
|
function toolEvent(item, result) {
|
|
7894
7894
|
const run = result ?? item;
|
|
7895
7895
|
const status = item.role === "tool_call" && result === void 0 ? "unfinished" : run.recordedStatus ?? (run.toolError === true ? "error" : "ok");
|
|
7896
|
-
const
|
|
7896
|
+
const truncated2 = run.outputTruncated === true;
|
|
7897
7897
|
return {
|
|
7898
7898
|
seq: item.seq,
|
|
7899
7899
|
windowId: item.windowId,
|
|
@@ -7905,7 +7905,7 @@ function toolEvent(item, result) {
|
|
|
7905
7905
|
status,
|
|
7906
7906
|
// A call records its arguments; a bare result records none, and gets none invented.
|
|
7907
7907
|
...item.arguments === void 0 ? {} : { arguments: item.arguments },
|
|
7908
|
-
...
|
|
7908
|
+
...truncated2 ? { outputTruncated: true, ...run.fullOutputPath ? { fullOutputPath: run.fullOutputPath } : {} } : {},
|
|
7909
7909
|
...run.nestedCalls ? { nestedCalls: run.nestedCalls } : {}
|
|
7910
7910
|
}
|
|
7911
7911
|
};
|
|
@@ -7988,14 +7988,14 @@ function visibleItem(event, maxChars, matchOffset) {
|
|
|
7988
7988
|
const chars = Array.from(document);
|
|
7989
7989
|
const start = matchOffset ?? 0;
|
|
7990
7990
|
const limit = Math.max(0, maxChars);
|
|
7991
|
-
const
|
|
7991
|
+
const truncated2 = start > 0 || start + limit < chars.length;
|
|
7992
7992
|
return {
|
|
7993
7993
|
seq: event.seq,
|
|
7994
7994
|
role: event.role,
|
|
7995
7995
|
created_at: event.createdAt ?? null,
|
|
7996
7996
|
...toolSummary(event),
|
|
7997
|
-
content:
|
|
7998
|
-
truncated,
|
|
7997
|
+
content: truncated2 ? chars.slice(start, start + limit).join("") : document,
|
|
7998
|
+
truncated: truncated2,
|
|
7999
7999
|
...matchOffset === void 0 ? {} : { offset_chars: matchOffset }
|
|
8000
8000
|
};
|
|
8001
8001
|
}
|
|
@@ -8165,7 +8165,7 @@ function addressFor(identity2, scope, path, who) {
|
|
|
8165
8165
|
// src/notes/policy.ts
|
|
8166
8166
|
var DEFAULT_NOTE_BUDGET = 4096;
|
|
8167
8167
|
var MAX_PINNED_NOTES = 5;
|
|
8168
|
-
var DEFAULT_PINNED_PAGES = ["CHEATSHEET.md"
|
|
8168
|
+
var DEFAULT_PINNED_PAGES = ["CHEATSHEET.md"];
|
|
8169
8169
|
function validateNotePolicy(fields) {
|
|
8170
8170
|
for (const key of ["pinned", "readonly"]) {
|
|
8171
8171
|
if (fields[key] !== void 0 && typeof fields[key] !== "boolean") throw new NoteError("invalid_policy", `${key} must be a boolean.`);
|
|
@@ -8205,7 +8205,12 @@ function applyNotePolicy(target, fields) {
|
|
|
8205
8205
|
var SCOPES = ["session", "project", "human", "agent", "model"];
|
|
8206
8206
|
var ORIGINS = ["user", "self", "external"];
|
|
8207
8207
|
var TIMESTAMP_KEYS = ["createdAt", "updatedAt", "lastAccessed"];
|
|
8208
|
-
var KNOWN_KEYS = ["pinned", "budget", "readonly", "origin", "crumpledAt", "createdAt", "updatedAt", "lastAccessed", "accessCount", "sourceWindow", "supersedes", "recurrenceCount", "recurrenceWindows"];
|
|
8208
|
+
var KNOWN_KEYS = ["pinned", "budget", "readonly", "description", "origin", "crumpledAt", "createdAt", "updatedAt", "lastAccessed", "accessCount", "sourceWindow", "supersedes", "recurrenceCount", "recurrenceWindows"];
|
|
8209
|
+
var MAX_DESCRIPTION_CHARS = 160;
|
|
8210
|
+
function collapseDescription(value) {
|
|
8211
|
+
const collapsed = value.replace(/\s+/g, " ").trim();
|
|
8212
|
+
return collapsed.length === 0 ? void 0 : collapsed;
|
|
8213
|
+
}
|
|
8209
8214
|
var pad2 = (value) => String(value).padStart(2, "0");
|
|
8210
8215
|
function localIso(epochMs) {
|
|
8211
8216
|
const date = new Date(epochMs);
|
|
@@ -8281,6 +8286,11 @@ function parseNote(raw, now = Date.now()) {
|
|
|
8281
8286
|
meta.origin = isOrigin(meta.origin) ? meta.origin : "self";
|
|
8282
8287
|
for (const key of TIMESTAMP_KEYS) meta[key] = toEpoch(meta[key], now);
|
|
8283
8288
|
meta.accessCount = typeof meta.accessCount === "number" && Number.isFinite(meta.accessCount) ? meta.accessCount : 0;
|
|
8289
|
+
if (meta.description !== void 0) {
|
|
8290
|
+
const description = typeof meta.description === "string" ? collapseDescription(meta.description) : void 0;
|
|
8291
|
+
if (description === void 0) delete meta.description;
|
|
8292
|
+
else meta.description = description;
|
|
8293
|
+
}
|
|
8284
8294
|
return { meta, body };
|
|
8285
8295
|
}
|
|
8286
8296
|
function yamlScalar(value) {
|
|
@@ -8395,8 +8405,25 @@ var MAX_NOTE_PATH_BYTES = 512;
|
|
|
8395
8405
|
|
|
8396
8406
|
// src/notes/project-namespace.ts
|
|
8397
8407
|
import { randomUUID } from "node:crypto";
|
|
8398
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync,
|
|
8408
|
+
import { existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
8399
8409
|
import { basename, dirname, join as join2, resolve as resolve2, sep } from "node:path";
|
|
8410
|
+
|
|
8411
|
+
// src/sqlite-lock.ts
|
|
8412
|
+
function trySqliteLock(path, waitMs) {
|
|
8413
|
+
const sqlite = process.getBuiltinModule?.("node:sqlite");
|
|
8414
|
+
if (!sqlite?.DatabaseSync) throw new Error("Notesoup locks require built-in node:sqlite (Node 22.13+).");
|
|
8415
|
+
const db = new sqlite.DatabaseSync(path);
|
|
8416
|
+
try {
|
|
8417
|
+
db.exec(`PRAGMA busy_timeout = ${waitMs}; BEGIN IMMEDIATE`);
|
|
8418
|
+
} catch (error) {
|
|
8419
|
+
db.close();
|
|
8420
|
+
if (error instanceof Error && "errcode" in error && error.errcode === 5) return void 0;
|
|
8421
|
+
throw error;
|
|
8422
|
+
}
|
|
8423
|
+
return () => db.close();
|
|
8424
|
+
}
|
|
8425
|
+
|
|
8426
|
+
// src/notes/project-namespace.ts
|
|
8400
8427
|
function errno(error) {
|
|
8401
8428
|
return typeof error === "object" && error !== null ? error.code : void 0;
|
|
8402
8429
|
}
|
|
@@ -8509,67 +8536,42 @@ function updateMarker(namespace, marker) {
|
|
|
8509
8536
|
}
|
|
8510
8537
|
return { ...namespace, ...marker };
|
|
8511
8538
|
}
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
for (; ; ) {
|
|
8516
|
-
const result = attempt();
|
|
8517
|
-
if (result !== void 0) return result;
|
|
8518
|
-
const remaining = deadline - performance.now();
|
|
8519
|
-
if (remaining <= 0) throw new Error(`Timed out waiting for project claim at ${path}`);
|
|
8520
|
-
Atomics.wait(claimSleep, 0, 0, Math.min(10, remaining));
|
|
8521
|
-
}
|
|
8539
|
+
function checkoutMarker(cwd) {
|
|
8540
|
+
const path = canonicalRoot(cwd);
|
|
8541
|
+
return { id: originRemote(path) ?? path, path };
|
|
8522
8542
|
}
|
|
8523
8543
|
function resolveProjectNamespace(cwd, home) {
|
|
8524
|
-
|
|
8525
|
-
const
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
throw error;
|
|
8533
|
-
}
|
|
8534
|
-
});
|
|
8544
|
+
const expected = checkoutMarker(cwd);
|
|
8545
|
+
const current = projectNamespaces(home).find((candidate) => candidate.id === expected.id);
|
|
8546
|
+
if (current?.path === expected.path) return current;
|
|
8547
|
+
const root = projectRoot(home);
|
|
8548
|
+
mkdirSync(root, { recursive: true });
|
|
8549
|
+
const lockPath = join2(home, ".project-claim.sqlite");
|
|
8550
|
+
const release = trySqliteLock(lockPath, 5e3);
|
|
8551
|
+
if (!release) throw new Error(`Timed out waiting for project claim at ${lockPath}`);
|
|
8535
8552
|
try {
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
return found;
|
|
8556
|
-
}
|
|
8557
|
-
const base = slugify(basename(root));
|
|
8558
|
-
const taken = new Set(readdirSync(markerRoot));
|
|
8559
|
-
for (let suffix = 0; ; suffix++) {
|
|
8560
|
-
const name = suffix === 0 ? base : `${base}-${suffix}`;
|
|
8561
|
-
if (taken.has(name)) continue;
|
|
8562
|
-
const dir = join2(markerRoot, name);
|
|
8563
|
-
try {
|
|
8564
|
-
mkdirSync(dir);
|
|
8565
|
-
} catch (error) {
|
|
8566
|
-
if (errno(error) !== "EEXIST") throw error;
|
|
8567
|
-
let winner = awaitClaim(join2(dir, ".project"), () => readMarker(dir));
|
|
8568
|
-
if (winner.id !== id2 && !(remote && winner.id === root)) continue;
|
|
8569
|
-
if (winner.id !== id2 || winner.path !== root) winner = updateMarker(winner, { id: id2, path: root });
|
|
8570
|
-
return winner;
|
|
8553
|
+
const marker = checkoutMarker(cwd);
|
|
8554
|
+
const { id: id2, path } = marker;
|
|
8555
|
+
const namespaces = projectNamespaces(home);
|
|
8556
|
+
const found = namespaces.find((candidate) => candidate.id === id2) ?? namespaces.find((candidate) => candidate.id === path);
|
|
8557
|
+
if (found) return found.id === id2 && found.path === path ? found : updateMarker(found, marker);
|
|
8558
|
+
const base = slugify(basename(path));
|
|
8559
|
+
for (let suffix = 0; ; suffix++) {
|
|
8560
|
+
const name = suffix === 0 ? base : `${base}-${suffix}`;
|
|
8561
|
+
const dir = join2(root, name);
|
|
8562
|
+
if (lstatSync(dir, { throwIfNoEntry: false })) continue;
|
|
8563
|
+
const staged = mkdtempSync(join2(home, ".project-pending-"));
|
|
8564
|
+
try {
|
|
8565
|
+
writeFileSync(join2(staged, ".project"), JSON.stringify(marker));
|
|
8566
|
+
renameSync(staged, dir);
|
|
8567
|
+
} catch (error) {
|
|
8568
|
+
rmSync(staged, { recursive: true, force: true });
|
|
8569
|
+
throw error;
|
|
8570
|
+
}
|
|
8571
|
+
return { name, dir, ...marker };
|
|
8571
8572
|
}
|
|
8572
|
-
|
|
8573
|
+
} finally {
|
|
8574
|
+
release();
|
|
8573
8575
|
}
|
|
8574
8576
|
}
|
|
8575
8577
|
function gitRoot(cwd) {
|
|
@@ -8728,6 +8730,13 @@ function assertOrigin(value) {
|
|
|
8728
8730
|
if (!isOrigin(value)) throw new NoteError("invalid_origin", `origin must be one of user, self, external (got ${JSON.stringify(value)})`);
|
|
8729
8731
|
return value;
|
|
8730
8732
|
}
|
|
8733
|
+
function normalizeDescription(value) {
|
|
8734
|
+
const collapsed = collapseDescription(value);
|
|
8735
|
+
if (collapsed === void 0) return void 0;
|
|
8736
|
+
const count = Array.from(collapsed).length;
|
|
8737
|
+
if (count > MAX_DESCRIPTION_CHARS) throw new NoteError("invalid_description", `description is ${count} characters; limit is ${MAX_DESCRIPTION_CHARS}.`);
|
|
8738
|
+
return collapsed;
|
|
8739
|
+
}
|
|
8731
8740
|
function assertWho(value, scope) {
|
|
8732
8741
|
if (typeof value !== "string" || !(scope === "session" ? isSessionId(value) : SLUG_PATTERN.test(value))) {
|
|
8733
8742
|
throw new NoteError("invalid_scope", scope === "session" ? "session id must be a safe single directory component" : "who must be a canonical lowercase slug");
|
|
@@ -8817,6 +8826,7 @@ function createNotesStore(input) {
|
|
|
8817
8826
|
async function write(address, content, options = {}) {
|
|
8818
8827
|
const stableOptions = { ...options };
|
|
8819
8828
|
validateNotePolicy(stableOptions);
|
|
8829
|
+
const description = stableOptions.description === void 0 ? void 0 : normalizeDescription(stableOptions.description);
|
|
8820
8830
|
const destination = assertAddress(address);
|
|
8821
8831
|
assertWritablePath(destination.path);
|
|
8822
8832
|
const scope = destination.scope;
|
|
@@ -8844,6 +8854,9 @@ function createNotesStore(input) {
|
|
|
8844
8854
|
};
|
|
8845
8855
|
meta.scope = scope;
|
|
8846
8856
|
applyNotePolicy(meta, stableOptions);
|
|
8857
|
+
if (description === void 0) {
|
|
8858
|
+
if (stableOptions.description !== void 0) delete meta.description;
|
|
8859
|
+
} else meta.description = description;
|
|
8847
8860
|
if (origin !== void 0) meta.origin = origin;
|
|
8848
8861
|
delete meta.crumpledAt;
|
|
8849
8862
|
meta.updatedAt = now;
|
|
@@ -8873,14 +8886,15 @@ function createNotesStore(input) {
|
|
|
8873
8886
|
const operations = edits === void 0 ? [] : edits.map((operation) => ({ ...operation }));
|
|
8874
8887
|
const stableOptions = { ...options };
|
|
8875
8888
|
validateNotePolicy(stableOptions);
|
|
8889
|
+
const description = stableOptions.description === void 0 ? void 0 : normalizeDescription(stableOptions.description);
|
|
8876
8890
|
const from = assertAddress(address);
|
|
8877
8891
|
const destination = stableOptions.renameTo === void 0 ? from : assertAddress(stableOptions.renameTo);
|
|
8878
8892
|
assertWritablePath(destination.path);
|
|
8879
8893
|
const scope = destination.scope;
|
|
8880
8894
|
assertWritableNamespace(from.scope, from.who, identity2);
|
|
8881
8895
|
assertWritableNamespace(scope, destination.who, identity2);
|
|
8882
|
-
if (operations.length === 0 && stableOptions.origin === void 0 && stableOptions.crumpled === void 0 && stableOptions.renameTo === void 0 && stableOptions.pinned === void 0 && stableOptions.budget === void 0 && stableOptions.readonly === void 0) {
|
|
8883
|
-
throw new NoteError("nothing_to_do", "Nothing to change: provide edits, policy, an origin, a crumpled state, or a new address.");
|
|
8896
|
+
if (operations.length === 0 && stableOptions.origin === void 0 && stableOptions.description === void 0 && stableOptions.crumpled === void 0 && stableOptions.renameTo === void 0 && stableOptions.pinned === void 0 && stableOptions.budget === void 0 && stableOptions.readonly === void 0) {
|
|
8897
|
+
throw new NoteError("nothing_to_do", "Nothing to change: provide edits, a description, policy, an origin, a crumpled state, or a new address.");
|
|
8884
8898
|
}
|
|
8885
8899
|
const fromPath = physicalPath(from.scope, from.path, identity2, from.who);
|
|
8886
8900
|
const path = physicalPath(scope, destination.path, identity2, destination.who);
|
|
@@ -8904,6 +8918,9 @@ function createNotesStore(input) {
|
|
|
8904
8918
|
if (moved && targetRaw !== void 0) assertNoteUnlocked(parseNote(targetRaw).meta, stableOptions.readonly);
|
|
8905
8919
|
const beforeMeta = { ...meta };
|
|
8906
8920
|
applyNotePolicy(meta, stableOptions);
|
|
8921
|
+
if (description === void 0) {
|
|
8922
|
+
if (stableOptions.description !== void 0) delete meta.description;
|
|
8923
|
+
} else meta.description = description;
|
|
8907
8924
|
meta.scope = scope;
|
|
8908
8925
|
if (from.scope !== "session" && scope === "session") meta.project = identity2.projectKey;
|
|
8909
8926
|
if (from.scope === "session" && scope !== "session") delete meta.project;
|
|
@@ -8932,10 +8949,11 @@ function createNotesStore(input) {
|
|
|
8932
8949
|
const bodyChanged = body !== next;
|
|
8933
8950
|
const originChanged = beforeMeta.origin !== meta.origin;
|
|
8934
8951
|
const policyChanged = beforeMeta.pinned !== meta.pinned || beforeMeta.budget !== meta.budget || beforeMeta.readonly !== meta.readonly;
|
|
8935
|
-
|
|
8952
|
+
const descriptionChanged = beforeMeta.description !== meta.description;
|
|
8953
|
+
if (bodyChanged || originChanged || policyChanged || descriptionChanged || moved) meta.updatedAt = writeStamp();
|
|
8936
8954
|
const serialized = serializeNote(meta, next);
|
|
8937
8955
|
assertSerializedSize(serialized);
|
|
8938
|
-
const metadataChanged = originChanged || policyChanged || beforeMeta.crumpledAt !== meta.crumpledAt;
|
|
8956
|
+
const metadataChanged = originChanged || policyChanged || descriptionChanged || beforeMeta.crumpledAt !== meta.crumpledAt;
|
|
8939
8957
|
let change;
|
|
8940
8958
|
if (bodyChanged && (metadataChanged || moved)) change = { kind: "body", before: raw, after: serialized };
|
|
8941
8959
|
else if (bodyChanged) change = { kind: "body", before: body, after: next };
|
|
@@ -9162,8 +9180,9 @@ var ORIGIN_VALUES = [typebox_exports.Literal("user"), typebox_exports.Literal("s
|
|
|
9162
9180
|
var ORIGIN = typebox_exports.Optional(typebox_exports.Union([...ORIGIN_VALUES], {
|
|
9163
9181
|
description: "Whose handwriting: user, self, or external. Leave it out to keep what's there."
|
|
9164
9182
|
}));
|
|
9183
|
+
var DESCRIPTION_PARAMETER = typebox_exports.Optional(typebox_exports.String({ description: "One-line summary of what's inside and when to open it (max 160 chars). Empty string clears it." }));
|
|
9165
9184
|
var POLICY_PARAMETERS = {
|
|
9166
|
-
pinned: typebox_exports.Optional(typebox_exports.Boolean({ description: "Tape the page inside the cover: read whole at every wake-up. Five per notebook, CHEATSHEET
|
|
9185
|
+
pinned: typebox_exports.Optional(typebox_exports.Boolean({ description: "Tape the page inside the cover: read whole at every wake-up. Five per notebook, CHEATSHEET included." })),
|
|
9167
9186
|
budget: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER, description: "How much paper the page gets. Writing past it still saves, with a warning. A page over budget gets boiled down: stale lines out, repeats merged, the rest said shorter. More paper is for a page already boiled down that still needs the room." })),
|
|
9168
9187
|
readonly: typebox_exports.Optional(typebox_exports.Boolean({ description: "A paperclip that keeps your own hands off. `false` takes it off \u2014 same call is fine." }))
|
|
9169
9188
|
};
|
|
@@ -9185,7 +9204,7 @@ function withWarnings(text, data) {
|
|
|
9185
9204
|
var CRUMPLED_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "`true` balls the page up: gone from list and search, still readable. `false` smooths it flat again." }));
|
|
9186
9205
|
var CRUMPLED_LIST_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "Only the crumpled balls." }));
|
|
9187
9206
|
var FILE_LIMIT_PARAMETER = typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "How many pages at most." }));
|
|
9188
|
-
var GLOB_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Which drawers to open. Leave it out for this session and your current notebooks. `@project/**` one shelf \xB7 `
|
|
9207
|
+
var GLOB_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Which drawers to open. Leave it out for this session and your current notebooks. `@project/**` one shelf \xB7 `CHEATSHEET.md` that page in every notebook \xB7 `**` everything \xB7 `@sessions/*/**` every session." }));
|
|
9189
9208
|
var CWD_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Treat this directory's project as `@project/`." }));
|
|
9190
9209
|
var ADDRESS_PARAMETER = typebox_exports.String({ description: "Which drawer the page sits in. `plan.md` \u2014 this session's desk, cleared when it ends. `@project/` this project's shelf \xB7 `@human/` your human's file \xB7 `@self/` your own notebook \xB7 `@model/` your brain's. `@projects/<name>/`, `@sessions/<id>/`, `@agents/<name>/`, `@models/<name>/` \u2014 someone else's shelf: read only. Paper, not files: hand one to read/write/edit/bash and a real `@project` folder is born." });
|
|
9191
9210
|
function failureOf(error) {
|
|
@@ -9194,7 +9213,7 @@ function failureOf(error) {
|
|
|
9194
9213
|
if (isFilesystemError(error)) return failure("io_error", "notes operation failed");
|
|
9195
9214
|
throw error;
|
|
9196
9215
|
}
|
|
9197
|
-
var NORMALIZED_META_KEYS = /* @__PURE__ */ new Set(["scope", "origin", "createdAt", "updatedAt", "lastAccessed", "accessCount", "crumpledAt", "project", "pinned", "budget", "readonly"]);
|
|
9216
|
+
var NORMALIZED_META_KEYS = /* @__PURE__ */ new Set(["scope", "origin", "createdAt", "updatedAt", "lastAccessed", "accessCount", "crumpledAt", "project", "pinned", "budget", "readonly", "description"]);
|
|
9198
9217
|
var MAX_METADATA_ENTRY_BYTES = 1024;
|
|
9199
9218
|
var MAX_METADATA_VERBATIM_BYTES = 2048;
|
|
9200
9219
|
var TOO_LARGE_EXTRA_VALUE = "[omitted: too large]";
|
|
@@ -9205,6 +9224,7 @@ var NoteMetadataSchema = typebox_exports.Object({
|
|
|
9205
9224
|
updated_at: typebox_exports.String(),
|
|
9206
9225
|
crumpled_at: typebox_exports.Optional(typebox_exports.String()),
|
|
9207
9226
|
project: typebox_exports.Optional(typebox_exports.String()),
|
|
9227
|
+
description: typebox_exports.Optional(typebox_exports.String()),
|
|
9208
9228
|
extra: typebox_exports.Record(typebox_exports.String(), typebox_exports.Unknown())
|
|
9209
9229
|
}, { additionalProperties: false });
|
|
9210
9230
|
function noteMetadata(meta, address) {
|
|
@@ -9231,6 +9251,7 @@ function noteMetadata(meta, address) {
|
|
|
9231
9251
|
updated_at: localIso(meta.updatedAt),
|
|
9232
9252
|
...typeof meta.crumpledAt === "string" ? { crumpled_at: meta.crumpledAt } : {},
|
|
9233
9253
|
...typeof meta.project === "string" ? { project: meta.project } : {},
|
|
9254
|
+
...typeof meta.description === "string" ? { description: meta.description } : {},
|
|
9234
9255
|
extra
|
|
9235
9256
|
};
|
|
9236
9257
|
}
|
|
@@ -9241,7 +9262,8 @@ function renderMetadata(metadata) {
|
|
|
9241
9262
|
`created ${metadata.created_at}`,
|
|
9242
9263
|
`updated ${metadata.updated_at}`,
|
|
9243
9264
|
...metadata.crumpled_at === void 0 ? [] : [`crumpled ${metadata.crumpled_at}`],
|
|
9244
|
-
...metadata.project === void 0 ? [] : [`project ${metadata.project}`]
|
|
9265
|
+
...metadata.project === void 0 ? [] : [`project ${metadata.project}`],
|
|
9266
|
+
...metadata.description === void 0 ? [] : [`description ${metadata.description}`]
|
|
9245
9267
|
];
|
|
9246
9268
|
const extra = Object.keys(metadata.extra);
|
|
9247
9269
|
if (extra.length > 0) fields.push(`extra ${JSON.stringify(metadata.extra)}`);
|
|
@@ -9268,7 +9290,8 @@ var ListedFileSchema = typebox_exports.Object({
|
|
|
9268
9290
|
...PolicySchema,
|
|
9269
9291
|
...WarningsSchema,
|
|
9270
9292
|
updated_at: typebox_exports.String(),
|
|
9271
|
-
crumpled_at: typebox_exports.Optional(typebox_exports.String())
|
|
9293
|
+
crumpled_at: typebox_exports.Optional(typebox_exports.String()),
|
|
9294
|
+
description: typebox_exports.Optional(typebox_exports.String())
|
|
9272
9295
|
}, { additionalProperties: false });
|
|
9273
9296
|
var MatchSchema = typebox_exports.Object({
|
|
9274
9297
|
line: typebox_exports.Integer(),
|
|
@@ -9328,9 +9351,9 @@ function snapshot(rows, limit, status, renderData, shrink) {
|
|
|
9328
9351
|
}
|
|
9329
9352
|
function listedFile(row, identity2) {
|
|
9330
9353
|
const policy = policyAt(row.meta, row.address);
|
|
9331
|
-
return { ...noteIdentity(identity2, row.address), ...policy, warnings: row.warnings ?? (row.body === void 0 ? [] : noteBudgetWarnings(row.body, policy)), updated_at: localIso(row.meta.updatedAt), ...row.meta.crumpledAt === void 0 ? {} : { crumpled_at: row.meta.crumpledAt } };
|
|
9354
|
+
return { ...noteIdentity(identity2, row.address), ...policy, warnings: row.warnings ?? (row.body === void 0 ? [] : noteBudgetWarnings(row.body, policy)), updated_at: localIso(row.meta.updatedAt), ...row.meta.crumpledAt === void 0 ? {} : { crumpled_at: row.meta.crumpledAt }, ...typeof row.meta.description === "string" ? { description: row.meta.description } : {} };
|
|
9332
9355
|
}
|
|
9333
|
-
var notesWriteParameters = typebox_exports.Object({ address: ADDRESS_PARAMETER, content: typebox_exports.String({ description: "The whole page." }), origin: ORIGIN, ...POLICY_PARAMETERS, cwd: CWD_PARAMETER }, { additionalProperties: false });
|
|
9356
|
+
var notesWriteParameters = typebox_exports.Object({ address: ADDRESS_PARAMETER, content: typebox_exports.String({ description: "The whole page." }), origin: ORIGIN, description: DESCRIPTION_PARAMETER, ...POLICY_PARAMETERS, cwd: CWD_PARAMETER }, { additionalProperties: false });
|
|
9334
9357
|
function renderWriteData(data) {
|
|
9335
9358
|
return withWarnings(`${data.outcome} ${renderIdentity(data)} | ${renderPolicy(data)}`, data);
|
|
9336
9359
|
}
|
|
@@ -9344,7 +9367,7 @@ var notesWrite = {
|
|
|
9344
9367
|
async execute(params, context2) {
|
|
9345
9368
|
try {
|
|
9346
9369
|
const identity2 = notesIdentityForCall(context2, params.cwd);
|
|
9347
|
-
const { outcome, meta, warnings } = await createNotesStore(identity2).write(params.address, params.content, { origin: params.origin, pinned: params.pinned, budget: params.budget, readonly: params.readonly });
|
|
9370
|
+
const { outcome, meta, warnings } = await createNotesStore(identity2).write(params.address, params.content, { origin: params.origin, description: params.description, pinned: params.pinned, budget: params.budget, readonly: params.readonly });
|
|
9348
9371
|
return success({ ...noteIdentity(identity2, params.address), outcome, ...policyAt(meta, params.address), warnings });
|
|
9349
9372
|
} catch (error) {
|
|
9350
9373
|
return failureOf(error);
|
|
@@ -9356,6 +9379,7 @@ var notesUpdateParameters = typebox_exports.Object({
|
|
|
9356
9379
|
address: ADDRESS_PARAMETER,
|
|
9357
9380
|
edits: typebox_exports.Optional(typebox_exports.Array(typebox_exports.Object({ oldText: typebox_exports.String({ description: "The passage as it stands on the page." }), newText: typebox_exports.String({ description: "What goes in its place." }) }, { additionalProperties: false }), { description: "Pen strokes, in order. Each `oldText` is the exact passage \u2014 same case, found once \u2014 and `newText` is what goes in its place." })),
|
|
9358
9381
|
origin: ORIGIN,
|
|
9382
|
+
description: DESCRIPTION_PARAMETER,
|
|
9359
9383
|
...POLICY_PARAMETERS,
|
|
9360
9384
|
crumpled: CRUMPLED_PARAMETER,
|
|
9361
9385
|
replace_all: typebox_exports.Optional(typebox_exports.Boolean({ description: "Strike every copy of `oldText`, not just one." })),
|
|
@@ -9378,7 +9402,7 @@ var notesUpdate = {
|
|
|
9378
9402
|
const identity2 = notesIdentityForCall(context2, params.cwd);
|
|
9379
9403
|
const store = createNotesStore(identity2);
|
|
9380
9404
|
const renameTo = params.rename_to === "" ? void 0 : params.rename_to;
|
|
9381
|
-
const { change, moved, meta, warnings } = await store.update(params.address, params.edits, { origin: params.origin, pinned: params.pinned, budget: params.budget, readonly: params.readonly, crumpled: params.crumpled, replaceAll: params.replace_all, renameTo });
|
|
9405
|
+
const { change, moved, meta, warnings } = await store.update(params.address, params.edits, { origin: params.origin, description: params.description, pinned: params.pinned, budget: params.budget, readonly: params.readonly, crumpled: params.crumpled, replaceAll: params.replace_all, renameTo });
|
|
9382
9406
|
onChange?.(change);
|
|
9383
9407
|
const from = noteIdentity(identity2, params.address).address;
|
|
9384
9408
|
const to = noteIdentity(identity2, renameTo ?? params.address);
|
|
@@ -9430,7 +9454,7 @@ var notesListParameters = typebox_exports.Object({
|
|
|
9430
9454
|
function renderListData(data) {
|
|
9431
9455
|
const lines = [`${data.files.length} ${data.files.length === 1 ? "note" : "notes"}`];
|
|
9432
9456
|
for (const file of data.files) {
|
|
9433
|
-
const fields = [`- ${renderIdentity(file)}`, renderPolicy(file), `updated ${file.updated_at}`];
|
|
9457
|
+
const fields = [file.description === void 0 ? `- ${renderIdentity(file)}` : `- ${renderIdentity(file)} \u2014 ${file.description}`, renderPolicy(file), `updated ${file.updated_at}`];
|
|
9434
9458
|
if (file.last_accessed !== void 0) fields.push(`accessed ${file.last_accessed}`);
|
|
9435
9459
|
if (file.crumpled_at !== void 0) fields.push(`crumpled ${file.crumpled_at}`);
|
|
9436
9460
|
if (file.matches) fields.push(`${file.matches.length} ${file.matches.length === 1 ? "match" : "matches"}${file.more_matches ? `, ${file.more_matches} more lines` : ""}`);
|
|
@@ -11226,7 +11250,6 @@ async function loadNotesSnapshot(identity2, openedAt, loadNamespace) {
|
|
|
11226
11250
|
}
|
|
11227
11251
|
|
|
11228
11252
|
// src/boot/text.ts
|
|
11229
|
-
var SHELF_FRESH_LIMIT = 3;
|
|
11230
11253
|
var WINDOW_IDENTITY_OPEN_TAG = "<notesoup:window_identity>";
|
|
11231
11254
|
var WINDOW_IDENTITY_CLOSE_TAG = "</notesoup:window_identity>";
|
|
11232
11255
|
var NOTES_PROTOCOL_OPEN_TAG = "<notesoup:notes_protocol>";
|
|
@@ -11268,24 +11291,25 @@ Still a tie? *shrugs* You've got a brain. Use it.
|
|
|
11268
11291
|
Any other @ address is fake. End of discussion. @ addresses are not file paths: never pass them to file tools like \`read\`, \`write\`, \`edit\`, or \`bash\`.
|
|
11269
11292
|
${NOTES_PROTOCOL_CLOSE_TAG}`;
|
|
11270
11293
|
var MAPS_BLOCK = `<notesoup:maps>
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11294
|
+
Each notebook has one default pin: \`CHEATSHEET.md\`. Pinned pages get jammed straight into your
|
|
11295
|
+
brain the moment you wake up. Whoever wakes up next reads them, and next is you. So keep them
|
|
11296
|
+
short, and keep them true.
|
|
11274
11297
|
|
|
11275
|
-
Up to five pages per notebook can be taped inside the cover,
|
|
11298
|
+
Up to five pages per notebook can be taped inside the cover, CHEATSHEET included. Every page gets
|
|
11276
11299
|
a paper budget; when a page outgrows it, boil it down \u2014 stale lines out, repeats merged, the rest
|
|
11277
11300
|
said shorter \u2014 instead of giving it more paper.
|
|
11278
11301
|
|
|
11279
11302
|
- **\`CHEATSHEET.md\`** holds what you'll want next time \u2014 a rule, a warning, a grudge, a name,
|
|
11280
11303
|
a phone number you'll regret losing. Nobody grades it. Keep it to five lines, or it grows fat
|
|
11281
11304
|
and everybody pays for it.
|
|
11282
|
-
- **\`
|
|
11283
|
-
|
|
11284
|
-
|
|
11305
|
+
- **\`description\`** is one line saying what's inside a note and when to open it \u2014 max 160
|
|
11306
|
+
characters, set through your notes tools. Boot indexes every shelf from these,
|
|
11307
|
+
newest first, address and age beside them. No hand-written map to keep in sync: a stale
|
|
11308
|
+
description lies to the next window, so keep it true or crumple the page.
|
|
11285
11309
|
|
|
11286
11310
|
Each notebook keeps its own: \`@project\`, \`@human\`, \`@self\`, \`@model\`. Missing pages are skipped;
|
|
11287
|
-
no need to create empty ones. New
|
|
11288
|
-
|
|
11311
|
+
no need to create empty ones. New rule worth remembering, new Cheatsheet line. And when a line
|
|
11312
|
+
goes wrong, stale, or useless, kill it \u2014 tomorrow's you reads that page as fact.
|
|
11289
11313
|
</notesoup:maps>`;
|
|
11290
11314
|
function renderProtocolBlock(tools, agentName = NAMELESS_AGENT) {
|
|
11291
11315
|
const names = {
|
|
@@ -11313,14 +11337,30 @@ function relativeTime(timestamp, now) {
|
|
|
11313
11337
|
const amount = `${Math.abs(Math.trunc(seconds / size))}${unit}`;
|
|
11314
11338
|
return seconds > 0 ? `in ${amount}` : `${amount} ago`;
|
|
11315
11339
|
}
|
|
11316
|
-
var
|
|
11340
|
+
var SHELF_INDEX_MAX_ENTRIES = 25;
|
|
11341
|
+
var SHELF_INDEX_MAX_CHARS = 4096;
|
|
11342
|
+
var FALLBACK_TITLE_MAX_CHARS = 80;
|
|
11343
|
+
function truncated(text, max) {
|
|
11344
|
+
const chars = Array.from(text);
|
|
11345
|
+
return chars.length > max ? `${chars.slice(0, max).join("")}\u2026` : chars.join("");
|
|
11346
|
+
}
|
|
11317
11347
|
function feedTitle(body) {
|
|
11318
11348
|
const lines = body.split("\n");
|
|
11319
11349
|
const heading = lines.find((line) => /^#+\s+\S/.test(line));
|
|
11320
11350
|
const raw = (heading ? heading.replace(/^#+\s+/, "") : lines.find((line) => line.trim().length > 0) ?? "").trim();
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11351
|
+
return raw.length === 0 ? void 0 : truncated(raw, FALLBACK_TITLE_MAX_CHARS);
|
|
11352
|
+
}
|
|
11353
|
+
function summaryOf(row) {
|
|
11354
|
+
if (typeof row.meta.description === "string") {
|
|
11355
|
+
const collapsed = collapseDescription(row.meta.description);
|
|
11356
|
+
return collapsed === void 0 ? void 0 : truncated(collapsed, MAX_DESCRIPTION_CHARS);
|
|
11357
|
+
}
|
|
11358
|
+
return feedTitle(row.body);
|
|
11359
|
+
}
|
|
11360
|
+
function indexLine(row, openedAt) {
|
|
11361
|
+
const locator = `${row.address} \xB7 ${relativeTime(row.meta.updatedAt, openedAt)}`;
|
|
11362
|
+
const summary = summaryOf(row);
|
|
11363
|
+
return summary === void 0 ? ` ${locator}` : ` ${locator} \u2014 ${summary}`;
|
|
11324
11364
|
}
|
|
11325
11365
|
function indent(text) {
|
|
11326
11366
|
return text.split("\n").map((line) => line.length > 0 ? ` ${line}` : line).join("\n");
|
|
@@ -11348,13 +11388,20 @@ function notesIndex(snapshot2, tools, agentName, modelName) {
|
|
|
11348
11388
|
const rows = (snapshot2.namespaces.get(namespace.scope) ?? []).filter((row) => row.meta.crumpledAt === void 0);
|
|
11349
11389
|
const pins = rows.filter((row) => effectiveNotePolicy(row.meta, row.path).pinned).sort((a, b) => pinnedPageOrder(a.path) - pinnedPageOrder(b.path) || a.path.localeCompare(b.path));
|
|
11350
11390
|
const pinned = pins.slice(0, MAX_PINNED_NOTES);
|
|
11351
|
-
const
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11391
|
+
const unpinned = rows.filter((row) => !effectiveNotePolicy(row.meta, row.path).pinned);
|
|
11392
|
+
const index = [];
|
|
11393
|
+
let usedChars = 0;
|
|
11394
|
+
for (const row of unpinned) {
|
|
11395
|
+
if (index.length >= SHELF_INDEX_MAX_ENTRIES) break;
|
|
11396
|
+
const line = indexLine(row, snapshot2.openedAt);
|
|
11397
|
+
const nextChars = usedChars + (index.length > 0 ? 1 : 0) + line.length;
|
|
11398
|
+
if (index.length > 0 && nextChars > SHELF_INDEX_MAX_CHARS) break;
|
|
11399
|
+
index.push(line);
|
|
11400
|
+
usedChars = nextChars;
|
|
11401
|
+
}
|
|
11402
|
+
const omitted = unpinned.length - index.length;
|
|
11403
|
+
if (omitted > 0) index.push(` \u2026 and ${omitted} more (use ${tools.notesList})`);
|
|
11404
|
+
if (pinned.length === 0 && index.length === 0) continue;
|
|
11358
11405
|
const parts = pinned.map((row) => {
|
|
11359
11406
|
const warnings = noteBudgetWarnings(row.body, effectiveNotePolicy(row.meta, row.path));
|
|
11360
11407
|
return `${row.address}
|
|
@@ -11362,9 +11409,9 @@ function notesIndex(snapshot2, tools, agentName, modelName) {
|
|
|
11362
11409
|
${indent([...warnings, row.body].join("\n"))}`;
|
|
11363
11410
|
});
|
|
11364
11411
|
if (pins.length > MAX_PINNED_NOTES) parts.push(indent(`Warning: only ${MAX_PINNED_NOTES} pinned notes per notebook are injected; omitted pins: ${pins.slice(MAX_PINNED_NOTES).map((row) => row.address).join(", ")}. Unpin some notes or read the omitted pages with ${tools.notes}.`));
|
|
11365
|
-
if (
|
|
11412
|
+
if (index.length > 0) parts.push(pinned.length > 0 ? `notes
|
|
11366
11413
|
|
|
11367
|
-
${
|
|
11414
|
+
${index.join("\n")}` : index.join("\n"));
|
|
11368
11415
|
shelves.push(section(namespace.label, parts.join("\n\n")));
|
|
11369
11416
|
}
|
|
11370
11417
|
return shelves.length > 0 ? ["YOUR NOTES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500", ...shelves].join("\n\n\n") : "YOUR NOTES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nNone yet. A blank slate is a fine place to start \u2014 just don't finish there.";
|
|
@@ -11413,7 +11460,7 @@ function selectContinuation(origin) {
|
|
|
11413
11460
|
return pool[Math.floor(Math.random() * pool.length)];
|
|
11414
11461
|
}
|
|
11415
11462
|
var WARNING_TIMING = "The reserve is nearly spent. The wipe lands at the end of whichever turn spends the last of it, possibly this one.";
|
|
11416
|
-
var WARNING_BODY = "Stop the task. Write down what git and history can't give back:\n- where you are, and how far you got\n- what the human decided, in their words\n- what's blocked or waiting\n- the next move\n- where the half-done work sits\n- what failed, and why\n- which skills, seqs, notes, or files to reopen\n- anything else worth noting\nThen leave the shelf current: replace what's stale, a whole note or a section inside one, and crumple the dead ones. Update and trim pinned pages (CHEATSHEET.md and
|
|
11463
|
+
var WARNING_BODY = "Stop the task. Write down what git and history can't give back:\n- where you are, and how far you got\n- what the human decided, in their words\n- what's blocked or waiting\n- the next move\n- where the half-done work sits\n- what failed, and why\n- which skills, seqs, notes, or files to reopen\n- anything else worth noting\nThen leave the shelf current: replace what's stale, a whole note or a section inside one, and crumple the dead ones. Update and trim pinned pages (CHEATSHEET.md by default) and keep each page's one-line `description` true; every new window loads the pins and renders the index. The next window gets whatever you leave, dead notes and dead sections alike.\nDon't call anything that might return a large output. One big read can spend the rest of the reserve before your notes are saved.";
|
|
11417
11464
|
var WARNING_CALL = "Then call `empty_brain`. Nothing in between.";
|
|
11418
11465
|
function warningPrompt() {
|
|
11419
11466
|
return `${WARNING_TIMING}
|
|
@@ -22,12 +22,12 @@ Durable notes hold decisions, constraints, and lessons that stay true after the
|
|
|
22
22
|
|
|
23
23
|
1. **Leave stable notes alone.** Change a note to incorporate new evidence, fix a verified error, retire a stale claim, merge a genuine duplicate, trim diary content, or split an oversized file, not merely to shorten or rephrase it. No change is a valid outcome.
|
|
24
24
|
2. **Verify only what the proposed change depends on.** Before correcting, retiring, or promoting a conclusion, check the relevant evidence as needed. Do not revalidate every stable note or turn dream into a source-code audit. An unavailable referent is unverified, not proof that it is dead.
|
|
25
|
-
3. **Retire what is no longer true.** When evidence shows a durable note is stale, correct it in place; if nothing true remains, crumple it.
|
|
25
|
+
3. **Retire what is no longer true.** When evidence shows a durable note is stale, correct it in place; if nothing true remains, crumple it. Fix its `description` either way. A note's last access is a hint, not evidence: long-unread notes are candidates to check, not to crumple on sight. `dream_begin` lists each note's last access; reads during a dream leave no stamp, so reviewing a note does not make it look fresh.
|
|
26
26
|
4. **Merge only genuine duplicates.** Merge two notes only when they share a topic and kind (checkpoint, design, log). First carry every fact, condition, and exception unique to the absorbed note into the survivor, then crumple the absorbed note. Otherwise keep both and record any unresolved conflict.
|
|
27
|
-
5. **Relocate misfiled notes.** When a standing ruling or the note's own
|
|
27
|
+
5. **Relocate misfiled notes.** When a standing ruling or the note's own `description` already names its proper notebook, move it there, preserving its metadata, and keep its `description` true. Do it, don't propose it. Propose only when the destination notebook itself is unclear.
|
|
28
28
|
6. **Preserve meaning and provenance.** Keep facts, conditions, exceptions, uncertainty, authorship, and sources. When promoting a finding, cite its source. Do not relabel agent-authored material as human-authored. If its destination or authority is unclear, propose the promotion instead.
|
|
29
29
|
7. **Keep notes manageable.** Aim below about 200 lines / 8KB per note. Split oversized notes by topic with one-line cross-links.
|
|
30
|
-
8. **Keep wake-up pages useful.** Each writable notebook's `CHEATSHEET.md` holds standing reminders, kept to five lines.
|
|
30
|
+
8. **Keep wake-up pages useful.** Each writable notebook's `CHEATSHEET.md` holds standing reminders, kept to five lines; it is the one default-pinned page and loads every window when live unless explicitly unpinned. Every durable note gets a one-line `description` (max 160 characters) saying what it holds and when to open it — boot lists each notebook's unpinned notes newest first from these, so a missing, stale, or vague description hides the page. A hand-written `MAP.md` is an ordinary note now; once its lines live in `description`s, crumple it. Do not create empty pages. Each notebook allows five live pins. Ordinary pages default to a 4096-code-point advisory budget (2048 for root `CHEATSHEET.md`), adjustable per note; overflow warns without truncating a pinned body. Preserve standing rules and keep descriptions true as notes are promoted or retired.
|
|
31
31
|
|
|
32
32
|
## Deleting
|
|
33
33
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dream
|
|
3
|
-
description: Review and consolidate durable notes using notesoup's shared dream playbook. Use when the human asks to dream over notes, merge genuine duplicates,
|
|
3
|
+
description: Review and consolidate durable notes using notesoup's shared dream playbook. Use when the human asks to dream over notes, merge genuine duplicates, audit descriptions, or promote durable findings.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Dream
|
|
7
7
|
|
|
8
|
-
Read `../../playbook.md` completely, resolving the path from this skill's directory. It is the shared guide to reviewing and organizing notes. Standing reminders belong in a separate `CHEATSHEET.md` (five lines);
|
|
8
|
+
Read `../../playbook.md` completely, resolving the path from this skill's directory. It is the shared guide to reviewing and organizing notes. Standing reminders belong in a separate `CHEATSHEET.md` (five lines), the one default-pinned page; it loads every window when live unless explicitly unpinned. Every durable note carries a one-line `description` (max 160 characters) saying what it holds and when to open it — boot renders each notebook's index from these, so a missing or stale description is an index defect. Ordinary notes default to a 4096-code-point advisory budget (2048 for root `CHEATSHEET.md`), adjustable per note; pinned bodies load whole with overflow warnings. Respect soft readonly locks; explicitly unlock with `readonly:false` before changing a locked note.
|
|
9
9
|
|
|
10
10
|
Dream in this agent's current session. Do not start another agent or model unless the human asks.
|
|
11
11
|
|
|
@@ -32,7 +32,7 @@ Any other `@` prefix is refused. A path is relative and `/`-separated, with no e
|
|
|
32
32
|
|
|
33
33
|
`@` addresses are not file paths: never pass them to file tools like `read`, `write`, `edit`, or `bash`. That creates a stray directory instead of a note.
|
|
34
34
|
|
|
35
|
-
`CHEATSHEET.md`
|
|
35
|
+
`CHEATSHEET.md` at each notebook's root is the default-pinned page you wake up with; absent or crumpled pages are skipped. Set `pinned`, `budget`, and `readonly` through `notes_write`/`notes_update` or frontmatter. Explicit `pinned:false` unpins even a default page. Each notebook allows five live pins; ordinary pages default to a 4096-code-point advisory budget (2048 for root `CHEATSHEET.md`), adjustable per note. Overflow warns but saves, and pinned bodies load whole. `readonly:true` is a soft lock, not security; explicitly set `readonly:false` to unlock, alone or alongside your changes. Keep standing reminders in `CHEATSHEET.md`, to five lines. Give each durable note a one-line `description` (max 160 characters, set with `notes_write`/`notes_update`): boot lists every notebook's unpinned pages newest first as address, age, and description, so it is the only index. Do not create empty pages.
|
|
36
36
|
|
|
37
37
|
Keep notes focused on what is true now; if a piece of past context still matters (such as why an approach was ruled out), keep only a brief summary rather than a blow-by-blow log. Crumple notes that are no longer true; a stale note is worse than none.
|
|
38
38
|
|