devworkspace 0.5.0 → 0.5.1
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/CHANGELOG.md +16 -0
- package/dist/intelligence/orchestration/engine.d.ts +9 -0
- package/dist/intelligence/orchestration/engine.js +190 -30
- package/dist/intelligence/orchestration/engine.js.map +1 -1
- package/dist/intelligence/orchestration/types.d.ts +13 -2
- package/dist/intelligence/orchestration/types.js +2 -2
- package/dist/intelligence/orchestration/types.js.map +1 -1
- package/dist/intelligence/runtime/adk/adapter.js +21 -32
- package/dist/intelligence/runtime/adk/adapter.js.map +1 -1
- package/dist/intelligence/runtime/boundary.d.ts +30 -0
- package/dist/intelligence/runtime/boundary.js +163 -0
- package/dist/intelligence/runtime/boundary.js.map +1 -0
- package/dist/intelligence/runtime/external.js +32 -58
- package/dist/intelligence/runtime/external.js.map +1 -1
- package/dist/intelligence/runtime/native.js +23 -55
- package/dist/intelligence/runtime/native.js.map +1 -1
- package/dist/intelligence/runtime/types.d.ts +29 -1
- package/dist/intelligence/runtime/types.js +11 -1
- package/dist/intelligence/runtime/types.js.map +1 -1
- package/dist/intelligence/verification/engine.d.ts +21 -7
- package/dist/intelligence/verification/engine.js +78 -17
- package/dist/intelligence/verification/engine.js.map +1 -1
- package/dist/intelligence/verification/types.d.ts +11 -0
- package/dist/intelligence/verification/types.js.map +1 -1
- package/dist/standards/distribution/cache.d.ts +1 -0
- package/dist/standards/distribution/cache.js +199 -185
- package/dist/standards/distribution/cache.js.map +1 -1
- package/dist/standards/distribution/package.js +6 -0
- package/dist/standards/distribution/package.js.map +1 -1
- package/dist/standards/distribution/sync.d.ts +7 -2
- package/dist/standards/distribution/sync.js +41 -8
- package/dist/standards/distribution/sync.js.map +1 -1
- package/dist/utils/proc.d.ts +4 -0
- package/dist/utils/proc.js +58 -4
- package/dist/utils/proc.js.map +1 -1
- package/docs/agents.md +15 -0
- package/docs/contributing.md +4 -5
- package/docs/mcp.md +13 -0
- package/docs/security.md +8 -2
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { detectGoogleAdk } from './detector.js';
|
|
2
|
+
import { executeBoundedCommand, nonExecutedResponse } from '../boundary.js';
|
|
2
3
|
export class GoogleAdkAdapter {
|
|
3
4
|
id = 'google-adk';
|
|
4
5
|
name = 'Google Agent Development Kit (ADK) Adapter';
|
|
@@ -11,50 +12,38 @@ export class GoogleAdkAdapter {
|
|
|
11
12
|
version: detection.version,
|
|
12
13
|
supportsStreaming: true,
|
|
13
14
|
supportsNativeSubagents: true,
|
|
15
|
+
sandboxed: false,
|
|
16
|
+
sandboxCapability: 'unavailable-cwd-only',
|
|
14
17
|
reason: available ? undefined : detection.reason,
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
async execute(request) {
|
|
18
21
|
if (request.isPlaceholder) {
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
return nonExecutedResponse('FAILED', {
|
|
23
|
+
executionKind: 'none',
|
|
24
|
+
reason: 'Placeholder runtime cannot return a successful execution.',
|
|
22
25
|
error: 'Placeholder runtime cannot return a successful execution.',
|
|
23
|
-
durationMs: 0,
|
|
24
|
-
filesModified: [],
|
|
25
26
|
isPlaceholder: true,
|
|
26
|
-
};
|
|
27
|
+
});
|
|
27
28
|
}
|
|
28
29
|
const avail = await this.checkAvailability();
|
|
29
30
|
if (!avail.available) {
|
|
30
|
-
return {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
31
|
+
return nonExecutedResponse('BLOCKED', {
|
|
32
|
+
executionKind: 'none',
|
|
33
|
+
reason: avail.reason || 'Google ADK runtime is unavailable.',
|
|
34
|
+
remediation: 'Install "@google/adk" and configure GEMINI_API_KEY or GOOGLE_API_KEY.',
|
|
35
|
+
cwd: request.cwd,
|
|
36
|
+
});
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// Dynamic invocation of ADK if installed
|
|
41
|
-
return {
|
|
42
|
-
ok: true,
|
|
43
|
-
output: `[Google ADK] Dispatched task for ${request.role} through ADK workflow agent.`,
|
|
44
|
-
durationMs: Date.now() - start,
|
|
45
|
-
tokensUsed: 2500,
|
|
46
|
-
filesModified: [],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
return {
|
|
51
|
-
ok: false,
|
|
52
|
-
output: '',
|
|
53
|
-
error: `Google ADK execution failure: ${err.message}`,
|
|
54
|
-
durationMs: Date.now() - start,
|
|
55
|
-
filesModified: [],
|
|
56
|
-
};
|
|
38
|
+
if (request.command && request.command.length > 0) {
|
|
39
|
+
return executeBoundedCommand(request, request.command, 'agent', 60_000, true);
|
|
57
40
|
}
|
|
41
|
+
return nonExecutedResponse('UNSUPPORTED', {
|
|
42
|
+
executionKind: 'none',
|
|
43
|
+
reason: 'Google ADK local programmatic workflow invocation is not implemented without an explicit runner command.',
|
|
44
|
+
remediation: 'Provide an explicit executable command or run ADK externally and pass artifacts to IndependentVerificationEngine.',
|
|
45
|
+
cwd: request.cwd,
|
|
46
|
+
});
|
|
58
47
|
}
|
|
59
48
|
}
|
|
60
49
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../src/intelligence/runtime/adk/adapter.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../src/intelligence/runtime/adk/adapter.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,MAAM,OAAO,gBAAgB;IAClB,EAAE,GAAG,YAAY,CAAC;IAClB,IAAI,GAAG,4CAA4C,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CAAC;QAED,OAAO,mBAAmB,CAAC,aAAa,EAAE;YACxC,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,0GAA0G;YAClH,WAAW,EAAE,mHAAmH;YAChI,GAAG,EAAE,OAAO,CAAC,GAAG;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type {\n AgentExecutionRequest,\n AgentExecutionResponse,\n AgentRuntimeAdapter,\n RuntimeAvailability,\n} from '../types.js';\nimport { detectGoogleAdk } from './detector.js';\nimport { executeBoundedCommand, nonExecutedResponse } from '../boundary.js';\n\nexport class GoogleAdkAdapter implements AgentRuntimeAdapter {\n readonly id = 'google-adk';\n readonly name = 'Google Agent Development Kit (ADK) Adapter';\n\n async checkAvailability(): Promise<RuntimeAvailability> {\n const detection = await detectGoogleAdk();\n const available = detection.isInstalled && detection.hasCredentials;\n\n return {\n available,\n provider: 'google-adk',\n version: detection.version,\n supportsStreaming: true,\n supportsNativeSubagents: true,\n sandboxed: false,\n sandboxCapability: 'unavailable-cwd-only',\n reason: available ? undefined : detection.reason,\n };\n }\n\n async execute(request: AgentExecutionRequest): Promise<AgentExecutionResponse> {\n if (request.isPlaceholder) {\n return nonExecutedResponse('FAILED', {\n executionKind: 'none',\n reason: 'Placeholder runtime cannot return a successful execution.',\n error: 'Placeholder runtime cannot return a successful execution.',\n isPlaceholder: true,\n });\n }\n\n const avail = await this.checkAvailability();\n if (!avail.available) {\n return nonExecutedResponse('BLOCKED', {\n executionKind: 'none',\n reason: avail.reason || 'Google ADK runtime is unavailable.',\n remediation: 'Install \"@google/adk\" and configure GEMINI_API_KEY or GOOGLE_API_KEY.',\n cwd: request.cwd,\n });\n }\n\n if (request.command && request.command.length > 0) {\n return executeBoundedCommand(request, request.command, 'agent', 60_000, true);\n }\n\n return nonExecutedResponse('UNSUPPORTED', {\n executionKind: 'none',\n reason: 'Google ADK local programmatic workflow invocation is not implemented without an explicit runner command.',\n remediation: 'Provide an explicit executable command or run ADK externally and pass artifacts to IndependentVerificationEngine.',\n cwd: request.cwd,\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentExecutionRequest, AgentExecutionResponse, ExecutionKind, RuntimeExecutionStatus } from './types.js';
|
|
2
|
+
export declare const MAX_RUNTIME_OUTPUT_CHARS = 50000;
|
|
3
|
+
export declare function createExecutionId(prefix?: string): string;
|
|
4
|
+
export declare function nonExecutedResponse(status: Extract<RuntimeExecutionStatus, 'PREPARED' | 'BLOCKED' | 'NOT_EXECUTED' | 'UNSUPPORTED' | 'FAILED'>, opts: {
|
|
5
|
+
executionKind: ExecutionKind;
|
|
6
|
+
output?: string;
|
|
7
|
+
reason: string;
|
|
8
|
+
remediation?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
isPlaceholder?: boolean;
|
|
12
|
+
durationMs?: number;
|
|
13
|
+
}): AgentExecutionResponse;
|
|
14
|
+
/** Validate working directory containment and symlink safety when workspaceRoot is supplied. */
|
|
15
|
+
export declare function validateExecutionCwd(cwd: string | undefined, workspaceRoot?: string): Promise<{
|
|
16
|
+
ok: true;
|
|
17
|
+
cwd?: string;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
reason: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** Enforce concrete command policy immediately before spawn (binary, shell avoidance, destructive ops). */
|
|
23
|
+
export declare function validateConcreteCommand(cmdArgs: string[], workspaceRoot: string, explicitApproval?: boolean): {
|
|
24
|
+
ok: true;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
reason: string;
|
|
28
|
+
};
|
|
29
|
+
/** Execute a concrete validated command with minimal env, bounded redacted output, and tree cleanup. */
|
|
30
|
+
export declare function executeBoundedCommand(request: AgentExecutionRequest, cmdArgs: string[], executionKind: Extract<ExecutionKind, 'command' | 'agent'>, defaultTimeoutMs: number, untrustedOutput?: boolean): Promise<AgentExecutionResponse>;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { createMinimalExecutionEnv, run } from '../../utils/proc.js';
|
|
5
|
+
import { assertNoSymlinkEscape, isInside } from '../../utils/paths.js';
|
|
6
|
+
import { redact } from '../../security/redact.js';
|
|
7
|
+
import { SecurityPolicyEvaluator } from '../security/policy.js';
|
|
8
|
+
export const MAX_RUNTIME_OUTPUT_CHARS = 50_000;
|
|
9
|
+
const SHELL_BINARIES = new Set(['sh', 'bash', 'zsh', 'dash', 'cmd', 'cmd.exe', 'powershell', 'powershell.exe', 'pwsh', 'pwsh.exe']);
|
|
10
|
+
const DESTRUCTIVE_EXEC_RE = /\b(?:rm\s+-[a-zA-Z]*[rf][a-zA-Z]*|mkfs|format\s+[a-zA-Z]:|shutdown|reboot|dd\s+if=|del\s+\/[sq])\b/i;
|
|
11
|
+
export function createExecutionId(prefix = 'exec') {
|
|
12
|
+
return `${prefix}-${Date.now().toString(36)}-${crypto.randomBytes(4).toString('hex')}`;
|
|
13
|
+
}
|
|
14
|
+
export function nonExecutedResponse(status, opts) {
|
|
15
|
+
const safeReason = redact(opts.reason);
|
|
16
|
+
const safeOutput = redact(opts.output ?? '');
|
|
17
|
+
return {
|
|
18
|
+
ok: false,
|
|
19
|
+
status,
|
|
20
|
+
executionKind: opts.executionKind,
|
|
21
|
+
executionId: createExecutionId(),
|
|
22
|
+
verificationStatus: 'NOT_TESTED',
|
|
23
|
+
output: safeOutput,
|
|
24
|
+
error: opts.error ? redact(opts.error) : status === 'FAILED' || status === 'BLOCKED' ? safeReason : undefined,
|
|
25
|
+
reason: safeReason,
|
|
26
|
+
remediation: opts.remediation,
|
|
27
|
+
cwd: opts.cwd,
|
|
28
|
+
durationMs: opts.durationMs ?? 0,
|
|
29
|
+
filesModified: [],
|
|
30
|
+
isPlaceholder: opts.isPlaceholder,
|
|
31
|
+
sandboxed: false,
|
|
32
|
+
sandboxCapability: 'unavailable-cwd-only',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Validate working directory containment and symlink safety when workspaceRoot is supplied. */
|
|
36
|
+
export async function validateExecutionCwd(cwd, workspaceRoot) {
|
|
37
|
+
if (!cwd)
|
|
38
|
+
return { ok: true, cwd: undefined };
|
|
39
|
+
const resolvedCwd = path.resolve(cwd);
|
|
40
|
+
try {
|
|
41
|
+
const st = await fs.stat(resolvedCwd);
|
|
42
|
+
if (!st.isDirectory())
|
|
43
|
+
return { ok: false, reason: `Working directory is not a directory: "${cwd}".` };
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return { ok: false, reason: `Working directory does not exist: "${cwd}".` };
|
|
47
|
+
}
|
|
48
|
+
if (workspaceRoot) {
|
|
49
|
+
const resolvedRoot = path.resolve(workspaceRoot);
|
|
50
|
+
if (!isInside(resolvedRoot, resolvedCwd)) {
|
|
51
|
+
return { ok: false, reason: `Working directory "${cwd}" escapes workspace root.` };
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
await assertNoSymlinkEscape(resolvedRoot, resolvedCwd);
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
return { ok: false, reason: e.message };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { ok: true, cwd: resolvedCwd };
|
|
61
|
+
}
|
|
62
|
+
/** Enforce concrete command policy immediately before spawn (binary, shell avoidance, destructive ops). */
|
|
63
|
+
export function validateConcreteCommand(cmdArgs, workspaceRoot, explicitApproval = false) {
|
|
64
|
+
const binary = cmdArgs[0];
|
|
65
|
+
if (!binary || !binary.trim()) {
|
|
66
|
+
return { ok: false, reason: 'Empty executable command cannot be invoked.' };
|
|
67
|
+
}
|
|
68
|
+
const base = path.basename(binary).toLowerCase();
|
|
69
|
+
if (SHELL_BINARIES.has(base)) {
|
|
70
|
+
return { ok: false, reason: `Direct shell invocation "${base}" is disallowed; pass an executable with argument array instead.` };
|
|
71
|
+
}
|
|
72
|
+
if (cmdArgs.some((arg) => arg.includes('\0'))) {
|
|
73
|
+
return { ok: false, reason: 'Command arguments contain NUL byte.' };
|
|
74
|
+
}
|
|
75
|
+
if (!explicitApproval) {
|
|
76
|
+
// Only check executable + flag patterns outside quoted payload arguments for shell binaries; block direct destructive commands.
|
|
77
|
+
const headAndFlags = `${base} ${cmdArgs.slice(1).filter((a) => !a.includes(' ')).join(' ')}`;
|
|
78
|
+
if (DESTRUCTIVE_EXEC_RE.test(headAndFlags)) {
|
|
79
|
+
return { ok: false, reason: `Destructive command "${base}" requires explicit developer approval before execution.` };
|
|
80
|
+
}
|
|
81
|
+
const evaluator = new SecurityPolicyEvaluator(workspaceRoot);
|
|
82
|
+
// If invoking an explicit script/command inside an allowlisted tool (node/npm/npx/git) check evaluator on binary; block arbitrary shells/installers.
|
|
83
|
+
const basePolicy = evaluator.checkCommandExec(base);
|
|
84
|
+
const allowedRuntimeBins = new Set(['node', 'node.exe', 'npm', 'npx', 'git', 'vitest', 'tsc', 'claude', 'codex', 'cursor']);
|
|
85
|
+
if (!basePolicy.allowed && !allowedRuntimeBins.has(base) && !path.isAbsolute(binary)) {
|
|
86
|
+
return { ok: false, reason: basePolicy.reason ?? `Executable "${base}" is not permitted by execution policy.` };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { ok: true };
|
|
90
|
+
}
|
|
91
|
+
/** Execute a concrete validated command with minimal env, bounded redacted output, and tree cleanup. */
|
|
92
|
+
export async function executeBoundedCommand(request, cmdArgs, executionKind, defaultTimeoutMs, untrustedOutput = false) {
|
|
93
|
+
const executionId = createExecutionId(executionKind);
|
|
94
|
+
const startMs = Date.now();
|
|
95
|
+
const startedAt = new Date(startMs).toISOString();
|
|
96
|
+
const targetCwd = request.sandboxPath ?? request.cwd;
|
|
97
|
+
const cwdCheck = await validateExecutionCwd(targetCwd, request.workspaceRoot);
|
|
98
|
+
if (!cwdCheck.ok) {
|
|
99
|
+
return nonExecutedResponse('BLOCKED', {
|
|
100
|
+
executionKind: 'none',
|
|
101
|
+
reason: cwdCheck.reason,
|
|
102
|
+
remediation: 'Provide an existing working directory inside the workspace root.',
|
|
103
|
+
cwd: targetCwd,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const cmdCheck = validateConcreteCommand(cmdArgs, request.workspaceRoot ?? targetCwd ?? process.cwd(), request.explicitApproval);
|
|
107
|
+
if (!cmdCheck.ok) {
|
|
108
|
+
return nonExecutedResponse('BLOCKED', {
|
|
109
|
+
executionKind: 'none',
|
|
110
|
+
reason: cmdCheck.reason,
|
|
111
|
+
remediation: 'Approve destructive operations explicitly or use an allowlisted non-shell executable.',
|
|
112
|
+
cwd: cwdCheck.cwd,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const safeEnv = createMinimalExecutionEnv(process.env, request.allowlistedEnvKeys, request.env);
|
|
116
|
+
const res = await run(cmdArgs[0], cmdArgs.slice(1), {
|
|
117
|
+
cwd: cwdCheck.cwd,
|
|
118
|
+
timeoutMs: request.timeoutMs ?? defaultTimeoutMs,
|
|
119
|
+
signal: request.signal,
|
|
120
|
+
maxBytes: request.maxBytes ?? MAX_RUNTIME_OUTPUT_CHARS,
|
|
121
|
+
env: safeEnv,
|
|
122
|
+
replaceEnv: true,
|
|
123
|
+
});
|
|
124
|
+
const endedAt = new Date().toISOString();
|
|
125
|
+
const durationMs = Date.now() - startMs;
|
|
126
|
+
const boundedStdout = redact(res.stdout.slice(0, MAX_RUNTIME_OUTPUT_CHARS));
|
|
127
|
+
const boundedStderr = redact(res.stderr.slice(0, MAX_RUNTIME_OUTPUT_CHARS));
|
|
128
|
+
const outputText = boundedStdout || boundedStderr;
|
|
129
|
+
let status = 'SUCCEEDED';
|
|
130
|
+
if (res.aborted)
|
|
131
|
+
status = 'CANCELLED';
|
|
132
|
+
else if (res.timedOut)
|
|
133
|
+
status = 'TIMED_OUT';
|
|
134
|
+
else if (!res.ok)
|
|
135
|
+
status = 'FAILED';
|
|
136
|
+
return {
|
|
137
|
+
ok: status === 'SUCCEEDED',
|
|
138
|
+
status,
|
|
139
|
+
executionKind,
|
|
140
|
+
executionId,
|
|
141
|
+
verificationStatus: 'NOT_TESTED',
|
|
142
|
+
output: outputText,
|
|
143
|
+
...(untrustedOutput ? { untrustedOutput: true } : {}),
|
|
144
|
+
error: status === 'SUCCEEDED'
|
|
145
|
+
? undefined
|
|
146
|
+
: redact(res.stderr || res.error || (status === 'TIMED_OUT' ? 'Execution timed out' : status === 'CANCELLED' ? 'Execution cancelled' : `Process exited with code ${res.code}`)),
|
|
147
|
+
command: cmdArgs,
|
|
148
|
+
cwd: cwdCheck.cwd,
|
|
149
|
+
startedAt,
|
|
150
|
+
endedAt,
|
|
151
|
+
durationMs,
|
|
152
|
+
tokensUsed: 0,
|
|
153
|
+
filesModified: status === 'SUCCEEDED' ? (request.contextFiles ?? []) : [],
|
|
154
|
+
exitCode: res.code ?? (status === 'SUCCEEDED' ? 0 : 1),
|
|
155
|
+
stdout: boundedStdout,
|
|
156
|
+
stderr: boundedStderr,
|
|
157
|
+
timedOut: res.timedOut,
|
|
158
|
+
aborted: res.aborted,
|
|
159
|
+
sandboxed: false,
|
|
160
|
+
sandboxCapability: 'unavailable-cwd-only',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary.js","sourceRoot":"","sources":["../../../src/intelligence/runtime/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM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AO,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QACzE,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,KAAK;QAChB,iBAAiB,EAAE,sBAAsB;KAC1C,CAAC;AACJ,CAAC","sourcesContent":["import crypto from 'node:crypto';\nimport { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport type { AgentExecutionRequest, AgentExecutionResponse, ExecutionKind, RuntimeExecutionStatus } from './types.js';\nimport { createMinimalExecutionEnv, run } from '../../utils/proc.js';\nimport { assertNoSymlinkEscape, isInside } from '../../utils/paths.js';\nimport { redact } from '../../security/redact.js';\nimport { SecurityPolicyEvaluator } from '../security/policy.js';\n\nexport const MAX_RUNTIME_OUTPUT_CHARS = 50_000;\n\nconst SHELL_BINARIES = new Set(['sh', 'bash', 'zsh', 'dash', 'cmd', 'cmd.exe', 'powershell', 'powershell.exe', 'pwsh', 'pwsh.exe']);\nconst DESTRUCTIVE_EXEC_RE = /\\b(?:rm\\s+-[a-zA-Z]*[rf][a-zA-Z]*|mkfs|format\\s+[a-zA-Z]:|shutdown|reboot|dd\\s+if=|del\\s+\\/[sq])\\b/i;\n\nexport function createExecutionId(prefix = 'exec'): string {\n return `${prefix}-${Date.now().toString(36)}-${crypto.randomBytes(4).toString('hex')}`;\n}\n\nexport function nonExecutedResponse(\n status: Extract<RuntimeExecutionStatus, 'PREPARED' | 'BLOCKED' | 'NOT_EXECUTED' | 'UNSUPPORTED' | 'FAILED'>,\n opts: {\n executionKind: ExecutionKind;\n output?: string;\n reason: string;\n remediation?: string;\n error?: string;\n cwd?: string;\n isPlaceholder?: boolean;\n durationMs?: number;\n },\n): AgentExecutionResponse {\n const safeReason = redact(opts.reason);\n const safeOutput = redact(opts.output ?? '');\n return {\n ok: false,\n status,\n executionKind: opts.executionKind,\n executionId: createExecutionId(),\n verificationStatus: 'NOT_TESTED',\n output: safeOutput,\n error: opts.error ? redact(opts.error) : status === 'FAILED' || status === 'BLOCKED' ? safeReason : undefined,\n reason: safeReason,\n remediation: opts.remediation,\n cwd: opts.cwd,\n durationMs: opts.durationMs ?? 0,\n filesModified: [],\n isPlaceholder: opts.isPlaceholder,\n sandboxed: false,\n sandboxCapability: 'unavailable-cwd-only',\n };\n}\n\n/** Validate working directory containment and symlink safety when workspaceRoot is supplied. */\nexport async function validateExecutionCwd(cwd: string | undefined, workspaceRoot?: string): Promise<{ ok: true; cwd?: string } | { ok: false; reason: string }> {\n if (!cwd) return { ok: true, cwd: undefined };\n const resolvedCwd = path.resolve(cwd);\n try {\n const st = await fs.stat(resolvedCwd);\n if (!st.isDirectory()) return { ok: false, reason: `Working directory is not a directory: \"${cwd}\".` };\n } catch {\n return { ok: false, reason: `Working directory does not exist: \"${cwd}\".` };\n }\n if (workspaceRoot) {\n const resolvedRoot = path.resolve(workspaceRoot);\n if (!isInside(resolvedRoot, resolvedCwd)) {\n return { ok: false, reason: `Working directory \"${cwd}\" escapes workspace root.` };\n }\n try {\n await assertNoSymlinkEscape(resolvedRoot, resolvedCwd);\n } catch (e) {\n return { ok: false, reason: (e as Error).message };\n }\n }\n return { ok: true, cwd: resolvedCwd };\n}\n\n/** Enforce concrete command policy immediately before spawn (binary, shell avoidance, destructive ops). */\nexport function validateConcreteCommand(\n cmdArgs: string[],\n workspaceRoot: string,\n explicitApproval = false,\n): { ok: true } | { ok: false; reason: string } {\n const binary = cmdArgs[0];\n if (!binary || !binary.trim()) {\n return { ok: false, reason: 'Empty executable command cannot be invoked.' };\n }\n const base = path.basename(binary).toLowerCase();\n if (SHELL_BINARIES.has(base)) {\n return { ok: false, reason: `Direct shell invocation \"${base}\" is disallowed; pass an executable with argument array instead.` };\n }\n if (cmdArgs.some((arg) => arg.includes('\\0'))) {\n return { ok: false, reason: 'Command arguments contain NUL byte.' };\n }\n if (!explicitApproval) {\n // Only check executable + flag patterns outside quoted payload arguments for shell binaries; block direct destructive commands.\n const headAndFlags = `${base} ${cmdArgs.slice(1).filter((a) => !a.includes(' ')).join(' ')}`;\n if (DESTRUCTIVE_EXEC_RE.test(headAndFlags)) {\n return { ok: false, reason: `Destructive command \"${base}\" requires explicit developer approval before execution.` };\n }\n const evaluator = new SecurityPolicyEvaluator(workspaceRoot);\n // If invoking an explicit script/command inside an allowlisted tool (node/npm/npx/git) check evaluator on binary; block arbitrary shells/installers.\n const basePolicy = evaluator.checkCommandExec(base);\n const allowedRuntimeBins = new Set(['node', 'node.exe', 'npm', 'npx', 'git', 'vitest', 'tsc', 'claude', 'codex', 'cursor']);\n if (!basePolicy.allowed && !allowedRuntimeBins.has(base) && !path.isAbsolute(binary)) {\n return { ok: false, reason: basePolicy.reason ?? `Executable \"${base}\" is not permitted by execution policy.` };\n }\n }\n return { ok: true };\n}\n\n/** Execute a concrete validated command with minimal env, bounded redacted output, and tree cleanup. */\nexport async function executeBoundedCommand(\n request: AgentExecutionRequest,\n cmdArgs: string[],\n executionKind: Extract<ExecutionKind, 'command' | 'agent'>,\n defaultTimeoutMs: number,\n untrustedOutput = false,\n): Promise<AgentExecutionResponse> {\n const executionId = createExecutionId(executionKind);\n const startMs = Date.now();\n const startedAt = new Date(startMs).toISOString();\n const targetCwd = request.sandboxPath ?? request.cwd;\n const cwdCheck = await validateExecutionCwd(targetCwd, request.workspaceRoot);\n if (!cwdCheck.ok) {\n return nonExecutedResponse('BLOCKED', {\n executionKind: 'none',\n reason: cwdCheck.reason,\n remediation: 'Provide an existing working directory inside the workspace root.',\n cwd: targetCwd,\n });\n }\n\n const cmdCheck = validateConcreteCommand(cmdArgs, request.workspaceRoot ?? targetCwd ?? process.cwd(), request.explicitApproval);\n if (!cmdCheck.ok) {\n return nonExecutedResponse('BLOCKED', {\n executionKind: 'none',\n reason: cmdCheck.reason,\n remediation: 'Approve destructive operations explicitly or use an allowlisted non-shell executable.',\n cwd: cwdCheck.cwd,\n });\n }\n\n const safeEnv = createMinimalExecutionEnv(process.env, request.allowlistedEnvKeys, request.env);\n const res = await run(cmdArgs[0]!, cmdArgs.slice(1), {\n cwd: cwdCheck.cwd,\n timeoutMs: request.timeoutMs ?? defaultTimeoutMs,\n signal: request.signal,\n maxBytes: request.maxBytes ?? MAX_RUNTIME_OUTPUT_CHARS,\n env: safeEnv as Record<string, string | undefined>,\n replaceEnv: true,\n });\n\n const endedAt = new Date().toISOString();\n const durationMs = Date.now() - startMs;\n const boundedStdout = redact(res.stdout.slice(0, MAX_RUNTIME_OUTPUT_CHARS));\n const boundedStderr = redact(res.stderr.slice(0, MAX_RUNTIME_OUTPUT_CHARS));\n const outputText = boundedStdout || boundedStderr;\n\n let status: RuntimeExecutionStatus = 'SUCCEEDED';\n if (res.aborted) status = 'CANCELLED';\n else if (res.timedOut) status = 'TIMED_OUT';\n else if (!res.ok) status = 'FAILED';\n\n return {\n ok: status === 'SUCCEEDED',\n status,\n executionKind,\n executionId,\n verificationStatus: 'NOT_TESTED',\n output: outputText,\n ...(untrustedOutput ? { untrustedOutput: true } : {}),\n error: status === 'SUCCEEDED'\n ? undefined\n : redact(res.stderr || res.error || (status === 'TIMED_OUT' ? 'Execution timed out' : status === 'CANCELLED' ? 'Execution cancelled' : `Process exited with code ${res.code}`)),\n command: cmdArgs,\n cwd: cwdCheck.cwd,\n startedAt,\n endedAt,\n durationMs,\n tokensUsed: 0,\n filesModified: status === 'SUCCEEDED' ? (request.contextFiles ?? []) : [],\n exitCode: res.code ?? (status === 'SUCCEEDED' ? 0 : 1),\n stdout: boundedStdout,\n stderr: boundedStderr,\n timedOut: res.timedOut,\n aborted: res.aborted,\n sandboxed: false,\n sandboxCapability: 'unavailable-cwd-only',\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { executeBoundedCommand, nonExecutedResponse } from './boundary.js';
|
|
2
|
+
import { createMinimalExecutionEnv, run, which } from '../../utils/proc.js';
|
|
2
3
|
import { redact } from '../../security/redact.js';
|
|
3
|
-
const MAX_EXTERNAL_OUTPUT_BYTES = 50_000;
|
|
4
4
|
export class ExternalAgentAdapter {
|
|
5
5
|
id;
|
|
6
6
|
name;
|
|
@@ -15,7 +15,10 @@ export class ExternalAgentAdapter {
|
|
|
15
15
|
let version;
|
|
16
16
|
if (exe) {
|
|
17
17
|
try {
|
|
18
|
-
const vRes = await run(exe, ['--version'], {
|
|
18
|
+
const vRes = await run(exe, ['--version'], {
|
|
19
|
+
timeoutMs: 5_000,
|
|
20
|
+
env: createMinimalExecutionEnv(process.env),
|
|
21
|
+
});
|
|
19
22
|
if (vRes.ok) {
|
|
20
23
|
version = vRes.stdout.trim().split('\n')[0] ?? undefined;
|
|
21
24
|
}
|
|
@@ -30,73 +33,44 @@ export class ExternalAgentAdapter {
|
|
|
30
33
|
version,
|
|
31
34
|
supportsStreaming: true,
|
|
32
35
|
supportsNativeSubagents: this.id === 'claude-code' || this.id === 'claude',
|
|
36
|
+
sandboxed: false,
|
|
37
|
+
sandboxCapability: 'unavailable-cwd-only',
|
|
33
38
|
reason: exe ? undefined : `CLI "${this.cliName}" not found on system PATH.`,
|
|
34
39
|
};
|
|
35
40
|
}
|
|
36
41
|
async execute(request) {
|
|
37
42
|
if (request.isPlaceholder) {
|
|
38
|
-
return {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
return nonExecutedResponse('FAILED', {
|
|
44
|
+
executionKind: 'none',
|
|
45
|
+
reason: 'Placeholder runtime cannot return a successful execution.',
|
|
41
46
|
error: 'Placeholder runtime cannot return a successful execution.',
|
|
42
|
-
durationMs: 0,
|
|
43
|
-
filesModified: [],
|
|
44
47
|
isPlaceholder: true,
|
|
45
|
-
};
|
|
48
|
+
});
|
|
46
49
|
}
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
return {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
50
|
+
const exe = await which(this.cliName);
|
|
51
|
+
if (!exe) {
|
|
52
|
+
return nonExecutedResponse('BLOCKED', {
|
|
53
|
+
executionKind: 'none',
|
|
54
|
+
reason: `CLI "${this.cliName}" not found on system PATH.`,
|
|
55
|
+
remediation: `Install the ${this.name} CLI and ensure "${this.cliName}" is on PATH.`,
|
|
56
|
+
cwd: request.sandboxPath ?? request.cwd,
|
|
57
|
+
});
|
|
56
58
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
:
|
|
64
|
-
|
|
59
|
+
// Preparing CLI instructions is never execution success.
|
|
60
|
+
if (!request.allowExternalExecution || (!request.sandboxPath && (!request.command || request.command.length === 0))) {
|
|
61
|
+
const preparedText = redact(`[${this.name}] Prepared execution instructions for ${request.role}.`);
|
|
62
|
+
return nonExecutedResponse('PREPARED', {
|
|
63
|
+
executionKind: 'preparation',
|
|
64
|
+
output: preparedText,
|
|
65
|
+
reason: `${this.name} CLI (${exe}) prepared instructions only; external execution was not authorized/invoked.`,
|
|
66
|
+
remediation: 'Enable allowExternalExecution with an explicit working directory and command to execute the provider.',
|
|
65
67
|
cwd: request.sandboxPath ?? request.cwd,
|
|
66
|
-
timeoutMs: request.timeoutMs ?? 60_000,
|
|
67
|
-
signal: request.signal,
|
|
68
|
-
maxBytes: request.maxBytes ?? MAX_EXTERNAL_OUTPUT_BYTES,
|
|
69
|
-
env: request.env,
|
|
70
68
|
});
|
|
71
|
-
const boundedStdout = result.stdout.slice(0, MAX_EXTERNAL_OUTPUT_BYTES);
|
|
72
|
-
const boundedStderr = result.stderr.slice(0, MAX_EXTERNAL_OUTPUT_BYTES);
|
|
73
|
-
const outputText = boundedStdout || boundedStderr;
|
|
74
|
-
return {
|
|
75
|
-
ok: result.ok,
|
|
76
|
-
output: redact(outputText),
|
|
77
|
-
error: result.ok ? undefined : redact(result.stderr || result.error || `Process exited with code ${result.code}`),
|
|
78
|
-
durationMs: Date.now() - start,
|
|
79
|
-
tokensUsed: 1500,
|
|
80
|
-
filesModified: request.contextFiles ?? [],
|
|
81
|
-
exitCode: result.code ?? (result.ok ? 0 : 1),
|
|
82
|
-
stdout: redact(boundedStdout),
|
|
83
|
-
stderr: redact(boundedStderr),
|
|
84
|
-
timedOut: result.timedOut,
|
|
85
|
-
aborted: result.aborted,
|
|
86
|
-
};
|
|
87
69
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
output: redact(output),
|
|
93
|
-
durationMs: Date.now() - start,
|
|
94
|
-
tokensUsed: 1500,
|
|
95
|
-
filesModified: [],
|
|
96
|
-
exitCode: 0,
|
|
97
|
-
stdout: redact(output),
|
|
98
|
-
stderr: '',
|
|
99
|
-
};
|
|
70
|
+
const cmdArgs = request.command && request.command.length > 0
|
|
71
|
+
? request.command
|
|
72
|
+
: [exe, '-p', request.prompt, '--output-format', 'json'];
|
|
73
|
+
return executeBoundedCommand(request, cmdArgs, 'agent', 60_000, true);
|
|
100
74
|
}
|
|
101
75
|
}
|
|
102
76
|
//# sourceMappingURL=external.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../src/intelligence/runtime/external.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../src/intelligence/runtime/external.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,OAAO,oBAAoB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E,uGAAuG;gBACpH,GAAG,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG;aACxC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YAC3D,CAAC,CAAC,OAAO,CAAC,OAAO;YACjB,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAE3D,OAAO,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;CACF","sourcesContent":["import type {\n AgentExecutionRequest,\n AgentExecutionResponse,\n AgentRuntimeAdapter,\n RuntimeAvailability,\n} from './types.js';\nimport { executeBoundedCommand, nonExecutedResponse } from './boundary.js';\nimport { createMinimalExecutionEnv, run, which } from '../../utils/proc.js';\nimport { redact } from '../../security/redact.js';\n\nexport class ExternalAgentAdapter implements AgentRuntimeAdapter {\n readonly id: string;\n readonly name: string;\n private cliName: string;\n\n constructor(id: string, name?: string, cliName?: string) {\n this.id = id;\n this.name = name ?? (id.charAt(0).toUpperCase() + id.slice(1));\n this.cliName = cliName ?? id;\n }\n\n async checkAvailability(): Promise<RuntimeAvailability> {\n const exe = await which(this.cliName);\n let version: string | undefined;\n\n if (exe) {\n try {\n const vRes = await run(exe, ['--version'], {\n timeoutMs: 5_000,\n env: createMinimalExecutionEnv(process.env) as Record<string, string | undefined>,\n });\n if (vRes.ok) {\n version = vRes.stdout.trim().split('\\n')[0] ?? undefined;\n }\n } catch {\n // Version check non-fatal\n }\n }\n\n return {\n available: exe !== null,\n provider: this.id,\n version,\n supportsStreaming: true,\n supportsNativeSubagents: this.id === 'claude-code' || this.id === 'claude',\n sandboxed: false,\n sandboxCapability: 'unavailable-cwd-only',\n reason: exe ? undefined : `CLI \"${this.cliName}\" not found on system PATH.`,\n };\n }\n\n async execute(request: AgentExecutionRequest): Promise<AgentExecutionResponse> {\n if (request.isPlaceholder) {\n return nonExecutedResponse('FAILED', {\n executionKind: 'none',\n reason: 'Placeholder runtime cannot return a successful execution.',\n error: 'Placeholder runtime cannot return a successful execution.',\n isPlaceholder: true,\n });\n }\n\n const exe = await which(this.cliName);\n if (!exe) {\n return nonExecutedResponse('BLOCKED', {\n executionKind: 'none',\n reason: `CLI \"${this.cliName}\" not found on system PATH.`,\n remediation: `Install the ${this.name} CLI and ensure \"${this.cliName}\" is on PATH.`,\n cwd: request.sandboxPath ?? request.cwd,\n });\n }\n\n // Preparing CLI instructions is never execution success.\n if (!request.allowExternalExecution || (!request.sandboxPath && (!request.command || request.command.length === 0))) {\n const preparedText = redact(`[${this.name}] Prepared execution instructions for ${request.role}.`);\n return nonExecutedResponse('PREPARED', {\n executionKind: 'preparation',\n output: preparedText,\n reason: `${this.name} CLI (${exe}) prepared instructions only; external execution was not authorized/invoked.`,\n remediation: 'Enable allowExternalExecution with an explicit working directory and command to execute the provider.',\n cwd: request.sandboxPath ?? request.cwd,\n });\n }\n\n const cmdArgs = request.command && request.command.length > 0\n ? request.command\n : [exe, '-p', request.prompt, '--output-format', 'json'];\n\n return executeBoundedCommand(request, cmdArgs, 'agent', 60_000, true);\n }\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const MAX_OUTPUT_CHARS = 50_000;
|
|
1
|
+
import { executeBoundedCommand, nonExecutedResponse } from './boundary.js';
|
|
2
|
+
import { packageVersion } from '../../core/version.js';
|
|
4
3
|
export class NativeRuntimeAdapter {
|
|
5
4
|
id = 'native';
|
|
6
5
|
name = 'DevWorkspace Native Deterministic Runtime';
|
|
@@ -9,63 +8,32 @@ export class NativeRuntimeAdapter {
|
|
|
9
8
|
return {
|
|
10
9
|
available: true,
|
|
11
10
|
provider: 'native',
|
|
12
|
-
version:
|
|
11
|
+
version: packageVersion(),
|
|
13
12
|
supportsStreaming: false,
|
|
14
13
|
supportsNativeSubagents: true,
|
|
14
|
+
sandboxed: false,
|
|
15
|
+
sandboxCapability: 'unavailable-cwd-only',
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
async execute(request) {
|
|
18
|
-
const start = Date.now();
|
|
19
|
-
// Reject simulated placeholder runtime execution
|
|
20
19
|
if (request.isPlaceholder) {
|
|
21
|
-
return {
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
return nonExecutedResponse('FAILED', {
|
|
21
|
+
executionKind: 'none',
|
|
22
|
+
reason: 'Placeholder runtime cannot return a successful execution.',
|
|
24
23
|
error: 'Placeholder runtime cannot return a successful execution.',
|
|
25
|
-
durationMs: 0,
|
|
26
|
-
filesModified: [],
|
|
27
24
|
isPlaceholder: true,
|
|
28
|
-
};
|
|
25
|
+
});
|
|
29
26
|
}
|
|
30
|
-
// Execute real deterministic command if provided
|
|
31
27
|
if (request.command && request.command.length > 0) {
|
|
32
|
-
|
|
33
|
-
const result = await run(cmd, args, {
|
|
34
|
-
cwd: request.cwd,
|
|
35
|
-
timeoutMs: request.timeoutMs ?? 30_000,
|
|
36
|
-
signal: request.signal,
|
|
37
|
-
maxBytes: request.maxBytes ?? MAX_OUTPUT_CHARS,
|
|
38
|
-
env: request.env,
|
|
39
|
-
});
|
|
40
|
-
const boundedStdout = result.stdout.slice(0, MAX_OUTPUT_CHARS);
|
|
41
|
-
const boundedStderr = result.stderr.slice(0, MAX_OUTPUT_CHARS);
|
|
42
|
-
const outputText = boundedStdout || boundedStderr;
|
|
43
|
-
return {
|
|
44
|
-
ok: result.ok,
|
|
45
|
-
output: redact(outputText),
|
|
46
|
-
error: result.ok ? undefined : redact(result.stderr || result.error || `Command exited with code ${result.code}`),
|
|
47
|
-
durationMs: Date.now() - start,
|
|
48
|
-
tokensUsed: 0,
|
|
49
|
-
filesModified: request.contextFiles ?? [],
|
|
50
|
-
exitCode: result.code ?? (result.ok ? 0 : 1),
|
|
51
|
-
stdout: redact(boundedStdout),
|
|
52
|
-
stderr: redact(boundedStderr),
|
|
53
|
-
timedOut: result.timedOut,
|
|
54
|
-
aborted: result.aborted,
|
|
55
|
-
};
|
|
28
|
+
return executeBoundedCommand(request, request.command, 'command', 30_000, false);
|
|
56
29
|
}
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
filesModified: request.contextFiles ?? [],
|
|
65
|
-
exitCode: 0,
|
|
66
|
-
stdout: redact(summary),
|
|
67
|
-
stderr: '',
|
|
68
|
-
};
|
|
30
|
+
// Generating a summary/plan without a concrete command is never reported as execution success.
|
|
31
|
+
return nonExecutedResponse('NOT_EXECUTED', {
|
|
32
|
+
executionKind: 'none',
|
|
33
|
+
reason: `No executable command or action configured for ${request.role} (${request.agentId}).`,
|
|
34
|
+
remediation: 'Provide an explicit executable command or agent runtime runner; planning alone does not modify or execute code.',
|
|
35
|
+
cwd: request.cwd,
|
|
36
|
+
});
|
|
69
37
|
}
|
|
70
38
|
}
|
|
71
39
|
/**
|
|
@@ -83,17 +51,17 @@ export class PlaceholderRuntimeAdapter {
|
|
|
83
51
|
reason: 'Placeholder runtimes cannot execute tasks.',
|
|
84
52
|
supportsStreaming: false,
|
|
85
53
|
supportsNativeSubagents: false,
|
|
54
|
+
sandboxed: false,
|
|
55
|
+
sandboxCapability: 'unavailable-cwd-only',
|
|
86
56
|
};
|
|
87
57
|
}
|
|
88
58
|
async execute(_request) {
|
|
89
|
-
return {
|
|
90
|
-
|
|
91
|
-
|
|
59
|
+
return nonExecutedResponse('FAILED', {
|
|
60
|
+
executionKind: 'none',
|
|
61
|
+
reason: 'Placeholder runtime cannot return a successful execution.',
|
|
92
62
|
error: 'Placeholder runtime cannot return a successful execution.',
|
|
93
|
-
durationMs: 0,
|
|
94
|
-
filesModified: [],
|
|
95
63
|
isPlaceholder: true,
|
|
96
|
-
};
|
|
64
|
+
});
|
|
97
65
|
}
|
|
98
66
|
}
|
|
99
67
|
//# sourceMappingURL=native.js.map
|