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.
@@ -1,6 +1,6 @@
1
1
  import type { ActivityToolHandler } from "../../workflow";
2
2
  import type { bashToolSchemaType } from "./tool";
3
- import { Bash, type IFileSystem } from "just-bash";
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
- fs: IFileSystem
15
+ bashOptions: BashToolOptions,
13
16
  ) => ActivityToolHandler<bashToolSchemaType, BashExecOut | null> =
14
- (fs: IFileSystem) => async (args: bashToolSchemaType, _context) => {
17
+ (bashOptions: BashToolOptions) => async (args: bashToolSchemaType, _context) => {
15
18
  const { command } = args;
16
19
 
17
- const bashOptions = fs ? { fs } : {};
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(bashOptions);
28
+ const bash = new Bash(mergedOptions);
20
29
 
21
30
  try {
22
31
  const { exitCode, stderr, stdout } = await bash.exec(command);
@@ -4,15 +4,31 @@ export const createBashToolDescription = ({
4
4
  fileTree,
5
5
  }: {
6
6
  fileTree: string;
7
- }): string => `tool to execute bash commands, the file tree is: ${fileTree}`;
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: "tool to execute bash commands",
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("stringified command to be executed inside the Bash"),
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: ["cjs", "esm"],
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
  });