Fix a couple bugs

This commit is contained in:
Brian Hackett 2025-03-19 12:49:37 -07:00
parent 3271171646
commit 6d74d355ce
2 changed files with 9 additions and 6 deletions

View File

@ -12,13 +12,10 @@ export async function getRepositoryContents(repositoryId: string): Promise<strin
// Remotely create an imported repository from the given contents.
export async function createRepositoryImported(reason: string, repositoryContents: string): Promise<string> {
const rv = (await sendCommandDedicatedClient({
method: 'Nut.createRepository',
method: 'Nut.importRepository',
params: {
repositoryContents,
origin: {
kind: 'imported',
reason,
},
reason,
},
})) as { repositoryId: string };
return rv.repositoryId;

View File

@ -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) {