chore: 导入清理前的完整工程状态(含 Capacitor 原生壳,作为回滚备份点)

This commit is contained in:
toor
2026-10-21 11:50:10 +08:00
committed by trae-solo-agent
commit 8ded87a3a8
389 changed files with 52242 additions and 0 deletions
@@ -0,0 +1,31 @@
import type { RecipeReport, SearchSignal } from '~/adapters/feedback'
import { createFeedbackRemote } from '~/adapters/feedback'
import { getDeviceId, signalKey } from '~/utils/feedback'
const sentSignals = new Set<string>()
/**
* Recipe reports and anonymous search signals, sent to the `cook-feedback`
* cloud function. Signals are best effort and never surface errors.
*/
export function useRecipeFeedback() {
const auth = useYunlefunAuth()
const remote = () => createFeedbackRemote(auth.callFunction, getDeviceId())
async function report(input: RecipeReport): Promise<void> {
await remote().report(input)
}
function signal(input: SearchSignal): void {
if (!import.meta.client || !input.stuff.length)
return
const key = signalKey(input)
if (sentSignals.has(key))
return
sentSignals.add(key)
// Fire once per session even if it fails, so an unconfigured backend is not retried on every change.
remote().signal(input).catch(() => {})
}
return { report, signal }
}