@causyne/agent 1.20.33 → 1.20.34
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 +1 -1
- package/src/agentLoop.js +6 -2
- package/src/agentLoop.ts +8 -2
- package/src/toolPacks.js +7 -1
- package/src/toolPacks.ts +6 -1
package/package.json
CHANGED
package/src/agentLoop.js
CHANGED
|
@@ -2928,7 +2928,9 @@ You are operating in a text-and-code modality without direct image pixel renderi
|
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
// Web Visual Validation Guard (Anti-Slop / Transcendence)
|
|
2931
|
-
const
|
|
2931
|
+
const outcomes = coldObserver.getToolOutcomes(this.taskId);
|
|
2932
|
+
const hasWebOrCodeMutation = this.webArtifacts.size > 0 || outcomes.some((o) => o.success !== false && ['fs_write', 'fs_edit', 'MultiEdit', 'ui_forge', 'write_file', 'write_to_file', 'edit_file', 'replace_file_content', 'multi_replace_file_content'].includes(String(o.tool || '')));
|
|
2933
|
+
const isWebTask = !isLaunchOnlyPrompt(taskPrompt) && !isPlanningOnlyRequest(taskPrompt) && isWebIntent(taskPrompt) && hasWebOrCodeMutation;
|
|
2932
2934
|
let browserReady = false;
|
|
2933
2935
|
let browserDeclined = false;
|
|
2934
2936
|
let browserRuntimeError = '';
|
|
@@ -2988,7 +2990,6 @@ You are operating in a text-and-code modality without direct image pixel renderi
|
|
|
2988
2990
|
// Tool availability and a completed plan are not evidence of visual
|
|
2989
2991
|
// inspection. A failed browser/capture attempt must not become a
|
|
2990
2992
|
// successful task merely because the provider says "verified".
|
|
2991
|
-
const outcomes = coldObserver.getToolOutcomes(this.taskId);
|
|
2992
2993
|
const hasBrowserActOutcome = outcomes.some((o) => o.tool === 'browser_act' && o.success !== false);
|
|
2993
2994
|
const hasPassingTests = outcomes.some((o) => o.success && (isVerificationCommand(o.command || o.tool || '') || /\b(?:test|unittest|vitest|jest|pytest)\b/i.test(o.command || ''))) || (Array.isArray(this._planSteps) && this._planSteps.some(s => s.success && /test/i.test(s.tool)));
|
|
2994
2995
|
let observerVerified = false;
|
|
@@ -3759,6 +3760,9 @@ You are operating in a text-and-code modality without direct image pixel renderi
|
|
|
3759
3760
|
this.emitEvent({ type: result?.success === false || typeof result?.error === 'string' ? 'step_error' : 'step_complete',
|
|
3760
3761
|
tool: functionName, result: eventResult, toolCallId: toolCall.id });
|
|
3761
3762
|
this.stepsCompleted++;
|
|
3763
|
+
if (this._implementationPlanSeeded && result?.success !== false && !result?.error && functionName !== 'update_plan') {
|
|
3764
|
+
this.advanceImplementationPlanProgress('mutation');
|
|
3765
|
+
}
|
|
3762
3766
|
// The procedure, as it actually ran. Tool name plus a whitelisted
|
|
3763
3767
|
// action token only — planCache.toStep() reads no paths, arguments or
|
|
3764
3768
|
// command lines, so what is cached is a route and never a transcript.
|
package/src/agentLoop.ts
CHANGED
|
@@ -3084,7 +3084,11 @@ You are operating in a text-and-code modality without direct image pixel renderi
|
|
|
3084
3084
|
}
|
|
3085
3085
|
|
|
3086
3086
|
// Web Visual Validation Guard (Anti-Slop / Transcendence)
|
|
3087
|
-
const
|
|
3087
|
+
const outcomes = coldObserver.getToolOutcomes(this.taskId);
|
|
3088
|
+
const hasWebOrCodeMutation = this.webArtifacts.size > 0 || outcomes.some((o) =>
|
|
3089
|
+
o.success !== false && ['fs_write', 'fs_edit', 'MultiEdit', 'ui_forge', 'write_file', 'write_to_file', 'edit_file', 'replace_file_content', 'multi_replace_file_content'].includes(String(o.tool || ''))
|
|
3090
|
+
);
|
|
3091
|
+
const isWebTask = !isLaunchOnlyPrompt(taskPrompt) && !isPlanningOnlyRequest(taskPrompt) && isWebIntent(taskPrompt) && hasWebOrCodeMutation;
|
|
3088
3092
|
let browserReady = false;
|
|
3089
3093
|
let browserDeclined = false;
|
|
3090
3094
|
let browserRuntimeError = '';
|
|
@@ -3141,7 +3145,6 @@ You are operating in a text-and-code modality without direct image pixel renderi
|
|
|
3141
3145
|
// Tool availability and a completed plan are not evidence of visual
|
|
3142
3146
|
// inspection. A failed browser/capture attempt must not become a
|
|
3143
3147
|
// successful task merely because the provider says "verified".
|
|
3144
|
-
const outcomes = coldObserver.getToolOutcomes(this.taskId);
|
|
3145
3148
|
const hasBrowserActOutcome = outcomes.some(
|
|
3146
3149
|
(o) => o.tool === 'browser_act' && o.success !== false
|
|
3147
3150
|
);
|
|
@@ -3978,6 +3981,9 @@ You are operating in a text-and-code modality without direct image pixel renderi
|
|
|
3978
3981
|
this.emitEvent({ type: result?.success === false || typeof result?.error === 'string' ? 'step_error' : 'step_complete',
|
|
3979
3982
|
tool: functionName, result: eventResult, toolCallId: toolCall.id });
|
|
3980
3983
|
this.stepsCompleted++;
|
|
3984
|
+
if (this._implementationPlanSeeded && result?.success !== false && !result?.error && functionName !== 'update_plan') {
|
|
3985
|
+
this.advanceImplementationPlanProgress('mutation');
|
|
3986
|
+
}
|
|
3981
3987
|
|
|
3982
3988
|
// The procedure, as it actually ran. Tool name plus a whitelisted
|
|
3983
3989
|
// action token only — planCache.toStep() reads no paths, arguments or
|
package/src/toolPacks.js
CHANGED
|
@@ -349,7 +349,13 @@ export function isGameIntent(prompt) {
|
|
|
349
349
|
}
|
|
350
350
|
/** True when the prompt genuinely describes web/UI work. */
|
|
351
351
|
export function isWebIntent(prompt) {
|
|
352
|
-
|
|
352
|
+
if (!prompt)
|
|
353
|
+
return false;
|
|
354
|
+
const sanitized = prompt
|
|
355
|
+
.replace(/\b(?:adobe|photoshop|premiere|after\s*effects|illustrator|indesign|extendscript|uxp)\s+dom\b/gi, '')
|
|
356
|
+
.replace(/\bdom\s*\/\s*python\b/gi, '')
|
|
357
|
+
.replace(/\bdom\s+simulat(?:or|ion)\b/gi, '');
|
|
358
|
+
return WEB_INTENT.test(sanitized);
|
|
353
359
|
}
|
|
354
360
|
/**
|
|
355
361
|
* Decide which packs to unlock before the first LLM call, so the common case
|
package/src/toolPacks.ts
CHANGED
|
@@ -397,7 +397,12 @@ export function isGameIntent(prompt?: string | null): boolean {
|
|
|
397
397
|
|
|
398
398
|
/** True when the prompt genuinely describes web/UI work. */
|
|
399
399
|
export function isWebIntent(prompt?: string | null): boolean {
|
|
400
|
-
|
|
400
|
+
if (!prompt) return false;
|
|
401
|
+
const sanitized = prompt
|
|
402
|
+
.replace(/\b(?:adobe|photoshop|premiere|after\s*effects|illustrator|indesign|extendscript|uxp)\s+dom\b/gi, '')
|
|
403
|
+
.replace(/\bdom\s*\/\s*python\b/gi, '')
|
|
404
|
+
.replace(/\bdom\s+simulat(?:or|ion)\b/gi, '');
|
|
405
|
+
return WEB_INTENT.test(sanitized);
|
|
401
406
|
}
|
|
402
407
|
|
|
403
408
|
/**
|