@north-light/crouter 0.3.290 → 0.3.292
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/api/dto/node-outcomes.d.ts +6 -2
- package/dist/clients/attach/__tests__/crtr-output.test.js +3 -3
- package/dist/clients/attach/render/chat-view.js +10 -3
- package/dist/clients/attach/render/crtr-output.d.ts +6 -2
- package/dist/clients/attach/render/crtr-output.js +158 -14
- package/dist/clients/attach/render/edit-diff.d.ts +2 -14
- package/dist/clients/attach/render/edit-diff.js +4 -1
- package/dist/clients/attach/render/group-activity.js +2 -22
- package/dist/clients/attach/render/tool-calls.d.ts +15 -0
- package/dist/clients/attach/render/tool-calls.js +0 -3
- package/dist/clients/attach/viewer.js +577 -577
- package/dist/core/preview-registry.d.ts +10 -0
- package/dist/core/preview-registry.js +36 -0
- package/dist/core/substrate/schema.d.ts +7 -0
- package/dist/core/substrate/schema.js +1 -1
- package/dist/daemon/api/map.js +7 -6
- package/package.json +1 -1
- package/runtime.lock.json +5 -5
|
@@ -32,6 +32,16 @@ export interface CrtrPreview {
|
|
|
32
32
|
jsonl?: Record<string, unknown>[];
|
|
33
33
|
error?: Record<string, unknown>;
|
|
34
34
|
}
|
|
35
|
+
/** Every crtr invocation's own structured result in one bash tool result, in
|
|
36
|
+
* invocation order — mirrored onto `details` by the canvas preview extension
|
|
37
|
+
* (pi-extensions/canvas-preview-result.ts), and present on live tool events and
|
|
38
|
+
* on rebuilt snapshot messages alike.
|
|
39
|
+
*
|
|
40
|
+
* `crtrPreviews` carries every invocation in the call; `crtrPreview` (the last
|
|
41
|
+
* record alone) is all a transcript persisted before the channel became a list
|
|
42
|
+
* can offer, so both are read. This validates only the transport envelope —
|
|
43
|
+
* command-owned summaries validate the fields they use. */
|
|
44
|
+
export declare function crtrPreviewRecords(result: unknown): CrtrPreview[];
|
|
35
45
|
type SummaryInput = {
|
|
36
46
|
result?: Record<string, unknown>;
|
|
37
47
|
jsonl?: Record<string, unknown>[];
|
|
@@ -185,6 +185,42 @@ export function iconForPath(tokens) {
|
|
|
185
185
|
const familyCp = tokens.length > 0 ? FAMILY_ICON_CP[tokens[0]] : undefined;
|
|
186
186
|
return familyCp !== undefined ? String.fromCodePoint(familyCp) : '◆';
|
|
187
187
|
}
|
|
188
|
+
function plainObject(value) {
|
|
189
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
190
|
+
? value
|
|
191
|
+
: undefined;
|
|
192
|
+
}
|
|
193
|
+
/** Every crtr invocation's own structured result in one bash tool result, in
|
|
194
|
+
* invocation order — mirrored onto `details` by the canvas preview extension
|
|
195
|
+
* (pi-extensions/canvas-preview-result.ts), and present on live tool events and
|
|
196
|
+
* on rebuilt snapshot messages alike.
|
|
197
|
+
*
|
|
198
|
+
* `crtrPreviews` carries every invocation in the call; `crtrPreview` (the last
|
|
199
|
+
* record alone) is all a transcript persisted before the channel became a list
|
|
200
|
+
* can offer, so both are read. This validates only the transport envelope —
|
|
201
|
+
* command-owned summaries validate the fields they use. */
|
|
202
|
+
export function crtrPreviewRecords(result) {
|
|
203
|
+
const details = plainObject(plainObject(result)?.['details']);
|
|
204
|
+
if (details === undefined)
|
|
205
|
+
return [];
|
|
206
|
+
const all = details['crtrPreviews'];
|
|
207
|
+
const records = Array.isArray(all) ? all : [details['crtrPreview']];
|
|
208
|
+
return records.flatMap((entry) => {
|
|
209
|
+
const record = plainObject(entry);
|
|
210
|
+
if (record === undefined || typeof record['path'] !== 'string')
|
|
211
|
+
return [];
|
|
212
|
+
const jsonl = record['jsonl'];
|
|
213
|
+
return [{
|
|
214
|
+
path: record['path'],
|
|
215
|
+
result: plainObject(record['result']),
|
|
216
|
+
jsonl: Array.isArray(jsonl) ? jsonl.flatMap((row) => {
|
|
217
|
+
const parsed = plainObject(row);
|
|
218
|
+
return parsed === undefined ? [] : [parsed];
|
|
219
|
+
}) : undefined,
|
|
220
|
+
error: plainObject(record['error']),
|
|
221
|
+
}];
|
|
222
|
+
});
|
|
223
|
+
}
|
|
188
224
|
const MEMORY_READ_CONTENT_LINES = 3;
|
|
189
225
|
function record(input) {
|
|
190
226
|
return input.result;
|
|
@@ -142,3 +142,10 @@ export declare function effectiveDocKind(doc: MemoryDoc): string;
|
|
|
142
142
|
* lives once here to prevent drift. Light cleanup normalizes the trailing
|
|
143
143
|
* period. */
|
|
144
144
|
export declare function previewLine(doc: Pick<SubstrateSchema, 'whenAndWhyToRead'>): string;
|
|
145
|
+
/** Tolerant `surfaces` parse: a non-array yields `[]`; invalid entries are
|
|
146
|
+
* dropped (bad `on`, bad `at`, a read/memory-read/command/pre-command entry
|
|
147
|
+
* left with neither `match` nor — read only — `match-frontmatter`). `match-frontmatter`
|
|
148
|
+
* on a non-read event is dropped from the entry, which survives iff it still
|
|
149
|
+
* carries a `match`; an invalid entry `gate` is dropped. Lint owns strict
|
|
150
|
+
* enforcement; the runtime parser maps over many docs and must never throw. */
|
|
151
|
+
export declare function parseSurfaces(v: unknown): SurfaceEntry[];
|
|
@@ -137,7 +137,7 @@ function parseGate(v) {
|
|
|
137
137
|
* on a non-read event is dropped from the entry, which survives iff it still
|
|
138
138
|
* carries a `match`; an invalid entry `gate` is dropped. Lint owns strict
|
|
139
139
|
* enforcement; the runtime parser maps over many docs and must never throw. */
|
|
140
|
-
function parseSurfaces(v) {
|
|
140
|
+
export function parseSurfaces(v) {
|
|
141
141
|
if (!Array.isArray(v))
|
|
142
142
|
return [];
|
|
143
143
|
const out = [];
|
package/dist/daemon/api/map.js
CHANGED
|
@@ -62,12 +62,13 @@ export function toNodeOutcomeDTO(node) {
|
|
|
62
62
|
};
|
|
63
63
|
if (node.outcome_kind === 'result')
|
|
64
64
|
return { ...base, kind: 'result', reason: node.outcome_reason, declined: null };
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
// A declined row whose detail holds no decline block still projects: the row
|
|
66
|
+
// predates the decline block being recorded, or the outcome-column backfill
|
|
67
|
+
// rebuilt it from `terminal_reason` alone. This mapper also runs per row in
|
|
68
|
+
// the canvas-wide list projection, so throwing here would take every
|
|
69
|
+
// graph-wide read down over one unreadable node.
|
|
70
|
+
if (node.outcome_reason === 'declined')
|
|
71
|
+
return { ...base, kind: 'failure', reason: 'declined', declined: detail?.declined ?? null };
|
|
71
72
|
return { ...base, kind: 'failure', reason: node.outcome_reason, declined: null };
|
|
72
73
|
}
|
|
73
74
|
/** Project a durable delivery row without exposing its execution coordinates or stderr tail. */
|
package/package.json
CHANGED
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.292",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/crouter",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.292",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"workspaces": [
|
|
@@ -4244,17 +4244,17 @@
|
|
|
4244
4244
|
},
|
|
4245
4245
|
"packages/crouter-api": {
|
|
4246
4246
|
"name": "@north-light/crouter-api",
|
|
4247
|
-
"version": "0.3.
|
|
4247
|
+
"version": "0.3.292",
|
|
4248
4248
|
"license": "UNLICENSED"
|
|
4249
4249
|
},
|
|
4250
4250
|
"packages/crouter-env-docker": {
|
|
4251
4251
|
"name": "@north-light/crouter-env-docker",
|
|
4252
|
-
"version": "0.3.
|
|
4252
|
+
"version": "0.3.292",
|
|
4253
4253
|
"license": "UNLICENSED"
|
|
4254
4254
|
},
|
|
4255
4255
|
"packages/crouter-sdk": {
|
|
4256
4256
|
"name": "@north-light/crouter-sdk",
|
|
4257
|
-
"version": "0.3.
|
|
4257
|
+
"version": "0.3.292",
|
|
4258
4258
|
"license": "UNLICENSED",
|
|
4259
4259
|
"dependencies": {
|
|
4260
4260
|
"@north-light/crouter-api": "*"
|