From 6d74d355cec864c2374255c16ca395399d139885 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Wed, 19 Mar 2025 12:49:37 -0700 Subject: [PATCH] Fix a couple bugs --- app/lib/replay/Repository.ts | 7 ++----- app/lib/replay/SimulationPrompt.ts | 8 +++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/lib/replay/Repository.ts b/app/lib/replay/Repository.ts index 7f58f1c1..970ca69c 100644 --- a/app/lib/replay/Repository.ts +++ b/app/lib/replay/Repository.ts @@ -12,13 +12,10 @@ export async function getRepositoryContents(repositoryId: string): Promise { const rv = (await sendCommandDedicatedClient({ - method: 'Nut.createRepository', + method: 'Nut.importRepository', params: { repositoryContents, - origin: { - kind: 'imported', - reason, - }, + reason, }, })) as { repositoryId: string }; return rv.repositoryId; diff --git a/app/lib/replay/SimulationPrompt.ts b/app/lib/replay/SimulationPrompt.ts index 3bf109d8..b95fe70b 100644 --- a/app/lib/replay/SimulationPrompt.ts +++ b/app/lib/replay/SimulationPrompt.ts @@ -110,11 +110,17 @@ class ChatManager { }); } - finishSimulationData() { + async finishSimulationData() { assert(this.client, 'Chat has been destroyed'); assert(!this.simulationFinished, 'Simulation has been finished'); this.simulationFinished = true; + + const chatId = await this.chatIdPromise; + await this.client.sendCommand({ + method: 'Nut.finishSimulationData', + params: { chatId }, + }); } async sendChatMessage(messages: Message[], references: ChatReference[], onResponsePart: ChatResponsePartCallback) {