Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/conversation-permissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hashintel/petrinaut": patch
---

Allow hosts to show interactive tool controls only for matching tool calls, such as a destructive change waiting for approval.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@ interface ConversationStorage {
setItem(key: string, value: string): void;
}

/** Change only the pointer; old conversation history and the model are retained. */
export const replaceBrunchConversationId = (
netId: string,
conversationId: string,
storage: ConversationStorage = window.localStorage,
): void => {
let stored: Record<string, string> = {};
try {
stored = JSON.parse(
storage.getItem(conversationStorageKey) ?? "{}",
) as Record<string, string>;
} catch {
// A broken pointer cache must not prevent starting a new conversation.
}
try {
storage.setItem(
conversationStorageKey,
JSON.stringify({ ...stored, [netId]: conversationId }),
);
} catch {
// The host retains the new id for this page load.
}
};

export const getOrCreateBrunchConversationId = (
netId: string,
storage: ConversationStorage = window.localStorage,
Expand Down
Loading
Loading