شعار Hedera Agent Kit V4 Migration

Hedera Agent Kit V4 Migration

مؤسسة
hedera-dev
Hedera Agent Kit v4 Migration

This skill should be used when the user asks to "migrate to hedera-agent-kit v4", "upgrade hak v3 to v4", "convert plugin to BaseTool", "migrate Tool to BaseTool", "rename hedera-agent-kit imports", "fix v3 deprecation warnings", or has a project still on `hedera-agent-kit@3.x` / `@hashgraph/sdk` that needs to move to `@hashgraph/hedera-agent-kit@4.x` / `@hiero-ledger/sdk`. Covers both custom-plugin migration (Tool → BaseTool) and toolkit-consumer migration (LangChain/AI SDK/ElizaOS/MCP).

نظرة عامة

الناشرhedera-dev
المستودعhedera-skills
اسم المهارةHedera Agent Kit v4 Migration
النجوم
37
التفريعات
18
الملفات المرفقة
5
الترخيصApache-2.0
الروابط
  • تعليمات بصيغة Markdown

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

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

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

  • الملفات المرفقة: 5

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

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

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

التثبيت

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

1

التثبيت في TypingMind

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

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/hedera-dev/hedera-skills/tree/master/plugins/agent-kit-plugin/skills/agent-kit-v4-migration
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/hedera-dev/hedera-skills.git /tmp/hedera-skills
mkdir -p .claude/skills
cp -r /tmp/hedera-skills/plugins/agent-kit-plugin/skills/agent-kit-v4-migration .claude/skills/hedera-dev-hedera-agent-kit-v4-migration
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

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

يُحمّل النموذج مهارة Hedera Agent Kit V4 Migration تلقائيًا بمجرد ورود طلب ذي صلة بها.

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

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

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

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

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

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

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

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

Migrating Hedera Agent Kit v3 → v4

This skill drives a complete v3 → v4 migration. v4 is the current major; v3 (hedera-agent-kit@3.x) no longer receives updates. Use this skill whenever you see code importing from hedera-agent-kit (unscoped) or @hashgraph/sdk.

Quick triage — what kind of v3 code is this?

Before editing anything, classify the file you are migrating. The migration steps differ.

If the file…It's a…Apply
Defines a Plugin and exports tool factories that return object literals with an execute functionCustom pluginPlugin migration + BaseTool migration
Calls new HederaLangchainToolkit / HederaAIToolkit / HederaElizaOSToolkit / HederaMCPToolkitToolkit consumerToolkit migration
Imports plugins like coreTokenPlugin, coreAccountPlugin, coreHTSPluginToolkit consumer (uses built-in plugins)Toolkit migration + alias rename
Imports ResponseParserService or HederaMCPServer from hedera-agent-kitToolkit consumerToolkit migration (these moved to toolkit packages)
BothRun toolkit migration first, then plugin migration for each tool

Migration workflow

Step 1 — find every v3 entry point

Run these searches at the project root before editing anything. They give you the migration surface in one shot:

bash
# Old package name in source and dependency manifests
grep -rn "from ['\"]hedera-agent-kit" .
grep -n '"hedera-agent-kit"' package.json

# Old SDK package
grep -rn "from ['\"]@hashgraph/sdk" .
grep -n '"@hashgraph/sdk"' package.json

# Deprecated plugin aliases
grep -rn "coreHTSPlugin\|coreSCSPlugin\|coreQueriesPlugin" .

# Old subpath import
grep -rn "from ['\"]hedera-agent-kit/elizaos" .

# v3 functional Tool pattern (object literal with execute)
grep -rn "execute: " . --include="*.ts" | grep -i "tool"

Build a list of files to edit; do not start mutating yet.

Step 2 — update package.json

Replace dependencies, then run install. See references/breaking-changes.md § "Package mapping" for the complete table and § "Versioning" for version ranges. Quick form:

  • Remove: hedera-agent-kit, @hashgraph/sdk. Drop @langchain/core, langchain, @langchain/langgraph, ai only if your code never imports from them directly — they are transitive deps of the toolkit, so package managers with strict resolution (bun, pnpm) won't satisfy direct imports unless you keep them. When in doubt, keep them as devDeps.
  • Add: @hashgraph/hedera-agent-kit (use ^4.0.0) and @hiero-ledger/sdk (use ^2.81.0), plus exactly one toolkit package for your framework. Toolkit packages are NOT on ^4 — they re-baselined at 1.0.0 for this release. Use ^1.0.0 for @hashgraph/hedera-agent-kit-langchain / -ai-sdk / -elizaos / -mcp. Run npm view <pkg> version to confirm before pinning.
  • Keep: the LLM provider (@langchain/openai, @ai-sdk/openai, @langchain/anthropic, etc.) — toolkits never bundle providers. LangChain consumers must also bump the provider package to its 1.x line (e.g. @langchain/openai@^1); the 0.x line depends on @langchain/core@^0.3 and produces dual-package type errors against the toolkit's @langchain/core@^1. See references/breaking-changes.md § "LangChain ecosystem bump".

