agent-web-os 0.3.4 → 0.4.0-beta.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/dist/index.d.cts CHANGED
@@ -1,126 +1,7 @@
1
- import * as just_bash from 'just-bash';
2
- import { InMemoryFs, FileContent, MkdirOptions, RmOptions, CpOptions } from 'just-bash';
3
- import { Bash, CustomCommand, CommandContext, ExecResult } from 'just-bash/browser';
1
+ export { B as BrowserBashSession, D as DEFAULT_BASH_SHELL_ENV, O as ObservableInMemoryFs, a as ObservableInMemoryFsChangeEvent, b as ObservableInMemoryFsChangeEventName, c as ObservableInMemoryFsOptions, T as ToolResult, d as assertObservableInMemoryFs, e as createBrowserBashSession, f as executeBrowserBash } from './browser-bash-session-kzgy0g4v.cjs';
2
+ import { CommandContext, ExecResult } from 'just-bash/browser';
4
3
  export { Bash, CommandContext, CustomCommand, ExecResult, defineCommand } from 'just-bash/browser';
5
-
6
- type ObservableInMemoryFsWriteFileSyncOptions = Parameters<InMemoryFs["writeFileSync"]>[2];
7
- type ObservableInMemoryFsWriteFileSyncMetadata = Parameters<InMemoryFs["writeFileSync"]>[3];
8
- type ObservableInMemoryFsWriteFileLazy = Parameters<InMemoryFs["writeFileLazy"]>[1];
9
- type ObservableInMemoryFsWriteFileLazyMetadata = Parameters<InMemoryFs["writeFileLazy"]>[2];
10
- type ObservableInMemoryFsWriteOptions = Parameters<InMemoryFs["writeFile"]>[2];
11
- type ObservableInMemoryFsEntryType = "file" | "directory" | "symlink";
12
- type ObservableInMemoryFsChangeEventName = "add" | "addDir" | "change" | "unlink" | "unlinkDir";
13
- type ObservableInMemoryFsChangeEvent = {
14
- event: ObservableInMemoryFsChangeEventName;
15
- path: string;
16
- entryType: ObservableInMemoryFsEntryType;
17
- previousPath?: string;
18
- };
19
- type ObservableInMemoryFsOptions = {
20
- /** Whether to console.log change events (default: false) */
21
- consoleLogChanges?: boolean;
22
- /** Root path used to filter which changes are console-logged (default: "/") */
23
- workspaceRoot?: string;
24
- };
25
- declare function assertObservableInMemoryFs(value: unknown): ObservableInMemoryFs;
26
- type ObservableInMemoryFsListener = (event: ObservableInMemoryFsChangeEvent) => void;
27
- declare class ObservableInMemoryFs extends InMemoryFs {
28
- private listeners;
29
- private lazyPaths;
30
- private suppressSyncEventCount;
31
- private suppressConsoleLogCount;
32
- private suppressChangeEmissionCount;
33
- private readonly consoleLogChanges;
34
- private readonly isLoggableWorkspacePath;
35
- constructor(options?: ObservableInMemoryFsOptions);
36
- isPathLazy(filePath: string): boolean;
37
- private clearLazyPath;
38
- private clearLazyPathsUnder;
39
- subscribe(listener: ObservableInMemoryFsListener): () => void;
40
- private shouldEmitChanges;
41
- suppressObservability<T>(operation: () => Promise<T>): Promise<T>;
42
- private queueChangeEmission;
43
- private areConsoleLogsSuppressed;
44
- private runWithSuppressedConsoleLogs;
45
- private shouldConsoleLogChangeEvent;
46
- private emit;
47
- private areSyncEventsSuppressed;
48
- private runWithSuppressedSyncEvents;
49
- writeFileSync(path: string, content: FileContent, options?: ObservableInMemoryFsWriteFileSyncOptions, metadata?: ObservableInMemoryFsWriteFileSyncMetadata): void;
50
- writeFileLazy(path: string, lazy: ObservableInMemoryFsWriteFileLazy, metadata?: ObservableInMemoryFsWriteFileLazyMetadata): void;
51
- private emitWriteEvent;
52
- private emitMkdirEvent;
53
- private emitRemovalEvent;
54
- mkdirSync(path: string, options?: MkdirOptions): void;
55
- readFileBuffer(path: string): Promise<Uint8Array>;
56
- stat(path: string): Promise<just_bash.FsStat>;
57
- lstat(path: string): Promise<just_bash.FsStat>;
58
- writeFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
59
- appendFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
60
- mkdir(path: string, options?: MkdirOptions): Promise<void>;
61
- rm(path: string, options?: RmOptions): Promise<void>;
62
- cp(src: string, dest: string, options?: CpOptions): Promise<void>;
63
- mv(src: string, dest: string): Promise<void>;
64
- chmod(path: string, mode: number): Promise<void>;
65
- symlink(target: string, linkPath: string): Promise<void>;
66
- link(existingPath: string, newPath: string): Promise<void>;
67
- utimes(path: string, atime: Date, mtime: Date): Promise<void>;
68
- }
69
-
70
- /**
71
- * Shared types for agent-web-os.
72
- */
73
- interface ToolResult {
74
- success: boolean;
75
- error?: string;
76
- [key: string]: any;
77
- }
78
-
79
- declare const DEFAULT_BASH_SHELL_ENV: {
80
- readonly LANG: "C.UTF-8";
81
- readonly LC_ALL: "C.UTF-8";
82
- readonly PYTHONIOENCODING: "utf-8";
83
- readonly PYTHONUTF8: "1";
84
- readonly PI_OFFLINE: "1";
85
- };
86
- type BrowserBashSession = {
87
- fs: ObservableInMemoryFs;
88
- bash: Bash;
89
- rootPath: string;
90
- cwd: string;
91
- setStdoutWriter: (writer: ((data: string) => void) | undefined) => void;
92
- writeStdin: (data: string) => void;
93
- setTerminalSize: (columns: number, rows: number) => void;
94
- dispose: () => void;
95
- };
96
- type BrowserBashSessionOptions = {
97
- /** Root path in the virtual filesystem (default: "/workspace") */
98
- rootPath?: string;
99
- /** Shell environment variables */
100
- env?: Record<string, string>;
101
- /** Options for the ObservableInMemoryFs */
102
- fsOptions?: ObservableInMemoryFsOptions;
103
- /** Enable Node.js runtime (node, npm commands). Lazy-loaded on first use. (default: false) */
104
- node?: boolean;
105
- /** Enable Python runtime via Pyodide (python, python3, pip commands). Lazy-loaded on first use. (default: false) */
106
- python?: boolean;
107
- /** Additional custom commands to register alongside the built-in commands */
108
- customCommands?: CustomCommand[];
109
- };
110
- type ExecuteBrowserBashOptions = {
111
- /** Whether to truncate command output (default: true) */
112
- truncateOutput?: boolean;
113
- /** Abort signal for cancellation */
114
- signal?: AbortSignal;
115
- /** Command timeout in ms (default: DEFAULT_BASH_COMMAND_TIMEOUT_MS) */
116
- commandTimeoutMs?: number;
117
- /** Output truncation limit (default: DEFAULT_BASH_OUTPUT_LIMIT) */
118
- outputLimit?: number;
119
- };
120
- /** Create a browser-based bash session with in-memory filesystem */
121
- declare function createBrowserBashSession(options?: BrowserBashSessionOptions): BrowserBashSession;
122
- /** Execute a bash command and return a ToolResult */
123
- declare function executeBrowserBash(session: BrowserBashSession, command: string, options?: ExecuteBrowserBashOptions): Promise<ToolResult>;
4
+ import 'just-bash';
124
5
 
