@frogbotai/piece-math-helper 0.22.0 → 0.24.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.
- package/README.md +22 -0
- package/dist/actions/addNumbers.d.ts +19 -0
- package/dist/actions/addNumbers.d.ts.map +1 -0
- package/dist/actions/addNumbers.js +17 -0
- package/dist/actions/addNumbers.js.map +1 -0
- package/dist/actions/divideNumbers.d.ts +19 -0
- package/dist/actions/divideNumbers.d.ts.map +1 -0
- package/dist/actions/divideNumbers.js +20 -0
- package/dist/actions/divideNumbers.js.map +1 -0
- package/dist/actions/generateRandomNumber.d.ts +19 -0
- package/dist/actions/generateRandomNumber.d.ts.map +1 -0
- package/dist/actions/generateRandomNumber.js +17 -0
- package/dist/actions/generateRandomNumber.js.map +1 -0
- package/dist/actions/getRemainder.d.ts +19 -0
- package/dist/actions/getRemainder.d.ts.map +1 -0
- package/dist/actions/getRemainder.js +17 -0
- package/dist/actions/getRemainder.js.map +1 -0
- package/dist/actions/multiplyNumbers.d.ts +19 -0
- package/dist/actions/multiplyNumbers.d.ts.map +1 -0
- package/dist/actions/multiplyNumbers.js +17 -0
- package/dist/actions/multiplyNumbers.js.map +1 -0
- package/dist/actions/subtractNumbers.d.ts +19 -0
- package/dist/actions/subtractNumbers.d.ts.map +1 -0
- package/dist/actions/subtractNumbers.js +17 -0
- package/dist/actions/subtractNumbers.js.map +1 -0
- package/dist/index.d.ts +87 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -35
- package/dist/index.js.map +1 -1
- package/package.json +5 -10
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# `@frogbotai/piece-math-helper`
|
|
2
|
+
|
|
3
|
+
Perform arithmetic and generate random integers without a configured credential.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createMathHelper } from '@frogbotai/piece-math-helper';
|
|
9
|
+
|
|
10
|
+
export const mathHelper = createMathHelper();
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Actions
|
|
14
|
+
|
|
15
|
+
| Upstream action slug | Previous wrapper export | Native action | Notes |
|
|
16
|
+
| --------------------- | ----------------------- | ---------------------- | ------------------------------------------- |
|
|
17
|
+
| `addition_math` | `additionMath` | `addNumbers` | Adds the two numbers. |
|
|
18
|
+
| `subtraction_math` | `subtractionMath` | `subtractNumbers` | Subtracts the first number from the second. |
|
|
19
|
+
| `multiplication_math` | `multiplicationMath` | `multiplyNumbers` | Multiplies the two numbers. |
|
|
20
|
+
| `division_math` | `divisionMath` | `divideNumbers` | Rejects a zero second number. |
|
|
21
|
+
| `modulo_math` | `moduloMath` | `getRemainder` | Uses JavaScript remainder semantics. |
|
|
22
|
+
| `generateRandom_math` | `generateRandomMath` | `generateRandomNumber` | Includes both supplied bounds. |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
firstNumber: z.ZodNumber;
|
|
5
|
+
secondNumber: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const addNumbers: {
|
|
8
|
+
slug: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
firstNumber: z.ZodNumber;
|
|
13
|
+
secondNumber: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodNumber;
|
|
16
|
+
run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<number>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=addNumbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addNumbers.d.ts","sourceRoot":"","sources":["../../src/actions/addNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;mBAMA,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
firstNumber: z.number().meta({ label: 'First Number' }),
|
|
4
|
+
secondNumber: z.number().meta({ label: 'Second Number' }),
|
|
5
|
+
});
|
|
6
|
+
const output = z.number();
|
|
7
|
+
export const addNumbers = {
|
|
8
|
+
slug: 'addNumbers',
|
|
9
|
+
label: 'Add Numbers',
|
|
10
|
+
description: 'Add the first number and the second number.',
|
|
11
|
+
input: inputSchema,
|
|
12
|
+
output,
|
|
13
|
+
async run({ input }) {
|
|
14
|
+
return input.firstNumber + input.secondNumber;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=addNumbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addNumbers.js","sourceRoot":"","sources":["../../src/actions/addNumbers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1D,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,6CAA6C;IAC1D,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
firstNumber: z.ZodNumber;
|
|
5
|
+
secondNumber: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const divideNumbers: {
|
|
8
|
+
slug: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
firstNumber: z.ZodNumber;
|
|
13
|
+
secondNumber: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodNumber;
|
|
16
|
+
run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<number>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=divideNumbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divideNumbers.d.ts","sourceRoot":"","sources":["../../src/actions/divideNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;iBAMf,CAAC;AAGH,eAAO,MAAM,aAAa;;;;;;;;;mBAMH,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
firstNumber: z.number().meta({ label: 'First Number' }),
|
|
4
|
+
secondNumber: z
|
|
5
|
+
.number()
|
|
6
|
+
.refine((value) => value !== 0, 'Second number cannot be zero')
|
|
7
|
+
.meta({ label: 'Second Number' }),
|
|
8
|
+
});
|
|
9
|
+
const output = z.number();
|
|
10
|
+
export const divideNumbers = {
|
|
11
|
+
slug: 'divideNumbers',
|
|
12
|
+
label: 'Divide Numbers',
|
|
13
|
+
description: 'Divide the first number by the second number.',
|
|
14
|
+
input: inputSchema,
|
|
15
|
+
output,
|
|
16
|
+
async run({ input }) {
|
|
17
|
+
return input.firstNumber / input.secondNumber;
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=divideNumbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divideNumbers.js","sourceRoot":"","sources":["../../src/actions/divideNumbers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACvD,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,EAAE,8BAA8B,CAAC;SAC9D,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CACpC,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
firstNumber: z.ZodNumber;
|
|
5
|
+
secondNumber: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const generateRandomNumber: {
|
|
8
|
+
slug: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
firstNumber: z.ZodNumber;
|
|
13
|
+
secondNumber: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodNumber;
|
|
16
|
+
run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<number>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=generateRandomNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateRandomNumber.d.ts","sourceRoot":"","sources":["../../src/actions/generateRandomNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;mBAMV,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAKnF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
firstNumber: z.number().meta({ label: 'First Number' }),
|
|
4
|
+
secondNumber: z.number().meta({ label: 'Second Number' }),
|
|
5
|
+
});
|
|
6
|
+
const output = z.number();
|
|
7
|
+
export const generateRandomNumber = {
|
|
8
|
+
slug: 'generateRandomNumber',
|
|
9
|
+
label: 'Generate Random Number',
|
|
10
|
+
description: 'Generate a random integer between two numbers, inclusive.',
|
|
11
|
+
input: inputSchema,
|
|
12
|
+
output,
|
|
13
|
+
async run({ input }) {
|
|
14
|
+
return Math.floor(Math.random() * (input.secondNumber - input.firstNumber + 1) + input.firstNumber);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=generateRandomNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateRandomNumber.js","sourceRoot":"","sources":["../../src/actions/generateRandomNumber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1D,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,2DAA2D;IACxE,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,IAAI,CAAC,KAAK,CACf,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,WAAW,CACjF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
firstNumber: z.ZodNumber;
|
|
5
|
+
secondNumber: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const getRemainder: {
|
|
8
|
+
slug: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
firstNumber: z.ZodNumber;
|
|
13
|
+
secondNumber: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodNumber;
|
|
16
|
+
run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<number>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=getRemainder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRemainder.d.ts","sourceRoot":"","sources":["../../src/actions/getRemainder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AAGH,eAAO,MAAM,YAAY;;;;;;;;;mBAMF,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
firstNumber: z.number().meta({ label: 'First Number' }),
|
|
4
|
+
secondNumber: z.number().meta({ label: 'Second Number' }),
|
|
5
|
+
});
|
|
6
|
+
const output = z.number();
|
|
7
|
+
export const getRemainder = {
|
|
8
|
+
slug: 'getRemainder',
|
|
9
|
+
label: 'Get Remainder',
|
|
10
|
+
description: 'Get the remainder after dividing the first number by the second number.',
|
|
11
|
+
input: inputSchema,
|
|
12
|
+
output,
|
|
13
|
+
async run({ input }) {
|
|
14
|
+
return input.firstNumber % input.secondNumber;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=getRemainder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRemainder.js","sourceRoot":"","sources":["../../src/actions/getRemainder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1D,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,yEAAyE;IACtF,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
firstNumber: z.ZodNumber;
|
|
5
|
+
secondNumber: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const multiplyNumbers: {
|
|
8
|
+
slug: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
firstNumber: z.ZodNumber;
|
|
13
|
+
secondNumber: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodNumber;
|
|
16
|
+
run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<number>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=multiplyNumbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiplyNumbers.d.ts","sourceRoot":"","sources":["../../src/actions/multiplyNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AAGH,eAAO,MAAM,eAAe;;;;;;;;;mBAML,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
firstNumber: z.number().meta({ label: 'First Number' }),
|
|
4
|
+
secondNumber: z.number().meta({ label: 'Second Number' }),
|
|
5
|
+
});
|
|
6
|
+
const output = z.number();
|
|
7
|
+
export const multiplyNumbers = {
|
|
8
|
+
slug: 'multiplyNumbers',
|
|
9
|
+
label: 'Multiply Numbers',
|
|
10
|
+
description: 'Multiply the first number by the second number.',
|
|
11
|
+
input: inputSchema,
|
|
12
|
+
output,
|
|
13
|
+
async run({ input }) {
|
|
14
|
+
return input.firstNumber * input.secondNumber;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=multiplyNumbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiplyNumbers.js","sourceRoot":"","sources":["../../src/actions/multiplyNumbers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1D,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
firstNumber: z.ZodNumber;
|
|
5
|
+
secondNumber: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const subtractNumbers: {
|
|
8
|
+
slug: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
firstNumber: z.ZodNumber;
|
|
13
|
+
secondNumber: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodNumber;
|
|
16
|
+
run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<number>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=subtractNumbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subtractNumbers.d.ts","sourceRoot":"","sources":["../../src/actions/subtractNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AAGH,eAAO,MAAM,eAAe;;;;;;;;;mBAML,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
firstNumber: z.number().meta({ label: 'First Number' }),
|
|
4
|
+
secondNumber: z.number().meta({ label: 'Second Number' }),
|
|
5
|
+
});
|
|
6
|
+
const output = z.number();
|
|
7
|
+
export const subtractNumbers = {
|
|
8
|
+
slug: 'subtractNumbers',
|
|
9
|
+
label: 'Subtract Numbers',
|
|
10
|
+
description: 'Subtract the first number from the second number.',
|
|
11
|
+
input: inputSchema,
|
|
12
|
+
output,
|
|
13
|
+
async run({ input }) {
|
|
14
|
+
return input.secondNumber - input.firstNumber;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=subtractNumbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subtractNumbers.js","sourceRoot":"","sources":["../../src/actions/subtractNumbers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1D,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,mDAAmD;IAChE,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,CAAC;CACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
1
|
+
export declare const createMathHelper: import("frogbot/pieces").PieceFactory<{
|
|
2
|
+
readonly slug: "mathHelper";
|
|
3
|
+
readonly label: "Math Helper";
|
|
4
|
+
readonly admin: {
|
|
5
|
+
readonly description: "Perform mathematical operations";
|
|
6
|
+
readonly group: "Core";
|
|
7
|
+
};
|
|
8
|
+
readonly actions: readonly [{
|
|
9
|
+
slug: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
input: import("zod").ZodObject<{
|
|
13
|
+
firstNumber: import("zod").ZodNumber;
|
|
14
|
+
secondNumber: import("zod").ZodNumber;
|
|
15
|
+
}, import("zod/v4/core").$strip>;
|
|
16
|
+
output: import("zod").ZodNumber;
|
|
17
|
+
run({ input }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
18
|
+
firstNumber: import("zod").ZodNumber;
|
|
19
|
+
secondNumber: import("zod").ZodNumber;
|
|
20
|
+
}, import("zod/v4/core").$strip>>, object, undefined>): Promise<number>;
|
|
21
|
+
}, {
|
|
22
|
+
slug: string;
|
|
23
|
+
label: string;
|
|
24
|
+
description: string;
|
|
25
|
+
input: import("zod").ZodObject<{
|
|
26
|
+
firstNumber: import("zod").ZodNumber;
|
|
27
|
+
secondNumber: import("zod").ZodNumber;
|
|
28
|
+
}, import("zod/v4/core").$strip>;
|
|
29
|
+
output: import("zod").ZodNumber;
|
|
30
|
+
run({ input }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
31
|
+
firstNumber: import("zod").ZodNumber;
|
|
32
|
+
secondNumber: import("zod").ZodNumber;
|
|
33
|
+
}, import("zod/v4/core").$strip>>, object, undefined>): Promise<number>;
|
|
34
|
+
}, {
|
|
35
|
+
slug: string;
|
|
36
|
+
label: string;
|
|
37
|
+
description: string;
|
|
38
|
+
input: import("zod").ZodObject<{
|
|
39
|
+
firstNumber: import("zod").ZodNumber;
|
|
40
|
+
secondNumber: import("zod").ZodNumber;
|
|
41
|
+
}, import("zod/v4/core").$strip>;
|
|
42
|
+
output: import("zod").ZodNumber;
|
|
43
|
+
run({ input }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
44
|
+
firstNumber: import("zod").ZodNumber;
|
|
45
|
+
secondNumber: import("zod").ZodNumber;
|
|
46
|
+
}, import("zod/v4/core").$strip>>, object, undefined>): Promise<number>;
|
|
47
|
+
}, {
|
|
48
|
+
slug: string;
|
|
49
|
+
label: string;
|
|
50
|
+
description: string;
|
|
51
|
+
input: import("zod").ZodObject<{
|
|
52
|
+
firstNumber: import("zod").ZodNumber;
|
|
53
|
+
secondNumber: import("zod").ZodNumber;
|
|
54
|
+
}, import("zod/v4/core").$strip>;
|
|
55
|
+
output: import("zod").ZodNumber;
|
|
56
|
+
run({ input }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
57
|
+
firstNumber: import("zod").ZodNumber;
|
|
58
|
+
secondNumber: import("zod").ZodNumber;
|
|
59
|
+
}, import("zod/v4/core").$strip>>, object, undefined>): Promise<number>;
|
|
60
|
+
}, {
|
|
61
|
+
slug: string;
|
|
62
|
+
label: string;
|
|
63
|
+
description: string;
|
|
64
|
+
input: import("zod").ZodObject<{
|
|
65
|
+
firstNumber: import("zod").ZodNumber;
|
|
66
|
+
secondNumber: import("zod").ZodNumber;
|
|
67
|
+
}, import("zod/v4/core").$strip>;
|
|
68
|
+
output: import("zod").ZodNumber;
|
|
69
|
+
run({ input }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
70
|
+
firstNumber: import("zod").ZodNumber;
|
|
71
|
+
secondNumber: import("zod").ZodNumber;
|
|
72
|
+
}, import("zod/v4/core").$strip>>, object, undefined>): Promise<number>;
|
|
73
|
+
}, {
|
|
74
|
+
slug: string;
|
|
75
|
+
label: string;
|
|
76
|
+
description: string;
|
|
77
|
+
input: import("zod").ZodObject<{
|
|
78
|
+
firstNumber: import("zod").ZodNumber;
|
|
79
|
+
secondNumber: import("zod").ZodNumber;
|
|
80
|
+
}, import("zod/v4/core").$strip>;
|
|
81
|
+
output: import("zod").ZodNumber;
|
|
82
|
+
run({ input }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
83
|
+
firstNumber: import("zod").ZodNumber;
|
|
84
|
+
secondNumber: import("zod").ZodNumber;
|
|
85
|
+
}, import("zod/v4/core").$strip>>, object, undefined>): Promise<number>;
|
|
86
|
+
}];
|
|
87
|
+
}>;
|
|
18
88
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return Object.assign(piece, {
|
|
22
|
-
/** Addition: Add the first number and the second number */
|
|
23
|
-
additionMath: piece.tool('addition_math'),
|
|
24
|
-
/** Subtraction: Subtract the first number from the second number */
|
|
25
|
-
subtractionMath: piece.tool('subtraction_math'),
|
|
26
|
-
/** Multiplication: Multiply first number by the second number */
|
|
27
|
-
multiplicationMath: piece.tool('multiplication_math'),
|
|
28
|
-
/** Division: Divide first number by the second number */
|
|
29
|
-
divisionMath: piece.tool('division_math'),
|
|
30
|
-
/** Modulo: Get the remainder of the first number divided by second number */
|
|
31
|
-
moduloMath: piece.tool('modulo_math'),
|
|
32
|
-
/** Generate Random Number: Generate random number between two numbers (inclusive) */
|
|
33
|
-
generateRandomMath: piece.tool('generateRandom_math'),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
1
|
+
import { definePiece } from 'frogbot/pieces';
|
|
2
|
+
import { addNumbers } from './actions/addNumbers.js';
|
|
3
|
+
import { divideNumbers } from './actions/divideNumbers.js';
|
|
4
|
+
import { generateRandomNumber } from './actions/generateRandomNumber.js';
|
|
5
|
+
import { getRemainder } from './actions/getRemainder.js';
|
|
6
|
+
import { multiplyNumbers } from './actions/multiplyNumbers.js';
|
|
7
|
+
import { subtractNumbers } from './actions/subtractNumbers.js';
|
|
8
|
+
export const createMathHelper = definePiece({
|
|
9
|
+
slug: 'mathHelper',
|
|
10
|
+
label: 'Math Helper',
|
|
11
|
+
admin: { description: 'Perform mathematical operations', group: 'Core' },
|
|
12
|
+
actions: [
|
|
13
|
+
addNumbers,
|
|
14
|
+
subtractNumbers,
|
|
15
|
+
multiplyNumbers,
|
|
16
|
+
divideNumbers,
|
|
17
|
+
getRemainder,
|
|
18
|
+
generateRandomNumber,
|
|
19
|
+
],
|
|
20
|
+
});
|
|
36
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,KAAK,EAAE,MAAM,EAAE;IACxE,OAAO,EAAE;QACP,UAAU;QACV,eAAe;QACf,eAAe;QACf,aAAa;QACb,YAAY;QACZ,oBAAoB;KACrB;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-math-helper",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.24.0",
|
|
4
|
+
"description": "math-helper tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/frogbotai/frogbot.git",
|
|
10
|
-
"directory": "packages/pieces/piece-math-helper"
|
|
11
|
-
},
|
|
12
7
|
"type": "module",
|
|
13
8
|
"main": "./dist/index.js",
|
|
14
9
|
"types": "./dist/index.d.ts",
|
|
@@ -24,14 +19,14 @@
|
|
|
24
19
|
],
|
|
25
20
|
"sideEffects": false,
|
|
26
21
|
"dependencies": {
|
|
27
|
-
"
|
|
22
|
+
"zod": "^4.3.6"
|
|
28
23
|
},
|
|
29
24
|
"peerDependencies": {
|
|
30
|
-
"frogbot": "0.
|
|
25
|
+
"frogbot": "0.24.0"
|
|
31
26
|
},
|
|
32
27
|
"devDependencies": {
|
|
33
28
|
"typescript": "5.6.2",
|
|
34
|
-
"frogbot": "0.
|
|
29
|
+
"frogbot": "0.24.0"
|
|
35
30
|
},
|
|
36
31
|
"publishConfig": {
|
|
37
32
|
"access": "public"
|