zeitlich 0.2.0 → 0.2.1
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 +3 -0
- package/dist/index.cjs +29 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -6
- package/dist/index.js.map +1 -1
- package/dist/{workflow-uVNF7zoe.d.cts → workflow-CCoHnc3B.d.cts} +4 -2
- package/dist/{workflow-uVNF7zoe.d.ts → workflow-CCoHnc3B.d.ts} +4 -2
- package/dist/workflow.cjs +19 -3
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.js +19 -3
- package/dist/workflow.js.map +1 -1
- package/package.json +6 -7
- package/src/tools/bash/bash.test.ts +11 -11
- package/src/tools/bash/handler.ts +14 -5
- package/src/tools/bash/tool.ts +19 -3
- package/tsup.config.ts +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActivityToolHandler } from "../../workflow";
|
|
2
2
|
import type { bashToolSchemaType } from "./tool";
|
|
3
|
-
import { Bash, type
|
|
3
|
+
import { Bash, type BashOptions } from "just-bash";
|
|
4
4
|
|
|
5
5
|
type BashExecOut = {
|
|
6
6
|
exitCode: number;
|
|
@@ -8,15 +8,24 @@ type BashExecOut = {
|
|
|
8
8
|
stdout: string;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
/** BashOptions with `fs` required */
|
|
12
|
+
type BashToolOptions = Required<Pick<BashOptions, "fs">> & Omit<BashOptions, "fs">;
|
|
13
|
+
|
|
11
14
|
export const handleBashTool: (
|
|
12
|
-
|
|
15
|
+
bashOptions: BashToolOptions,
|
|
13
16
|
) => ActivityToolHandler<bashToolSchemaType, BashExecOut | null> =
|
|
14
|
-
(
|
|
17
|
+
(bashOptions: BashToolOptions) => async (args: bashToolSchemaType, _context) => {
|
|
15
18
|
const { command } = args;
|
|
16
19
|
|
|
17
|
-
const
|
|
20
|
+
const mergedOptions: BashOptions = {
|
|
21
|
+
...bashOptions,
|
|
22
|
+
executionLimits: {
|
|
23
|
+
maxStringLength: 52428800, // 50MB default
|
|
24
|
+
...bashOptions.executionLimits,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
18
27
|
|
|
19
|
-
const bash = new Bash(
|
|
28
|
+
const bash = new Bash(mergedOptions);
|
|
20
29
|
|
|
21
30
|
try {
|
|
22
31
|
const { exitCode, stderr, stdout } = await bash.exec(command);
|
package/src/tools/bash/tool.ts
CHANGED
|
@@ -4,15 +4,31 @@ export const createBashToolDescription = ({
|
|
|
4
4
|
fileTree,
|
|
5
5
|
}: {
|
|
6
6
|
fileTree: string;
|
|
7
|
-
}): string => `
|
|
7
|
+
}): string => `Execute shell commands in a bash environment.
|
|
8
|
+
|
|
9
|
+
Use this tool to:
|
|
10
|
+
- Run shell commands (ls, cat, grep, find, etc.)
|
|
11
|
+
- Execute scripts and chain commands with pipes (|) or logical operators (&&, ||)
|
|
12
|
+
- Inspect files and directories
|
|
13
|
+
|
|
14
|
+
Current file tree:
|
|
15
|
+
${fileTree}`;
|
|
8
16
|
|
|
9
17
|
export const bashTool = {
|
|
10
18
|
name: "Bash" as const,
|
|
11
|
-
description:
|
|
19
|
+
description: `Execute shell commands in a sandboxed bash environment.
|
|
20
|
+
|
|
21
|
+
Use this tool to:
|
|
22
|
+
- Run shell commands (ls, cat, grep, find, etc.)
|
|
23
|
+
- Execute scripts and chain commands with pipes (|) or logical operators (&&, ||)
|
|
24
|
+
- Inspect files and directories
|
|
25
|
+
`,
|
|
12
26
|
schema: z.object({
|
|
13
27
|
command: z
|
|
14
28
|
.string()
|
|
15
|
-
.describe(
|
|
29
|
+
.describe(
|
|
30
|
+
"The bash command to execute. Can include pipes (|), redirects (>, >>), logical operators (&&, ||), and shell features like command substitution $(...)."
|
|
31
|
+
),
|
|
16
32
|
}),
|
|
17
33
|
strict: true,
|
|
18
34
|
};
|
package/tsup.config.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default defineConfig({
|
|
|
5
5
|
index: "src/index.ts",
|
|
6
6
|
workflow: "src/workflow.ts",
|
|
7
7
|
},
|
|
8
|
-
format: ["
|
|
8
|
+
format: ["esm", "cjs"],
|
|
9
9
|
dts: true,
|
|
10
10
|
clean: true,
|
|
11
11
|
sourcemap: true,
|
|
@@ -16,5 +16,7 @@ export default defineConfig({
|
|
|
16
16
|
/^@temporalio\//,
|
|
17
17
|
/^@langchain\//,
|
|
18
18
|
"ioredis",
|
|
19
|
+
"@mongodb-js/zstd",
|
|
20
|
+
"node-liblzma",
|
|
19
21
|
],
|
|
20
22
|
});
|