شعار Cloud Sync Module

Cloud Sync Module

مؤسسة
LedgerHQ
cloud-sync-module

اكتب `cloudSyncModule.ts` أو راجعه أو صحّح أخطاءه — وهو `CloudSyncDataManager` يزامن جزءًا واحدًا من بيانات المستخدم عبر Ledger Sync (Cloud Sync). يغطي ذلك العقد وثوابته واختبار العقد الإلزامي وقائمة التحقق من الربط ومخاطر فقدان البيانات. استخدمه لأي عمل على `**/cloudSyncModule.ts` أو `createAggregator` أو `@shared/cloud-sync-module`.

Add to TypingMind

نظرة عامة

الناشرLedgerHQ
المستودعledger-live
اسم المهارةcloud-sync-module
النجوم
622
التفريعات
491
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها LedgerHQ على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Cloud Sync Module في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/LedgerHQ/ledger-live/tree/develop/.agents/skills/cloud-sync-module
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LedgerHQ/ledger-live.git /tmp/ledger-live
mkdir -p .claude/skills
cp -r /tmp/ledger-live/.agents/skills/cloud-sync-module .claude/skills/cloud-sync-module
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Cloud Sync Module في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Cloud Sync Module تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Cloud Sync Module بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Authoring a cloudSyncModule.ts

A module reconciles LocalState (what the app holds, from Redux) with DistantState (what is stored encrypted in Cloud Sync). createAggregator composes every module into one blob shared by all of the user's instances (LWD, LWM, web-tools).

Concepts: 05-wallet-sync-data-manager, then 06-watch-loop for when each hook fires. Steps and a video: cookbook. Testing layers: test-strategy. Contract: @shared/cloud-sync-module. Copy account-name (simplest); accounts for async + injected ctx; recent-addresses for the tolerant-list schema only — its .transform() use is a known bug (see below).

The three hooks

HookSync?RunsMust return
diffLocalToDistant(local, latest)syncevery loop tick (~10s) before push{ hasChanges, nextState } — what to push
resolveIncrementalUpdate(local, latest, incoming)asyncon pull and every tick with incoming === latest{ hasChanges: false } or { hasChanges: true, update }
applyUpdate(local, update)synconly when the above reported changesthe new LocalState (pure, no mutation)

Live under domain/entity/<name>/src/cloudSyncModule.ts beside schema.ts + slice.ts (see domain/entity/README.md). Type it CloudSyncDataManager<LocalState, Update, typeof schema>, with hasChanges: false as const so the union narrows. A 4th generic DistantState defaults to z.infer<Schema> — pass the raw wire type explicitly if your schema transforms, since that is what the hooks actually receive.

Invariants — break one and the loop misbehaves

  1. resolveIncrementalUpdate short-circuits on incoming == null, on incoming === latest, and on incoming being content-equal to local. The reference check alone only covers makeLocalIncrementalUpdate, which passes one object as both args every tick; every pull hands you a freshly decrypted one (incrementalUpdates.ts, makeSaveNewUpdate). Without the content check, an unchanged pull dispatches → re-renders → pushes, forever.
  2. diffLocalToDistant(emptyLocal, null) → hasChanges: false, or every user who never touched the feature creates Cloud Sync data on first launch.
  3. Stability: re-diffing against your own nextState yields hasChanges: false. No Date.now(), no random ids, no unstable key order.
  4. Round-trip: the comparator must ignore any field applyUpdate cannot reproduce exactly (recent-addresses stores lastUsed but never compares it — comparing it would loop forever).
  5. Convergence: after applyUpdate from an incoming state, diffing against that state reports no changes.
  6. Purity: LocalState comes from Redux and is Immer-frozen. Never mutate — return new objects.

Risks to evaluate before writing a line

  • Wiping every instance's data. Persist LocalState with the same lifetime as walletSyncState.version (exportWalletState / importWalletState, both apps). Otherwise a restart finds the version "up-to-date", never pulls, and diffLocalToDistant(empty, latest) pushes an empty state that deletes the data everywhere.
  • A too-strict schema kills sync, or overwrites data. CloudSyncSDK parses the whole aggregate on every pull and push, so one module rejecting another version's payload stops sync for accounts, names, everything. On the persisted path parseDistantState (walletSyncComposition.ts) safeParses and returns null instead — which the loop reads as "no distant state" and pushes over. Stay permissive: optional fields, z.unknown() + safeParse-and-filter for lists, never .strict().
  • A .transform()'s output is discarded in production. Both call sites above do parse — the transform executes — then pass the raw JSON on, to preserve unknown fields. Hooks therefore get un-normalised data typed as the transform's output, a lie TypeScript will not catch; normalise in the hooks instead. The contract suite won't catch it either: it only ever replays states your own diffLocalToDistant produced (the idempotence case runs one back through schema.parse()), never the legacy payload an older version actually wrote.
  • No migrations, ever. The wire format is permanent and shared across app versions: add optional fields only, never rename, repurpose or require a key. Rebuilding nextState from scratch (account-name, recent-addresses) is safe only while your subtree is a total function of LocalState — once it can carry a field you don't own, apply your diff on top of latest as accounts does, or you silently delete the other version's data. recent-addresses already violates this: it drops the ensName its own schema declares.
  • Payload and privacy. One blob holds every module: store the minimum needed to restore the state (descriptors, ids), nothing refetchable, no raw device/user ids (client-ids).
  • Async blocks the loop. resolveIncrementalUpdate runs inside the pull's atomic lock. Network work must be batched and recoverable — see accounts' nonImportedAccountInfos + backoff queue.
  • Injected dependencies? The interface has no ctx: export a bindCtx(ctx) factory, as accounts does.

