Forked from OpenCode v1.17.4 with multi-agent system: - 5 agents: aircoding, scheduler, worker, architect, reviewer - Deterministic DAG scheduling engine (coordinator_tick) - Tool whitelists as hard enforcement - AirCoding validation plugin - System prompt injection for routing - V1 requirements: C4 docs, ADR, AGENTS.md, debug-log.md - Design documents in docs/
25 lines
579 B
TypeScript
25 lines
579 B
TypeScript
const accepted = new Set<string>()
|
|
|
|
function key(sessionID: string, directory?: string) {
|
|
return `${directory ?? ""}:${sessionID}`
|
|
}
|
|
|
|
export function usePermission() {
|
|
return {
|
|
autoResponds() {
|
|
return false
|
|
},
|
|
isAutoAccepting(sessionID: string, directory?: string) {
|
|
return accepted.has(key(sessionID, directory))
|
|
},
|
|
toggleAutoAccept(sessionID: string, directory?: string) {
|
|
const next = key(sessionID, directory)
|
|
if (accepted.has(next)) {
|
|
accepted.delete(next)
|
|
return
|
|
}
|
|
accepted.add(next)
|
|
},
|
|
}
|
|
}
|