@toolforge-js/sdk 0.6.0 → 0.7.0

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.
@@ -1771,47 +1771,6 @@ const agentErrorMessageSchema = baseMessageSchema.extend({
1771
1771
  })
1772
1772
  });
1773
1773
 
1774
- //#endregion
1775
- //#region ../core/dist/utils.js
1776
- function exponentialBackoff(attempt, initialDelay = 1e3, maxRetryDelay = 3e4, jitterFactor = .5, backoffMultiplier = 2) {
1777
- let delay = initialDelay * Math.pow(backoffMultiplier, attempt - 1);
1778
- const jitter = delay * jitterFactor * Math.random();
1779
- delay += jitter;
1780
- return Math.min(delay, maxRetryDelay);
1781
- }
1782
- function runWithRetries(fn, retries = 3, config = {}) {
1783
- let attempt = 0;
1784
- const execute = async () => {
1785
- try {
1786
- return await fn();
1787
- } catch (error) {
1788
- if (attempt < retries) {
1789
- attempt++;
1790
- await setTimeout(exponentialBackoff(attempt, config.initialDelayMs, config.maxDelayMs, config.backoffMultiplier));
1791
- return execute();
1792
- }
1793
- throw error;
1794
- }
1795
- };
1796
- return execute();
1797
- }
1798
-
1799
- //#endregion
1800
- //#region src/lib/utils.ts
1801
- function convertToWords(input) {
1802
- if (input.includes("-") || input.includes("_")) return input.split(/[-_]+/).filter((word) => word.length > 0).map((word) => word.toLowerCase());
1803
- return input.split(/(?=[A-Z])/).filter((word) => word.length > 0).map((word) => word.toLowerCase());
1804
- }
1805
- function invariant(cond, message) {
1806
- if (!cond) throw new Error(message);
1807
- }
1808
- function getErrorMessage(error, defaultMessage = "Something went wrong. Please try again") {
1809
- let errorMessage = defaultMessage;
1810
- if (error instanceof z$1.ZodError) errorMessage = error.issues.length ? error.issues.map((e) => e.message).join(", ") : error.message;
1811
- else if (error instanceof Error) errorMessage = error.message;
1812
- return errorMessage;
1813
- }
1814
-
1815
1774
  //#endregion
1816
1775
  //#region src/internal/block.ts
1817
1776
  var Block = class {
@@ -2043,6 +2002,47 @@ var Block = class {
2043
2002
  }
2044
2003
  };
2045
2004
 
2005
+ //#endregion
2006
+ //#region ../core/dist/utils.js
2007
+ function exponentialBackoff(attempt, initialDelay = 1e3, maxRetryDelay = 3e4, jitterFactor = .5, backoffMultiplier = 2) {
2008
+ let delay = initialDelay * Math.pow(backoffMultiplier, attempt - 1);
2009
+ const jitter = delay * jitterFactor * Math.random();
2010
+ delay += jitter;
2011
+ return Math.min(delay, maxRetryDelay);
2012
+ }
2013
+ function runWithRetries(fn, retries = 3, config = {}) {
2014
+ let attempt = 0;
2015
+ const execute = async () => {
2016
+ try {
2017
+ return await fn();
2018
+ } catch (error) {
2019
+ if (attempt < retries) {
2020
+ attempt++;
2021
+ await setTimeout(exponentialBackoff(attempt, config.initialDelayMs, config.maxDelayMs, config.backoffMultiplier));
2022
+ return execute();
2023
+ }
2024
+ throw error;
2025
+ }
2026
+ };
2027
+ return execute();
2028
+ }
2029
+
2030
+ //#endregion
2031
+ //#region src/lib/utils.ts
2032
+ function convertToWords(input) {
2033
+ if (input.includes("-") || input.includes("_")) return input.split(/[-_]+/).filter((word) => word.length > 0).map((word) => word.toLowerCase());
2034
+ return input.split(/(?=[A-Z])/).filter((word) => word.length > 0).map((word) => word.toLowerCase());
2035
+ }
2036
+ function invariant(cond, message) {
2037
+ if (!cond) throw new Error(message);
2038
+ }
2039
+ function getErrorMessage(error, defaultMessage = "Something went wrong. Please try again") {
2040
+ let errorMessage = defaultMessage;
2041
+ if (error instanceof z$1.ZodError) errorMessage = error.issues.length ? error.issues.map((e) => e.message).join(", ") : error.message;
2042
+ else if (error instanceof Error) errorMessage = error.message;
2043
+ return errorMessage;
2044
+ }
2045
+
2046
2046
  //#endregion
2047
2047
  //#region src/internal/loader.ts
2048
2048
  var Loader = class {
@@ -2624,6 +2624,73 @@ var IO = class {
2624
2624
  }
2625
2625
  };
2626
2626
 
