@termwright/conformance 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/fixtures/adversarial-peer.mjs +12 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@termwright/conformance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "generic/semantic/adversarial fixtures + adapter contract tests",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@xterm/headless": "^6.0.0",
|
|
27
|
-
"@termwright/driver": "0.
|
|
28
|
-
"@termwright/
|
|
29
|
-
"@termwright/
|
|
27
|
+
"@termwright/driver": "0.4.0",
|
|
28
|
+
"@termwright/protocol": "0.4.0",
|
|
29
|
+
"@termwright/resource-broker": "0.4.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
33
33
|
"@types/react": "^19.2.18",
|
|
34
34
|
"ink": "^7.1.1",
|
|
35
35
|
"react": "^19.2.8",
|
|
36
|
-
"@termwright/ink": "0.
|
|
37
|
-
"@termwright/
|
|
38
|
-
"@termwright/
|
|
39
|
-
"@termwright/probe-ink": "0.
|
|
40
|
-
"@termwright/test": "0.
|
|
41
|
-
"@termwright/probe-tview": "0.
|
|
36
|
+
"@termwright/ink": "0.4.0",
|
|
37
|
+
"@termwright/mcp": "0.4.0",
|
|
38
|
+
"@termwright/logs": "0.4.0",
|
|
39
|
+
"@termwright/probe-ink": "0.4.0",
|
|
40
|
+
"@termwright/test": "0.4.0",
|
|
41
|
+
"@termwright/probe-tview": "0.4.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"vitest": "4.1.11"
|
|
@@ -138,7 +138,7 @@ function marker(revision, forSession = sessionId, terminator = '\x07') {
|
|
|
138
138
|
|
|
139
139
|
function tree(revision, nodes, overrides = {}) {
|
|
140
140
|
return {
|
|
141
|
-
v:
|
|
141
|
+
v: 3,
|
|
142
142
|
sessionId,
|
|
143
143
|
revision,
|
|
144
144
|
columns: 80,
|
|
@@ -201,7 +201,7 @@ function validNodes(label) {
|
|
|
201
201
|
|
|
202
202
|
/** Publishes a well-formed revision: snapshot, commit, then the render marker. */
|
|
203
203
|
function publish(revision, label = 'Peer') {
|
|
204
|
-
socket.write(frame({ type: '
|
|
204
|
+
socket.write(frame({ type: 'semantic-full', snapshot: tree(revision, validNodes(label)) }));
|
|
205
205
|
socket.write(frame({ type: 'revision-commit', revision }));
|
|
206
206
|
process.stdout.write(REPAINT + marker(revision));
|
|
207
207
|
published = revision;
|
|
@@ -215,7 +215,7 @@ const SCENARIOS = {
|
|
|
215
215
|
socket.write(frame(hello({ protocol: 'termwright/99' })));
|
|
216
216
|
},
|
|
217
217
|
'no-hello': () => {
|
|
218
|
-
socket.write(frame({ type: '
|
|
218
|
+
socket.write(frame({ type: 'semantic-full', snapshot: tree(1, validNodes('Peer')) }));
|
|
219
219
|
},
|
|
220
220
|
|
|
221
221
|
'duplicate-hello': () => {
|
|
@@ -234,7 +234,7 @@ const SCENARIOS = {
|
|
|
234
234
|
socket.write(Buffer.concat([header, Buffer.from('{"type":"sna', 'utf8')]));
|
|
235
235
|
},
|
|
236
236
|
'duplicate-frames': () => {
|
|
237
|
-
const message = frame({ type: '
|
|
237
|
+
const message = frame({ type: 'semantic-full', snapshot: tree(2, validNodes('Twice')) });
|
|
238
238
|
socket.write(message);
|
|
239
239
|
socket.write(message);
|
|
240
240
|
process.stdout.write(marker(2));
|
|
@@ -282,7 +282,7 @@ const SCENARIOS = {
|
|
|
282
282
|
process.stdout.write(marker(5));
|
|
283
283
|
},
|
|
284
284
|
'tree-without-marker': () => {
|
|
285
|
-
socket.write(frame({ type: '
|
|
285
|
+
socket.write(frame({ type: 'semantic-full', snapshot: tree(4, validNodes('Unpaired')) }));
|
|
286
286
|
socket.write(frame({ type: 'revision-commit', revision: 4 }));
|
|
287
287
|
},
|
|
288
288
|
'rapid-rerender': () => {
|
|
@@ -294,12 +294,12 @@ const SCENARIOS = {
|
|
|
294
294
|
say('PEER FLOOD OUTPUT COMPLETE');
|
|
295
295
|
for (let revision = 2; revision <= 100; revision += 1) {
|
|
296
296
|
socket.write(
|
|
297
|
-
frame({ type: '
|
|
297
|
+
frame({ type: 'semantic-full', snapshot: tree(revision, validNodes(`Flood${revision}`)) }),
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
301
|
'disconnect-mid-render': () => {
|
|
302
|
-
socket.end(frame({ type: '
|
|
302
|
+
socket.end(frame({ type: 'semantic-full', snapshot: tree(2, validNodes('Torn')) }));
|
|
303
303
|
},
|
|
304
304
|
'hostile-unicode': () => {
|
|
305
305
|
// A lone high surrogate survives JSON.stringify as an escape, so the bytes
|
|
@@ -325,7 +325,7 @@ const SCENARIOS = {
|
|
|
325
325
|
'deep-nesting': () => {
|
|
326
326
|
let value = 'leaf';
|
|
327
327
|
for (let depth = 0; depth < MAX_DEPTH * 2; depth += 1) value = { nested: value };
|
|
328
|
-
socket.write(frame({ type: '
|
|
328
|
+
socket.write(frame({ type: 'semantic-full', snapshot: value }));
|
|
329
329
|
},
|
|
330
330
|
'too-many-nodes': () => {
|
|
331
331
|
const nodes = [{ id: 'n1', role: 'region', name: 'Peer', geometry: unknownGeometry() }];
|
|
@@ -390,7 +390,7 @@ const SCENARIOS = {
|
|
|
390
390
|
},
|
|
391
391
|
'marker-st-terminator': () => {
|
|
392
392
|
// ST rather than BEL. The tree must pair exactly as it does with BEL.
|
|
393
|
-
socket.write(frame({ type: '
|
|
393
|
+
socket.write(frame({ type: 'semantic-full', snapshot: tree(2, validNodes('Terminated')) }));
|
|
394
394
|
process.stdout.write(marker(2, sessionId, '\x1b\\'));
|
|
395
395
|
published = 2;
|
|
396
396
|
},
|
|
@@ -401,7 +401,7 @@ const SCENARIOS = {
|
|
|
401
401
|
},
|
|
402
402
|
'foreign-marker': () => {
|
|
403
403
|
// A marker MAC bound to a different session must not commit anything here.
|
|
404
|
-
socket.write(frame({ type: '
|
|
404
|
+
socket.write(frame({ type: 'semantic-full', snapshot: tree(2, validNodes('Forged')) }));
|
|
405
405
|
process.stdout.write(marker(2, 'another-session'));
|
|
406
406
|
},
|
|
407
407
|
};
|
|
@@ -413,7 +413,7 @@ function hello(overrides = {}) {
|
|
|
413
413
|
if (NEEDS_LOGS.has(scenario)) capabilities.push('logs');
|
|
414
414
|
return {
|
|
415
415
|
type: 'hello',
|
|
416
|
-
protocol: 'termwright/
|
|
416
|
+
protocol: 'termwright/3',
|
|
417
417
|
token,
|
|
418
418
|
adapter: { name: 'adversarial-peer', version: '0.1.0' },
|
|
419
419
|
capabilities,
|
|
@@ -433,7 +433,7 @@ function sendLog(seq, message) {
|
|
|
433
433
|
|
|
434
434
|
/** Sends a deliberately chosen snapshot together with its marker. */
|
|
435
435
|
function send(snapshot) {
|
|
436
|
-
socket.write(frame({ type: '
|
|
436
|
+
socket.write(frame({ type: 'semantic-full', snapshot }));
|
|
437
437
|
process.stdout.write(marker(snapshot.revision));
|
|
438
438
|
}
|
|
439
439
|
|