@elizaos/plugin-shell 2.0.0-alpha.9 → 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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/auto-enable.ts +37 -0
  4. package/package.json +46 -20
  5. package/dist/actions/clearHistory.d.ts +0 -4
  6. package/dist/actions/clearHistory.d.ts.map +0 -1
  7. package/dist/actions/index.d.ts +0 -2
  8. package/dist/actions/index.d.ts.map +0 -1
  9. package/dist/approvals/allowlist.d.ts +0 -76
  10. package/dist/approvals/allowlist.d.ts.map +0 -1
  11. package/dist/approvals/analysis.d.ts +0 -76
  12. package/dist/approvals/analysis.d.ts.map +0 -1
  13. package/dist/approvals/index.d.ts +0 -12
  14. package/dist/approvals/index.d.ts.map +0 -1
  15. package/dist/approvals/service.d.ts +0 -121
  16. package/dist/approvals/service.d.ts.map +0 -1
  17. package/dist/approvals/types.d.ts +0 -219
  18. package/dist/approvals/types.d.ts.map +0 -1
  19. package/dist/build.d.ts +0 -2
  20. package/dist/build.d.ts.map +0 -1
  21. package/dist/generated/prompts/typescript/prompts.d.ts +0 -12
  22. package/dist/generated/prompts/typescript/prompts.d.ts.map +0 -1
  23. package/dist/generated/specs/spec-helpers.d.ts +0 -49
  24. package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
  25. package/dist/generated/specs/specs.d.ts +0 -73
  26. package/dist/generated/specs/specs.d.ts.map +0 -1
  27. package/dist/index.browser.d.ts +0 -4
  28. package/dist/index.browser.d.ts.map +0 -1
  29. package/dist/index.d.ts +0 -14
  30. package/dist/index.d.ts.map +0 -1
  31. package/dist/index.js +0 -5278
  32. package/dist/index.js.map +0 -35
  33. package/dist/providers/index.d.ts +0 -2
  34. package/dist/providers/index.d.ts.map +0 -1
  35. package/dist/providers/shellHistoryProvider.d.ts +0 -4
  36. package/dist/providers/shellHistoryProvider.d.ts.map +0 -1
  37. package/dist/providers/terminalUsage.d.ts +0 -3
  38. package/dist/providers/terminalUsage.d.ts.map +0 -1
  39. package/dist/services/index.d.ts +0 -3
  40. package/dist/services/index.d.ts.map +0 -1
  41. package/dist/services/processRegistry.d.ts +0 -25
  42. package/dist/services/processRegistry.d.ts.map +0 -1
  43. package/dist/services/shellService.d.ts +0 -91
  44. package/dist/services/shellService.d.ts.map +0 -1
  45. package/dist/types/index.d.ts +0 -144
  46. package/dist/types/index.d.ts.map +0 -1
  47. package/dist/utils/config.d.ts +0 -4
  48. package/dist/utils/config.d.ts.map +0 -1
  49. package/dist/utils/index.d.ts +0 -7
  50. package/dist/utils/index.d.ts.map +0 -1
  51. package/dist/utils/pathUtils.d.ts +0 -5
  52. package/dist/utils/pathUtils.d.ts.map +0 -1
  53. package/dist/utils/processQueue.d.ts +0 -136
  54. package/dist/utils/processQueue.d.ts.map +0 -1
  55. package/dist/utils/ptyKeys.d.ts +0 -23
  56. package/dist/utils/ptyKeys.d.ts.map +0 -1
  57. package/dist/utils/shellArgv.d.ts +0 -37
  58. package/dist/utils/shellArgv.d.ts.map +0 -1
  59. package/dist/utils/shellUtils.d.ts +0 -103
  60. package/dist/utils/shellUtils.d.ts.map +0 -1
  61. package/dist/vitest.config.d.ts +0 -3
  62. package/dist/vitest.config.d.ts.map +0 -1