Tests

describeCloudSyncModuleContract is mandatory, but a floor rather than a proof. It covers invariants 1-3 and 5, JSON serialisability, a 1MB ceiling, and a 5ms average over 100 calls — for diffLocalToDistant and applyUpdate only. It skips invariant 4 and resolveIncrementalUpdate's cost, and wraps its convergence and applyUpdate cases in if (result.hasChanges), so a module that always answers hasChanges: false passes them silently.

ts
// src/__tests__/cloudSyncModule.test.ts
import { describeCloudSyncModuleContract } from "@shared/cloud-sync-module/moduleRequirements";

describeCloudSyncModuleContract("<name>SyncModule contract", <name>SyncModule, {
  emptyLocalState,
  nonEmptyLocalState,
  matchingDistantState, // optional — always provide it, it unlocks 2 extra checks
});

Then add module-specific cases:

TargetCover
schemavalid payload · garbage/unknown entries tolerated, not thrown · fields written by a future version survive
diffLocalToDistantnull latest · exact match · added · modified · removed · fields it must ignore (invariant 4)
resolveIncrementalUpdatenull incoming · same reference · same content, different reference · real change · the raw payload rather than schema.parse()'s output (the only way to catch the transform trap)
applyUpdateexpected state · does not mutate localData · is reached at all — assert hasChanges: true explicitly instead of trusting the contract suite

Run pnpm --filter @domain/entity-<name> test; copy a sibling entity package's jest config (testEnvironment: "node", roots: ["<rootDir>/src"]).

Wiring checklist

Registration is where the module becomes real — and where the persistence risk above lives.

  1. walletSyncComposition.ts — add the key to createAggregator({...}) and to the hand-maintained walletSyncSchema (they are duplicated; miss the second and your key silently vanishes from WalletSyncDistantState).
  2. Reducers — LWD wallet.core.ts, LWM wallet.ts: reducer, ExportedWalletState, exportWalletState, walletStateExportShouldDiffer, importWalletState.
  3. useWatchWalletSync.ts — LWD, LWM: add the key to localStateSelector and dispatch it in save.
  4. AppAccountsSync.tsx — a third full registration site (its own createAggregator, AggLocalState, localStateSelector). It is also the only place to verify by hand, with several web-tools tabs as separate instances.
  5. Changeset (create-changeset) and a line in scenarios.md.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Cloud Sync Module؟

اكتب `cloudSyncModule.ts` أو راجعه أو صحّح أخطاءه — وهو `CloudSyncDataManager` يزامن جزءًا واحدًا من بيانات المستخدم عبر Ledger Sync (Cloud Sync). يغطي ذلك العقد وثوابته واختبار العقد الإلزامي وقائمة التحقق من الربط ومخاطر فقدان البيانات. استخدمه لأي عمل على `**/cloudSyncModule.ts` أو `createAggregator` أو `@shared/cloud-sync-module`.

لماذا تستخدم Cloud Sync Module على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Cloud Sync Module عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Cloud Sync Module في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/LedgerHQ/ledger-live/tree/develop/.agents/skills/cloud-sync-module. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Cloud Sync Module؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Cloud Sync Module؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Cloud Sync Module معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Cloud Sync Module مجانية؟

نعم. نشرها LedgerHQ على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل
شعار openclaw

Graincrawl

openclaw
مؤسسةشائع

أرشيف Granola: البحث، وحداثة المزامنة، والملاحظات، والنصوص المفرغة، واللوحات، وإحصاءات SQL، وأعمال مستودعات Graincrawl.

82.2K
391K
الملفات: 1
عرض
شعار openclaw

Openclaw Changelog Update

openclaw
مؤسسةشائع

أعِد إنشاء أقسام سجل تغييرات إصدارات OpenClaw استنادًا إلى سجل git قبل إصدارات beta أو stable أو extended-stable.

82.2K
391K
الملفات: 1
عرض
شعار openclaw

Openclaw Ci Limits

openclaw
مؤسسةشائع

أدِر سعة GitHub Actions وBlacksmith CI في OpenClaw، وميزانيات تسجيل المشغّلات، وحدود التوزيع المتوازي، وضمان تشغيل مهمة واحدة لكل دفعة دفع إلى main، وتحديد أحجام الأجزاء، ونقل الأحمال إلى المشغّلات المستضافة، وصحة قائمة الانتظار، والتدرّج الآمن في خفض السعة وزيادتها…

82.2K
391K
الملفات: 1
عرض
شعار openclaw

Openclaw Debugging

openclaw
مؤسسةشائع

شخّص مشكلات النماذج ومزوّدي الخدمة وواجهات الأدوات ووضع البرمجة والبث المباشر وسلوك OpenClaw المباشر/Crabbox، باختيار السجلات والفحوصات ومسار التحقق المناسب قبل تغيير الشيفرة، بما في ذلك جلب الجلسات المحفوظة…

82.2K
391K
الملفات: 1
عرض

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