@elizaos/plugin-shell 2.0.0-beta.1 → 2.0.11-beta.7

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.
Files changed (61) hide show
  1. package/README.md +71 -323
  2. package/auto-enable.ts +18 -2
  3. package/package.json +16 -6
  4. package/dist/actions/clearHistory.d.ts +0 -4
  5. package/dist/actions/clearHistory.d.ts.map +0 -1
  6. package/dist/actions/index.d.ts +0 -2
  7. package/dist/actions/index.d.ts.map +0 -1
  8. package/dist/approvals/allowlist.d.ts +0 -76
  9. package/dist/approvals/allowlist.d.ts.map +0 -1
  10. package/dist/approvals/analysis.d.ts +0 -76
  11. package/dist/approvals/analysis.d.ts.map +0 -1
  12. package/dist/approvals/index.d.ts +0 -12
  13. package/dist/approvals/index.d.ts.map +0 -1
  14. package/dist/approvals/service.d.ts +0 -121
  15. package/dist/approvals/service.d.ts.map +0 -1
  16. package/dist/approvals/types.d.ts +0 -219
  17. package/dist/approvals/types.d.ts.map +0 -1
  18. package/dist/auto-enable.d.ts +0 -4
  19. package/dist/auto-enable.d.ts.map +0 -1
  20. package/dist/generated/specs/spec-helpers.d.ts +0 -36
  21. package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
  22. package/dist/generated/specs/specs.d.ts +0 -58
  23. package/dist/generated/specs/specs.d.ts.map +0 -1
  24. package/dist/index.browser.d.ts +0 -4
  25. package/dist/index.browser.d.ts.map +0 -1
  26. package/dist/index.d.ts +0 -13
  27. package/dist/index.d.ts.map +0 -1
  28. package/dist/index.js +0 -10578
  29. package/dist/index.js.map +0 -75
  30. package/dist/prompts.d.ts +0 -11
  31. package/dist/prompts.d.ts.map +0 -1
  32. package/dist/providers/index.d.ts +0 -2
  33. package/dist/providers/index.d.ts.map +0 -1
  34. package/dist/providers/shellHistoryProvider.d.ts +0 -4
  35. package/dist/providers/shellHistoryProvider.d.ts.map +0 -1
  36. package/dist/services/index.d.ts +0 -3
  37. package/dist/services/index.d.ts.map +0 -1
  38. package/dist/services/processRegistry.d.ts +0 -25
  39. package/dist/services/processRegistry.d.ts.map +0 -1
  40. package/dist/services/shellService.d.ts +0 -94
  41. package/dist/services/shellService.d.ts.map +0 -1
  42. package/dist/types/index.d.ts +0 -144
  43. package/dist/types/index.d.ts.map +0 -1
  44. package/dist/utils/config.d.ts +0 -4
  45. package/dist/utils/config.d.ts.map +0 -1
  46. package/dist/utils/executionMode.d.ts +0 -9
  47. package/dist/utils/executionMode.d.ts.map +0 -1
  48. package/dist/utils/index.d.ts +0 -7
  49. package/dist/utils/index.d.ts.map +0 -1
  50. package/dist/utils/pathUtils.d.ts +0 -5
  51. package/dist/utils/pathUtils.d.ts.map +0 -1
  52. package/dist/utils/processQueue.d.ts +0 -136
  53. package/dist/utils/processQueue.d.ts.map +0 -1
  54. package/dist/utils/ptyKeys.d.ts +0 -23
  55. package/dist/utils/ptyKeys.d.ts.map +0 -1
  56. package/dist/utils/shellArgv.d.ts +0 -37
  57. package/dist/utils/shellArgv.d.ts.map +0 -1
  58. package/dist/utils/shellUtils.d.ts +0 -103
  59. package/dist/utils/shellUtils.d.ts.map +0 -1
  60. package/dist/vitest.config.d.ts +0 -3
  61. package/dist/vitest.config.d.ts.map +0 -1
