agent-web-os 0.3.5 → 0.4.0-beta.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/dist/browser-bash-session-kzgy0g4v.d.cts +122 -0
- package/dist/browser-bash-session-kzgy0g4v.d.ts +122 -0
- package/dist/chunk-L7KW6Y27.js +2750 -0
- package/dist/chunk-L7KW6Y27.js.map +1 -0
- package/dist/chunk-QV36H6BY.js +5325 -0
- package/dist/chunk-QV36H6BY.js.map +1 -0
- package/dist/{chunk-JTZ3QUCT.js → chunk-ZZTRZYH2.js} +1021 -3
- package/dist/chunk-ZZTRZYH2.js.map +1 -0
- package/dist/index.cjs +34202 -75108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -143
- package/dist/index.d.ts +5 -143
- package/dist/index.js +10 -953
- package/dist/index.js.map +1 -1
- package/dist/node.cjs +63339 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +34 -0
- package/dist/node.d.ts +34 -0
- package/dist/node.js +16709 -0
- package/dist/node.js.map +1 -0
- package/dist/npm-C6N7BGOG.js +14 -0
- package/dist/server-bridge-DZUJDQIT.js +329 -0
- package/dist/server-bridge-DZUJDQIT.js.map +1 -0
- package/package.json +6 -1
- package/dist/almostnode-session-2FPETBKJ.js +0 -2103
- package/dist/almostnode-session-2FPETBKJ.js.map +0 -1
- package/dist/chunk-FNHNA3XU.js +0 -90
- package/dist/chunk-FNHNA3XU.js.map +0 -1
- package/dist/chunk-JTZ3QUCT.js.map +0 -1
- package/dist/chunk-YMOX2CWB.js +0 -38704
- package/dist/chunk-YMOX2CWB.js.map +0 -1
- package/dist/dist-2XQJWZPX.js +0 -98
- /package/dist/{dist-2XQJWZPX.js.map → npm-C6N7BGOG.js.map} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Bash, CustomCommand } from 'just-bash/browser';
|
|
2
|
+
import * as just_bash from 'just-bash';
|
|
3
|
+
import { InMemoryFs, FileContent, MkdirOptions, RmOptions, CpOptions } from 'just-bash';
|
|
4
|
+
|
|
5
|
+
type ObservableInMemoryFsWriteFileSyncOptions = Parameters<InMemoryFs["writeFileSync"]>[2];
|
|
6
|
+
type ObservableInMemoryFsWriteFileSyncMetadata = Parameters<InMemoryFs["writeFileSync"]>[3];
|
|
7
|
+
type ObservableInMemoryFsWriteFileLazy = Parameters<InMemoryFs["writeFileLazy"]>[1];
|
|
8
|
+
type ObservableInMemoryFsWriteFileLazyMetadata = Parameters<InMemoryFs["writeFileLazy"]>[2];
|
|
9
|
+
type ObservableInMemoryFsWriteOptions = Parameters<InMemoryFs["writeFile"]>[2];
|
|
10
|
+
type ObservableInMemoryFsEntryType = "file" | "directory" | "symlink";
|
|
11
|
+
type ObservableInMemoryFsChangeEventName = "add" | "addDir" | "change" | "unlink" | "unlinkDir";
|
|
12
|
+
type ObservableInMemoryFsChangeEvent = {
|
|
13
|
+
event: ObservableInMemoryFsChangeEventName;
|
|
14
|
+
path: string;
|
|
15
|
+
entryType: ObservableInMemoryFsEntryType;
|
|
16
|
+
previousPath?: string;
|
|
17
|
+
};
|
|
18
|
+
type ObservableInMemoryFsOptions = {
|
|
19
|
+
/** Whether to console.log change events (default: false) */
|
|
20
|
+
consoleLogChanges?: boolean;
|
|
21
|
+
/** Root path used to filter which changes are console-logged (default: "/") */
|
|
22
|
+
workspaceRoot?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function assertObservableInMemoryFs(value: unknown): ObservableInMemoryFs;
|
|
25
|
+
type ObservableInMemoryFsListener = (event: ObservableInMemoryFsChangeEvent) => void;
|
|
26
|
+
declare class ObservableInMemoryFs extends InMemoryFs {
|
|
27
|
+
private listeners;
|
|
28
|
+
private lazyPaths;
|
|
29
|
+
private suppressSyncEventCount;
|
|
30
|
+
private suppressConsoleLogCount;
|
|
31
|
+
private suppressChangeEmissionCount;
|
|
32
|
+
private readonly consoleLogChanges;
|
|
33
|
+
private readonly isLoggableWorkspacePath;
|
|
34
|
+
constructor(options?: ObservableInMemoryFsOptions);
|
|
35
|
+
isPathLazy(filePath: string): boolean;
|
|
36
|
+
private clearLazyPath;
|
|
37
|
+
private clearLazyPathsUnder;
|
|
38
|
+
subscribe(listener: ObservableInMemoryFsListener): () => void;
|
|
39
|
+
private shouldEmitChanges;
|
|
40
|
+
suppressObservability<T>(operation: () => Promise<T>): Promise<T>;
|
|
41
|
+
private queueChangeEmission;
|
|
42
|
+
private areConsoleLogsSuppressed;
|
|
43
|
+
private runWithSuppressedConsoleLogs;
|
|
44
|
+
private shouldConsoleLogChangeEvent;
|
|
45
|
+
private emit;
|
|
46
|
+
private areSyncEventsSuppressed;
|
|
47
|
+
private runWithSuppressedSyncEvents;
|
|
48
|
+
writeFileSync(path: string, content: FileContent, options?: ObservableInMemoryFsWriteFileSyncOptions, metadata?: ObservableInMemoryFsWriteFileSyncMetadata): void;
|
|
49
|
+
writeFileLazy(path: string, lazy: ObservableInMemoryFsWriteFileLazy, metadata?: ObservableInMemoryFsWriteFileLazyMetadata): void;
|
|
50
|
+
private emitWriteEvent;
|
|
51
|
+
private emitMkdirEvent;
|
|
52
|
+
private emitRemovalEvent;
|
|
53
|
+
mkdirSync(path: string, options?: MkdirOptions): void;
|
|
54
|
+
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
55
|
+
stat(path: string): Promise<just_bash.FsStat>;
|
|
56
|
+
lstat(path: string): Promise<just_bash.FsStat>;
|
|
57
|
+
writeFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
|
|
58
|
+
appendFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
|
|
59
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
60
|
+
rm(path: string, options?: RmOptions): Promise<void>;
|
|
61
|
+
cp(src: string, dest: string, options?: CpOptions): Promise<void>;
|
|
62
|
+
mv(src: string, dest: string): Promise<void>;
|
|
63
|
+
chmod(path: string, mode: number): Promise<void>;
|
|
64
|
+
symlink(target: string, linkPath: string): Promise<void>;
|
|
65
|
+
link(existingPath: string, newPath: string): Promise<void>;
|
|
66
|
+
utimes(path: string, atime: Date, mtime: Date): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Shared types for agent-web-os.
|
|
71
|
+
*/
|
|
72
|
+
interface ToolResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
error?: string;
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare const DEFAULT_BASH_SHELL_ENV: {
|
|
79
|
+
readonly LANG: "C.UTF-8";
|
|
80
|
+
readonly LC_ALL: "C.UTF-8";
|
|
81
|
+
readonly PYTHONIOENCODING: "utf-8";
|
|
82
|
+
readonly PYTHONUTF8: "1";
|
|
83
|
+
readonly PI_OFFLINE: "1";
|
|
84
|
+
};
|
|
85
|
+
type BrowserBashSession = {
|
|
86
|
+
fs: ObservableInMemoryFs;
|
|
87
|
+
bash: Bash;
|
|
88
|
+
rootPath: string;
|
|
89
|
+
cwd: string;
|
|
90
|
+
setStdoutWriter: (writer: ((data: string) => void) | undefined) => void;
|
|
91
|
+
writeStdin: (data: string) => void;
|
|
92
|
+
setTerminalSize: (columns: number, rows: number) => void;
|
|
93
|
+
dispose: () => void;
|
|
94
|
+
};
|
|
95
|
+
type BrowserBashSessionOptions = {
|
|
96
|
+
/** Root path in the virtual filesystem (default: "/workspace") */
|
|
97
|
+
rootPath?: string;
|
|
98
|
+
/** Shell environment variables */
|
|
99
|
+
env?: Record<string, string>;
|
|
100
|
+
/** Options for the ObservableInMemoryFs */
|
|
101
|
+
fsOptions?: ObservableInMemoryFsOptions;
|
|
102
|
+
/** Enable Python runtime via Pyodide (python, python3, pip commands). Lazy-loaded on first use. (default: false) */
|
|
103
|
+
python?: boolean;
|
|
104
|
+
/** Additional custom commands to register alongside the built-in commands */
|
|
105
|
+
customCommands?: CustomCommand[];
|
|
106
|
+
};
|
|
107
|
+
type ExecuteBrowserBashOptions = {
|
|
108
|
+
/** Whether to truncate command output (default: true) */
|
|
109
|
+
truncateOutput?: boolean;
|
|
110
|
+
/** Abort signal for cancellation */
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
/** Command timeout in ms (default: DEFAULT_BASH_COMMAND_TIMEOUT_MS) */
|
|
113
|
+
commandTimeoutMs?: number;
|
|
114
|
+
/** Output truncation limit (default: DEFAULT_BASH_OUTPUT_LIMIT) */
|
|
115
|
+
outputLimit?: number;
|
|
116
|
+
};
|
|
117
|
+
/** Create a browser-based bash session with in-memory filesystem */
|
|
118
|
+
declare function createBrowserBashSession(options?: BrowserBashSessionOptions): BrowserBashSession;
|
|
119
|
+
/** Execute a bash command and return a ToolResult */
|
|
120
|
+
declare function executeBrowserBash(session: BrowserBashSession, command: string, options?: ExecuteBrowserBashOptions): Promise<ToolResult>;
|
|
121
|
+
|
|
122
|
+
export { type BrowserBashSession as B, DEFAULT_BASH_SHELL_ENV as D, ObservableInMemoryFs as O, type ToolResult as T, type ObservableInMemoryFsChangeEvent as a, type ObservableInMemoryFsChangeEventName as b, type ObservableInMemoryFsOptions as c, assertObservableInMemoryFs as d, createBrowserBashSession as e, executeBrowserBash as f };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Bash, CustomCommand } from 'just-bash/browser';
|
|
2
|
+
import * as just_bash from 'just-bash';
|
|
3
|
+
import { InMemoryFs, FileContent, MkdirOptions, RmOptions, CpOptions } from 'just-bash';
|
|
4
|
+
|
|
5
|
+
type ObservableInMemoryFsWriteFileSyncOptions = Parameters<InMemoryFs["writeFileSync"]>[2];
|
|
6
|
+
type ObservableInMemoryFsWriteFileSyncMetadata = Parameters<InMemoryFs["writeFileSync"]>[3];
|
|
7
|
+
type ObservableInMemoryFsWriteFileLazy = Parameters<InMemoryFs["writeFileLazy"]>[1];
|
|
8
|
+
type ObservableInMemoryFsWriteFileLazyMetadata = Parameters<InMemoryFs["writeFileLazy"]>[2];
|
|
9
|
+
type ObservableInMemoryFsWriteOptions = Parameters<InMemoryFs["writeFile"]>[2];
|
|
10
|
+
type ObservableInMemoryFsEntryType = "file" | "directory" | "symlink";
|
|
11
|
+
type ObservableInMemoryFsChangeEventName = "add" | "addDir" | "change" | "unlink" | "unlinkDir";
|
|
12
|
+
type ObservableInMemoryFsChangeEvent = {
|
|
13
|
+
event: ObservableInMemoryFsChangeEventName;
|
|
14
|
+
path: string;
|
|
15
|
+
entryType: ObservableInMemoryFsEntryType;
|
|
16
|
+
previousPath?: string;
|
|
17
|
+
};
|
|
18
|
+
type ObservableInMemoryFsOptions = {
|
|
19
|
+
/** Whether to console.log change events (default: false) */
|
|
20
|
+
consoleLogChanges?: boolean;
|
|
21
|
+
/** Root path used to filter which changes are console-logged (default: "/") */
|
|
22
|
+
workspaceRoot?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function assertObservableInMemoryFs(value: unknown): ObservableInMemoryFs;
|
|
25
|
+
type ObservableInMemoryFsListener = (event: ObservableInMemoryFsChangeEvent) => void;
|
|
26
|
+
declare class ObservableInMemoryFs extends InMemoryFs {
|
|
27
|
+
private listeners;
|
|
28
|
+
private lazyPaths;
|
|
29
|
+
private suppressSyncEventCount;
|
|
30
|
+
private suppressConsoleLogCount;
|
|
31
|
+
private suppressChangeEmissionCount;
|
|
32
|
+
private readonly consoleLogChanges;
|
|
33
|
+
private readonly isLoggableWorkspacePath;
|
|
34
|
+
constructor(options?: ObservableInMemoryFsOptions);
|
|
35
|
+
isPathLazy(filePath: string): boolean;
|
|
36
|
+
private clearLazyPath;
|
|
37
|
+
private clearLazyPathsUnder;
|
|
38
|
+
subscribe(listener: ObservableInMemoryFsListener): () => void;
|
|
39
|
+
private shouldEmitChanges;
|
|
40
|
+
suppressObservability<T>(operation: () => Promise<T>): Promise<T>;
|
|
41
|
+
private queueChangeEmission;
|
|
42
|
+
private areConsoleLogsSuppressed;
|
|
43
|
+
private runWithSuppressedConsoleLogs;
|
|
44
|
+
private shouldConsoleLogChangeEvent;
|
|
45
|
+
private emit;
|
|
46
|
+
private areSyncEventsSuppressed;
|
|
47
|
+
private runWithSuppressedSyncEvents;
|
|
48
|
+
writeFileSync(path: string, content: FileContent, options?: ObservableInMemoryFsWriteFileSyncOptions, metadata?: ObservableInMemoryFsWriteFileSyncMetadata): void;
|
|
49
|
+
writeFileLazy(path: string, lazy: ObservableInMemoryFsWriteFileLazy, metadata?: ObservableInMemoryFsWriteFileLazyMetadata): void;
|
|
50
|
+
private emitWriteEvent;
|
|
51
|
+
private emitMkdirEvent;
|
|
52
|
+
private emitRemovalEvent;
|
|
53
|
+
mkdirSync(path: string, options?: MkdirOptions): void;
|
|
54
|
+
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
55
|
+
stat(path: string): Promise<just_bash.FsStat>;
|
|
56
|
+
lstat(path: string): Promise<just_bash.FsStat>;
|
|
57
|
+
writeFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
|
|
58
|
+
appendFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
|
|
59
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
60
|
+
rm(path: string, options?: RmOptions): Promise<void>;
|
|
61
|
+
cp(src: string, dest: string, options?: CpOptions): Promise<void>;
|
|
62
|
+
mv(src: string, dest: string): Promise<void>;
|
|
63
|
+
chmod(path: string, mode: number): Promise<void>;
|
|
64
|
+
symlink(target: string, linkPath: string): Promise<void>;
|
|
65
|
+
link(existingPath: string, newPath: string): Promise<void>;
|
|
66
|
+
utimes(path: string, atime: Date, mtime: Date): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Shared types for agent-web-os.
|
|
71
|
+
*/
|
|
72
|
+
interface ToolResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
error?: string;
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare const DEFAULT_BASH_SHELL_ENV: {
|
|
79
|
+
readonly LANG: "C.UTF-8";
|
|
80
|
+
readonly LC_ALL: "C.UTF-8";
|
|
81
|
+
readonly PYTHONIOENCODING: "utf-8";
|
|
82
|
+
readonly PYTHONUTF8: "1";
|
|
83
|
+
readonly PI_OFFLINE: "1";
|
|
84
|
+
};
|
|
85
|
+
type BrowserBashSession = {
|
|
86
|
+
fs: ObservableInMemoryFs;
|
|
87
|
+
bash: Bash;
|
|
88
|
+
rootPath: string;
|
|
89
|
+
cwd: string;
|
|
90
|
+
setStdoutWriter: (writer: ((data: string) => void) | undefined) => void;
|
|
91
|
+
writeStdin: (data: string) => void;
|
|
92
|
+
setTerminalSize: (columns: number, rows: number) => void;
|
|
93
|
+
dispose: () => void;
|
|
94
|
+
};
|
|
95
|
+
type BrowserBashSessionOptions = {
|
|
96
|
+
/** Root path in the virtual filesystem (default: "/workspace") */
|
|
97
|
+
rootPath?: string;
|
|
98
|
+
/** Shell environment variables */
|
|
99
|
+
env?: Record<string, string>;
|
|
100
|
+
/** Options for the ObservableInMemoryFs */
|
|
101
|
+
fsOptions?: ObservableInMemoryFsOptions;
|
|
102
|
+
/** Enable Python runtime via Pyodide (python, python3, pip commands). Lazy-loaded on first use. (default: false) */
|
|
103
|
+
python?: boolean;
|
|
104
|
+
/** Additional custom commands to register alongside the built-in commands */
|
|
105
|
+
customCommands?: CustomCommand[];
|
|
106
|
+
};
|
|
107
|
+
type ExecuteBrowserBashOptions = {
|
|
108
|
+
/** Whether to truncate command output (default: true) */
|
|
109
|
+
truncateOutput?: boolean;
|
|
110
|
+
/** Abort signal for cancellation */
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
/** Command timeout in ms (default: DEFAULT_BASH_COMMAND_TIMEOUT_MS) */
|
|
113
|
+
commandTimeoutMs?: number;
|
|
114
|
+
/** Output truncation limit (default: DEFAULT_BASH_OUTPUT_LIMIT) */
|
|
115
|
+
outputLimit?: number;
|
|
116
|
+
};
|
|
117
|
+
/** Create a browser-based bash session with in-memory filesystem */
|
|
118
|
+
declare function createBrowserBashSession(options?: BrowserBashSessionOptions): BrowserBashSession;
|
|
119
|
+
/** Execute a bash command and return a ToolResult */
|
|
120
|
+
declare function executeBrowserBash(session: BrowserBashSession, command: string, options?: ExecuteBrowserBashOptions): Promise<ToolResult>;
|
|
121
|
+
|
|
122
|
+
export { type BrowserBashSession as B, DEFAULT_BASH_SHELL_ENV as D, ObservableInMemoryFs as O, type ToolResult as T, type ObservableInMemoryFsChangeEvent as a, type ObservableInMemoryFsChangeEventName as b, type ObservableInMemoryFsOptions as c, assertObservableInMemoryFs as d, createBrowserBashSession as e, executeBrowserBash as f };
|