@lazyingart/agintiflow 0.20.67 → 0.20.68
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Low-cost, project-aware Web and CLI agents with DeepSeek/Venice/OpenAI routing, visible tool calls, durable sessions, scouts, AAPS, SCS, and guarded local execution.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -246,6 +246,20 @@ try {
|
|
|
246
246
|
failedNetworkAdvice.instruction.includes("Stop and present this blocker"),
|
|
247
247
|
"network failure advice did not tell the model to stop and ask"
|
|
248
248
|
);
|
|
249
|
+
const failedOutsidePathAdvice = buildFailedCommandAdvice({
|
|
250
|
+
args: { command: 'echo "outside permission test" > /home/lachlan/ProjectsLFS/outside.txt' },
|
|
251
|
+
commandPolicy: evaluateCommandPolicy('echo "outside permission test" > /home/lachlan/ProjectsLFS/outside.txt', dockerWorkspacePolicy),
|
|
252
|
+
commandResult: {
|
|
253
|
+
ok: false,
|
|
254
|
+
stdout: "EXIT: 1",
|
|
255
|
+
stderr: "bash: line 1: /home/lachlan/ProjectsLFS/outside.txt: No such file or directory",
|
|
256
|
+
},
|
|
257
|
+
config: dockerWorkspacePolicy,
|
|
258
|
+
state: { sessionId: "coding-outside-path-smoke" },
|
|
259
|
+
});
|
|
260
|
+
assert(failedOutsidePathAdvice?.failureKind === "workspace-path", "outside host path failure advice was not generated");
|
|
261
|
+
assert(failedOutsidePathAdvice.suggestedCommand.includes("--sandbox-mode host"), "outside path advice did not suggest host mode");
|
|
262
|
+
assert(!failedOutsidePathAdvice.suggestedCommand.includes("aginti run --sandbox host"), "outside path advice used legacy sandbox syntax");
|
|
249
263
|
assert(
|
|
250
264
|
shouldRunParallelScouts(
|
|
251
265
|
{
|
package/src/agent-runner.js
CHANGED
|
@@ -361,7 +361,7 @@ async function createInitialState(config, sessionId) {
|
|
|
361
361
|
? `A shell command tool is available inside Docker sandbox mode ${config.sandboxMode}. Docker workspace mode with approved package installs supports broader setup and network commands. The project is mounted at /workspace and the persistent agent toolchain is mounted at /aginti-env with caches under /aginti-cache.`
|
|
362
362
|
: `A host shell command tool is available under the configured trust policy on ${platformLabel(platform)}. On native Windows, prefer PowerShell/cmd-compatible commands or switch to WSL/Docker for bash-like toolchains.`
|
|
363
363
|
: "No shell command tool is available.",
|
|
364
|
-
"Permission contract: current-workspace file writes are allowed through workspace file tools when enabled. Outside-workspace paths, host sudo, host OS package installs, destructive git/shell actions, and blocked network/setup must not be bypassed by retrying variants. If a tool result includes permissionAdvice or suggestedCommand, stop, explain the blocker, and ask the user to approve/rerun that mode or choose a safer workspace-relative path.",
|
|
364
|
+
"Permission contract: current-workspace file writes are allowed through workspace file tools when enabled. Outside-workspace paths, host sudo, host OS package installs, destructive git/shell actions, and blocked network/setup must not be bypassed by retrying variants. If a tool result includes permissionAdvice or suggestedCommand, stop, explain the blocker, copy the exact suggestedCommand when giving a rerun path, and ask the user to approve/rerun that mode or choose a safer workspace-relative path. Never invent legacy AgInTi syntax such as `aginti run --sandbox host`; use the exact flags from permissionAdvice.",
|
|
365
365
|
"If an operation fails but a directory, artifact, or file already exists, treat it as pre-existing unless you have evidence this run created or updated it. Verify expected outputs before claiming success.",
|
|
366
366
|
config.allowShellTool
|
|
367
367
|
? "Host tmux tools are available for long-running terminals: list sessions, capture panes, send safe keys/text, and start detached sessions. Prefer these tools for monitoring long installs/tests/dev servers without blocking; capture before sending input and never send secrets or sudo passwords. Do not start or install tmux inside Docker run_command containers because those containers are short-lived."
|
package/src/behavior-contract.js
CHANGED
|
@@ -68,7 +68,7 @@ export function formatBehaviorContractForPrompt({ mode = "runtime" } = {}) {
|
|
|
68
68
|
"Prefer the smallest coherent change that satisfies the request; do not add speculative features or abstractions.",
|
|
69
69
|
"Make surgical edits: no drive-by refactors, unrelated formatting churn, or deletion of code you did not need to touch.",
|
|
70
70
|
"Define or infer concrete success criteria for non-trivial work, then run focused checks or state why checks are unavailable.",
|
|
71
|
-
"Respect the permission contract: if a tool is blocked, stop and present the
|
|
71
|
+
"Respect the permission contract: if a tool is blocked or returns permissionAdvice, stop and present the exact suggestedCommand/approval path instead of retrying variants or inventing CLI flags.",
|
|
72
72
|
"Keep artifacts durable and discoverable with descriptive non-conflicting names; never overwrite unless the user clearly asked.",
|
|
73
73
|
"When reporting shell, language, runtime, build, or test results, name the actual environment used (host vs Docker, relevant interpreter/tool path/version when it matters). Do not claim compatibility across untested runtimes, hosts, containers, or language versions; state the caveat or run an explicit check.",
|
|
74
74
|
].join(" ");
|
package/src/permission-advice.js
CHANGED
|
@@ -10,6 +10,13 @@ const NETWORK_FAILURE_PATTERNS = [
|
|
|
10
10
|
/unable to access ['"].*?:/i,
|
|
11
11
|
];
|
|
12
12
|
|
|
13
|
+
const DOCKER_WORKSPACE_PATH_FAILURE_PATTERNS = [
|
|
14
|
+
/\/home\/[^:\n]+:\s+No such file or directory/i,
|
|
15
|
+
/\/Users\/[^:\n]+:\s+No such file or directory/i,
|
|
16
|
+
/[A-Z]:\\[^:\n]+:\s+No such file or directory/i,
|
|
17
|
+
/cannot statx? ['"][^'"]+['"]:\s+No such file or directory/i,
|
|
18
|
+
];
|
|
19
|
+
|
|
13
20
|
function quoteShell(value = "") {
|
|
14
21
|
const text = String(value || "");
|
|
15
22
|
return `'${text.replace(/'/g, `'\\''`)}'`;
|
|
@@ -183,7 +190,26 @@ export function looksLikeNetworkFailure(result = {}) {
|
|
|
183
190
|
return NETWORK_FAILURE_PATTERNS.some((pattern) => pattern.test(text));
|
|
184
191
|
}
|
|
185
192
|
|
|
193
|
+
export function looksLikeDockerWorkspacePathFailure(result = {}, config = {}) {
|
|
194
|
+
if ((config.sandboxMode || "") !== "docker-workspace") return false;
|
|
195
|
+
const text = `${result.stdout || ""}\n${result.stderr || ""}`;
|
|
196
|
+
return DOCKER_WORKSPACE_PATH_FAILURE_PATTERNS.some((pattern) => pattern.test(text));
|
|
197
|
+
}
|
|
198
|
+
|
|
186
199
|
export function buildFailedCommandAdvice({ args = {}, commandPolicy = {}, commandResult = {}, config = {}, state = {} } = {}) {
|
|
200
|
+
if (looksLikeDockerWorkspacePathFailure(commandResult, config)) {
|
|
201
|
+
return {
|
|
202
|
+
...adviceForCategory("workspace-path", {
|
|
203
|
+
toolName: "run_command",
|
|
204
|
+
args,
|
|
205
|
+
config,
|
|
206
|
+
state,
|
|
207
|
+
reason:
|
|
208
|
+
"The command referenced a host absolute path that is not mounted inside the Docker workspace. Do not retry shell variants; keep output in the workspace or ask for explicit host-mode approval.",
|
|
209
|
+
}),
|
|
210
|
+
failureKind: "workspace-path",
|
|
211
|
+
};
|
|
212
|
+
}
|
|
187
213
|
if (!looksLikeNetworkFailure(commandResult)) return null;
|
|
188
214
|
return {
|
|
189
215
|
...adviceForCategory(commandPolicy.needsNetwork ? "network-fetch" : "general-shell", {
|