network-ai 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Agent Runtime — Sandboxed execution environment for AI agents
3
+ *
4
+ * Provides controlled access to shell commands, file system, and system
5
+ * resources with policy enforcement, approval gates, and audit logging.
6
+ *
7
+ * Components:
8
+ * - SandboxPolicy — defines what agents are allowed to do
9
+ * - ShellExecutor — spawns child processes within policy constraints
10
+ * - FileAccessor — scoped file read/write with traversal protection
11
+ * - ApprovalGate — human-in-the-loop approval for sensitive operations
12
+ * - AgentRuntime — unified facade combining all components
13
+ *
14
+ * @module AgentRuntime
15
+ * @version 1.0.0
16
+ */
17
+ import { EventEmitter } from 'events';
18
+ /** Result of a shell command execution */
19
+ export interface ShellResult {
20
+ /** Exit code (0 = success) */
21
+ exitCode: number;
22
+ /** Standard output */
23
+ stdout: string;
24
+ /** Standard error output */
25
+ stderr: string;
26
+ /** Execution time in milliseconds */
27
+ durationMs: number;
28
+ /** Whether the command was terminated due to timeout */
29
+ timedOut: boolean;
30
+ /** Whether the command was killed due to output limit */
31
+ truncated: boolean;
32
+ }
33
+ /** Options for shell execution */
34
+ export interface ShellOptions {
35
+ /** Working directory (defaults to policy basePath) */
36
+ cwd?: string;
37
+ /** Environment variables to merge with process.env */
38
+ env?: Record<string, string>;
39
+ /** Command timeout in milliseconds (default: 30000) */
40
+ timeoutMs?: number;
41
+ /** Maximum output bytes (default: 1048576 = 1MB) */
42
+ maxOutputBytes?: number;
43
+ /** Whether this command requires human approval (auto-detected from policy if not set) */
44
+ requiresApproval?: boolean;
45
+ /** Agent ID requesting execution */
46
+ agentId?: string;
47
+ }
48
+ /** File operation result */
49
+ export interface FileResult {
50
+ success: boolean;
51
+ path: string;
52
+ content?: string;
53
+ entries?: string[];
54
+ error?: string;
55
+ durationMs: number;
56
+ }
57
+ /** Sandbox policy configuration */
58
+ export interface SandboxPolicyConfig {
59
+ /** Base directory agents are scoped to */
60
+ basePath: string;
61
+ /** Allowed command patterns (globs). Empty = deny all. */
62
+ allowedCommands: string[];
63
+ /** Blocked command patterns (override allowed). Always enforced. */
64
+ blockedCommands: string[];
65
+ /** Allowed directory paths for file access (relative to basePath) */
66
+ allowedPaths: string[];
67
+ /** Blocked directory paths (override allowed) */
68
+ blockedPaths: string[];
69
+ /** Maximum concurrent processes (default: 5) */
70
+ maxConcurrentProcesses: number;
71
+ /** Default command timeout in ms (default: 30000) */
72
+ defaultTimeoutMs: number;
73
+ /** Default max output bytes (default: 1MB) */
74
+ defaultMaxOutputBytes: number;
75
+ /** Commands that always require approval (patterns) */
76
+ approvalRequired: string[];
77
+ /** Whether read-only file operations auto-approve (default: true) */
78
+ autoApproveReads: boolean;
79
+ }
80
+ /** Approval request passed to the approval callback */
81
+ export interface ApprovalRequest {
82
+ /** Type of operation */
83
+ type: 'shell' | 'file_write' | 'file_read' | 'file_list';
84
+ /** The command or path being requested */
85
+ target: string;
86
+ /** Agent ID making the request */
87
+ agentId: string;
88
+ /** Why the agent needs this */
89
+ justification?: string;
90
+ /** Risk assessment */
91
+ risk: 'low' | 'medium' | 'high';
92
+ /** Timestamp of request */
93
+ timestamp: number;
94
+ }
95
+ /** Approval decision from the human/callback */
96
+ export interface ApprovalDecision {
97
+ approved: boolean;
98
+ approvedBy?: string;
99
+ reason?: string;
100
+ }
101
+ /** Callback function for approval decisions */
102
+ export type ApprovalCallback = (request: ApprovalRequest) => Promise<ApprovalDecision>;
103
+ /** Audit entry for runtime operations */
104
+ export interface RuntimeAuditEntry {
105
+ timestamp: string;
106
+ action: 'shell_execute' | 'file_read' | 'file_write' | 'file_list' | 'approval_requested' | 'approval_granted' | 'approval_denied' | 'policy_violation';
107
+ agentId: string;
108
+ target: string;
109
+ result: 'success' | 'denied' | 'error' | 'timeout' | 'blocked';
110
+ details?: Record<string, unknown>;
111
+ durationMs?: number;
112
+ }
113
+ /** Events emitted by AgentRuntime */
114
+ export interface RuntimeEvents {
115
+ 'approval:requested': (request: ApprovalRequest) => void;
116
+ 'approval:decided': (request: ApprovalRequest, decision: ApprovalDecision) => void;
117
+ 'command:start': (agentId: string, command: string) => void;
118
+ 'command:complete': (agentId: string, command: string, result: ShellResult) => void;
119
+ 'file:access': (agentId: string, path: string, mode: 'read' | 'write' | 'list') => void;
120
+ 'policy:violation': (agentId: string, target: string, reason: string) => void;
121
+ 'audit': (entry: RuntimeAuditEntry) => void;
122
+ }
123
+ /** Options for creating an AgentRuntime */
124
+ export interface AgentRuntimeOptions {
125
+ policy: Partial<SandboxPolicyConfig> & {
126
+ basePath: string;
127
+ };
128
+ onApproval?: ApprovalCallback;
129
+ autoApproveAll?: boolean;
130
+ }
131
+ /**
132
+ * Sandbox policy engine — determines what agents are allowed to do.
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * const policy = new SandboxPolicy({
137
+ * basePath: '/project',
138
+ * allowedCommands: ['npm *', 'node *', 'git status'],
139
+ * });
140
+ * policy.isCommandAllowed('npm test'); // true
141
+ * policy.isCommandAllowed('rm -rf /'); // false
142
+ * ```
143
+ */
144
+ export declare class SandboxPolicy {
145
+ private readonly config;
146
+ constructor(config: Partial<SandboxPolicyConfig> & {
147
+ basePath: string;
148
+ });
149
+ /** Check if a command matches the policy's allowed list and isn't blocked */
150
+ isCommandAllowed(command: string): boolean;
151
+ /** Check if a command requires human approval */
152
+ requiresApproval(command: string): boolean;
153
+ /** Assess risk level of a command */
154
+ assessRisk(command: string): 'low' | 'medium' | 'high';
155
+ /** Validate that a file path is within allowed scope */
156
+ isPathAllowed(filePath: string): boolean;
157
+ /** Resolve and validate a path against basePath (returns null if traversal detected) */
158
+ resolvePath(filePath: string): string | null;
159
+ /** Get a copy of the current policy config */
160
+ getConfig(): Readonly<SandboxPolicyConfig>;
161
+ /** Update allowed commands */
162
+ allowCommand(pattern: string): void;
163
+ /** Remove an allowed command pattern */
164
+ disallowCommand(pattern: string): void;
165
+ /** Update allowed paths */
166
+ allowPath(path: string): void;
167
+ /** Block a path */
168
+ blockPath(path: string): void;
169
+ get basePath(): string;
170
+ get maxConcurrentProcesses(): number;
171
+ get defaultTimeoutMs(): number;
172
+ get defaultMaxOutputBytes(): number;
173
+ get autoApproveReads(): boolean;
174
+ /** Simple glob matching: supports * as wildcard */
175
+ private matchesAny;
176
+ /** Match a simple glob pattern against a string */
177
+ private globMatch;
178
+ }
179
+ /**
180
+ * Sandboxed shell command executor with timeout, output limits, and
181
+ * concurrent process tracking.
182
+ *
183
+ * @example
184
+ * ```typescript
185
+ * const executor = new ShellExecutor(policy);
186
+ * const result = await executor.execute('npm test', { agentId: 'tester' });
187
+ * console.log(result.exitCode, result.stdout);
188
+ * ```
189
+ */
190
+ export declare class ShellExecutor {
191
+ private readonly policy;
192
+ private activeProcesses;
193
+ constructor(policy: SandboxPolicy);
194
+ /** Execute a shell command within policy constraints */
195
+ execute(command: string, opts?: ShellOptions): Promise<ShellResult>;
196
+ /** Get the number of currently running processes */
197
+ get running(): number;
198
+ private spawnCommand;
199
+ }
200
+ /**
201
+ * Policy-scoped file system accessor. All paths are validated against
202
+ * the sandbox policy before any I/O.
203
+ *
204
+ * @example
205
+ * ```typescript
206
+ * const files = new FileAccessor(policy);
207
+ * const result = await files.read('src/index.ts', 'reader-agent');
208
+ * ```
209
+ */
210
+ export declare class FileAccessor {
211
+ private readonly policy;
212
+ constructor(policy: SandboxPolicy);
213
+ /** Read a file within the sandbox scope */
214
+ read(filePath: string, agentId: string): Promise<FileResult>;
215
+ /** Write a file within the sandbox scope */
216
+ write(filePath: string, content: string, agentId: string): Promise<FileResult>;
217
+ /** List directory contents within the sandbox scope */
218
+ list(dirPath: string, agentId: string): Promise<FileResult>;
219
+ }
220
+ /**
221
+ * Human-in-the-loop approval gate. Queues requests and waits for
222
+ * a decision from the configured callback.
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * const gate = new ApprovalGate(async (req) => {
227
+ * return { approved: true, approvedBy: 'operator' };
228
+ * });
229
+ * const decision = await gate.request({ type: 'shell', target: 'npm publish', ... });
230
+ * ```
231
+ */
232
+ export declare class ApprovalGate extends EventEmitter {
233
+ private readonly callback;
234
+ private readonly autoApproveAll;
235
+ private readonly history;
236
+ constructor(callback?: ApprovalCallback, autoApproveAll?: boolean);
237
+ /** Request approval for an operation */
238
+ request(req: ApprovalRequest): Promise<ApprovalDecision>;
239
+ /** Get approval history */
240
+ getHistory(): ReadonlyArray<{
241
+ request: ApprovalRequest;
242
+ decision: ApprovalDecision;
243
+ }>;
244
+ /** Get count of approvals/denials */
245
+ getStats(): {
246
+ total: number;
247
+ approved: number;
248
+ denied: number;
249
+ };
250
+ }
251
+ /**
252
+ * Unified agent execution runtime. Combines policy, shell, file access,
253
+ * and approval into a single interface for agent consumption.
254
+ *
255
+ * @example
256
+ * ```typescript
257
+ * const runtime = new AgentRuntime({
258
+ * policy: {
259
+ * basePath: '/project',
260
+ * allowedCommands: ['npm *', 'node *', 'git status', 'git diff'],
261
+ * },
262
+ * onApproval: async (req) => {
263
+ * console.log(`Approve? ${req.type}: ${req.target}`);
264
+ * return { approved: true, approvedBy: 'operator' };
265
+ * },
266
+ * });
267
+ *
268
+ * const result = await runtime.exec('npm test', 'tester-agent');
269
+ * ```
270
+ */
271
+ export declare class AgentRuntime extends EventEmitter {
272
+ readonly policy: SandboxPolicy;
273
+ readonly shell: ShellExecutor;
274
+ readonly files: FileAccessor;
275
+ readonly gate: ApprovalGate;
276
+ private auditLog;
277
+ constructor(opts: AgentRuntimeOptions);
278
+ /**
279
+ * Execute a shell command with policy + approval checks.
280
+ * Returns ShellResult on success, throws on policy violation.
281
+ */
282
+ exec(command: string, agentId: string, opts?: ShellOptions): Promise<ShellResult>;
283
+ /** Read a file with policy + optional approval */
284
+ readFile(filePath: string, agentId: string): Promise<FileResult>;
285
+ /** Write a file with policy + approval */
286
+ writeFile(filePath: string, content: string, agentId: string): Promise<FileResult>;
287
+ /** List a directory with policy check */
288
+ listDir(dirPath: string, agentId: string): Promise<FileResult>;
289
+ /** Get the internal audit log */
290
+ getAuditLog(): ReadonlyArray<RuntimeAuditEntry>;
291
+ /** Clear the internal audit log */
292
+ clearAuditLog(): void;
293
+ private audit;
294
+ }
295
+ /** Thrown when an operation violates the sandbox policy */
296
+ export declare class RuntimePolicyError extends Error {
297
+ readonly code = "POLICY_VIOLATION";
298
+ constructor(message: string);
299
+ }
300
+ /** Thrown when an operation is denied by the approval gate */
301
+ export declare class RuntimeApprovalError extends Error {
302
+ readonly code = "APPROVAL_DENIED";
303
+ constructor(message: string);
304
+ }
305
+ /** Thrown when a command fails to spawn */
306
+ export declare class RuntimeExecutionError extends Error {
307
+ readonly code = "EXECUTION_ERROR";
308
+ constructor(message: string);
309
+ }
310
+ //# sourceMappingURL=agent-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../../lib/agent-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtC,0CAA0C;AAC1C,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,cAAc,CAAC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