5719a13cbf
Migrate SessionPrompt to the Effect service pattern (Interface, Service, Layer, InstanceState, makeRuntime + async facades). Key design decisions: - Fiber-based cancellation replaces manual AbortController management. Effect.promise((signal) => ...) derives AbortSignals automatically; cancel() interrupts fibers and signals propagate to the AI SDK, shell processes, and tool execution. - Deferred queue replaces Promise callback queue. Concurrent loop() callers get a Deferred that resolves when the running fiber finishes. On cancel or error, queued callers now receive proper errors instead of hanging forever. - Separate loops/shells maps in InstanceState replace the single shared state object, with shell-to-loop handoff preserved: if callers queue a loop while a shell is running, shellE cleanup starts the loop. - Heavy helper functions (createUserMessage, handleSubtask, shellImpl, resolveCommand, insertReminders, ensureTitle) stay as plain async functions called via Effect.promise, keeping the migration incremental. - resolveTools and createStructuredOutputTool are unchanged (deeply tied to AI SDK tool callbacks).