@north-light/crouter 0.3.201 → 0.3.203
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/builtin-memory/insights/capture.md +1 -1
- package/dist/clients/attach/ansi-cells.d.ts +5 -1
- package/dist/clients/attach/ansi-cells.js +16 -5
- package/dist/clients/attach/render/transcript-search.js +5 -6
- package/dist/clients/attach/viewer.js +650 -650
- package/dist/commands/human/shared.d.ts +1 -0
- package/dist/commands/human/shared.js +5 -0
- package/dist/commands/human.js +1 -0
- package/dist/commands/memory/delete.js +14 -3
- package/dist/commands/memory/edit.d.ts +1 -0
- package/dist/commands/memory/edit.js +166 -0
- package/dist/commands/memory/history.d.ts +1 -0
- package/dist/commands/memory/history.js +179 -0
- package/dist/commands/memory/list.js +1 -1
- package/dist/commands/memory/read.js +2 -2
- package/dist/commands/memory/shared.d.ts +27 -0
- package/dist/commands/memory/shared.js +69 -0
- package/dist/commands/memory/write.js +54 -61
- package/dist/commands/memory.js +6 -3
- package/dist/core/memory/history.d.ts +54 -0
- package/dist/core/memory/history.js +202 -0
- package/dist/core/memory-resolver.d.ts +21 -0
- package/dist/core/memory-resolver.js +47 -16
- package/dist/core/preview-registry.js +2 -0
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
|
@@ -45,6 +45,6 @@ The review is asynchronous. Continue unrelated work or wait dormant, but do not
|
|
|
45
45
|
|
|
46
46
|
Apply direct line edits and explicit comments. If feedback requires a materially new formulation, update the open review artifact or submit a replacement review; review the revised formulation before writing it. If no candidate survives, save nothing.
|
|
47
47
|
|
|
48
|
-
Run `crtr memory write -h
|
|
48
|
+
Run `crtr memory write -h` for the authoring contract, then reach only the approved destination — `crtr memory write` to create it, `crtr memory edit` to revise one that exists. A new principle is normally knowledge, and a preference only when its use is behavioral; use `none` visibility on both axes unless review approves a flat boot-rung exception. Keep its body to the approved truth, any material boundary, and the concise why. Update the selected active listener or organizing router with the canonical link without duplicating the principle.
|
|
49
49
|
|
|
50
50
|
Source context and agent reasoning stay only in the review artifact. Do not copy them into semantic memory or provenance frontmatter. Run `crtr memory lint` after every create or rewrite and fix every finding.
|
|
@@ -24,10 +24,14 @@ export declare function rowCells(line: string): number;
|
|
|
24
24
|
/** Plain text of cells `[from, to)` — every escape, link boundary, and cursor
|
|
25
25
|
* marker dropped, exactly what a terminal copies out of that span. */
|
|
26
26
|
export declare function sliceCells(line: string, from: number, to: number): string;
|
|
27
|
-
/** The SGR pair `styleCells` asserts over a span.
|
|
27
|
+
/** The SGR pair `styleCells` asserts over a span. A style that paints color
|
|
28
|
+
* sets `restore`, because its `off` cannot un-set one color without also
|
|
29
|
+
* discarding whatever color the row had underneath it — with `restore`, the
|
|
30
|
+
* span closes by resetting and replaying the SGRs the row had already asserted. */
|
|
28
31
|
export type CellStyle = {
|
|
29
32
|
on: string;
|
|
30
33
|
off: string;
|
|
34
|
+
restore?: boolean;
|
|
31
35
|
};
|
|
32
36
|
export declare const INVERSE_STYLE: CellStyle;
|
|
33
37
|
/** Style cells `[from, to)`, re-asserting `style.on` after any SGR inside the
|
|
@@ -89,19 +89,30 @@ export function styleCells(line, from, to, maxCells, style = INVERSE_STYLE) {
|
|
|
89
89
|
return line;
|
|
90
90
|
let out = '';
|
|
91
91
|
let inside = false;
|
|
92
|
+
// The SGRs in force at the current point, so a color span can hand the row
|
|
93
|
+
// back exactly as it found it. A full reset clears the list.
|
|
94
|
+
const active = [];
|
|
92
95
|
const open = () => { if (!inside) {
|
|
93
96
|
out += style.on;
|
|
94
97
|
inside = true;
|
|
95
98
|
} };
|
|
96
|
-
const close = () => {
|
|
97
|
-
|
|
99
|
+
const close = () => {
|
|
100
|
+
if (!inside)
|
|
101
|
+
return;
|
|
102
|
+
out += style.restore === true ? `\x1b[0m${active.join('')}` : style.off;
|
|
98
103
|
inside = false;
|
|
99
|
-
}
|
|
104
|
+
};
|
|
100
105
|
const cells = walkRow(line, {
|
|
101
106
|
onEscape: (escape) => {
|
|
102
107
|
out += escape;
|
|
108
|
+
if (!escape.endsWith('m'))
|
|
109
|
+
return;
|
|
110
|
+
if (escape === '\x1b[0m' || escape === '\x1b[m')
|
|
111
|
+
active.length = 0;
|
|
112
|
+
else
|
|
113
|
+
active.push(escape);
|
|
103
114
|
// An SGR inside the span may have reset every attribute, including ours.
|
|
104
|
-
if (inside
|
|
115
|
+
if (inside)
|
|
105
116
|
out += style.on;
|
|
106
117
|
},
|
|
107
118
|
onGlyph: (glyph) => {
|
|
@@ -116,7 +127,7 @@ export function styleCells(line, from, to, maxCells, style = INVERSE_STYLE) {
|
|
|
116
127
|
if (cells < end) {
|
|
117
128
|
const gap = Math.max(0, from - cells);
|
|
118
129
|
const styled = end - Math.max(from, cells);
|
|
119
|
-
out += ' '.repeat(gap) + style.on + ' '.repeat(styled) + style.off;
|
|
130
|
+
out += ' '.repeat(gap) + style.on + ' '.repeat(styled) + (style.restore === true ? '\x1b[0m' : style.off);
|
|
120
131
|
}
|
|
121
132
|
return out;
|
|
122
133
|
}
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
// what the viewport needs to scroll to one and what `highlightCells` needs to
|
|
11
11
|
// paint one.
|
|
12
12
|
import { styleCells, walkRow } from '../ansi-cells.js';
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const SELECTED_HIT_STYLE = { on: '\x1b[7m\x1b[4m', off: '\x1b[24m\x1b[27m' };
|
|
13
|
+
/** Hits are painted as backgrounds with black text, the way an editor marks
|
|
14
|
+
* find results: white for every hit, amber for the one you are standing on, so
|
|
15
|
+
* a screen full of hits still says which of them `n` will leave. */
|
|
16
|
+
const HIT_STYLE = { on: '\x1b[107m\x1b[30m', off: '', restore: true };
|
|
17
|
+
const SELECTED_HIT_STYLE = { on: '\x1b[48;5;214m\x1b[30m', off: '', restore: true };
|
|
19
18
|
function plainRow(line) {
|
|
20
19
|
let text = '';
|
|
21
20
|
const cells = [];
|