@fitlab-ai/agent-infra 0.9.7 → 0.9.9
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 +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/bin/internal-cli.js +11 -1
- package/dist/lib/agent-clients/adapters/claude-code.js +3 -3
- package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +60 -22
- package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +8 -1
- package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +175 -11
- package/dist/lib/agent-clients/adapters/codex-lifecycle/controller-context.js +147 -0
- package/dist/lib/agent-clients/adapters/codex-lifecycle/evidence.js +14 -0
- package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +86 -69
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +2 -1
- package/dist/lib/decide.js +68 -14
- package/dist/lib/git/workflow.js +10 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/internal/codex-lifecycle.js +19 -5
- package/dist/lib/internal/codex-sandbox-controller.js +6 -13
- package/dist/lib/internal/git-workflow.js +5 -7
- package/dist/lib/internal/platform-pr.js +20 -7
- package/dist/lib/internal/release-workflow.js +3 -4
- package/dist/lib/internal/sandbox-control.js +79 -2
- package/dist/lib/internal/task-activity.js +57 -7
- package/dist/lib/internal/task-event.js +57 -4
- package/dist/lib/internal/task-finalization.js +54 -0
- package/dist/lib/internal/task-ledger.js +59 -5
- package/dist/lib/internal/task-lifecycle.js +59 -8
- package/dist/lib/internal/task-orchestration.js +161 -288
- package/dist/lib/internal/task-override.js +131 -0
- package/dist/lib/internal/task-review.js +64 -6
- package/dist/lib/internal/task-verify.js +65 -3
- package/dist/lib/internal/task-warning.js +57 -4
- package/dist/lib/platform/pr-summary.js +53 -13
- package/dist/lib/platform/pull-requests.js +205 -41
- package/dist/lib/runtime/agent-runtime.js +56 -0
- package/dist/lib/sandbox/commands/create.js +389 -311
- package/dist/lib/sandbox/commands/rm.js +316 -55
- package/dist/lib/sandbox/control/client.js +190 -6
- package/dist/lib/sandbox/control/container-identity.js +1 -1
- package/dist/lib/sandbox/control/controller-registration.js +273 -0
- package/dist/lib/sandbox/control/executor.js +145 -5
- package/dist/lib/sandbox/control/lifecycle.js +395 -73
- package/dist/lib/sandbox/control/protocol.js +67 -6
- package/dist/lib/sandbox/control/state.js +27 -11
- package/dist/lib/sandbox/engine.js +14 -7
- package/dist/lib/sandbox/index.js +5 -3
- package/dist/lib/sandbox/managed-fs.js +5 -0
- package/dist/lib/sandbox/mounts.js +20 -5
- package/dist/lib/sandbox/recovery.js +78 -10
- package/dist/lib/sandbox/task-resolver.js +50 -6
- package/dist/lib/sandbox/workspace-identity.js +27 -0
- package/dist/lib/sandbox/workspace-view.js +62 -40
- package/dist/lib/sandbox/worktree-safety.js +215 -2
- package/dist/lib/server/process-state.js +51 -1
- package/dist/lib/task/activity-intent.js +4 -1
- package/dist/lib/task/codex-orchestration.js +158 -33
- package/dist/lib/task/commands/status.js +59 -1
- package/dist/lib/task/commit-operation.js +335 -0
- package/dist/lib/task/commit-policy.js +18 -0
- package/dist/lib/task/decision-intents.js +4 -2
- package/dist/lib/task/delegation-receipts.js +279 -17
- package/dist/lib/task/events.js +9 -5
- package/dist/lib/task/finalization.js +567 -0
- package/dist/lib/task/guard-override.js +31 -0
- package/dist/lib/task/human-override.js +1240 -0
- package/dist/lib/task/ledger-intents.js +6 -3
- package/dist/lib/task/lifecycle.js +69 -14
- package/dist/lib/task/operation-outcome.js +33 -0
- package/dist/lib/task/orchestration.js +199 -719
- package/dist/lib/task/review-finalization.js +3 -2
- package/dist/lib/task/short-id.js +59 -1
- package/dist/lib/task/task-execution-lock.js +6 -1
- package/dist/lib/task/verification-engine.js +138 -59
- package/dist/lib/task/verification.js +15 -2
- package/dist/lib/task/workflow-warning-intents.js +54 -3
- package/dist/lib/task/write.js +2 -1
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-clients/adapters/claude-code.ts +3 -3
- package/lib/agent-clients/adapters/codex-lifecycle/app-server.ts +63 -20
- package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +12 -0
- package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +278 -13
- package/lib/agent-clients/adapters/codex-lifecycle/controller-context.ts +180 -0
- package/lib/agent-clients/adapters/codex-lifecycle/evidence.ts +19 -0
- package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +9 -1
- package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +112 -93
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +2 -1
- package/lib/decide.ts +59 -14
- package/lib/git/workflow.ts +11 -2
- package/lib/init.ts +1 -1
- package/lib/internal/codex-lifecycle.ts +18 -5
- package/lib/internal/codex-sandbox-controller.ts +6 -12
- package/lib/internal/git-workflow.ts +5 -6
- package/lib/internal/platform-pr.ts +14 -7
- package/lib/internal/release-workflow.ts +3 -4
- package/lib/internal/sandbox-control.ts +92 -2
- package/lib/internal/task-activity.ts +46 -6
- package/lib/internal/task-event.ts +53 -4
- package/lib/internal/task-finalization.ts +68 -0
- package/lib/internal/task-ledger.ts +48 -4
- package/lib/internal/task-lifecycle.ts +56 -12
- package/lib/internal/task-orchestration.ts +32 -107
- package/lib/internal/task-override.ts +138 -0
- package/lib/internal/task-review.ts +51 -6
- package/lib/internal/task-verify.ts +52 -3
- package/lib/internal/task-warning.ts +44 -3
- package/lib/platform/pr-summary.ts +65 -14
- package/lib/platform/pull-requests.ts +211 -41
- package/lib/runtime/agent-runtime.ts +76 -0
- package/lib/sandbox/commands/create.ts +88 -4
- package/lib/sandbox/commands/rm.ts +413 -61
- package/lib/sandbox/config.ts +2 -1
- package/lib/sandbox/control/client.ts +255 -6
- package/lib/sandbox/control/container-identity.ts +3 -3
- package/lib/sandbox/control/controller-registration.ts +347 -0
- package/lib/sandbox/control/executor.ts +172 -6
- package/lib/sandbox/control/lifecycle.ts +465 -77
- package/lib/sandbox/control/protocol.ts +85 -9
- package/lib/sandbox/control/state.ts +35 -18
- package/lib/sandbox/engine.ts +20 -9
- package/lib/sandbox/index.ts +5 -3
- package/lib/sandbox/managed-fs.ts +5 -0
- package/lib/sandbox/mounts.ts +23 -5
- package/lib/sandbox/recovery.ts +90 -9
- package/lib/sandbox/task-resolver.ts +58 -7
- package/lib/sandbox/workspace-identity.ts +50 -2
- package/lib/sandbox/workspace-view.ts +73 -43
- package/lib/sandbox/worktree-safety.ts +236 -2
- package/lib/server/process-state.ts +48 -1
- package/lib/task/activity-intent.ts +4 -2
- package/lib/task/codex-orchestration.ts +167 -33
- package/lib/task/commands/status.ts +78 -1
- package/lib/task/commit-operation.ts +430 -0
- package/lib/task/commit-policy.ts +30 -0
- package/lib/task/decision-intents.ts +4 -2
- package/lib/task/delegation-receipts.ts +304 -19
- package/lib/task/events.ts +10 -5
- package/lib/task/finalization.ts +719 -0
- package/lib/task/guard-override.ts +50 -0
- package/lib/task/human-override.ts +1503 -0
- package/lib/task/ledger-intents.ts +6 -3
- package/lib/task/lifecycle.ts +71 -14
- package/lib/task/operation-outcome.ts +48 -0
- package/lib/task/orchestration.ts +239 -922
- package/lib/task/review-finalization.ts +6 -2
- package/lib/task/short-id.ts +65 -1
- package/lib/task/task-execution-lock.ts +10 -1
- package/lib/task/verification-engine.ts +145 -64
- package/lib/task/verification.ts +18 -3
- package/lib/task/workflow-warning-intents.ts +61 -4
- package/lib/task/write.ts +4 -1
- package/package.json +2 -2
- package/templates/.agents/QUICKSTART.en.md +2 -2
- package/templates/.agents/QUICKSTART.zh-CN.md +2 -2
- package/templates/.agents/hooks/lifecycle-delegation.js +9 -24
- package/templates/.agents/rules/lifecycle-orchestration.en.md +4 -3
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +4 -3
- package/templates/.agents/rules/task-management.en.md +2 -2
- package/templates/.agents/rules/task-management.zh-CN.md +2 -2
- package/templates/.agents/skills/block-task/SKILL.en.md +2 -4
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -4
- package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/close-codescan/SKILL.en.md +6 -2
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +6 -2
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/commit/SKILL.en.md +41 -125
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +52 -123
- package/templates/.agents/skills/commit/reference/commit-message.en.md +1 -1
- package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +14 -43
- package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +14 -49
- package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
- package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +2 -35
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +2 -35
- package/templates/.agents/skills/complete-task/SKILL.en.md +31 -38
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +31 -38
- package/templates/.agents/skills/complete-task/config/verify.en.json +1 -0
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +1 -1
- package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +1 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +6 -4
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +6 -4
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +2 -2
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +2 -2
- package/templates/.agents/skills/run-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +3 -1
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +3 -1
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +1 -1
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +1 -1
- package/templates/.codex/hooks.json +4 -4
- package/dist/lib/task/commit-finalization.js +0 -305
- package/dist/lib/task/commit-intent.js +0 -165
- package/lib/task/commit-finalization.ts +0 -419
- package/lib/task/commit-intent.ts +0 -230
|
@@ -4,8 +4,17 @@ import path from 'node:path';
|
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
import { getProcessStartTime } from '../../server/process-state.ts';
|
|
6
6
|
import { createTask } from '../../task/create-service.ts';
|
|
7
|
+
import { applyTaskFinalization } from '../../task/finalization.ts';
|
|
8
|
+
import { verifyTaskEvent } from '../../task/verification.ts';
|
|
7
9
|
import { bindSandboxControlTask, type SandboxControlExecution, type SandboxControlManifest, type SandboxControlRequest } from './protocol.ts';
|
|
8
10
|
import { atomicWriteJson, executionPath, terminateSandboxControlExecution } from './state.ts';
|
|
11
|
+
import { computeLifecycleBuildIdentity } from '../../agent-clients/adapters/codex-lifecycle/build-identity.ts';
|
|
12
|
+
import {
|
|
13
|
+
closeCodexControllerRegistration,
|
|
14
|
+
CodexControllerRegistrationError,
|
|
15
|
+
openCodexControllerRegistration,
|
|
16
|
+
resolveCodexControllerBinding
|
|
17
|
+
} from './controller-registration.ts';
|
|
9
18
|
|
|
10
19
|
export type SandboxControlExecutionResult = {
|
|
11
20
|
exitCode: number;
|
|
@@ -57,7 +66,11 @@ export async function prepareSandboxControlExecution(params: {
|
|
|
57
66
|
cwd: params.manifest.repoRoot,
|
|
58
67
|
detached: process.platform !== 'win32',
|
|
59
68
|
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
|
60
|
-
env: {
|
|
69
|
+
env: {
|
|
70
|
+
...safeEnv(process.env),
|
|
71
|
+
AGENT_INFRA_EXECUTOR_MANIFEST: params.manifestPath,
|
|
72
|
+
AGENT_INFRA_RUNTIME_DIR: params.manifest.runtimeDir
|
|
73
|
+
}
|
|
61
74
|
}
|
|
62
75
|
);
|
|
63
76
|
if (typeof child.pid !== 'number') throw new Error('SANDBOX_CONTROL_EXECUTOR_SPAWN_FAILED');
|
|
@@ -128,7 +141,70 @@ function waitForGate(nonce: string, timeoutMs = 2_000): Promise<void> {
|
|
|
128
141
|
});
|
|
129
142
|
}
|
|
130
143
|
|
|
131
|
-
function
|
|
144
|
+
function controllerFailure(error: unknown): SandboxControlExecutionResult {
|
|
145
|
+
const code = error instanceof CodexControllerRegistrationError
|
|
146
|
+
? error.code
|
|
147
|
+
: /^([A-Z][A-Z0-9_]+)/u.exec(error instanceof Error ? error.message : String(error))?.[1]
|
|
148
|
+
?? 'CODEX_SANDBOX_CONTROLLER_FAILED';
|
|
149
|
+
const payload = {
|
|
150
|
+
version: 1,
|
|
151
|
+
status: 'failed',
|
|
152
|
+
changed: false,
|
|
153
|
+
lease: null,
|
|
154
|
+
error: { code, message: `${code}: controller request failed`, retryable: false }
|
|
155
|
+
};
|
|
156
|
+
return { exitCode: 1, stdout: `${JSON.stringify(payload)}\n`, stderr: '' };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function orchestrationFailure(code: string, message: string): SandboxControlExecutionResult {
|
|
160
|
+
return {
|
|
161
|
+
exitCode: 1,
|
|
162
|
+
stdout: `${JSON.stringify({
|
|
163
|
+
status: 'failed', changed: false, taskId: null, run: null, next: null,
|
|
164
|
+
error: { code, message }
|
|
165
|
+
})}\n`,
|
|
166
|
+
stderr: ''
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function finalizationResult(result: ReturnType<typeof applyTaskFinalization>): SandboxControlExecutionResult {
|
|
171
|
+
const payload = {
|
|
172
|
+
version: 1,
|
|
173
|
+
status: result.status,
|
|
174
|
+
changed: result.changed,
|
|
175
|
+
accepted: true,
|
|
176
|
+
result,
|
|
177
|
+
error: result.error
|
|
178
|
+
};
|
|
179
|
+
return {
|
|
180
|
+
exitCode: result.status === 'completed' ? 0 : result.status === 'blocked' ? 2 : 1,
|
|
181
|
+
stdout: `${JSON.stringify(payload)}\n`,
|
|
182
|
+
stderr: ''
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function isCodexPrepare(args: readonly string[]): boolean {
|
|
187
|
+
if (args[1] !== 'prepare') return false;
|
|
188
|
+
const values: string[] = [];
|
|
189
|
+
for (let index = 2; index < args.length; index += 1) {
|
|
190
|
+
if (args[index] === '--client') values.push(args[index + 1] ?? '');
|
|
191
|
+
else if (args[index]?.startsWith('--client=')) values.push(args[index]!.slice('--client='.length));
|
|
192
|
+
}
|
|
193
|
+
return values.length === 1 && values[0] === 'codex';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
type ExecuteRequestOptions = Readonly<{
|
|
197
|
+
buildIdentity?: typeof computeLifecycleBuildIdentity;
|
|
198
|
+
resolveControllerBinding?: typeof resolveCodexControllerBinding;
|
|
199
|
+
spawnDomain?: typeof spawnSync;
|
|
200
|
+
}>;
|
|
201
|
+
|
|
202
|
+
export function executeRequest(
|
|
203
|
+
manifest: SandboxControlManifest,
|
|
204
|
+
manifestPath: string,
|
|
205
|
+
request: SandboxControlRequest,
|
|
206
|
+
options: ExecuteRequestOptions = {}
|
|
207
|
+
): SandboxControlExecutionResult {
|
|
132
208
|
if (request.family === 'task-create') {
|
|
133
209
|
const result = createTask(request.candidate, { repoRoot: manifest.repoRoot });
|
|
134
210
|
return {
|
|
@@ -137,12 +213,102 @@ function executeRequest(manifest: SandboxControlManifest, request: SandboxContro
|
|
|
137
213
|
stderr: ''
|
|
138
214
|
};
|
|
139
215
|
}
|
|
216
|
+
if (request.family === 'codex-controller') {
|
|
217
|
+
try {
|
|
218
|
+
if (request.command === 'verify') {
|
|
219
|
+
const binding = (options.resolveControllerBinding ?? resolveCodexControllerBinding)({
|
|
220
|
+
manifest,
|
|
221
|
+
manifestPath,
|
|
222
|
+
proof: request.controllerProof!,
|
|
223
|
+
buildIdentity: (options.buildIdentity ?? computeLifecycleBuildIdentity)(manifest.repoRoot)
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
exitCode: 0,
|
|
227
|
+
stdout: `${JSON.stringify({
|
|
228
|
+
version: 1,
|
|
229
|
+
status: 'verified',
|
|
230
|
+
changed: false,
|
|
231
|
+
lease: null,
|
|
232
|
+
binding: {
|
|
233
|
+
taskId: manifest.taskId,
|
|
234
|
+
controlGeneration: binding.controlGeneration,
|
|
235
|
+
controllerInstanceDigest: binding.instanceDigest
|
|
236
|
+
},
|
|
237
|
+
error: null
|
|
238
|
+
})}\n`,
|
|
239
|
+
stderr: ''
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
const result = request.command === 'open'
|
|
243
|
+
? openCodexControllerRegistration({
|
|
244
|
+
manifest,
|
|
245
|
+
manifestPath,
|
|
246
|
+
controllerProcess: request.controllerProcess!,
|
|
247
|
+
buildIdentity: (options.buildIdentity ?? computeLifecycleBuildIdentity)(manifest.repoRoot)
|
|
248
|
+
})
|
|
249
|
+
: closeCodexControllerRegistration({
|
|
250
|
+
manifest,
|
|
251
|
+
manifestPath,
|
|
252
|
+
proof: request.controllerProof!
|
|
253
|
+
});
|
|
254
|
+
return { exitCode: 0, stdout: `${JSON.stringify(result)}\n`, stderr: '' };
|
|
255
|
+
} catch (error) {
|
|
256
|
+
return controllerFailure(error);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (request.family === 'task-finalization') {
|
|
260
|
+
return finalizationResult(applyTaskFinalization(
|
|
261
|
+
{ taskRef: manifest.taskId!, intent: 'complete', agent: request.agent },
|
|
262
|
+
{ repoRoot: manifest.repoRoot, preflight: (input, options) => verifyTaskEvent(
|
|
263
|
+
{ ...input, event: 'complete-task.hard-preflight' }, options
|
|
264
|
+
) }
|
|
265
|
+
));
|
|
266
|
+
}
|
|
140
267
|
const boundArgs = bindSandboxControlTask(request, manifest.taskId!);
|
|
141
|
-
|
|
142
|
-
|
|
268
|
+
let controllerBinding: Readonly<{ instanceDigest: string; controlGeneration: string }> | null = null;
|
|
269
|
+
if (request.family === 'task-orchestration') {
|
|
270
|
+
if (isCodexPrepare(request.args)) {
|
|
271
|
+
if (!request.controllerProof) {
|
|
272
|
+
return orchestrationFailure(
|
|
273
|
+
'CODEX_SANDBOX_CONTROLLER_PROOF_REQUIRED',
|
|
274
|
+
'Codex prepare requires a current controller lease proof'
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
try {
|
|
278
|
+
controllerBinding = (options.resolveControllerBinding ?? resolveCodexControllerBinding)({
|
|
279
|
+
manifest,
|
|
280
|
+
manifestPath,
|
|
281
|
+
proof: request.controllerProof,
|
|
282
|
+
buildIdentity: (options.buildIdentity ?? computeLifecycleBuildIdentity)(manifest.repoRoot)
|
|
283
|
+
});
|
|
284
|
+
} catch (error) {
|
|
285
|
+
const code = error instanceof CodexControllerRegistrationError
|
|
286
|
+
? error.code
|
|
287
|
+
: 'CODEX_SANDBOX_CONTROLLER_PROOF_INVALID';
|
|
288
|
+
return orchestrationFailure(code, `${code}: Codex controller proof was rejected`);
|
|
289
|
+
}
|
|
290
|
+
} else if (request.controllerProof !== null) {
|
|
291
|
+
return orchestrationFailure(
|
|
292
|
+
'CODEX_SANDBOX_CONTROLLER_PROOF_INVALID',
|
|
293
|
+
'Controller proof is only accepted for canonical Codex prepare'
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
boundArgs.push('--git-worktree-root', manifest.worktreeRoot);
|
|
297
|
+
}
|
|
298
|
+
const result = (options.spawnDomain ?? spawnSync)(
|
|
143
299
|
process.execPath,
|
|
144
300
|
nodeEntryArgs(process.argv[1]!, [request.family, ...boundArgs]),
|
|
145
|
-
{
|
|
301
|
+
{
|
|
302
|
+
cwd: manifest.repoRoot,
|
|
303
|
+
encoding: 'utf8',
|
|
304
|
+
env: {
|
|
305
|
+
...safeEnv(process.env),
|
|
306
|
+
AGENT_INFRA_RUNTIME_DIR: manifest.runtimeDir,
|
|
307
|
+
...(controllerBinding
|
|
308
|
+
? { AGENT_INFRA_CONTROL_CONTROLLER_BINDING: JSON.stringify(controllerBinding) }
|
|
309
|
+
: {})
|
|
310
|
+
}
|
|
311
|
+
}
|
|
146
312
|
);
|
|
147
313
|
return { exitCode: result.status ?? 1, stdout: result.stdout ?? '', stderr: result.stderr ?? '' };
|
|
148
314
|
}
|
|
@@ -156,7 +322,7 @@ export async function runSandboxControlExecutor(requestPath: string, nonce: stri
|
|
|
156
322
|
if (!manifestPath) throw new Error('SANDBOX_CONTROL_EXECUTOR_MANIFEST_MISSING');
|
|
157
323
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as SandboxControlManifest;
|
|
158
324
|
if (fs.realpathSync.native(manifest.repoRoot) !== root) throw new Error('SANDBOX_CONTROL_EXECUTOR_ROOT_INVALID');
|
|
159
|
-
const result = executeRequest(manifest, request);
|
|
325
|
+
const result = executeRequest(manifest, manifestPath, request);
|
|
160
326
|
process.stdout.write(result.stdout);
|
|
161
327
|
process.stderr.write(result.stderr);
|
|
162
328
|
process.exitCode = result.exitCode;
|