125
6
  /**
126
7
  * `fd` command implementation for just-bash.
@@ -148,25 +29,6 @@ declare function executeBrowserBash(session: BrowserBashSession, command: string
148
29
 
149
30
  declare function executeFd(args: string[], ctx: CommandContext): Promise<ExecResult>;
150
31
 
151
- /**
152
- * Lazy singleton holder for the almostnode ServerBridge.
153
- *
154
- * This module purposefully avoids a top-level `import "almostnode"` so that
155
- * bundlers (tsup/rollup) don't pull the entire almostnode package into the
156
- * shared chunk. The dynamic `import()` ensures almostnode only appears in the
157
- * lazily-loaded almostnode-session chunk.
158
- */
159
- type ServerBridge = {
160
- initServiceWorker(options?: {
161
- swUrl?: string;
162
- }): Promise<void>;
163
- registerServer(server: unknown, port: number): void;
164
- unregisterServer(port: number): void;
165
- getServerUrl(port: number): string;
166
- };
167
- declare function getServerBridge(): Promise<ServerBridge>;
168
- declare function resetServerBridge(): void;
169
-
170
- declare const AGENT_WEB_OS_VERSION = "0.3.4";
32
+ declare const AGENT_WEB_OS_VERSION = "0.4.0-beta.0";
171
33
 
