Integrating into NodeJS

edit: I mostly figured things out, I think? If I don't set autoreconnect to true it always fails, telling me "unable to send data due inactive connection". So I keep autoreconnect as true. But then it tries to shoot back a whole bunch of messages for the one I sent it (can confirm in the Chat Log that it is sending lots of messages after receiving only one), so I have to close the connection after each incoming message.

Hello. I want to integrate a character into NodeJs and trying first to get the Say Hello example running. I'm getting "Cancelled on Client". Am I doing something wrong?
Actually, it seems like it's mostly working, and I can see in the Chat Logs that a reply was generated. Just a bit confused about why the "Error: 1 CANCELLED: Cancelled on client".

Running it produces the following:

InworldPacket {
packetId: {
packetId: 'bb7fa35e-eabc-4e87-8db7-dd241bd98770',
utteranceId: '2f75d5d4-8427-45d8-9160-60ebe5ce30d6',
interactionId: '300c26a1-7c2e-42e3-98e3-6b50704db7bb'
routing: {
source: { name: '', isPlayer: true, isCharacter: false },
target: {
name: 'b8fff50d-1c96-40e0-8030-315e1865fee9',
isPlayer: false,
isCharacter: true
date: '2023-01-16T18:21:47.518Z',
type: 4,
emotions: {
joy: 0,
fear: -0.5099999904632568,
trust: 0.9900000095367432,
surprise: -0.4375,
behavior: EmotionBehavior { behavior: 15 },
strength: EmotionStrength { strength: 2 }
Error: 1 CANCELLED: Cancelled on client
at callErrorFromStatus (C:\Users\rober\nodestuff\chatnode\node_modules@grpc\grpc-js\src\call.ts:81:17)
at Object.onReceiveStatus (C:\Users\rober\nodestuff\chatnode\node_modules@grpc\grpc-js\src\client.ts:692:51)
at Object.onReceiveStatus (C:\Users\rober\nodestuff\chatnode\node_modules@grpc\grpc-js\src\client-interceptors.ts:417:48)
at C:\Users\rober\nodestuff\chatnode\node_modules@grpc\grpc-js\src\resolving-call.ts:110:24
at processTicksAndRejections (node:internal/process/task_queues:78:11)
for call at
at ServiceClientImpl.makeBidiStreamRequest (C:\Users\rober\nodestuff\chatnode\node_modules@grpc\grpc-js\src\client.ts:676:30)
at ServiceClientImpl.session (C:\Users\rober\nodestuff\chatnode\node_modules@grpc\grpc-js\src\make-client.ts:189:15)
at WorldEngineClientGrpcService.session (C:\Users\rober\nodestuff\chatnode\node_modules@inworld\nodejs-sdk\build\src\services\gprc\world_engine_client_grpc.service.js:39:40)
at ConnectionService. (C:\Users\rober\nodestuff\chatnode\node_modules@inworld\nodejs-sdk\build\src\services\connection.service.js:99:49)
at ()
at fulfilled (C:\Users\rober\nodestuff\chatnode\node_modules@inworld\nodejs-sdk\build\src\services\connection.service.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 1,
details: 'Cancelled on client',
metadata: Metadata { internalRepr: Map(0) {}, options: {} }

Any suggestions - I found that even if I just download the "Say Hello" sample from @inworld/nodejs-sdk - npm, it fails, so this appears to be a bug ion the nodeJS implementation itself.

I eventually did get it to work in my development environment.
This person has graciously shared some code on github that might help anyone else struggling:

And I realized that the shooting back of multiple messages is intended behavior. It's not too hard though to collate them into one big string by closing the connection only after msg.isInteractionEnd().