From c9de8c711696f9f9ca4243b58174c0c521585013 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sun, 15 Nov 2026 09:35:43 +0100 Subject: [PATCH] tools: the protocol group's landed/unlanded intent split (#20) token.create now answers on its fields, so the 'not landed yet' examples move to status.set and character.create (slices 7-8). --- tools/protocol.test.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/protocol.test.mjs b/tools/protocol.test.mjs index 15d0329..6ea156c 100644 --- a/tools/protocol.test.mjs +++ b/tools/protocol.test.mjs @@ -97,9 +97,14 @@ test('an unknown type is refused, unknown fields are ignored, and every intent g assert.equal((await gm.ws.request({ t: 'token.teleport', id: 'x' })).code, 'unknown-type') assert.equal((await gm.ws.request({ t: '' })).code, 'unknown-type') assert.equal((await gm.ws.request({ t: 'TOKEN.MOVE', id: 'x' })).code, 'unknown-type') - // a catalogue intent whose slice has not landed still answers exactly once - assert.equal((await gm.ws.request({ t: 'token.create', scene: 1 })).code, 'unknown-type') + // a catalogue intent whose slice has not landed still answers exactly once (slices 6-8) + assert.equal((await gm.ws.request({ t: 'status.set', id: 'x', status: 'stuck' })).code, + 'unknown-type') assert.equal((await gm.ws.request({ t: 'scene.set', scene: 1 })).code, 'unknown-type') + assert.equal((await gm.ws.request({ t: 'character.create', descriptive_name: 'x', + actual_name: 'X' })).code, 'unknown-type') + // an intent whose slice HAS landed answers on its fields (empty token.create = invalid) + assert.equal((await gm.ws.request({ t: 'token.create', scene: 1 })).code, 'invalid') // the reserved FFF hook is refused for everyone and is never ok const act = await gm.ws.request({ t: 'act.do', actor: 1, action: 'x', args: {} }) assert.equal(act.ok, false)