just-bash 1.5.3 → 2.0.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 +10 -8
- package/dist/AGENTS.md +40 -78
- package/dist/browser.d.ts +22 -0
- package/dist/bundle/{ai/index.js → browser.js} +306 -311
- package/package.json +8 -22
- package/dist/ai/index.d.ts +0 -66
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "just-bash",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A simulated bash environment with virtual filesystem",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,30 +16,18 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
|
+
"browser": "./dist/bundle/browser.js",
|
|
19
20
|
"import": "./dist/bundle/index.js"
|
|
20
21
|
},
|
|
21
|
-
"./
|
|
22
|
-
"types": "./dist/
|
|
23
|
-
"import": "./dist/bundle/
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"peerDependencies": {
|
|
27
|
-
"ai": "^6.0.0",
|
|
28
|
-
"zod": "^3.0.0 || ^4.0.0"
|
|
29
|
-
},
|
|
30
|
-
"peerDependenciesMeta": {
|
|
31
|
-
"ai": {
|
|
32
|
-
"optional": true
|
|
33
|
-
},
|
|
34
|
-
"zod": {
|
|
35
|
-
"optional": true
|
|
22
|
+
"./browser": {
|
|
23
|
+
"types": "./dist/browser.d.ts",
|
|
24
|
+
"import": "./dist/bundle/browser.js"
|
|
36
25
|
}
|
|
37
26
|
},
|
|
38
27
|
"files": [
|
|
39
28
|
"dist/bundle/",
|
|
40
29
|
"dist/bin/",
|
|
41
30
|
"dist/*.d.ts",
|
|
42
|
-
"dist/ai/*.d.ts",
|
|
43
31
|
"dist/ast/*.d.ts",
|
|
44
32
|
"dist/commands/**/*.d.ts",
|
|
45
33
|
"dist/expander/*.d.ts",
|
|
@@ -67,12 +55,10 @@
|
|
|
67
55
|
"@types/node": "^25.0.3",
|
|
68
56
|
"@types/sprintf-js": "^1.1.4",
|
|
69
57
|
"@types/turndown": "^5.0.6",
|
|
70
|
-
"ai": "^6.0.3",
|
|
71
58
|
"esbuild": "^0.27.2",
|
|
72
59
|
"knip": "^5.41.1",
|
|
73
60
|
"typescript": "^5.9.3",
|
|
74
|
-
"vitest": "^4.0.16"
|
|
75
|
-
"zod": "^4.2.1"
|
|
61
|
+
"vitest": "^4.0.16"
|
|
76
62
|
},
|
|
77
63
|
"dependencies": {
|
|
78
64
|
"diff": "^8.0.2",
|
|
@@ -83,10 +69,10 @@
|
|
|
83
69
|
},
|
|
84
70
|
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81",
|
|
85
71
|
"scripts": {
|
|
86
|
-
"build": "rm -rf dist && tsc && pnpm build:lib && pnpm build:
|
|
72
|
+
"build": "rm -rf dist && tsc && pnpm build:lib && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:clean && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md",
|
|
87
73
|
"build:clean": "find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete",
|
|
88
74
|
"build:lib": "esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown",
|
|
89
|
-
"build:
|
|
75
|
+
"build:browser": "esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:*",
|
|
90
76
|
"build:cli": "esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node'",
|
|
91
77
|
"build:shell": "esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node'",
|
|
92
78
|
"validate": "pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm test:run && pnpm test:dist",
|
package/dist/ai/index.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type Tool } from "ai";
|
|
2
|
-
import { type BashLogger, type BashOptions } from "../Bash.js";
|
|
3
|
-
import type { CommandName } from "../commands/registry.js";
|
|
4
|
-
import type { IFileSystem, InitialFiles } from "../fs/interface.js";
|
|
5
|
-
type BashToolInput = {
|
|
6
|
-
command: string;
|
|
7
|
-
};
|
|
8
|
-
type BashToolOutput = {
|
|
9
|
-
stdout: string;
|
|
10
|
-
stderr: string;
|
|
11
|
-
exitCode: number;
|
|
12
|
-
};
|
|
13
|
-
export interface CreateBashToolOptions {
|
|
14
|
-
/**
|
|
15
|
-
* Initial files to populate the virtual filesystem.
|
|
16
|
-
* The tool instructions will include common operations on a sample of these files.
|
|
17
|
-
* Ignored if `fs` is provided.
|
|
18
|
-
*/
|
|
19
|
-
files?: InitialFiles;
|
|
20
|
-
/**
|
|
21
|
-
* Custom filesystem implementation (e.g., OverlayFs for copy-on-write behavior).
|
|
22
|
-
* If provided, `files` option is ignored.
|
|
23
|
-
*/
|
|
24
|
-
fs?: IFileSystem;
|
|
25
|
-
/**
|
|
26
|
-
* Additional instructions to append to the tool description.
|
|
27
|
-
*/
|
|
28
|
-
extraInstructions?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Optional list of command names to register.
|
|
31
|
-
* If not provided, all built-in commands are available.
|
|
32
|
-
* Use this to restrict which commands can be executed.
|
|
33
|
-
*/
|
|
34
|
-
commands?: CommandName[];
|
|
35
|
-
/**
|
|
36
|
-
* Custom commands to register alongside built-in commands.
|
|
37
|
-
* These take precedence over built-ins with the same name.
|
|
38
|
-
*/
|
|
39
|
-
customCommands?: BashOptions["customCommands"];
|
|
40
|
-
/**
|
|
41
|
-
* Network configuration for commands like curl.
|
|
42
|
-
* Disabled by default for security.
|
|
43
|
-
*/
|
|
44
|
-
network?: BashOptions["network"];
|
|
45
|
-
/**
|
|
46
|
-
* Environment variables to set in the bash environment.
|
|
47
|
-
*/
|
|
48
|
-
env?: Record<string, string>;
|
|
49
|
-
/**
|
|
50
|
-
* Current working directory. Defaults to /home/user.
|
|
51
|
-
*/
|
|
52
|
-
cwd?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Callback invoked before each command execution.
|
|
55
|
-
* Useful for logging or monitoring tool calls.
|
|
56
|
-
*/
|
|
57
|
-
onCall?: (command: string) => void;
|
|
58
|
-
/**
|
|
59
|
-
* Optional logger for execution tracing.
|
|
60
|
-
* Logs exec commands (info), stdout (debug), stderr (info), and exit codes (info).
|
|
61
|
-
*/
|
|
62
|
-
logger?: BashLogger;
|
|
63
|
-
}
|
|
64
|
-
export declare function createBashTool(options?: CreateBashToolOptions): Tool<BashToolInput, BashToolOutput>;
|
|
65
|
-
export type BashTool = ReturnType<typeof createBashTool>;
|
|
66
|
-
export {};
|