Package io.jenkins.plugins.aiagentjob
Class AiAgentTypeHandler
java.lang.Object
hudson.model.AbstractDescribableImpl<AiAgentTypeHandler>
io.jenkins.plugins.aiagentjob.AiAgentTypeHandler
- All Implemented Interfaces:
ExtensionPoint,Describable<AiAgentTypeHandler>
- Direct Known Subclasses:
ClaudeCodeAgentHandler,CodexAgentHandler,CursorAgentHandler,GeminiCliAgentHandler,OpenCodeAgentHandler
public abstract class AiAgentTypeHandler
extends AbstractDescribableImpl<AiAgentTypeHandler>
implements ExtensionPoint
Describable extension point for an AI agent implementation.
Implementations must define:
getId()— stable identifiergetDefaultApiKeyEnvVar()— env var for the API keybuildDefaultCommand(io.jenkins.plugins.aiagentjob.AiAgentConfiguration, java.lang.String)— CLI command to launch the agentgetLogFormat()— parser for the agent's JSONL outputgetStatsExtractor()— usage stats extractor for the agent's JSONL output
Implementations may optionally override prepareExecution(io.jenkins.plugins.aiagentjob.AiAgentConfiguration, hudson.FilePath, hudson.model.TaskListener) to contribute agent-specific
environment setup/cleanup.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildDefaultCommand(AiAgentConfiguration config, String prompt) abstract Stringabstract StringgetId()Stable identifier for this agent implementation.abstract AiAgentLogFormatReturns the log format parser for this agent's JSONL output.abstract AiAgentStatsExtractorReturns the stats extractor for this agent's JSONL output.prepareExecution(AiAgentConfiguration config, FilePath workspace, TaskListener listener) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Describable
getDescriptor
-
Constructor Details
-
AiAgentTypeHandler
public AiAgentTypeHandler()
-
-
Method Details
-
getId
Stable identifier for this agent implementation. -
getDefaultApiKeyEnvVar
-
buildDefaultCommand
-
prepareExecution
public AiAgentExecutionCustomization prepareExecution(AiAgentConfiguration config, FilePath workspace, TaskListener listener) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
getLogFormat
Returns the log format parser for this agent's JSONL output.The returned format's
AiAgentLogFormat.classify(long, net.sf.json.JSONObject)method should returnnullfor any JSON it does not recognise, so the parser can fall through to the shared format and generic fallback. -
getStatsExtractor
Returns the stats extractor for this agent's JSONL output.The returned extractor's
AiAgentStatsExtractor.extract(net.sf.json.JSONObject, io.jenkins.plugins.aiagentjob.AgentUsageStats)method should returnfalsefor any JSON it does not recognise, so the shared extractor handles it as a fallback.
-