2627
+ //#endregion
2628
+ //#region src/internal/tool.ts
2629
+ const TOOL_HANDLER_TAG_NAME = Symbol("TOOL_HANDLER");
2630
+ const TOOL_TAG_NAME = Symbol("TOOL");
2631
+ /**
2632
+ * Tool class is responsible for running the tool's logic.
2633
+ * It manages the tool lifecycle, communication with the worker, and handles sending messages back to the ForgeRunner.
2634
+ * It uses the IO component to facilitate input/output operations for the tool.
2635
+ */
2636
+ var Tool = class {
2637
+ #metadata;
2638
+ #abortController = new AbortController();
2639
+ #handler;
2640
+ #io;
2641
+ #block;
2642
+ #logger;
2643
+ constructor(options, logger) {
2644
+ this.#metadata = options.metadata;
2645
+ this.#handler = options.handler;
2646
+ this.#logger = logger.child({
2647
+ sessionId: this.#metadata.sessionId,
2648
+ component: "TOOL"
2649
+ });
2650
+ this.#io = new IO({
2651
+ sessionId: this.#metadata.sessionId,
2652
+ runnerId: this.#metadata.runnerId,
2653
+ webSocketClient: options.webSocketClient,
2654
+ signal: this.#abortController.signal,
2655
+ executionContext: { type: "TOOL" }
2656
+ }, this.#logger);
2657
+ this.#block = new Block({ signal: this.#abortController.signal });
2658
+ this.#logger.debug("initialized Tool instance");
2659
+ }
2660
+ async run() {
2661
+ return new Promise(async (resolve, reject) => {
2662
+ if (this.#abortController.signal.aborted) {
2663
+ this.#logger.info("tool execution aborted before start");
2664
+ return Promise.reject(/* @__PURE__ */ new Error("tool execution aborted"));
2665
+ }
2666
+ this.#abortController.signal.addEventListener("abort", () => {
2667
+ this.#logger.info("tool execution aborted");
2668
+ reject(/* @__PURE__ */ new Error("Tool execution aborted"));
2669
+ });
2670
+ try {
2671
+ this.#logger.info("running tool handler...");
2672
+ const output = await this.#handler({
2673
+ io: this.#io,
2674
+ signal: this.#abortController.signal,
2675
+ block: this.#block,
2676
+ metadata: this.#metadata
2677
+ });
2678
+ this.#logger.info("tool handler completed successfully");
2679
+ this.#io[STOP_SYMBOL]();
2680
+ resolve(output);
2681
+ } catch (error) {
2682
+ this.#logger.error(error, "error running tool handler");
2683
+ return reject(error);
2684
+ }
2685
+ });
2686
+ }
2687
+ stop() {
2688
+ this.#logger.info("stopping Tool...");
2689
+ this.#abortController.abort();
2690
+ this.#logger.info("Tool stopped");
2691
+ }
2692
+ };
2693
+
2627
2694
  //#endregion
2628
2695
  //#region src/internal/workflow-builder.ts
