@toolforge-js/sdk 0.8.2 → 0.8.3
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
CHANGED
|
@@ -38,25 +38,13 @@ After installing the tool-forge sdk, you have configure the SDK using `toolforge
|
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
40
|
// toolforge.config.ts
|
|
41
|
-
import { defineToolForgeConfig } from '@toolforge-js/sdk'
|
|
42
41
|
import 'dotenv/config'
|
|
42
|
+
import { defineToolForgeConfig } from '@toolforge-js/sdk'
|
|
43
43
|
import { defineConfig } from '@toolforge-js/sdk/config'
|
|
44
|
-
import * as z from 'zod'
|
|
45
|
-
|
|
46
|
-
// store the API key in environment variable TOOL_FORGE_API_KEY
|
|
47
|
-
|
|
48
|
-
const { TOOL_FORGE_API_KEY } = z
|
|
49
|
-
.object({
|
|
50
|
-
TOOL_FORGE_API_KEY: z
|
|
51
|
-
.string()
|
|
52
|
-
.refine((val) => val.startsWith('sk_live') || val.startsWith('pk_test'), {
|
|
53
|
-
message: 'API key must start with sk_live or pk_test',
|
|
54
|
-
}),
|
|
55
|
-
})
|
|
56
|
-
.parse(process.env)
|
|
57
44
|
|
|
58
45
|
export default defineConfig({
|
|
59
|
-
|
|
46
|
+
// store the API key in environment variable TOOL_FORGE_API_KEY
|
|
47
|
+
apiKey: process.env.TOOL_FORGE_API_KEY,
|
|
60
48
|
})
|
|
61
49
|
```
|
|
62
50
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as __toESM, S as __require, _ as stopToolMessageSchema, a as AGENT_TAG_NAME, b as invariant, c as runWithRetries, d as heartbeatAckMessageSchema, f as initCommunicationMessageSchema, g as stopAgentMessageSchema, h as startToolMessageSchema, i as AGENT_STEP_TAG_NAME, l as ackMessageSchema, m as startAgentMessageSchema, n as TOOL_TAG_NAME, o as Agent, p as runnerId, r as Tool, s as exponentialBackoff, t as TOOL_HANDLER_TAG_NAME, u as baseMessageSchema, v as convertToWords, x as __commonJS, y as getErrorMessage } from "../tool-DDDEH8M3.js";
|
|
2
|
-
import { n as toolForgeConfigSchema,
|
|
2
|
+
import { n as toolForgeConfigSchema, t as TF_CONFIG_TAG_NAME } from "../config-schema-V_1JIDL9.js";
|
|
3
3
|
import * as z$1 from "zod";
|
|
4
4
|
import z from "zod";
|
|
5
5
|
import { createReadStream, readFileSync } from "node:fs";
|
|
@@ -3689,6 +3689,11 @@ function getDeviceLabel() {
|
|
|
3689
3689
|
return `${os.userInfo().username}@${os.hostname()}`;
|
|
3690
3690
|
}
|
|
3691
3691
|
|
|
3692
|
+
//#endregion
|
|
3693
|
+
//#region ../core/dist/token/index.js
|
|
3694
|
+
const TOKEN_PREFIX = "tf_token--";
|
|
3695
|
+
const TOOL_FORGE_TOKEN_FILE = "TOOL_FORGE_TOKEN_FILE";
|
|
3696
|
+
|
|
3692
3697
|
//#endregion
|
|
3693
3698
|
//#region src/internal/websocket-client.ts
|
|
3694
3699
|
const optionsSchema$1 = z$1.object({
|
|
@@ -4017,7 +4022,12 @@ var ForgeRunner = class extends EventEmitter {
|
|
|
4017
4022
|
constructor(config, options, logger) {
|
|
4018
4023
|
super({ captureRejections: true });
|
|
4019
4024
|
this.#config = config;
|
|
4020
|
-
this.#apiKey = config.apiKey;
|
|
4025
|
+
if (typeof config.apiKey === "string") this.#apiKey = config.apiKey;
|
|
4026
|
+
else if (typeof process.env[TOOL_FORGE_TOKEN_FILE] === "string") {
|
|
4027
|
+
const token = readFileSync(process.env[TOOL_FORGE_TOKEN_FILE], "utf-8").trim();
|
|
4028
|
+
if (!token.startsWith(TOKEN_PREFIX)) throw new Error(`API key in ${process.env[TOOL_FORGE_TOKEN_FILE]} is invalid`);
|
|
4029
|
+
this.#apiKey = token;
|
|
4030
|
+
} else throw new Error("API key is required to initialize ForgeRunner");
|
|
4021
4031
|
const url = new URL(this.#config.sdkServer);
|
|
4022
4032
|
url.searchParams.set("apiKey", this.#apiKey);
|
|
4023
4033
|
url.searchParams.set("runnerId", this.#id);
|
|
@@ -4030,9 +4040,7 @@ var ForgeRunner = class extends EventEmitter {
|
|
|
4030
4040
|
runnerId: this.#id
|
|
4031
4041
|
}, this, this.#logger);
|
|
4032
4042
|
this.#webSocketClient.on(WEB_SOCKET_CLIENT_EVENTS.COMMUNICATION_INITIALIZED, this.#handleWebSocketCommunicationInitialized.bind(this));
|
|
4033
|
-
if (this.#apiKey.startsWith(TOKEN_PREFIX)) this.#refreshApiKeyInterval = setInterval(()
|
|
4034
|
-
this.#refreshApiKey();
|
|
4035
|
-
}, 840 * 1e3);
|
|
4043
|
+
if (this.#apiKey.startsWith(TOKEN_PREFIX)) this.#refreshApiKeyInterval = setInterval(this.#refreshApiKey.bind(this), 840 * 1e3);
|
|
4036
4044
|
this.#logger.info({
|
|
4037
4045
|
mode: this.#options.mode,
|
|
4038
4046
|
id: this.#id
|
|
@@ -98,9 +98,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
98
98
|
max: z$1.ZodNumber;
|
|
99
99
|
chartType: z$1.ZodLiteral<"progress-bar">;
|
|
100
100
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
101
|
+
error: "error";
|
|
101
102
|
success: "success";
|
|
102
103
|
default: "default";
|
|
103
|
-
error: "error";
|
|
104
104
|
neutral: "neutral";
|
|
105
105
|
warning: "warning";
|
|
106
106
|
}>>>;
|
|
@@ -110,9 +110,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
110
110
|
max: z$1.ZodNumber;
|
|
111
111
|
chartType: z$1.ZodLiteral<"progress-circle">;
|
|
112
112
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
113
|
+
error: "error";
|
|
113
114
|
success: "success";
|
|
114
115
|
default: "default";
|
|
115
|
-
error: "error";
|
|
116
116
|
neutral: "neutral";
|
|
117
117
|
warning: "warning";
|
|
118
118
|
}>>>;
|
|
@@ -614,9 +614,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
614
614
|
max: z$1.ZodNumber;
|
|
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
|
+
error: "error";
|
|
617
618
|
success: "success";
|
|
618
619
|
default: "default";
|
|
619
|
-
error: "error";
|
|
620
620
|
neutral: "neutral";
|
|
621
621
|
warning: "warning";
|
|
622
622
|
}>>>;
|
|
@@ -629,9 +629,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
629
629
|
max: z$1.ZodNumber;
|
|
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
|
+
error: "error";
|
|
632
633
|
success: "success";
|
|
633
634
|
default: "default";
|
|
634
|
-
error: "error";
|
|
635
635
|
neutral: "neutral";
|
|
636
636
|
warning: "warning";
|
|
637
637
|
}>>>;
|
|
@@ -903,9 +903,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
903
903
|
max: z$1.ZodNumber;
|
|
904
904
|
chartType: z$1.ZodLiteral<"progress-bar">;
|
|
905
905
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
906
|
+
error: "error";
|
|
906
907
|
success: "success";
|
|
907
908
|
default: "default";
|
|
908
|
-
error: "error";
|
|
909
909
|
neutral: "neutral";
|
|
910
910
|
warning: "warning";
|
|
911
911
|
}>>>;
|
|
@@ -915,9 +915,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
915
915
|
max: z$1.ZodNumber;
|
|
916
916
|
chartType: z$1.ZodLiteral<"progress-circle">;
|
|
917
917
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
918
|
+
error: "error";
|
|
918
919
|
success: "success";
|
|
919
920
|
default: "default";
|
|
920
|
-
error: "error";
|
|
921
921
|
neutral: "neutral";
|
|
922
922
|
warning: "warning";
|
|
923
923
|
}>>>;
|
|
@@ -1419,9 +1419,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
1419
1419
|
max: z$1.ZodNumber;
|
|
1420
1420
|
label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
|
|
1421
1421
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1422
|
+
error: "error";
|
|
1422
1423
|
success: "success";
|
|
1423
1424
|
default: "default";
|
|
1424
|
-
error: "error";
|
|
1425
1425
|
neutral: "neutral";
|
|
1426
1426
|
warning: "warning";
|
|
1427
1427
|
}>>>;
|
|
@@ -1434,9 +1434,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
1434
1434
|
max: z$1.ZodNumber;
|
|
1435
1435
|
radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1436
1436
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1437
|
+
error: "error";
|
|
1437
1438
|
success: "success";
|
|
1438
1439
|
default: "default";
|
|
1439
|
-
error: "error";
|
|
1440
1440
|
neutral: "neutral";
|
|
1441
1441
|
warning: "warning";
|
|
1442
1442
|
}>>>;
|
|
@@ -1686,9 +1686,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
1686
1686
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1687
1687
|
type: z$1.ZodLiteral<"badge">;
|
|
1688
1688
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1689
|
+
error: "error";
|
|
1689
1690
|
success: "success";
|
|
1690
1691
|
default: "default";
|
|
1691
|
-
error: "error";
|
|
1692
1692
|
neutral: "neutral";
|
|
1693
1693
|
warning: "warning";
|
|
1694
1694
|
}>>>;
|
|
@@ -1709,9 +1709,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
1709
1709
|
}>>>;
|
|
1710
1710
|
maxValue: z$1.ZodNumber;
|
|
1711
1711
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1712
|
+
error: "error";
|
|
1712
1713
|
success: "success";
|
|
1713
1714
|
default: "default";
|
|
1714
|
-
error: "error";
|
|
1715
1715
|
neutral: "neutral";
|
|
1716
1716
|
warning: "warning";
|
|
1717
1717
|
}>>>;
|
|
@@ -1800,9 +1800,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
1800
1800
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1801
1801
|
type: z$1.ZodLiteral<"badge">;
|
|
1802
1802
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1803
|
+
error: "error";
|
|
1803
1804
|
success: "success";
|
|
1804
1805
|
default: "default";
|
|
1805
|
-
error: "error";
|
|
1806
1806
|
neutral: "neutral";
|
|
1807
1807
|
warning: "warning";
|
|
1808
1808
|
}>>>;
|
|
@@ -1823,9 +1823,9 @@ declare const showMessageMessageSchema: z$1.ZodObject<{
|
|
|
1823
1823
|
}>>>;
|
|
1824
1824
|
maxValue: z$1.ZodNumber;
|
|
1825
1825
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1826
|
+
error: "error";
|
|
1826
1827
|
success: "success";
|
|
1827
1828
|
default: "default";
|
|
1828
|
-
error: "error";
|
|
1829
1829
|
neutral: "neutral";
|
|
1830
1830
|
warning: "warning";
|
|
1831
1831
|
}>>>;
|
|
@@ -2944,9 +2944,9 @@ declare const chartBlock: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2944
2944
|
max: z$1.ZodNumber;
|
|
2945
2945
|
label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
|
|
2946
2946
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
2947
|
+
error: "error";
|
|
2947
2948
|
success: "success";
|
|
2948
2949
|
default: "default";
|
|
2949
|
-
error: "error";
|
|
2950
2950
|
neutral: "neutral";
|
|
2951
2951
|
warning: "warning";
|
|
2952
2952
|
}>>>;
|
|
@@ -2959,9 +2959,9 @@ declare const chartBlock: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
2959
2959
|
max: z$1.ZodNumber;
|
|
2960
2960
|
radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2961
2961
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
2962
|
+
error: "error";
|
|
2962
2963
|
success: "success";
|
|
2963
2964
|
default: "default";
|
|
2964
|
-
error: "error";
|
|
2965
2965
|
neutral: "neutral";
|
|
2966
2966
|
warning: "warning";
|
|
2967
2967
|
}>>>;
|
|
@@ -3349,9 +3349,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
3349
3349
|
max: z$1.ZodNumber;
|
|
3350
3350
|
chartType: z$1.ZodLiteral<"progress-bar">;
|
|
3351
3351
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
3352
|
+
error: "error";
|
|
3352
3353
|
success: "success";
|
|
3353
3354
|
default: "default";
|
|
3354
|
-
error: "error";
|
|
3355
3355
|
neutral: "neutral";
|
|
3356
3356
|
warning: "warning";
|
|
3357
3357
|
}>>>;
|
|
@@ -3361,9 +3361,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
3361
3361
|
max: z$1.ZodNumber;
|
|
3362
3362
|
chartType: z$1.ZodLiteral<"progress-circle">;
|
|
3363
3363
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
3364
|
+
error: "error";
|
|
3364
3365
|
success: "success";
|
|
3365
3366
|
default: "default";
|
|
3366
|
-
error: "error";
|
|
3367
3367
|
neutral: "neutral";
|
|
3368
3368
|
warning: "warning";
|
|
3369
3369
|
}>>>;
|
|
@@ -3865,9 +3865,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
3865
3865
|
max: z$1.ZodNumber;
|
|
3866
3866
|
label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
|
|
3867
3867
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
3868
|
+
error: "error";
|
|
3868
3869
|
success: "success";
|
|
3869
3870
|
default: "default";
|
|
3870
|
-
error: "error";
|
|
3871
3871
|
neutral: "neutral";
|
|
3872
3872
|
warning: "warning";
|
|
3873
3873
|
}>>>;
|
|
@@ -3880,9 +3880,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
3880
3880
|
max: z$1.ZodNumber;
|
|
3881
3881
|
radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
3882
3882
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
3883
|
+
error: "error";
|
|
3883
3884
|
success: "success";
|
|
3884
3885
|
default: "default";
|
|
3885
|
-
error: "error";
|
|
3886
3886
|
neutral: "neutral";
|
|
3887
3887
|
warning: "warning";
|
|
3888
3888
|
}>>>;
|
|
@@ -4154,9 +4154,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
4154
4154
|
max: z$1.ZodNumber;
|
|
4155
4155
|
chartType: z$1.ZodLiteral<"progress-bar">;
|
|
4156
4156
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
4157
|
+
error: "error";
|
|
4157
4158
|
success: "success";
|
|
4158
4159
|
default: "default";
|
|
4159
|
-
error: "error";
|
|
4160
4160
|
neutral: "neutral";
|
|
4161
4161
|
warning: "warning";
|
|
4162
4162
|
}>>>;
|
|
@@ -4166,9 +4166,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
4166
4166
|
max: z$1.ZodNumber;
|
|
4167
4167
|
chartType: z$1.ZodLiteral<"progress-circle">;
|
|
4168
4168
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
4169
|
+
error: "error";
|
|
4169
4170
|
success: "success";
|
|
4170
4171
|
default: "default";
|
|
4171
|
-
error: "error";
|
|
4172
4172
|
neutral: "neutral";
|
|
4173
4173
|
warning: "warning";
|
|
4174
4174
|
}>>>;
|
|
@@ -4670,9 +4670,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
4670
4670
|
max: z$1.ZodNumber;
|
|
4671
4671
|
label: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>>;
|
|
4672
4672
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
4673
|
+
error: "error";
|
|
4673
4674
|
success: "success";
|
|
4674
4675
|
default: "default";
|
|
4675
|
-
error: "error";
|
|
4676
4676
|
neutral: "neutral";
|
|
4677
4677
|
warning: "warning";
|
|
4678
4678
|
}>>>;
|
|
@@ -4685,9 +4685,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
4685
4685
|
max: z$1.ZodNumber;
|
|
4686
4686
|
radius: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
4687
4687
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
4688
|
+
error: "error";
|
|
4688
4689
|
success: "success";
|
|
4689
4690
|
default: "default";
|
|
4690
|
-
error: "error";
|
|
4691
4691
|
neutral: "neutral";
|
|
4692
4692
|
warning: "warning";
|
|
4693
4693
|
}>>>;
|
|
@@ -4937,9 +4937,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
4937
4937
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
4938
4938
|
type: z$1.ZodLiteral<"badge">;
|
|
4939
4939
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
4940
|
+
error: "error";
|
|
4940
4941
|
success: "success";
|
|
4941
4942
|
default: "default";
|
|
4942
|
-
error: "error";
|
|
4943
4943
|
neutral: "neutral";
|
|
4944
4944
|
warning: "warning";
|
|
4945
4945
|
}>>>;
|
|
@@ -4960,9 +4960,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
4960
4960
|
}>>>;
|
|
4961
4961
|
maxValue: z$1.ZodNumber;
|
|
4962
4962
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
4963
|
+
error: "error";
|
|
4963
4964
|
success: "success";
|
|
4964
4965
|
default: "default";
|
|
4965
|
-
error: "error";
|
|
4966
4966
|
neutral: "neutral";
|
|
4967
4967
|
warning: "warning";
|
|
4968
4968
|
}>>>;
|
|
@@ -5051,9 +5051,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
5051
5051
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
5052
5052
|
type: z$1.ZodLiteral<"badge">;
|
|
5053
5053
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
5054
|
+
error: "error";
|
|
5054
5055
|
success: "success";
|
|
5055
5056
|
default: "default";
|
|
5056
|
-
error: "error";
|
|
5057
5057
|
neutral: "neutral";
|
|
5058
5058
|
warning: "warning";
|
|
5059
5059
|
}>>>;
|
|
@@ -5074,9 +5074,9 @@ declare const blockSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
5074
5074
|
}>>>;
|
|
5075
5075
|
maxValue: z$1.ZodNumber;
|
|
5076
5076
|
variant: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
5077
|
+
error: "error";
|
|
5077
5078
|
success: "success";
|
|
5078
5079
|
default: "default";
|
|
5079
|
-
error: "error";
|
|
5080
5080
|
neutral: "neutral";
|
|
5081
5081
|
warning: "warning";
|
|
5082
5082
|
}>>>;
|
|
@@ -5152,7 +5152,7 @@ declare class Block {
|
|
|
5152
5152
|
type: "number" | "currency" | "percentage";
|
|
5153
5153
|
decimals: number;
|
|
5154
5154
|
currency: string;
|
|
5155
|
-
currencyDisplay: "symbol" | "
|
|
5155
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5156
5156
|
thousandsSeparator: string;
|
|
5157
5157
|
decimalSeparator: string;
|
|
5158
5158
|
showPercentageSymbol: boolean;
|
|
@@ -5189,7 +5189,7 @@ declare class Block {
|
|
|
5189
5189
|
type: "number" | "currency" | "percentage";
|
|
5190
5190
|
decimals: number;
|
|
5191
5191
|
currency: string;
|
|
5192
|
-
currencyDisplay: "symbol" | "
|
|
5192
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5193
5193
|
thousandsSeparator: string;
|
|
5194
5194
|
decimalSeparator: string;
|
|
5195
5195
|
showPercentageSymbol: boolean;
|
|
@@ -5258,7 +5258,7 @@ declare class Block {
|
|
|
5258
5258
|
type: "number" | "currency" | "percentage";
|
|
5259
5259
|
decimals: number;
|
|
5260
5260
|
currency: string;
|
|
5261
|
-
currencyDisplay: "symbol" | "
|
|
5261
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5262
5262
|
thousandsSeparator: string;
|
|
5263
5263
|
decimalSeparator: string;
|
|
5264
5264
|
showPercentageSymbol: boolean;
|
|
@@ -5293,7 +5293,7 @@ declare class Block {
|
|
|
5293
5293
|
type: "number" | "currency" | "percentage";
|
|
5294
5294
|
decimals: number;
|
|
5295
5295
|
currency: string;
|
|
5296
|
-
currencyDisplay: "symbol" | "
|
|
5296
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5297
5297
|
thousandsSeparator: string;
|
|
5298
5298
|
decimalSeparator: string;
|
|
5299
5299
|
showPercentageSymbol: boolean;
|
|
@@ -5313,7 +5313,7 @@ declare class Block {
|
|
|
5313
5313
|
chartType: "progress-bar";
|
|
5314
5314
|
value: number;
|
|
5315
5315
|
max: number;
|
|
5316
|
-
variant: "error" | "
|
|
5316
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5317
5317
|
title?: string | undefined;
|
|
5318
5318
|
description?: string | undefined;
|
|
5319
5319
|
label?: string | number | undefined;
|
|
@@ -5329,7 +5329,7 @@ declare class Block {
|
|
|
5329
5329
|
value: number;
|
|
5330
5330
|
max: number;
|
|
5331
5331
|
radius: number;
|
|
5332
|
-
variant: "error" | "
|
|
5332
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5333
5333
|
title?: string | undefined;
|
|
5334
5334
|
description?: string | undefined;
|
|
5335
5335
|
};
|
|
@@ -5393,7 +5393,7 @@ declare class Block {
|
|
|
5393
5393
|
type: "number" | "currency" | "percentage";
|
|
5394
5394
|
decimals: number;
|
|
5395
5395
|
currency: string;
|
|
5396
|
-
currencyDisplay: "symbol" | "
|
|
5396
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5397
5397
|
thousandsSeparator: string;
|
|
5398
5398
|
decimalSeparator: string;
|
|
5399
5399
|
showPercentageSymbol: boolean;
|
|
@@ -5414,7 +5414,7 @@ declare class Block {
|
|
|
5414
5414
|
type: "number" | "currency" | "percentage";
|
|
5415
5415
|
decimals: number;
|
|
5416
5416
|
currency: string;
|
|
5417
|
-
currencyDisplay: "symbol" | "
|
|
5417
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5418
5418
|
thousandsSeparator: string;
|
|
5419
5419
|
decimalSeparator: string;
|
|
5420
5420
|
showPercentageSymbol: boolean;
|
|
@@ -5459,7 +5459,7 @@ declare class Block {
|
|
|
5459
5459
|
type: "number" | "currency" | "percentage";
|
|
5460
5460
|
decimals: number;
|
|
5461
5461
|
currency: string;
|
|
5462
|
-
currencyDisplay: "symbol" | "
|
|
5462
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5463
5463
|
thousandsSeparator: string;
|
|
5464
5464
|
decimalSeparator: string;
|
|
5465
5465
|
showPercentageSymbol: boolean;
|
|
@@ -5484,7 +5484,7 @@ declare class Block {
|
|
|
5484
5484
|
type: "number" | "currency" | "percentage";
|
|
5485
5485
|
decimals: number;
|
|
5486
5486
|
currency: string;
|
|
5487
|
-
currencyDisplay: "symbol" | "
|
|
5487
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5488
5488
|
thousandsSeparator: string;
|
|
5489
5489
|
decimalSeparator: string;
|
|
5490
5490
|
showPercentageSymbol: boolean;
|
|
@@ -5494,7 +5494,7 @@ declare class Block {
|
|
|
5494
5494
|
suffix?: string | undefined;
|
|
5495
5495
|
} | undefined;
|
|
5496
5496
|
change?: string | number | undefined;
|
|
5497
|
-
changeType?: "
|
|
5497
|
+
changeType?: "positive" | "negative" | "neutral" | undefined;
|
|
5498
5498
|
chart?: {
|
|
5499
5499
|
values: (number | {
|
|
5500
5500
|
value: number;
|
|
@@ -5514,14 +5514,14 @@ declare class Block {
|
|
|
5514
5514
|
value: number;
|
|
5515
5515
|
max: number;
|
|
5516
5516
|
chartType: "progress-bar";
|
|
5517
|
-
variant: "error" | "
|
|
5517
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5518
5518
|
label?: string | number | undefined;
|
|
5519
5519
|
} | {
|
|
5520
5520
|
type: "chart";
|
|
5521
5521
|
value: number;
|
|
5522
5522
|
max: number;
|
|
5523
5523
|
chartType: "progress-circle";
|
|
5524
|
-
variant: "error" | "
|
|
5524
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5525
5525
|
radius: number;
|
|
5526
5526
|
} | {
|
|
5527
5527
|
type: "chart";
|
|
@@ -5564,7 +5564,7 @@ declare class Block {
|
|
|
5564
5564
|
type: "default";
|
|
5565
5565
|
} | {
|
|
5566
5566
|
type: "badge";
|
|
5567
|
-
variant: "error" | "
|
|
5567
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5568
5568
|
} | {
|
|
5569
5569
|
type: "image";
|
|
5570
5570
|
width: number;
|
|
@@ -5574,7 +5574,7 @@ declare class Block {
|
|
|
5574
5574
|
type: "progress";
|
|
5575
5575
|
chartType: "bar" | "circle";
|
|
5576
5576
|
maxValue: number;
|
|
5577
|
-
variant: "error" | "
|
|
5577
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5578
5578
|
} | {
|
|
5579
5579
|
type: "link";
|
|
5580
5580
|
target: "_blank" | "_self";
|
|
@@ -5585,7 +5585,7 @@ declare class Block {
|
|
|
5585
5585
|
type: "number" | "currency" | "percentage";
|
|
5586
5586
|
decimals: number;
|
|
5587
5587
|
currency: string;
|
|
5588
|
-
currencyDisplay: "symbol" | "
|
|
5588
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5589
5589
|
thousandsSeparator: string;
|
|
5590
5590
|
decimalSeparator: string;
|
|
5591
5591
|
showPercentageSymbol: boolean;
|
|
@@ -5650,7 +5650,7 @@ declare class Block {
|
|
|
5650
5650
|
type: "number" | "currency" | "percentage";
|
|
5651
5651
|
decimals: number;
|
|
5652
5652
|
currency: string;
|
|
5653
|
-
currencyDisplay: "symbol" | "
|
|
5653
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5654
5654
|
thousandsSeparator: string;
|
|
5655
5655
|
decimalSeparator: string;
|
|
5656
5656
|
showPercentageSymbol: boolean;
|
|
@@ -5660,7 +5660,7 @@ declare class Block {
|
|
|
5660
5660
|
suffix?: string | undefined;
|
|
5661
5661
|
} | undefined;
|
|
5662
5662
|
change?: string | number | undefined;
|
|
5663
|
-
changeType?: "
|
|
5663
|
+
changeType?: "positive" | "negative" | "neutral" | undefined;
|
|
5664
5664
|
chart?: {
|
|
5665
5665
|
values: (number | {
|
|
5666
5666
|
value: number;
|
|
@@ -5680,14 +5680,14 @@ declare class Block {
|
|
|
5680
5680
|
value: number;
|
|
5681
5681
|
max: number;
|
|
5682
5682
|
chartType: "progress-bar";
|
|
5683
|
-
variant: "error" | "
|
|
5683
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5684
5684
|
label?: string | number | undefined;
|
|
5685
5685
|
} | {
|
|
5686
5686
|
type: "chart";
|
|
5687
5687
|
value: number;
|
|
5688
5688
|
max: number;
|
|
5689
5689
|
chartType: "progress-circle";
|
|
5690
|
-
variant: "error" | "
|
|
5690
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5691
5691
|
radius: number;
|
|
5692
5692
|
} | {
|
|
5693
5693
|
type: "chart";
|
|
@@ -5732,7 +5732,7 @@ declare class Block {
|
|
|
5732
5732
|
type: "number" | "currency" | "percentage";
|
|
5733
5733
|
decimals: number;
|
|
5734
5734
|
currency: string;
|
|
5735
|
-
currencyDisplay: "symbol" | "
|
|
5735
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5736
5736
|
thousandsSeparator: string;
|
|
5737
5737
|
decimalSeparator: string;
|
|
5738
5738
|
showPercentageSymbol: boolean;
|
|
@@ -5765,7 +5765,7 @@ declare class Block {
|
|
|
5765
5765
|
type: "number" | "currency" | "percentage";
|
|
5766
5766
|
decimals: number;
|
|
5767
5767
|
currency: string;
|
|
5768
|
-
currencyDisplay: "symbol" | "
|
|
5768
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5769
5769
|
thousandsSeparator: string;
|
|
5770
5770
|
decimalSeparator: string;
|
|
5771
5771
|
showPercentageSymbol: boolean;
|
|
@@ -5795,7 +5795,7 @@ declare class Block {
|
|
|
5795
5795
|
type: "number" | "currency" | "percentage";
|
|
5796
5796
|
decimals: number;
|
|
5797
5797
|
currency: string;
|
|
5798
|
-
currencyDisplay: "symbol" | "
|
|
5798
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5799
5799
|
thousandsSeparator: string;
|
|
5800
5800
|
decimalSeparator: string;
|
|
5801
5801
|
showPercentageSymbol: boolean;
|
|
@@ -5816,7 +5816,7 @@ declare class Block {
|
|
|
5816
5816
|
type: "number" | "currency" | "percentage";
|
|
5817
5817
|
decimals: number;
|
|
5818
5818
|
currency: string;
|
|
5819
|
-
currencyDisplay: "symbol" | "
|
|
5819
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5820
5820
|
thousandsSeparator: string;
|
|
5821
5821
|
decimalSeparator: string;
|
|
5822
5822
|
showPercentageSymbol: boolean;
|
|
@@ -5876,7 +5876,7 @@ declare class Block {
|
|
|
5876
5876
|
type: "number" | "currency" | "percentage";
|
|
5877
5877
|
decimals: number;
|
|
5878
5878
|
currency: string;
|
|
5879
|
-
currencyDisplay: "symbol" | "
|
|
5879
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5880
5880
|
thousandsSeparator: string;
|
|
5881
5881
|
decimalSeparator: string;
|
|
5882
5882
|
showPercentageSymbol: boolean;
|
|
@@ -5907,7 +5907,7 @@ declare class Block {
|
|
|
5907
5907
|
type: "number" | "currency" | "percentage";
|
|
5908
5908
|
decimals: number;
|
|
5909
5909
|
currency: string;
|
|
5910
|
-
currencyDisplay: "symbol" | "
|
|
5910
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5911
5911
|
thousandsSeparator: string;
|
|
5912
5912
|
decimalSeparator: string;
|
|
5913
5913
|
showPercentageSymbol: boolean;
|
|
@@ -5921,7 +5921,7 @@ declare class Block {
|
|
|
5921
5921
|
chartType: "progress-bar";
|
|
5922
5922
|
value: number;
|
|
5923
5923
|
max: number;
|
|
5924
|
-
variant: "error" | "
|
|
5924
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5925
5925
|
title?: string | undefined;
|
|
5926
5926
|
description?: string | undefined;
|
|
5927
5927
|
label?: string | number | undefined;
|
|
@@ -5931,7 +5931,7 @@ declare class Block {
|
|
|
5931
5931
|
value: number;
|
|
5932
5932
|
max: number;
|
|
5933
5933
|
radius: number;
|
|
5934
|
-
variant: "error" | "
|
|
5934
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
5935
5935
|
title?: string | undefined;
|
|
5936
5936
|
description?: string | undefined;
|
|
5937
5937
|
} | {
|
|
@@ -5979,7 +5979,7 @@ declare class Block {
|
|
|
5979
5979
|
type: "number" | "currency" | "percentage";
|
|
5980
5980
|
decimals: number;
|
|
5981
5981
|
currency: string;
|
|
5982
|
-
currencyDisplay: "symbol" | "
|
|
5982
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
5983
5983
|
thousandsSeparator: string;
|
|
5984
5984
|
decimalSeparator: string;
|
|
5985
5985
|
showPercentageSymbol: boolean;
|
|
@@ -6011,7 +6011,7 @@ declare class Block {
|
|
|
6011
6011
|
type: "default";
|
|
6012
6012
|
} | {
|
|
6013
6013
|
type: "badge";
|
|
6014
|
-
variant: "error" | "
|
|
6014
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
6015
6015
|
} | {
|
|
6016
6016
|
type: "image";
|
|
6017
6017
|
width: number;
|
|
@@ -6021,7 +6021,7 @@ declare class Block {
|
|
|
6021
6021
|
type: "progress";
|
|
6022
6022
|
chartType: "bar" | "circle";
|
|
6023
6023
|
maxValue: number;
|
|
6024
|
-
variant: "error" | "
|
|
6024
|
+
variant: "error" | "success" | "default" | "neutral" | "warning";
|
|
6025
6025
|
} | {
|
|
6026
6026
|
type: "link";
|
|
6027
6027
|
target: "_blank" | "_self";
|
|
@@ -6032,7 +6032,7 @@ declare class Block {
|
|
|
6032
6032
|
type: "number" | "currency" | "percentage";
|
|
6033
6033
|
decimals: number;
|
|
6034
6034
|
currency: string;
|
|
6035
|
-
currencyDisplay: "symbol" | "
|
|
6035
|
+
currencyDisplay: "symbol" | "code" | "name";
|
|
6036
6036
|
thousandsSeparator: string;
|
|
6037
6037
|
decimalSeparator: string;
|
|
6038
6038
|
showPercentageSymbol: boolean;
|
|
@@ -6086,7 +6086,7 @@ declare class Block {
|
|
|
6086
6086
|
//#region src/config/config-schema.d.ts
|
|
6087
6087
|
declare const toolForgeConfigSchema: z$1.ZodObject<{
|
|
6088
6088
|
toolsDir: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
|
|
6089
|
-
apiKey: z$1.ZodString
|
|
6089
|
+
apiKey: z$1.ZodOptional<z$1.ZodString>;
|
|
6090
6090
|
sdkServer: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodURL>>;
|
|
6091
6091
|
appServerUrl: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodURL>>;
|
|
6092
6092
|
appUrl: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodURL>>;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type ToolForgeConfig = {
|
|
|
7
7
|
* Must start with `sk_live` or `pk_test`.
|
|
8
8
|
* Get your API key from the Tool Forge environment dashboard.
|
|
9
9
|
*/
|
|
10
|
-
apiKey
|
|
10
|
+
apiKey?: string;
|
|
11
11
|
/** Optional URL for the SDK server (overrides default). */
|
|
12
12
|
sdkServer?: string;
|
|
13
13
|
/** Optional URL for the Tool Forge app server (overrides default). */
|
|
@@ -22,11 +22,11 @@ type ToolForgeConfig = {
|
|
|
22
22
|
*/
|
|
23
23
|
declare function defineConfig(input: ToolForgeConfig): {
|
|
24
24
|
toolsDir: string;
|
|
25
|
-
apiKey: string;
|
|
26
25
|
sdkServer: string;
|
|
27
26
|
appServerUrl: string;
|
|
28
27
|
appUrl: string;
|
|
29
28
|
maxRetries: number;
|
|
29
|
+
apiKey?: string | undefined;
|
|
30
30
|
__tf__tag__name__: symbol;
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
package/dist/config/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import * as z$1 from "zod";
|
|
2
2
|
|
|
3
|
-
//#region ../core/dist/token/index.js
|
|
4
|
-
const TOKEN_PREFIX = "tf_token--";
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
3
|
//#region src/config/config-schema.ts
|
|
8
4
|
const toolForgeConfigSchema = z$1.object({
|
|
9
5
|
toolsDir: z$1.string().describe("Directory where the tools are located").optional().default("tools"),
|
|
10
|
-
apiKey: z$1.string().describe("API key for authenticating with the Tool Forge platform").refine((val) => val.startsWith("sk_live") || val.startsWith("pk_test")
|
|
6
|
+
apiKey: z$1.string().describe("API key for authenticating with the Tool Forge platform").refine((val) => val.startsWith("sk_live") || val.startsWith("pk_test"), { message: "API key must start with sk_live, pk_test" }).describe("API key for authenticating with the Tool Forge platform.").optional(),
|
|
11
7
|
sdkServer: z$1.url().describe("URL of the Tool Forge SDK server").optional().default("https://sdk.tool-forge.ai"),
|
|
12
8
|
appServerUrl: z$1.url().optional().describe("URL of the Tool Forge application server").default("https://api.tool-forge.ai"),
|
|
13
9
|
appUrl: z$1.url().optional().describe("URL of the Tool Forge application").default("https://app.tool-forge.ai"),
|
|
@@ -16,4 +12,4 @@ const toolForgeConfigSchema = z$1.object({
|
|
|
16
12
|
const TF_CONFIG_TAG_NAME = Symbol("TOOL_FORGE_CONFIG");
|
|
17
13
|
|
|
18
14
|
//#endregion
|
|
19
|
-
export { toolForgeConfigSchema as n,
|
|
15
|
+
export { toolForgeConfigSchema as n, TF_CONFIG_TAG_NAME as t };
|