172
- export { AGENT_WEB_OS_VERSION, type BrowserBashSession, DEFAULT_BASH_SHELL_ENV, ObservableInMemoryFs, type ObservableInMemoryFsChangeEvent, type ObservableInMemoryFsChangeEventName, type ObservableInMemoryFsOptions, type ServerBridge, type ToolResult, assertObservableInMemoryFs, createBrowserBashSession, executeBrowserBash, executeFd, getServerBridge, resetServerBridge };
34
+ export { AGENT_WEB_OS_VERSION, executeFd };
package/dist/index.d.ts CHANGED
@@ -1,126 +1,7 @@
1
- import * as just_bash from 'just-bash';
2
- import { InMemoryFs, FileContent, MkdirOptions, RmOptions, CpOptions } from 'just-bash';
3
- import { Bash, CustomCommand, CommandContext, ExecResult } from 'just-bash/browser';
1
+ export { B as BrowserBashSession, D as DEFAULT_BASH_SHELL_ENV, O as ObservableInMemoryFs, a as ObservableInMemoryFsChangeEvent, b as ObservableInMemoryFsChangeEventName, c as ObservableInMemoryFsOptions, T as ToolResult, d as assertObservableInMemoryFs, e as createBrowserBashSession, f as executeBrowserBash } from './browser-bash-session-kzgy0g4v.js';
2
+ import { CommandContext, ExecResult } from 'just-bash/browser';
4
3
  export { Bash, CommandContext, CustomCommand, ExecResult, defineCommand } from 'just-bash/browser';
5
-
6
- type ObservableInMemoryFsWriteFileSyncOptions = Parameters<InMemoryFs["writeFileSync"]>[2];
7
- type ObservableInMemoryFsWriteFileSyncMetadata = Parameters<InMemoryFs["writeFileSync"]>[3];
8
- type ObservableInMemoryFsWriteFileLazy = Parameters<InMemoryFs["writeFileLazy"]>[1];
9
- type ObservableInMemoryFsWriteFileLazyMetadata = Parameters<InMemoryFs["writeFileLazy"]>[2];
10
- type ObservableInMemoryFsWriteOptions = Parameters<InMemoryFs["writeFile"]>[2];
11
- type ObservableInMemoryFsEntryType = "file" | "directory" | "symlink";
12
- type ObservableInMemoryFsChangeEventName = "add" | "addDir" | "change" | "unlink" | "unlinkDir";
13
- type ObservableInMemoryFsChangeEvent = {
14
- event: ObservableInMemoryFsChangeEventName;
15
- path: string;
16
- entryType: ObservableInMemoryFsEntryType;
17
- previousPath?: string;
18
- };
19
- type ObservableInMemoryFsOptions = {
20
- /** Whether to console.log change events (default: false) */
21
- consoleLogChanges?: boolean;
22
- /** Root path used to filter which changes are console-logged (default: "/") */
23
- workspaceRoot?: string;
24
- };
25
- declare function assertObservableInMemoryFs(value: unknown): ObservableInMemoryFs;
26
- type ObservableInMemoryFsListener = (event: ObservableInMemoryFsChangeEvent) => void;
27
- declare class ObservableInMemoryFs extends InMemoryFs {
28
- private listeners;
29
- private lazyPaths;
30
- private suppressSyncEventCount;
31
- private suppressConsoleLogCount;
32
- private suppressChangeEmissionCount;
33
- private readonly consoleLogChanges;
34
- private readonly isLoggableWorkspacePath;
35
- constructor(options?: ObservableInMemoryFsOptions);
36
- isPathLazy(filePath: string): boolean;
37
- private clearLazyPath;
38
- private clearLazyPathsUnder;
39
- subscribe(listener: ObservableInMemoryFsListener): () => void;
40
- private shouldEmitChanges;
41
- suppressObservability<T>(operation: () => Promise<T>): Promise<T>;
42
- private queueChangeEmission;
43
- private areConsoleLogsSuppressed;
44
- private runWithSuppressedConsoleLogs;
45
- private shouldConsoleLogChangeEvent;
46
- private emit;
47
- private areSyncEventsSuppressed;
48
- private runWithSuppressedSyncEvents;
49
- writeFileSync(path: string, content: FileContent, options?: ObservableInMemoryFsWriteFileSyncOptions, metadata?: ObservableInMemoryFsWriteFileSyncMetadata): void;
50
- writeFileLazy(path: string, lazy: ObservableInMemoryFsWriteFileLazy, metadata?: ObservableInMemoryFsWriteFileLazyMetadata): void;
51
- private emitWriteEvent;
52
- private emitMkdirEvent;
53
- private emitRemovalEvent;
54
- mkdirSync(path: string, options?: MkdirOptions): void;
55
- readFileBuffer(path: string): Promise<Uint8Array>;
56
- stat(path: string): Promise<just_bash.FsStat>;
57
- lstat(path: string): Promise<just_bash.FsStat>;
58
- writeFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
59
- appendFile(path: string, content: FileContent, options?: ObservableInMemoryFsWriteOptions): Promise<void>;
60
- mkdir(path: string, options?: MkdirOptions): Promise<void>;
61
- rm(path: string, options?: RmOptions): Promise<void>;
62
- cp(src: string, dest: string, options?: CpOptions): Promise<void>;
63
- mv(src: string, dest: string): Promise<void>;
64
- chmod(path: string, mode: number): Promise<void>;
65
- symlink(target: string, linkPath: string): Promise<void>;
66
- link(existingPath: string, newPath: string): Promise<void>;
67
- utimes(path: string, atime: Date, mtime: Date): Promise<void>;
68
- }
69
-
70
- /**
71
- * Shared types for agent-web-os.
72
- */
73
- interface ToolResult {
74
- success: boolean;
75
- error?: string;
76
- [key: string]: any;
77
- }
78
-
79
- declare const DEFAULT_BASH_SHELL_ENV: {
80
- readonly LANG: "C.UTF-8";
81
- readonly LC_ALL: "C.UTF-8";
82
- readonly PYTHONIOENCODING: "utf-8";
83
- readonly PYTHONUTF8: "1";
84
- readonly PI_OFFLINE: "1";
85
- };
86
- type BrowserBashSession = {
87
- fs: ObservableInMemoryFs;
88
- bash: Bash;
89
- rootPath: string;
90
- cwd: string;
91
- setStdoutWriter: (writer: ((data: string) => void) | undefined) => void;
92
- writeStdin: (data: string) => void;
93
- setTerminalSize: (columns: number, rows: number) => void;
94
- dispose: () => void;
95
- };
96
- type BrowserBashSessionOptions = {
97
- /** Root path in the virtual filesystem (default: "/workspace") */
98
- rootPath?: string;
99
- /** Shell environment variables */
100
- env?: Record<string, string>;
101
- /** Options for the ObservableInMemoryFs */
102
- fsOptions?: ObservableInMemoryFsOptions;
103
- /** Enable Node.js runtime (node, npm commands). Lazy-loaded on first use. (default: false) */
104
- node?: boolean;
105
- /** Enable Python runtime via Pyodide (python, python3, pip commands). Lazy-loaded on first use. (default: false) */
106
- python?: boolean;
107
- /** Additional custom commands to register alongside the built-in commands */
108
- customCommands?: CustomCommand[];
109
- };
110
- type ExecuteBrowserBashOptions = {
111
- /** Whether to truncate command output (default: true) */
112
- truncateOutput?: boolean;
113
- /** Abort signal for cancellation */
114
- signal?: AbortSignal;
115
- /** Command timeout in ms (default: DEFAULT_BASH_COMMAND_TIMEOUT_MS) */
116
- commandTimeoutMs?: number;
117
- /** Output truncation limit (default: DEFAULT_BASH_OUTPUT_LIMIT) */
118
- outputLimit?: number;
119
- };
120
- /** Create a browser-based bash session with in-memory filesystem */
121
- declare function createBrowserBashSession(options?: BrowserBashSessionOptions): BrowserBashSession;
122
- /** Execute a bash command and return a ToolResult */
123
- declare function executeBrowserBash(session: BrowserBashSession, command: string, options?: ExecuteBrowserBashOptions): Promise<ToolResult>;
4
+ import 'just-bash';
124
5
 
