Class CaptureManager
java.lang.Object
com.shaft.capture.runtime.CaptureManager
- All Implemented Interfaces:
AutoCloseable
Thread-safe local lifecycle API shared by CLI and MCP capture controls.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the live SHAFT driver wrapping the recorded browser while a capture session is ACTIVE, so element-level tools can drive the recorded browser (agent-performed codegen: start a session, perform the described actions, stop, generate).checkpoint(String description, Checkpoint.CheckpointKind kind) Adds a human-review checkpoint to the active session.voidclose()mode()Returns the recorder's current live authoring mode:record(default; the recorder captures interactions as replayable steps) orinspect(the recorder overlay highlights hovered elements for a live locator pick instead of recording an interaction step).Returns the list of network transactions from the active session.networkTransactions(NetworkCaptureOptions options, int limit) Returns network transactions from the active session filtered per the supplied capture options, bounded to the most recentlimitentries in capture order.Sets the recorder's live authoring mode.start(CaptureStartRequest request) Starts one managed browser capture.status()Returns the latest safe status without captured values.steps()Returns the current server-side step list for the active session, so the recorder UI (or an external control client) can rehydrate its step list from the session store rather than page-scoped browser storage.stop(boolean discard) Stops the active session.
-
Constructor Details
-
CaptureManager
public CaptureManager()Creates the default managed recorder lifecycle.
-
-
Method Details
-
start
Starts one managed browser capture.- Parameters:
request- validated start request- Returns:
- active recorder status
-
status
Returns the latest safe status without captured values.- Returns:
- recorder status
-
activeShaftDriver
Returns the live SHAFT driver wrapping the recorded browser while a capture session is ACTIVE, so element-level tools can drive the recorded browser (agent-performed codegen: start a session, perform the described actions, stop, generate).- Returns:
- the active session's SHAFT driver, or empty when no session is active
-
steps
Returns the current server-side step list for the active session, so the recorder UI (or an external control client) can rehydrate its step list from the session store rather than page-scoped browser storage.- Returns:
- ordered safe step summaries, or an empty list when no session is active
-
mode
Returns the recorder's current live authoring mode:record(default; the recorder captures interactions as replayable steps) orinspect(the recorder overlay highlights hovered elements for a live locator pick instead of recording an interaction step). This is in-memory only, mirroringsteps()/status(): it reflects the live recorder, not durable session state.- Returns:
"record"or"inspect"
-
setMode
Sets the recorder's live authoring mode.- Parameters:
requestedMode-"record"or"inspect"(case-insensitive)- Returns:
- the mode now in effect
- Throws:
IllegalArgumentException- whenrequestedModeis not a supported mode
-
networkTransactions
Returns the list of network transactions from the active session.- Returns:
- ordered network transaction summaries, or an empty list when no session is active
-
networkTransactions
Returns network transactions from the active session filtered per the supplied capture options, bounded to the most recentlimitentries in capture order.- Parameters:
options- asset-noise and pattern filters;nullapplies no filteringlimit- maximum number of transactions to return; non-positive values are treated as unbounded- Returns:
- ordered, filtered, bounded network transaction summaries
-
checkpoint
Adds a human-review checkpoint to the active session.- Parameters:
description- checkpoint descriptionkind- checkpoint kind- Returns:
- updated status
-
stop
Stops the active session.- Parameters:
discard- whether to remove capture artifacts after clean shutdown- Returns:
- final status
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-