2629
2696
  var WorkflowBuilder = class {
@@ -3023,71 +3090,4 @@ var Agent = class {
3023
3090
  };
3024
3091
 
3025
3092
  //#endregion
3026
- //#region src/internal/tool.ts
3027
- const TOOL_HANDLER_TAG_NAME = Symbol("TOOL_HANDLER");
3028
- const TOOL_TAG_NAME = Symbol("TOOL");
3029
- /**
3030
- * Tool class is responsible for running the tool's logic.
3031
- * It manages the tool lifecycle, communication with the worker, and handles sending messages back to the ForgeRunner.
3032
- * It uses the IO component to facilitate input/output operations for the tool.
3033
- */
3034
- var Tool = class {
3035
- #metadata;
3036
- #abortController = new AbortController();
3037
- #handler;
3038
- #io;
3039
- #block;
3040
- #logger;
3041
- constructor(options, logger) {
3042
- this.#metadata = options.metadata;
3043
- this.#handler = options.handler;
3044
- this.#logger = logger.child({
3045
- sessionId: this.#metadata.sessionId,
3046
- component: "TOOL"
3047
- });
3048
- this.#io = new IO({
3049
- sessionId: this.#metadata.sessionId,
3050
- runnerId: this.#metadata.runnerId,
3051
- webSocketClient: options.webSocketClient,
3052
- signal: this.#abortController.signal,
3053
- executionContext: { type: "TOOL" }
3054
- }, this.#logger);
3055
- this.#block = new Block({ signal: this.#abortController.signal });
3056
- this.#logger.debug("initialized Tool instance");
3057
- }
3058
- async run() {
3059
- return new Promise(async (resolve, reject) => {
3060
- if (this.#abortController.signal.aborted) {
3061
- this.#logger.info("tool execution aborted before start");
3062
- return Promise.reject(/* @__PURE__ */ new Error("tool execution aborted"));
3063
- }
3064
- this.#abortController.signal.addEventListener("abort", () => {
3065
- this.#logger.info("tool execution aborted");
3066
- reject(/* @__PURE__ */ new Error("Tool execution aborted"));
3067
- });
3068
- try {
3069
- this.#logger.info("running tool handler...");
3070
- const output = await this.#handler({
3071
- io: this.#io,
3072
- signal: this.#abortController.signal,
3073
- block: this.#block,
3074
- metadata: this.#metadata
3075
- });
3076
- this.#logger.info("tool handler completed successfully");
3077
- this.#io[STOP_SYMBOL]();
3078
- resolve(output);
3079
- } catch (error) {
3080
- this.#logger.error(error, "error running tool handler");
3081
- return reject(error);
3082
- }
3083
- });
3084
- }
3085
- stop() {
3086
- this.#logger.info("stopping Tool...");
3087
- this.#abortController.abort();
3088
- this.#logger.info("Tool stopped");
3089
- }
3090
- };
3091
-
3092
- //#endregion
3093
- export { __toESM as C, __require as S, startAgentMessageSchema as _, AGENT_TAG_NAME as a, stopToolMessageSchema as b, getErrorMessage as c, runWithRetries as d, ackMessageSchema as f, runnerId as g, initCommunicationMessageSchema as h, AGENT_STEP_TAG_NAME as i, invariant as l, heartbeatAckMessageSchema as m, TOOL_TAG_NAME as n, Agent as o, baseMessageSchema as p, Tool as r, convertToWords as s, TOOL_HANDLER_TAG_NAME as t, exponentialBackoff as u, startToolMessageSchema as v, __commonJS as x, stopAgentMessageSchema as y };
3093
+ export { __toESM as C, __require as S, startAgentMessageSchema as _, TOOL_TAG_NAME as a, stopToolMessageSchema as b, getErrorMessage as c, runWithRetries as d, ackMessageSchema as f, runnerId as g, initCommunicationMessageSchema as h, TOOL_HANDLER_TAG_NAME as i, invariant as l, heartbeatAckMessageSchema as m, AGENT_TAG_NAME as n, Tool as o, baseMessageSchema as p, Agent as r, convertToWords as s, AGENT_STEP_TAG_NAME as t, exponentialBackoff as u, startToolMessageSchema as v, __commonJS as x, stopAgentMessageSchema as y };
package/dist/cli/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { C as __toESM, S as __require, _ as startAgentMessageSchema, a as AGENT_TAG_NAME, b as stopToolMessageSchema, c as getErrorMessage, d as runWithRetries, f as ackMessageSchema, g as runnerId, h as initCommunicationMessageSchema, i as AGENT_STEP_TAG_NAME, l as invariant, m as heartbeatAckMessageSchema, n as TOOL_TAG_NAME, o as Agent, p as baseMessageSchema, r as Tool, s as convertToWords, t as TOOL_HANDLER_TAG_NAME, u as exponentialBackoff, v as startToolMessageSchema, x as __commonJS, y as stopAgentMessageSchema } from "../tool-UVAGtnlr.js";
1
+ import { C as __toESM, S as __require, _ as startAgentMessageSchema, a as TOOL_TAG_NAME, b as stopToolMessageSchema, c as getErrorMessage, d as runWithRetries, f as ackMessageSchema, g as runnerId, h as initCommunicationMessageSchema, i as TOOL_HANDLER_TAG_NAME, l as invariant, m as heartbeatAckMessageSchema, n as AGENT_TAG_NAME, o as Tool, p as baseMessageSchema, r as Agent, s as convertToWords, t as AGENT_STEP_TAG_NAME, u as exponentialBackoff, v as startToolMessageSchema, x as __commonJS, y as stopAgentMessageSchema } from "../agent-DBDnKm26.js";
2
2
  import { t as toolForgeConfigSchema } from "../config-schema-CcWOtgOv.js";
3
3
  import * as z$1 from "zod";
4
4
  import z from "zod";
5
+ import { P, match } from "ts-pattern";
6
+ import { setTimeout as setTimeout$1 } from "node:timers/promises";
7
+ import { nanoid } from "nanoid";
5
8
  import { readFileSync } from "node:fs";
6
9
  import * as path from "node:path";
7
10
  import { EventEmitter } from "node:events";
8
11
  import { pino } from "pino";
9
- import { P, match } from "ts-pattern";
10
- import { setTimeout as setTimeout$1 } from "node:timers/promises";
11
12
  import chokidar from "chokidar";
12
- import { nanoid } from "nanoid";
13
13
  import picocolors from "picocolors";
14
14
  import * as fs from "node:fs/promises";
15
15
  import * as os from "node:os";
