@elizaos/plugin-shell 2.0.0-beta.1 → 2.0.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -323
- package/auto-enable.ts +18 -2
- package/package.json +16 -6
- package/dist/actions/clearHistory.d.ts +0 -4
- package/dist/actions/clearHistory.d.ts.map +0 -1
- package/dist/actions/index.d.ts +0 -2
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/approvals/allowlist.d.ts +0 -76
- package/dist/approvals/allowlist.d.ts.map +0 -1
- package/dist/approvals/analysis.d.ts +0 -76
- package/dist/approvals/analysis.d.ts.map +0 -1
- package/dist/approvals/index.d.ts +0 -12
- package/dist/approvals/index.d.ts.map +0 -1
- package/dist/approvals/service.d.ts +0 -121
- package/dist/approvals/service.d.ts.map +0 -1
- package/dist/approvals/types.d.ts +0 -219
- package/dist/approvals/types.d.ts.map +0 -1
- package/dist/auto-enable.d.ts +0 -4
- package/dist/auto-enable.d.ts.map +0 -1
- package/dist/generated/specs/spec-helpers.d.ts +0 -36
- package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
- package/dist/generated/specs/specs.d.ts +0 -58
- package/dist/generated/specs/specs.d.ts.map +0 -1
- package/dist/index.browser.d.ts +0 -4
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -10578
- package/dist/index.js.map +0 -75
- package/dist/prompts.d.ts +0 -11
- package/dist/prompts.d.ts.map +0 -1
- package/dist/providers/index.d.ts +0 -2
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/shellHistoryProvider.d.ts +0 -4
- package/dist/providers/shellHistoryProvider.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -3
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/processRegistry.d.ts +0 -25
- package/dist/services/processRegistry.d.ts.map +0 -1
- package/dist/services/shellService.d.ts +0 -94
- package/dist/services/shellService.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -144
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/config.d.ts +0 -4
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/executionMode.d.ts +0 -9
- package/dist/utils/executionMode.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/pathUtils.d.ts +0 -5
- package/dist/utils/pathUtils.d.ts.map +0 -1
- package/dist/utils/processQueue.d.ts +0 -136
- package/dist/utils/processQueue.d.ts.map +0 -1
- package/dist/utils/ptyKeys.d.ts +0 -23
- package/dist/utils/ptyKeys.d.ts.map +0 -1
- package/dist/utils/shellArgv.d.ts +0 -37
- package/dist/utils/shellArgv.d.ts.map +0 -1
- package/dist/utils/shellUtils.d.ts +0 -103
- package/dist/utils/shellUtils.d.ts.map +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command Analysis
|
|
3
|
-
*
|
|
4
|
-
* Functions for analyzing shell commands for security evaluation.
|
|
5
|
-
* Parses commands, resolves executables, and evaluates against allowlists.
|
|
6
|
-
*/
|
|
7
|
-
import type { CommandResolution, ExecAllowlistAnalysis, ExecAllowlistEntry, ExecAllowlistEvaluation, ExecCommandAnalysis } from "./types";
|
|
8
|
-
/**
|
|
9
|
-
* Resolve command to executable info
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveCommandResolution(command: string, cwd?: string, env?: NodeJS.ProcessEnv): CommandResolution | null;
|
|
12
|
-
/**
|
|
13
|
-
* Resolve command from argv
|
|
14
|
-
*/
|
|
15
|
-
export declare function resolveCommandFromArgv(argv: string[], cwd?: string, env?: NodeJS.ProcessEnv): CommandResolution | null;
|
|
16
|
-
/**
|
|
17
|
-
* Analyze a shell command
|
|
18
|
-
*/
|
|
19
|
-
export declare function analyzeShellCommand(params: {
|
|
20
|
-
command: string;
|
|
21
|
-
cwd?: string;
|
|
22
|
-
env?: NodeJS.ProcessEnv;
|
|
23
|
-
platform?: string | null;
|
|
24
|
-
}): ExecCommandAnalysis;
|
|
25
|
-
/**
|
|
26
|
-
* Normalize safe bins set
|
|
27
|
-
*/
|
|
28
|
-
export declare function normalizeSafeBins(entries?: string[]): Set<string>;
|
|
29
|
-
/**
|
|
30
|
-
* Resolve safe bins with defaults
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveSafeBins(entries?: string[] | null): Set<string>;
|
|
33
|
-
/**
|
|
34
|
-
* Check if command is safe bin usage (no file args)
|
|
35
|
-
*/
|
|
36
|
-
export declare function isSafeBinUsage(params: {
|
|
37
|
-
argv: string[];
|
|
38
|
-
resolution: CommandResolution | null;
|
|
39
|
-
safeBins: Set<string>;
|
|
40
|
-
cwd?: string;
|
|
41
|
-
fileExists?: (filePath: string) => boolean;
|
|
42
|
-
}): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Evaluate command against allowlist
|
|
45
|
-
*/
|
|
46
|
-
export declare function evaluateExecAllowlist(params: {
|
|
47
|
-
analysis: ExecCommandAnalysis;
|
|
48
|
-
allowlist: ExecAllowlistEntry[];
|
|
49
|
-
safeBins: Set<string>;
|
|
50
|
-
cwd?: string;
|
|
51
|
-
skillBins?: Set<string>;
|
|
52
|
-
autoAllowSkills?: boolean;
|
|
53
|
-
}): ExecAllowlistEvaluation;
|
|
54
|
-
/**
|
|
55
|
-
* Evaluate shell command for allowlist (combined analysis + evaluation)
|
|
56
|
-
*/
|
|
57
|
-
export declare function evaluateShellAllowlist(params: {
|
|
58
|
-
command: string;
|
|
59
|
-
allowlist: ExecAllowlistEntry[];
|
|
60
|
-
safeBins: Set<string>;
|
|
61
|
-
cwd?: string;
|
|
62
|
-
env?: NodeJS.ProcessEnv;
|
|
63
|
-
skillBins?: Set<string>;
|
|
64
|
-
autoAllowSkills?: boolean;
|
|
65
|
-
platform?: string | null;
|
|
66
|
-
}): ExecAllowlistAnalysis;
|
|
67
|
-
/**
|
|
68
|
-
* Check if approval is required
|
|
69
|
-
*/
|
|
70
|
-
export declare function requiresExecApproval(params: {
|
|
71
|
-
ask: "off" | "on-miss" | "always";
|
|
72
|
-
security: "deny" | "allowlist" | "full";
|
|
73
|
-
analysisOk: boolean;
|
|
74
|
-
allowlistSatisfied: boolean;
|
|
75
|
-
}): boolean;
|
|
76
|
-
//# sourceMappingURL=analysis.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../approvals/analysis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAmIjB;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,iBAAiB,GAAG,IAAI,CAQ1B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,iBAAiB,GAAG,IAAI,CAQ1B;AA+PD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,mBAAmB,CA6CtB;AA4KD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAMjE;AAED;;GAEG;AACH,wBAAgB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AK,GAAG,SAAS,GAAG,QAAQ,CAAC;IAClC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,GAAG,OAAO,CAOV"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exec Approvals Module
|
|
3
|
-
*
|
|
4
|
-
* Command execution approval system for plugin-shell.
|
|
5
|
-
* Provides allowlist management, command analysis, and approval workflows.
|
|
6
|
-
*/
|
|
7
|
-
export { addAllowlistEntry, ensureApprovals, getApprovalFilePath, getApprovalSocketPath, loadApprovals, matchAllowlist, maxAsk, minSecurity, normalizeApprovals, readApprovalsSnapshot, recordAllowlistUse, resolveApprovals, resolveApprovalsFromFile, saveApprovals, } from "./allowlist";
|
|
8
|
-
export { analyzeShellCommand, evaluateExecAllowlist, evaluateShellAllowlist, isSafeBinUsage, normalizeSafeBins, requiresExecApproval, resolveCommandFromArgv, resolveCommandResolution, resolveSafeBins, } from "./analysis";
|
|
9
|
-
export { type CommandCheckResult, ExecApprovalService } from "./service";
|
|
10
|
-
export type { CommandResolution, ExecAllowlistAnalysis, ExecAllowlistEntry, ExecAllowlistEvaluation, ExecApprovalDecision, ExecApprovalRequest, ExecApprovalResult, ExecApprovalsAgent, ExecApprovalsDefaults, ExecApprovalsFile, ExecApprovalsResolved, ExecApprovalsSnapshot, ExecAsk, ExecCommandAnalysis, ExecCommandSegment, ExecHost, ExecSecurity, } from "./types";
|
|
11
|
-
export { DEFAULT_SAFE_BINS, EXEC_APPROVAL_DEFAULTS } from "./types";
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../approvals/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,EACR,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ExecApprovalService
|
|
3
|
-
*
|
|
4
|
-
* Service for managing command execution approvals in plugin-shell.
|
|
5
|
-
* Integrates with Eliza's ApprovalService for approval UI,
|
|
6
|
-
* and provides allowlist management and command analysis.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* const approvalService = runtime.getService('exec_approval') as ExecApprovalService;
|
|
11
|
-
*
|
|
12
|
-
* // Check if command needs approval
|
|
13
|
-
* const check = await approvalService.checkCommand({
|
|
14
|
-
* command: 'rm -rf /tmp/cache',
|
|
15
|
-
* cwd: '/home/user',
|
|
16
|
-
* roomId: message.roomId,
|
|
17
|
-
* });
|
|
18
|
-
*
|
|
19
|
-
* if (check.requiresApproval) {
|
|
20
|
-
* const result = await approvalService.requestApproval(check.request);
|
|
21
|
-
* if (result.decision === 'deny') {
|
|
22
|
-
* return { error: 'Command denied' };
|
|
23
|
-
* }
|
|
24
|
-
* if (result.decision === 'allow-always') {
|
|
25
|
-
* await approvalService.addToAllowlist(command);
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
import type { IAgentRuntime, UUID } from "@elizaos/core";
|
|
31
|
-
import { Service } from "@elizaos/core";
|
|
32
|
-
import type { ExecAllowlistEntry, ExecApprovalDecision, ExecApprovalRequest, ExecApprovalResult, ExecApprovalsResolved, ExecCommandAnalysis } from "./types";
|
|
33
|
-
/**
|
|
34
|
-
* Command check result
|
|
35
|
-
*/
|
|
36
|
-
export interface CommandCheckResult {
|
|
37
|
-
/** Whether the command can be executed */
|
|
38
|
-
allowed: boolean;
|
|
39
|
-
/** Whether approval is required */
|
|
40
|
-
requiresApproval: boolean;
|
|
41
|
-
/** Reason for denial (if not allowed and no approval needed) */
|
|
42
|
-
reason?: string;
|
|
43
|
-
/** Approval request (if approval required) */
|
|
44
|
-
request?: ExecApprovalRequest;
|
|
45
|
-
/** Command analysis result */
|
|
46
|
-
analysis: ExecCommandAnalysis;
|
|
47
|
-
/** Matching allowlist entries */
|
|
48
|
-
allowlistMatches: ExecAllowlistEntry[];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* ExecApprovalService provides command execution approval management.
|
|
52
|
-
*/
|
|
53
|
-
export declare class ExecApprovalService extends Service {
|
|
54
|
-
static serviceType: string;
|
|
55
|
-
capabilityDescription: string;
|
|
56
|
-
private approvalConfig;
|
|
57
|
-
private safeBins;
|
|
58
|
-
private skillBins;
|
|
59
|
-
constructor(runtime?: IAgentRuntime);
|
|
60
|
-
/**
|
|
61
|
-
* Start the ExecApprovalService
|
|
62
|
-
*/
|
|
63
|
-
static start(runtime: IAgentRuntime): Promise<Service>;
|
|
64
|
-
/**
|
|
65
|
-
* Stop the ExecApprovalService
|
|
66
|
-
*/
|
|
67
|
-
stop(): Promise<void>;
|
|
68
|
-
/**
|
|
69
|
-
* Load/reload configuration
|
|
70
|
-
*/
|
|
71
|
-
loadConfig(agentId?: string): ExecApprovalsResolved;
|
|
72
|
-
/**
|
|
73
|
-
* Get current configuration
|
|
74
|
-
*/
|
|
75
|
-
getConfig(): ExecApprovalsResolved;
|
|
76
|
-
/**
|
|
77
|
-
* Set safe binaries that don't need approval
|
|
78
|
-
*/
|
|
79
|
-
setSafeBins(bins: string[]): void;
|
|
80
|
-
/**
|
|
81
|
-
* Set skill binaries that are auto-allowed
|
|
82
|
-
*/
|
|
83
|
-
setSkillBins(bins: string[]): void;
|
|
84
|
-
/**
|
|
85
|
-
* Check if a command is allowed to execute
|
|
86
|
-
*/
|
|
87
|
-
checkCommand(params: {
|
|
88
|
-
command: string;
|
|
89
|
-
cwd?: string;
|
|
90
|
-
roomId: UUID;
|
|
91
|
-
env?: NodeJS.ProcessEnv;
|
|
92
|
-
agentId?: string;
|
|
93
|
-
}): Promise<CommandCheckResult>;
|
|
94
|
-
/**
|
|
95
|
-
* Request approval for a command
|
|
96
|
-
*/
|
|
97
|
-
requestApproval(request: ExecApprovalRequest): Promise<ExecApprovalResult>;
|
|
98
|
-
/**
|
|
99
|
-
* Request approval asynchronously (fire and forget with callbacks)
|
|
100
|
-
*/
|
|
101
|
-
requestApprovalAsync(request: ExecApprovalRequest, callbacks?: {
|
|
102
|
-
onApproved?: (decision: ExecApprovalDecision) => Promise<void>;
|
|
103
|
-
onDenied?: () => Promise<void>;
|
|
104
|
-
onTimeout?: () => Promise<void>;
|
|
105
|
-
}): Promise<UUID>;
|
|
106
|
-
/**
|
|
107
|
-
* Add a pattern to the allowlist
|
|
108
|
-
* @returns true if pattern was added successfully
|
|
109
|
-
*/
|
|
110
|
-
addToAllowlist(pattern: string, agentId?: string): Promise<boolean>;
|
|
111
|
-
/**
|
|
112
|
-
* Cancel a pending approval
|
|
113
|
-
*/
|
|
114
|
-
cancelApproval(taskId: UUID): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Get all pending exec approvals for a room
|
|
117
|
-
*/
|
|
118
|
-
getPendingApprovals(roomId: UUID): Promise<ExecApprovalRequest[]>;
|
|
119
|
-
}
|
|
120
|
-
export default ExecApprovalService;
|
|
121
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../approvals/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAQ,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAgC,OAAO,EAAE,MAAM,eAAe,CAAC;AAyBtE,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EAErB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,8BAA8B;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,iCAAiC;IACjC,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO;IAC9C,MAAM,CAAC,WAAW,SAAmB;IACrC,qBAAqB,SACwD;IAE7E,OAAO,CAAC,cAAc,CAAsC;IAC5D,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,SAAS,CAAc;gBAEnB,OAAO,CAAC,EAAE,aAAa;IAMnC;;OAEG;WAC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;;OAEG;IACG,mBAAmB,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAyCxE;AAgBD,eAAe,mBAAmB,CAAC"}
|
|
@@ -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;IACpC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,sCAAsC;IACtC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6CAA6C;IAC7C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,iCAAiC;IACjC,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;IACvC,8BAA8B;IAC9B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,eAAe;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,MAAM,EAAE,IAAI,CAAC;IACb,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,iCAAiC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,4EAUpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB;uBACb,YAAY;kBACd,OAAO;0BACF,YAAY;;;CAG3B,CAAC"}
|
package/dist/auto-enable.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-enable.d.ts","sourceRoot":"","sources":["../auto-enable.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAW7D,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAElE"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper functions to lookup action/provider 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 and regenerate.
|
|
7
|
-
*/
|
|
8
|
-
import { type ActionDoc, 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
|
-
export type { ActionDoc, ProviderDoc };
|
|
36
|
-
//# 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,EACL,KAAK,SAAS,EAKd,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAUjB;;;;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;AAGD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated canonical action/provider docs for plugin-shell.
|
|
3
|
-
* DO NOT EDIT - Generated from prompts/specs/**.
|
|
4
|
-
*/
|
|
5
|
-
export type ActionDoc = {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
descriptionCompressed?: string;
|
|
9
|
-
similes?: readonly string[];
|
|
10
|
-
parameters?: readonly unknown[];
|
|
11
|
-
examples?: readonly (readonly unknown[])[];
|
|
12
|
-
};
|
|
13
|
-
export type ProviderDoc = {
|
|
14
|
-
name: string;
|
|
15
|
-
description: string;
|
|
16
|
-
descriptionCompressed?: string;
|
|
17
|
-
position?: number;
|
|
18
|
-
dynamic?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export declare const coreActionsSpec: {
|
|
21
|
-
readonly version: "1.0.0";
|
|
22
|
-
readonly actions: readonly [{
|
|
23
|
-
readonly name: "CLEAR_SHELL_HISTORY";
|
|
24
|
-
readonly description: "Clears the recorded history of shell commands for the current conversation";
|
|
25
|
-
readonly similes: readonly ["RESET_SHELL", "CLEAR_TERMINAL", "CLEAR_HISTORY", "RESET_HISTORY"];
|
|
26
|
-
readonly parameters: readonly [];
|
|
27
|
-
}];
|
|
28
|
-
};
|
|
29
|
-
export declare const allActionsSpec: {
|
|
30
|
-
readonly version: "1.0.0";
|
|
31
|
-
readonly actions: readonly [{
|
|
32
|
-
readonly name: "CLEAR_SHELL_HISTORY";
|
|
33
|
-
readonly description: "Clears the recorded history of shell commands for the current conversation";
|
|
34
|
-
readonly similes: readonly ["RESET_SHELL", "CLEAR_TERMINAL", "CLEAR_HISTORY", "RESET_HISTORY"];
|
|
35
|
-
readonly parameters: readonly [];
|
|
36
|
-
}];
|
|
37
|
-
};
|
|
38
|
-
export declare const coreProvidersSpec: {
|
|
39
|
-
readonly version: "1.0.0";
|
|
40
|
-
readonly providers: readonly [{
|
|
41
|
-
readonly name: "SHELL_HISTORY";
|
|
42
|
-
readonly description: "Provides recent shell command history, current working directory, and file operations within the restricted environment";
|
|
43
|
-
readonly dynamic: true;
|
|
44
|
-
}];
|
|
45
|
-
};
|
|
46
|
-
export declare const allProvidersSpec: {
|
|
47
|
-
readonly version: "1.0.0";
|
|
48
|
-
readonly providers: readonly [{
|
|
49
|
-
readonly name: "SHELL_HISTORY";
|
|
50
|
-
readonly description: "Provides recent shell command history, current working directory, and file operations within the restricted environment";
|
|
51
|
-
readonly dynamic: true;
|
|
52
|
-
}];
|
|
53
|
-
};
|
|
54
|
-
export declare const coreActionDocs: readonly ActionDoc[];
|
|
55
|
-
export declare const allActionDocs: readonly ActionDoc[];
|
|
56
|
-
export declare const coreProviderDocs: readonly ProviderDoc[];
|
|
57
|
-
export declare const allProviderDocs: readonly ProviderDoc[];
|
|
58
|
-
//# 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;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,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;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;CAUlB,CAAC;AACX,eAAO,MAAM,cAAc;;;;;;;;CAUjB,CAAC;AACX,eAAO,MAAM,iBAAiB;;;;;;;CAUpB,CAAC;AACX,eAAO,MAAM,gBAAgB;;;;;;;CAUnB,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,EAAgC,CAAC;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAA+B,CAAC"}
|
package/dist/index.browser.d.ts
DELETED
|
@@ -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,MAMzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +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 { shellHistoryProvider } from "./providers/shellHistoryProvider";
|
|
7
|
-
export { addSession, appendOutput, clearFinished, createSessionSlug, deleteSession, drainSession, getFinishedSession, getSession, listFinishedSessions, listRunningSessions, markBackgrounded, markExited, resetProcessRegistryForTests, setJobTtlMs, tail, trimWithCap, } from "./services/processRegistry";
|
|
8
|
-
export { ShellService } from "./services/shellService";
|
|
9
|
-
export type { CommandHistoryEntry, CommandResult, ExecResult, ExecuteOptions, FileOperation, FileOperationType, FinishedSession, ProcessAction, ProcessActionParams, ProcessSession, ProcessStatus, PtyExitEvent, PtyHandle, PtyListener, PtySpawn, SessionStdin, ShellConfig, } from "./types";
|
|
10
|
-
export { DEFAULT_FORBIDDEN_COMMANDS, extractBaseCommand, isForbiddenCommand, isSafeCommand, loadShellConfig, validatePath, } from "./utils";
|
|
11
|
-
export { BRACKETED_PASTE_END, BRACKETED_PASTE_START, buildCursorPositionResponse, encodeKeySequence, encodePaste, type KeyEncodingRequest, type KeyEncodingResult, stripDsrRequests, } from "./utils/ptyKeys";
|
|
12
|
-
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";
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -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;AAM5C,eAAO,MAAM,WAAW,EAAE,MAgBzB,CAAC;AAEF,eAAe,WAAW,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,EACN,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