Merge pull request #12 from Jeff-Emmett/add-runpod-AI-API

Add runpod ai api
This commit is contained in:
Jeff Emmett 2025-11-16 02:52:01 -07:00 committed by GitHub
commit 7c0c888276
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 30 additions and 40 deletions

View File

@ -48,7 +48,15 @@ export class CloudflareAdapter {
// Focus on the store data which is what actually changes
const storeData = doc.store || {}
const storeKeys = Object.keys(storeData).sort()
const storeString = JSON.stringify(storeData, storeKeys)
// CRITICAL FIX: JSON.stringify's second parameter when it's an array is a replacer
// that only includes those properties. We need to stringify the entire store object.
// To ensure stable ordering, create a new object with sorted keys
const sortedStore: any = {}
for (const key of storeKeys) {
sortedStore[key] = storeData[key]
}
const storeString = JSON.stringify(sortedStore)
// Simple hash function (you could use a more sophisticated one if needed)
let hash = 0

View File

@ -59,43 +59,8 @@ export function CustomToolbar() {
}
}, [showProfilePopup])
// Keyboard shortcut for Alt+O to open Obsidian vault browser
useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
// Check for Alt+O (keyCode 79 for 'O')
if (event.altKey && event.key === 'o') {
event.preventDefault()
// If vault browser is already open, close it
if (showVaultBrowser) {
console.log('🔧 Alt+O pressed, vault browser already open, closing it')
setShowVaultBrowser(false)
return
}
// Check if user already has a vault selected
if (session.obsidianVaultPath && session.obsidianVaultPath !== 'folder-selected') {
console.log('🔧 Alt+O pressed, vault already selected, opening search interface')
setVaultBrowserMode('keyboard')
setShowVaultBrowser(true)
} else if (session.obsidianVaultPath === 'folder-selected' && session.obsidianVaultName) {
console.log('🔧 Alt+O pressed, folder-selected vault exists, opening search interface')
setVaultBrowserMode('keyboard')
setShowVaultBrowser(true)
} else {
console.log('🔧 Alt+O pressed, no vault selected, opening vault selection')
setVaultBrowserMode('keyboard')
setShowVaultBrowser(true)
}
}
}
document.addEventListener('keydown', handleKeyDown)
return () => {
document.removeEventListener('keydown', handleKeyDown)
}
}, [session.obsidianVaultPath, session.obsidianVaultName, showVaultBrowser])
// Alt+O is now handled by the tool system via overrides.tsx
// It selects the ObsidianNote tool, which waits for canvas click before deploying
// Listen for open-fathom-meetings event - now creates a shape instead of modal
useEffect(() => {

View File

@ -478,7 +478,7 @@ export const overrides: TLUiOverrides = {
openObsidianBrowser: {
id: "open-obsidian-browser",
label: "Open Obsidian Browser",
kbd: "alt+o",
// Removed kbd: "alt+o" - Alt+O now selects the ObsidianNote tool instead
readonlyOk: true,
onSelect: () => {
// Trigger the Obsidian browser to open

View File

@ -427,7 +427,15 @@ export class AutomergeDurableObject {
// Focus on the store data which is what actually changes
const storeData = doc.store || {}
const storeKeys = Object.keys(storeData).sort()
const storeString = JSON.stringify(storeData, storeKeys)
// CRITICAL FIX: JSON.stringify's second parameter when it's an array is a replacer
// that only includes those properties. We need to stringify the entire store object.
// To ensure stable ordering, create a new object with sorted keys
const sortedStore: any = {}
for (const key of storeKeys) {
sortedStore[key] = storeData[key]
}
const storeString = JSON.stringify(sortedStore)
// Simple hash function (you could use a more sophisticated one if needed)
let hash = 0

View File

@ -28,6 +28,15 @@ bindings = [
tag = "v1"
new_classes = ["AutomergeDurableObject"]
# Migration to handle transition from TldrawDurableObject to AutomergeDurableObject
# This ensures existing TldrawDurableObject instances can continue working
# while new connections use AutomergeDurableObject
[[migrations]]
tag = "v2"
# Note: We keep TldrawDurableObject as a stub (extends AutomergeDurableObject)
# so existing instances continue to work. New instances will use AutomergeDurableObject.
# The stub class ensures backward compatibility during the transition period.
[[r2_buckets]]
binding = 'TLDRAW_BUCKET'
bucket_name = 'jeffemmett-canvas'