@@ -1,219 +0,0 @@
1
- /**
2
- * Exec Approval Types
3
- *
4
- * Types for command execution approval system in plugin-shell.
5
- * Provides type definitions for approval configuration, allowlist entries,
6
- * command analysis, and approval decisions.
7
- */
8
- import type { UUID } from "@elizaos/core";
9
- /**
10
- * Security levels for command execution
11
- */
12
- export type ExecSecurity = "deny" | "allowlist" | "full";
13
- /**
14
- * Ask modes for approval prompts
15
- */
16
- export type ExecAsk = "off" | "on-miss" | "always";
17
- /**
18
- * Execution host types
19
- */
20
- export type ExecHost = "sandbox" | "gateway" | "node";
21
- /**
22
- * Default configuration for exec approvals
23
- */
24
- export interface ExecApprovalsDefaults {
25
- /** Security level (deny, allowlist, full) */
26
- security?: ExecSecurity;
27
- /** Ask mode (off, on-miss, always) */
28
- ask?: ExecAsk;
29
- /** Fallback security when ask is declined */
30
- askFallback?: ExecSecurity;
31
- /** Auto-allow commands from skill definitions */
32
- autoAllowSkills?: boolean;
33
- }
34
- /**
35
- * Allowlist entry for permitted commands
36
- */
37
- export interface ExecAllowlistEntry {
38
- /** Unique identifier */
39
- id?: string;
40
- /** Pattern to match (executable path or glob) */
41
- pattern: string;
42
- /** Last time this pattern was used */
43
- lastUsedAt?: number;
44
- /** Last command that matched this pattern */
45
- lastUsedCommand?: string;
46
- /** Last resolved executable path */
47
- lastResolvedPath?: string;
48
- }
49
- /**
50
- * Agent-specific approval configuration
51
- */
52
- export interface ExecApprovalsAgent extends ExecApprovalsDefaults {
53
- /** Allowlist entries for this agent */
54
- allowlist?: ExecAllowlistEntry[];
55
- }
56
- /**
57
- * Full approval configuration file structure
58
- */
59
- export interface ExecApprovalsFile {
60
- /** Version number (always 1) */
61
- version: 1;
62
- /** Socket configuration for external approval UI */
63
- socket?: {
64
- path?: string;
65
- token?: string;
66
- };
67
- /** Default approval settings */
68
- defaults?: ExecApprovalsDefaults;
69
- /** Per-agent approval settings */
70
- agents?: Record<string, ExecApprovalsAgent>;
71
- }
72
- /**
73
- * Snapshot of approval configuration file
74
- */
75
- export interface ExecApprovalsSnapshot {
76
- /** File path */
77
- path: string;
78
- /** Whether the file exists */
79
- exists: boolean;
80
- /** Raw file content */
81
- raw: string | null;
82
- /** Parsed and normalized configuration */
83
- file: ExecApprovalsFile;
84
- /** Content hash */
85
- hash: string;
86
- }
87
- /**
88
- * Resolved approval configuration for an agent
89
- */
90
- export interface ExecApprovalsResolved {
91
- /** File path */
92
- path: string;
93
- /** Socket path for external approval UI */
94
- socketPath: string;
95
- /** Authentication token */
96
- token: string;
97
- /** Resolved default settings */
98
- defaults: Required<ExecApprovalsDefaults>;
99
- /** Resolved agent-specific settings */
100
- agent: Required<ExecApprovalsDefaults>;
101
- /** Combined allowlist entries */
102
- allowlist: ExecAllowlistEntry[];
103
- /** Full configuration file */
104
- file: ExecApprovalsFile;
105
- }
106
- /**
107
- * Command resolution result
108
- */
109
- export interface CommandResolution {
110
- /** The raw executable from the command */
111
- rawExecutable: string;
112
- /** Fully resolved executable path */
113
- resolvedPath?: string;
114
- /** Executable name (basename) */
115
- executableName: string;
116
- }
117
- /**
118
- * Command segment from shell parsing
119
- */
120
- export interface ExecCommandSegment {
121
- /** Raw command text */
122
- raw: string;
123
- /** Parsed argument vector */
124
- argv: string[];
125
- /** Resolution of the executable */
126
- resolution: CommandResolution | null;
127
- }
128
- /**
129
- * Result of command analysis
130
- */
131
- export interface ExecCommandAnalysis {
132
- /** Whether analysis succeeded */
133
- ok: boolean;
134
- /** Reason for failure (if any) */
135
- reason?: string;
136
- /** Parsed command segments */
137
- segments: ExecCommandSegment[];
138
- /** Segments grouped by chain operators (&&, ||, ;) */
139
- chains?: ExecCommandSegment[][];
140
- }
141
- /**
142
- * Result of allowlist evaluation
143
- */
144
- export interface ExecAllowlistEvaluation {
145
- /** Whether all commands are in the allowlist */
146
- allowlistSatisfied: boolean;
147
- /** Matching allowlist entries */
148
- allowlistMatches: ExecAllowlistEntry[];
149
- }
150
- /**
151
- * Combined analysis and allowlist evaluation
152
- */
153
- export interface ExecAllowlistAnalysis {
154
- /** Whether analysis succeeded */
155
- analysisOk: boolean;
156
- /** Whether allowlist is satisfied */
157
- allowlistSatisfied: boolean;
158
- /** Matching allowlist entries */
159
- allowlistMatches: ExecAllowlistEntry[];
160
- /** Parsed command segments */
161
- segments: ExecCommandSegment[];
162
- }
163
- /**
164
- * Possible approval decisions
165
- */
166
- export type ExecApprovalDecision = "allow-once" | "allow-always" | "deny";
167
- /**
168
- * Request for exec approval
169
- */
170
- export interface ExecApprovalRequest {
171
- /** Unique request ID */
172
- id: string;
173
- /** The command to execute */
174
- command: string;
175
- /** Working directory */
176
- cwd?: string;
177
- /** Execution host */
178
- host?: ExecHost;
179
- /** Security level */
180
- security?: ExecSecurity;
181
- /** Ask mode */
182
- ask?: ExecAsk;
183
- /** Agent ID */
184
- agentId?: string;
185
- /** Resolved executable path */
186
- resolvedPath?: string;
187
- /** Session key for routing */
188
- sessionKey?: string;
189
- /** Room ID where approval is requested */
190
- roomId: UUID;
191
- /** Timeout in milliseconds */
192
- timeoutMs?: number;
193
- }
194
- /**
195
- * Result of exec approval
196
- */
197
- export interface ExecApprovalResult {
198
- /** The decision made */
199
- decision: ExecApprovalDecision;
200
- /** Whether approval timed out */
201
- timedOut: boolean;
202
- /** Who resolved the approval */
203
- resolvedBy?: UUID;
204
- }
205
- /**
206
- * Configuration for safe binary commands that don't need approval
207
- */
208
- export declare const DEFAULT_SAFE_BINS: readonly ["jq", "grep", "cut", "sort", "uniq", "head", "tail", "tr", "wc"];
209
- /**
210
- * Default exec approval settings
211
- */
212
- export declare const EXEC_APPROVAL_DEFAULTS: {
213
- readonly security: ExecSecurity;
214
- readonly ask: ExecAsk;
215
- readonly askFallback: ExecSecurity;
216
- readonly autoAllowSkills: false;
217
- readonly timeoutMs: 120000;
218
- };
219
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../approvals/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,sCAAsC;IACtC,GAAG,CAAC,EAAE,OAAO,C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":"build.d.ts","sourceRoot":"","sources":["../build.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- /**
2
- * Auto-generated prompt templates
3
- * DO NOT EDIT - Generated from ../../../../prompts/*.txt
4
- *
5
- * These prompts use Handlebars-style template syntax:
6
- * - {{variableName}} for simple substitution
7
- * - {{#each items}}...{{/each}} for iteration
8
- * - {{#if condition}}...{{/if}} for conditionals
9
- */
10
- 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\nYour response must be formatted as a JSON block:\n```json\n{\n \"command\": \"<complete shell command to execute>\"\n}\n```";
11
- 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\nYour response must be formatted as a JSON block:\n```json\n{\n \"command\": \"<complete shell command to execute>\"\n}\n```";
12
- //# sourceMappingURL=prompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../generated/prompts/typescript/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,yBAAyB,25EA+C/B,CAAC;AAER,eAAO,MAAM,2BAA2B,25EAA4B,CAAC"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Helper functions to lookup action/provider/evaluator specs by name.
3
- * These allow language-specific implementations to import their text content
4
- * (description, similes, examples) from the centralized specs.
5
- *
6
- * DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json, prompts/evaluators.json and regenerate.
7
- */
8
- import { type ActionDoc, type EvaluatorDoc, type ProviderDoc } from "./specs";
9
- /**
10
- * Get an action spec by name from the core specs.
11
- * @param name - The action name
12
- * @returns The action spec or undefined if not found
13
- */
14
- export declare function getActionSpec(name: string): ActionDoc | undefined;
15
- /**
16
- * Get an action spec by name, throwing if not found.
17
- * @param name - The action name
18
- * @returns The action spec
19
- * @throws Error if the action is not found
20
- */
21
- export declare function requireActionSpec(name: string): ActionDoc;
22
- /**
23
- * Get a provider spec by name from the core specs.
24
- * @param name - The provider name
25
- * @returns The provider spec or undefined if not found
26
- */
27
- export declare function getProviderSpec(name: string): ProviderDoc | undefined;
28
- /**
29
- * Get a provider spec by name, throwing if not found.
30
- * @param name - The provider name
31
- * @returns The provider spec
32
- * @throws Error if the provider is not found
33
- */
34
- export declare function requireProviderSpec(name: string): ProviderDoc;
35
- /**
36
- * Get an evaluator spec by name from the core specs.
37
- * @param name - The evaluator name
38
- * @returns The evaluator spec or undefined if not found
39
- */
40
- export declare function getEvaluatorSpec(name: string): EvaluatorDoc | undefined;
41
- /**
42
- * Get an evaluator spec by name, throwing if not found.
43
- * @param name - The evaluator name
44
- * @returns The evaluator spec
45
- * @throws Error if the evaluator is not found
46
- */
47
- export declare function requireEvaluatorSpec(name: string): EvaluatorDoc;
48
- export type { ActionDoc, ProviderDoc, EvaluatorDoc };
49
- //# sourceMappingURL=spec-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-helpers.d.ts","sourceRoot":"","sources":["../../../generated/specs/spec-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACN,KAAK,SAAS,EAOd,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,MAAM,SAAS,CAAC;AAsBjB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAMzD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAM/D;AAGD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Auto-generated canonical action/provider/evaluator docs for plugin-shell.
3
- * DO NOT EDIT - Generated from prompts/specs/**.
4
- */
5
- export type ActionDoc = {
6
- name: string;
7
- description: string;
8
- similes?: readonly string[];
9
- parameters?: readonly unknown[];
10
- examples?: readonly (readonly unknown[])[];
11
- };
12
- export type ProviderDoc = {
13
- name: string;
14
- description: string;
15
- position?: number;
16
- dynamic?: boolean;
17
- };
18
- export type EvaluatorDoc = {
19
- name: string;
20
- description: string;
21
- similes?: readonly string[];
22
- alwaysRun?: boolean;
23
- examples?: readonly unknown[];
24
- };
25
- export declare const coreActionsSpec: {
26
- readonly version: "1.0.0";
27
- readonly actions: readonly [{
28
- readonly name: "CLEAR_SHELL_HISTORY";
29
- readonly description: "Clears the recorded history of shell commands for the current conversation";
30
- readonly similes: readonly ["RESET_SHELL", "CLEAR_TERMINAL", "CLEAR_HISTORY", "RESET_HISTORY"];
31
- readonly parameters: readonly [];
32
- }];
33
- };
34
- export declare const allActionsSpec: {
35
- readonly version: "1.0.0";
36
- readonly actions: readonly [{
37
- readonly name: "CLEAR_SHELL_HISTORY";
38
- readonly description: "Clears the recorded history of shell commands for the current conversation";
39
- readonly similes: readonly ["RESET_SHELL", "CLEAR_TERMINAL", "CLEAR_HISTORY", "RESET_HISTORY"];
40
- readonly parameters: readonly [];
41
- }];
42
- };
43
- export declare const coreProvidersSpec: {
44
- readonly version: "1.0.0";
45
- readonly providers: readonly [{
46
- readonly name: "SHELL_HISTORY";
47
- readonly description: "Provides recent shell command history, current working directory, and file operations within the restricted environment";
48
- readonly dynamic: true;
49
- }];
50
- };
51
- export declare const allProvidersSpec: {
52
- readonly version: "1.0.0";
53
- readonly providers: readonly [{
54
- readonly name: "SHELL_HISTORY";
55
- readonly description: "Provides recent shell command history, current working directory, and file operations within the restricted environment";
56
- readonly dynamic: true;
57
- }];
58
- };
59
- export declare const coreEvaluatorsSpec: {
60
- readonly version: "1.0.0";
61
- readonly evaluators: readonly [];
62
- };
63
- export declare const allEvaluatorsSpec: {
64
- readonly version: "1.0.0";
65
- readonly evaluators: readonly [];
66
- };
67
- export declare const coreActionDocs: readonly ActionDoc[];
68
- export declare const allActionDocs: readonly ActionDoc[];
69
- export declare const coreProviderDocs: readonly ProviderDoc[];
70
- export declare const allProviderDocs: readonly ProviderDoc[];
71
- export declare const coreEvaluatorDocs: readonly EvaluatorDoc[];
72
- export declare const allEvaluatorDocs: readonly EvaluatorDoc[];
73
- //# sourceMappingURL=specs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;CAgBlB,CAAC;AACX,eAAO,MAAM,cAAc;;;;;;;;CAgBjB,CAAC;AACX,eAAO,MAAM,iBAAiB;;;;;;;CAUpB,CAAC;AACX,eAAO,MAAM,gBAAgB;;;;;;;CAUnB,CAAC;AACX,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AACX,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,eAAO,MAAM,cAAc,EAAE,SAAS,SAAS,EAA4B,CAAC;AAC5E,eAAO,MAAM,aAAa,EAAE,SAAS,SAAS,EAA2B,CAAC;AAC1E,eAAO,MAAM,gBAAgB,EAAE,SAAS,WAAW,EACvB,CAAC;AAC7B,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EACvB,CAAC;AAC5B,eAAO,MAAM,iBAAiB,EAAE,SAAS,YAAY,EACvB,CAAC;AAC/B,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EACvB,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { Plugin } from "@elizaos/core";
2
- export declare const shellPlugin: Plugin;
3
- export default shellPlugin;
4
- //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAK3D,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { Plugin } from "@elizaos/core";
2
- export declare const shellPlugin: Plugin;
3
- export default shellPlugin;
4
- export { clearHistory } from "./actions/clearHistory";
5
- export { addAllowlistEntry, analyzeShellCommand, type CommandCheckResult, type CommandResolution, DEFAULT_SAFE_BINS, EXEC_APPROVAL_DEFAULTS, type ExecAllowlistAnalysis, type ExecAllowlistEntry, type ExecAllowlistEvaluation, type ExecApprovalDecision, type ExecApprovalRequest, type ExecApprovalResult, ExecApprovalService, type ExecApprovalsAgent, type ExecApprovalsDefaults, type ExecApprovalsFile, type ExecApprovalsResolved, type ExecApprovalsSnapshot, type ExecAsk, type ExecCommandAnalysis, type ExecCommandSegment, type ExecHost, type ExecSecurity, ensureApprovals, evaluateExecAllowlist, evaluateShellAllowlist, getApprovalFilePath, getApprovalSocketPath, isSafeBinUsage, loadApprovals, matchAllowlist, maxAsk, minSecurity, normalizeApprovals, normalizeSafeBins, readApprovalsSnapshot, recordAllowlistUse, requiresExecApproval, resolveApprovals, resolveApprovalsFromFile, resolveCommandFromArgv, resolveCommandResolution, resolveSafeBins, saveApprovals, } from "./approvals";
6
- export { terminalUsageProvider } from "./providers/terminalUsage";
7
- export { shellHistoryProvider } from "./providers/shellHistoryProvider";
8
- export { addSession, appendOutput, clearFinished, createSessionSlug, deleteSession, drainSession, getFinishedSession, getSession, listFinishedSessions, listRunningSessions, markBackgrounded, markExited, resetProcessRegistryForTests, setJobTtlMs, tail, trimWithCap, } from "./services/processRegistry";
9
- export { ShellService } from "./services/shellService";
10
- export type { CommandHistoryEntry, CommandResult, ExecResult, ExecuteOptions, FileOperation, FileOperationType, FinishedSession, ProcessAction, ProcessActionParams, ProcessSession, ProcessStatus, PtyExitEvent, PtyHandle, PtyListener, PtySpawn, SessionStdin, ShellConfig, } from "./types";
11
- export { DEFAULT_FORBIDDEN_COMMANDS, extractBaseCommand, isForbiddenCommand, isSafeCommand, loadShellConfig, validatePath, } from "./utils";
12
- export { BRACKETED_PASTE_END, BRACKETED_PASTE_START, buildCursorPositionResponse, encodeKeySequence, encodePaste, type KeyEncodingRequest, type KeyEncodingResult, stripDsrRequests, } from "./utils/ptyKeys";
13
- export { chunkString, clampNumber, coerceEnv, deriveSessionName, formatDuration, formatSpawnError, getShellConfig, killProcessTree, killSession, pad, readEnvInt, resolveWorkdir, type SpawnFallback, type SpawnWithFallbackResult, sanitizeBinaryOutput, sliceLogLines, sliceUtf16Safe, spawnWithFallback, truncateMiddle, } from "./utils/shellUtils";
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO5C,eAAO,MAAM,WAAW,EAAE,MAOzB,CAAC;AAEF,eAAe,WAAW,CAAC;AAG3B,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