@fitlab-ai/agent-infra 0.9.7 → 0.9.8
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/dist/bin/internal-cli.js +5 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +3 -3
- package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +2 -1
- package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +2 -1
- package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +30 -2
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +2 -1
- package/dist/lib/decide.js +68 -14
- package/dist/lib/init.js +1 -1
- package/dist/lib/internal/release-workflow.js +1 -3
- package/dist/lib/internal/task-activity.js +57 -7
- package/dist/lib/internal/task-event.js +57 -4
- 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 +11 -3
- 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 +5 -3
- package/dist/lib/runtime/agent-runtime.js +56 -0
- package/dist/lib/sandbox/commands/create.js +389 -311
- package/dist/lib/sandbox/control/container-identity.js +1 -1
- package/dist/lib/sandbox/control/executor.js +10 -2
- package/dist/lib/sandbox/control/lifecycle.js +392 -72
- package/dist/lib/sandbox/control/state.js +27 -11
- package/dist/lib/sandbox/engine.js +14 -7
- package/dist/lib/sandbox/mounts.js +20 -5
- package/dist/lib/sandbox/recovery.js +78 -10
- package/dist/lib/sandbox/workspace-view.js +62 -40
- package/dist/lib/server/process-state.js +51 -1
- package/dist/lib/task/activity-intent.js +4 -1
- package/dist/lib/task/decision-intents.js +4 -2
- package/dist/lib/task/delegation-receipts.js +37 -16
- package/dist/lib/task/events.js +9 -5
- 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/orchestration.js +60 -6
- package/dist/lib/task/review-finalization.js +3 -2
- package/dist/lib/task/verification-engine.js +40 -14
- package/dist/lib/task/verification.js +13 -1
- package/dist/lib/task/workflow-warning-intents.js +4 -2
- 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 +2 -1
- package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +2 -1
- package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +29 -2
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +2 -1
- package/lib/decide.ts +59 -14
- package/lib/init.ts +1 -1
- package/lib/internal/release-workflow.ts +1 -3
- package/lib/internal/task-activity.ts +46 -6
- package/lib/internal/task-event.ts +53 -4
- package/lib/internal/task-ledger.ts +48 -4
- package/lib/internal/task-lifecycle.ts +56 -12
- package/lib/internal/task-orchestration.ts +12 -4
- 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 +10 -3
- package/lib/runtime/agent-runtime.ts +76 -0
- package/lib/sandbox/commands/create.ts +88 -4
- package/lib/sandbox/config.ts +2 -1
- package/lib/sandbox/control/container-identity.ts +3 -3
- package/lib/sandbox/control/executor.ts +10 -2
- package/lib/sandbox/control/lifecycle.ts +463 -76
- package/lib/sandbox/control/protocol.ts +5 -2
- package/lib/sandbox/control/state.ts +35 -18
- package/lib/sandbox/engine.ts +20 -9
- package/lib/sandbox/mounts.ts +23 -5
- package/lib/sandbox/recovery.ts +90 -9
- package/lib/sandbox/workspace-view.ts +70 -40
- package/lib/server/process-state.ts +48 -1
- package/lib/task/activity-intent.ts +4 -2
- package/lib/task/decision-intents.ts +4 -2
- package/lib/task/delegation-receipts.ts +46 -18
- package/lib/task/events.ts +10 -5
- 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/orchestration.ts +89 -7
- package/lib/task/review-finalization.ts +6 -2
- package/lib/task/verification-engine.ts +42 -16
- package/lib/task/verification.ts +15 -1
- package/lib/task/workflow-warning-intents.ts +4 -2
- package/lib/task/write.ts +4 -1
- package/package.json +1 -1
- package/templates/.agents/hooks/lifecycle-delegation.js +8 -3
- package/templates/.agents/rules/lifecycle-orchestration.en.md +3 -2
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +3 -2
- 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/lib/sandbox/config.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { normalizeAgentClients } from '../agent-clients/config.ts';
|
|
|
7
7
|
import { isAgentClientId } from '../agent-clients/types.ts';
|
|
8
8
|
import type { AgentClientState } from '../agent-clients/types.ts';
|
|
9
9
|
import { validateSandboxEngine } from './engine.ts';
|
|
10
|
+
import type { SandboxEngineInput } from './engine.ts';
|
|
10
11
|
import { hostJoin } from './engines/wsl2-paths.ts';
|
|
11
12
|
import { findRuntimeEngineMismatches } from './runtime-engines.ts';
|
|
12
13
|
import { parseCustomTools } from './tools.ts';
|
|
@@ -29,7 +30,7 @@ type PlatformFn = typeof platform;
|
|
|
29
30
|
type WriteStderr = (chunk: string) => unknown;
|
|
30
31
|
|
|
31
32
|
type SandboxConfigInput = {
|
|
32
|
-
engine?:
|
|
33
|
+
engine?: SandboxEngineInput;
|
|
33
34
|
runtimes?: string[];
|
|
34
35
|
tools?: string[];
|
|
35
36
|
customTools?: unknown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SandboxControlManifest } from './protocol.ts';
|
|
1
|
+
import type { SandboxControlManifest, SandboxControlManifestLike } from './protocol.ts';
|
|
2
2
|
import { commandForEngine, runEngine, runProbe } from '../shell.ts';
|
|
3
3
|
|
|
4
4
|
export type ContainerObservation =
|
|
@@ -14,7 +14,7 @@ export type ContainerInspection = Readonly<{
|
|
|
14
14
|
|
|
15
15
|
function isAuthoritativeNotFound(error: unknown): boolean {
|
|
16
16
|
const message = error instanceof Error ? error.message : String(error);
|
|
17
|
-
return /(?:no such container|container .* not found|cannot find container)/i.test(message);
|
|
17
|
+
return /(?:no such (?:container|object)|container .* not found|cannot find container)/i.test(message);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function classifySandboxContainerInspection(
|
|
@@ -48,7 +48,7 @@ export function classifySandboxContainerInspection(
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export async function inspectSandboxControlContainer(
|
|
51
|
-
manifest:
|
|
51
|
+
manifest: SandboxControlManifestLike,
|
|
52
52
|
options: { run?: typeof runEngine; probe?: typeof runProbe; timeoutMs?: number } = {}
|
|
53
53
|
): Promise<ContainerObservation> {
|
|
54
54
|
try {
|
|
@@ -57,7 +57,11 @@ export async function prepareSandboxControlExecution(params: {
|
|
|
57
57
|
cwd: params.manifest.repoRoot,
|
|
58
58
|
detached: process.platform !== 'win32',
|
|
59
59
|
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
|
60
|
-
env: {
|
|
60
|
+
env: {
|
|
61
|
+
...safeEnv(process.env),
|
|
62
|
+
AGENT_INFRA_EXECUTOR_MANIFEST: params.manifestPath,
|
|
63
|
+
AGENT_INFRA_RUNTIME_DIR: params.manifest.runtimeDir
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
);
|
|
63
67
|
if (typeof child.pid !== 'number') throw new Error('SANDBOX_CONTROL_EXECUTOR_SPAWN_FAILED');
|
|
@@ -142,7 +146,11 @@ function executeRequest(manifest: SandboxControlManifest, request: SandboxContro
|
|
|
142
146
|
const result = spawnSync(
|
|
143
147
|
process.execPath,
|
|
144
148
|
nodeEntryArgs(process.argv[1]!, [request.family, ...boundArgs]),
|
|
145
|
-
{
|
|
149
|
+
{
|
|
150
|
+
cwd: manifest.repoRoot,
|
|
151
|
+
encoding: 'utf8',
|
|
152
|
+
env: { ...safeEnv(process.env), AGENT_INFRA_RUNTIME_DIR: manifest.runtimeDir }
|
|
153
|
+
}
|
|
146
154
|
);
|
|
147
155
|
return { exitCode: result.status ?? 1, stdout: result.stdout ?? '', stderr: result.stderr ?? '' };
|
|
148
156
|
}
|