Step 3 — rewrite imports

Apply the find-and-replace map from references/import-cheatsheet.md. Key moves:

diff
- from 'hedera-agent-kit'        → from '@hashgraph/hedera-agent-kit'
- from '@hashgraph/sdk'          → from '@hiero-ledger/sdk'
- from 'hedera-agent-kit/elizaos' → from '@hashgraph/hedera-agent-kit-elizaos'

Plugins must come from the /plugins subpath:

diff
- import { coreTokenPlugin } from 'hedera-agent-kit'
+ import { coreTokenPlugin } from '@hashgraph/hedera-agent-kit/plugins'

Rename deprecated aliases:

RemovedReplacement
coreHTSPlugincoreTokenPlugin
coreSCSPlugincoreEVMPlugin
coreQueriesPluginIndividual plugins: coreAccountQueryPlugin, coreTokenQueryPlugin, coreConsensusQueryPlugin, coreEVMQueryPlugin, coreMiscQueriesPlugin, coreTransactionQueryPlugin

Toolkits and their helpers each moved to a dedicated package:

diff
- import { HederaLangchainToolkit, ResponseParserService } from 'hedera-agent-kit'
+ import { HederaLangchainToolkit, ResponseParserService } from '@hashgraph/hedera-agent-kit-langchain'

- import { HederaAIToolkit } from 'hedera-agent-kit'
+ import { HederaAIToolkit } from '@hashgraph/hedera-agent-kit-ai-sdk'

- import { HederaMCPToolkit } from 'hedera-agent-kit'
+ import { HederaMCPToolkit } from '@hashgraph/hedera-agent-kit-mcp'

AgentMode, Configuration, Context, Plugin, Tool, BaseTool, handleTransaction, output parsers, mirrornode types — all stay in @hashgraph/hedera-agent-kit.

Step 4 — fix the silent behaviour change in toolkit configuration

In v3 an empty plugins: [] may have loaded default tools. In v4, empty means zero tools. This will not throw — the agent will silently have nothing to call. Audit every toolkit construction:

typescript
// v4: pass plugins explicitly
import { allCorePlugins } from '@hashgraph/hedera-agent-kit/plugins';

new HederaLangchainToolkit({
  client,
  configuration: {
    plugins: allCorePlugins,           // or list specific plugins
    context: { mode: AgentMode.AUTONOMOUS },
  },
});

Use allCorePlugins to preserve v3's "everything" default. Prefer explicit lists when the user wants a smaller tool surface; bundlers tree-shake either way.

Step 5 — handle RETURN_BYTES consumers

If any code reads parsedData.raw.bytes from ResponseParserService and converts it (e.g. Buffer.isBuffer(...), Buffer.from(obj.data)), delete the conversion. v4 standardises raw.bytes to Uint8Array everywhere; passing it directly to Transaction.fromBytes() works in Node and browser. See references/breaking-changes.md § "RETURN_BYTES".

Step 6 — migrate every custom plugin tool to BaseTool

BaseTool is the supported shape for tools in v4. Every custom tool must be migrated — the v3 functional pattern (object literal with an execute function) is no longer the supported authoring style and bypasses the hooks/policies system (HcsAuditTrailHook, MaxRecipientsPolicy, RejectToolPolicy, and any subclass of AbstractHook/AbstractPolicy). Migrate every tool the plugin exports; do not leave a mix of old- and new-style tools.

Full step-by-step recipe with annotated before/after: references/basetool-migration.md.