125
6
  /**
126
7
  * `fd` command implementation for just-bash.
@@ -148,25 +29,6 @@ declare function executeBrowserBash(session: BrowserBashSession, command: string
148
29
 
149
30
  declare function executeFd(args: string[], ctx: CommandContext): Promise<ExecResult>;
150
31
 
151
- /**
152
- * Lazy singleton holder for the almostnode ServerBridge.
153
- *
154
- * This module purposefully avoids a top-level `import "almostnode"` so that
155
- * bundlers (tsup/rollup) don't pull the entire almostnode package into the
156
- * shared chunk. The dynamic `import()` ensures almostnode only appears in the
157
- * lazily-loaded almostnode-session chunk.
158
- */
159
- type ServerBridge = {
160
- initServiceWorker(options?: {
161
- swUrl?: string;
162
- }): Promise<void>;
163
- registerServer(server: unknown, port: number): void;
164
- unregisterServer(port: number): void;
165
- getServerUrl(port: number): string;
166
- };
167
- declare function getServerBridge(): Promise<ServerBridge>;
168
- declare function resetServerBridge(): void;
169
-
170
- declare const AGENT_WEB_OS_VERSION = "0.3.4";
32
+ declare const AGENT_WEB_OS_VERSION = "0.4.0-beta.0";
171
33
 
172
- export { AGENT_WEB_OS_VERSION, type BrowserBashSession, DEFAULT_BASH_SHELL_ENV, ObservableInMemoryFs, type ObservableInMemoryFsChangeEvent, type ObservableInMemoryFsChangeEventName, type ObservableInMemoryFsOptions, type ServerBridge, type ToolResult, assertObservableInMemoryFs, createBrowserBashSession, executeBrowserBash, executeFd, getServerBridge, resetServerBridge };
34
+ export { AGENT_WEB_OS_VERSION, executeFd };