import type { SupervisorStatusFile } from "../contracts/core.js"; import type { Profile, ServiceDefinition } from "../profiles/types.js"; import { type ProbeResult } from "../probes/service.probe.js"; /** ويندوز بدأ منذ أقلّ من هذا ← مهمّة الإقلاع قد تكون ما زالت تحدّث أو تُقلع. */ export declare const BOOT_RECENT_MS: number; /** انتظارُ مشرفٍ حيّ أو في إقلاعه قبل الرجوع إلى طلب الصلاحية. إقلاع النواة على قرصٍ بطيء يقارب الدقيقة. */ export declare const HANDOFF_WAIT_MS: number; /** تحديثٌ يركّبه المشرف يُبقي الانتظار حتى هذا السقف — حزمةٌ بمئات الميغابايتات على خطٍّ بطيء. */ export declare const UPDATE_WAIT_MS: number; /** منذ هذه النسخة يحدّث المشرِف النظام بنفسه عند الإقلاع وكل ليلة (مواصفة 003، ‎aa8751d‎ و‎b75860c‎). */ export declare const SELF_UPDATING_SUPERVISOR = "1.7.0"; /** * AR: **أيحدّث مشرف هذا التثبيت النظامَ بنفسه؟** لا يُسلَّم له إلّا إن كان — فمشرفٌ أقدم من 1.7.0 يُقلع ولا يحدّث * شيئاً، ونافذة UAC في ‎start‎ هي طريق التحديث الوحيد على جهازه؛ تسليمٌ له كان سيُبقيه على حزمته إلى الأبد. * ‎\supervisor\package.json‎ يقرؤه المستخدمون. ملفٌّ غائب أو لا يُقرأ ← لا تسليم: المسار القديم كما هو. * EN: **Does this install's supervisor update the system by itself?** Only then is it handed off — a supervisor * older than 1.7.0 boots and updates nothing, and `start`'s UAC prompt is the only road to an update on that * machine; handing off to it would leave it on its bundle forever. `\supervisor\package.json` is * readable by Users. A missing or unreadable file → no hand-off: the old path, unchanged. */ export declare function supervisorUpdatesItself(root: string): boolean; export type SupervisorPresence = "alive" | "booting" | "absent"; /** * AR: أيعمل مشرفٌ هنا؟ **دالّة خالصة.** حديثٌ ← حيّ. قديمٌ من قبل هذا الإقلاع، ومهمّته كانت مسجَّلة، وويندوز بدأ * للتوّ ← المشرف الجديد ما زال في تحديث ما قبل الإقلاع (لا ينبض حتى يُقلع الخدمات). وما عدا ذلك غياب. * EN: Is a supervisor at work here? **A pure function.** Fresh → alive. Stale from before this boot, with its * task registered, and Windows just started → the new supervisor is still in its pre-boot update (it does not * beat until the services are up). Anything else is absence. */ export declare function supervisorPresence(status: SupervisorStatusFile | null, now: number, uptimeMs: number): SupervisorPresence; /** * AR: أتجيب هذه الخدمة؟ ‎401/403‎ من مسار ‎/internal‎ جوابٌ: الخدمة حيّة، وهذا الحساب لا يقرأ السرّ (‎data\‎ مقفول). * خدمة البث تجيب ‎/internal/health‎ بلا سرّ منذ 2026-10-10، وما قبلها يردّ 403. * EN: Does this service answer? A 401/403 from an `/internal` path is an answer: the service is alive and this * account cannot read the secret (`data\` is locked). The live service answers `/internal/health` without it * since 2026-10-10; older ones reply 403. */ export declare function answers(service: ServiceDefinition, probe: ProbeResult): boolean; /** مُجيب الصيانة (‎maintenance-responder.ts‎): ‎503‎ برمز ‎UPDATING‎ على ‎/api‎ في منفذ النواة. */ export declare function updateInProgress(port: number, timeoutMs?: number): Promise; export interface HandoffDeps { probe(service: ServiceDefinition): Promise; updating(port: number): Promise; presence(): SupervisorPresence; now(): number; sleep(ms: number): Promise; } export type HandoffEvent = "waiting" | "updating"; /** * AR: هل تعمل الخدمات بيد المشرف — الآن، أو بعد انتظاره؟ ‎true‎ حين تجيب كلّها. ‎false‎ فوراً حين لا مشرف يعمل، * أو بعد المهلة — فيعود المُنادي إلى طلب الصلاحية والإقلاع بنفسه. * EN: Are the services up in the supervisor's hands — now, or after waiting for it? `true` once all answer. * `false` at once when no supervisor is at work, or after the wait — the caller then asks for the rights and * boots them itself. */ export declare function awaitSupervisor(profile: Profile, services: ServiceDefinition[], options?: { onEvent?: (event: HandoffEvent) => void; deps?: Partial; }): Promise; //# sourceMappingURL=handoff.d.ts.map