@@ -3801,36 +3801,13 @@ var ForgeRunner = class extends EventEmitter {
3801
3801
  //#region src/cli/index.ts
3802
3802
  const version = JSON.parse(readFileSync(path.resolve(__dirname, "../../package.json"), "utf-8")).version;
3803
3803
  program.name("toolforge-js").description("Tool Forge SDK").version(version);
3804
- program.command("dev").option("-c, --config <path>", "path to the tool-forge config file", "toolforge.config.ts").option("-d, --debug", "enable debug logging", false).action(async function startServer() {
3805
- const logger = pino({
3806
- level: z$1.boolean().optional().default(false).parse(this.opts().debug) ? "debug" : "info",
3807
- transport: { target: "pino-pretty" }
3804
+ program.command("dev").description("start the tool forge development server").option("-c, --config <path>", "path to the tool-forge config file", "toolforge.config.ts").option("-d, --debug", "enable debug logging", false).action(async function startServer() {
3805
+ const debug = z$1.boolean().optional().default(false).parse(this.opts().debug);
3806
+ await startToolForge({
3807
+ configRelPath: z$1.string().parse(this.opts().config),
3808
+ debug,
3809
+ mode: "development"
3808
3810
  });
3809
- try {
3810
- const configRelPath = z$1.string().parse(this.opts().config);
3811
- const configPath = path.resolve(process.cwd(), configRelPath);
3812
- const config = toolForgeConfigSchema.parse(await import(configPath).then((mod) => mod.default));
3813
- logger.debug({ config }, "loaded config from %s", configPath);
3814
- const runner = new ForgeRunner(config, { mode: "development" }, logger);
3815
- runner.on("error", async (error) => {
3816
- logger.error(error, "tool runner error - shutting down");
3817
- await runner.stop();
3818
- process.exit(1);
3819
- });
3820
- process.on("SIGTERM", async () => {
3821
- logger.info("gracefully shutting down tool runner...");
3822
- await runner.stop();
3823
- process.exit(1);
3824
- });
3825
- process.on("SIGINT", async () => {
3826
- logger.info("gracefully shutting down tool runner...");
3827
- await runner.stop();
3828
- process.exit(1);
3829
- });
3830
- } catch (error) {
3831
- logger.error(error, "failed to start tool runner");
3832
- process.exit(1);
3833
- }
3834
3811
  });
3835
3812
  program.command("build").description("build the tools for production").option("-c, --config <path>", "path to the tool-forge config file", "toolforge.config.ts").option("-d, --debug", "enable debug logging", false).action(async function() {
3836
3813
  const logger = pino({
@@ -3861,6 +3838,44 @@ program.command("build").description("build the tools for production").option("-
3861
3838
  process.exit(1);
3862
3839
  }
3863
3840
  });
3841
+ program.command("start").description("start the tool forge server in production mode").option("-c, --config <path>", "path to the tool-forge config file", "toolforge.config.ts").option("-d, --debug", "enable debug logging", false).action(async function startServer() {
3842
+ const debug = z$1.boolean().optional().default(false).parse(this.opts().debug);
3843
+ await startToolForge({
3844
+ configRelPath: z$1.string().parse(this.opts().config),
3845
+ debug,
3846
+ mode: "production"
3847
+ });
3848
+ });
3849
+ async function startToolForge({ configRelPath, debug, mode }) {
3850
+ const logger = pino({
3851
+ level: debug ? "debug" : "info",
3852
+ transport: { target: "pino-pretty" }
3853
+ });
3854
+ try {
3855
+ const configPath = path.resolve(process.cwd(), configRelPath);
3856
+ const config = toolForgeConfigSchema.parse(await import(configPath).then((mod) => mod.default));
3857
+ logger.debug({ config }, "loaded config from %s", configPath);
3858
+ const runner = new ForgeRunner(config, { mode }, logger);
3859
+ runner.on("error", async (error) => {
3860
+ logger.error(error, "tool runner error - shutting down");
3861
+ await runner.stop();
3862
+ process.exit(1);
3863
+ });
3864
+ process.on("SIGTERM", async () => {
3865
+ logger.info("gracefully shutting down tool runner...");
3866
+ await runner.stop();
3867
+ process.exit(1);
3868
+ });
3869
+ process.on("SIGINT", async () => {
3870
+ logger.info("gracefully shutting down tool runner...");
3871
+ await runner.stop();
3872
+ process.exit(1);
3873
+ });
3874
+ } catch (error) {
3875
+ logger.error(error, "failed to start tool runner");
3876
+ process.exit(1);
3877
+ }
3878
+ }
3864
3879
  program.parse(Bun.argv);
3865
3880
 
3866
3881
  //#endregion
@@ -99,8 +99,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
99
99
  chartType: z$1.ZodLiteral<"progress-bar">;
100
100
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
101
101
  default: "default";
102
- success: "success";
103
102
  error: "error";
103
+ success: "success";
104
104
  neutral: "neutral";
105
105
  warning: "warning";
106
106
  }>>>;
@@ -111,8 +111,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
111
111
  chartType: z$1.ZodLiteral<"progress-circle">;
112
112
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
113
113
  default: "default";
114
- success: "success";
115
114
  error: "error";
115
+ success: "success";
116
116
  neutral: "neutral";
117
117
  warning: "warning";
118
118
  }>>>;
@@ -615,8 +615,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
615
615
  label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
616
616
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
617
617
  default: "default";
618
- success: "success";
619
618
  error: "error";
619
+ success: "success";
620
620
  neutral: "neutral";
621
621
  warning: "warning";
622
622
  }>>>;
@@ -630,8 +630,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
630
630
  radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
631
631
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
632
632
  default: "default";
633
- success: "success";
634
633
  error: "error";
634
+ success: "success";
635
635
  neutral: "neutral";
636
636
  warning: "warning";
637
637
  }>>>;
@@ -888,8 +888,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
888
888
  chartType: z$1.ZodLiteral<"progress-bar">;
889
889
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
890
890
  default: "default";
891
- success: "success";
892
891
  error: "error";
892
+ success: "success";
893
893
  neutral: "neutral";
894
894
  warning: "warning";
895
895
  }>>>;
@@ -900,8 +900,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
900
900
  chartType: z$1.ZodLiteral<"progress-circle">;
901
901
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
902
902
  default: "default";
903
- success: "success";
904
903
  error: "error";
904
+ success: "success";
905
905
  neutral: "neutral";
906
906
  warning: "warning";
907
907
  }>>>;
@@ -1404,8 +1404,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
1404
1404
  label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
1405
1405
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
1406
1406
  default: "default";
1407
- success: "success";
1408
1407
  error: "error";
1408
+ success: "success";
1409
1409
  neutral: "neutral";
1410
1410
  warning: "warning";
1411
1411
  }>>>;
