Skip to main content

Event Types & Enums

These types are shared across the backend, TypeScript SDK, and Python SDK.

EventType

The type of event being sent to Sequenceware.

ValueWhen to send
run.startedAgent begins a task
run.completedAgent finishes successfully
run.failedAgent encounters an error
step.startedAgent begins a sub-task / phase
step.completedAgent finishes a sub-task
tool.calledAgent is about to use a tool
tool.completedTool execution finished
tool.blockedTool call was blocked by a policy
risk.detectedRisk event flagged
approval.requestedApproval request created
approval.approvedApproval granted
approval.rejectedApproval denied
policy.matchedA policy matched a tool call
import { EventType } from '@sequenceware/sdk';

EventType.RUN_STARTED // 'run.started'
EventType.RUN_COMPLETED // 'run.completed'
EventType.RUN_FAILED // 'run.failed'
EventType.TOOL_CALLED // 'tool.called'
EventType.TOOL_COMPLETED // 'tool.completed'
EventType.TOOL_BLOCKED // 'tool.blocked'
// ...

PolicyAction

The action a policy takes when it matches a tool call.

ValueDescription
allowLet the tool call proceed
warnLet it proceed, flag in dashboard
blockReject the tool call immediately
require_approvalPause until a human approves
import { PolicyAction } from '@sequenceware/sdk';

ApprovalStatus

The status of an approval request.

ValueDescription
pendingWaiting for a reviewer
approvedReviewer approved
rejectedReviewer rejected
import { ApprovalStatus } from '@sequenceware/sdk';

ToolCallStatus

The status of a tool call after policy evaluation.

ValueDescription
pendingBeing processed
completedExecution finished
blockedBlocked by a policy
awaiting_approvalPaused, waiting for approval
import { ToolCallStatus } from '@sequenceware/sdk';

RiskSeverity

Risk severity levels.

ValueDescription
lowMinor concern
mediumModerate concern
highSignificant concern
criticalImmediate attention required
import { RiskSeverity } from '@sequenceware/sdk';

ActionType

Semantic action types for tool calls. Used with the actionHint parameter.

ValueDescription
pr_createCreating a pull request
pr_mergeMerging a pull request
pr_updateUpdating a pull request
branch_deleteDeleting a branch
deployDeploying to an environment
script_executeExecuting a script
db_migrateRunning database migrations
config_changeChanging configuration
secret_accessAccessing secrets/credentials
api_writeWriting via an external API
unknownUnclassified action
import { ActionType } from '@sequenceware/sdk';

AgentContext

Provides additional context about the agent's intent and reasoning. Can be attached to runs and tool calls to improve observability and audit quality.

interface AgentContext {
goal?: string; // User's original task/instruction
reasoning?: string; // Agent's chain-of-thought before this action
conversationId?: string; // External reference to conversation thread
promptSummary?: string; // Summary of active prompt/context
}
FieldTypeDescription
goalstring?The user's original task or instruction the agent is working on
reasoningstring?The agent's chain-of-thought or rationale before taking this action
conversationIdstring?External reference to the conversation thread (e.g., from a chat UI)
promptSummarystring?Summary of the active prompt or context window

Pass agentContext as a parameter to startRun() and trackToolCall(). It is stored on runs and tool calls, and forwarded to approval requests for reviewer context.

import { AgentContext } from '@sequenceware/sdk';

TypeScript interfaces

All interfaces are exported from @sequenceware/sdk:

import type {
ClientConfig,
SequencewareEvent,
AgentContext,
ApprovalRequest,
Policy,
RunSummary,
AuditLog,
} from '@sequenceware/sdk';

See the Client Reference for detailed interface definitions.