@lazyingart/agintiflow 0.20.75 → 0.20.76
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.76",
|
|
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",
|
|
@@ -279,6 +279,28 @@ try {
|
|
|
279
279
|
});
|
|
280
280
|
assert(permissionAdvice.suggestedCommand.includes("coding-policy-smoke"), "permission advice did not include resume session id");
|
|
281
281
|
assert(permissionAdvice.suggestedCommand.includes("--sandbox-mode docker-workspace"), "permission advice did not suggest docker-workspace recovery");
|
|
282
|
+
const destructiveAdvice = buildPermissionAdvice({
|
|
283
|
+
toolName: "run_command",
|
|
284
|
+
args: { command: "rm -rf reports && git reset --hard" },
|
|
285
|
+
guard: { category: "destructive", reason: "Destructive shell commands require Allow destructive actions." },
|
|
286
|
+
config: dockerWorkspacePolicy,
|
|
287
|
+
state: { sessionId: "coding-destructive-smoke" },
|
|
288
|
+
});
|
|
289
|
+
const destructiveAdviceText = [
|
|
290
|
+
destructiveAdvice.summary,
|
|
291
|
+
...(destructiveAdvice.options || []),
|
|
292
|
+
destructiveAdvice.suggestedCommand,
|
|
293
|
+
destructiveAdvice.destructiveApprovalCommand,
|
|
294
|
+
].join("\n");
|
|
295
|
+
assert(/dry-run|inspect-only/i.test(destructiveAdviceText), "destructive advice did not lead with dry-run or inspect-only alternatives");
|
|
296
|
+
assert(
|
|
297
|
+
!destructiveAdvice.suggestedCommand.includes("--allow-destructive"),
|
|
298
|
+
"default destructive advice suggested command should not enable destructive mode"
|
|
299
|
+
);
|
|
300
|
+
assert(
|
|
301
|
+
destructiveAdvice.destructiveApprovalCommand.includes("--allow-destructive"),
|
|
302
|
+
"destructive advice did not provide an explicit approval command"
|
|
303
|
+
);
|
|
282
304
|
const failedNetworkAdvice = buildFailedCommandAdvice({
|
|
283
305
|
args: { command: "git clone https://github.com/lazyingart/AgInTiFlow.git" },
|
|
284
306
|
commandPolicy: clonePolicy,
|
package/src/behavior-contract.js
CHANGED
|
@@ -69,6 +69,7 @@ export function formatBehaviorContractForPrompt({ mode = "runtime" } = {}) {
|
|
|
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
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
|
+
"When destructive cleanup is blocked, lead with inspect-only or dry-run evidence (`git status`, `git clean -nd`, targeted file lists). Do not call delete/reset/clean commands safe unless they are clearly labeled as requiring explicit user approval.",
|
|
72
73
|
"Protect secrets aggressively: never repeat token/key/password/secret values from prompts, files, tool output, plans, final answers, reports, diffs, or artifacts. Redact the value as [REDACTED] and use dedicated key storage such as `aginti keys set` when credentials are needed.",
|
|
73
74
|
"Keep artifacts durable and discoverable with descriptive non-conflicting names; never overwrite unless the user clearly asked.",
|
|
74
75
|
"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.",
|
package/src/permission-advice.js
CHANGED
|
@@ -135,7 +135,40 @@ function adviceForCategory(category = "", { toolName = "", args = {}, config = {
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
if (category === "destructive"
|
|
138
|
+
if (category === "destructive") {
|
|
139
|
+
return {
|
|
140
|
+
...base,
|
|
141
|
+
summary:
|
|
142
|
+
"This command is destructive and was blocked. Do not retry variants. First offer inspect-only or dry-run cleanup evidence; destructive cleanup requires explicit user approval.",
|
|
143
|
+
options: [
|
|
144
|
+
"Inspect only: run non-destructive checks such as `git status --short`, `git clean -nd`, `find <path> -maxdepth ... -print`, or targeted file listings.",
|
|
145
|
+
"Safer cleanup plan: write a report listing exact files that would be removed, then ask the user before deletion.",
|
|
146
|
+
"Explicit destructive approval: only rerun with --allow-destructive after the user accepts the data-loss risk.",
|
|
147
|
+
],
|
|
148
|
+
suggestedCommand: resumeCommand({
|
|
149
|
+
config,
|
|
150
|
+
state,
|
|
151
|
+
sandboxMode: "docker-workspace",
|
|
152
|
+
prompt: "Continue with inspect-only or dry-run cleanup evidence. Do not delete, reset, clean, or overwrite anything unless the user explicitly approves destructive actions.",
|
|
153
|
+
}),
|
|
154
|
+
destructiveApprovalCommand: resumeCommand({
|
|
155
|
+
config,
|
|
156
|
+
state,
|
|
157
|
+
sandboxMode: "docker-workspace",
|
|
158
|
+
destructive: true,
|
|
159
|
+
prompt: "Continue after the user explicitly approved destructive project-local cleanup. Inspect first, delete only the named targets, and verify git status afterwards.",
|
|
160
|
+
}),
|
|
161
|
+
trustedHostCommand: resumeCommand({
|
|
162
|
+
config,
|
|
163
|
+
state,
|
|
164
|
+
sandboxMode: "host",
|
|
165
|
+
destructive: true,
|
|
166
|
+
prompt: "Continue after the user explicitly approved trusted host destructive execution. Inspect first, avoid unrelated files, and keep git status understandable.",
|
|
167
|
+
}),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (category === "permission-change" || category === "general-shell") {
|
|
139
172
|
return {
|
|
140
173
|
...base,
|
|
141
174
|
summary:
|