Skip to main content

Module agent_temp

Module agent_temp 

Source
Expand description

Managed workspace-local temporary artifacts for model-driven helpers.

Initialize advertises one stable directory per Winx session under <workspace>/.winx/tmp/. The directory is intentionally not created until a file tool actually needs it, so merely inspecting a repository does not dirty its working tree. File tools enforce a small path and storage budget; Bash remains governed by its own operator-selected command policy.

Structs§

AgentTempInfo
Policy information returned by Initialize and reused by file-tool errors.
TempEdit
A resolved edit and its size change, used to validate a MultiFileEdit against the workspace-wide quota before any file is committed.

Constants§

MAX_AGE
Session directories with no filesystem activity for this long are pruned when another session initializes in the same workspace.
MAX_COMPONENT_BYTES
Prevent payloads from being smuggled into a filename or directory component.
MAX_FILE_BYTES
One helper should remain small enough to inspect and remove cheaply.
MAX_RELATIVE_COMPONENTS
Depth beneath the session directory, including the target filename.
MAX_RELATIVE_PATH_BYTES
Bound the whole session-relative path independently of component count.
MAX_TOTAL_BYTES
Workspace-wide budget shared by all managed temporary sessions.

Functions§

prepare_session
Return the session policy and best-effort prune expired sibling sessions. The active directory is not created here; FileWriteOrEdit creates it on demand through its normal parent-directory path.
session_info
Compute the stable session directory without touching the filesystem.
validate_bash_command
Reject statically visible shell writes that bypass the managed session area.
validate_batch_quota
Validate the aggregate size of a MultiFileEdit after every target has been planned and duplicate paths have been rejected.
validate_edit_target
Validate one FileWriteOrEdit target. Non-temporary project files keep their existing behavior; only legacy Winx root artifacts and .winx/tmp receive this additional governance.