Mechanical summary:

  1. Replace import type { Tool } with import { BaseTool } from @hashgraph/hedera-agent-kit.
  2. Rewrite the factory: (context: Context): Tool => ({ ... execute }) becomes a class extending BaseTool and a one-line factory (context) => new MyTool(context).
  3. Split the body of the old execute function into:
    • normalizeParams (resolve defaults, validate format)
    • coreAction (build the Transaction for mutations, fetch the data for queries)
    • secondaryAction (call handleTransaction(...) for mutations; pass-through for queries)
  4. For query-only tools, override shouldSecondaryAction to return false and provide a no-op secondaryAction.
  5. Move the try/catch body into an handleError(error, context) override (BaseTool calls it from any failed stage).
  6. Keep the factory return type BaseTool — Plugin.tools() accepts it directly.

The example under examples/transfer-hbar-migration/ shows the full transformation on the canonical transfer_hbar tool.

Step 7 — verify

After mutating files, run in this order:

  1. npm install (or bun install / pnpm install) — confirms package.json resolves. Watch for "no version matching X" errors; toolkit packages are on ^1, not ^4.
  2. tsc --noEmit (or npm run build) — picks up missing imports and type drifts (e.g. setTreasuryAccountId complaining because a normalised type was not declared, or noImplicitOverride complaining about a missing override keyword on handleError / secondaryAction).
  3. For LangChain consumers, type errors mentioning two different @langchain/core paths (one nested under your provider package, one nested under the toolkit) indicate a dual-package situation — the provider package is still on 0.x. Bump it to 1.x per Step 2.
  4. For LangChain consumers, errors like Cannot find module 'langchain/agents' or 'langchain/memory' indicate the legacy AgentExecutor/BufferMemory pattern — these subpaths were removed in langchain@1.x. The fix is a separate framework migration to createReactAgent from @langchain/langgraph/prebuilt. See references/breaking-changes.md § "LangChain ecosystem bump".
  5. Smoke-test the agent: instantiate the toolkit, list tools (toolkit.getTools().length must be > 0), invoke one tool end-to-end. A passing build does not prove the migration worked — the empty-plugins-array footgun is type-safe and silent.

What this skill does NOT cover

  • Solidity / system-contracts migration — see the system-contracts plugin.
  • Native JS SDK changes inside @hiero-ledger/sdk itself — only the import path changes; the API surface remained stable across the rename.
  • Plugin authoring patterns from scratch — see the agent-kit-plugin skill.
  • Writing new hooks/policies — see agent-kit-hook and agent-kit-policy skills. Migration to BaseTool is the prerequisite for those features.
  • LangChain framework migration (AgentExecutor → createReactAgent, BufferMemory → messages-based history). The v4 LangChain toolkit forces a bump to langchain@1.x, which removes these APIs, but rewriting the agent setup is a LangChain-side concern. references/breaking-changes.md § "LangChain ecosystem bump" sketches the shape of the change; consult LangChain's own migration guide for details.

Reference index

  • references/breaking-changes.md — every breaking change, package mapping, install commands, version-bump notes.
  • references/import-cheatsheet.md — flat find-and-replace table; load this when sweeping files.
  • references/basetool-migration.md — annotated before/after for converting one tool from the Tool object literal to a BaseTool subclass, including the query-only variant.
  • examples/transfer-hbar-migration/ — before-v3.ts and after-v4.ts of the same tool, side by side, with a README.md walking through every change.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

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

ماذا تفعل مهارة الذكاء الاصطناعي Hedera Agent Kit V4 Migration؟

This skill should be used when the user asks to "migrate to hedera-agent-kit v4", "upgrade hak v3 to v4", "convert plugin to BaseTool", "migrate Tool to BaseTool", "rename hedera-agent-kit imports", "fix v3 deprecation warnings", or has a project still on `hedera-agent-kit@3.x` / `@hashgraph/sdk` that needs to move to `@hashgraph/hedera-agent-kit@4.x` / `@hiero-ledger/sdk`. Covers both custom-plugin migration (Tool → BaseTool) and toolkit-consumer migration (LangChain/AI SDK/ElizaOS/MCP).

لماذا تستخدم Hedera Agent Kit V4 Migration على TypingMind؟

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

كيف أثبّت Hedera Agent Kit V4 Migration في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/hedera-dev/hedera-skills/tree/master/plugins/agent-kit-plugin/skills/agent-kit-v4-migration. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Hedera Agent Kit V4 Migration؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Hedera Agent Kit V4 Migration؟

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

هل مهارة الذكاء الاصطناعي Hedera Agent Kit V4 Migration مجانية؟

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

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

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

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

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

عرض الكل

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

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