@@ -1419,8 +1419,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
1419
1419
  radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
1420
1420
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
1421
1421
  default: "default";
1422
- success: "success";
1423
1422
  error: "error";
1423
+ success: "success";
1424
1424
  neutral: "neutral";
1425
1425
  warning: "warning";
1426
1426
  }>>>;
@@ -1655,8 +1655,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
1655
1655
  type: z$1.ZodLiteral<"badge">;
1656
1656
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
1657
1657
  default: "default";
1658
- success: "success";
1659
1658
  error: "error";
1659
+ success: "success";
1660
1660
  neutral: "neutral";
1661
1661
  warning: "warning";
1662
1662
  }>>>;
@@ -1678,8 +1678,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
1678
1678
  maxValue: z$1.ZodNumber;
1679
1679
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
1680
1680
  default: "default";
1681
- success: "success";
1682
1681
  error: "error";
1682
+ success: "success";
1683
1683
  neutral: "neutral";
1684
1684
  warning: "warning";
1685
1685
  }>>>;
@@ -1769,8 +1769,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
1769
1769
  type: z$1.ZodLiteral<"badge">;
1770
1770
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
1771
1771
  default: "default";
1772
- success: "success";
1773
1772
  error: "error";
1773
+ success: "success";
1774
1774
  neutral: "neutral";
1775
1775
  warning: "warning";
1776
1776
  }>>>;
@@ -1792,8 +1792,8 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
1792
1792
  maxValue: z$1.ZodNumber;
1793
1793
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
1794
1794
  default: "default";
1795
- success: "success";
1796
1795
  error: "error";
1796
+ success: "success";
1797
1797
  neutral: "neutral";
1798
1798
  warning: "warning";
1799
1799
  }>>>;
@@ -2913,8 +2913,8 @@ declare const chartBlock: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2913
2913
  label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
2914
2914
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
2915
2915
  default: "default";
2916
- success: "success";
2917
2916
  error: "error";
2917
+ success: "success";
2918
2918
  neutral: "neutral";
2919
2919
  warning: "warning";
2920
2920
  }>>>;
@@ -2928,8 +2928,8 @@ declare const chartBlock: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2928
2928
  radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
2929
2929
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
2930
2930
  default: "default";
2931
- success: "success";
2932
2931
  error: "error";
2932
+ success: "success";
2933
2933
  neutral: "neutral";
2934
2934
  warning: "warning";
2935
2935
  }>>>;
@@ -3304,8 +3304,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3304
3304
  chartType: z$1.ZodLiteral<"progress-bar">;
3305
3305
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
3306
3306
  default: "default";
3307
- success: "success";
3308
3307
  error: "error";
3308
+ success: "success";
3309
3309
  neutral: "neutral";
3310
3310
  warning: "warning";
3311
3311
  }>>>;
@@ -3316,8 +3316,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3316
3316
  chartType: z$1.ZodLiteral<"progress-circle">;
3317
3317
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
3318
3318
  default: "default";
3319
- success: "success";
3320
3319
  error: "error";
3320
+ success: "success";
3321
3321
  neutral: "neutral";
3322
3322
  warning: "warning";
3323
3323
  }>>>;
@@ -3820,8 +3820,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3820
3820
  label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
3821
3821
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
3822
3822
  default: "default";
3823
- success: "success";
3824
3823
  error: "error";
3824
+ success: "success";
3825
3825
  neutral: "neutral";
3826
3826
  warning: "warning";
3827
3827
  }>>>;
@@ -3835,8 +3835,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3835
3835
  radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
3836
3836
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
3837
3837
  default: "default";
3838
- success: "success";
3839
3838
  error: "error";
3839
+ success: "success";
3840
3840
  neutral: "neutral";
3841
3841
  warning: "warning";
3842
3842
  }>>>;
@@ -4093,8 +4093,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4093
4093
  chartType: z$1.ZodLiteral<"progress-bar">;
4094
4094
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4095
4095
  default: "default";
4096
- success: "success";
4097
4096
  error: "error";
4097
+ success: "success";
4098
4098
  neutral: "neutral";
4099
4099
  warning: "warning";
4100
4100
  }>>>;
@@ -4105,8 +4105,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4105
4105
  chartType: z$1.ZodLiteral<"progress-circle">;
4106
4106
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4107
4107
  default: "default";
4108
- success: "success";
4109
4108
  error: "error";
4109
+ success: "success";
4110
4110
  neutral: "neutral";
4111
4111
  warning: "warning";
4112
4112
  }>>>;
@@ -4609,8 +4609,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4609
4609
  label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
4610
4610
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4611
4611
  default: "default";
4612
- success: "success";
4613
4612
  error: "error";
4613
+ success: "success";
4614
4614
  neutral: "neutral";
4615
4615
  warning: "warning";
4616
4616
  }>>>;
@@ -4624,8 +4624,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4624
4624
  radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
4625
4625
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4626
4626
  default: "default";
4627
- success: "success";
4628
4627
  error: "error";
4628
+ success: "success";
4629
4629
  neutral: "neutral";
4630
4630
  warning: "warning";
