import type { RemoteStateFiles } from "../contracts/core.js"; import type { Profile } from "../profiles/types.js"; /** * AR: أسماء ملفّات القناة بين المشرف والنواة — نسخة الـ CLI (٠٢٠). * * **نسختان لا واحدة، والسبب مقيس:** ‎@fantastic/shared-types‎ حزمة أنواع فقط تُشحن مصدرًا خامًّا * بلا خطوة بناء، فاستيراد **قيمة** منها يفشل عند الإقلاع. والانحراف بين النسختين يمنعه اختبار * ‎remote-contract.spec.ts‎ الذي يقرأهما ويقارن قيمهما — فاسمٌ يتغيّر هنا وحده يُفشل البناء بدل * أن يُنتج طلبًا لا يقرؤه أحد. * EN: The names of the supervisor↔core channel files — the CLI's copy (020). * * **Two copies rather than one, and the reason was measured:** `@fantastic/shared-types` is a * types-only package shipped as raw source with no build step, so importing a **value** from it * fails at boot. Drift between the copies is prevented by `remote-contract.spec.ts`, which reads * both and compares their values — so a name changed here alone fails the build instead of * producing a request nobody reads. */ export declare const REMOTE_STATE_FILES: RemoteStateFiles; /** * بعده يُعدّ نبض المشرف قديمًا. نفس القيمة التي تقرأ بها النواة الملفّ — ولا يجوز أن تتباعدا. يقرؤه ‎doctor‎ * و‎start‎ (‎handoff.ts‎) من هنا لا من نسختين. */ export declare const HEARTBEAT_STALE_MS = 90000; export declare function stateFilePath(profile: Profile, name: string): string; /** يقرأ ملفّ JSON من مجلد الحالة، أو ‎null‎ حين لا يوجد أو تعذّرت قراءته. */ export declare function readStateJson(profile: Profile, name: string): T | null; /** يكتب ملفّ JSON ذرّيًّا. */ export declare function writeStateJson(profile: Profile, name: string, value: unknown): void; /** * فحص 2026-10-08 (U5): ملفّ تحكّمٍ كتبته النواة، يُقبل موقَّعاً وحده (انظر ‎control-mac.ts‎). غير الموقَّع أو المزوَّر يُقرأ * كأنه غير موجود — جدولٌ زرعه غير النواة لا يُشغَّل. */ export declare function readSignedStateJson(profile: Profile, name: string): T | null; export declare function removeStateFile(profile: Profile, name: string): void; /** * AR: يطالب بملفّ لمرّة واحدة ثم يقرؤه ويحذفه. يعيد ‎null‎ إن لم يكن هناك شيء يُستهلَك. * المطالبة بإعادة التسمية أولًا هي ما يجعل «مرّة واحدة» صحيحة حتى لو عمل مشرفان بالخطأ. * EN: Claims a one-shot file, reads it, and deletes it. Returns `null` when there is nothing to * consume. Claiming by renaming first is what makes "once" true even if two supervisors are * running by mistake. */ export declare function takeStateJson(profile: Profile, name: string): T | null; //# sourceMappingURL=state-files.d.ts.map