import { type InstalledProduct } from "../registry/local-registry.js"; /** المنتج الوحيد المشحون اليوم. يُقرأ هنا لا في ‎install.ts‎ وحده: ثلاثة أوامر تحتاجه الآن. */ export declare const DEFAULT_PRODUCT = "estraha"; export interface ApplianceIdentity { product: string; /** غائبٌ حين لم يُسجَّل — فيُسأل عنه، ولا يُعدّ ذلك عطلًا. */ code?: string; } /** * AR: الجزء الذي يُتّخذ فيه القرار، نقيًّا وبلا قرصٍ ولا سجلّ — فيُختبَر بمصفوفة. * * **الجذر أوّلًا، ثم الاسم المطلوب، ثم الافتراضيّ.** ولا يُخمَّن صفٌّ واحدٌ عند التعدّد كما * يفعل ‎resolveProduct‎: هناك السؤال «أيّ جهازٍ يقصد المستخدم؟» وهنا «أيّ صفٍّ يصف هذا الجذر * بعينه؟» — ولهما جوابان مختلفان على آلةٍ فيها جهازان. * EN: The part where the decision is made — pure, with no disk and no registry, so it is tested with * an array. * * **The root first, then the requested name, then the default.** A single row is never guessed at * when there are several, the way `resolveProduct` does: there the question is "which appliance * does the user mean?" and here it is "which row describes *this* root?" — two different answers * on a machine holding two appliances. */ export declare function identityForRoot(products: InstalledProduct[], root: string, requested?: string): ApplianceIdentity; /** * AR: نفس القرار، على سجلّ الآلة الحقيقيّ. * * **والكود يُقرأ من ملفّه المحميّ لا من الفهرس.** كان مكتوبًا نصًّا في ‎registry.json‎، وذلك * الملفّ مقروءٌ لكل مستخدمٍ محلّي بالافتراض، والكود هو ما يَسحب المقاعد من الرخصة. فيُنقَل هنا * — عند أوّل قراءةٍ بعد ترقية الواجهة — إلى ملفٍّ لا يقرؤه إلّا مدير الآلة، ويُمحى من الفهرس. * * وقراءةُ الفهرس تبقى احتياطًا خلف الملفّ: بينهما لحظةٌ قد يتعذّر فيها الترحيل (حسابٌ بلا * كتابة)، ولا يجوز أن يفقد الجهاز فيها قدرته على سؤال المركز. * EN: The same decision, against the machine's real registry. * * **And the code is read from its protected file rather than from the index.** It used to sit in * plain text inside `registry.json`, a file every local user can read by default, and the code is * what draws seats from a licence. So it is moved here — on the first read after the CLI is * upgraded — into a file only the machine's administrator can read, and erased from the index. * * Reading the index stays as a fallback behind the file: between them lies a moment where the * migration may fail (an account without write access), and the appliance must not lose its * ability to ask the centre in it. */ export declare function applianceIdentity(root: string, requested?: string): ApplianceIdentity; //# sourceMappingURL=identity.d.ts.map