package/dist/prompts.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * Prompt templates for plugin-shell.
3
- *
4
- * These prompts use Handlebars-style template syntax:
5
- * - {{variableName}} for simple substitution
6
- * - {{#each items}}...{{/each}} for iteration
7
- * - {{#if condition}}...{{/if}} for conditionals
8
- */
9
- export declare const commandExtractionTemplate = "# Extracting shell command from request\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to execute a shell command. Extract the COMPLETE shell command they want to run.\n\nIMPORTANT:\n1. Always return the FULL executable shell command, not just the content or partial command.\n2. If the user mentions installing something, create the appropriate brew/npm/apt command.\n3. If the user directly provides a command (like \"brew install X\"), use it exactly as provided.\n4. ALWAYS extract a command if the user is asking for ANY kind of system operation.\n\nCommon patterns:\n- \"run ls -la\" -> command: \"ls -la\"\n- \"execute npm test\" -> command: \"npm test\"\n- \"show me the files\" or \"list files\" -> command: \"ls -la\"\n- \"what's in this directory\" -> command: \"ls -la\"\n- \"check git status\" -> command: \"git status\"\n- \"navigate to src folder\" -> command: \"cd src\"\n- \"create a file called test.txt\" -> command: \"touch test.txt\"\n- \"write hello world to a file\" -> command: \"echo 'hello world' > file.txt\"\n- \"create hello.js with javascript code\" -> command: \"echo 'console.log(\\\"Hello, World!\\\");' > hello.js\"\n- \"create hello_world.py and write a python hello world script inside\" -> command: \"echo 'print(\\\"Hello, World!\\\")' > hello_world.py\"\n- \"make a new directory\" -> command: \"mkdir newdir\"\n- \"list files inside your filesystem\" -> command: \"ls -la\"\n- \"install orbstack\" or \"brew install orbstack\" -> command: \"brew install orbstack\"\n- \"install mullvad vpn\" -> command: \"brew install --cask mullvad-vpn\"\n- \"get system info\" -> command: \"system_profiler SPHardwareDataType\"\n- \"check memory usage\" -> command: \"vm_stat\"\n- \"install package\" -> command: \"brew install <package>\"\n\nSpecial cases:\n- \"Run it in your shell\" or \"execute it\" -> Extract the command from previous context\n- \"Install these\" -> Look for package names in previous messages\n- Direct commands should be used exactly as provided\n\nKey rules:\n1. For file creation with content, use: echo 'content' > filename\n2. For listing files, use: ls -la (not just ls)\n3. Always include the echo command when writing to files\n4. Include all flags and arguments\n5. When user says \"run it\", \"execute it\", or similar, they want you to run the command\n\nRespond with JSON only:\n{\n \"command\": \"<complete shell command to execute>\"\n}";
10
- export declare const COMMAND_EXTRACTION_TEMPLATE = "# Extracting shell command from request\n{{recentMessages}}\n\n# Instructions: {{senderName}} wants to execute a shell command. Extract the COMPLETE shell command they want to run.\n\nIMPORTANT:\n1. Always return the FULL executable shell command, not just the content or partial command.\n2. If the user mentions installing something, create the appropriate brew/npm/apt command.\n3. If the user directly provides a command (like \"brew install X\"), use it exactly as provided.\n4. ALWAYS extract a command if the user is asking for ANY kind of system operation.\n\nCommon patterns:\n- \"run ls -la\" -> command: \"ls -la\"\n- \"execute npm test\" -> command: \"npm test\"\n- \"show me the files\" or \"list files\" -> command: \"ls -la\"\n- \"what's in this directory\" -> command: \"ls -la\"\n- \"check git status\" -> command: \"git status\"\n- \"navigate to src folder\" -> command: \"cd src\"\n- \"create a file called test.txt\" -> command: \"touch test.txt\"\n- \"write hello world to a file\" -> command: \"echo 'hello world' > file.txt\"\n- \"create hello.js with javascript code\" -> command: \"echo 'console.log(\\\"Hello, World!\\\");' > hello.js\"\n- \"create hello_world.py and write a python hello world script inside\" -> command: \"echo 'print(\\\"Hello, World!\\\")' > hello_world.py\"\n- \"make a new directory\" -> command: \"mkdir newdir\"\n- \"list files inside your filesystem\" -> command: \"ls -la\"\n- \"install orbstack\" or \"brew install orbstack\" -> command: \"brew install orbstack\"\n- \"install mullvad vpn\" -> command: \"brew install --cask mullvad-vpn\"\n- \"get system info\" -> command: \"system_profiler SPHardwareDataType\"\n- \"check memory usage\" -> command: \"vm_stat\"\n- \"install package\" -> command: \"brew install <package>\"\n\nSpecial cases:\n- \"Run it in your shell\" or \"execute it\" -> Extract the command from previous context\n- \"Install these\" -> Look for package names in previous messages\n- Direct commands should be used exactly as provided\n\nKey rules:\n1. For file creation with content, use: echo 'content' > filename\n2. For listing files, use: ls -la (not just ls)\n3. Always include the echo command when writing to files\n4. Include all flags and arguments\n5. When user says \"run it\", \"execute it\", or similar, they want you to run the command\n\nRespond with JSON only:\n{\n \"command\": \"<complete shell command to execute>\"\n}";
11
- //# sourceMappingURL=prompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,yBAAyB,m3EA6CpC,CAAC;AAEH,eAAO,MAAM,2BAA2B,m3EAA4B,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default, shellHistoryProvider } from "./shellHistoryProvider";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type Provider } from "@elizaos/core";
2
- export declare const shellHistoryProvider: Provider;
3
- export default shellHistoryProvider;
4
- //# sourceMappingURL=shellHistoryProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shellHistoryProvider.d.ts","sourceRoot":"","sources":["../../providers/shellHistoryProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,eAAe,CAAC;AAUvB,eAAO,MAAM,oBAAoB,EAAE,QAsIlC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,3 +0,0 @@
1
- export { addSession, appendOutput, clearFinished, createSessionSlug, deleteSession, drainSession, getFinishedSession, getSession, listFinishedSessions, listRunningSessions, markBackgrounded, markExited, resetProcessRegistryForTests, setJobTtlMs, tail, trimWithCap, } from "./processRegistry";
2
- export { ShellService } from "./shellService";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACX,IAAI,EACJ,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Process Registry - Manages running and finished shell sessions
3
- * Ported from otto bash-process-registry.ts
4
- */
5
- import type { FinishedSession, ProcessSession, ProcessStatus } from "../types";
6
- export declare function createSessionSlug(isTaken?: (id: string) => boolean): string;
7
- export declare function addSession(session: ProcessSession): void;
8
- export declare function getSession(id: string): ProcessSession | undefined;
9
- export declare function getFinishedSession(id: string): FinishedSession | undefined;
10
- export declare function deleteSession(id: string): void;
11
- export declare function tail(text: string, max?: number): string;
12
- export declare function trimWithCap(text: string, max: number): string;
13
- export declare function appendOutput(session: ProcessSession, stream: "stdout" | "stderr", chunk: string): void;
14
- export declare function drainSession(session: ProcessSession): {
15
- stdout: string;
16
- stderr: string;
17
- };
18
- export declare function markExited(session: ProcessSession, exitCode: number | null, exitSignal: NodeJS.Signals | number | null, status: ProcessStatus): void;
19
- export declare function markBackgrounded(session: ProcessSession): void;
20
- export declare function listRunningSessions(): ProcessSession[];
21
- export declare function listFinishedSessions(): FinishedSession[];
22
- export declare function clearFinished(): void;
23
- export declare function resetProcessRegistryForTests(): void;
24
- export declare function setJobTtlMs(value?: number): void;
25
- //# sourceMappingURL=processRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processRegistry.d.ts","sourceRoot":"","sources":["../../services/processRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAuI/E,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CA4B3E;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAGxD;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEjE;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE1E;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAG9C;AAgCD,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAO,GAAG,MAAM,CAKrD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAC3B,KAAK,EAAE,MAAM,GACZ,IAAI,CA4BN;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAQA;AAwBD,wBAAgB,UAAU,CACxB,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,UAAU,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,IAAI,EAC1C,MAAM,EAAE,aAAa,GACpB,IAAI,CAMN;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAE9D;AAED,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAEtD;AAED,wBAAgB,oBAAoB,IAAI,eAAe,EAAE,CAExD;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,4BAA4B,IAAI,IAAI,CAInD;AAED,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAOhD"}
@@ -1,94 +0,0 @@
1
- /**
2
- * Enhanced Shell Service with PTY, background execution, and session management
3
- * Migrated from otto bash-tools.exec.ts, bash-tools.process.ts
4
- */
5
- import { type IAgentRuntime, Service } from "@elizaos/core";
6
- import type { CommandHistoryEntry, CommandResult, ExecResult, ExecuteOptions, FinishedSession, ProcessActionParams, ProcessSession, ShellConfig } from "../types";
7
- export declare class ShellService extends Service {
8
- static serviceType: string;
9
- private shellConfig;
10
- private currentDirectory;
11
- private commandHistory;
12
- private maxHistoryPerConversation;
13
- private scopeKey?;
14
- constructor(runtime: IAgentRuntime);
15
- static start(runtime: IAgentRuntime): Promise<ShellService>;
16
- stop(): Promise<void>;
17
- get capabilityDescription(): string;
18
- private getSandboxManager;
19
- private toSandboxWorkdir;
20
- private runSandboxCommand;
21
- /**
22
- * Set scope key for session isolation
23
- */
24
- setScopeKey(scopeKey: string): void;
25
- /**
26
- * Simple command execution (original API for backward compatibility)
27
- */
28
- executeCommand(command: string, conversationId?: string): Promise<CommandResult>;
29
- /**
30
- * Enhanced command execution with PTY, background support, and session management
31
- * This is the main execution method that supports all advanced features
32
- */
33
- exec(command: string, options?: ExecuteOptions): Promise<ExecResult>;
34
- /**
35
- * Process management action handler
36
- * Supports: list, poll, log, write, send-keys, submit, paste, kill, clear, remove
37
- */
38
- processAction(params: ProcessActionParams): Promise<{
39
- success: boolean;
40
- message: string;
41
- data?: Record<string, unknown>;
42
- }>;
43
- /**
44
- * List all running sessions
45
- */
46
- listRunningSessions(): ProcessSession[];
47
- /**
48
- * List all finished sessions
49
- */
50
- listFinishedSessions(): FinishedSession[];
51
- /**
52
- * Get a specific session by ID
53
- */
54
- getSession(id: string): ProcessSession | undefined;
55
- /**
56
- * Get a specific finished session by ID
57
- */
58
- getFinishedSession(id: string): FinishedSession | undefined;
59
- /**
60
- * Kill a session by ID
61
- */
62
- killSessionById(id: string): boolean;
63
- /**
64
- * Get command history for a conversation
65
- */
66
- getCommandHistory(conversationId: string, limit?: number): CommandHistoryEntry[];
67
- /**
68
- * Clear command history for a conversation
69
- */
70
- clearCommandHistory(conversationId: string): void;
71
- /**
72
- * Get current working directory
73
- */
74
- getCurrentDirectory(_conversationId?: string): string;
75
- /**
76
- * Set current working directory
77
- */
78
- setCurrentDirectory(directory: string): boolean;
79
- /**
80
- * Get allowed directory
81
- */
82
- getAllowedDirectory(): string;
83
- /**
84
- * Get shell configuration
85
- */
86
- getShellConfig(): ShellConfig;
87
- private handleCdCommand;
88
- private runCommandSimple;
89
- private runExecProcess;
90
- private addToHistory;
91
- private detectFileOperations;
92
- private resolvePath;
93
- }
94
- //# sourceMappingURL=shellService.d.ts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E,OAAO,CAAC,CAAC;KAChC,CAAC;IAwaF;;OAEG;IACH,mBAAmB,IAAI,cAAc,EAAE;IAKvC;;OAEG;IACH,oBAAoB,IAAI,eAAe,EAAE;IAKzC;;OAEG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAOlD;;OAEG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAO3D;;OAEG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAQpC;;OAEG;IACH,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,mBAAmB,EAAE;IAQhF;;OAEG;IACH,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAKjD;;OAEG;IACH,mBAAmB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrD;;OAEG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAa/C;;OAEG;IACH,mBAAmB,IAAI,MAAM;IAI7B;;OAEG;IACH,cAAc,IAAI,WAAW;YAMf,eAAe;YAyCf,gBAAgB;YAwFhB,cAAc;IAyU5B,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,oBAAoB;IA6C5B,OAAO,CAAC,WAAW;CAMpB"}
@@ -1,144 +0,0 @@
1
- import type { ChildProcessWithoutNullStreams } from "node:child_process";
2
- export interface CommandResult {
3
- success: boolean;
4
- stdout: string;
5
- stderr: string;
6
- exitCode: number | null;
7
- error?: string;
8
- executedIn: string;
9
- }
10
- export interface CommandHistoryEntry {
11
- command: string;
12
- stdout: string;
13
- stderr: string;
14
- exitCode: number | null;
15
- timestamp: number;
16
- workingDirectory: string;
17
- fileOperations?: FileOperation[];
18
- }
19
- export type FileOperationType = "create" | "write" | "read" | "delete" | "mkdir" | "move" | "copy";
20
- export interface FileOperation {
21
- type: FileOperationType;
22
- target: string;
23
- secondaryTarget?: string;
24
- }
25
- export interface ShellConfig {
26
- enabled: boolean;
27
- allowedDirectory: string;
28
- timeout: number;
29
- forbiddenCommands: string[];
30
- maxOutputChars: number;
31
- pendingMaxOutputChars: number;
32
- defaultBackgroundMs: number;
33
- allowBackground: boolean;
34
- }
35
- export type ProcessStatus = "running" | "completed" | "failed" | "killed";
36
- export type SessionStdin = {
37
- write: (data: string, cb?: (err?: Error | null) => void) => void;
38
- end: () => void;
39
- destroyed?: boolean;
40
- };
41
- export interface ProcessSession {
42
- id: string;
43
- command: string;
44
- scopeKey?: string;
45
- sessionKey?: string;
46
- notifyOnExit?: boolean;
47
- exitNotified?: boolean;
48
- child?: ChildProcessWithoutNullStreams;
49
- stdin?: SessionStdin;
50
- pid?: number;
51
- startedAt: number;
52
- cwd?: string;
53
- maxOutputChars: number;
54
- pendingMaxOutputChars?: number;
55
- totalOutputChars: number;
56
- pendingStdout: string[];
57
- pendingStderr: string[];
58
- pendingStdoutChars: number;
59
- pendingStderrChars: number;
60
- aggregated: string;
61
- tail: string;
62
- exitCode?: number | null;
63
- exitSignal?: NodeJS.Signals | number | null;
64
- exited: boolean;
65
- truncated: boolean;
66
- backgrounded: boolean;
67
- }
68
- export interface FinishedSession {
69
- id: string;
70
- command: string;
71
- scopeKey?: string;
72
- startedAt: number;
73
- endedAt: number;
74
- cwd?: string;
75
- status: ProcessStatus;
76
- exitCode?: number | null;
77
- exitSignal?: NodeJS.Signals | number | null;
78
- aggregated: string;
79
- tail: string;
80
- truncated: boolean;
81
- totalOutputChars: number;
82
- }
83
- export interface ExecuteOptions {
84
- workdir?: string;
85
- env?: Record<string, string>;
86
- yieldMs?: number;
87
- background?: boolean;
88
- timeout?: number;
89
- pty?: boolean;
90
- conversationId?: string;
91
- scopeKey?: string;
92
- sessionKey?: string;
93
- notifyOnExit?: boolean;
94
- onUpdate?: (session: ProcessSession) => void;
95
- }
96
- export type ExecResult = {
97
- status: "running";
98
- sessionId: string;
99
- pid?: number;
100
- startedAt: number;
101
- cwd?: string;
102
- tail?: string;
103
- } | {
104
- status: "completed" | "failed";
105
- exitCode: number | null;
106
- durationMs: number;
107
- aggregated: string;
108
- cwd?: string;
109
- timedOut?: boolean;
110
- reason?: string;
111
- };
112
- export type ProcessAction = "list" | "poll" | "log" | "write" | "send-keys" | "submit" | "paste" | "kill" | "clear" | "remove";
113
- export interface ProcessActionParams {
114
- action: ProcessAction;
115
- sessionId?: string;
116
- data?: string;
117
- keys?: string[];
118
- hex?: string[];
119
- literal?: string;
120
- text?: string;
121
- bracketed?: boolean;
122
- eof?: boolean;
123
- offset?: number;
124
- limit?: number;
125
- }
126
- export type PtyExitEvent = {
127
- exitCode: number;
128
- signal?: number;
129
- };
130
- export type PtyListener<T> = (event: T) => void;
131
- export type PtyHandle = {
132
- pid: number;
133
- write: (data: string | Buffer) => void;
134
- onData: (listener: PtyListener<string>) => void;
135
- onExit: (listener: PtyListener<PtyExitEvent>) => void;
136
- };
137
- export type PtySpawn = (file: string, args: string[] | string, options: {
138
- name?: string;
139
- cols?: number;
140
- rows?: number;
141
- cwd?: string;
142
- env?: Record<string, string>;
143
- }) => PtyHandle;
144
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,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- export declare function loadShellConfig(): ShellConfig;
4
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../utils/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAa5C,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EA0B9C,CAAC;AAEX,wBAAgB,eAAe,IAAI,WAAW,CAwD7C"}
@@ -1,9 +0,0 @@
1
- import type { IAgentRuntime } from "@elizaos/core";
2
- export type RuntimeExecutionMode = "cloud" | "local-safe" | "local-yolo";
3
- /** @deprecated Use {@link RuntimeExecutionMode}. */
4
- export type LocalExecutionMode = "local-safe" | "local-yolo";
5
- export declare function resolveRuntimeExecutionMode(runtime?: Pick<IAgentRuntime, "getSetting"> | null): RuntimeExecutionMode;
6
- export declare function resolveLocalExecutionMode(runtime?: Pick<IAgentRuntime, "getSetting"> | null): LocalExecutionMode;
7
- export declare function shouldUseSandboxExecution(runtime?: Pick<IAgentRuntime, "getSetting"> | null): boolean;
8
- export declare function isCloudExecutionMode(runtime?: Pick<IAgentRuntime, "getSetting"> | null): boolean;
9
- //# sourceMappingURL=executionMode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executionMode.d.ts","sourceRoot":"","sources":["../../utils/executionMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAAC;AACzE,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,YAAY,CAAC;AAgB7D,wBAAgB,2BAA2B,CACzC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,IAAI,GACjD,oBAAoB,CActB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,IAAI,GACjD,kBAAkB,CAGpB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,IAAI,GACjD,OAAO,CAET;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,IAAI,GAAG,OAAO,CAEhG"}
@@ -1,7 +0,0 @@
1
- export { DEFAULT_FORBIDDEN_COMMANDS, loadShellConfig } from "./config";
2
- export { extractBaseCommand, isForbiddenCommand, isSafeCommand, validatePath, } from "./pathUtils";
3
- export { attachChildProcessBridge, type ChildProcessBridgeOptions, CommandLane, type CommandLane as CommandLaneType, type CommandOptions, clearCommandLane, enqueueCommand, enqueueCommandInLane, getQueueSize, getTotalQueueSize, runCommandWithTimeout, runExec, type SpawnResult, setCommandLaneConcurrency, } from "./processQueue";
4
- export { BRACKETED_PASTE_END, BRACKETED_PASTE_START, buildCursorPositionResponse, encodeKeySequence, encodePaste, type KeyEncodingRequest, type KeyEncodingResult, stripDsrRequests, } from "./ptyKeys";
5
- export { splitShellArgs } from "./shellArgv";
6
- export { chunkString, clampNumber, coerceEnv, deriveSessionName, formatDuration, getShellConfig, killProcessTree, killSession, pad, readEnvInt, resolveWorkdir, sanitizeBinaryOutput, sliceLogLines, sliceUtf16Safe, truncateMiddle, } from "./shellUtils";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,WAAW,EACX,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,cAAc,EACnB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,OAAO,EACP,KAAK,WAAW,EAChB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC3B,iBAAiB,EACjB,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,WAAW,EACX,GAAG,EACH,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,cAAc,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare function validatePath(commandPath: string, allowedDir: string, currentDir: string): string | null;
2
- export declare function isSafeCommand(command: string): boolean;
3
- export declare function extractBaseCommand(fullCommand: string): string;
4
- export declare function isForbiddenCommand(command: string, forbiddenCommands: string[]): boolean;
5
- //# sourceMappingURL=pathUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathUtils.d.ts","sourceRoot":"","sources":["../../utils/pathUtils.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAaf;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CA0BtD;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,OAAO,CAmBxF"}
@@ -1,136 +0,0 @@
1
- /**
2
- * Process execution utilities with command queuing.
3
- *
4
- * Provides cross-platform child process execution with:
5
- * - Windows command resolution (.cmd extension handling)
6
- * - Timeout support
7
- * - Lane-based command queuing for serialization
8
- * - Signal forwarding between parent and child processes
9
- *
10
- * @module utils/processQueue
11
- */
12
- import { type ChildProcess } from "node:child_process";
13
- /**
14
- * Command execution lanes for organizing concurrent command execution.
15
- * Lanes allow serialization within a lane while permitting parallelism across lanes.
16
- */
17
- export declare const CommandLane: {
18
- readonly Main: "main";
19
- readonly Cron: "cron";
20
- readonly Subagent: "subagent";
21
- readonly Nested: "nested";
22
- };
23
- export type CommandLane = (typeof CommandLane)[keyof typeof CommandLane];
24
- /**
25
- * Simple promise-wrapped execFile with timeout support.
26
- *
27
- * @param command - The command to execute
28
- * @param args - Command arguments
29
- * @param opts - Timeout in ms or options object
30
- * @returns Promise resolving to stdout and stderr
31
- */
32
- export declare function runExec(command: string, args: string[], opts?: number | {
33
- timeoutMs?: number;
34
- maxBuffer?: number;
35
- }): Promise<{
36
- stdout: string;
37
- stderr: string;
38
- }>;
39
- /**
40
- * Result from a spawned command execution.
41
- */
42
- export type SpawnResult = {
43
- stdout: string;
44
- stderr: string;
45
- code: number | null;
46
- signal: NodeJS.Signals | null;
47
- killed: boolean;
48
- };
49
- /**
50
- * Options for running a command with timeout.
51
- */
52
- export type CommandOptions = {
53
- timeoutMs: number;
54
- cwd?: string;
55
- input?: string;
56
- env?: NodeJS.ProcessEnv;
57
- windowsVerbatimArguments?: boolean;
58
- };
59
- /**
60
- * Run a command with timeout, input, and environment control.
61
- *
62
- * @param argv - Command and arguments as array
63
- * @param optionsOrTimeout - Options object or timeout in ms
64
- * @returns Promise resolving to spawn result
65
- */
66
- export declare function runCommandWithTimeout(argv: string[], optionsOrTimeout: number | CommandOptions): Promise<SpawnResult>;
67
- /**
68
- * Set the maximum concurrency for a command lane.
69
- *
70
- * @param lane - The lane name
71
- * @param maxConcurrent - Maximum concurrent tasks
72
- */
73
- export declare function setCommandLaneConcurrency(lane: string, maxConcurrent: number): void;
74
- /**
75
- * Enqueue a task to execute in a specific lane.
76
- *
77
- * @param lane - The lane name
78
- * @param task - Async task function
79
- * @param opts - Options including warning threshold and callbacks
80
- * @returns Promise resolving when task completes
81
- */
82
- export declare function enqueueCommandInLane<T>(lane: string, task: () => Promise<T>, opts?: {
83
- warnAfterMs?: number;
84
- onWait?: (waitMs: number, queuedAhead: number) => void;
85
- }): Promise<T>;
86
- /**
87
- * Enqueue a task to execute in the main lane.
88
- *
89
- * @param task - Async task function
90
- * @param opts - Options including warning threshold and callbacks
91
- * @returns Promise resolving when task completes
92
- */
93
- export declare function enqueueCommand<T>(task: () => Promise<T>, opts?: {
94
- warnAfterMs?: number;
95
- onWait?: (waitMs: number, queuedAhead: number) => void;
96
- }): Promise<T>;
97
- /**
98
- * Get the current queue size for a lane (queued + active).
99
- *
100
- * @param lane - The lane name (defaults to main)
101
- * @returns Queue size
102
- */
103
- export declare function getQueueSize(lane?: string): number;
104
- /**
105
- * Get total queue size across all lanes.
106
- *
107
- * @returns Total queue size
108
- */
109
- export declare function getTotalQueueSize(): number;
110
- /**
111
- * Clear all pending tasks in a lane.
112
- *
113
- * @param lane - The lane name (defaults to main)
114
- * @returns Number of tasks cleared
115
- */
116
- export declare function clearCommandLane(lane?: string): number;
117
- /**
118
- * Options for attaching a child process signal bridge.
119
- */
120
- export type ChildProcessBridgeOptions = {
121
- signals?: NodeJS.Signals[];
122
- onSignal?: (signal: NodeJS.Signals) => void;
123
- };
124
- /**
125
- * Attach signal forwarding from parent to child process.
126
- * Signals sent to the parent will be forwarded to the child.
127
- * Automatically detaches when child exits.
128
- *
129
- * @param child - The child process
130
- * @param options - Bridge options
131
- * @returns Object with detach function
132
- */
133
- export declare function attachChildProcessBridge(child: ChildProcess, { signals, onSignal }?: ChildProcessBridgeOptions): {
134
- detach: () => void;
135
- };
136
- //# sourceMappingURL=processQueue.d.ts.map
@@ -1 +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;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CA8BxB"}
@@ -1,23 +0,0 @@
1
- /**
2
- * PTY Key Encoding - Terminal key sequence encoding utilities
3
- * Ported from otto pty-keys.ts and pty-dsr.ts
4
- */
5
- export declare const BRACKETED_PASTE_START = "\u001B[200~";
6
- export declare const BRACKETED_PASTE_END = "\u001B[201~";
7
- export type KeyEncodingRequest = {
8
- keys?: string[];
9
- hex?: string[];
10
- literal?: string;
11
- };
12
- export type KeyEncodingResult = {
13
- data: string;
14
- warnings: string[];
15
- };
16
- export declare function encodeKeySequence(request: KeyEncodingRequest): KeyEncodingResult;
17
- export declare function encodePaste(text: string, bracketed?: boolean): string;
18
- export declare function stripDsrRequests(input: string): {
19
- cleaned: string;
20
- requests: number;
21
- };
22
- export declare function buildCursorPositionResponse(row?: number, col?: number): string;
23
- //# sourceMappingURL=ptyKeys.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ptyKeys.d.ts","sourceRoot":"","sources":["../../utils/ptyKeys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAyFjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CA0BhF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,MAAM,CAKlE;AAkKD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAOA;AAED,wBAAgB,2BAA2B,CAAC,GAAG,SAAI,EAAE,GAAG,SAAI,GAAG,MAAM,CAEpE"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Shell argument parsing utilities.
3
- *
4
- * Provides functions to split shell command strings into argument arrays,
5
- * handling quotes and escape sequences.
6
- *
7
- * @module utils/shellArgv
8
- */
9
- /**
10
- * Split a shell command string into an array of arguments.
11
- *
12
- * Handles:
13
- * - Single quotes (literal strings)
14
- * - Double quotes (literal strings)
15
- * - Backslash escapes (outside quotes)
16
- * - Whitespace as argument separator
17
- *
18
- * @param raw - The raw command string
19
- * @returns Array of arguments, or null if string has unclosed quotes/escapes
20
- *
21
- * @example
22
- * ```ts
23
- * splitShellArgs('git commit -m "fix bug"')
24
- * // => ['git', 'commit', '-m', 'fix bug']
25
- *
26
- * splitShellArgs("echo 'hello world'")
27
- * // => ['echo', 'hello world']
28
- *
29
- * splitShellArgs('path\\ with\\ spaces')
30
- * // => ['path with spaces']
31
- *
32
- * splitShellArgs('"unclosed')
33
- * // => null (unclosed quote)
34
- * ```
35
- */
36
- export declare function splitShellArgs(raw: string): string[] | null;
37
- //# sourceMappingURL=shellArgv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shellArgv.d.ts","sourceRoot":"","sources":["../../utils/shellArgv.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CA6D3D"}