4631
4631
  }>>>;
@@ -4860,8 +4860,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4860
4860
  type: z$1.ZodLiteral<"badge">;
4861
4861
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4862
4862
  default: "default";
4863
- success: "success";
4864
4863
  error: "error";
4864
+ success: "success";
4865
4865
  neutral: "neutral";
4866
4866
  warning: "warning";
4867
4867
  }>>>;
@@ -4883,8 +4883,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4883
4883
  maxValue: z$1.ZodNumber;
4884
4884
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4885
4885
  default: "default";
4886
- success: "success";
4887
4886
  error: "error";
4887
+ success: "success";
4888
4888
  neutral: "neutral";
4889
4889
  warning: "warning";
4890
4890
  }>>>;
@@ -4974,8 +4974,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4974
4974
  type: z$1.ZodLiteral<"badge">;
4975
4975
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4976
4976
  default: "default";
4977
- success: "success";
4978
4977
  error: "error";
4978
+ success: "success";
4979
4979
  neutral: "neutral";
4980
4980
  warning: "warning";
4981
4981
  }>>>;
@@ -4997,8 +4997,8 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4997
4997
  maxValue: z$1.ZodNumber;
4998
4998
  variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
4999
4999
  default: "default";
5000
- success: "success";
5001
5000
  error: "error";
5001
+ success: "success";
5002
5002
  neutral: "neutral";
5003
5003
  warning: "warning";
5004
5004
  }>>>;
