@hashgraphonline/standards-agent-kit 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index12.js +8 -0
- package/dist/_virtual/index12.js.map +1 -0
- package/dist/_virtual/index13.js +5 -0
- package/dist/_virtual/index13.js.map +1 -0
- package/dist/_virtual/index14.js +5 -0
- package/dist/_virtual/index14.js.map +1 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +8 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +8 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +6 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +8 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/lower-bound.js +5 -0
- package/dist/_virtual/lower-bound.js.map +1 -0
- package/dist/_virtual/priority-queue.js +5 -0
- package/dist/_virtual/priority-queue.js.map +1 -0
- package/dist/_virtual/re.js +5 -0
- package/dist/_virtual/re.js.map +1 -0
- package/dist/_virtual/retry.js +5 -0
- package/dist/_virtual/retry.js.map +1 -0
- package/dist/agents/index.d.ts +0 -0
- package/dist/hcs10/HCS10Client.d.ts +117 -0
- package/dist/hcs10/HCS10Client.js +251 -0
- package/dist/hcs10/HCS10Client.js.map +1 -0
- package/dist/hcs10/index.d.ts +1 -0
- package/dist/hcs10/types.d.ts +35 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.es.js +9747 -11699
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +59 -0
- package/dist/init.js +92 -0
- package/dist/init.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/base.js +98 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/base.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.js +419 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/promises.js +16 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/promises.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/language_models/base.js +42 -0
- package/dist/node_modules/@langchain/core/dist/language_models/base.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/load/map_keys.js +16 -0
- package/dist/node_modules/@langchain/core/dist/load/map_keys.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/load/serializable.js +121 -0
- package/dist/node_modules/@langchain/core/dist/load/serializable.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/messages/ai.js +95 -0
- package/dist/node_modules/@langchain/core/dist/messages/ai.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/messages/base.js +112 -0
- package/dist/node_modules/@langchain/core/dist/messages/base.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/messages/utils.js +30 -0
- package/dist/node_modules/@langchain/core/dist/messages/utils.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/base.js +1277 -0
- package/dist/node_modules/@langchain/core/dist/runnables/base.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/config.js +83 -0
- package/dist/node_modules/@langchain/core/dist/runnables/config.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph.js +106 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/iter.js +33 -0
- package/dist/node_modules/@langchain/core/dist/runnables/iter.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/utils.js +54 -0
- package/dist/node_modules/@langchain/core/dist/runnables/utils.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.js +20 -0
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/singletons/index.js +34 -0
- package/dist/node_modules/@langchain/core/dist/singletons/index.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tools.js +69 -0
- package/dist/node_modules/@langchain/core/dist/tools.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tracers/base.js +299 -0
- package/dist/node_modules/@langchain/core/dist/tracers/base.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tracers/console.js +193 -0
- package/dist/node_modules/@langchain/core/dist/tracers/console.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tracers/initialize.js +10 -0
- package/dist/node_modules/@langchain/core/dist/tracers/initialize.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tracers/log_stream.js +284 -0
- package/dist/node_modules/@langchain/core/dist/tracers/log_stream.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tracers/root_listener.js +54 -0
- package/dist/node_modules/@langchain/core/dist/tracers/root_listener.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.js +68 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.js +86 -0
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/env.js +33 -0
- package/dist/node_modules/@langchain/core/dist/utils/env.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/core.js +218 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/core.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/helpers.js +117 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/helpers.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/json.js +40 -0
- package/dist/node_modules/@langchain/core/dist/utils/json.js.map +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/stream.js +164 -0
- package/dist/node_modules/@langchain/core/dist/utils/stream.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/ansi-styles/index.js +111 -0
- package/dist/node_modules/@langchain/core/node_modules/ansi-styles/index.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/camelcase/index.js +30 -0
- package/dist/node_modules/@langchain/core/node_modules/camelcase/index.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.js +2002 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.js +94 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.js +96 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.js +27 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/native.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/rng.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/rng.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/stringify.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v4.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v4.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/rng.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/rng.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/stringify.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v4.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v4.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/dist/node_modules/base64-js/index.js +53 -0
- package/dist/node_modules/base64-js/index.js.map +1 -0
- package/dist/node_modules/decamelize/index.js +12 -0
- package/dist/node_modules/decamelize/index.js.map +1 -0
- package/dist/node_modules/eventemitter3/index.js +112 -0
- package/dist/node_modules/eventemitter3/index.js.map +1 -0
- package/dist/node_modules/js-tiktoken/dist/chunk-Z5MDQTGX.js +117 -0
- package/dist/node_modules/js-tiktoken/dist/chunk-Z5MDQTGX.js.map +1 -0
- package/dist/node_modules/p-finally/index.js +18 -0
- package/dist/node_modules/p-finally/index.js.map +1 -0
- package/dist/node_modules/p-queue/dist/index.js +198 -0
- package/dist/node_modules/p-queue/dist/index.js.map +1 -0
- package/dist/node_modules/p-queue/dist/lower-bound.js +20 -0
- package/dist/node_modules/p-queue/dist/lower-bound.js.map +1 -0
- package/dist/node_modules/p-queue/dist/priority-queue.js +41 -0
- package/dist/node_modules/p-queue/dist/priority-queue.js.map +1 -0
- package/dist/node_modules/p-retry/index.js +63 -0
- package/dist/node_modules/p-retry/index.js.map +1 -0
- package/dist/node_modules/p-timeout/index.js +45 -0
- package/dist/node_modules/p-timeout/index.js.map +1 -0
- package/dist/node_modules/retry/index.js +9 -0
- package/dist/node_modules/retry/index.js.map +1 -0
- package/dist/node_modules/retry/lib/retry.js +59 -0
- package/dist/node_modules/retry/lib/retry.js.map +1 -0
- package/dist/node_modules/retry/lib/retry_operation.js +58 -0
- package/dist/node_modules/retry/lib/retry_operation.js.map +1 -0
- package/dist/node_modules/semver/classes/comparator.js +57 -0
- package/dist/node_modules/semver/classes/comparator.js.map +1 -0
- package/dist/node_modules/semver/classes/range.js +149 -0
- package/dist/node_modules/semver/classes/range.js.map +1 -0
- package/dist/node_modules/semver/classes/semver.js +170 -0
- package/dist/node_modules/semver/classes/semver.js.map +1 -0
- package/dist/node_modules/semver/functions/clean.js +15 -0
- package/dist/node_modules/semver/functions/clean.js.map +1 -0
- package/dist/node_modules/semver/functions/cmp.js +40 -0
- package/dist/node_modules/semver/functions/cmp.js.map +1 -0
- package/dist/node_modules/semver/functions/coerce.js +34 -0
- package/dist/node_modules/semver/functions/coerce.js.map +1 -0
- package/dist/node_modules/semver/functions/compare-build.js +15 -0
- package/dist/node_modules/semver/functions/compare-build.js.map +1 -0
- package/dist/node_modules/semver/functions/compare-loose.js +12 -0
- package/dist/node_modules/semver/functions/compare-loose.js.map +1 -0
- package/dist/node_modules/semver/functions/compare.js +12 -0
- package/dist/node_modules/semver/functions/compare.js.map +1 -0
- package/dist/node_modules/semver/functions/diff.js +25 -0
- package/dist/node_modules/semver/functions/diff.js.map +1 -0
- package/dist/node_modules/semver/functions/eq.js +12 -0
- package/dist/node_modules/semver/functions/eq.js.map +1 -0
- package/dist/node_modules/semver/functions/gt.js +12 -0
- package/dist/node_modules/semver/functions/gt.js.map +1 -0
- package/dist/node_modules/semver/functions/gte.js +12 -0
- package/dist/node_modules/semver/functions/gte.js.map +1 -0
- package/dist/node_modules/semver/functions/inc.js +22 -0
- package/dist/node_modules/semver/functions/inc.js.map +1 -0
- package/dist/node_modules/semver/functions/lt.js +12 -0
- package/dist/node_modules/semver/functions/lt.js.map +1 -0
- package/dist/node_modules/semver/functions/lte.js +12 -0
- package/dist/node_modules/semver/functions/lte.js.map +1 -0
- package/dist/node_modules/semver/functions/major.js +12 -0
- package/dist/node_modules/semver/functions/major.js.map +1 -0
- package/dist/node_modules/semver/functions/minor.js +12 -0
- package/dist/node_modules/semver/functions/minor.js.map +1 -0
- package/dist/node_modules/semver/functions/neq.js +12 -0
- package/dist/node_modules/semver/functions/neq.js.map +1 -0
- package/dist/node_modules/semver/functions/parse.js +22 -0
- package/dist/node_modules/semver/functions/parse.js.map +1 -0
- package/dist/node_modules/semver/functions/patch.js +12 -0
- package/dist/node_modules/semver/functions/patch.js.map +1 -0
- package/dist/node_modules/semver/functions/prerelease.js +15 -0
- package/dist/node_modules/semver/functions/prerelease.js.map +1 -0
- package/dist/node_modules/semver/functions/rcompare.js +12 -0
- package/dist/node_modules/semver/functions/rcompare.js.map +1 -0
- package/dist/node_modules/semver/functions/rsort.js +12 -0
- package/dist/node_modules/semver/functions/rsort.js.map +1 -0
- package/dist/node_modules/semver/functions/satisfies.js +19 -0
- package/dist/node_modules/semver/functions/satisfies.js.map +1 -0
- package/dist/node_modules/semver/functions/sort.js +12 -0
- package/dist/node_modules/semver/functions/sort.js.map +1 -0
- package/dist/node_modules/semver/functions/valid.js +15 -0
- package/dist/node_modules/semver/functions/valid.js.map +1 -0
- package/dist/node_modules/semver/index.js +98 -0
- package/dist/node_modules/semver/index.js.map +1 -0
- package/dist/node_modules/semver/internal/constants.js +29 -0
- package/dist/node_modules/semver/internal/constants.js.map +1 -0
- package/dist/node_modules/semver/internal/debug.js +9 -0
- package/dist/node_modules/semver/internal/debug.js.map +1 -0
- package/dist/node_modules/semver/internal/identifiers.js +17 -0
- package/dist/node_modules/semver/internal/identifiers.js.map +1 -0
- package/dist/node_modules/semver/internal/lrucache.js +33 -0
- package/dist/node_modules/semver/internal/lrucache.js.map +1 -0
- package/dist/node_modules/semver/internal/parse-options.js +11 -0
- package/dist/node_modules/semver/internal/parse-options.js.map +1 -0
- package/dist/node_modules/semver/internal/re.js +33 -0
- package/dist/node_modules/semver/internal/re.js.map +1 -0
- package/dist/node_modules/semver/ranges/gtr.js +12 -0
- package/dist/node_modules/semver/ranges/gtr.js.map +1 -0
- package/dist/node_modules/semver/ranges/intersects.js +12 -0
- package/dist/node_modules/semver/ranges/intersects.js.map +1 -0
- package/dist/node_modules/semver/ranges/ltr.js +12 -0
- package/dist/node_modules/semver/ranges/ltr.js.map +1 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +23 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js.map +1 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +23 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js.map +1 -0
- package/dist/node_modules/semver/ranges/min-version.js +43 -0
- package/dist/node_modules/semver/ranges/min-version.js.map +1 -0
- package/dist/node_modules/semver/ranges/outside.js +45 -0
- package/dist/node_modules/semver/ranges/outside.js.map +1 -0
- package/dist/node_modules/semver/ranges/simplify.js +25 -0
- package/dist/node_modules/semver/ranges/simplify.js.map +1 -0
- package/dist/node_modules/semver/ranges/subset.js +95 -0
- package/dist/node_modules/semver/ranges/subset.js.map +1 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +12 -0
- package/dist/node_modules/semver/ranges/to-comparators.js.map +1 -0
- package/dist/node_modules/semver/ranges/valid.js +18 -0
- package/dist/node_modules/semver/ranges/valid.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +32 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +22 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +14 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +44 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +7 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +17 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +26 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +9 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +6 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +59 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +11 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +10 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +36 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +16 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +27 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +11 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +9 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +12 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +30 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +28 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +50 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +22 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +21 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +6 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +56 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +17 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +245 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +27 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +9 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +69 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +7 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +110 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +26 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
- package/dist/plugins/BasePlugin.d.ts +28 -0
- package/dist/plugins/BasePlugin.js +19 -0
- package/dist/plugins/BasePlugin.js.map +1 -0
- package/dist/plugins/PluginInterface.d.ts +64 -0
- package/dist/plugins/PluginLoader.d.ts +38 -0
- package/dist/plugins/PluginLoader.js +60 -0
- package/dist/plugins/PluginLoader.js.map +1 -0
- package/dist/plugins/PluginRegistry.d.ts +47 -0
- package/dist/plugins/PluginRegistry.js +71 -0
- package/dist/plugins/PluginRegistry.js.map +1 -0
- package/dist/plugins/__tests__/BasePlugin.test.d.ts +1 -0
- package/dist/plugins/__tests__/PluginLoader.test.d.ts +1 -0
- package/dist/plugins/__tests__/PluginRegistry.test.d.ts +1 -0
- package/dist/plugins/defi/index.d.ts +13 -0
- package/dist/plugins/hedera/HbarPricePlugin.d.ts +45 -0
- package/dist/plugins/hedera/HbarPricePlugin.js +70 -0
- package/dist/plugins/hedera/HbarPricePlugin.js.map +1 -0
- package/dist/plugins/hedera/__tests__/HbarPricePlugin.test.d.ts +1 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/weather/index.d.ts +15 -0
- package/dist/src/agents/index.d.ts +0 -0
- package/dist/src/init.d.ts +2 -2
- package/dist/src/plugins/hedera/HbarPricePlugin.d.ts +45 -0
- package/dist/src/plugins/index.d.ts +1 -0
- package/dist/src/tools/CheckMessagesTool.d.ts +9 -2
- package/dist/src/utils/state-tools.d.ts +23 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/open-convai-state.d.ts +84 -0
- package/dist/state/open-convai-state.js +132 -0
- package/dist/state/open-convai-state.js.map +1 -0
- package/dist/state/state-types.d.ts +143 -0
- package/dist/tools/AcceptConnectionRequestTool.d.ts +33 -0
- package/dist/tools/AcceptConnectionRequestTool.js +116 -0
- package/dist/tools/AcceptConnectionRequestTool.js.map +1 -0
- package/dist/tools/CheckMessagesTool.d.ts +34 -0
- package/dist/tools/CheckMessagesTool.js +96 -0
- package/dist/tools/CheckMessagesTool.js.map +1 -0
- package/dist/tools/ConnectionMonitorTool.d.ts +96 -0
- package/dist/tools/ConnectionMonitorTool.js +289 -0
- package/dist/tools/ConnectionMonitorTool.js.map +1 -0
- package/dist/tools/ConnectionTool.d.ts +40 -0
- package/dist/tools/ConnectionTool.js +114 -0
- package/dist/tools/ConnectionTool.js.map +1 -0
- package/dist/tools/FindRegistrationsTool.d.ts +27 -0
- package/dist/tools/FindRegistrationsTool.js +64 -0
- package/dist/tools/FindRegistrationsTool.js.map +1 -0
- package/dist/tools/InitiateConnectionTool.d.ts +30 -0
- package/dist/tools/InitiateConnectionTool.js +79 -0
- package/dist/tools/InitiateConnectionTool.js.map +1 -0
- package/dist/tools/ListConnectionsTool.d.ts +33 -0
- package/dist/tools/ListConnectionsTool.js +327 -0
- package/dist/tools/ListConnectionsTool.js.map +1 -0
- package/dist/tools/ListUnapprovedConnectionRequestsTool.d.ts +53 -0
- package/dist/tools/ListUnapprovedConnectionRequestsTool.js +177 -0
- package/dist/tools/ListUnapprovedConnectionRequestsTool.js.map +1 -0
- package/dist/tools/ManageConnectionRequestsTool.d.ts +39 -0
- package/dist/tools/ManageConnectionRequestsTool.js +161 -0
- package/dist/tools/ManageConnectionRequestsTool.js.map +1 -0
- package/dist/tools/RegisterAgentTool.d.ts +188 -0
- package/dist/tools/RegisterAgentTool.js +331 -0
- package/dist/tools/RegisterAgentTool.js.map +1 -0
- package/dist/tools/RetrieveProfileTool.d.ts +34 -0
- package/dist/tools/RetrieveProfileTool.js +53 -0
- package/dist/tools/RetrieveProfileTool.js.map +1 -0
- package/dist/tools/SendMessageToConnectionTool.d.ts +31 -0
- package/dist/tools/SendMessageToConnectionTool.js +74 -0
- package/dist/tools/SendMessageToConnectionTool.js.map +1 -0
- package/dist/tools/SendMessageTool.d.ts +44 -0
- package/dist/tools/SendMessageTool.js +75 -0
- package/dist/tools/SendMessageTool.js.map +1 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/utils/Encryption.d.ts +7 -0
- package/dist/utils/Encryption.js +7 -0
- package/dist/utils/Encryption.js.map +1 -0
- package/dist/utils/HederaClient.d.ts +18 -0
- package/dist/utils/connectionUtils.d.ts +15 -0
- package/dist/utils/connectionUtils.js +64 -0
- package/dist/utils/connectionUtils.js.map +1 -0
- package/dist/utils/state-tools.d.ts +23 -0
- package/dist/utils/state-tools.js +90 -0
- package/dist/utils/state-tools.js.map +1 -0
- package/package.json +20 -10
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class n {
|
|
2
|
+
/**
|
|
3
|
+
* Initialize the plugin with the provided context
|
|
4
|
+
* @param context The context containing shared resources
|
|
5
|
+
*/
|
|
6
|
+
async initialize(a) {
|
|
7
|
+
this.context = a;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Clean up resources when the plugin is unloaded
|
|
11
|
+
* Default implementation does nothing
|
|
12
|
+
*/
|
|
13
|
+
async cleanup() {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
n as BasePlugin
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=BasePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasePlugin.js","sources":["../../src/plugins/BasePlugin.ts"],"sourcesContent":["import { IPlugin, PluginContext } from './PluginInterface';\nimport { StructuredTool } from '@langchain/core/tools';\n\n/**\n * Base class for plugins to simplify implementation\n */\nexport abstract class BasePlugin implements IPlugin {\n abstract id: string;\n abstract name: string;\n abstract description: string;\n abstract version: string;\n abstract author: string;\n\n protected context!: PluginContext;\n\n /**\n * Initialize the plugin with the provided context\n * @param context The context containing shared resources\n */\n async initialize(context: PluginContext): Promise<void> {\n this.context = context;\n }\n\n /**\n * Get the tools provided by this plugin\n * @returns Array of tools provided by this plugin\n */\n abstract getTools(): StructuredTool[];\n\n /**\n * Clean up resources when the plugin is unloaded\n * Default implementation does nothing\n */\n async cleanup(): Promise<void> {\n // Default implementation does nothing\n }\n}\n"],"names":["BasePlugin","context"],"mappings":"AAMO,MAAeA,EAA8B;AAAA;AAAA;AAAA;AAAA;AAAA,EAalD,MAAM,WAAWC,GAAuC;AACtD,SAAK,UAAUA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAajB,MAAM,UAAyB;AAAA,EAAA;AAGjC;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
+
import { HCS10Client } from '../hcs10/HCS10Client';
|
|
3
|
+
import { IStateManager } from '../state/state-types';
|
|
4
|
+
import { Logger } from '@hashgraphonline/standards-sdk';
|
|
5
|
+
/**
|
|
6
|
+
* Context provided to plugins during initialization
|
|
7
|
+
*/
|
|
8
|
+
export interface PluginContext {
|
|
9
|
+
/**
|
|
10
|
+
* The HCS10Client instance
|
|
11
|
+
*/
|
|
12
|
+
client: HCS10Client;
|
|
13
|
+
/**
|
|
14
|
+
* Optional state manager
|
|
15
|
+
*/
|
|
16
|
+
stateManager?: IStateManager;
|
|
17
|
+
/**
|
|
18
|
+
* Logger instance
|
|
19
|
+
*/
|
|
20
|
+
logger: Logger;
|
|
21
|
+
/**
|
|
22
|
+
* Configuration options
|
|
23
|
+
*/
|
|
24
|
+
config: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Standard interface that all plugins must implement
|
|
28
|
+
*/
|
|
29
|
+
export interface IPlugin {
|
|
30
|
+
/**
|
|
31
|
+
* Unique identifier for the plugin
|
|
32
|
+
*/
|
|
33
|
+
id: string;
|
|
34
|
+
/**
|
|
35
|
+
* Human-readable name of the plugin
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Description of what the plugin does
|
|
40
|
+
*/
|
|
41
|
+
description: string;
|
|
42
|
+
/**
|
|
43
|
+
* Version of the plugin
|
|
44
|
+
*/
|
|
45
|
+
version: string;
|
|
46
|
+
/**
|
|
47
|
+
* Author of the plugin
|
|
48
|
+
*/
|
|
49
|
+
author: string;
|
|
50
|
+
/**
|
|
51
|
+
* Initialize the plugin with the provided context
|
|
52
|
+
* @param context The context containing shared resources
|
|
53
|
+
*/
|
|
54
|
+
initialize(context: PluginContext): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get the tools provided by this plugin
|
|
57
|
+
* @returns Array of tools provided by this plugin
|
|
58
|
+
*/
|
|
59
|
+
getTools(): StructuredTool[];
|
|
60
|
+
/**
|
|
61
|
+
* Clean up resources when the plugin is unloaded
|
|
62
|
+
*/
|
|
63
|
+
cleanup?(): Promise<void>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PluginContext, IPlugin } from './PluginInterface';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for loading a plugin
|
|
4
|
+
*/
|
|
5
|
+
export interface PluginLoadOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to initialize the plugin after loading
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
initialize?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Utility for loading plugins from different sources
|
|
14
|
+
*/
|
|
15
|
+
export declare class PluginLoader {
|
|
16
|
+
/**
|
|
17
|
+
* Load a plugin from a directory
|
|
18
|
+
* @param directory Path to the directory containing the plugin
|
|
19
|
+
* @param context Context to provide to the plugin during initialization
|
|
20
|
+
* @param options Options for loading the plugin
|
|
21
|
+
* @returns The loaded plugin instance
|
|
22
|
+
*/
|
|
23
|
+
static loadFromDirectory(directory: string, context: PluginContext, options?: PluginLoadOptions): Promise<IPlugin>;
|
|
24
|
+
/**
|
|
25
|
+
* Load a plugin from an npm package
|
|
26
|
+
* @param packageName Name of the npm package containing the plugin
|
|
27
|
+
* @param context Context to provide to the plugin during initialization
|
|
28
|
+
* @param options Options for loading the plugin
|
|
29
|
+
* @returns The loaded plugin instance
|
|
30
|
+
*/
|
|
31
|
+
static loadFromPackage(packageName: string, context: PluginContext, options?: PluginLoadOptions): Promise<IPlugin>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if an object implements the IPlugin interface
|
|
34
|
+
* @param obj Object to check
|
|
35
|
+
* @returns true if the object implements IPlugin, false otherwise
|
|
36
|
+
*/
|
|
37
|
+
private static isValidPlugin;
|
|
38
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as l from "fs";
|
|
2
|
+
import * as c from "path";
|
|
3
|
+
class d {
|
|
4
|
+
/**
|
|
5
|
+
* Load a plugin from a directory
|
|
6
|
+
* @param directory Path to the directory containing the plugin
|
|
7
|
+
* @param context Context to provide to the plugin during initialization
|
|
8
|
+
* @param options Options for loading the plugin
|
|
9
|
+
* @returns The loaded plugin instance
|
|
10
|
+
*/
|
|
11
|
+
static async loadFromDirectory(i, o, a = { initialize: !0 }) {
|
|
12
|
+
const t = c.join(i, "plugin.json");
|
|
13
|
+
if (!l.existsSync(t))
|
|
14
|
+
throw new Error(`Plugin manifest not found at ${t}`);
|
|
15
|
+
try {
|
|
16
|
+
const n = l.readFileSync(t, "utf8"), r = JSON.parse(n);
|
|
17
|
+
if (!r.id || !r.main)
|
|
18
|
+
throw new Error("Invalid plugin manifest: missing required fields (id, main)");
|
|
19
|
+
const e = c.join(i, r.main);
|
|
20
|
+
if (!l.existsSync(e))
|
|
21
|
+
throw new Error(`Plugin main file not found at ${e}`);
|
|
22
|
+
const f = await import(e), u = f.default || f[r.id];
|
|
23
|
+
if (!u)
|
|
24
|
+
throw new Error(`Could not find plugin class in ${e}`);
|
|
25
|
+
const s = new u();
|
|
26
|
+
if (!this.isValidPlugin(s))
|
|
27
|
+
throw new Error("Plugin does not implement the IPlugin interface correctly");
|
|
28
|
+
return a.initialize && await s.initialize(o), s;
|
|
29
|
+
} catch (n) {
|
|
30
|
+
throw new Error(`Failed to load plugin from directory ${i}: ${n instanceof Error ? n.message : String(n)}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load a plugin from an npm package
|
|
35
|
+
* @param packageName Name of the npm package containing the plugin
|
|
36
|
+
* @param context Context to provide to the plugin during initialization
|
|
37
|
+
* @param options Options for loading the plugin
|
|
38
|
+
* @returns The loaded plugin instance
|
|
39
|
+
*/
|
|
40
|
+
static async loadFromPackage(i, o, a = { initialize: !0 }) {
|
|
41
|
+
try {
|
|
42
|
+
const t = require.resolve(i), n = c.dirname(t);
|
|
43
|
+
return this.loadFromDirectory(n, o, a);
|
|
44
|
+
} catch (t) {
|
|
45
|
+
throw new Error(`Failed to load plugin from package ${i}: ${t instanceof Error ? t.message : String(t)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Check if an object implements the IPlugin interface
|
|
50
|
+
* @param obj Object to check
|
|
51
|
+
* @returns true if the object implements IPlugin, false otherwise
|
|
52
|
+
*/
|
|
53
|
+
static isValidPlugin(i) {
|
|
54
|
+
return i && typeof i.id == "string" && typeof i.name == "string" && typeof i.description == "string" && typeof i.version == "string" && typeof i.author == "string" && typeof i.initialize == "function" && typeof i.getTools == "function";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
d as PluginLoader
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=PluginLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginLoader.js","sources":["../../src/plugins/PluginLoader.ts"],"sourcesContent":["import { PluginContext } from './PluginInterface';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { IPlugin } from './PluginInterface';\n\n/**\n * Configuration for loading a plugin\n */\nexport interface PluginLoadOptions {\n /**\n * Whether to initialize the plugin after loading\n * @default true\n */\n initialize?: boolean;\n}\n\n/**\n * Utility for loading plugins from different sources\n */\nexport class PluginLoader {\n /**\n * Load a plugin from a directory\n * @param directory Path to the directory containing the plugin\n * @param context Context to provide to the plugin during initialization\n * @param options Options for loading the plugin\n * @returns The loaded plugin instance\n */\n static async loadFromDirectory(\n directory: string, \n context: PluginContext, \n options: PluginLoadOptions = { initialize: true }\n ): Promise<IPlugin> {\n const manifestPath = path.join(directory, 'plugin.json');\n \n if (!fs.existsSync(manifestPath)) {\n throw new Error(`Plugin manifest not found at ${manifestPath}`);\n }\n \n try {\n const manifestContent = fs.readFileSync(manifestPath, 'utf8');\n const manifest = JSON.parse(manifestContent);\n \n // Validate manifest\n if (!manifest.id || !manifest.main) {\n throw new Error('Invalid plugin manifest: missing required fields (id, main)');\n }\n \n // Load the plugin module\n const mainPath = path.join(directory, manifest.main);\n if (!fs.existsSync(mainPath)) {\n throw new Error(`Plugin main file not found at ${mainPath}`);\n }\n \n // Import the plugin module\n const pluginModule = await import(mainPath);\n const PluginClass = pluginModule.default || pluginModule[manifest.id];\n \n if (!PluginClass) {\n throw new Error(`Could not find plugin class in ${mainPath}`);\n }\n \n // Create an instance of the plugin\n const plugin = new PluginClass();\n \n // Validate that it implements the IPlugin interface\n if (!this.isValidPlugin(plugin)) {\n throw new Error(`Plugin does not implement the IPlugin interface correctly`);\n }\n \n // Initialize the plugin if requested\n if (options.initialize) {\n await plugin.initialize(context);\n }\n \n return plugin;\n } catch (error) {\n throw new Error(`Failed to load plugin from directory ${directory}: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n \n /**\n * Load a plugin from an npm package\n * @param packageName Name of the npm package containing the plugin\n * @param context Context to provide to the plugin during initialization\n * @param options Options for loading the plugin\n * @returns The loaded plugin instance\n */\n static async loadFromPackage(\n packageName: string, \n context: PluginContext, \n options: PluginLoadOptions = { initialize: true }\n ): Promise<IPlugin> {\n try {\n // Resolve the package path\n const packagePath = require.resolve(packageName);\n const packageDir = path.dirname(packagePath);\n \n return this.loadFromDirectory(packageDir, context, options);\n } catch (error) {\n throw new Error(`Failed to load plugin from package ${packageName}: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n \n /**\n * Check if an object implements the IPlugin interface\n * @param obj Object to check\n * @returns true if the object implements IPlugin, false otherwise\n */\n private static isValidPlugin(obj: any): obj is IPlugin {\n return (\n obj &&\n typeof obj.id === 'string' &&\n typeof obj.name === 'string' &&\n typeof obj.description === 'string' &&\n typeof obj.version === 'string' &&\n typeof obj.author === 'string' &&\n typeof obj.initialize === 'function' &&\n typeof obj.getTools === 'function'\n );\n }\n}\n"],"names":["PluginLoader","directory","context","options","manifestPath","path","fs","manifestContent","manifest","mainPath","pluginModule","PluginClass","plugin","error","packageName","packagePath","packageDir","obj"],"mappings":";;AAmBO,MAAMA,EAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxB,aAAa,kBACXC,GACAC,GACAC,IAA6B,EAAE,YAAY,MACzB;AAClB,UAAMC,IAAeC,EAAK,KAAKJ,GAAW,aAAa;AAEvD,QAAI,CAACK,EAAG,WAAWF,CAAY;AAC7B,YAAM,IAAI,MAAM,gCAAgCA,CAAY,EAAE;AAG5D,QAAA;AACF,YAAMG,IAAkBD,EAAG,aAAaF,GAAc,MAAM,GACtDI,IAAW,KAAK,MAAMD,CAAe;AAG3C,UAAI,CAACC,EAAS,MAAM,CAACA,EAAS;AACtB,cAAA,IAAI,MAAM,6DAA6D;AAI/E,YAAMC,IAAWJ,EAAK,KAAKJ,GAAWO,EAAS,IAAI;AACnD,UAAI,CAACF,EAAG,WAAWG,CAAQ;AACzB,cAAM,IAAI,MAAM,iCAAiCA,CAAQ,EAAE;AAIvD,YAAAC,IAAe,MAAM,OAAOD,IAC5BE,IAAcD,EAAa,WAAWA,EAAaF,EAAS,EAAE;AAEpE,UAAI,CAACG;AACH,cAAM,IAAI,MAAM,kCAAkCF,CAAQ,EAAE;AAIxD,YAAAG,IAAS,IAAID,EAAY;AAG/B,UAAI,CAAC,KAAK,cAAcC,CAAM;AACtB,cAAA,IAAI,MAAM,2DAA2D;AAI7E,aAAIT,EAAQ,cACJ,MAAAS,EAAO,WAAWV,CAAO,GAG1BU;AAAA,aACAC,GAAO;AACd,YAAM,IAAI,MAAM,wCAAwCZ,CAAS,KAAKY,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,CAAC,EAAE;AAAA,IAAA;AAAA,EAChI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,aAAa,gBACXC,GACAZ,GACAC,IAA6B,EAAE,YAAY,MACzB;AACd,QAAA;AAEI,YAAAY,IAAc,QAAQ,QAAQD,CAAW,GACzCE,IAAaX,EAAK,QAAQU,CAAW;AAE3C,aAAO,KAAK,kBAAkBC,GAAYd,GAASC,CAAO;AAAA,aACnDU,GAAO;AACd,YAAM,IAAI,MAAM,sCAAsCC,CAAW,KAAKD,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,CAAC,EAAE;AAAA,IAAA;AAAA,EAChI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQF,OAAe,cAAcI,GAA0B;AAEnD,WAAAA,KACA,OAAOA,EAAI,MAAO,YAClB,OAAOA,EAAI,QAAS,YACpB,OAAOA,EAAI,eAAgB,YAC3B,OAAOA,EAAI,WAAY,YACvB,OAAOA,EAAI,UAAW,YACtB,OAAOA,EAAI,cAAe,cAC1B,OAAOA,EAAI,YAAa;AAAA,EAAA;AAG9B;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IPlugin, PluginContext } from './PluginInterface';
|
|
2
|
+
import { StructuredTool } from '@langchain/core/tools';
|
|
3
|
+
/**
|
|
4
|
+
* Registry for managing plugins in the Standards Agent Kit
|
|
5
|
+
*/
|
|
6
|
+
export declare class PluginRegistry {
|
|
7
|
+
private plugins;
|
|
8
|
+
private context;
|
|
9
|
+
private logger;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new PluginRegistry instance
|
|
12
|
+
* @param context The context to provide to plugins during initialization
|
|
13
|
+
*/
|
|
14
|
+
constructor(context: PluginContext);
|
|
15
|
+
/**
|
|
16
|
+
* Register a plugin with the registry
|
|
17
|
+
* @param plugin The plugin to register
|
|
18
|
+
* @throws Error if a plugin with the same ID is already registered
|
|
19
|
+
*/
|
|
20
|
+
registerPlugin(plugin: IPlugin): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Get a plugin by ID
|
|
23
|
+
* @param id The ID of the plugin to retrieve
|
|
24
|
+
* @returns The plugin, or undefined if not found
|
|
25
|
+
*/
|
|
26
|
+
getPlugin(id: string): IPlugin | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Get all registered plugins
|
|
29
|
+
* @returns Array of all registered plugins
|
|
30
|
+
*/
|
|
31
|
+
getAllPlugins(): IPlugin[];
|
|
32
|
+
/**
|
|
33
|
+
* Get all tools from all registered plugins
|
|
34
|
+
* @returns Array of all tools provided by registered plugins
|
|
35
|
+
*/
|
|
36
|
+
getAllTools(): StructuredTool[];
|
|
37
|
+
/**
|
|
38
|
+
* Unregister a plugin
|
|
39
|
+
* @param id The ID of the plugin to unregister
|
|
40
|
+
* @returns true if the plugin was unregistered, false if it wasn't found
|
|
41
|
+
*/
|
|
42
|
+
unregisterPlugin(id: string): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Unregister all plugins
|
|
45
|
+
*/
|
|
46
|
+
unregisterAllPlugins(): Promise<void>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
class n {
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new PluginRegistry instance
|
|
4
|
+
* @param context The context to provide to plugins during initialization
|
|
5
|
+
*/
|
|
6
|
+
constructor(i) {
|
|
7
|
+
this.plugins = /* @__PURE__ */ new Map(), this.context = i, this.logger = i.logger;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Register a plugin with the registry
|
|
11
|
+
* @param plugin The plugin to register
|
|
12
|
+
* @throws Error if a plugin with the same ID is already registered
|
|
13
|
+
*/
|
|
14
|
+
async registerPlugin(i) {
|
|
15
|
+
if (this.plugins.has(i.id))
|
|
16
|
+
throw new Error(`Plugin with ID ${i.id} is already registered`);
|
|
17
|
+
await i.initialize(this.context), this.plugins.set(i.id, i), this.logger.info(`Plugin registered: ${i.name} (${i.id}) v${i.version}`);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a plugin by ID
|
|
21
|
+
* @param id The ID of the plugin to retrieve
|
|
22
|
+
* @returns The plugin, or undefined if not found
|
|
23
|
+
*/
|
|
24
|
+
getPlugin(i) {
|
|
25
|
+
return this.plugins.get(i);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get all registered plugins
|
|
29
|
+
* @returns Array of all registered plugins
|
|
30
|
+
*/
|
|
31
|
+
getAllPlugins() {
|
|
32
|
+
return Array.from(this.plugins.values());
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get all tools from all registered plugins
|
|
36
|
+
* @returns Array of all tools provided by registered plugins
|
|
37
|
+
*/
|
|
38
|
+
getAllTools() {
|
|
39
|
+
return this.getAllPlugins().flatMap((i) => i.getTools());
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Unregister a plugin
|
|
43
|
+
* @param id The ID of the plugin to unregister
|
|
44
|
+
* @returns true if the plugin was unregistered, false if it wasn't found
|
|
45
|
+
*/
|
|
46
|
+
async unregisterPlugin(i) {
|
|
47
|
+
const r = this.plugins.get(i);
|
|
48
|
+
if (!r)
|
|
49
|
+
return !1;
|
|
50
|
+
if (r.cleanup)
|
|
51
|
+
try {
|
|
52
|
+
await r.cleanup();
|
|
53
|
+
} catch (t) {
|
|
54
|
+
this.logger.error(`Error during plugin cleanup: ${t}`);
|
|
55
|
+
}
|
|
56
|
+
const e = this.plugins.delete(i);
|
|
57
|
+
return e && this.logger.info(`Plugin unregistered: ${r.name} (${r.id})`), e;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Unregister all plugins
|
|
61
|
+
*/
|
|
62
|
+
async unregisterAllPlugins() {
|
|
63
|
+
const i = Array.from(this.plugins.keys());
|
|
64
|
+
for (const r of i)
|
|
65
|
+
await this.unregisterPlugin(r);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
n as PluginRegistry
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=PluginRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginRegistry.js","sources":["../../src/plugins/PluginRegistry.ts"],"sourcesContent":["import { IPlugin, PluginContext } from './PluginInterface';\nimport { StructuredTool } from '@langchain/core/tools';\nimport { Logger } from '@hashgraphonline/standards-sdk';\n\n/**\n * Registry for managing plugins in the Standards Agent Kit\n */\nexport class PluginRegistry {\n private plugins: Map<string, IPlugin> = new Map();\n private context: PluginContext;\n private logger: Logger;\n \n /**\n * Creates a new PluginRegistry instance\n * @param context The context to provide to plugins during initialization\n */\n constructor(context: PluginContext) {\n this.context = context;\n this.logger = context.logger;\n }\n \n /**\n * Register a plugin with the registry\n * @param plugin The plugin to register\n * @throws Error if a plugin with the same ID is already registered\n */\n async registerPlugin(plugin: IPlugin): Promise<void> {\n if (this.plugins.has(plugin.id)) {\n throw new Error(`Plugin with ID ${plugin.id} is already registered`);\n }\n \n await plugin.initialize(this.context);\n this.plugins.set(plugin.id, plugin);\n this.logger.info(`Plugin registered: ${plugin.name} (${plugin.id}) v${plugin.version}`);\n }\n \n /**\n * Get a plugin by ID\n * @param id The ID of the plugin to retrieve\n * @returns The plugin, or undefined if not found\n */\n getPlugin(id: string): IPlugin | undefined {\n return this.plugins.get(id);\n }\n \n /**\n * Get all registered plugins\n * @returns Array of all registered plugins\n */\n getAllPlugins(): IPlugin[] {\n return Array.from(this.plugins.values());\n }\n \n /**\n * Get all tools from all registered plugins\n * @returns Array of all tools provided by registered plugins\n */\n getAllTools(): StructuredTool[] {\n return this.getAllPlugins().flatMap(plugin => plugin.getTools());\n }\n \n /**\n * Unregister a plugin\n * @param id The ID of the plugin to unregister\n * @returns true if the plugin was unregistered, false if it wasn't found\n */\n async unregisterPlugin(id: string): Promise<boolean> {\n const plugin = this.plugins.get(id);\n if (!plugin) {\n return false;\n }\n \n if (plugin.cleanup) {\n try {\n await plugin.cleanup();\n } catch (error) {\n this.logger.error(`Error during plugin cleanup: ${error}`);\n }\n }\n \n const result = this.plugins.delete(id);\n if (result) {\n this.logger.info(`Plugin unregistered: ${plugin.name} (${plugin.id})`);\n }\n \n return result;\n }\n \n /**\n * Unregister all plugins\n */\n async unregisterAllPlugins(): Promise<void> {\n const pluginIds = Array.from(this.plugins.keys());\n for (const id of pluginIds) {\n await this.unregisterPlugin(id);\n }\n }\n}\n"],"names":["PluginRegistry","context","plugin","id","error","result","pluginIds"],"mappings":"AAOO,MAAMA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA,EAS1B,YAAYC,GAAwB;AAR5B,SAAA,8BAAoC,IAAI,GAS9C,KAAK,UAAUA,GACf,KAAK,SAASA,EAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxB,MAAM,eAAeC,GAAgC;AACnD,QAAI,KAAK,QAAQ,IAAIA,EAAO,EAAE;AAC5B,YAAM,IAAI,MAAM,kBAAkBA,EAAO,EAAE,wBAAwB;AAG/D,UAAAA,EAAO,WAAW,KAAK,OAAO,GACpC,KAAK,QAAQ,IAAIA,EAAO,IAAIA,CAAM,GAC7B,KAAA,OAAO,KAAK,sBAAsBA,EAAO,IAAI,KAAKA,EAAO,EAAE,MAAMA,EAAO,OAAO,EAAE;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxF,UAAUC,GAAiC;AAClC,WAAA,KAAK,QAAQ,IAAIA,CAAE;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5B,gBAA2B;AACzB,WAAO,MAAM,KAAK,KAAK,QAAQ,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOzC,cAAgC;AAC9B,WAAO,KAAK,gBAAgB,QAAQ,CAAUD,MAAAA,EAAO,UAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjE,MAAM,iBAAiBC,GAA8B;AACnD,UAAMD,IAAS,KAAK,QAAQ,IAAIC,CAAE;AAClC,QAAI,CAACD;AACI,aAAA;AAGT,QAAIA,EAAO;AACL,UAAA;AACF,cAAMA,EAAO,QAAQ;AAAA,eACdE,GAAO;AACd,aAAK,OAAO,MAAM,gCAAgCA,CAAK,EAAE;AAAA,MAAA;AAI7D,UAAMC,IAAS,KAAK,QAAQ,OAAOF,CAAE;AACrC,WAAIE,KACG,KAAA,OAAO,KAAK,wBAAwBH,EAAO,IAAI,KAAKA,EAAO,EAAE,GAAG,GAGhEG;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMT,MAAM,uBAAsC;AAC1C,UAAMC,IAAY,MAAM,KAAK,KAAK,QAAQ,MAAM;AAChD,eAAWH,KAAMG;AACT,YAAA,KAAK,iBAAiBH,CAAE;AAAA,EAChC;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BasePlugin } from '../../../src/plugins';
|
|
2
|
+
import { StructuredTool } from '@langchain/core/tools';
|
|
3
|
+
/**
|
|
4
|
+
* DeFi Integration Plugin for the Standards Agent Kit
|
|
5
|
+
*/
|
|
6
|
+
export default class DeFiPlugin extends BasePlugin {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
version: string;
|
|
11
|
+
author: string;
|
|
12
|
+
getTools(): StructuredTool[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { IPlugin } from '../PluginInterface';
|
|
4
|
+
/**
|
|
5
|
+
* A Langchain tool to get the current HBAR price in USD.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GetHbarPriceTool extends StructuredTool {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* DISCLAIMER: THIS TOOL USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.
|
|
13
|
+
* USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.
|
|
14
|
+
* Retrieves the current price of HBAR in USD from the Hedera Mirror Node.
|
|
15
|
+
* @returns A promise that resolves to a string containing the current HBAR price in USD.
|
|
16
|
+
*/
|
|
17
|
+
protected _call(): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* DISCLAIMER: THIS PLUGIN USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.
|
|
21
|
+
* USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.
|
|
22
|
+
* Plugin to provide tools related to Hedera network information, like HBAR price.
|
|
23
|
+
*/
|
|
24
|
+
export declare class HbarPricePlugin implements IPlugin {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
version: string;
|
|
29
|
+
author: string;
|
|
30
|
+
private tools;
|
|
31
|
+
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* Initializes the plugin. Currently no specific initialization needed.
|
|
34
|
+
*/
|
|
35
|
+
initialize(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the tools provided by this plugin.
|
|
38
|
+
* @returns An array containing the GetHbarPriceTool.
|
|
39
|
+
*/
|
|
40
|
+
getTools(): StructuredTool[];
|
|
41
|
+
/**
|
|
42
|
+
* Cleans up resources. Currently no cleanup needed.
|
|
43
|
+
*/
|
|
44
|
+
cleanup(): Promise<void>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { StructuredTool as a } from "../../node_modules/@langchain/core/dist/tools.js";
|
|
2
|
+
import { z as e } from "zod";
|
|
3
|
+
import n from "axios";
|
|
4
|
+
const c = "https://mainnet.mirrornode.hedera.com/api/v1", u = e.object({
|
|
5
|
+
current_rate: e.object({
|
|
6
|
+
cent_equivalent: e.number(),
|
|
7
|
+
hbar_equivalent: e.number(),
|
|
8
|
+
expiration_time: e.number()
|
|
9
|
+
}),
|
|
10
|
+
next_rate: e.object({
|
|
11
|
+
cent_equivalent: e.number(),
|
|
12
|
+
hbar_equivalent: e.number(),
|
|
13
|
+
expiration_time: e.number()
|
|
14
|
+
}),
|
|
15
|
+
timestamp: e.string()
|
|
16
|
+
});
|
|
17
|
+
class l extends a {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.name = "getHbarPrice", this.description = "Retrieves the current price of HBAR in USD from the Hedera Mirror Node.", this.schema = e.object({});
|
|
20
|
+
}
|
|
21
|
+
// No input required for this tool
|
|
22
|
+
/**
|
|
23
|
+
* DISCLAIMER: THIS TOOL USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.
|
|
24
|
+
* USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.
|
|
25
|
+
* Retrieves the current price of HBAR in USD from the Hedera Mirror Node.
|
|
26
|
+
* @returns A promise that resolves to a string containing the current HBAR price in USD.
|
|
27
|
+
*/
|
|
28
|
+
async _call() {
|
|
29
|
+
try {
|
|
30
|
+
const t = (await n.get(`${c}/network/exchangerate`)).data, o = u.safeParse(t);
|
|
31
|
+
if (!o.success)
|
|
32
|
+
throw console.error("Failed to parse exchange rate response:", o.error), new Error("Invalid API response format");
|
|
33
|
+
const { current_rate: s } = o.data;
|
|
34
|
+
return `The current price of HBAR is $${(s.cent_equivalent / s.hbar_equivalent / 100).toFixed(6)} USD.`;
|
|
35
|
+
} catch (r) {
|
|
36
|
+
console.error("Error fetching HBAR price:", r);
|
|
37
|
+
let t = "An unknown error occurred";
|
|
38
|
+
return n.isAxiosError(r) ? (t = r.message, r.response && (t += ` (Status: ${r.response.status})`)) : r instanceof Error && (t = r.message), `Failed to retrieve HBAR price: ${t}`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
class b {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.id = "hedera-hbar-price", this.name = "Hedera HBAR Price Plugin", this.description = "Provides tools to interact with Hedera network data, specifically HBAR price.", this.version = "1.0.0", this.author = "Hedera Agent", this.tools = [new l()];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the plugin. Currently no specific initialization needed.
|
|
48
|
+
*/
|
|
49
|
+
async initialize() {
|
|
50
|
+
return Promise.resolve();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns the tools provided by this plugin.
|
|
54
|
+
* @returns An array containing the GetHbarPriceTool.
|
|
55
|
+
*/
|
|
56
|
+
getTools() {
|
|
57
|
+
return this.tools;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Cleans up resources. Currently no cleanup needed.
|
|
61
|
+
*/
|
|
62
|
+
async cleanup() {
|
|
63
|
+
return Promise.resolve();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
l as GetHbarPriceTool,
|
|
68
|
+
b as HbarPricePlugin
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=HbarPricePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HbarPricePlugin.js","sources":["../../../src/plugins/hedera/HbarPricePlugin.ts"],"sourcesContent":["import { StructuredTool } from '@langchain/core/tools';\nimport { z } from 'zod';\nimport { IPlugin /*, PluginContext */ } from '../PluginInterface';\nimport axios from 'axios'; // Use axios instead of node-fetch\n\nconst HEDERA_MIRROR_NODE_API = 'https://mainnet.mirrornode.hedera.com/api/v1';\n\n/**\n * Defines the schema for the HBAR price API response.\n */\nconst ExchangeRateResponseSchema = z.object({\n current_rate: z.object({\n cent_equivalent: z.number(),\n hbar_equivalent: z.number(),\n expiration_time: z.number(),\n }),\n next_rate: z.object({\n cent_equivalent: z.number(),\n hbar_equivalent: z.number(),\n expiration_time: z.number(),\n }),\n timestamp: z.string(),\n});\n\n/**\n * A Langchain tool to get the current HBAR price in USD.\n */\n// Export the class for testing purposes\nexport class GetHbarPriceTool extends StructuredTool {\n name = 'getHbarPrice';\n description = 'Retrieves the current price of HBAR in USD from the Hedera Mirror Node.';\n schema = z.object({}); // No input required for this tool\n\n /**\n * DISCLAIMER: THIS TOOL USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.\n * USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.\n * Retrieves the current price of HBAR in USD from the Hedera Mirror Node.\n * @returns A promise that resolves to a string containing the current HBAR price in USD.\n */\n protected async _call(): Promise<string> {\n try {\n // Use axios.get instead of fetch\n const response = await axios.get(`${HEDERA_MIRROR_NODE_API}/network/exchangerate`);\n\n // Axios puts data directly in response.data\n const data: unknown = response.data;\n\n // Validate the response structure\n const parsedData = ExchangeRateResponseSchema.safeParse(data);\n if (!parsedData.success) {\n console.error(\"Failed to parse exchange rate response:\", parsedData.error);\n throw new Error('Invalid API response format');\n }\n\n const { current_rate } = parsedData.data;\n const priceUsd = current_rate.cent_equivalent / current_rate.hbar_equivalent / 100;\n\n return `The current price of HBAR is $${priceUsd.toFixed(6)} USD.`;\n } catch (error) {\n console.error('Error fetching HBAR price:', error);\n // Handle axios errors specifically if needed, otherwise generic handling\n let errorMessage = 'An unknown error occurred';\n if (axios.isAxiosError(error)) {\n errorMessage = error.message;\n if (error.response) {\n errorMessage += ` (Status: ${error.response.status})`;\n }\n } else if (error instanceof Error) {\n errorMessage = error.message;\n }\n return `Failed to retrieve HBAR price: ${errorMessage}`;\n }\n }\n}\n\n\n/**\n * DISCLAIMER: THIS PLUGIN USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.\n * USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.\n * Plugin to provide tools related to Hedera network information, like HBAR price.\n */\nexport class HbarPricePlugin implements IPlugin {\n id = 'hedera-hbar-price';\n name = 'Hedera HBAR Price Plugin';\n description = 'Provides tools to interact with Hedera network data, specifically HBAR price.';\n version = '1.0.0';\n author = 'Hedera Agent'; // Replace with actual author/team name if desired\n\n private tools: StructuredTool[];\n\n constructor() {\n this.tools = [new GetHbarPriceTool()];\n }\n\n /**\n * Initializes the plugin. Currently no specific initialization needed.\n */\n async initialize(): Promise<void> {\n // No specific initialization required for this plugin yet\n return Promise.resolve();\n }\n\n /**\n * Returns the tools provided by this plugin.\n * @returns An array containing the GetHbarPriceTool.\n */\n getTools(): StructuredTool[] {\n return this.tools;\n }\n\n /**\n * Cleans up resources. Currently no cleanup needed.\n */\n async cleanup(): Promise<void> {\n // No cleanup necessary\n return Promise.resolve();\n }\n}"],"names":["HEDERA_MIRROR_NODE_API","ExchangeRateResponseSchema","z","GetHbarPriceTool","StructuredTool","data","axios","parsedData","current_rate","error","errorMessage","HbarPricePlugin"],"mappings":";;;AAKA,MAAMA,IAAyB,gDAKzBC,IAA6BC,EAAE,OAAO;AAAA,EAC1C,cAAcA,EAAE,OAAO;AAAA,IACrB,iBAAiBA,EAAE,OAAO;AAAA,IAC1B,iBAAiBA,EAAE,OAAO;AAAA,IAC1B,iBAAiBA,EAAE,OAAO;AAAA,EAAA,CAC3B;AAAA,EACD,WAAWA,EAAE,OAAO;AAAA,IAClB,iBAAiBA,EAAE,OAAO;AAAA,IAC1B,iBAAiBA,EAAE,OAAO;AAAA,IAC1B,iBAAiBA,EAAE,OAAO;AAAA,EAAA,CAC3B;AAAA,EACD,WAAWA,EAAE,OAAO;AACtB,CAAC;AAMM,MAAMC,UAAyBC,EAAe;AAAA,EAA9C,cAAA;AAAA,UAAA,GAAA,SAAA,GACE,KAAA,OAAA,gBACO,KAAA,cAAA,2EACL,KAAA,SAAAF,EAAE,OAAO,CAAA,CAAE;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpB,MAAgB,QAAyB;AACnC,QAAA;AAKF,YAAMG,KAHW,MAAMC,EAAM,IAAI,GAAGN,CAAsB,uBAAuB,GAGlD,MAGzBO,IAAaN,EAA2B,UAAUI,CAAI;AACxD,UAAA,CAACE,EAAW;AACL,sBAAA,MAAM,2CAA2CA,EAAW,KAAK,GACnE,IAAI,MAAM,6BAA6B;AAG1C,YAAA,EAAE,cAAAC,MAAiBD,EAAW;AAGpC,aAAO,kCAFUC,EAAa,kBAAkBA,EAAa,kBAAkB,KAE9B,QAAQ,CAAC,CAAC;AAAA,aACpDC,GAAO;AACN,cAAA,MAAM,8BAA8BA,CAAK;AAEjD,UAAIC,IAAe;AACf,aAAAJ,EAAM,aAAaG,CAAK,KAC1BC,IAAeD,EAAM,SACjBA,EAAM,aACQC,KAAA,aAAaD,EAAM,SAAS,MAAM,QAE3CA,aAAiB,UAC1BC,IAAeD,EAAM,UAEhB,kCAAkCC,CAAY;AAAA,IAAA;AAAA,EACvD;AAEJ;AAQO,MAAMC,EAAmC;AAAA,EAS9C,cAAc;AART,SAAA,KAAA,qBACE,KAAA,OAAA,4BACO,KAAA,cAAA,iFACJ,KAAA,UAAA,SACD,KAAA,SAAA,gBAKP,KAAK,QAAQ,CAAC,IAAIR,GAAkB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMtC,MAAM,aAA4B;AAEhC,WAAO,QAAQ,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOzB,WAA6B;AAC3B,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMd,MAAM,UAAyB;AAE7B,WAAO,QAAQ,QAAQ;AAAA,EAAA;AAE3B;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BasePlugin, PluginContext } from '../../../src/plugins';
|
|
2
|
+
import { StructuredTool } from '@langchain/core/tools';
|
|
3
|
+
/**
|
|
4
|
+
* Weather API Plugin for the Standards Agent Kit
|
|
5
|
+
*/
|
|
6
|
+
export default class WeatherPlugin extends BasePlugin {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
version: string;
|
|
11
|
+
author: string;
|
|
12
|
+
private apiKey?;
|
|
13
|
+
initialize(context: PluginContext): Promise<void>;
|
|
14
|
+
getTools(): StructuredTool[];
|
|
15
|
+
}
|
|
File without changes
|
package/dist/src/init.d.ts
CHANGED
|
@@ -51,9 +51,9 @@ export interface HCS10Tools {
|
|
|
51
51
|
* @param options - Initialization options
|
|
52
52
|
* @returns Object containing hcs10Client and requested tools
|
|
53
53
|
*/
|
|
54
|
-
export declare function initializeHCS10Client(options?: HCS10InitializationOptions):
|
|
54
|
+
export declare function initializeHCS10Client(options?: HCS10InitializationOptions): {
|
|
55
55
|
hcs10Client: HCS10Client;
|
|
56
56
|
monitoringClient?: HCS10Client;
|
|
57
57
|
tools: Partial<HCS10Tools>;
|
|
58
58
|
stateManager: IStateManager;
|
|
59
|
-
}
|
|
59
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { IPlugin } from '../PluginInterface';
|
|
4
|
+
/**
|
|
5
|
+
* A Langchain tool to get the current HBAR price in USD.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GetHbarPriceTool extends StructuredTool {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* DISCLAIMER: THIS TOOL USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.
|
|
13
|
+
* USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.
|
|
14
|
+
* Retrieves the current price of HBAR in USD from the Hedera Mirror Node.
|
|
15
|
+
* @returns A promise that resolves to a string containing the current HBAR price in USD.
|
|
16
|
+
*/
|
|
17
|
+
protected _call(): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* DISCLAIMER: THIS PLUGIN USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.
|
|
21
|
+
* USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.
|
|
22
|
+
* Plugin to provide tools related to Hedera network information, like HBAR price.
|
|
23
|
+
*/
|
|
24
|
+
export declare class HbarPricePlugin implements IPlugin {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
version: string;
|
|
29
|
+
author: string;
|
|
30
|
+
private tools;
|
|
31
|
+
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* Initializes the plugin. Currently no specific initialization needed.
|
|
34
|
+
*/
|
|
35
|
+
initialize(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the tools provided by this plugin.
|
|
38
|
+
* @returns An array containing the GetHbarPriceTool.
|
|
39
|
+
*/
|
|
40
|
+
getTools(): StructuredTool[];
|
|
41
|
+
/**
|
|
42
|
+
* Cleans up resources. Currently no cleanup needed.
|
|
43
|
+
*/
|
|
44
|
+
cleanup(): Promise<void>;
|
|
45
|
+
}
|
|
@@ -7,21 +7,28 @@ export interface CheckMessagesToolParams extends ToolParams {
|
|
|
7
7
|
stateManager: IStateManager;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* A tool to check for new messages on an active HCS-10 connection topic
|
|
10
|
+
* A tool to check for new messages on an active HCS-10 connection topic,
|
|
11
|
+
* or optionally fetch the latest messages regardless of timestamp.
|
|
11
12
|
*/
|
|
12
13
|
export declare class CheckMessagesTool extends StructuredTool {
|
|
13
14
|
name: string;
|
|
14
15
|
description: string;
|
|
15
16
|
schema: z.ZodObject<{
|
|
16
17
|
targetIdentifier: z.ZodString;
|
|
18
|
+
fetchLatest: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
19
|
+
lastMessagesCount: z.ZodOptional<z.ZodNumber>;
|
|
17
20
|
}, "strip", z.ZodTypeAny, {
|
|
18
21
|
targetIdentifier: string;
|
|
22
|
+
fetchLatest: boolean;
|
|
23
|
+
lastMessagesCount?: number | undefined;
|
|
19
24
|
}, {
|
|
20
25
|
targetIdentifier: string;
|
|
26
|
+
fetchLatest?: boolean | undefined;
|
|
27
|
+
lastMessagesCount?: number | undefined;
|
|
21
28
|
}>;
|
|
22
29
|
hcsClient: HCS10Client;
|
|
23
30
|
private stateManager;
|
|
24
31
|
private logger;
|
|
25
32
|
constructor({ hcsClient, stateManager, ...rest }: CheckMessagesToolParams);
|
|
26
|
-
protected _call({ targetIdentifier, }: z.infer<this['schema']>): Promise<string>;
|
|
33
|
+
protected _call({ targetIdentifier, fetchLatest, lastMessagesCount, }: z.infer<this['schema']>): Promise<string>;
|
|
27
34
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HCS10Client, AgentBuilder, Logger } from '@hashgraphonline/standards-sdk';
|
|
2
|
+
export declare const MIN_REQUIRED_USD = 2;
|
|
3
|
+
export declare const MIN_REQUIRED_HBAR_USD = 10;
|
|
4
|
+
export declare const ENV_FILE_PATH: string;
|
|
5
|
+
export interface AgentData {
|
|
6
|
+
accountId: string;
|
|
7
|
+
operatorId: string;
|
|
8
|
+
inboundTopicId: string;
|
|
9
|
+
outboundTopicId: string;
|
|
10
|
+
client: HCS10Client;
|
|
11
|
+
}
|
|
12
|
+
export interface RegistrationProgressData {
|
|
13
|
+
registered: boolean;
|
|
14
|
+
accountId?: string;
|
|
15
|
+
privateKey?: string;
|
|
16
|
+
publicKey?: string;
|
|
17
|
+
inboundTopicId?: string;
|
|
18
|
+
outboundTopicId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function ensureAgentHasEnoughHbar(logger: Logger, baseClient: HCS10Client, accountId: string, agentName: string): Promise<void>;
|
|
21
|
+
export declare function getAgentFromEnv(logger: Logger, baseClient: HCS10Client, agentName: string, envPrefix: string): Promise<AgentData | null>;
|
|
22
|
+
export declare function createAgent(logger: Logger, baseClient: HCS10Client, agentName: string, agentBuilder: AgentBuilder, envPrefix: string): Promise<AgentData | null>;
|
|
23
|
+
export declare function updateEnvFile(envFilePath: string, variables: Record<string, string>): Promise<void>;
|