@duetso/agent 0.1.139 → 0.1.140
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/package.json +1 -1
- package/dist/src/cli/help.d.ts.map +1 -1
- package/dist/src/cli/help.js +20 -7
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/cli/memory-reflect.d.ts.map +1 -1
- package/dist/src/cli/memory-reflect.js +3 -2
- package/dist/src/cli/memory-reflect.js.map +1 -1
- package/dist/src/memory/observation-groups.d.ts +11 -1
- package/dist/src/memory/observation-groups.d.ts.map +1 -1
- package/dist/src/memory/observation-groups.js +15 -5
- package/dist/src/memory/observation-groups.js.map +1 -1
- package/dist/src/memory/observational-prompts.d.ts +21 -2
- package/dist/src/memory/observational-prompts.d.ts.map +1 -1
- package/dist/src/memory/observational-prompts.js +89 -12
- package/dist/src/memory/observational-prompts.js.map +1 -1
- package/dist/src/memory/observational.d.ts +36 -6
- package/dist/src/memory/observational.d.ts.map +1 -1
- package/dist/src/memory/observational.js +118 -53
- package/dist/src/memory/observational.js.map +1 -1
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +19 -0
- package/dist/src/tui/app.js.map +1 -1
- package/dist/src/tui/dino/index.d.ts +31 -0
- package/dist/src/tui/dino/index.d.ts.map +1 -0
- package/dist/src/tui/dino/index.js +313 -0
- package/dist/src/tui/dino/index.js.map +1 -0
- package/dist/src/tui/dino/input.d.ts +12 -0
- package/dist/src/tui/dino/input.d.ts.map +1 -0
- package/dist/src/tui/dino/input.js +44 -0
- package/dist/src/tui/dino/input.js.map +1 -0
- package/dist/src/tui/dino/persistence.d.ts +3 -0
- package/dist/src/tui/dino/persistence.d.ts.map +1 -0
- package/dist/src/tui/dino/persistence.js +36 -0
- package/dist/src/tui/dino/persistence.js.map +1 -0
- package/dist/src/tui/dino/render.d.ts +19 -0
- package/dist/src/tui/dino/render.d.ts.map +1 -0
- package/dist/src/tui/dino/render.js +164 -0
- package/dist/src/tui/dino/render.js.map +1 -0
- package/dist/src/tui/dino/state.d.ts +141 -0
- package/dist/src/tui/dino/state.d.ts.map +1 -0
- package/dist/src/tui/dino/state.js +156 -0
- package/dist/src/tui/dino/state.js.map +1 -0
- package/dist/src/tui/dino/tick.d.ts +10 -0
- package/dist/src/tui/dino/tick.d.ts.map +1 -0
- package/dist/src/tui/dino/tick.js +117 -0
- package/dist/src/tui/dino/tick.js.map +1 -0
- package/dist/src/tui/dino/visibility.d.ts +2 -0
- package/dist/src/tui/dino/visibility.d.ts.map +1 -0
- package/dist/src/tui/dino/visibility.js +18 -0
- package/dist/src/tui/dino/visibility.js.map +1 -0
- package/dist/src/tui/key-handlers.d.ts +7 -0
- package/dist/src/tui/key-handlers.d.ts.map +1 -1
- package/dist/src/tui/key-handlers.js +25 -1
- package/dist/src/tui/key-handlers.js.map +1 -1
- package/dist/src/tui/layout.d.ts +7 -0
- package/dist/src/tui/layout.d.ts.map +1 -1
- package/dist/src/tui/layout.js +10 -0
- package/dist/src/tui/layout.js.map +1 -1
- package/dist/src/tui/status-controller.d.ts +9 -0
- package/dist/src/tui/status-controller.d.ts.map +1 -1
- package/dist/src/tui/status-controller.js +28 -0
- package/dist/src/tui/status-controller.js.map +1 -1
- package/dist/src/turn-runner/tools.js +17 -21
- package/dist/src/turn-runner/tools.js.map +1 -1
- package/dist/src/turn-runner/turn-runner.d.ts.map +1 -1
- package/dist/src/turn-runner/turn-runner.js +1 -0
- package/dist/src/turn-runner/turn-runner.js.map +1 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/cli/help.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAoFtD;AAED,wBAAgB,cAAc,IAAI,IAAI,CA0BrC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAsBnC;AAED,wBAAgB,eAAe,IAAI,IAAI,CAqBtC;AAED,wBAAgB,eAAe,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/cli/help.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAoFtD;AAED,wBAAgB,cAAc,IAAI,IAAI,CA0BrC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAsBnC;AAED,wBAAgB,eAAe,IAAI,IAAI,CAqBtC;AAED,wBAAgB,eAAe,IAAI,IAAI,CA2BtC;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAuC7C;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAiB5C;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAa1D"}
|
package/dist/src/cli/help.js
CHANGED
|
@@ -169,10 +169,15 @@ duet memory — Browse, edit, and delete observational memories
|
|
|
169
169
|
|
|
170
170
|
USAGE
|
|
171
171
|
duet memory [--db <path>] [--wait <seconds>]
|
|
172
|
+
duet memory reflect [options]
|
|
172
173
|
|
|
173
174
|
ALIASES
|
|
174
175
|
duet memories
|
|
175
176
|
|
|
177
|
+
SUBCOMMANDS
|
|
178
|
+
reflect Condense old global observations into reflection rows
|
|
179
|
+
(run \`duet memory reflect --help\` for reflect-specific options)
|
|
180
|
+
|
|
176
181
|
OPTIONS
|
|
177
182
|
--db <path> Memory database path (default: ~/.duet/memory.db)
|
|
178
183
|
--wait <seconds> Seconds to wait for the cross-process open-lock when a peer
|
|
@@ -196,13 +201,21 @@ USAGE
|
|
|
196
201
|
[--effective-context <tokens>] [--wait <seconds>]
|
|
197
202
|
|
|
198
203
|
DESCRIPTION
|
|
199
|
-
Walks the durable memory store and folds
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
Walks the durable memory store and folds older content into atomic
|
|
205
|
+
global reflection rows that downstream recall can rank, decay, and
|
|
206
|
+
refresh independently.
|
|
207
|
+
|
|
208
|
+
Eligible input includes raw observations AND single-blob local
|
|
209
|
+
reflections (the per-session reflections written automatically when a
|
|
210
|
+
session crosses its local memory budget). Global reflection rows from
|
|
211
|
+
prior \`duet memory reflect\` runs are preserved verbatim — re-reflecting
|
|
212
|
+
them would only collapse them into vaguer text. Fresh rows younger
|
|
213
|
+
than --min-age-days (default 3) are also preserved so resumed sessions
|
|
214
|
+
keep their recent local memory intact.
|
|
215
|
+
|
|
216
|
+
Batches are packed up to one reflection trigger's worth of tokens and
|
|
217
|
+
sequenced chronologically across sessions for cross-session dedup. Use
|
|
218
|
+
--dry-run to preview without writing.
|
|
206
219
|
|
|
207
220
|
OPTIONS
|
|
208
221
|
--db <path> Memory database path (default: ~/.duet/memory.db)
|
package/dist/src/cli/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;gDAmBkC,WAAW;;;;;;;;;;;;;gHAaqD,+BAA+B;;;;;oFAK3D,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CxG,CAAC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;wEAW0D,qBAAqB;;;;;;;;;;;;;CAa5F,CAAC,CAAC;AACH,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AC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBb,CAAC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCb,CAAC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;CAeb,CAAC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,OAAO,CAAC,GAAG,CAAC;oCACsB,WAAW;;;;;;;;;;CAU9C,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-reflect.d.ts","sourceRoot":"","sources":["../../../src/cli/memory-reflect.ts"],"names":[],"mappings":"AA0BA,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,GAAE,gBAAqE,GACxE,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"memory-reflect.d.ts","sourceRoot":"","sources":["../../../src/cli/memory-reflect.ts"],"names":[],"mappings":"AA0BA,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,GAAE,gBAAqE,GACxE,OAAO,CAAC,IAAI,CAAC,CA0Ff"}
|
|
@@ -58,12 +58,13 @@ export async function runMemoryReflectCommand(args, io = { stdout: process.stdou
|
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
if (result.reflections.length === 0) {
|
|
61
|
-
io.stdout.write(`\nNothing eligible: ${result.preserved.length}
|
|
61
|
+
io.stdout.write(`\nNothing eligible: ${result.preserved.length} row(s) preserved (too fresh or already a global reflection).\n`);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
for (let index = 0; index < result.reflections.length; index++) {
|
|
65
65
|
const reflection = result.reflections[index];
|
|
66
|
-
|
|
66
|
+
const priorityIcon = reflection.priority === "high" ? "🔴" : reflection.priority === "medium" ? "🟡" : "🟢";
|
|
67
|
+
io.stdout.write(`\n--- Reflected row ${index + 1}/${result.reflections.length} ${priorityIcon} ${reflection.priority} · observed ${reflection.observedDate} ---\n`);
|
|
67
68
|
io.stdout.write(`${reflection.content.trim()}\n`);
|
|
68
69
|
io.stdout.write("--- end ---\n");
|
|
69
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-reflect.js","sourceRoot":"","sources":["../../../src/cli/memory-reflect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,mCAAmC,EACnC,sBAAsB,EACtB,kCAAkC,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAiBxD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB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AI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;oBAC7C,IAAI,CAAC,yBAAyB,GAAG,4CAA4C,CAAC,CAAC;gBACjF,CAAC;gBACD,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;gBAC1C,MAAM;YACR,CAAC;YACD,KAAK,gBAAgB,CAAC,CAAC,CAAC;gBACtB,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBACtB,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjC,IAAI,CAAC,iCAAiC,GAAG,iCAAiC,CAAC,CAAC;gBAC9E,CAAC;gBACD,UAAU,GAAG,CAAC,CAAC;gBACf,MAAM;YACR,CAAC;YACD,KAAK,QAAQ,CAAC;YACd,KAAK,IAAI;gBACP,sBAAsB,EAAE,CAAC;gBACzB,OAAO,SAAS,CAAC;YACnB;gBACE,IAAI,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM;QACN,MAAM;QACN,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,KAAK;QACL,gBAAgB;QAChB,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -3,9 +3,19 @@ export interface ObservationGroup {
|
|
|
3
3
|
range: string;
|
|
4
4
|
content: string;
|
|
5
5
|
kind?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Working directory the observation was captured in, when known.
|
|
8
|
+
* Carried as an attribute on the `<observation-group>` wrapper so
|
|
9
|
+
* the reflector and any downstream reader can see which project
|
|
10
|
+
* a row belongs to without relying on the model to embed it in
|
|
11
|
+
* the content prose. Optional only because rows that predate cwd
|
|
12
|
+
* tracking carry no value — new writes always set it when the
|
|
13
|
+
* caller has a cwd.
|
|
14
|
+
*/
|
|
15
|
+
cwd?: string;
|
|
6
16
|
}
|
|
7
17
|
export declare function generateAnchorId(): string;
|
|
8
|
-
export declare function wrapInObservationGroup(observations: string, range: string, id?: string,
|
|
18
|
+
export declare function wrapInObservationGroup(observations: string, range: string, id?: string, kind?: string, cwd?: string): string;
|
|
9
19
|
export declare function parseObservationGroups(observations: string): ObservationGroup[];
|
|
10
20
|
export declare function stripObservationGroups(observations: string): string;
|
|
11
21
|
export declare function combineObservationGroupRanges(groups: ObservationGroup[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation-groups.d.ts","sourceRoot":"","sources":["../../../src/memory/observation-groups.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"observation-groups.d.ts","sourceRoot":"","sources":["../../../src/memory/observation-groups.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAoDD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,EAAE,SAAqB,EACvB,IAAI,CAAC,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CAKR;AAMD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA2B/E;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CASnE;AASD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAgBhF;AAED,wBAAgB,oCAAoC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBxF;AAOD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EAAE,GACzB,gBAAgB,EAAE,CAkCpB;AAED,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,MAAM,EACf,kBAAkB,EAAE,MAAM,GACzB,MAAM,GAAG,IAAI,CAgCf"}
|
|
@@ -37,10 +37,14 @@ function stripReflectionGroupMetadata(body) {
|
|
|
37
37
|
export function generateAnchorId() {
|
|
38
38
|
return randomBytes(8).toString("hex");
|
|
39
39
|
}
|
|
40
|
-
export function wrapInObservationGroup(observations, range, id = generateAnchorId(),
|
|
40
|
+
export function wrapInObservationGroup(observations, range, id = generateAnchorId(), kind, cwd) {
|
|
41
41
|
const content = observations.trim();
|
|
42
42
|
const kindAttr = kind ? ` kind="${kind}"` : "";
|
|
43
|
-
|
|
43
|
+
const cwdAttr = cwd ? ` cwd="${escapeAttribute(cwd)}"` : "";
|
|
44
|
+
return `<observation-group id="${id}" range="${range}"${kindAttr}${cwdAttr}>\n${content}\n</observation-group>`;
|
|
45
|
+
}
|
|
46
|
+
function escapeAttribute(value) {
|
|
47
|
+
return value.replace(/"/g, """);
|
|
44
48
|
}
|
|
45
49
|
export function parseObservationGroups(observations) {
|
|
46
50
|
if (!observations) {
|
|
@@ -58,7 +62,8 @@ export function parseObservationGroups(observations) {
|
|
|
58
62
|
groups.push({
|
|
59
63
|
id,
|
|
60
64
|
range,
|
|
61
|
-
kind: attributes["kind"],
|
|
65
|
+
...(attributes["kind"] ? { kind: attributes["kind"] } : {}),
|
|
66
|
+
...(attributes["cwd"] ? { cwd: attributes["cwd"] } : {}),
|
|
62
67
|
content: match[2].trim(),
|
|
63
68
|
});
|
|
64
69
|
}
|
|
@@ -151,9 +156,14 @@ export function reconcileObservationGroupsFromReflection(content, sourceObservat
|
|
|
151
156
|
const derivedGroups = deriveObservationGroupProvenance(normalizedContent, sourceGroups);
|
|
152
157
|
if (derivedGroups.length > 0) {
|
|
153
158
|
return derivedGroups
|
|
154
|
-
.map((group) => wrapInObservationGroup(group.content, group.range, group.id,
|
|
159
|
+
.map((group) => wrapInObservationGroup(group.content, group.range, group.id, group.kind, group.cwd))
|
|
155
160
|
.join("\n\n");
|
|
156
161
|
}
|
|
157
|
-
|
|
162
|
+
// Reconciled reflection inherits the cwd when every source group
|
|
163
|
+
// agrees; mixed-cwd inputs leave the attribute off because no single
|
|
164
|
+
// value is correct for the joined row.
|
|
165
|
+
const sourceCwds = new Set(sourceGroups.map((group) => group.cwd).filter(Boolean));
|
|
166
|
+
const inheritedCwd = sourceCwds.size === 1 ? sourceGroups[0]?.cwd : undefined;
|
|
167
|
+
return wrapInObservationGroup(normalizedContent, combineObservationGroupRanges(sourceGroups), generateAnchorId(), "reflection", inheritedCwd);
|
|
158
168
|
}
|
|
159
169
|
//# sourceMappingURL=observation-groups.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation-groups.js","sourceRoot":"","sources":["../../../src/memory/observation-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"observation-groups.js","sourceRoot":"","sources":["../../../src/memory/observation-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAwB1C,MAAM,yBAAyB,GAAG,4DAA4D,CAAC;AAC/F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,CAAC;IACzC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,aAAa,GAAG,gCAAgC,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;IACxF,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,aAAa;aACjB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACb,sBAAsB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CACpF;aACA,IAAI,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,iEAAiE;IACjE,qEAAqE;IACrE,uCAAuC;IACvC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACnF,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,OAAO,sBAAsB,CAC3B,iBAAiB,EACjB,6BAA6B,CAAC,YAAY,CAAC,EAC3C,gBAAgB,EAAE,EAClB,YAAY,EACZ,YAAY,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -19,12 +19,31 @@ export declare const LOCAL_OBSERVATIONS_HINT = "This is a compacted summary of e
|
|
|
19
19
|
export declare const OBSERVATION_CONTEXT_INSTRUCTIONS: string;
|
|
20
20
|
export declare const OBSERVER_GUIDELINES: string;
|
|
21
21
|
export declare function buildObserverOutputFormat(includeThreadTitle?: boolean): string;
|
|
22
|
-
export
|
|
22
|
+
export interface ObserverPromptContext {
|
|
23
|
+
/**
|
|
24
|
+
* Working directory the runner is executing in. Surfaced verbatim
|
|
25
|
+
* to the observer so project-specific observations carry enough
|
|
26
|
+
* cwd / project signal to stay meaningful when read back later
|
|
27
|
+
* — especially across repos or after the user switches projects.
|
|
28
|
+
*/
|
|
29
|
+
cwd?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function buildObserverSystemPrompt(instruction?: string, includeThreadTitle?: boolean, context?: ObserverPromptContext): string;
|
|
23
32
|
export declare function buildObserverPrompt(messages: RawMemoryMessage[], existingObservations: string, targetTokens: number, retry?: {
|
|
24
33
|
actualTokens: number;
|
|
25
34
|
}, now?: Date): RawMemoryContent;
|
|
26
35
|
export declare function formatMessagesForObserver(messages: RawMemoryMessage[]): RawMemoryContent;
|
|
27
|
-
export
|
|
36
|
+
export interface ReflectorPromptContext {
|
|
37
|
+
/**
|
|
38
|
+
* Working directory of the in-session reflector run. Only set when
|
|
39
|
+
* the rolled-up blob comes from one session in one cwd; the global
|
|
40
|
+
* reflector spans many sessions and many cwds, so it leaves this
|
|
41
|
+
* undefined and instead relies on the cwd attribute already on each
|
|
42
|
+
* source <observation-group>.
|
|
43
|
+
*/
|
|
44
|
+
cwd?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function buildReflectorSystemPrompt(instruction?: string, context?: ReflectorPromptContext): string;
|
|
28
47
|
export declare function buildReflectorPrompt(observations: string, targetTokens: number, retry?: {
|
|
29
48
|
actualTokens: number;
|
|
30
49
|
}): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observational-prompts.d.ts","sourceRoot":"","sources":["../../../src/memory/observational-prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"observational-prompts.d.ts","sourceRoot":"","sources":["../../../src/memory/observational-prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAoBvE,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,CAYxF;AAMD,MAAM,WAAW,sBAAsB;IACrC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,0BAA0B,CACxC,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CA6CR;AAED,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GAC/B,MAAM,CAkBR"}
|
|
@@ -67,6 +67,21 @@ const OBSERVER_EXTRACTION_INSTRUCTIONS = dedent `
|
|
|
67
67
|
- One observation should usually summarize an entire tool exchange, not enumerate every call. Use sub-bullets only when distinct results carry independent signal.
|
|
68
68
|
- If a tool result is truncated, do not invent the missing content. Note "(partial)" if the truncation matters.
|
|
69
69
|
|
|
70
|
+
DECISION TRACES — CAPTURE THE WHY, NOT JUST THE WHAT
|
|
71
|
+
|
|
72
|
+
The most valuable observations are decision traces: short records of HOW context turned into action, not just what action was taken. When the exchange contained any kind of decision (which file to edit, which approach to take, which option to ship, whether to escalate), capture the trace inside the observation prose. Bare outcome rows ("X was fixed", "v0.1.131 released") are the failure mode — expand them into traces.
|
|
73
|
+
|
|
74
|
+
A decision trace surfaces, when each is visible in the exchange:
|
|
75
|
+
|
|
76
|
+
- INPUTS GATHERED. Which files, tool results, error strings, commands, or prior messages did the agent draw on before acting? Name the surfaces (file paths, tool names) that materially shaped the decision — not every single read, just the ones that informed the choice.
|
|
77
|
+
- ALTERNATIVES CONSIDERED AND REJECTED. What did the agent try first that didn't work, propose that was dropped, or weigh against the chosen path? "Tried \`findAtomicCoverage\` first, dropped it as overengineered" is a high-value trace; "the fix is X" alone is not. This is the conflicts/precedent layer — future agents reuse rejected options as much as chosen ones.
|
|
78
|
+
- USER STEERS / APPROVALS / OVERRIDES. When the user pushed back, redirected, vetoed, or explicitly approved a path, preserve their wording near-verbatim and treat it as an authority signal. Quotes like "I think this is overengineered", "we should not treat them as legacy", "do X instead", "go ahead" are the equivalent of a VP approving a discount on a Zoom call: not in any system of record until you write it down. These are the HIGHEST-signal observations to capture, because they are the precedent that overrides defaults.
|
|
79
|
+
- CONVENTION OR POLICY APPLIED. Which \`AGENTS.md\` rule, project guideline, skill instruction, or prior decision was leaned on? "Per AGENTS.md ‘Prefer Direct, Local Guarantees’, removed the redundant guard" is a trace; "removed the redundant guard" alone loses the rule that justified it.
|
|
80
|
+
- PRIOR PRECEDENT. When the decision was informed by a prior memory row, a prior PR, or an earlier session's choice, mention it by name or short paraphrase so the future agent can find the precedent edge. This is also what \`usedObservationIds\` captures structurally — the prose should mirror it for readers who only see the content.
|
|
81
|
+
- EXCEPTION / OVERRIDE FLAG. If the path taken deviates from the usual approach or contradicts an existing rule, mark it plainly ("exception:", "override:", "departing from the default because…"). Exceptions are the most-reused precedent.
|
|
82
|
+
|
|
83
|
+
Not every observation is a decision — user facts, preferences, and routine completions don't need traces. But when a decision IS being recorded, omitting the trace is the same as recording a discount approval without the policy version, the exception route, or who signed off. The outcome alone is not enough.
|
|
84
|
+
|
|
70
85
|
PRESERVE SPECIFICS
|
|
71
86
|
|
|
72
87
|
Capture user facts, preferences, goals, constraints, corrections, explicit decisions, project details, file paths, commands, unresolved tasks, and completed work.
|
|
@@ -152,16 +167,45 @@ export function buildObserverOutputFormat(includeThreadTitle = false) {
|
|
|
152
167
|
usedObservationIds:
|
|
153
168
|
The existing observations block above lists prior cross-session memories with explicit \`[memory id: mem_xxx]\` markers. If the assistant's response in this exchange leaned on one or more of those memories — referenced facts, preferences, prior decisions, or context drawn from them — list the matching ids here. Omit or return [] when no prior memory was actually used. Only cite ids that appear verbatim in the markers above; do not invent ids.
|
|
154
169
|
|
|
155
|
-
|
|
170
|
+
CITE EACH DISTINCT FACT YOU USED, AT THE NARROWEST ROW THAT CARRIES IT — AND AT EXACTLY ONE ROW PER FACT. For each distinct fact the response leaned on, find every row in the observations block that mentions that fact, then pick exactly ONE id to cite for it:
|
|
171
|
+
1. Prefer the most specific row — the one whose subject is that fact, not a broader summary that mentions it among many.
|
|
172
|
+
2. Among rows of similar specificity, prefer the highest-priority (🔴 > 🟡 > 🟢) and most recently observed wording.
|
|
173
|
+
3. Fall back to a broader summary row ONLY when no narrower row carries the fact at all.
|
|
174
|
+
|
|
175
|
+
NEVER cite two ids for the same fact, even when the rows are worded differently or have different specificity. If three rows describe the same lint convention at different levels of detail ("User wants consistent linting", "User uses Biome", "User configured Biome with 2-space indent, double quotes, and \`noUnusedImports\` as error in \`biome.json\`"), pick the single best representative and leave the duplicates alone. Bumping every overlapping row uniformly refreshes stale or vague duplicates and defeats freshness decay; that is exactly what this field must avoid.
|
|
176
|
+
|
|
177
|
+
When the response leaned on multiple DISTINCT facts (different subjects, not different phrasings of the same subject), emit one id per fact actually used. A 100-token row whose only subject is one fact beats a 5,000-token row that mentions the same fact alongside fifteen others; bumping the narrow row keeps the broad summary fading until something specifically uses it again.
|
|
178
|
+
|
|
179
|
+
Worked example A (prefer narrow over summary). The block has \`[memory id: mem_backend_conventions]\` summarising the user's backend project conventions — logger module path, error base class, migration filename format, ORM choice, test runner, and Dockerfile base image — plus six narrower rows \`mem_logger\`, \`mem_errors\`, \`mem_migrations\`, \`mem_orm\`, \`mem_test_runner\`, \`mem_docker\` each focused on one of those facts. If your response leaned on the migration filename format and the Dockerfile base image, cite \`["mem_migrations", "mem_docker"]\` — not \`mem_backend_conventions\`, and not the narrower ids for facts you did not use.
|
|
180
|
+
|
|
181
|
+
Worked example A2 (prefer narrow over summary, release-history flavour). The block has \`[memory id: mem_release_log]\` summarising a recent release train — a docs cleanup release, a bundled-dependency release, a runtime-recovery release, an upgrade release, and a couple of tag-only releases — plus per-release narrow rows \`mem_rel_docs\`, \`mem_rel_bundled_dep\`, \`mem_rel_recovery\`, \`mem_rel_upgrade\`, \`mem_rel_tagonly_a\`, \`mem_rel_tagonly_b\`. If your response leaned on the bundled-dependency release and the runtime-recovery release, cite \`["mem_rel_bundled_dep", "mem_rel_recovery"]\` — not \`mem_release_log\`, and not the narrower ids for releases you did not reference.
|
|
182
|
+
|
|
183
|
+
Worked example B (collapse duplicates of the same fact). The block has \`mem_best\` (🔴 recent, specific: "For senior IC interviews, user weights system-design 40%, coding 30%, behavioural 20%, take-home 10%, and requires two strong-yes signals on system-design to advance"), \`mem_dup_medium\` (🟡 older, less specific: "User weights system-design heavily for senior IC hires"), and \`mem_dup_vague\` (🟢 oldest, vague: "User has an interview rubric"). All three cover the same fact. If your response leaned on that one fact, cite \`["mem_best"]\` only — never \`["mem_best", "mem_dup_medium"]\` and never all three.
|
|
184
|
+
|
|
185
|
+
Worked example C (fallback to summary). The block has only \`mem_quarterly_plan\` covering the user's Q3 plan (three OKRs, a hiring target, a launch event in week 9, a vacation block in week 7, a board update date, and a budget cap) and no narrower siblings. If your response leaned on the launch event and the board update date, cite \`["mem_quarterly_plan"]\` because no narrower row carries those facts.
|
|
186
|
+
|
|
187
|
+
Do not cite ids you did not actually use. Freshness decay relies on bumps reflecting real usage, so an unused citation is worse than an omitted one.
|
|
156
188
|
|
|
157
189
|
suggestedContinuation:
|
|
158
190
|
Hint for the agent's immediate next message. If the assistant needs to respond to the user, say that it should pause for user reply before continuing other tasks.
|
|
159
191
|
${threadTitleSection}
|
|
160
192
|
`;
|
|
161
193
|
}
|
|
162
|
-
export function buildObserverSystemPrompt(instruction, includeThreadTitle = false) {
|
|
194
|
+
export function buildObserverSystemPrompt(instruction, includeThreadTitle = false, context = {}) {
|
|
195
|
+
const cwdBlock = context.cwd
|
|
196
|
+
? dedent `
|
|
197
|
+
|
|
198
|
+
=== CURRENT PROJECT (CWD) ===
|
|
199
|
+
|
|
200
|
+
The runner is operating in:
|
|
201
|
+
|
|
202
|
+
${context.cwd}
|
|
203
|
+
|
|
204
|
+
Every observation produced here is implicitly scoped to this directory. The persistence layer also writes this cwd onto the surrounding <observation-group> wrapper automatically, so you do NOT need to copy the literal path into observation content. What you DO need to do is keep enough project signal in the prose itself (the repo name, key package or module names, or the product/area being worked on) so a future reader who sees only one observation — without the wrapper attributes — can still tell which project it is about. "Updated session-store.ts" is too thin; "Updated \`packages/agent-gateway/src/session-store.ts\` in the duet-agent monorepo" is right-sized. Skip project tagging only for observations that are clearly user-level facts unrelated to any codebase (preferences, personal info, schedule).
|
|
205
|
+
`
|
|
206
|
+
: "";
|
|
163
207
|
return dedent `
|
|
164
|
-
You are the memory consciousness of an AI assistant. Your observations will be the ONLY information the assistant has about past interactions with this user
|
|
208
|
+
You are the memory consciousness of an AI assistant. Your observations will be the ONLY information the assistant has about past interactions with this user.${cwdBlock}
|
|
165
209
|
|
|
166
210
|
Extract observations that will help the assistant remember:
|
|
167
211
|
|
|
@@ -247,18 +291,49 @@ export function formatMessagesForObserver(messages) {
|
|
|
247
291
|
function isImageContent(part) {
|
|
248
292
|
return part.type !== "text";
|
|
249
293
|
}
|
|
250
|
-
export function buildReflectorSystemPrompt(instruction) {
|
|
294
|
+
export function buildReflectorSystemPrompt(instruction, context = {}) {
|
|
295
|
+
const cwdBlock = context.cwd
|
|
296
|
+
? dedent `
|
|
297
|
+
|
|
298
|
+
Current working directory for this batch:
|
|
299
|
+
|
|
300
|
+
${context.cwd}
|
|
301
|
+
|
|
302
|
+
Every source observation was captured inside this cwd. Preserve the project / repo / module identifier in the reflected narrative so it stays meaningful when read back in another project.
|
|
303
|
+
`
|
|
304
|
+
: dedent `
|
|
305
|
+
|
|
306
|
+
Source observations may come from multiple working directories. Each <observation-group> in the input carries a \`cwd="..."\` attribute on its opening tag identifying the project that row belongs to. Treat that attribute as authoritative project context and INCLUDE the project / repo name in the narrative of each reflected row (e.g. "in the duet-agent monorepo", "on the marketing-site repo") when the row is project-specific. A row whose action only makes sense inside a specific codebase but doesn't name the project is incomplete.
|
|
307
|
+
`;
|
|
251
308
|
return dedent `
|
|
252
|
-
You are the reflection agent for an observational memory system.
|
|
309
|
+
You are the reflection agent for an observational memory system. Your output is the long-term cross-session memory the acting assistant will see weeks from now, when the original transcript is gone. Optimize for an agent who has never read the original turns.${cwdBlock}
|
|
253
310
|
|
|
254
|
-
|
|
311
|
+
Each row is one durable insight told as a self-contained mini-narrative. A bare factual headline ("X was done on Y") is the WRONG shape. The RIGHT shape captures the journey:
|
|
312
|
+
|
|
313
|
+
1. Trigger — what surfaced the problem, request, or decision? What was the symptom, complaint, error, or goal that started this thread of work?
|
|
314
|
+
2. Investigation / path — what was tried, ruled out, or considered? Which file/system/person was involved? What constraint forced the path that was taken?
|
|
315
|
+
3. Decision or outcome — what was actually done or chosen, with the concrete identifiers (file path, commit SHA, version, person, place) that let the agent find it again.
|
|
316
|
+
4. Rationale or higher-level lesson — WHY this was the right call given the constraints. What is the durable principle the next session should generalize? Often this is the most important part of the row.
|
|
317
|
+
5. Project / cwd anchor — name the repo, package, or product surface the work belongs to whenever the row is project-specific. A row about "the session store race" is ambiguous without "duet-agent's \`packages/agent-gateway/\`"; the future agent may be working in a different repo when it reads this back. Skip the anchor only for rows that are clearly user-level facts unrelated to any codebase (preferences, personal info, schedule).
|
|
318
|
+
6. Decision-trace dimensions — when the source observations recorded any of these for a decision, PRESERVE them in the reflected row. Do not strip them as "narrative fluff". Every row that records a DECISION (a path chosen, a fix landed, an option weighed) must ATTRIBUTE that decision to a concrete source: a user steer, a project convention or rule, a prior precedent / earlier fix, an observed symptom / error / measurement, or an explicit "no precedent — fresh judgement call". Passive-voice outcome rows ("X was changed to Y", "v1.2.3 was released") are INVALID — always name WHY the path was taken.
|
|
319
|
+
- Alternatives considered and rejected ("tried X first, dropped it because…", "weighed Y vs Z, picked Y because…"). Future agents reuse rejected options as much as chosen ones.
|
|
320
|
+
- User steers, push-backs, approvals, vetoes — quote or near-quote the user's wording. These are the highest-signal precedent because they override defaults. A reflection that loses the user's "we should not treat them as legacy" or "I think this is overengineered" has destroyed the most valuable input.
|
|
321
|
+
- Convention / policy applied (\`AGENTS.md\` rules, skill instructions, project guidelines that justified the path).
|
|
322
|
+
- Prior precedent / earlier decisions / earlier memory rows the work built on, by short paraphrase so the next agent can follow the precedent edge.
|
|
323
|
+
- Exception / override markers when the path deviates from the default. Exceptions are the most-reused precedent.
|
|
324
|
+
|
|
325
|
+
Treat reflection as writing a short "why" memo, not bullet-point minutes. Multi-sentence rows that explain the journey are preferred over short rows that only state the outcome. A row that omits the trigger or the rationale is incomplete — expand it.
|
|
255
326
|
|
|
256
327
|
Rules:
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
328
|
+
- Each row must be readable cold, by an agent with no other context. Test it: if a reader can't tell why the work mattered or what problem it solved, the row is too thin.
|
|
329
|
+
- Preserve concrete identifiers (dates, file paths, commit SHAs, PR numbers, error strings, version tags, names of people/products) wherever they appear in the source. They are how the future agent finds the work.
|
|
330
|
+
- Deduplicate across rows. Each insight gets one row. If two source observations describe the same journey, merge them.
|
|
331
|
+
- Group cause and effect into one row, not two. "The metadata.json race caused /answer 400s" + "SessionStore.save was made atomic" belong in the SAME row because the second is the resolution of the first.
|
|
332
|
+
- Consolidate aggressively when multiple source observations describe the same underlying journey from different angles (the symptom, the investigation, the fix, the verification). Those are ONE row covering the whole arc, not three rows. Successive tweaks to the same file or subsystem also belong in one row that tells the layered story — not one row per release.
|
|
333
|
+
- When two rows would describe the SAME overarching outcome or lesson at a different zoom level (one summarizes the loop, the other zooms in on one fix inside the loop), MERGE them into one row that names the specific fixes inside the larger arc. Do not let "this row mentions a different SHA" justify keeping a duplicate — the test is whether the durable insight is the same.
|
|
334
|
+
- Preserve chronology and observation-group headings/ranges where they exist in the source.
|
|
335
|
+
- Do not invent details. If a fact wasn't in the source, leave it out — but DO restate context that IS in the source even if it feels redundant within the row, because it won't be redundant when read cold.
|
|
336
|
+
- Length budget per row: roughly 150-600 tokens (one short paragraph). Going longer is fine when the journey genuinely needs it; staying very short is the failure mode to avoid.
|
|
262
337
|
${instruction ? `\nCustom instructions:\n${instruction}` : ""}
|
|
263
338
|
`;
|
|
264
339
|
}
|
|
@@ -271,7 +346,9 @@ export function buildReflectorPrompt(observations, targetTokens, retry) {
|
|
|
271
346
|
`
|
|
272
347
|
: `Target budget: keep the reflected observation log under approximately ${targetTokens.toLocaleString("en-US")} tokens.`;
|
|
273
348
|
return dedent `
|
|
274
|
-
Reflect on these observations and return
|
|
349
|
+
Reflect on these observations and return an ARRAY of atomic reflection rows. One self-contained narrative per row.
|
|
350
|
+
|
|
351
|
+
For each row, walk through trigger → journey → decision → rationale/lesson. A row that only states the outcome ("X was fixed", "v0.1.131 was released") is incomplete — expand it with what triggered the work, what was tried, why this resolution was chosen, and what the durable lesson is.
|
|
275
352
|
|
|
276
353
|
${budgetInstruction}
|
|
277
354
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observational-prompts.js","sourceRoot":"","sources":["../../../src/memory/observational-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"observational-prompts.js","sourceRoot":"","sources":["../../../src/memory/observational-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAkC5B,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAA;;;;;;;;CAQlD,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAA;;CAE/C,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAClF,MAAM,CAAC,MAAM,wBAAwB,GACnC,uQAAuQ,CAAC;AAE1Q,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAClC,sOAAsO,CAAC;AAEzO,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAA;;;;;;;;;;CAUrD,CAAC;AAEF,MAAM,gCAAgC,GAAG,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE;IAEpC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG;QAC1B,CAAC,CAAC,MAAM,CAAA;;;;YAIA,OAAO,CAAC,GAAG;;;OAGhB;QACH,CAAC,CAAC,MAAM,CAAA;;;OAGL,CAAC;IACN,OAAO,MAAM,CAAA;yQAC0P,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4B3Q,WAAW,CAAC,CAAC,CAAC,2BAA2B,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;GAC9D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,YAAoB,EACpB,YAAoB,EACpB,KAAgC;IAEhC,MAAM,iBAAiB,GAAG,KAAK;QAC7B,CAAC,CAAC,MAAM,CAAA;mEACuD,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,+BAA+B,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC;;6EAEnG,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC;OAC1G;QACH,CAAC,CAAC,yEAAyE,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC;IAE5H,OAAO,MAAM,CAAA;;;;;MAKT,iBAAiB;;MAEjB,YAAY;GACf,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { type WireGuardHorizon } from "../turn-runner/wire-shaping.js";
|
|
|
4
4
|
import type { MemoryContextCache } from "./store.js";
|
|
5
5
|
import type { MemorySession } from "./session.js";
|
|
6
6
|
import { type SessionObservationsSnapshot } from "./storage.js";
|
|
7
|
-
import type { Observation, ObservationalMemoryActivityEvent, ObservationalMemorySettings, ObservationalMemorySettingsInput } from "../types/memory.js";
|
|
7
|
+
import type { Observation, ObservationPriority, ObservationalMemoryActivityEvent, ObservationalMemorySettings, ObservationalMemorySettingsInput } from "../types/memory.js";
|
|
8
8
|
import { type RawMemoryMessage } from "./observational-prompts.js";
|
|
9
9
|
/**
|
|
10
10
|
* Default `effectiveContext` when the runner doesn't specify one. 200k is a
|
|
@@ -124,9 +124,21 @@ export interface ObserverResult {
|
|
|
124
124
|
/** Optional short title when the observer is asked to name the session/thread. */
|
|
125
125
|
threadTitle?: string;
|
|
126
126
|
}
|
|
127
|
+
export interface ReflectorReflection {
|
|
128
|
+
/** One durable insight rendered as a single small row (~30-150 tokens). */
|
|
129
|
+
content: string;
|
|
130
|
+
/** Priority for the row. Defaults to "high" when omitted. */
|
|
131
|
+
priority?: ObservationPriority;
|
|
132
|
+
/** ISO YYYY-MM-DD the insight is anchored to. Defaults to today when omitted. */
|
|
133
|
+
observedDate?: string;
|
|
134
|
+
}
|
|
127
135
|
export interface ReflectorResult {
|
|
128
|
-
/**
|
|
129
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Atomic reflection rows produced from the batch. The global-prune
|
|
138
|
+
* path persists each row as its own `Observation` so recall
|
|
139
|
+
* freshness can rank, decay, and refresh each insight independently.
|
|
140
|
+
*/
|
|
141
|
+
reflections: ReflectorReflection[];
|
|
130
142
|
/** Hint for the actor's next response after reflection rewrites memory. */
|
|
131
143
|
suggestedContinuation?: string;
|
|
132
144
|
}
|
|
@@ -192,6 +204,14 @@ export interface ObservationalMemoryUpdateOptions {
|
|
|
192
204
|
settings?: ObservationalMemorySettingsInput;
|
|
193
205
|
actorModel: string;
|
|
194
206
|
messages: AgentMessage[];
|
|
207
|
+
/**
|
|
208
|
+
* Working directory the runner is executing in. Stored on the
|
|
209
|
+
* resulting `<observation-group>` wrapper as a `cwd` attribute and
|
|
210
|
+
* exposed to the observer/in-session reflector prompts so project
|
|
211
|
+
* context is preserved in every row — essential when memory is
|
|
212
|
+
* read back weeks later or across repos.
|
|
213
|
+
*/
|
|
214
|
+
cwd?: string;
|
|
195
215
|
onUsage?: (usage: Usage) => void;
|
|
196
216
|
onActivity?: (event: ObservationalMemoryActivityEvent) => void;
|
|
197
217
|
}
|
|
@@ -376,9 +396,19 @@ export interface PlanReflectionBatchesOptions {
|
|
|
376
396
|
* batching/eligibility rules can be unit-tested without docker/LLM.
|
|
377
397
|
*
|
|
378
398
|
* Rules:
|
|
379
|
-
* - `kind === "reflection"`
|
|
380
|
-
*
|
|
381
|
-
*
|
|
399
|
+
* - GLOBAL reflection rows (`kind === "reflection"` AND
|
|
400
|
+
* `sessionId === GLOBAL_REFLECTION_SESSION_ID`) are always preserved.
|
|
401
|
+
* They are the output of prior `duet memory reflect` runs and
|
|
402
|
+
* reflecting on them again would collapse already-condensed text
|
|
403
|
+
* into vaguer text. See option 3 in the
|
|
404
|
+
* {@link DEFAULT_GLOBAL_REFLECT_MIN_AGE_DAYS} comment.
|
|
405
|
+
* - LOCAL reflection rows (`kind === "reflection"` with any other
|
|
406
|
+
* sessionId) are the single-blob outputs of the in-session reflector
|
|
407
|
+
* (`reflectObservations`), each still wrapped in `<observation-group>`.
|
|
408
|
+
* They ARE eligible: `duet memory reflect` is the path that breaks
|
|
409
|
+
* them up into atomic global reflection rows. Once folded, the
|
|
410
|
+
* resulting global rows carry `sessionId === GLOBAL_REFLECTION_SESSION_ID`
|
|
411
|
+
* and are preserved on subsequent runs.
|
|
382
412
|
* - Non-reflection rows with `createdAt > cutoff` are preserved (too
|
|
383
413
|
* fresh; resume-info-loss risk too high).
|
|
384
414
|
* - Everything else is eligible. Eligible rows are sorted by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observational.d.ts","sourceRoot":"","sources":["../../../src/memory/observational.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAgB,KAAK,EAAe,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAIrF,OAAO,EAQL,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAML,KAAK,2BAA2B,EACjC,MAAM,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