@@ -5074,7 +5074,7 @@ declare class Block {
5074
5074
  type: "number" | "currency" | "percentage";
5075
5075
  decimals: number;
5076
5076
  currency: string;
5077
- currencyDisplay: "symbol" | "name" | "code";
5077
+ currencyDisplay: "symbol" | "code" | "name";
5078
5078
  thousandsSeparator: string;
5079
5079
  decimalSeparator: string;
5080
5080
  showPercentageSymbol: boolean;
@@ -5111,7 +5111,7 @@ declare class Block {
5111
5111
  type: "number" | "currency" | "percentage";
5112
5112
  decimals: number;
5113
5113
  currency: string;
5114
- currencyDisplay: "symbol" | "name" | "code";
5114
+ currencyDisplay: "symbol" | "code" | "name";
5115
5115
  thousandsSeparator: string;
5116
5116
  decimalSeparator: string;
5117
5117
  showPercentageSymbol: boolean;
@@ -5180,7 +5180,7 @@ declare class Block {
5180
5180
  type: "number" | "currency" | "percentage";
5181
5181
  decimals: number;
5182
5182
  currency: string;
5183
- currencyDisplay: "symbol" | "name" | "code";
5183
+ currencyDisplay: "symbol" | "code" | "name";
5184
5184
  thousandsSeparator: string;
5185
5185
  decimalSeparator: string;
5186
5186
  showPercentageSymbol: boolean;
@@ -5215,7 +5215,7 @@ declare class Block {
5215
5215
  type: "number" | "currency" | "percentage";
5216
5216
  decimals: number;
5217
5217
  currency: string;
5218
- currencyDisplay: "symbol" | "name" | "code";
5218
+ currencyDisplay: "symbol" | "code" | "name";
5219
5219
  thousandsSeparator: string;
5220
5220
  decimalSeparator: string;
5221
5221
  showPercentageSymbol: boolean;
@@ -5235,7 +5235,7 @@ declare class Block {
5235
5235
  chartType: "progress-bar";
5236
5236
  value: number;
5237
5237
  max: number;
5238
- variant: "error" | "default" | "success" | "neutral" | "warning";
5238
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5239
5239
  title?: string | undefined;
5240
5240
  description?: string | undefined;
5241
5241
  label?: string | number | undefined;
@@ -5251,7 +5251,7 @@ declare class Block {
5251
5251
  value: number;
5252
5252
  max: number;
5253
5253
  radius: number;
5254
- variant: "error" | "default" | "success" | "neutral" | "warning";
5254
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5255
5255
  title?: string | undefined;
5256
5256
  description?: string | undefined;
5257
5257
  };
@@ -5315,7 +5315,7 @@ declare class Block {
5315
5315
  type: "number" | "currency" | "percentage";
5316
5316
  decimals: number;
5317
5317
  currency: string;
5318
- currencyDisplay: "symbol" | "name" | "code";
5318
+ currencyDisplay: "symbol" | "code" | "name";
5319
5319
  thousandsSeparator: string;
5320
5320
  decimalSeparator: string;
5321
5321
  showPercentageSymbol: boolean;
@@ -5336,7 +5336,7 @@ declare class Block {
5336
5336
  type: "number" | "currency" | "percentage";
5337
5337
  decimals: number;
5338
5338
  currency: string;
5339
- currencyDisplay: "symbol" | "name" | "code";
5339
+ currencyDisplay: "symbol" | "code" | "name";
5340
5340
  thousandsSeparator: string;
5341
5341
  decimalSeparator: string;
5342
5342
  showPercentageSymbol: boolean;
@@ -5381,7 +5381,7 @@ declare class Block {
5381
5381
  type: "number" | "currency" | "percentage";
5382
5382
  decimals: number;
5383
5383
  currency: string;
5384
- currencyDisplay: "symbol" | "name" | "code";
5384
+ currencyDisplay: "symbol" | "code" | "name";
5385
5385
  thousandsSeparator: string;
5386
5386
  decimalSeparator: string;
5387
5387
  showPercentageSymbol: boolean;
@@ -5406,7 +5406,7 @@ declare class Block {
5406
5406
  type: "number" | "currency" | "percentage";
5407
5407
  decimals: number;
5408
5408
  currency: string;
5409
- currencyDisplay: "symbol" | "name" | "code";
5409
+ currencyDisplay: "symbol" | "code" | "name";
5410
5410
  thousandsSeparator: string;
5411
5411
  decimalSeparator: string;
5412
5412
  showPercentageSymbol: boolean;
@@ -5416,7 +5416,7 @@ declare class Block {
5416
5416
  suffix?: string | undefined;
5417
5417
  } | undefined;
5418
5418
  change?: string | number | undefined;
5419
- changeType?: "neutral" | "positive" | "negative" | undefined;
5419
+ changeType?: "positive" | "negative" | "neutral" | undefined;
5420
5420
  chart?: {
5421
5421
  values: (number | {
5422
5422
  value: number;
@@ -5436,14 +5436,14 @@ declare class Block {
5436
5436
  type: "chart";
5437
5437
  max: number;
5438
5438
  chartType: "progress-bar";
5439
- variant: "error" | "default" | "success" | "neutral" | "warning";
5439
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5440
5440
  label?: string | number | undefined;
5441
5441
  } | {
5442
5442
  value: number;
5443
5443
  type: "chart";
5444
5444
  max: number;
5445
5445
  chartType: "progress-circle";
5446
- variant: "error" | "default" | "success" | "neutral" | "warning";
5446
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5447
5447
  radius: number;
5448
5448
  } | {
5449
5449
  data: Record<string, any>[];
@@ -5486,7 +5486,7 @@ declare class Block {
5486
5486
  type: "default";
5487
5487
  } | {
5488
5488
  type: "badge";
5489
- variant: "error" | "default" | "success" | "neutral" | "warning";
5489
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5490
5490
  } | {
5491
5491
  type: "image";
5492
5492
  width: number;
@@ -5496,7 +5496,7 @@ declare class Block {
5496
5496
  type: "progress";
5497
5497
  chartType: "bar" | "circle";
5498
5498
  maxValue: number;
5499
- variant: "error" | "default" | "success" | "neutral" | "warning";
5499
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5500
5500
  } | {
5501
5501
  type: "link";
5502
5502
  target: "_blank" | "_self";
@@ -5507,7 +5507,7 @@ declare class Block {
5507
5507
  type: "number" | "currency" | "percentage";
5508
5508
  decimals: number;
5509
5509
  currency: string;
5510
- currencyDisplay: "symbol" | "name" | "code";
5510
+ currencyDisplay: "symbol" | "code" | "name";
5511
5511
  thousandsSeparator: string;
5512
5512
  decimalSeparator: string;
5513
5513
  showPercentageSymbol: boolean;
@@ -5572,7 +5572,7 @@ declare class Block {
5572
5572
  type: "number" | "currency" | "percentage";
5573
5573
  decimals: number;
5574
5574
  currency: string;
5575
- currencyDisplay: "symbol" | "name" | "code";
5575
+ currencyDisplay: "symbol" | "code" | "name";
5576
5576
  thousandsSeparator: string;
5577
5577
  decimalSeparator: string;
5578
5578
  showPercentageSymbol: boolean;
@@ -5582,7 +5582,7 @@ declare class Block {
5582
5582
  suffix?: string | undefined;
5583
5583
  } | undefined;
5584
5584
  change?: string | number | undefined;
5585
- changeType?: "neutral" | "positive" | "negative" | undefined;
5585
+ changeType?: "positive" | "negative" | "neutral" | undefined;
5586
5586
  chart?: {
5587
5587
  values: (number | {
5588
5588
  value: number;
@@ -5602,14 +5602,14 @@ declare class Block {
5602
5602
  type: "chart";
5603
5603
  max: number;
5604
5604
  chartType: "progress-bar";
5605
- variant: "error" | "default" | "success" | "neutral" | "warning";
5605
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5606
5606
  label?: string | number | undefined;
5607
5607
  } | {
5608
5608
  value: number;
5609
5609
  type: "chart";
5610
5610
  max: number;
5611
5611
  chartType: "progress-circle";
5612
- variant: "error" | "default" | "success" | "neutral" | "warning";
5612
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5613
5613
  radius: number;
5614
5614
  } | {
5615
5615
  data: Record<string, any>[];
@@ -5654,7 +5654,7 @@ declare class Block {
5654
5654
  type: "number" | "currency" | "percentage";
5655
5655
  decimals: number;
5656
5656
  currency: string;
5657
- currencyDisplay: "symbol" | "name" | "code";
5657
+ currencyDisplay: "symbol" | "code" | "name";
5658
5658
  thousandsSeparator: string;
5659
5659
  decimalSeparator: string;
5660
5660
  showPercentageSymbol: boolean;
@@ -5687,7 +5687,7 @@ declare class Block {
5687
5687
  type: "number" | "currency" | "percentage";
5688
5688
  decimals: number;
5689
5689
  currency: string;
5690
- currencyDisplay: "symbol" | "name" | "code";
5690
+ currencyDisplay: "symbol" | "code" | "name";
5691
5691
  thousandsSeparator: string;
5692
5692
  decimalSeparator: string;
5693
5693
  showPercentageSymbol: boolean;
@@ -5717,7 +5717,7 @@ declare class Block {
5717
5717
  type: "number" | "currency" | "percentage";
5718
5718
  decimals: number;
5719
5719
  currency: string;
5720
- currencyDisplay: "symbol" | "name" | "code";
5720
+ currencyDisplay: "symbol" | "code" | "name";
5721
5721
  thousandsSeparator: string;
5722
5722
  decimalSeparator: string;
5723
5723
  showPercentageSymbol: boolean;
@@ -5738,7 +5738,7 @@ declare class Block {
5738
5738
  type: "number" | "currency" | "percentage";
5739
5739
  decimals: number;
5740
5740
  currency: string;
5741
- currencyDisplay: "symbol" | "name" | "code";
5741
+ currencyDisplay: "symbol" | "code" | "name";
5742
5742
  thousandsSeparator: string;
5743
5743
  decimalSeparator: string;
5744
5744
  showPercentageSymbol: boolean;
@@ -5798,7 +5798,7 @@ declare class Block {
5798
5798
  type: "number" | "currency" | "percentage";
5799
5799
  decimals: number;
5800
5800
  currency: string;
5801
- currencyDisplay: "symbol" | "name" | "code";
5801
+ currencyDisplay: "symbol" | "code" | "name";
5802
5802
  thousandsSeparator: string;
5803
5803
  decimalSeparator: string;
5804
5804
  showPercentageSymbol: boolean;
@@ -5829,7 +5829,7 @@ declare class Block {
5829
5829
  type: "number" | "currency" | "percentage";
5830
5830
  decimals: number;
5831
5831
  currency: string;
5832
- currencyDisplay: "symbol" | "name" | "code";
5832
+ currencyDisplay: "symbol" | "code" | "name";
5833
5833
  thousandsSeparator: string;
5834
5834
  decimalSeparator: string;
5835
5835
  showPercentageSymbol: boolean;
@@ -5843,7 +5843,7 @@ declare class Block {
5843
5843
  chartType: "progress-bar";
5844
5844
  value: number;
5845
5845
  max: number;
5846
- variant: "error" | "default" | "success" | "neutral" | "warning";
5846
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5847
5847
  title?: string | undefined;
5848
5848
  description?: string | undefined;
5849
5849
  label?: string | number | undefined;
@@ -5853,7 +5853,7 @@ declare class Block {
5853
5853
  value: number;
5854
5854
  max: number;
5855
5855
  radius: number;
5856
- variant: "error" | "default" | "success" | "neutral" | "warning";
5856
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5857
5857
  title?: string | undefined;
5858
5858
  description?: string | undefined;
5859
5859
  } | {
@@ -5901,7 +5901,7 @@ declare class Block {
5901
5901
  type: "number" | "currency" | "percentage";
5902
5902
  decimals: number;
5903
5903
  currency: string;
5904
- currencyDisplay: "symbol" | "name" | "code";
5904
+ currencyDisplay: "symbol" | "code" | "name";
5905
5905
  thousandsSeparator: string;
5906
5906
  decimalSeparator: string;
5907
5907
  showPercentageSymbol: boolean;
@@ -5924,7 +5924,7 @@ declare class Block {
5924
5924
  type: "default";
5925
5925
  } | {
5926
5926
  type: "badge";
5927
- variant: "error" | "default" | "success" | "neutral" | "warning";
5927
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5928
5928
  } | {
5929
5929
  type: "image";
5930
5930
  width: number;
@@ -5934,7 +5934,7 @@ declare class Block {
5934
5934
  type: "progress";
5935
5935
  chartType: "bar" | "circle";
5936
5936
  maxValue: number;
5937
- variant: "error" | "default" | "success" | "neutral" | "warning";
5937
+ variant: "error" | "success" | "default" | "neutral" | "warning";
5938
5938
  } | {
5939
5939
  type: "link";
5940
5940
  target: "_blank" | "_self";
@@ -5945,7 +5945,7 @@ declare class Block {
5945
5945
  type: "number" | "currency" | "percentage";
5946
5946
  decimals: number;
5947
5947
  currency: string;
5948
- currencyDisplay: "symbol" | "name" | "code";
5948
+ currencyDisplay: "symbol" | "code" | "name";
5949
5949
  thousandsSeparator: string;
5950
5950
  decimalSeparator: string;
5951
5951
  showPercentageSymbol: boolean;
@@ -1,4 +1,4 @@
1
- import { a as AGENT_TAG_NAME, i as AGENT_STEP_TAG_NAME, n as TOOL_TAG_NAME, t as TOOL_HANDLER_TAG_NAME } from "../tool-UVAGtnlr.js";
1
+ import { a as TOOL_TAG_NAME, i as TOOL_HANDLER_TAG_NAME, n as AGENT_TAG_NAME, t as AGENT_STEP_TAG_NAME } from "../agent-DBDnKm26.js";
2
2
 
3
3
  //#region src/components/tool.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolforge-js/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",