counterparts 0.3.52 → 0.3.53
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/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/docs/manual.md +1 -1
- package/docs/module-map.md +1 -0
- package/package.json +1 -1
- package/src/adapters/lifecycle.ts +12 -1
- package/src/adapters/mcp/server-self-tools.ts +15 -2
- package/src/adapters/mcp/server-words.ts +2 -2
- package/src/adapters/mcp/server.ts +61 -0
- package/src/adapters/mcp/tools.ts +43 -2
- package/src/core/counterpart-wake-shape.ts +793 -53
- package/src/core/counterpart.ts +37 -6
- package/src/core/dream/CONTRACT.md +3 -0
- package/src/core/dream/NOTES.md +9 -0
- package/src/core/dream/night-line.ts +11 -2
- package/src/core/dream/reflect.ts +38 -3
- package/src/core/encode/NOTES.md +1 -0
- package/src/core/encode/secrets.ts +13 -0
- package/src/core/handoff/CONTRACT.md +3 -1
- package/src/core/handoff/last-exchange.ts +24 -4
- package/src/core/owner-waits.ts +246 -0
- package/src/core/recall/INTERFACE-GAPS.md +6 -0
- package/src/core/recall/index.ts +5 -0
- package/src/core/recall/steps.ts +2 -0
- package/src/core/self/CONTRACT.md +76 -0
- package/src/core/self/NOTES.md +178 -0
- package/src/core/self/index.ts +105 -5
- package/src/core/self/set-down.ts +774 -0
- package/src/core/self/stories.ts +79 -0
- package/src/core/self/tunables.ts +134 -0
- package/src/core/self/writer.ts +57 -8
- package/src/core/store/index.ts +5 -0
- package/src/core/store/reads-memories.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.53 — 2026-11-09
|
|
4
|
+
|
|
5
|
+
**Your page names what it sets down and tells more than corrections; the morning wake reads cleaner; things waiting on you come up when they're relevant, not as a pile.** What you'll notice: the morning after a night's page write, the wake can say "Set down from my page last night: …"; the wake ends with a "Carried forward" line, gives overdue items as a count with the oldest date, and names the session id in its first line; and now and then a line "Waiting on <you>, ask when it fits: …" when something you owe an answer on comes up in the conversation or at the week's session start. The wake changes are in the shaped wake (on for a store created since 0.3.46, or after `counterparts wake-shape on`). `remember` takes `story: true`. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.52 is a reinstall with no store restore: `counterparts disconnect`, 0.3.52's install, then `counterparts connect`.
|
|
6
|
+
|
|
7
|
+
- **The page says what it sets down.** The self page stays within its room, so each night a new line pushes an old
|
|
8
|
+
one out. Now the night's page writers name the lines they take out, with a short why, and anything taken out
|
|
9
|
+
that wasn't named is recorded anyway; a line only reworded, or folded into a story still on the page, isn't
|
|
10
|
+
counted as gone. Each line set down is kept as a memory, word for word. The next morning's wake names up to two
|
|
11
|
+
("Set down from my page last night: …"), and `recall "set down"` lists them all, newest first, with why and date.
|
|
12
|
+
When life brings one up again (it's used, or a newer memory says it again), the night's writers are shown it and
|
|
13
|
+
may put it back.
|
|
14
|
+
- **The page's stories are about growth, not only corrections.** On a store that keeps its page in its own form
|
|
15
|
+
(`counterparts page-form own`), the night's page writers are told to keep a mix of story kinds (corrections that
|
|
16
|
+
changed how the counterpart works, and also what went right, discoveries, and moments with the owner), and that a
|
|
17
|
+
story earns its place if it would still teach something in a different project. Day's end is shown the day's
|
|
18
|
+
memories about me or us with a small head start over the day's work, so a busy work day doesn't crowd them out.
|
|
19
|
+
A practice on the page that is only about the work may move into a skill memory, which recall brings back when
|
|
20
|
+
the work calls for it; the set-down record names it. On every store, `remember` takes `story: true` to nominate a
|
|
21
|
+
moment as a story: the night's writer sees it first and still decides, and one it passes by fades like any
|
|
22
|
+
other memory.
|
|
23
|
+
- **The wake says what it points at, once.** A reminder told in another session is listed again by title instead of
|
|
24
|
+
"shown earlier", which that session never saw. The night's closing line no longer repeats a sentence the page or
|
|
25
|
+
day's end already says, and the same line on a second morning shrinks to a clause. Overdue items get their own count
|
|
26
|
+
with the oldest date. A handoff waiting on an answer with nothing new sinks below the others, and one more than a week
|
|
27
|
+
old that nothing refers to stops being listed (still under `recall "handoffs"`). Every line under Elsewhere says when.
|
|
28
|
+
"Last said" quotes a whole first sentence when it fits. "Last night" stops saying the run is under way once the
|
|
29
|
+
dream is written up. And the wake's first line names the session id, which the `reflect` tool asks for.
|
|
30
|
+
- **What waits on you comes up when it's relevant, not as a pile.** An item waiting on your answer is no longer one of
|
|
31
|
+
the wake's still-open lines. Instead, when a turn you start touches one, it's raised once after the recall block,
|
|
32
|
+
with what it needs and how long it has waited; and a session's wake says at most one ("Waiting on <you>, ask
|
|
33
|
+
when it fits: …"), the most relevant to the folder's week first, the same item there at most once a week. Each item is raised at most once a lived day across
|
|
34
|
+
every session, then again after 3, 7 and 14 lived days, and then it's parked (still under `recall "still open"`).
|
|
35
|
+
- **"PW" before a version number is no longer read as a password.** 0.3.52's prose-password check redacted the
|
|
36
|
+
version in "PW 1.48" (short for Playwright); a bare Playwright version after "PW" is now left alone, and short
|
|
37
|
+
passwords after "PW" are still redacted. The manual and README say "most passwords" named in a sentence.
|
|
38
|
+
|
|
3
39
|
## 0.3.52 — 2026-11-09
|
|
4
40
|
|
|
5
41
|
**Counterparts now runs on Windows (new: tell us how it goes), and a password said in a sentence is no longer kept.** It also brings memory that fades on purpose as it grows: old per-turn records roll up, older release notes give way to newer ones, finished things stop being overdue, and the night closes items itself. What you'll notice: the morning's "Last night" can say in one line which open items the night closed; doctor has new Growth lines saying what is filling up and whether it leaves as fast, and a Recall steps line saying where recall's time goes; fewer overdue and still-open items at wake. One thing goes for good: the per-turn recall records (`recall.decision`, `recall.credit`, `recall.rated`) are now kept 30 lived days instead of 90, and on the first night after updating, the ones older than that are rolled up into one summary row per day (counts, the memories credited, the sessions) and deleted. If you want them, copy your store before updating. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.50 needs no store restore: `counterparts disconnect`, 0.3.50's install, then `counterparts connect` (the rows already rolled up stay gone).
|
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART.md).
|
|
|
71
71
|
first, the next time Counterparts runs. It is never in a backup.
|
|
72
72
|
- What's stripped before anything is kept, in the memories and in that conversation text:
|
|
73
73
|
credentials in recognisable shapes (API keys, tokens, private keys, passwords in URLs, a
|
|
74
|
-
value after a name like `password=` or `api_key:`), and passwords named in a sentence
|
|
74
|
+
value after a name like `password=` or `api_key:`), and most passwords named in a sentence
|
|
75
75
|
("my wifi password is …", "the PIN is …"): the value goes, the sentence stays. Not every
|
|
76
76
|
secret has a shape, so don't paste things you wouldn't want kept.
|
|
77
77
|
- It doesn't read or change your CLAUDE.md files or Claude Code's own auto memory
|
package/docs/manual.md
CHANGED
|
@@ -13,7 +13,7 @@ A memory for an AI, in its own words, not a transcript: it writes with `remember
|
|
|
13
13
|
- Each session opens with a wake: who I am (the self page), where the work stands, what's coming up and still open, how yesterday went.
|
|
14
14
|
- In Claude Code, related memories come up as footnotes as the conversation goes. `recall` is the deliberate look, everywhere.
|
|
15
15
|
- It's theirs to see, export and delete. [local] It is one SQLite file on their computer, and Counterparts sends nothing about them anywhere (the details are on counterparts.ai/privacy). [hosted] It lives on Counterparts' server, one store per account; backups that leave the server are encrypted with a key for their account.
|
|
16
|
-
- What's stripped before anything is kept, in memories and in the raw conversation text: credentials in recognisable shapes (keys, tokens, private keys, passwords in URLs, a value written after a name like password= or api_key:), and passwords named in a sentence ("my wifi password is …", "the PIN is …"), the value only. Not every secret has a shape: don't paste things you wouldn't want kept.
|
|
16
|
+
- What's stripped before anything is kept, in memories and in the raw conversation text: credentials in recognisable shapes (keys, tokens, private keys, passwords in URLs, a value written after a name like password= or api_key:), and most passwords named in a sentence ("my wifi password is …", "the PIN is …"), the value only. Not every secret has a shape: don't paste things you wouldn't want kept.
|
|
17
17
|
- A new memory may start with a few starter notes, titled "Told: …". They were given, not lived: they start weak, come after lived memories that match as well, are never part of the self, and can be corrected or let go like any memory.
|
|
18
18
|
|
|
19
19
|
## Everyday phrases
|
package/docs/module-map.md
CHANGED
|
@@ -29,6 +29,7 @@ code and the `NOTES.md` / `INTERFACE-GAPS.md` next to it.*
|
|
|
29
29
|
| *(`reconsolidation.ts`)* | reconsolidation + interference | Two memories that disagree: flagged (a dream, today), noticed at write time (the nearest few live memories come back with a stored one), and SETTLED — `changed` (both true at their time: one strength cut, labelled earlier), `corrected` (archived, readable by id), or `open` (both kept, shown together) — by a new memory's `updates` + `how`, a `remember` settle, a dream or reflection with a plain reason, or the owner's `counterparts settle`. Every settle is on a trail (who, how, why, when) and can be undone. A file beside `revision.ts`, whose ordinary-memory arm it is; its tables are the store's (schema v10), its labels recall's (`recall/standing.ts`). **Added 2026-09-29** as `contradictions.ts`; **renamed 2026-10-11** (Group 2: noticing and updating are one process; the tables keep their names). |
|
|
30
30
|
| *(`interference.ts`)* | interference (retroactive, for routine work) | A newer routine work event fades the older one on the same subject: each night (the cycle's `interfere` phase) an unsalient, never-used `about: work` status note naming a version in its headline is settled `changed` (×0.5) under the nearest later state in the same folder, through `reconsolidation.ts#supersede` (source `interference`, reason `superseded-by-newer`). Nothing the owner said, nothing felt, nothing open. Counted beside the prune on the `sleep.cycle` row. **Added 2026-11-07** (FD1 step 3). |
|
|
31
31
|
| *(`close-hint.ts`)* | — (a write's hint, not a mechanism) | When a stored `remember` or `session_end` entry says something was done, the open items from any folder whose subject it matches (the same version series, the same PR, or what their `settlesWhen` names) are listed in its result, at most three, for the writing model to close or leave. Nothing closes here. Counted as `open.close-hint.shown` / `open.close-hint.closed`. **Added 2026-11-07** (SO1 step 1b). |
|
|
32
|
+
| *(`owner-waits.ts`)* | — (the wake's backoff for what waits on the owner) | An open memory marked `asked`, or a handoff WK3 sank, is said at most once per wake as "Waiting on <owner>, ask when it fits", the most relevant to the folder's week first, in an attended session, and after the recall block on a person's turn that touches it; each raise is latched once per item per lived day, then it waits 3/7/14 lived days (at session start at least a week) and parks, still listed under `recall "still open"`. Meta `wake.owner.raised`, event `open.owner.raised`. **Added 2026-11-09** (SO1 step 4). |
|
|
32
33
|
| *(`open-close.ts`)* | — (closing what is done) | The night closes an open item a later release shows done: each night (the cycle's `close` phase) an open release step ("0.3.46 ready") in a folder closes when a later memory there says a higher patch of the series was released — `closeThread`'s write with `threadClosedBy` and a `thread.night.closed` row. Never a question to the owner, a check, or one the owner reopened. What might be done is listed `mayBeDone` under `recall "still open"`; the reflect tool's `reopen` puts one back. **Added 2026-11-07** (SO1 step 1). |
|
|
33
34
|
| *(`time.ts`)* | — (a clock, not a memory) | The one module that converts: a moment (UTC ms from `store.now()`) to a person's local date or clock line, "today" in a zone, and calendar dates as said (day, month, year, range). A file, not a module; a test keeps hand-built dates out of `src/`. **Added 2026-09-25 (`docs/time.md`).** |
|
|
34
35
|
| *(`feelings-wheel.ts`)* | — (a vocabulary) | The feelings wheel as a typed list: seven cores (happy, warm, calm, curious, sad, uneasy, angry), the groups and their words, default valence and intensity on every entry, blends, aliases, and the rule that re-filed the first wheel's feelings (v11). Read by `store/` to validate the `feelings` table. **Added 2026-09-25; v2 2026-09-30.** |
|
package/package.json
CHANGED
|
@@ -339,6 +339,9 @@ export function writeUpPointer(input: {
|
|
|
339
339
|
|
|
340
340
|
const EVENT_RING = 500;
|
|
341
341
|
|
|
342
|
+
/** A session id the wake's head may carry as `session=…` (WK3): a host's id, no space, `>` or `-->` in it. */
|
|
343
|
+
const SESSION_FIELD = /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/;
|
|
344
|
+
|
|
342
345
|
/**
|
|
343
346
|
* Where the per-reason spawn refusal counters live: box 2's meta, under
|
|
344
347
|
* `adapter.spawn.refusals.<reason>`.
|
|
@@ -601,7 +604,12 @@ export class Lifecycle implements HostLifecycle {
|
|
|
601
604
|
): ReturnType<Counterpart["wake"]> & { readonly tags?: readonly string[]; readonly tagged?: boolean } {
|
|
602
605
|
const dir = this.counterpart.store.dir;
|
|
603
606
|
const asked = tags?.();
|
|
604
|
-
|
|
607
|
+
// THE WAKE NAMES ITS SESSION (WK3, 2026-11-09): `reflect` (phase `close`,
|
|
608
|
+
// `told`, …) asks for the session id, and a model had to dig it out of a
|
|
609
|
+
// scratchpad path. A head field (`session=…`), so it costs a few bytes and
|
|
610
|
+
// no line, and rides every road that keeps the head tag.
|
|
611
|
+
const own = input.nightRun === true || !SESSION_FIELD.test(input.sessionId) ? [] : [`session=${input.sessionId}`];
|
|
612
|
+
const fields = [...(asked === undefined || !ONE_TAG ? [] : markerFields(asked)), ...own];
|
|
605
613
|
const composed = this.counterpart.wake(
|
|
606
614
|
budget,
|
|
607
615
|
{ ...(input.at === undefined ? {} : { date: input.at }) },
|
|
@@ -1285,6 +1293,9 @@ export class Lifecycle implements HostLifecycle {
|
|
|
1285
1293
|
// What a named id may not carry across (FI1, 2026-10-30): the folder
|
|
1286
1294
|
// setting, read only on a turn with one to ask about.
|
|
1287
1295
|
...(config === undefined || config.length === 0 ? {} : { foldersOn: () => foldersOn(scopesPath(config)) }),
|
|
1296
|
+
// SO1 step 4's relevance lane: only a turn a person started may raise what
|
|
1297
|
+
// waits on them; the folder setting as the wake reads it.
|
|
1298
|
+
...(opts.startedBy === "person" && input.nightRun !== true ? { attended: true, exportsFrom: this.chapterExports() } : {}),
|
|
1288
1299
|
},
|
|
1289
1300
|
);
|
|
1290
1301
|
const decision = result.decision;
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
} from "../../core/self/index.js";
|
|
17
17
|
import type { TraceInput } from "../../core/self/page.js";
|
|
18
18
|
import type { PageWriterMode, PageWriterRun } from "../../core/self/index.js";
|
|
19
|
+
import { namedSetDowns } from "../../core/self/index.js";
|
|
20
|
+
import { setDownNote } from "../../core/self/set-down.js";
|
|
19
21
|
import type { ToolResult } from "./server-options.js";
|
|
20
22
|
import { DREAMING_OFF_REFUSAL, dreamHow, dreamLaunchHowFor, PAGE_REFUSAL_DETAIL, pageLaneAnswer, pageRoomAnswer, reflectLaunchHowFor, settingSaidFor } from "./server-words.js";
|
|
21
23
|
import type { McpServer } from "./server.js";
|
|
@@ -393,7 +395,7 @@ export function reflectTool(server: McpServer, sent: Record<string, unknown>): T
|
|
|
393
395
|
// …and the answer names them short, as the reflection knows them (review of #602).
|
|
394
396
|
const asShort = <T>(v: T): T => (aliases === null ? v : (JSON.parse(aliases.inText(JSON.stringify(v))) as T));
|
|
395
397
|
const ids = (v: unknown): string[] => (Array.isArray(v) ? v.filter((x): x is string => typeof x === "string") : []);
|
|
396
|
-
const part = (v: unknown): { text?: string; cites?: string[]; short?: string; claims?: { text: string; cites: string[] }[] } | null => {
|
|
398
|
+
const part = (v: unknown): { text?: string; cites?: string[]; short?: string; claims?: { text: string; cites: string[] }[]; setDown?: { line: string; why: string; skill?: string }[] } | null => {
|
|
397
399
|
if (v === null || typeof v !== "object" || Array.isArray(v)) return null;
|
|
398
400
|
const r = v as Record<string, unknown>;
|
|
399
401
|
return {
|
|
@@ -411,6 +413,8 @@ export function reflectTool(server: McpServer, sent: Record<string, unknown>): T
|
|
|
411
413
|
}),
|
|
412
414
|
}
|
|
413
415
|
: {}),
|
|
416
|
+
// What the page sets down (PG1, 2026-11-09); the share has none.
|
|
417
|
+
...(Array.isArray(r["setDown"]) ? { setDown: namedSetDowns(r["setDown"]) } : {}),
|
|
414
418
|
};
|
|
415
419
|
};
|
|
416
420
|
try {
|
|
@@ -798,7 +802,14 @@ export function selfPageTool(server: McpServer, args: Record<string, unknown>):
|
|
|
798
802
|
// added to the page as it stands, as a revision of the same text.
|
|
799
803
|
const written =
|
|
800
804
|
typeof body === "string"
|
|
801
|
-
? server.counterpart.revisePage(body, {
|
|
805
|
+
? server.counterpart.revisePage(body, {
|
|
806
|
+
...common,
|
|
807
|
+
reason: said ?? "amended",
|
|
808
|
+
...(short === undefined ? {} : { short }),
|
|
809
|
+
...(cited.trace === null ? {} : { trace: cited.trace }),
|
|
810
|
+
// WHAT IT SETS DOWN (PG1): read by the core at the nightly doors only.
|
|
811
|
+
...(Array.isArray(args["setDown"]) ? { setDown: namedSetDowns(args["setDown"]) } : {}),
|
|
812
|
+
})
|
|
802
813
|
: server.counterpart.addPageShort(short ?? "", { ...common, ...(said === null ? {} : { reason: said }) });
|
|
803
814
|
server["emit"]("mcp.self_page", written.id ?? undefined, {
|
|
804
815
|
stored: written.written,
|
|
@@ -920,6 +931,8 @@ export function selfPageTool(server: McpServer, args: Record<string, unknown>):
|
|
|
920
931
|
// the ids that name no memory here.
|
|
921
932
|
...(written.traced === undefined ? {} : { traced: written.traced }),
|
|
922
933
|
...(cited.refused.length === 0 ? {} : { refusedCites: cited.refused }),
|
|
934
|
+
// WHAT IT SET DOWN, SAID (PG1, 2026-11-09).
|
|
935
|
+
...(setDownNote(written.setDown) === null ? {} : { setDown: setDownNote(written.setDown) }),
|
|
923
936
|
...toldAnswer,
|
|
924
937
|
// WHEN IT WILL BE READ, precisely. The bundle every session wakes with
|
|
925
938
|
// is composed by a worker and served unchanged until the next render,
|
|
@@ -21,7 +21,7 @@ export const SERVER_NAME = "counterparts";
|
|
|
21
21
|
* host decides whether to trust what follows. Read from a constant rather than
|
|
22
22
|
* from disk so the server opens no file to answer its first message.
|
|
23
23
|
*/
|
|
24
|
-
export const SERVER_VERSION = "0.3.
|
|
24
|
+
export const SERVER_VERSION = "0.3.53";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* THE ONE LINE EVERY TOOL ANSWERS WITH when the store on disk is a schema AHEAD
|
|
@@ -209,7 +209,7 @@ export const PAGE_REFUSAL_DETAIL: Record<string, string> = {
|
|
|
209
209
|
"too-large":
|
|
210
210
|
"That page is past the write ceiling (`limit` bytes, UTF-8; `bytes` is what was sent, `over` how much to take out) — a sanity bound far past the page's room. It was refused rather than cut: what gets cut at write time is the only copy. Say the same thing shorter — tighten, merge or drop what no longer holds — and send the whole page again.",
|
|
211
211
|
"past-room":
|
|
212
|
-
"That page is past its room (`room` bytes, UTF-8; `bytes` is what was sent, `over` how much to take out), so tonight's first send was not written. Cut it and send the whole page again — cut, don't add a short version: keep it thin. Sent again still past the room, it is kept; not sent again, it is kept when the run ends.",
|
|
212
|
+
"That page is past its room (`room` bytes, UTF-8; `bytes` is what was sent, `over` how much to take out), so tonight's first send was not written. Cut it and send the whole page again (with `setDown` again, when you sent one) — cut, don't add a short version: keep it thin. Sent again still past the room, it is kept; not sent again, it is kept when the run ends.",
|
|
213
213
|
"short-not-needed":
|
|
214
214
|
"The page is within its room, so the wake shows it whole and a short version would never be read. Nothing was written.",
|
|
215
215
|
"short-refused":
|
|
@@ -257,6 +257,9 @@ import type { PageWriterMode } from "../../core/self/index.js";
|
|
|
257
257
|
import { canonicalToolName, toolDefinitions, toolSpec } from "./tools.js";
|
|
258
258
|
import { MANUAL_HANDLE, MANUAL_PATH, findSection, installedManual, manualAsk, manualIndexText } from "./manual.js";
|
|
259
259
|
import { DELETED_HANDLE, heldList, heldWakeLine, holdForRemoval, releaseHold, removalRefusal } from "../../core/removal-hold.js";
|
|
260
|
+
import { SET_DOWN_HANDLE, lineOnPage, preparePage, readSetDowns } from "../../core/self/set-down.js";
|
|
261
|
+
import { nominateStory } from "../../core/self/stories.js";
|
|
262
|
+
import { SET_DOWN_LIMITS } from "../../core/self/tunables.js";
|
|
260
263
|
import { REMOVAL_HOLD_MS } from "../../core/store/index.js";
|
|
261
264
|
import type { ManualAsk } from "./manual.js";
|
|
262
265
|
import { writeUpDoor } from "./write-up.js";
|
|
@@ -1989,6 +1992,7 @@ export class McpServer {
|
|
|
1989
1992
|
// A BELIEF IN THE MOMENT (lane C3), after the feelings: a vivid one is read off them.
|
|
1990
1993
|
...this.recordBelief(deposit, args["belief"]),
|
|
1991
1994
|
...this.recordTraits(deposit, traits.inputs, model),
|
|
1995
|
+
...this.recordStory(deposit, args["story"]),
|
|
1992
1996
|
...reminderEcho(deposit, dated, this.today()),
|
|
1993
1997
|
...titleEcho(deposit, TITLE_ASKED_NOTE),
|
|
1994
1998
|
...undatedReminderWarning(deposit, dated, args["title"], text),
|
|
@@ -2683,6 +2687,11 @@ export class McpServer {
|
|
|
2683
2687
|
if (typeof handle === "string" && handle.trim().toLowerCase() === DELETED_HANDLE && args["question"] === undefined && args["ids"] === undefined) {
|
|
2684
2688
|
return this.deletedTool();
|
|
2685
2689
|
}
|
|
2690
|
+
// WHAT THE PAGE SET DOWN (PG1, 2026-11-09): the door the wake's "Set down
|
|
2691
|
+
// from my page last night" line names, newest first, with why and date.
|
|
2692
|
+
if (typeof handle === "string" && handle.trim().toLowerCase() === SET_DOWN_HANDLE && args["question"] === undefined && args["ids"] === undefined) {
|
|
2693
|
+
return this.setDownTool();
|
|
2694
|
+
}
|
|
2686
2695
|
// WHAT'S DUE (WK2, 2026-10-30): the door the shaped wake's "Coming up" counts behind.
|
|
2687
2696
|
if (typeof handle === "string" && handle.trim().toLowerCase() === COMING_UP_HANDLE && args["question"] === undefined && args["ids"] === undefined) {
|
|
2688
2697
|
return this.comingUpTool();
|
|
@@ -4144,6 +4153,46 @@ export class McpServer {
|
|
|
4144
4153
|
}, false);
|
|
4145
4154
|
}
|
|
4146
4155
|
|
|
4156
|
+
/**
|
|
4157
|
+
* recall's `set down` handle (PG1, 2026-11-09): the lines the page set
|
|
4158
|
+
* down, newest first — each word for word, with why, the night's date,
|
|
4159
|
+
* whether the writer named it, and whether it is on the page again. They
|
|
4160
|
+
* count as shown, so one quoted or opened afterwards is credited.
|
|
4161
|
+
*/
|
|
4162
|
+
private setDownTool(): ToolResult {
|
|
4163
|
+
const store = this.counterpart.store;
|
|
4164
|
+
const rows = readSetDowns(store, SET_DOWN_LIMITS.LISTED);
|
|
4165
|
+
const page = this.counterpart.self.page()?.body ?? null;
|
|
4166
|
+
const prepared = page === null ? null : preparePage(page);
|
|
4167
|
+
this.markSeen(rows.map((r) => r.id));
|
|
4168
|
+
this.emit("mcp.recall.set_down", undefined, { total: rows.length });
|
|
4169
|
+
return this.result(
|
|
4170
|
+
{
|
|
4171
|
+
path: "handle",
|
|
4172
|
+
reason: "set-down",
|
|
4173
|
+
handle: SET_DOWN_HANDLE,
|
|
4174
|
+
total: rows.length,
|
|
4175
|
+
items: rows.map((r) => ({
|
|
4176
|
+
id: r.id,
|
|
4177
|
+
line: r.line,
|
|
4178
|
+
why: r.why,
|
|
4179
|
+
date: r.date,
|
|
4180
|
+
named: r.named,
|
|
4181
|
+
...(r.section.length === 0 ? {} : { section: r.section }),
|
|
4182
|
+
leftVersion: r.from,
|
|
4183
|
+
...(r.lines === undefined ? {} : { lines: r.lines }),
|
|
4184
|
+
...(r.quiet === true ? { quiet: true } : {}),
|
|
4185
|
+
...(prepared !== null && lineOnPage(r.line, prepared) ? { onPageAgain: true } : {}),
|
|
4186
|
+
})),
|
|
4187
|
+
note:
|
|
4188
|
+
rows.length === 0
|
|
4189
|
+
? "The page has set nothing down yet."
|
|
4190
|
+
: "Lines the nightly page writers took out of the page, newest first: each kept as a memory, word for word. named: false means the writer did not account for it and the engine's diff caught it; quiet means it may only have been reworded (or it holds the lines past one write's cap, in lines), so the wake didn't quote it. One that holds again can go back on the page.",
|
|
4191
|
+
},
|
|
4192
|
+
false,
|
|
4193
|
+
);
|
|
4194
|
+
}
|
|
4195
|
+
|
|
4147
4196
|
/** The doctor's red-only notice (and the search-by-meaning line), from the
|
|
4148
4197
|
* entry point's closure. Never throws. */
|
|
4149
4198
|
private wakeDoctorLine(night: boolean): string | null {
|
|
@@ -4572,6 +4621,18 @@ export class McpServer {
|
|
|
4572
4621
|
}
|
|
4573
4622
|
}
|
|
4574
4623
|
|
|
4624
|
+
/**
|
|
4625
|
+
* A STORY NOMINATION (PS1, 2026-11-09, `self/stories.ts`): `story: true`
|
|
4626
|
+
* tags the memory just written, and the night's writer sees it first. Said
|
|
4627
|
+
* back only when one was asked for; anything but `true` is no nomination.
|
|
4628
|
+
*/
|
|
4629
|
+
private recordStory(deposit: DepositResult, story: unknown): Record<string, unknown> {
|
|
4630
|
+
if (story !== true) return {};
|
|
4631
|
+
if (deposit.memoryId === null) return { story: { nominated: false, reason: "memory-not-stored" } };
|
|
4632
|
+
nominateStory(this.counterpart.store, deposit.memoryId);
|
|
4633
|
+
return { story: { nominated: true, note: "Nominated as a story for your page: the night's writer sees it first and still decides." } };
|
|
4634
|
+
}
|
|
4635
|
+
|
|
4575
4636
|
/**
|
|
4576
4637
|
* The `about` half of a deposit (schema v9): what the memory is about, set
|
|
4577
4638
|
* by the writer who just wrote it (`about_by = 'writer'`). Nothing when none
|
|
@@ -69,6 +69,7 @@ import { RECURRENCES } from "../../core/time.js";
|
|
|
69
69
|
import { PAGE_ROOM_BYTES, STILL_OPEN_HANDLE } from "../../core/self/briefing.js";
|
|
70
70
|
import { MANUAL_HANDLE } from "./manual.js";
|
|
71
71
|
import { DELETED_HANDLE } from "../../core/removal-hold.js";
|
|
72
|
+
import { PAGE_STORY_LIMITS, SET_DOWN_LIMITS } from "../../core/self/tunables.js";
|
|
72
73
|
import { CLAIM_PREFIX_MIN_CHARS } from "../../core/self/page.js";
|
|
73
74
|
import { MEET_STEPS } from "../../core/onboarding.js";
|
|
74
75
|
import { CLAUDE_AI_HOST, DESKTOP_HOST } from "../hosts.js";
|
|
@@ -337,6 +338,22 @@ export const SETTLES_WHEN_PROPERTY = {
|
|
|
337
338
|
'Optional, with unresolved: true: what would settle it, in a short phrase ("the landlord replies", "the team decides pricing"). "Still open" shows it, and the nightly run can close the item once a memory shows it happened. A date goes in eventDate. Revising the item with unresolved: true keeps it unless you send a new one (null drops it).',
|
|
338
339
|
} as const;
|
|
339
340
|
|
|
341
|
+
/**
|
|
342
|
+
* A STORY NOMINATION (PS1, 2026-11-09, `self/stories.ts`): a session marks a
|
|
343
|
+
* memory as a story for the self page; the night's writer sees it first and
|
|
344
|
+
* still decides. Kept as a tag on the memory. `remember` only (a write-up's
|
|
345
|
+
* entries go without: a nomination is a moment's judgment, made live).
|
|
346
|
+
*/
|
|
347
|
+
export const STORY_PROPERTY = {
|
|
348
|
+
type: "boolean",
|
|
349
|
+
description:
|
|
350
|
+
"Optional and rare: true when this moment could be a story for your self page: something that went right, a discovery, a moment between you and the owner, or a correction that changed how you work. The night's writer sees it first and still decides; one not taken fades like any memory.",
|
|
351
|
+
} as const;
|
|
352
|
+
|
|
353
|
+
/** A set-down practice moved to a skill memory (PS1): the field's words, at both nightly page doors. */
|
|
354
|
+
export const SET_DOWN_SKILL_TEXT = `With why "moved to a skill", \`skill\` keeps a practice that is only about the work as a skill memory (at most ${String(PAGE_STORY_LIMITS.SKILL_CHARS)} characters), named on its set-down; recall brings it back when the work calls for it.`;
|
|
355
|
+
const SET_DOWN_SKILL_PROPERTY = { type: "string", description: "Optional: the practice in a line or two, kept as a skill memory." } as const;
|
|
356
|
+
|
|
340
357
|
/**
|
|
341
358
|
* WHAT GOES IN `emotion` AND WHAT IN `carried_by` — said the same way at every
|
|
342
359
|
* door a model writes a feeling through (remember, session_end, a dream's
|
|
@@ -827,6 +844,7 @@ const REMEMBER: ToolSpec = {
|
|
|
827
844
|
about: ABOUT_PROPERTY,
|
|
828
845
|
unresolved: UNRESOLVED_PROPERTY,
|
|
829
846
|
settlesWhen: SETTLES_WHEN_PROPERTY,
|
|
847
|
+
story: STORY_PROPERTY,
|
|
830
848
|
traits: TRAITS_PROPERTY,
|
|
831
849
|
feelingsNow: FEELINGS_NOW_PROPERTY,
|
|
832
850
|
remark: REMARK_PROPERTY,
|
|
@@ -967,7 +985,7 @@ const RECALL: ToolSpec = {
|
|
|
967
985
|
},
|
|
968
986
|
handle: {
|
|
969
987
|
type: "string",
|
|
970
|
-
description: `A memory id or exact title to read whole. Exact: never treated as a search term. Takes no mode. A dream's id (drm_…) or a reflection's (rfl_…) reads that night whole, read-only. Or "last dream" (or "last night"): the newest dream whole — title, journal, what it did — and the reflection after it, read-only. Or "${LAST_EXCHANGE_HANDLE}": the last thing said to another session in this folder (about the last day) and its last reply, read from what was captured, never stored. Or "${STILL_OPEN_HANDLE}": everything the wake's Still open carries, in its order, with ids and how long since each was touched — paged (see page) — and what its Coming up lists or counts, by title and date. Or "handoffs" (or "${HANDOFFS_HERE_HANDLE}"): this folder's live handoffs, newest first, each by first sentence and id, to expand or retire, with what came after the newest. Or "coming up": what's due, by whole title: today, overdue, later, then other folders' the setting lets be named. Or "elsewhere": the other folders the wake's Elsewhere would show with room, in its order, each with its newest title — paged (see page) — and last the folders it only counts. Or "${DELETED_HANDLE}": memories deleted in chat that wait to be erased, to undo one. Or "${MANUAL_HANDLE}": how Counterparts works and how to use it — commands, switches, what to do when something seems off — as a list of sections; "${MANUAL_HANDLE} <section>" opens one. A memory titled exactly like one of these names opens by its id.`,
|
|
988
|
+
description: `A memory id or exact title to read whole. Exact: never treated as a search term. Takes no mode. A dream's id (drm_…) or a reflection's (rfl_…) reads that night whole, read-only. Or "last dream" (or "last night"): the newest dream whole — title, journal, what it did — and the reflection after it, read-only. Or "${LAST_EXCHANGE_HANDLE}": the last thing said to another session in this folder (about the last day) and its last reply, read from what was captured, never stored. Or "${STILL_OPEN_HANDLE}": everything the wake's Still open carries, in its order, with ids and how long since each was touched — paged (see page) — and what its Coming up lists or counts, by title and date. Or "handoffs" (or "${HANDOFFS_HERE_HANDLE}"): this folder's live handoffs, newest first, each by first sentence and id, to expand or retire, with what came after the newest. Or "coming up": what's due, by whole title: today, overdue, later, then other folders' the setting lets be named. Or "elsewhere": the other folders the wake's Elsewhere would show with room, in its order, each with its newest title — paged (see page) — and last the folders it only counts. Or "${DELETED_HANDLE}": memories deleted in chat that wait to be erased, to undo one. Or "set down": the lines the self page set down at night, newest first, each word for word with why and date. Or "${MANUAL_HANDLE}": how Counterparts works and how to use it — commands, switches, what to do when something seems off — as a list of sections; "${MANUAL_HANDLE} <section>" opens one. A memory titled exactly like one of these names opens by its id.`,
|
|
971
989
|
},
|
|
972
990
|
ids: {
|
|
973
991
|
type: "array",
|
|
@@ -1605,6 +1623,17 @@ const SELF_PAGE: ToolSpec = {
|
|
|
1605
1623
|
additionalProperties: false,
|
|
1606
1624
|
},
|
|
1607
1625
|
},
|
|
1626
|
+
setDown: {
|
|
1627
|
+
type: "array",
|
|
1628
|
+
description:
|
|
1629
|
+
`Only day's end's, with \`body\`: every sentence of the page as it stood that this write removes or changes, word for word as it was, with a short why that says which: "reworded", "folded into <the line that carries it now>", or set down ("retired by <newer ruling>", "no longer lived", "room"). Trusted as given. A sentence gone and left out is recorded anyway, as set down unnamed; each set-down line is kept as a memory (recall "set down"). A why is at most ${String(SET_DOWN_LIMITS.WHY_CHARS)} characters. ${SET_DOWN_SKILL_TEXT}`,
|
|
1630
|
+
items: {
|
|
1631
|
+
type: "object",
|
|
1632
|
+
properties: { line: { type: "string" }, why: { type: "string", maxLength: SET_DOWN_LIMITS.WHY_CHARS }, skill: SET_DOWN_SKILL_PROPERTY },
|
|
1633
|
+
required: ["line", "why"],
|
|
1634
|
+
additionalProperties: false,
|
|
1635
|
+
},
|
|
1636
|
+
},
|
|
1608
1637
|
summary: {
|
|
1609
1638
|
type: "string",
|
|
1610
1639
|
description: "Only day's end's, with `session`, as its block asks: a few lines about the day it read, with the page or alone when the page stands. Past its cap it is refused, never cut.",
|
|
@@ -1916,6 +1945,16 @@ const REFLECT: ToolSpec = {
|
|
|
1916
1945
|
properties: { text: { type: "string" }, cites: { type: "array", items: { type: "string" } } },
|
|
1917
1946
|
},
|
|
1918
1947
|
},
|
|
1948
|
+
setDown: {
|
|
1949
|
+
type: "array",
|
|
1950
|
+
description: `Every sentence of the page as it stood that this write removes or changes, word for word as it was, with a short why that says which: "reworded", "folded into <the line that carries it now>", or set down ("retired by …", "no longer lived", "room"). Trusted as given. A sentence gone and left out is recorded anyway, as set down unnamed. A why is at most ${String(SET_DOWN_LIMITS.WHY_CHARS)} characters. ${SET_DOWN_SKILL_TEXT}`,
|
|
1951
|
+
items: {
|
|
1952
|
+
type: "object",
|
|
1953
|
+
properties: { line: { type: "string" }, why: { type: "string", maxLength: SET_DOWN_LIMITS.WHY_CHARS }, skill: SET_DOWN_SKILL_PROPERTY },
|
|
1954
|
+
required: ["line", "why"],
|
|
1955
|
+
additionalProperties: false,
|
|
1956
|
+
},
|
|
1957
|
+
},
|
|
1919
1958
|
},
|
|
1920
1959
|
},
|
|
1921
1960
|
share: {
|
|
@@ -2573,6 +2612,8 @@ export const CLAUDE_AI_TRIM: Readonly<Partial<Record<ToolName, ClaudeAiTrim>>> =
|
|
|
2573
2612
|
"settle.why": null,
|
|
2574
2613
|
belief:
|
|
2575
2614
|
"Rare: one short claim about me or us that this memory plainly shows (the owner's words, my real choice, or a strongly felt moment). Most memories carry none.",
|
|
2615
|
+
// PS1: said shorter; the base's "the night's writer sees it first and still decides" is kept in substance.
|
|
2616
|
+
story: "Optional and rare: true when this could be a story for your self page (what went right, a discovery, a moment with the owner, a correction that changed you). The night sees it first and decides.",
|
|
2576
2617
|
traits: CLAUDE_AI_TRAITS_TEXT,
|
|
2577
2618
|
...under("traits", TRAIT_ITEM_UNDESCRIBED),
|
|
2578
2619
|
feelingsNow:
|
|
@@ -2598,7 +2639,7 @@ export const CLAUDE_AI_TRIM: Readonly<Partial<Record<ToolName, ClaudeAiTrim>>> =
|
|
|
2598
2639
|
question: (was) =>
|
|
2599
2640
|
`${was} In a question about feeling, "I" and "me" mean you, the counterpart, and "you" means the owner: to ask about the owner's feelings, say "the owner" or their name.`,
|
|
2600
2641
|
page: `With a question, or the handle "${STILL_OPEN_HANDLE}": which page of the answer (1 is the first). The answer says how many there are.`,
|
|
2601
|
-
handle: `A memory id or exact title, read whole (never a search; takes no mode). Also: a dream's id (drm_…) or a reflection's (rfl_…); "last dream" (or "last night"): the newest dream and the reflection after it; "${STILL_OPEN_HANDLE}": everything the wake's Still open carries, paged (see page); "coming up": what's due; "handoffs": the live handoffs, to expand or retire; "${DELETED_HANDLE}": memories deleted in chat that wait to be erased, to undo one; "${MANUAL_HANDLE}": how Counterparts works, as sections — "${MANUAL_HANDLE} <section>" opens one.`,
|
|
2642
|
+
handle: `A memory id or exact title, read whole (never a search; takes no mode). Also: a dream's id (drm_…) or a reflection's (rfl_…); "last dream" (or "last night"): the newest dream and the reflection after it; "${STILL_OPEN_HANDLE}": everything the wake's Still open carries, paged (see page); "coming up": what's due; "handoffs": the live handoffs, to expand or retire; "${DELETED_HANDLE}": memories deleted in chat that wait to be erased, to undo one; "set down": the lines the self page set down, with why and date; "${MANUAL_HANDLE}": how Counterparts works, as sections — "${MANUAL_HANDLE} <section>" opens one.`,
|
|
2602
2643
|
},
|
|
2603
2644
|
},
|
|
2604
2645
|
session_end: {
|