Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalChainingTraceIDs(traceIDs []string) []string
- func CanonicalEventTime(value time.Time) time.Time
- func CanonicalPublicWorkstationKind(kind WorkstationKind) string
- func ChainingTraceDepthForTokenColor(color TokenColor) int
- func ChainingTraceDepthForWorkItem(item FactoryWorkItem) int
- func ChainingTraceDepthFromTokenColors(colors []TokenColor) int
- func ClearGuardBlockingFields(history *TokenHistory)
- func CloneFactoryWorldInferenceAttemptsByDispatchID(attemptsByDispatchID map[string]map[string]FactoryWorldInferenceAttempt) map[string]map[string]FactoryWorldInferenceAttempt
- func CurrentChainingTraceIDFromTokenColors(colors []TokenColor) string
- func CurrentChainingTraceIDFromTokens(tokens []Token) string
- func CurrentChainingTraceIDFromWorkItems(items []FactoryWorkItem) string
- func GeneratedProviderFailureMetadata(failure *ProviderFailureMetadata) *factoryapi.ProviderFailureMetadata
- func GeneratedProviderSessionMetadata(session *ProviderSessionMetadata) *factoryapi.ProviderSessionMetadata
- func GeneratedPublicFactoryHostedWorkerProvider(value string) factoryapi.HostedWorkerProvider
- func GeneratedPublicFactoryHostedWorkerProviderPtr(value string) *factoryapi.HostedWorkerProvider
- func GeneratedPublicFactoryRunnerID(value string) factoryapi.RunnerID
- func GeneratedPublicFactoryRunnerIDPtr(value string) *factoryapi.RunnerID
- func GeneratedPublicFactoryRunnerSelectionSource(value string) factoryapi.RunnerSelectionSource
- func GeneratedPublicFactoryRunnerSelectionSourcePtr(value string) *factoryapi.RunnerSelectionSource
- func GeneratedPublicFactoryWorkerModelLocality(value string) factoryapi.WorkerModelLocality
- func GeneratedPublicFactoryWorkerModelLocalityPtr(value string) *factoryapi.WorkerModelLocality
- func GeneratedPublicFactoryWorkerModelOperationContentType(value string) factoryapi.ModelOperationContentType
- func GeneratedPublicFactoryWorkerModelOperationContentTypePtr(value string) *factoryapi.ModelOperationContentType
- func GeneratedPublicFactoryWorkerModelProvider(value string) factoryapi.WorkerModelProvider
- func GeneratedPublicFactoryWorkerModelProviderPtr(value string) *factoryapi.WorkerModelProvider
- func GeneratedPublicFactoryWorkerProvider(value string) factoryapi.WorkerProvider
- func GeneratedPublicFactoryWorkerProviderPtr(value string) *factoryapi.WorkerProvider
- func GeneratedPublicFactoryWorkerType(value string) factoryapi.WorkerType
- func GeneratedPublicFactoryWorkerTypePtr(value string) *factoryapi.WorkerType
- func GeneratedPublicFactoryWorkstationType(value string) factoryapi.WorkstationType
- func GeneratedPublicFactoryWorkstationTypePtr(value string) *factoryapi.WorkstationType
- func GeneratedPublicWorkstationKind(kind WorkstationKind) factoryapi.WorkstationKind
- func GeneratedPublicWorkstationKindPtr(kind WorkstationKind) *factoryapi.WorkstationKind
- func GeneratedSafeWorkDiagnostics(diagnostics *SafeWorkDiagnostics) *factoryapi.SafeWorkDiagnostics
- func GeneratedSafeWorkDiagnosticsFromWorkDiagnostics(diagnostics *WorkDiagnostics) *factoryapi.SafeWorkDiagnostics
- func GeneratedWorkFailureMetadata(failure *WorkFailureMetadata) *factoryapi.ProviderFailureMetadata
- func IsBuiltInRunnerID(id string) bool
- func IsSystemTimePlace(placeID string) bool
- func IsSystemTimeToken(token *Token) bool
- func IsSystemTimeWorkType(workTypeID string) bool
- func NormalizeRunnerID(id string) string
- func PermissivePublicFactoryHostedWorkerProvider(value string) string
- func PermissivePublicFactoryResourceType(value string) string
- func PermissivePublicFactoryRunnerID(value string) string
- func PermissivePublicFactoryRunnerSelectionSource(value string) string
- func PermissivePublicFactoryWorkerModelLocality(value string) string
- func PermissivePublicFactoryWorkerModelOperationContentType(value string) string
- func PermissivePublicFactoryWorkerModelProvider(value string) string
- func PermissivePublicFactoryWorkerProvider(value string) string
- func PermissivePublicFactoryWorkerType(value string) string
- func PermissivePublicFactoryWorkstationType(value string) string
- func PermissivePublicWorkTypeHandlingBehavior(value string) string
- func PreviousChainingTraceIDsFromTokenColors(colors []TokenColor) []string
- func PreviousChainingTraceIDsFromTokens(tokens []Token) []string
- func PreviousChainingTraceIDsFromWorkItems(items []FactoryWorkItem) []string
- func PublicWorkerModelProviderFromInternal(provider ModelProvider) (factoryapi.WorkerModelProvider, bool)
- func ResolveOpenCodeAgent(workstationAgent, workerAgent string) string
- func StrictPublicFactoryHostedWorkerProvider(value string) string
- func StrictPublicFactoryResourceType(value string) string
- func StrictPublicFactoryRunnerID(value string) string
- func StrictPublicFactoryRunnerSelectionSource(value string) string
- func StrictPublicFactoryWorkerModelLocality(value string) string
- func StrictPublicFactoryWorkerModelOperationContentType(value string) string
- func StrictPublicFactoryWorkerModelProvider(value string) string
- func StrictPublicFactoryWorkerProvider(value string) string
- func StrictPublicFactoryWorkerType(value string) string
- func StrictPublicFactoryWorkstationType(value string) string
- func StrictPublicWorkTypeHandlingBehavior(value string) string
- func StrictPublicWorkstationKind(value string) string
- func ValidateOpenCodeAgentForRunnerSelection(workstationAgent, workerAgent string, selection ResolvedRunnerSelection) error
- type ActiveThrottlePause
- type ArcMode
- type BundledFileConfig
- type BundledFileContentConfig
- type ClassificationRouteConfig
- type CommandDiagnostic
- type CompletedDispatch
- type CronConfig
- type DataType
- type DispatchEntry
- type DispatchRecord
- type EnabledTransition
- type EngineStateSnapshot
- type ExecutionMetadata
- type FactoryCompletionRecord
- type FactoryConfig
- type FactoryConstraint
- type FactoryDispatchRecord
- type FactoryEventStream
- type FactoryGuardConfig
- type FactoryPlace
- type FactoryPlaceOccupancy
- type FactoryRelation
- type FactoryResource
- type FactoryResourceUnit
- type FactoryState
- type FactoryStateChangePayload
- type FactoryStateDefinition
- type FactorySubmissionRecord
- type FactoryTerminalWork
- type FactoryTraceData
- type FactoryVersion
- type FactoryWorkItem
- type FactoryWorkType
- type FactoryWorker
- type FactoryWorkstation
- type FactoryWorkstationConfig
- type FactoryWorkstationRef
- type FactoryWorldActiveExecution
- type FactoryWorldActivity
- type FactoryWorldDispatch
- type FactoryWorldDispatchCompletion
- type FactoryWorldFailureDetail
- type FactoryWorldInferenceAttempt
- type FactoryWorldPlaceRef
- type FactoryWorldProviderSessionRecord
- type FactoryWorldRuntimeView
- type FactoryWorldScriptRequest
- type FactoryWorldScriptResponse
- type FactoryWorldSessionRuntime
- type FactoryWorldState
- type FactoryWorldSubmitWorkType
- type FactoryWorldThrottlePause
- type FactoryWorldTopologyView
- type FactoryWorldTrace
- type FactoryWorldView
- type FactoryWorldWorkItemRef
- type FactoryWorldWorkStateChangeRecord
- type FactoryWorldWorkstationEdge
- type FactoryWorldWorkstationNode
- type FailureRecord
- type FiringDecision
- type GeneratedSubmissionBatch
- type GeneratedSubmissionBatchMetadata
- type GuardConfig
- type GuardMatchConfig
- type GuardType
- type HostedLinearWorkerClaimConfig
- type HostedLinearWorkerConfig
- type HostedLinearWorkerMappingConfig
- type HostedWorkerAuthConfig
- type IOConfig
- type InferenceResponse
- type InitialStructurePayload
- type InputGuardConfig
- type InputKind
- type InputTypeConfig
- type MarkingMutation
- type ModelOperation
- type ModelOperationBinding
- type ModelOperationBindingSelector
- type ModelOperationBindingSource
- type ModelOperationSlot
- type ModelProvider
- type MutationType
- type OperatorMoveResult
- type PanicDiagnostic
- type PortableResourceManifestConfig
- type ProviderDiagnostic
- type ProviderErrorFamily
- type ProviderErrorType
- type ProviderFailureDecision
- type ProviderFailureMetadata
- type ProviderInferenceRequest
- type ProviderSessionMetadata
- type Relation
- type RelationType
- type RelationshipChangePayload
- type RenderedPromptDiagnostic
- type ReplayArtifact
- type ReplayDiagnostics
- type ReplayWallClockMetadata
- type RequiredToolConfig
- type ResolvedModelOperationBinding
- type ResolvedRunnerSelection
- type ResourceConfig
- type RunnerBaselineCapability
- type RunnerCapabilities
- type RunnerExecutionRequest
- type RunnerExecutionResult
- type RunnerMetadata
- type RunnerOptionalCapability
- type RunnerOptionalCapabilityStatus
- type RunnerOptionalCapabilitySupport
- type RunnerSelectionSource
- type RunnerToolExecutionMode
- type RuntimeConfigLookup
- type RuntimeDefinitionLookup
- type RuntimeMode
- type RuntimeStatus
- type RuntimeWorkstationLookup
- type SafeProviderDiagnostic
- type SafeRenderedPromptDiagnostic
- type SafeWorkDiagnostics
- type StateConfig
- type StateType
- type SubmissionHookContext
- type SubmissionHookResult
- type SubmitRequest
- type SubprocessExecutionRequest
- type TickResult
- type Token
- type TokenColor
- type TokenHistory
- type TokenMutationRecord
- type TransitionConfig
- type Work
- type WorkContentPart
- type WorkContentPartType
- type WorkDiagnostics
- type WorkDispatch
- type WorkFailureDecision
- type WorkFailureFamily
- type WorkFailureMetadata
- func CanonicalWorkFailureMetadata(failure *WorkFailureMetadata, providerFailure *ProviderFailureMetadata) *WorkFailureMetadata
- func CloneWorkFailureMetadata(failure *WorkFailureMetadata) *WorkFailureMetadata
- func WorkFailureMetadataFromGenerated(failure *factoryapi.ProviderFailureMetadata) *WorkFailureMetadata
- type WorkFailureType
- type WorkInputPayload
- type WorkMetrics
- type WorkOutcome
- type WorkPayloadContinuity
- type WorkPayloadLineageProjection
- func (p *WorkPayloadLineageProjection) RecordConsumedInputSnapshot(dispatchID string, item FactoryWorkItem)
- func (p *WorkPayloadLineageProjection) RecordDispatchOutputSnapshot(observedTick int, dispatchID string, consumedInputs []FactoryWorkItem, ...)
- func (p *WorkPayloadLineageProjection) RecordWorkRequestSnapshot(observedTick int, requestID string, item FactoryWorkItem)
- func (p WorkPayloadLineageProjection) ResolveConsumedInputSnapshot(dispatchID, workID string) WorkPayloadResolution
- func (p WorkPayloadLineageProjection) ResolveInitialSubmittedSnapshot(workID string) WorkPayloadResolution
- func (p WorkPayloadLineageProjection) ResolveOutputWorkSnapshot(dispatchID, workID string) WorkPayloadResolution
- func (p WorkPayloadLineageProjection) ResolveSelectedWorkSnapshot(workID string) WorkPayloadResolution
- type WorkPayloadRef
- type WorkPayloadResolution
- type WorkPayloadResolutionStatus
- type WorkPayloadSnapshot
- type WorkPayloadSnapshotKind
- type WorkRelation
- type WorkRelationType
- type WorkRequest
- type WorkRequestNormalizeOptions
- type WorkRequestPayload
- type WorkRequestRecord
- type WorkRequestSubmitResult
- type WorkRequestSubmittedWork
- type WorkRequestType
- type WorkResult
- type WorkStateChangeRecord
- type WorkStateChangeSource
- type WorkTypeConfig
- type WorkerConfig
- type WorkerState
- type WorkflowConfig
- type WorkstationExecutionRequest
- type WorkstationInput
- type WorkstationKind
- type WorkstationLimits
- type WorkstationOutput
- type WorkstationRequestPayload
- type WorkstationResponsePayload
- type WorkstationResult
Constants ¶
const ( FactoryDir = "factory" WorkflowsDir = "workflows" WorkTypesDir = "work-types" InputsDir = "inputs" WorkersDir = "workers" WorkstationsDir = "workstations" DefaultChannelName = "default" ArtifactsDirectory = "artifacts" StateDir = "state" TransitionsDir = "transitions" ArcsDir = "arcs" GuardsDir = "guards" ResourcesDir = "resources" TokensDir = "tokens" MarkingsDir = "markings" FactoryAgentsFileName = "AGENTS.md" // relevant files. FactoryConfigFile = "factory.json" CurrentFactoryPointerFile = ".current-factory" MetadataFile = "metadata.json" MarkingFile = "marking.json" )
const ( WorkID = "work_id" WorkTypeID = "work_type_id" TraceID = "trace_id" ParentID = "parent_id" Tags = "tags" Relations = "relations" Payload = "payload" )
Token fields These are fields that are used to color tokens as they go through the petri net.
const ( SystemTimeWorkTypeID = "__system_time" SystemTimePendingState = "pending" SystemTimePendingPlaceID = SystemTimeWorkTypeID + ":" + SystemTimePendingState SystemTimeExpiryTransitionID = SystemTimeWorkTypeID + ":expire" SystemTimeDashboardWorkTypeID = "time" SystemTimeDashboardPendingPlaceID = SystemTimeDashboardWorkTypeID + ":" + SystemTimePendingState SystemTimeDashboardExpiryTransitionID = SystemTimeDashboardWorkTypeID + ":expire" TimeWorkTagKeySource = "agent_factory.source" TimeWorkTagKeyCronWorkstation = "agent_factory.cron.workstation" TimeWorkTagKeyNominalAt = "agent_factory.time.nominal_at" TimeWorkTagKeyDueAt = "agent_factory.time.due_at" TimeWorkTagKeyExpiresAt = "agent_factory.time.expires_at" TimeWorkTagKeyJitter = "agent_factory.time.jitter" TimeWorkSourceCron = "cron" )
Internal time work contract.
const ( WorkerTypeModel = "MODEL_WORKER" WorkerTypeScript = "SCRIPT_WORKER" WorkerTypeHosted = "HOSTED_WORKER" )
WorkerType constants for worker AGENTS.md frontmatter.
const ( WorkstationTypeModel = "MODEL_WORKSTATION" WorkstationTypeInvoke = "MODEL_INVOKE" WorkstationTypeLogical = "LOGICAL_MOVE" WorkstationTypeClassify = "CLASSIFIER_WORKSTATION" )
WorkstationType constants for workstation AGENTS.md frontmatter.
const ( ResourceTypeModel = "MODEL" ResourceTypeProviderQuota = "PROVIDER_QUOTA" ResourceTypeInvocationSlot = "INVOCATION_SLOT" )
const ( // BundledFileTypeScript is the canonical manifest type for portable script assets. BundledFileTypeScript = "SCRIPT" // BundledFileTypeDoc is the canonical manifest type for portable documentation assets. BundledFileTypeDoc = "DOC" // BundledFileTypeInput is the canonical manifest type for portable starter // work files that restore under factory/inputs/... BundledFileTypeInput = "INPUT" // BundledFileTypeRootHelper is the canonical manifest type for supported // project-root helper files such as Makefile. BundledFileTypeRootHelper = "ROOT_HELPER" )
const ( ModelLocalityLocal = "LOCAL" ModelLocalityCloud = "CLOUD" )
const ( ModelOperationContentTypeText = "TEXT" ModelOperationContentTypeImage = "IMAGE" ModelOperationContentTypeAudio = "AUDIO" ModelOperationContentTypeJSON = "JSON" ModelOperationContentTypeBinary = "BINARY" )
const ( RunnerIDCodex = "codex" RunnerIDGemini = "gemini" RunnerIDKiro = "kiro" RunnerIDCursorCLI = "cursor-cli" RunnerIDOpenCode = "opencode" )
const (
// BundledFileEncodingUTF8 declares plain UTF-8 inline content.
BundledFileEncodingUTF8 = "utf-8"
)
const (
HostedWorkerProviderLinear = "LINEAR"
)
Hosted worker provider constants for public hosted worker config.
const (
JsonExtension = ".json"
)
const (
// These are well known tags that are used to store data for the messages between executors.
RejectionFeedback = "_rejection_feedback"
)
Executor configuration These are keys to store data for the messages between executors.
const (
ResourceStateAvailable = "available"
)
Resource avialable states
const WorkTypeHandlingBehaviorDefault = "DEFAULT"
WorkTypeHandlingBehaviorDefault marks the work type that receives simplified CLI prompt submissions.
Variables ¶
var ErrMoveWorkRequestAlreadyApplied = errors.New("operator move request was already applied")
ErrMoveWorkRequestAlreadyApplied reports a duplicate operator move requestId.
Functions ¶
func CanonicalChainingTraceIDs ¶
CanonicalChainingTraceIDs applies the shared chaining-trace fan-in rule: keep only non-empty predecessor chain IDs, dedupe them, and sort them.
func CanonicalEventTime ¶ added in v0.0.5
CanonicalEventTime normalizes runtime event boundary timestamps to UTC while preserving zero values so optional/fallback handling remains explicit.
func CanonicalPublicWorkstationKind ¶
func CanonicalPublicWorkstationKind(kind WorkstationKind) string
CanonicalPublicWorkstationKind returns the public factory-config enum value for a runtime workstation kind while preserving unknown values verbatim.
func ChainingTraceDepthForTokenColor ¶ added in v0.0.3
func ChainingTraceDepthForTokenColor(color TokenColor) int
ChainingTraceDepthForTokenColor returns the stored chain depth for one token color, falling back to depth 1 when only a trace identifier is available.
func ChainingTraceDepthForWorkItem ¶ added in v0.0.3
func ChainingTraceDepthForWorkItem(item FactoryWorkItem) int
ChainingTraceDepthForWorkItem returns the stored chain depth for one work item, falling back to depth 1 when only a trace identifier is available.
func ChainingTraceDepthFromTokenColors ¶ added in v0.0.3
func ChainingTraceDepthFromTokenColors(colors []TokenColor) int
ChainingTraceDepthFromTokenColors resolves the next chain depth from the deepest non-resource token color, defaulting initial traced work to depth 1.
func ClearGuardBlockingFields ¶ added in v0.0.5
func ClearGuardBlockingFields(history *TokenHistory)
ClearGuardBlockingFields resets visit and failure-count guard counters while preserving customer-visible failure history during operator recovery moves.
func CloneFactoryWorldInferenceAttemptsByDispatchID ¶
func CloneFactoryWorldInferenceAttemptsByDispatchID( attemptsByDispatchID map[string]map[string]FactoryWorldInferenceAttempt, ) map[string]map[string]FactoryWorldInferenceAttempt
CloneFactoryWorldInferenceAttemptsByDispatchID returns a detached copy of selected-tick inference attempts keyed by dispatch and request ID.
func CurrentChainingTraceIDFromTokenColors ¶ added in v0.0.3
func CurrentChainingTraceIDFromTokenColors(colors []TokenColor) string
func CurrentChainingTraceIDFromTokens ¶
CurrentChainingTraceIDFromTokens resolves the current dispatch chain from the first non-resource customer work token, falling back to any non-resource token when only system work is present.
func CurrentChainingTraceIDFromWorkItems ¶
func CurrentChainingTraceIDFromWorkItems(items []FactoryWorkItem) string
CurrentChainingTraceIDFromWorkItems resolves the current dispatch chain from the first non-system customer work item, falling back to any work item when only system work is present.
func GeneratedProviderFailureMetadata ¶
func GeneratedProviderFailureMetadata(failure *ProviderFailureMetadata) *factoryapi.ProviderFailureMetadata
GeneratedProviderFailureMetadata converts canonical provider-failure metadata into the generated event contract.
func GeneratedProviderSessionMetadata ¶
func GeneratedProviderSessionMetadata(session *ProviderSessionMetadata) *factoryapi.ProviderSessionMetadata
GeneratedProviderSessionMetadata converts canonical provider-session metadata into the generated event contract.
func GeneratedPublicFactoryHostedWorkerProvider ¶ added in v0.0.5
func GeneratedPublicFactoryHostedWorkerProvider(value string) factoryapi.HostedWorkerProvider
GeneratedPublicFactoryHostedWorkerProvider returns the generated hosted worker provider enum.
func GeneratedPublicFactoryHostedWorkerProviderPtr ¶ added in v0.0.5
func GeneratedPublicFactoryHostedWorkerProviderPtr(value string) *factoryapi.HostedWorkerProvider
GeneratedPublicFactoryHostedWorkerProviderPtr returns the generated hosted worker provider enum when non-empty.
func GeneratedPublicFactoryRunnerID ¶ added in v0.0.5
func GeneratedPublicFactoryRunnerID(value string) factoryapi.RunnerID
GeneratedPublicFactoryRunnerID returns the generated runner ID enum.
func GeneratedPublicFactoryRunnerIDPtr ¶ added in v0.0.5
func GeneratedPublicFactoryRunnerIDPtr(value string) *factoryapi.RunnerID
GeneratedPublicFactoryRunnerIDPtr returns the generated runner ID enum when non-empty.
func GeneratedPublicFactoryRunnerSelectionSource ¶ added in v0.0.5
func GeneratedPublicFactoryRunnerSelectionSource(value string) factoryapi.RunnerSelectionSource
GeneratedPublicFactoryRunnerSelectionSource returns the generated runner selection source enum.
func GeneratedPublicFactoryRunnerSelectionSourcePtr ¶ added in v0.0.5
func GeneratedPublicFactoryRunnerSelectionSourcePtr(value string) *factoryapi.RunnerSelectionSource
GeneratedPublicFactoryRunnerSelectionSourcePtr returns the generated runner selection source enum when non-empty.
func GeneratedPublicFactoryWorkerModelLocality ¶ added in v0.0.5
func GeneratedPublicFactoryWorkerModelLocality(value string) factoryapi.WorkerModelLocality
GeneratedPublicFactoryWorkerModelLocality returns the generated worker model locality enum.
func GeneratedPublicFactoryWorkerModelLocalityPtr ¶ added in v0.0.5
func GeneratedPublicFactoryWorkerModelLocalityPtr(value string) *factoryapi.WorkerModelLocality
GeneratedPublicFactoryWorkerModelLocalityPtr returns the generated worker model locality enum when non-empty.
func GeneratedPublicFactoryWorkerModelOperationContentType ¶ added in v0.0.5
func GeneratedPublicFactoryWorkerModelOperationContentType(value string) factoryapi.ModelOperationContentType
GeneratedPublicFactoryWorkerModelOperationContentType returns the generated worker capability content type enum.
func GeneratedPublicFactoryWorkerModelOperationContentTypePtr ¶ added in v0.0.5
func GeneratedPublicFactoryWorkerModelOperationContentTypePtr(value string) *factoryapi.ModelOperationContentType
GeneratedPublicFactoryWorkerModelOperationContentTypePtr returns the generated worker capability content type enum when non-empty.
func GeneratedPublicFactoryWorkerModelProvider ¶
func GeneratedPublicFactoryWorkerModelProvider(value string) factoryapi.WorkerModelProvider
GeneratedPublicFactoryWorkerModelProvider returns the generated worker model provider enum.
func GeneratedPublicFactoryWorkerModelProviderPtr ¶
func GeneratedPublicFactoryWorkerModelProviderPtr(value string) *factoryapi.WorkerModelProvider
GeneratedPublicFactoryWorkerModelProviderPtr returns the generated worker model provider enum when non-empty.
func GeneratedPublicFactoryWorkerProvider ¶
func GeneratedPublicFactoryWorkerProvider(value string) factoryapi.WorkerProvider
GeneratedPublicFactoryWorkerProvider returns the generated worker provider enum.
func GeneratedPublicFactoryWorkerProviderPtr ¶
func GeneratedPublicFactoryWorkerProviderPtr(value string) *factoryapi.WorkerProvider
GeneratedPublicFactoryWorkerProviderPtr returns the generated worker provider enum when non-empty.
func GeneratedPublicFactoryWorkerType ¶
func GeneratedPublicFactoryWorkerType(value string) factoryapi.WorkerType
GeneratedPublicFactoryWorkerType returns the generated worker type enum.
func GeneratedPublicFactoryWorkerTypePtr ¶
func GeneratedPublicFactoryWorkerTypePtr(value string) *factoryapi.WorkerType
GeneratedPublicFactoryWorkerTypePtr returns the generated worker type enum when non-empty.
func GeneratedPublicFactoryWorkstationType ¶
func GeneratedPublicFactoryWorkstationType(value string) factoryapi.WorkstationType
GeneratedPublicFactoryWorkstationType returns the generated workstation type enum.
func GeneratedPublicFactoryWorkstationTypePtr ¶
func GeneratedPublicFactoryWorkstationTypePtr(value string) *factoryapi.WorkstationType
GeneratedPublicFactoryWorkstationTypePtr returns the generated workstation type enum when non-empty.
func GeneratedPublicWorkstationKind ¶
func GeneratedPublicWorkstationKind(kind WorkstationKind) factoryapi.WorkstationKind
GeneratedPublicWorkstationKind returns the generated workstation kind enum.
func GeneratedPublicWorkstationKindPtr ¶
func GeneratedPublicWorkstationKindPtr(kind WorkstationKind) *factoryapi.WorkstationKind
GeneratedPublicWorkstationKindPtr returns the generated workstation kind enum when non-empty.
func GeneratedSafeWorkDiagnostics ¶
func GeneratedSafeWorkDiagnostics(diagnostics *SafeWorkDiagnostics) *factoryapi.SafeWorkDiagnostics
GeneratedSafeWorkDiagnostics converts the canonical internal safe boundary into the generated event contract.
func GeneratedSafeWorkDiagnosticsFromWorkDiagnostics ¶
func GeneratedSafeWorkDiagnosticsFromWorkDiagnostics(diagnostics *WorkDiagnostics) *factoryapi.SafeWorkDiagnostics
GeneratedSafeWorkDiagnosticsFromWorkDiagnostics projects worker-internal diagnostics to the canonical safe boundary and then to the generated event contract.
func GeneratedWorkFailureMetadata ¶ added in v0.0.5
func GeneratedWorkFailureMetadata(failure *WorkFailureMetadata) *factoryapi.ProviderFailureMetadata
GeneratedWorkFailureMetadata converts canonical work-failure metadata into the generated event contract.
func IsBuiltInRunnerID ¶ added in v0.0.5
IsBuiltInRunnerID reports whether a runner ID is one of the stable built-ins.
func IsSystemTimePlace ¶
IsSystemTimePlace reports whether a place belongs to the internal time-work state machine.
func IsSystemTimeToken ¶
IsSystemTimeToken reports whether a token is an internal time-work token.
func IsSystemTimeWorkType ¶
IsSystemTimeWorkType reports whether a work type is the internal time-work type used for cron ticks.
func NormalizeRunnerID ¶ added in v0.0.5
NormalizeRunnerID trims operator-supplied runner IDs into the canonical lowercase form used by the registry and runtime selection logic.
func PermissivePublicFactoryHostedWorkerProvider ¶ added in v0.0.5
PermissivePublicFactoryHostedWorkerProvider canonicalizes supported hosted worker providers and preserves unknown values.
func PermissivePublicFactoryResourceType ¶ added in v0.0.5
PermissivePublicFactoryResourceType canonicalizes supported public resource types and preserves unknown values.
func PermissivePublicFactoryRunnerID ¶ added in v0.0.5
PermissivePublicFactoryRunnerID canonicalizes supported public runner IDs and preserves unknown values.
func PermissivePublicFactoryRunnerSelectionSource ¶ added in v0.0.5
PermissivePublicFactoryRunnerSelectionSource canonicalizes supported public runner selection sources and preserves unknown values.
func PermissivePublicFactoryWorkerModelLocality ¶ added in v0.0.5
PermissivePublicFactoryWorkerModelLocality canonicalizes supported public worker model localities and preserves unknown values.
func PermissivePublicFactoryWorkerModelOperationContentType ¶ added in v0.0.5
PermissivePublicFactoryWorkerModelOperationContentType canonicalizes supported public capability content types and preserves unknown values.
func PermissivePublicFactoryWorkerModelProvider ¶
PermissivePublicFactoryWorkerModelProvider canonicalizes supported public worker model providers and preserves unknown values.
func PermissivePublicFactoryWorkerProvider ¶
PermissivePublicFactoryWorkerProvider canonicalizes supported public worker providers and preserves unknown values.
func PermissivePublicFactoryWorkerType ¶
PermissivePublicFactoryWorkerType canonicalizes supported public worker types and preserves unknown values.
func PermissivePublicFactoryWorkstationType ¶
PermissivePublicFactoryWorkstationType canonicalizes supported public workstation types and preserves unknown values.
func PermissivePublicWorkTypeHandlingBehavior ¶ added in v0.0.5
PermissivePublicWorkTypeHandlingBehavior canonicalizes supported public work-type handling markers and preserves unknown values.
func PreviousChainingTraceIDsFromTokenColors ¶
func PreviousChainingTraceIDsFromTokenColors(colors []TokenColor) []string
PreviousChainingTraceIDsFromTokenColors collects predecessor chain IDs from non-resource token colors using the canonical fan-in ordering rule.
func PreviousChainingTraceIDsFromTokens ¶
PreviousChainingTraceIDsFromTokens collects predecessor chain IDs from non-resource input tokens using the canonical fan-in ordering rule.
func PreviousChainingTraceIDsFromWorkItems ¶
func PreviousChainingTraceIDsFromWorkItems(items []FactoryWorkItem) []string
PreviousChainingTraceIDsFromWorkItems collects predecessor chain IDs from canonical work items using the shared deterministic fan-in rule.
func PublicWorkerModelProviderFromInternal ¶ added in v0.0.5
func PublicWorkerModelProviderFromInternal(provider ModelProvider) (factoryapi.WorkerModelProvider, bool)
PublicWorkerModelProviderFromInternal maps a canonical internal provider command to the generated public enum.
func ResolveOpenCodeAgent ¶ added in v0.0.5
ResolveOpenCodeAgent returns the configured OpenCode agent profile for one dispatch using workstation override precedence over the worker default.
func StrictPublicFactoryHostedWorkerProvider ¶ added in v0.0.5
StrictPublicFactoryHostedWorkerProvider canonicalizes supported hosted worker providers and rejects unknown values.
func StrictPublicFactoryResourceType ¶ added in v0.0.5
StrictPublicFactoryResourceType canonicalizes supported public resource types and rejects unknown values.
func StrictPublicFactoryRunnerID ¶ added in v0.0.5
StrictPublicFactoryRunnerID canonicalizes supported public runner IDs and rejects unknown values.
func StrictPublicFactoryRunnerSelectionSource ¶ added in v0.0.5
StrictPublicFactoryRunnerSelectionSource canonicalizes supported public runner selection sources and rejects unknown values.
func StrictPublicFactoryWorkerModelLocality ¶ added in v0.0.5
StrictPublicFactoryWorkerModelLocality canonicalizes supported public worker model localities and rejects unknown values.
func StrictPublicFactoryWorkerModelOperationContentType ¶ added in v0.0.5
StrictPublicFactoryWorkerModelOperationContentType canonicalizes supported public capability content types and rejects unknown values.
func StrictPublicFactoryWorkerModelProvider ¶
StrictPublicFactoryWorkerModelProvider canonicalizes supported public worker model providers and rejects unknown values.
func StrictPublicFactoryWorkerProvider ¶
StrictPublicFactoryWorkerProvider canonicalizes supported public worker providers and rejects unknown values.
func StrictPublicFactoryWorkerType ¶
StrictPublicFactoryWorkerType canonicalizes supported public worker types and rejects unknown values.
func StrictPublicFactoryWorkstationType ¶
StrictPublicFactoryWorkstationType canonicalizes supported public workstation types and rejects unknown values.
func StrictPublicWorkTypeHandlingBehavior ¶ added in v0.0.5
StrictPublicWorkTypeHandlingBehavior canonicalizes supported public work-type handling markers and rejects unknown values.
func StrictPublicWorkstationKind ¶ added in v0.0.3
StrictPublicWorkstationKind canonicalizes supported public workstation kinds and rejects unknown values.
func ValidateOpenCodeAgentForRunnerSelection ¶ added in v0.0.5
func ValidateOpenCodeAgentForRunnerSelection(workstationAgent, workerAgent string, selection ResolvedRunnerSelection) error
ValidateOpenCodeAgentForRunnerSelection reports a configuration error when a non-empty OpenCode agent profile is configured for a dispatch that will not use the OpenCode runner.
Types ¶
type ActiveThrottlePause ¶
type ActiveThrottlePause struct {
LaneID string `json:"lane_id"`
Provider string `json:"provider"`
Model string `json:"model"`
PausedAt time.Time `json:"paused_at,omitempty"`
PausedUntil time.Time `json:"paused_until"`
}
ActiveThrottlePause records an active provider/model dispatch pause window.
type BundledFileConfig ¶
type BundledFileConfig struct {
Type string `json:"type"`
TargetPath string `json:"targetPath"`
Content BundledFileContentConfig `json:"content"`
}
BundledFileConfig declares one portable file payload and its factory-relative restoration target.
type BundledFileContentConfig ¶
type BundledFileContentConfig struct {
Encoding string `json:"encoding"`
Inline string `json:"inline"`
}
BundledFileContentConfig declares the bundled inline file payload.
type ClassificationRouteConfig ¶ added in v0.0.5
type ClassificationRouteConfig struct {
Label string `json:"label" yaml:"label,omitempty"`
Outputs []IOConfig `json:"outputs" yaml:"outputs,omitempty"`
}
ClassificationRouteConfig declares one authored classifier label and the destinations that label should dispatch to on successful classification.
type CommandDiagnostic ¶
type CommandDiagnostic struct {
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Stdin string `json:"stdin,omitempty"`
Env map[string]string `json:"env,omitempty"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
TimedOut bool `json:"timed_out,omitempty"`
Duration time.Duration `json:"duration,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
}
CommandDiagnostic records script and provider command execution details.
type CompletedDispatch ¶
type CompletedDispatch struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
WorkstationName string `json:"workstation_name,omitempty"`
Outcome WorkOutcome `json:"outcome"`
SelectedClassificationLabel string `json:"selected_classification_label,omitempty"`
Reason string `json:"reason,omitempty"`
FailureMetadata *WorkFailureMetadata `json:"failure_metadata,omitempty"`
ProviderFailure *ProviderFailureMetadata `json:"provider_failure,omitempty"`
ProviderSession *ProviderSessionMetadata `json:"provider_session,omitempty"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
ConsumedTokens []Token `json:"consumed_tokens,omitempty"`
OutputMutations []TokenMutationRecord `json:"output_mutations,omitempty"`
}
CompletedDispatch records a dispatch that has finished, with timing data.
type CronConfig ¶
type CronConfig struct {
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
TriggerAtStart bool `json:"triggerAtStart,omitempty" yaml:"triggerAtStart,omitempty"`
Jitter string `json:"jitter,omitempty" yaml:"jitter,omitempty"`
ExpiryWindow string `json:"expiryWindow,omitempty" yaml:"expiryWindow,omitempty"`
// contains filtered or unexported fields
}
CronConfig declares the trigger contract for cron workstations. Cron workstations reuse workstation inputs and outputs for token readiness and routing; this object only owns trigger timing.
func (*CronConfig) HasUnsupportedInterval ¶
func (c *CronConfig) HasUnsupportedInterval() bool
HasUnsupportedInterval reports whether the decoded config supplied the removed cron.interval field.
func (*CronConfig) UnmarshalJSON ¶
func (c *CronConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the supported cron contract while preserving whether a removed interval field was supplied so config validation can report it with a precise workstation path.
type DispatchEntry ¶
type DispatchEntry struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
WorkstationName string `json:"workstation_name,omitempty"`
StartTime time.Time `json:"start_time"`
ConsumedTokens []Token `json:"consumed_tokens"`
HeldMutations []MarkingMutation `json:"held_mutations"`
}
DispatchEntry tracks an in-flight dispatch awaiting a worker result.
type DispatchRecord ¶
type DispatchRecord struct {
Dispatch WorkDispatch `json:"dispatch"`
Mutations []MarkingMutation `json:"mutations"`
}
DispatchRecord pairs a WorkDispatch with the marking mutations consumed to fire it.
type EnabledTransition ¶
type EnabledTransition struct {
TransitionID string `json:"transition_id"`
WorkerType string `json:"worker_type"`
Bindings map[string][]Token `json:"bindings"`
ArcModes map[string]ArcMode `json:"arc_modes"`
}
EnabledTransition represents a transition that is ready to fire.
type EngineStateSnapshot ¶
type EngineStateSnapshot[TMarking any, TTopology any] struct { RuntimeStatus RuntimeStatus `json:"runtime_status"` Marking TMarking `json:"marking"` Dispatches map[string]*DispatchEntry `json:"dispatches"` InFlightCount int `json:"in_flight_count"` Results []WorkResult `json:"results"` DispatchHistory []CompletedDispatch `json:"dispatch_history"` // ActiveThrottlePauses exposes active provider/model pause windows owned by // dispatcher policy for tests and observability reconstruction. ActiveThrottlePauses []ActiveThrottlePause `json:"active_throttle_pauses,omitempty"` TickCount int `json:"tick_count"` // Factory lifecycle state. FactoryState string `json:"factory_state"` // Uptime since the factory started. Uptime time.Duration `json:"uptime"` // Topology is the workflow net used to interpret marking and dispatch // records for service-facing observability read models. Topology TTopology `json:"topology,omitempty"` }
EngineStateSnapshot is a unified point-in-time snapshot of the full engine state: runtime state, factory lifecycle, session metrics, and uptime.
func (EngineStateSnapshot[TMarking, TTopology]) RuntimeStateSnapshot ¶
func (s EngineStateSnapshot[TMarking, TTopology]) RuntimeStateSnapshot() EngineStateSnapshot[TMarking, TTopology]
RuntimeStateSnapshot returns the raw runtime portion of the aggregate snapshot for reducers that intentionally operate on runtime records.
type ExecutionMetadata ¶
type ExecutionMetadata struct {
DispatchCreatedTick int `json:"dispatch_created_tick,omitempty"`
CurrentTick int `json:"current_tick,omitempty"`
RequestID string `json:"request_id,omitempty"`
TraceID string `json:"trace_id,omitempty"`
WorkIDs []string `json:"work_ids,omitempty"`
ReplayKey string `json:"replay_key,omitempty"`
}
ExecutionMetadata carries replay matching and logical tick context from the dispatch runtime.
func CloneExecutionMetadata ¶
func CloneExecutionMetadata(metadata ExecutionMetadata) ExecutionMetadata
CloneExecutionMetadata returns a detached copy of canonical dispatch execution metadata.
type FactoryCompletionRecord ¶
type FactoryCompletionRecord struct {
CompletionID string
DispatchID string
ObservedTick int
Result WorkResult
}
FactoryCompletionRecord stores a worker result at the logical tick where the engine observed it.
type FactoryConfig ¶
type FactoryConfig struct {
Name string `json:"name"`
Project string `json:"project,omitempty"`
Version *FactoryVersion `json:"version,omitempty"`
Runner string `json:"runner,omitempty"`
Guards []FactoryGuardConfig `json:"guards,omitempty"`
InputTypes []InputTypeConfig `json:"input_types,omitempty"`
WorkTypes []WorkTypeConfig `json:"work_types"`
Resources []ResourceConfig `json:"resources"`
ResourceManifest *PortableResourceManifestConfig `json:"resourceManifest,omitempty"`
Workers []WorkerConfig `json:"workers"`
Workstations []FactoryWorkstationConfig `json:"workstations"`
}
FactoryConfig is the specification of a factory as a JSON file.
type FactoryConstraint ¶
type FactoryConstraint struct {
ID string `json:"id"`
Type string `json:"type"`
Scope string `json:"scope,omitempty"`
Values map[string]string `json:"values,omitempty"`
}
FactoryConstraint describes a named runtime constraint or limit.
type FactoryDispatchRecord ¶
type FactoryDispatchRecord struct {
DispatchID string
CreatedTick int
Dispatch WorkDispatch
HeldMutations []MarkingMutation
ConsumedTokens []string
}
FactoryDispatchRecord stores a raw WorkDispatch plus token mutations held while the worker is in flight.
type FactoryEventStream ¶
type FactoryEventStream struct {
History []factoryapi.FactoryEvent
Events <-chan factoryapi.FactoryEvent
}
FactoryEventStream carries replayed history and then live canonical events.
type FactoryGuardConfig ¶
type FactoryGuardConfig struct {
Type GuardType `json:"type" yaml:"type"`
ModelProvider string `json:"model_provider,omitempty" yaml:"modelProvider,omitempty"`
Model string `json:"model,omitempty" yaml:"model,omitempty"`
RefreshWindow string `json:"refresh_window,omitempty" yaml:"refreshWindow,omitempty"`
}
FactoryGuardConfig declares a root-level factory guard using customer-facing names.
type FactoryPlace ¶
type FactoryPlace struct {
ID string `json:"id"`
TypeID string `json:"type_id"`
State string `json:"state"`
Category string `json:"category,omitempty"`
}
FactoryPlace describes a topology place for work or resource tokens.
type FactoryPlaceOccupancy ¶
type FactoryPlaceOccupancy struct {
PlaceID string `json:"place_id"`
WorkItemIDs []string `json:"work_item_ids,omitempty"`
ResourceTokenIDs []string `json:"resource_token_ids,omitempty"`
TokenCount int `json:"token_count"`
}
FactoryPlaceOccupancy describes work and resource tokens reconstructed at a place for the selected tick.
type FactoryRelation ¶
type FactoryRelation struct {
Type string `json:"type"`
SourceWorkID string `json:"sourceWorkId,omitempty"`
SourceWorkName string `json:"sourceWorkName,omitempty"`
TargetWorkID string `json:"targetWorkId"`
TargetWorkName string `json:"targetWorkName,omitempty"`
RequiredState string `json:"requiredState,omitempty"`
RequestID string `json:"requestId,omitempty"`
TraceID string `json:"traceId,omitempty"`
}
FactoryRelation describes a typed relationship between work items.
type FactoryResource ¶
type FactoryResource struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Capacity int `json:"capacity"`
}
FactoryResource describes a bounded resource type.
type FactoryResourceUnit ¶
type FactoryResourceUnit struct {
ResourceID string `json:"resource_id"`
TokenID string `json:"token_id"`
PlaceID string `json:"place_id,omitempty"`
}
FactoryResourceUnit identifies a concrete resource token.
type FactoryState ¶
type FactoryState string
FactoryState represents the current lifecycle state of a Factory.
const ( FactoryStateIdle FactoryState = "IDLE" FactoryStateRunning FactoryState = "RUNNING" FactoryStatePaused FactoryState = "PAUSED" FactoryStateCompleted FactoryState = "COMPLETED" FactoryStateFailed FactoryState = "FAILED" )
type FactoryStateChangePayload ¶
type FactoryStateChangePayload struct {
PreviousState string `json:"previous_state,omitempty"`
State string `json:"state"`
Reason string `json:"reason,omitempty"`
}
FactoryStateChangePayload describes a lifecycle state change.
type FactoryStateDefinition ¶
type FactoryStateDefinition struct {
Value string `json:"value"`
Category string `json:"category"`
}
FactoryStateDefinition describes a named state in a work type lifecycle.
type FactorySubmissionRecord ¶
type FactorySubmissionRecord struct {
SubmissionID string
ObservedTick int
Request SubmitRequest
Source string
}
FactorySubmissionRecord stores the engine tick at which a submit request became visible to the runtime.
type FactoryTerminalWork ¶
type FactoryTerminalWork struct {
WorkItem FactoryWorkItem `json:"work_item"`
Status string `json:"status"`
}
FactoryTerminalWork describes work that reached a terminal outcome.
type FactoryTraceData ¶
type FactoryTraceData struct {
TraceID string `json:"trace_id,omitempty"`
WorkIDs []string `json:"work_ids,omitempty"`
}
FactoryTraceData carries trace identifiers attached to a runtime event.
type FactoryVersion ¶ added in v0.0.5
FactoryVersion is the durable optimistic-concurrency metadata stored with a persisted factory definition.
type FactoryWorkItem ¶
type FactoryWorkItem struct {
ID string `json:"id"`
WorkTypeID string `json:"workTypeId"`
State string `json:"state,omitempty"`
DisplayName string `json:"displayName,omitempty"`
ChainingTraceDepth int `json:"chainingTraceDepth,omitempty"`
CurrentChainingTraceID string `json:"currentChainingTraceId,omitempty"`
PreviousChainingTraceIDs []string `json:"previousChainingTraceIds,omitempty"`
TraceID string `json:"traceId,omitempty"`
Content []WorkContentPart `json:"content,omitempty"`
ParentID string `json:"parentId,omitempty"`
PlaceID string `json:"placeId,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
FactoryWorkItem describes a unit of work at a point in history.
type FactoryWorkType ¶
type FactoryWorkType struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
States []FactoryStateDefinition `json:"states,omitempty"`
}
FactoryWorkType describes a work type and its possible states.
type FactoryWorker ¶
type FactoryWorker struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Provider string `json:"provider,omitempty"`
ModelProvider string `json:"model_provider,omitempty"`
Model string `json:"model,omitempty"`
Config map[string]string `json:"config,omitempty"`
}
FactoryWorker describes an executable worker type.
type FactoryWorkstation ¶
type FactoryWorkstation struct {
ID string `json:"id"`
Name string `json:"name"`
WorkerID string `json:"worker_id,omitempty"`
Kind string `json:"kind,omitempty"`
Config map[string]string `json:"config,omitempty"`
InputPlaceIDs []string `json:"input_place_ids,omitempty"`
OutputPlaceIDs []string `json:"output_place_ids,omitempty"`
ContinuePlaceIDs []string `json:"continue_place_ids,omitempty"`
RejectionPlaceIDs []string `json:"rejection_place_ids,omitempty"`
FailurePlaceIDs []string `json:"failure_place_ids,omitempty"`
}
FactoryWorkstation describes a transition that can execute work.
type FactoryWorkstationConfig ¶
type FactoryWorkstationConfig struct {
ID string `json:"id" yaml:"id,omitempty"`
Name string `json:"name" yaml:"name,omitempty"`
Kind WorkstationKind `json:"behavior,omitempty" yaml:"behavior,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Operation string `json:"operation,omitempty" yaml:"operation,omitempty"`
OperationBindings []ModelOperationBinding `json:"operationBindings,omitempty" yaml:"operationBindings,omitempty"`
WorkerTypeName string `json:"worker" yaml:"worker,omitempty"`
Runner string `json:"runner,omitempty" yaml:"runner,omitempty"`
OpenCodeAgent string `json:"openCodeAgent,omitempty" yaml:"openCodeAgent,omitempty"`
PromptFile string `json:"prompt_file,omitempty" yaml:"promptFile,omitempty"`
OutputSchema string `json:"output_schema,omitempty" yaml:"outputSchema,omitempty"`
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
Limits WorkstationLimits `json:"limits,omitempty" yaml:"limits,omitempty"`
Cron *CronConfig `json:"cron,omitempty" yaml:"cron,omitempty"`
Inputs []IOConfig `json:"inputs" yaml:"inputs,omitempty"`
Outputs []IOConfig `json:"outputs" yaml:"outputs,omitempty"`
ClassificationRoutes []ClassificationRouteConfig `json:"classification_routes,omitempty" yaml:"classificationRoutes,omitempty"`
OnContinue []IOConfig `json:"on_continue,omitempty" yaml:"onContinue,omitempty"`
OnRejection []IOConfig `json:"on_rejection,omitempty" yaml:"onRejection,omitempty"`
OnFailure []IOConfig `json:"on_failure,omitempty" yaml:"onFailure,omitempty"`
Resources []ResourceConfig `json:"resources,omitempty" yaml:"resources,omitempty"`
CopyReferencedScripts bool `json:"copy_referenced_scripts,omitempty" yaml:"-"`
Guards []GuardConfig `json:"guards,omitempty" yaml:"guards,omitempty"`
StopWords []string `json:"stop_words,omitempty" yaml:"stopWords,omitempty"`
RuntimeStopWords []string `json:"runtime_stop_words,omitempty" yaml:"-"`
Body string `json:"body,omitempty" yaml:"-"`
PromptTemplate string `json:"prompt_template,omitempty" yaml:"-"`
WorkingDirectory string `json:"working_directory,omitempty" yaml:"workingDirectory,omitempty"`
Worktree string `json:"worktree,omitempty" yaml:"worktree,omitempty"`
Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
}
FactoryWorkstationConfig is the factory.json workstation topology entry. It also carries flattened runtime workstation fields when factory.json embeds AGENTS.md-equivalent workstation configuration directly.
type FactoryWorkstationRef ¶
FactoryWorkstationRef identifies a workstation in a runtime event.
type FactoryWorldActiveExecution ¶
type FactoryWorldActiveExecution struct {
DispatchID string `json:"dispatch_id"`
WorkstationNodeID string `json:"workstation_node_id"`
TransitionID string `json:"transition_id"`
WorkstationName string `json:"workstation_name,omitempty"`
StartedAt time.Time `json:"started_at"`
WorkTypeIDs []string `json:"work_type_ids,omitempty"`
WorkItems []FactoryWorldWorkItemRef `json:"work_items,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
TraceIDs []string `json:"trace_ids,omitempty"`
ConsumedInputs []WorkstationInput `json:"consumed_inputs,omitempty"`
}
type FactoryWorldActivity ¶
type FactoryWorldActivity struct {
WorkstationNodeID string `json:"workstation_node_id"`
ActiveDispatchIDs []string `json:"active_dispatch_ids,omitempty"`
ActiveWorkItems []FactoryWorldWorkItemRef `json:"active_work_items,omitempty"`
TraceIDs []string `json:"trace_ids,omitempty"`
}
type FactoryWorldDispatch ¶
type FactoryWorldDispatch struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
Workstation FactoryWorkstationRef `json:"workstation"`
RunnerID string `json:"runner_id,omitempty"`
RunnerSelectionSource RunnerSelectionSource `json:"runner_selection_source,omitempty"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
StartedTick int `json:"started_tick"`
StartedAt time.Time `json:"started_at,omitempty"`
Inputs []WorkstationInput `json:"inputs,omitempty"`
Resources []FactoryResourceUnit `json:"resources,omitempty"`
WorkItemIDs []string `json:"work_item_ids,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
TraceIDs []string `json:"trace_ids,omitempty"`
}
FactoryWorldDispatch describes a workstation request that has not yet received its matching response at the selected tick.
type FactoryWorldDispatchCompletion ¶
type FactoryWorldDispatchCompletion struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
Workstation FactoryWorkstationRef `json:"workstation"`
RunnerID string `json:"runner_id,omitempty"`
RunnerSelectionSource RunnerSelectionSource `json:"runner_selection_source,omitempty"`
StartedTick int `json:"started_tick,omitempty"`
CompletedTick int `json:"completed_tick"`
StartedAt time.Time `json:"started_at,omitempty"`
CompletedAt time.Time `json:"completed_at,omitempty"`
DurationMillis int64 `json:"duration_millis"`
Result WorkstationResult `json:"result"`
WorkItemIDs []string `json:"work_item_ids,omitempty"`
ConsumedInputs []WorkstationInput `json:"consumed_inputs,omitempty"`
InputWorkItems []FactoryWorkItem `json:"input_work_items,omitempty"`
OutputWorkItems []FactoryWorkItem `json:"output_work_items,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
TraceIDs []string `json:"trace_ids,omitempty"`
ProviderSession *ProviderSessionMetadata `json:"provider_session,omitempty"`
Diagnostics *SafeWorkDiagnostics `json:"diagnostics,omitempty"`
TerminalWork *FactoryTerminalWork `json:"terminal_work,omitempty"`
}
FactoryWorldDispatchCompletion describes a finished dispatch reconstructed from a workstation response event.
func CloneFactoryWorldDispatchCompletion ¶
func CloneFactoryWorldDispatchCompletion(completion FactoryWorldDispatchCompletion) FactoryWorldDispatchCompletion
CloneFactoryWorldDispatchCompletion returns a detached copy of one canonical selected-tick dispatch completion record.
type FactoryWorldFailureDetail ¶
type FactoryWorldFailureDetail struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
WorkstationName string `json:"workstation_name,omitempty"`
WorkItem FactoryWorkItem `json:"work_item"`
FailureReason string `json:"failure_reason,omitempty"`
FailureMessage string `json:"failure_message,omitempty"`
}
FactoryWorldFailureDetail associates failed terminal work with the dispatch completion that produced the failure.
type FactoryWorldInferenceAttempt ¶
type FactoryWorldInferenceAttempt struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
InferenceRequestID string `json:"inference_request_id"`
Attempt int `json:"attempt"`
WorkingDirectory string `json:"working_directory,omitempty"`
Worktree string `json:"worktree,omitempty"`
Prompt string `json:"prompt"`
RequestTime time.Time `json:"request_time,omitempty"`
Outcome string `json:"outcome,omitempty"`
Response string `json:"response,omitempty"`
DurationMillis int64 `json:"duration_millis,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
ErrorClass string `json:"error_class,omitempty"`
ProviderSession *ProviderSessionMetadata `json:"provider_session,omitempty"`
Diagnostics *SafeWorkDiagnostics `json:"diagnostics,omitempty"`
ResponseTime time.Time `json:"response_time,omitempty"`
}
FactoryWorldInferenceAttempt records one provider-boundary inference attempt reconstructed from canonical inference request and response events.
type FactoryWorldPlaceRef ¶
type FactoryWorldProviderSessionRecord ¶
type FactoryWorldProviderSessionRecord struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
WorkstationName string `json:"workstation_name,omitempty"`
RunnerID string `json:"runner_id,omitempty"`
RunnerSelectionSource RunnerSelectionSource `json:"runner_selection_source,omitempty"`
Outcome string `json:"outcome"`
ProviderSession ProviderSessionMetadata `json:"provider_session"`
Diagnostics *SafeWorkDiagnostics `json:"diagnostics,omitempty"`
WorkItemIDs []string `json:"work_item_ids,omitempty"`
WorkItems []FactoryWorldWorkItemRef `json:"work_items,omitempty"`
ConsumedInputs []WorkstationInput `json:"consumed_inputs,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
TraceIDs []string `json:"trace_ids,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
FailureMessage string `json:"failure_message,omitempty"`
}
FactoryWorldProviderSessionRecord records one provider session attached to a workstation response in the canonical event-first world state.
func CloneFactoryWorldProviderSessionRecord ¶
func CloneFactoryWorldProviderSessionRecord(record FactoryWorldProviderSessionRecord) FactoryWorldProviderSessionRecord
CloneFactoryWorldProviderSessionRecord returns a detached copy of one canonical selected-tick provider-session record.
type FactoryWorldRuntimeView ¶
type FactoryWorldRuntimeView struct {
InFlightDispatchCount int `json:"in_flight_dispatch_count"`
ActiveDispatchIDs []string `json:"active_dispatch_ids,omitempty"`
ActiveExecutionsByDispatchID map[string]FactoryWorldActiveExecution `json:"active_executions_by_dispatch_id,omitempty"`
ActiveWorkstationNodeIDs []string `json:"active_workstation_node_ids,omitempty"`
InferenceAttemptsByDispatchID map[string]map[string]FactoryWorldInferenceAttempt `json:"inference_attempts_by_dispatch_id,omitempty"`
WorkstationActivityByNodeID map[string]FactoryWorldActivity `json:"workstation_activity_by_node_id,omitempty"`
PlaceTokenCounts map[string]int `json:"place_token_counts,omitempty"`
CurrentWorkItemsByPlaceID map[string][]FactoryWorldWorkItemRef `json:"current_work_items_by_place_id,omitempty"`
PlaceOccupancyWorkItemsByPlaceID map[string][]FactoryWorldWorkItemRef `json:"place_occupancy_work_items_by_place_id,omitempty"`
ActiveThrottlePauses []FactoryWorldThrottlePause `json:"active_throttle_pauses,omitempty"`
Session FactoryWorldSessionRuntime `json:"session"`
}
type FactoryWorldScriptRequest ¶
type FactoryWorldScriptRequest struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
ScriptRequestID string `json:"script_request_id"`
Attempt int `json:"attempt"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
RequestTime time.Time `json:"request_time,omitempty"`
}
FactoryWorldScriptRequest records one script-boundary request reconstructed from canonical script request events.
type FactoryWorldScriptResponse ¶
type FactoryWorldScriptResponse struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
ScriptRequestID string `json:"script_request_id"`
Attempt int `json:"attempt"`
Outcome string `json:"outcome,omitempty"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
DurationMillis int64 `json:"duration_millis,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
FailureType string `json:"failure_type,omitempty"`
ResponseTime time.Time `json:"response_time,omitempty"`
}
FactoryWorldScriptResponse records one script-boundary response reconstructed from canonical script response events.
type FactoryWorldSessionRuntime ¶
type FactoryWorldSessionRuntime struct {
HasData bool `json:"has_data"`
DispatchedCount int `json:"dispatched_count"`
CompletedCount int `json:"completed_count"`
FailedCount int `json:"failed_count"`
DispatchHistory []FactoryWorldDispatchCompletion `json:"dispatch_history,omitempty"`
ProviderSessions []FactoryWorldProviderSessionRecord `json:"provider_sessions,omitempty"`
DispatchedByWorkType map[string]int `json:"dispatched_by_work_type,omitempty"`
CompletedByWorkType map[string]int `json:"completed_by_work_type,omitempty"`
FailedByWorkType map[string]int `json:"failed_by_work_type,omitempty"`
}
type FactoryWorldState ¶
type FactoryWorldState struct {
Tick int `json:"tick"`
EventTime time.Time `json:"event_time,omitempty"`
Factory *factoryapi.Factory `json:"factory,omitempty"`
Topology InitialStructurePayload `json:"topology"`
PayloadLineage WorkPayloadLineageProjection `json:"payload_lineage,omitempty"`
WorkRequestsByID map[string]WorkRequestPayload `json:"work_requests_by_id,omitempty"`
RelationsByWorkID map[string][]FactoryRelation `json:"relations_by_work_id,omitempty"`
WorkItemsByID map[string]FactoryWorkItem `json:"work_items_by_id,omitempty"`
ActiveWorkItemsByID map[string]FactoryWorkItem `json:"active_work_items_by_id,omitempty"`
TerminalWorkByID map[string]FactoryTerminalWork `json:"terminal_work_by_id,omitempty"`
FailedWorkItemsByID map[string]FactoryWorkItem `json:"failed_work_items_by_id,omitempty"`
PlaceOccupancyByID map[string]FactoryPlaceOccupancy `json:"place_occupancy_by_id,omitempty"`
ActiveDispatches map[string]FactoryWorldDispatch `json:"active_dispatches,omitempty"`
CompletedDispatches []FactoryWorldDispatchCompletion `json:"completed_dispatches,omitempty"`
FailedDispatches []FactoryWorldDispatchCompletion `json:"failed_dispatches,omitempty"`
FailureDetailsByWorkID map[string]FactoryWorldFailureDetail `json:"failure_details_by_work_id,omitempty"`
InferenceAttemptsByDispatchID map[string]map[string]FactoryWorldInferenceAttempt `json:"inference_attempts_by_dispatch_id,omitempty"`
ScriptRequestsByDispatchID map[string]map[string]FactoryWorldScriptRequest `json:"script_requests_by_dispatch_id,omitempty"`
ScriptResponsesByDispatchID map[string]map[string]FactoryWorldScriptResponse `json:"script_responses_by_dispatch_id,omitempty"`
TracesByID map[string]FactoryWorldTrace `json:"traces_by_id,omitempty"`
ProviderSessions []FactoryWorldProviderSessionRecord `json:"provider_sessions,omitempty"`
WorkStateChangesByWorkID map[string][]FactoryWorldWorkStateChangeRecord `json:"work_state_changes_by_work_id,omitempty"`
FactoryState string `json:"factory_state,omitempty"`
FactoryStateReason string `json:"factory_state_reason,omitempty"`
FactoryStatePrevious string `json:"factory_state_previous,omitempty"`
}
FactoryWorldState is the dashboard-agnostic reconstruction of factory state from canonical factory events up to one selected engine tick.
type FactoryWorldSubmitWorkType ¶
type FactoryWorldSubmitWorkType struct {
WorkTypeName string `json:"work_type_name"`
}
type FactoryWorldThrottlePause ¶
type FactoryWorldThrottlePause struct {
LaneID string `json:"lane_id"`
Provider string `json:"provider"`
Model string `json:"model"`
PausedAt time.Time `json:"paused_at,omitempty"`
PausedUntil time.Time `json:"paused_until"`
RecoverAt time.Time `json:"recover_at"`
AffectedTransitionIDs []string `json:"affected_transition_ids,omitempty"`
AffectedWorkstationNames []string `json:"affected_workstation_names,omitempty"`
AffectedWorkerTypes []string `json:"affected_worker_types,omitempty"`
AffectedWorkTypeIDs []string `json:"affected_work_type_ids,omitempty"`
}
type FactoryWorldTopologyView ¶
type FactoryWorldTopologyView struct {
SubmitWorkTypes []FactoryWorldSubmitWorkType `json:"submit_work_types,omitempty"`
WorkstationNodeIDs []string `json:"workstation_node_ids,omitempty"`
WorkstationNodesByID map[string]FactoryWorldWorkstationNode `json:"workstation_nodes_by_id,omitempty"`
Edges []FactoryWorldWorkstationEdge `json:"edges,omitempty"`
}
FactoryWorldTopologyView contains stable graph structure for UI rendering.
type FactoryWorldTrace ¶
type FactoryWorldTrace struct {
TraceID string `json:"trace_id"`
WorkItemIDs []string `json:"work_item_ids,omitempty"`
DispatchIDs []string `json:"dispatch_ids,omitempty"`
TerminalWork []string `json:"terminal_work,omitempty"`
FailedWorkIDs []string `json:"failed_work_ids,omitempty"`
}
FactoryWorldTrace groups work and dispatch activity by trace identifier.
type FactoryWorldView ¶
type FactoryWorldView struct {
Factory *factoryapi.Factory `json:"factory,omitempty"`
Topology FactoryWorldTopologyView `json:"topology"`
Runtime FactoryWorldRuntimeView `json:"runtime"`
}
FactoryWorldView is a presentation projection derived from FactoryWorldState. It intentionally does not reconstruct from runtime snapshots; callers must build the generic world state from canonical events first.
type FactoryWorldWorkItemRef ¶
type FactoryWorldWorkItemRef struct {
WorkID string `json:"work_id"`
WorkTypeID string `json:"work_type_id,omitempty"`
State string `json:"state,omitempty"`
DisplayName string `json:"display_name,omitempty"`
ChainingTraceDepth int `json:"chaining_trace_depth,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
TraceID string `json:"trace_id,omitempty"`
Content []WorkContentPart `json:"content,omitempty"`
PayloadStatus string `json:"payload_status,omitempty"`
LineageLogicalWorkID string `json:"lineage_logical_work_id,omitempty"`
LineageSourceKind string `json:"lineage_source_kind,omitempty"`
LineageContinuity string `json:"lineage_continuity,omitempty"`
LineageParentWorkIDs []string `json:"lineage_parent_work_ids,omitempty"`
}
type FactoryWorldWorkStateChangeRecord ¶ added in v0.0.5
type FactoryWorldWorkStateChangeRecord struct {
WorkID string `json:"work_id"`
WorkTypeName string `json:"work_type_name,omitempty"`
FromState string `json:"from_state"`
ToState string `json:"to_state"`
FromPlaceID string `json:"from_place_id"`
ToPlaceID string `json:"to_place_id"`
Source WorkStateChangeSource `json:"source"`
RequestID string `json:"request_id,omitempty"`
Tick int `json:"tick"`
Sequence int `json:"sequence"`
EventTime time.Time `json:"event_time,omitempty"`
}
FactoryWorldWorkStateChangeRecord records one canonical WORK_STATE_CHANGE affecting a work item at the selected projection tick.
type FactoryWorldWorkstationEdge ¶
type FactoryWorldWorkstationEdge struct {
EdgeID string `json:"edge_id"`
FromNodeID string `json:"from_node_id"`
ToNodeID string `json:"to_node_id"`
ViaPlaceID string `json:"via_place_id"`
WorkTypeID string `json:"work_type_id,omitempty"`
StateValue string `json:"state_value,omitempty"`
StateCategory string `json:"state_category,omitempty"`
OutcomeKind string `json:"outcome_kind,omitempty"`
}
type FactoryWorldWorkstationNode ¶
type FactoryWorldWorkstationNode struct {
NodeID string `json:"node_id"`
TransitionID string `json:"transition_id"`
WorkstationName string `json:"workstation_name,omitempty"`
WorkerType string `json:"worker_type,omitempty"`
WorkstationKind string `json:"workstation_kind,omitempty"`
InputPlaces []FactoryWorldPlaceRef `json:"input_places,omitempty"`
OutputPlaces []FactoryWorldPlaceRef `json:"output_places,omitempty"`
InputPlaceIDs []string `json:"input_place_ids,omitempty"`
OutputPlaceIDs []string `json:"output_place_ids,omitempty"`
InputWorkTypeIDs []string `json:"input_work_type_ids,omitempty"`
OutputWorkTypeIDs []string `json:"output_work_type_ids,omitempty"`
}
type FailureRecord ¶
type FailureRecord struct {
TransitionID string `json:"transition_id"`
Timestamp time.Time `json:"timestamp"`
Error string `json:"error"`
Attempt int `json:"attempt"`
}
FailureRecord captures a single failure event for a token.
type FiringDecision ¶
type FiringDecision struct {
TransitionID string `json:"transition_id"`
ConsumeTokens []string `json:"consume_tokens"`
WorkerType string `json:"worker_type"`
InputBindings map[string][]string `json:"input_bindings,omitempty"`
}
FiringDecision represents a scheduler's decision to fire a transition.
type GeneratedSubmissionBatch ¶
type GeneratedSubmissionBatch struct {
Request WorkRequest `json:"request"`
Metadata GeneratedSubmissionBatchMetadata `json:"metadata"`
Submissions []SubmitRequest `json:"submissions"`
}
GeneratedSubmissionBatch carries a canonical generated request with runtime submissions.
type GeneratedSubmissionBatchMetadata ¶
type GeneratedSubmissionBatchMetadata struct {
Source string `json:"source"`
ParentLineage []string `json:"parentLineage"`
}
GeneratedSubmissionBatchMetadata captures request-level metadata for generated work.
type GuardConfig ¶
type GuardConfig struct {
Type GuardType `json:"type" yaml:"type"`
Workstation string `json:"workstation,omitempty" yaml:"workstation,omitempty"`
MaxVisits int `json:"max_visits,omitempty" yaml:"maxVisits,omitempty"`
MatchConfig *GuardMatchConfig `json:"match_config,omitempty" yaml:"matchConfig,omitempty"`
}
GuardConfig declares a guard on a workstation using customer-facing names.
type GuardMatchConfig ¶
type GuardMatchConfig struct {
InputKey string `json:"input_key,omitempty" yaml:"inputKey,omitempty"`
}
type GuardType ¶
type GuardType string
GuardType identifies a built-in guard type in customer-facing config.
const ( GuardTypeVisitCount GuardType = "visit_count" GuardTypeMatchesFields GuardType = "matches_fields" GuardTypeAllChildrenComplete GuardType = "all_children_complete" GuardTypeAnyChildFailed GuardType = "any_child_failed" GuardTypeSameName GuardType = "same_name" GuardTypeSameTraceID GuardType = "same_trace_id" GuardTypeInferenceThrottle GuardType = "inference_throttle_guard" )
type HostedLinearWorkerClaimConfig ¶ added in v0.0.5
type HostedLinearWorkerClaimConfig struct {
AssigneeField string `json:"assigneeField,omitempty" yaml:"assigneeField,omitempty"`
}
type HostedLinearWorkerConfig ¶ added in v0.0.5
type HostedLinearWorkerConfig struct {
PollInterval string `json:"pollInterval,omitempty" yaml:"pollInterval,omitempty"`
TeamIDs []string `json:"teamIds,omitempty" yaml:"teamIds,omitempty"`
StateIDs []string `json:"stateIds,omitempty" yaml:"stateIds,omitempty"`
Mapping HostedLinearWorkerMappingConfig `json:"mapping,omitempty" yaml:"mapping,omitempty"`
Claim *HostedLinearWorkerClaimConfig `json:"claim,omitempty" yaml:"claim,omitempty"`
}
type HostedLinearWorkerMappingConfig ¶ added in v0.0.5
type HostedWorkerAuthConfig ¶ added in v0.0.5
type HostedWorkerAuthConfig struct {
SecretRef string `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
}
type IOConfig ¶
type IOConfig struct {
WorkTypeName string `json:"work_type" yaml:"workType"`
StateName string `json:"state" yaml:"state"`
Guard *InputGuardConfig `json:"guard,omitempty" yaml:"guard,omitempty"`
}
type InferenceResponse ¶
type InferenceResponse struct {
Content string `json:"content"`
ProviderSession *ProviderSessionMetadata `json:"provider_session,omitempty"`
Diagnostics *WorkDiagnostics `json:"diagnostics,omitempty"`
}
InferenceResponse is returned by a provider after model inference.
type InitialStructurePayload ¶
type InitialStructurePayload struct {
Name string `json:"name,omitempty"`
Resources []FactoryResource `json:"resources,omitempty"`
Constraints []FactoryConstraint `json:"constraints,omitempty"`
Workers []FactoryWorker `json:"workers,omitempty"`
WorkTypes []FactoryWorkType `json:"work_types,omitempty"`
Workstations []FactoryWorkstation `json:"workstations,omitempty"`
Places []FactoryPlace `json:"places,omitempty"`
Relations []FactoryRelation `json:"relations,omitempty"`
}
InitialStructurePayload describes the topology available before work moves.
type InputGuardConfig ¶
type InputGuardConfig struct {
Type GuardType `json:"type" yaml:"type"`
MatchInput string `json:"match_input,omitempty" yaml:"matchInput,omitempty"`
ParentInput string `json:"parent_input,omitempty" yaml:"parentInput,omitempty"`
SpawnedBy string `json:"spawned_by,omitempty" yaml:"spawnedBy,omitempty"`
}
InputGuardConfig declares a guard on a specific input.
type InputKind ¶
type InputKind string
InputKind identifies how the factory should parse and validate an incoming input.
const ( // InputKindDefault accepts a plain SubmitRequest with no structured validation. InputKindDefault InputKind = "default" )
type InputTypeConfig ¶
InputTypeConfig declares a named input type that the factory accepts. When no input_types are declared, only the implicit "default" type is available.
type MarkingMutation ¶
type MarkingMutation struct {
Type MutationType `json:"type"`
TokenID string `json:"token_id"`
FromPlace string `json:"from_place"`
ToPlace string `json:"to_place"`
Reason string `json:"reason"`
NewToken *Token `json:"-"`
FailureRecords []FailureRecord `json:"-"`
}
MarkingMutation is a declarative description of a single token movement.
type ModelOperation ¶ added in v0.0.5
type ModelOperation struct {
Name string `json:"name" yaml:"name"`
Inputs []ModelOperationSlot `json:"inputs,omitempty" yaml:"inputs,omitempty"`
Outputs []ModelOperationSlot `json:"outputs,omitempty" yaml:"outputs,omitempty"`
}
ModelOperation declares one provider-agnostic capability exposed by a model worker.
type ModelOperationBinding ¶ added in v0.0.5
type ModelOperationBinding struct {
Slot string `json:"slot" yaml:"slot"`
Selector *ModelOperationBindingSelector `json:"selector,omitempty" yaml:"selector,omitempty"`
Config []WorkContentPart `json:"config,omitempty" yaml:"config,omitempty"`
DefaultContent []WorkContentPart `json:"defaultContent,omitempty" yaml:"defaultContent,omitempty"`
}
ModelOperationBinding declares how one MODEL_INVOKE workstation input slot resolves content from runtime input or authored workstation configuration.
type ModelOperationBindingSelector ¶ added in v0.0.5
type ModelOperationBindingSelector struct {
Slot string `json:"slot,omitempty" yaml:"slot,omitempty"`
Label string `json:"label,omitempty" yaml:"label,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Role string `json:"role,omitempty" yaml:"role,omitempty"`
}
ModelOperationBindingSelector matches one input content part deterministically against ordered runtime input content.
type ModelOperationBindingSource ¶ added in v0.0.5
type ModelOperationBindingSource string
ModelOperationBindingSource records where one slot binding was resolved from.
const ( ModelOperationBindingSourceInput ModelOperationBindingSource = "INPUT" ModelOperationBindingSourceConfig ModelOperationBindingSource = "CONFIG" ModelOperationBindingSourceDefault ModelOperationBindingSource = "DEFAULT" ModelOperationBindingSourceOmitted ModelOperationBindingSource = "OMITTED" )
type ModelOperationSlot ¶ added in v0.0.5
type ModelOperationSlot struct {
Name string `json:"name" yaml:"name"`
ContentTypes []string `json:"contentTypes,omitempty" yaml:"contentTypes,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
}
ModelOperationSlot declares one named operation input or output slot.
type ModelProvider ¶ added in v0.0.5
type ModelProvider string
ModelProvider identifies the CLI command used for model inference dispatch.
const ( ModelProviderClaude ModelProvider = "claude" ModelProviderCodex ModelProvider = "codex" ModelProviderGemini ModelProvider = "gemini" ModelProviderKiro ModelProvider = "kiro-cli" ModelProviderCursor ModelProvider = "agent" ModelProviderOpenCode ModelProvider = "opencode" )
func InternalModelProviderFromPublicWorkerModelProvider ¶ added in v0.0.5
func InternalModelProviderFromPublicWorkerModelProvider(value factoryapi.WorkerModelProvider) (ModelProvider, bool)
InternalModelProviderFromPublicWorkerModelProvider maps a canonical public WorkerModelProvider to the internal command.
func SupportedModelProviders ¶ added in v0.0.5
func SupportedModelProviders() []ModelProvider
SupportedModelProviders returns the canonical internal model provider commands used for runtime dispatch and validation.
type MutationType ¶
type MutationType string
MutationType describes the kind of marking mutation.
const ( MutationMove MutationType = "MOVE" MutationCreate MutationType = "CREATE" MutationConsume MutationType = "CONSUME" )
type OperatorMoveResult ¶ added in v0.0.5
type OperatorMoveResult struct {
WorkID string
WorkTypeID string
FromState string
ToState string
FromPlaceID string
ToPlaceID string
TokenID string
}
OperatorMoveResult is the engine outcome of a successful manual work relocation.
type PanicDiagnostic ¶
type PanicDiagnostic struct {
Message string `json:"message,omitempty"`
Stack string `json:"stack,omitempty"`
}
PanicDiagnostic records panic details captured at worker boundaries.
type PortableResourceManifestConfig ¶
type PortableResourceManifestConfig struct {
RequiredTools []RequiredToolConfig `json:"requiredTools,omitempty"`
BundledFiles []BundledFileConfig `json:"bundledFiles,omitempty"`
}
PortableResourceManifestConfig declares portability-only resources that are distinct from runtime-capacity resources.
type ProviderDiagnostic ¶
type ProviderDiagnostic struct {
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
RequestMetadata map[string]string `json:"request_metadata,omitempty"`
ResponseMetadata map[string]string `json:"response_metadata,omitempty"`
}
ProviderDiagnostic records provider request and response metadata.
type ProviderErrorFamily ¶
type ProviderErrorFamily = WorkFailureFamily
ProviderErrorFamily remains as a compatibility alias while runtime paths transition to generalized work-failure naming.
const ( ProviderErrorFamilyTerminal ProviderErrorFamily = WorkFailureFamilyTerminal ProviderErrorFamilyRetryable ProviderErrorFamily = WorkFailureFamilyRetryable ProviderErrorFamilyThrottle ProviderErrorFamily = WorkFailureFamilyThrottle )
type ProviderErrorType ¶
type ProviderErrorType = WorkFailureType
ProviderErrorType remains as a compatibility alias while runtime paths transition to generalized work-failure naming.
const ( ProviderErrorTypeAuthFailure ProviderErrorType = WorkFailureTypeAuthFailure ProviderErrorTypePermanentBadRequest ProviderErrorType = WorkFailureTypePermanentBadRequest ProviderErrorTypeThrottled ProviderErrorType = WorkFailureTypeThrottled ProviderErrorTypeInternalServerError ProviderErrorType = WorkFailureTypeInternalServerError ProviderErrorTypeTimeout ProviderErrorType = WorkFailureTypeTimeout ProviderErrorTypeUnknown ProviderErrorType = WorkFailureTypeUnknown ProviderErrorTypeMisconfigured ProviderErrorType = WorkFailureTypeMisconfigured )
type ProviderFailureDecision ¶
type ProviderFailureDecision = WorkFailureDecision
ProviderFailureDecision remains as a compatibility alias while runtime paths transition to generalized work-failure naming.
type ProviderFailureMetadata ¶
type ProviderFailureMetadata = WorkFailureMetadata
ProviderFailureMetadata remains as a compatibility alias while runtime paths transition to generalized work-failure naming.
func CloneProviderFailureMetadata ¶
func CloneProviderFailureMetadata(failure *ProviderFailureMetadata) *ProviderFailureMetadata
CloneProviderFailureMetadata retains the legacy helper name while runtime paths migrate to generalized failure metadata.
type ProviderInferenceRequest ¶
type ProviderInferenceRequest struct {
Dispatch WorkDispatch `json:"dispatch"`
WorkerType string `json:"worker_type,omitempty"`
WorkstationType string `json:"workstation_type,omitempty"`
RunnerID string `json:"runner_id,omitempty"`
ProjectID string `json:"project_id,omitempty"`
InputTokens []any `json:"input_tokens,omitempty"`
ModelOperation string `json:"model_operation,omitempty"`
ModelBindings []ResolvedModelOperationBinding `json:"model_bindings,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
UserMessage string `json:"user_message,omitempty"`
OutputSchema string `json:"output_schema,omitempty"`
ToolExecutionMode RunnerToolExecutionMode `json:"tool_execution_mode,omitempty"`
RequiredOptionalCapabilities []RunnerOptionalCapability `json:"required_optional_capabilities,omitempty"`
EnvVars map[string]string `json:"env_vars,omitempty"`
Worktree string `json:"worktree,omitempty"`
WorkingDirectory string `json:"working_directory,omitempty"`
Model string `json:"model,omitempty"`
ModelProvider string `json:"model_provider,omitempty"`
ModelLocality string `json:"model_locality,omitempty"`
SessionID string `json:"session_id,omitempty"`
OpenCodeAgent string `json:"open_code_agent,omitempty"`
}
ProviderInferenceRequest is the provider-owned request shape derived from one rendered workstation execution request plus runtime worker configuration.
func CloneProviderInferenceRequest ¶
func CloneProviderInferenceRequest(request ProviderInferenceRequest) ProviderInferenceRequest
CloneProviderInferenceRequest returns a detached copy of the provider-owned inference request.
type ProviderSessionMetadata ¶
type ProviderSessionMetadata struct {
Provider string `json:"provider,omitempty"`
Kind string `json:"kind,omitempty"`
ID string `json:"id,omitempty"`
}
ProviderSessionMetadata carries a stable provider rollout/session identity.
func CloneProviderSessionMetadata ¶
func CloneProviderSessionMetadata(session *ProviderSessionMetadata) *ProviderSessionMetadata
CloneProviderSessionMetadata returns a detached copy of canonical provider session metadata.
func ProviderSessionMetadataFromGenerated ¶
func ProviderSessionMetadataFromGenerated(session *factoryapi.ProviderSessionMetadata) *ProviderSessionMetadata
ProviderSessionMetadataFromGenerated converts the generated provider-session contract into canonical provider-session metadata.
type Relation ¶
type Relation struct {
Type RelationType `json:"type"`
TargetWorkID string `json:"target_work_id"`
RequiredState string `json:"required_state,omitempty"`
}
Relation defines a typed relationship between work items.
type RelationType ¶
type RelationType string
RelationType classifies the relationship between two work items.
const ( RelationDependsOn RelationType = "DEPENDS_ON" RelationParentChild RelationType = "PARENT_CHILD" RelationSpawnedBy RelationType = "SPAWNED_BY" )
type RelationshipChangePayload ¶
type RelationshipChangePayload struct {
Relation FactoryRelation `json:"relation"`
RequestID string `json:"request_id,omitempty"`
TraceID string `json:"trace_id,omitempty"`
}
RelationshipChangePayload describes a relationship added by a request batch.
type RenderedPromptDiagnostic ¶
type RenderedPromptDiagnostic struct {
SystemPromptHash string `json:"system_prompt_hash,omitempty"`
UserMessageHash string `json:"user_message_hash,omitempty"`
Variables map[string]string `json:"variables,omitempty"`
}
RenderedPromptDiagnostic describes prompt material rendered for a model worker.
type ReplayArtifact ¶
type ReplayArtifact struct {
SchemaVersion string `json:"schemaVersion"`
RecordedAt time.Time `json:"recordedAt"`
Events []factoryapi.FactoryEvent `json:"events"`
// The fields below are hydrated from Events for the current replay
// implementation. They are intentionally excluded from artifact storage.
Factory factoryapi.Factory `json:"-"`
Diagnostics ReplayDiagnostics `json:"-"`
WallClock *ReplayWallClockMetadata `json:"-"`
}
ReplayArtifact is the versioned, self-contained recording used to replay a factory run without requiring the original customer files or live side effects.
type ReplayDiagnostics ¶
type ReplayDiagnostics struct {
Notes []string `json:"notes,omitempty"`
Workers map[string]SafeWorkDiagnostics `json:"workers,omitempty"`
}
ReplayDiagnostics stores artifact-level notes and optional nested execution details.
type ReplayWallClockMetadata ¶
type ReplayWallClockMetadata struct {
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
}
ReplayWallClockMetadata retains wall-clock timing for investigation only. Replay behavior is driven by logical ticks, not these timestamps.
type RequiredToolConfig ¶
type RequiredToolConfig struct {
Name string `json:"name"`
Command string `json:"command"`
Purpose string `json:"purpose,omitempty"`
VersionArgs []string `json:"versionArgs,omitempty"`
}
RequiredToolConfig declares one validation-only external tool dependency.
type ResolvedModelOperationBinding ¶ added in v0.0.5
type ResolvedModelOperationBinding struct {
Slot string `json:"slot"`
Source ModelOperationBindingSource `json:"source"`
Content []WorkContentPart `json:"content,omitempty"`
}
ResolvedModelOperationBinding stores one resolved slot binding before model execution begins.
func CloneResolvedModelOperationBindings ¶ added in v0.0.5
func CloneResolvedModelOperationBindings(values []ResolvedModelOperationBinding) []ResolvedModelOperationBinding
CloneResolvedModelOperationBindings returns a detached copy of one resolved model-operation binding slice.
type ResolvedRunnerSelection ¶ added in v0.0.5
type ResolvedRunnerSelection struct {
RunnerID string `json:"runner_id,omitempty"`
Source RunnerSelectionSource `json:"source,omitempty"`
}
ResolvedRunnerSelection is the canonical runner-selection result used by backend runtime code before dispatch starts.
func ResolveRunnerSelection ¶ added in v0.0.5
func ResolveRunnerSelection(workstationRunner, factoryRunner, workerModelProvider string) ResolvedRunnerSelection
ResolveRunnerSelection applies the v1 precedence rules for backend runtime runner choice: workstation override, then factory override, then legacy worker modelProvider compatibility, then the codex default.
type ResourceConfig ¶
type RunnerBaselineCapability ¶ added in v0.0.5
type RunnerBaselineCapability string
RunnerBaselineCapability is a v1 baseline runner behavior that every built-in runner must support for standard orchestration participation.
const ( RunnerBaselineCapabilityPromptSubmission RunnerBaselineCapability = "prompt_submission" RunnerBaselineCapabilityToolExecution RunnerBaselineCapability = "tool_execution" )
func V1RunnerBaselineCapabilities ¶ added in v0.0.5
func V1RunnerBaselineCapabilities() []RunnerBaselineCapability
V1RunnerBaselineCapabilities returns the explicit v1 baseline capability set.
type RunnerCapabilities ¶ added in v0.0.5
type RunnerCapabilities struct {
Baseline []RunnerBaselineCapability `json:"baseline"`
Optional []RunnerOptionalCapabilitySupport `json:"optional,omitempty"`
}
RunnerCapabilities describes one runner's baseline and optional capability support in a product-surface-friendly shape.
func NewRunnerCapabilities ¶ added in v0.0.5
func NewRunnerCapabilities(optional ...RunnerOptionalCapabilitySupport) RunnerCapabilities
NewRunnerCapabilities creates a capability payload with the explicit v1 baseline and detached optional capability support entries.
type RunnerExecutionRequest ¶ added in v0.0.5
type RunnerExecutionRequest = ProviderInferenceRequest
RunnerExecutionRequest is the shared runner-owned execution request contract used by standard orchestration flows.
type RunnerExecutionResult ¶ added in v0.0.5
type RunnerExecutionResult = InferenceResponse
RunnerExecutionResult is the shared runner-owned execution result contract used by standard orchestration flows.
type RunnerMetadata ¶ added in v0.0.5
type RunnerMetadata struct {
ID string `json:"id"`
DisplayName string `json:"display_name,omitempty"`
Capabilities RunnerCapabilities `json:"capabilities"`
}
RunnerMetadata is the canonical metadata shape that product surfaces can use to inspect one runner's identity and capability support.
func BuiltInRunnerMetadata ¶ added in v0.0.5
func BuiltInRunnerMetadata(id string) (RunnerMetadata, bool)
BuiltInRunnerMetadata returns the metadata for one stable built-in runner ID.
type RunnerOptionalCapability ¶ added in v0.0.5
type RunnerOptionalCapability string
RunnerOptionalCapability identifies an execution behavior that may be supported by some runners without being required for baseline participation.
const ( RunnerOptionalCapabilityImageInput RunnerOptionalCapability = "image_input" RunnerOptionalCapabilitySessionResume RunnerOptionalCapability = "session_resume" RunnerOptionalCapabilityStructuredOutput RunnerOptionalCapability = "structured_output" RunnerOptionalCapabilityWorkingDirectory RunnerOptionalCapability = "working_directory" RunnerOptionalCapabilityWorktree RunnerOptionalCapability = "worktree" )
type RunnerOptionalCapabilityStatus ¶ added in v0.0.5
type RunnerOptionalCapabilityStatus string
RunnerOptionalCapabilityStatus reports whether a runner can satisfy one optional capability.
const ( RunnerOptionalCapabilityStatusSupported RunnerOptionalCapabilityStatus = "supported" RunnerOptionalCapabilityStatusUnsupported RunnerOptionalCapabilityStatus = "unsupported" )
type RunnerOptionalCapabilitySupport ¶ added in v0.0.5
type RunnerOptionalCapabilitySupport struct {
Capability RunnerOptionalCapability `json:"capability"`
Status RunnerOptionalCapabilityStatus `json:"status"`
Detail string `json:"detail,omitempty"`
}
RunnerOptionalCapabilitySupport is the machine-readable capability status shape intended for backend, CLI, API, and UI consumption.
type RunnerSelectionSource ¶ added in v0.0.5
type RunnerSelectionSource string
RunnerSelectionSource reports which configuration layer supplied the runner choice that execution should use.
const ( RunnerSelectionSourceWorkstation RunnerSelectionSource = "workstation" RunnerSelectionSourceFactory RunnerSelectionSource = "factory" RunnerSelectionSourceLegacyProvider RunnerSelectionSource = "legacy_provider" RunnerSelectionSourceDefault RunnerSelectionSource = "default" )
type RunnerToolExecutionMode ¶ added in v0.0.5
type RunnerToolExecutionMode string
RunnerToolExecutionMode describes whether a runner invocation is expected to permit tool execution during the request lifecycle.
const ( // RunnerToolExecutionModeRequired means the orchestration path expects the // selected runner to support tool execution for this request. RunnerToolExecutionModeRequired RunnerToolExecutionMode = "required" // RunnerToolExecutionModeDisabled means the request does not require tool // execution support. RunnerToolExecutionModeDisabled RunnerToolExecutionMode = "disabled" )
type RuntimeConfigLookup ¶
type RuntimeConfigLookup interface {
RuntimeDefinitionLookup
FactoryDir() string
RuntimeBaseDir() string
}
RuntimeConfigLookup exposes the canonical public runtime-facing lookup contract for consumers that need runtime definitions plus path-aware execution lookups.
type RuntimeDefinitionLookup ¶
type RuntimeDefinitionLookup interface {
RuntimeWorkstationLookup
Worker(name string) (*WorkerConfig, bool)
}
RuntimeDefinitionLookup resolves runtime worker and workstation definitions by authored name.
func FirstRuntimeDefinitionLookup ¶
func FirstRuntimeDefinitionLookup(lookups ...RuntimeDefinitionLookup) RuntimeDefinitionLookup
FirstRuntimeDefinitionLookup returns the first non-nil runtime definition lookup from the provided candidates.
type RuntimeMode ¶
type RuntimeMode string
RuntimeMode determines whether the runtime exits on idle completion or stays available for future submissions until its context is canceled.
const ( RuntimeModeBatch RuntimeMode = "BATCH" RuntimeModeService RuntimeMode = "SERVICE" )
type RuntimeStatus ¶
type RuntimeStatus string
RuntimeStatus describes whether the runtime is actively processing work, intentionally idle but still available, or terminally finished.
const ( RuntimeStatusActive RuntimeStatus = "ACTIVE" RuntimeStatusIdle RuntimeStatus = "IDLE" RuntimeStatusFinished RuntimeStatus = "FINISHED" )
type RuntimeWorkstationLookup ¶
type RuntimeWorkstationLookup interface {
Workstation(name string) (*FactoryWorkstationConfig, bool)
}
RuntimeWorkstationLookup resolves runtime workstation definitions by authored name.
func FirstRuntimeWorkstationLookup ¶
func FirstRuntimeWorkstationLookup(lookups ...RuntimeWorkstationLookup) RuntimeWorkstationLookup
FirstRuntimeWorkstationLookup returns the first non-nil runtime workstation lookup from the provided candidates.
type SafeProviderDiagnostic ¶
type SafeProviderDiagnostic struct {
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
RequestMetadata map[string]string `json:"request_metadata,omitempty"`
ResponseMetadata map[string]string `json:"response_metadata,omitempty"`
}
SafeProviderDiagnostic carries allowlisted provider execution metadata.
type SafeRenderedPromptDiagnostic ¶
type SafeRenderedPromptDiagnostic struct {
SystemPromptHash string `json:"system_prompt_hash,omitempty"`
UserMessageHash string `json:"user_message_hash,omitempty"`
Variables map[string]string `json:"variables,omitempty"`
}
SafeRenderedPromptDiagnostic carries prompt hashes and allowlisted variables.
type SafeWorkDiagnostics ¶
type SafeWorkDiagnostics struct {
RenderedPrompt *SafeRenderedPromptDiagnostic `json:"rendered_prompt,omitempty"`
Provider *SafeProviderDiagnostic `json:"provider,omitempty"`
}
SafeWorkDiagnostics carries the canonical dashboard-safe execution diagnostics surface used by event history, replay, and selected-tick projections.
func CloneSafeWorkDiagnostics ¶
func CloneSafeWorkDiagnostics(diagnostics *SafeWorkDiagnostics) *SafeWorkDiagnostics
CloneSafeWorkDiagnostics returns a detached copy of the canonical safe diagnostics boundary.
func SafeWorkDiagnosticsFromGenerated ¶
func SafeWorkDiagnosticsFromGenerated(diagnostics *factoryapi.SafeWorkDiagnostics) *SafeWorkDiagnostics
SafeWorkDiagnosticsFromGenerated converts the generated safe diagnostics contract into the canonical internal safe boundary.
func SafeWorkDiagnosticsFromWorkDiagnostics ¶
func SafeWorkDiagnosticsFromWorkDiagnostics(diagnostics *WorkDiagnostics) *SafeWorkDiagnostics
SafeWorkDiagnosticsFromWorkDiagnostics projects worker-internal diagnostics onto the canonical safe diagnostics boundary.
type StateConfig ¶
StateConfig declares a state within a work type.
type SubmissionHookContext ¶
type SubmissionHookContext[TSnapshot any] struct { Snapshot TSnapshot ContinuationState map[string]string }
SubmissionHookContext is the input passed to engine-owned submission hooks once per logical tick.
type SubmissionHookResult ¶
type SubmissionHookResult struct {
GeneratedBatches []GeneratedSubmissionBatch
Results []WorkResult
MarkingMutations []MarkingMutation
ContinuationState map[string]string
KeepAlive bool
}
SubmissionHookResult contains all due hook output observed by the engine at one logical tick.
type SubmitRequest ¶
type SubmitRequest struct {
RequestID string `json:"requestId,omitempty"`
WorkID string `json:"workId,omitempty"`
Name string `json:"name,omitempty"`
WorkTypeID string `json:"workTypeName"`
TargetState string `json:"targetState,omitempty"`
ChainingTraceDepth int `json:"chainingTraceDepth,omitempty"`
CurrentChainingTraceID string `json:"currentChainingTraceId,omitempty"`
PreviousChainingTraceIDs []string `json:"previousChainingTraceIds,omitempty"`
TraceID string `json:"traceId"`
Content []WorkContentPart `json:"content,omitempty"`
Payload []byte `json:"payload"`
Tags map[string]string `json:"tags"`
Relations []Relation `json:"relations"`
ExecutionID string `json:"executionId,omitempty"`
}
SubmitRequest is the internal normalized item used to create work tokens.
type SubprocessExecutionRequest ¶
type SubprocessExecutionRequest struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Stdin []byte `json:"stdin,omitempty"`
Env []string `json:"env,omitempty"`
WorkDir string `json:"work_dir,omitempty"`
DispatchID string `json:"dispatch_id,omitempty"`
TransitionID string `json:"transition_id,omitempty"`
WorkerType string `json:"worker_type,omitempty"`
WorkstationName string `json:"workstation_name,omitempty"`
ProjectID string `json:"project_id,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
Execution ExecutionMetadata `json:"execution,omitempty"`
InputTokens []any `json:"input_tokens,omitempty"`
InputBindings map[string][]string `json:"input_bindings,omitempty"`
}
SubprocessExecutionRequest is the command-boundary request derived from workstation or provider execution. It carries only subprocess-owned command fields plus the dispatch correlation and input context needed at that seam.
func CloneSubprocessExecutionRequest ¶
func CloneSubprocessExecutionRequest(request SubprocessExecutionRequest) SubprocessExecutionRequest
CloneSubprocessExecutionRequest returns a detached copy of the subprocess boundary request.
type TickResult ¶
type TickResult struct {
Mutations []MarkingMutation `json:"mutations,omitempty"`
GeneratedBatches []GeneratedSubmissionBatch `json:"generated_batches,omitempty"`
Dispatches []DispatchRecord `json:"dispatches,omitempty"`
Histories []TokenHistory `json:"histories,omitempty"`
CompletedDispatches []CompletedDispatch `json:"completed_dispatches,omitempty"`
ActiveThrottlePauses []ActiveThrottlePause `json:"active_throttle_pauses,omitempty"`
ThrottlePausesObserved bool `json:"throttle_pauses_observed,omitempty"`
ShouldTerminate bool `json:"should_terminate,omitempty"`
}
TickResult is the output of a single subsystem execution.
type Token ¶
type Token struct {
ID string `json:"id"`
PlaceID string `json:"place_id"`
Color TokenColor `json:"color"`
CreatedAt time.Time `json:"created_at"`
EnteredAt time.Time `json:"entered_at"`
History TokenHistory `json:"history"`
}
Token is a colored token: a work item or resource with data flowing through the net.
func CloneToken ¶ added in v0.0.5
CloneToken returns a detached copy of the canonical runtime token shape.
func CloneTokens ¶ added in v0.0.5
CloneTokens returns detached copies of canonical runtime tokens.
type TokenColor ¶
type TokenColor struct {
Name string `json:"name"`
RequestID string `json:"request_id"`
WorkID string `json:"work_id"`
WorkTypeID string `json:"work_type_id"`
DataType DataType `json:"data_type"`
ChainingTraceDepth int `json:"chaining_trace_depth,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
TraceID string `json:"trace_id"`
ParentID string `json:"parent_id"`
Tags map[string]string `json:"tags"`
Relations []Relation `json:"relations"`
Content []WorkContentPart `json:"content,omitempty"`
Payload []byte `json:"payload"`
}
TokenColor carries the domain data attached to a token.
func CloneTokenColor ¶ added in v0.0.5
func CloneTokenColor(color TokenColor) TokenColor
CloneTokenColor returns a detached copy of the canonical runtime token color.
type TokenHistory ¶
type TokenHistory struct {
TotalVisits map[string]int `json:"total_visits"`
ConsecutiveFailures map[string]int `json:"consecutive_failures"`
PlaceVisits map[string]int `json:"place_visits"`
TotalDuration time.Duration `json:"total_duration"`
LastError string `json:"last_error"`
FailureLog []FailureRecord `json:"failure_log"`
}
TokenHistory tracks a token's journey through the net.
func CloneTokenHistory ¶ added in v0.0.5
func CloneTokenHistory(history TokenHistory) TokenHistory
CloneTokenHistory returns a detached copy of canonical runtime token history.
type TokenMutationRecord ¶
type TokenMutationRecord struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
Outcome WorkOutcome `json:"outcome"`
Type MutationType `json:"type"`
TokenID string `json:"token_id"`
FromPlace string `json:"from_place"`
ToPlace string `json:"to_place"`
Reason string `json:"reason"`
Token *Token `json:"token,omitempty"`
}
TokenMutationRecord stores the raw token mutation emitted while applying a worker result.
type TransitionConfig ¶
type Work ¶
type Work struct {
Name string `json:"name"`
WorkID string `json:"workId,omitempty"`
RequestID string `json:"requestId,omitempty"`
WorkTypeID string `json:"workTypeName,omitempty"`
State string `json:"state,omitempty"`
ChainingTraceDepth int `json:"chainingTraceDepth,omitempty"`
CurrentChainingTraceID string `json:"currentChainingTraceId,omitempty"`
PreviousChainingTraceIDs []string `json:"previousChainingTraceIds,omitempty"`
TraceID string `json:"traceId,omitempty"`
Content []WorkContentPart `json:"content,omitempty"`
Payload any `json:"payload,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
ExecutionID string `json:"-"`
RuntimeRelations []Relation `json:"-"`
}
Work is one public item inside a WorkRequest batch.
type WorkContentPart ¶ added in v0.0.5
type WorkContentPart struct {
Type WorkContentPartType `json:"type"`
Text string `json:"text,omitempty"`
URL string `json:"url,omitempty"`
File string `json:"file,omitempty"`
JSON json.RawMessage `json:"json,omitempty"`
Slot string `json:"slot,omitempty"`
Label string `json:"label,omitempty"`
Role string `json:"role,omitempty"`
ContentType string `json:"contentType,omitempty"`
ArtifactID string `json:"artifactId,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
WorkContentPart is the backend-owned canonical work content shape mirrored from the public API contract.
func CloneWorkContentParts ¶ added in v0.0.5
func CloneWorkContentParts(parts []WorkContentPart) []WorkContentPart
CloneWorkContentParts returns a detached copy of canonical work content parts.
type WorkContentPartType ¶ added in v0.0.5
type WorkContentPartType string
WorkContentPartType identifies one canonical content part kind.
const ( WorkContentPartTypeText WorkContentPartType = "text" WorkContentPartTypeImage WorkContentPartType = "image" WorkContentPartTypeAudio WorkContentPartType = "AUDIO" WorkContentPartTypeJSON WorkContentPartType = "JSON" WorkContentPartTypeBinary WorkContentPartType = "BINARY" )
func (WorkContentPartType) Normalized ¶ added in v0.0.5
func (t WorkContentPartType) Normalized() WorkContentPartType
Normalized returns the stable backend-owned kind for supported public aliases.
type WorkDiagnostics ¶
type WorkDiagnostics struct {
RenderedPrompt *RenderedPromptDiagnostic `json:"rendered_prompt,omitempty"`
Provider *ProviderDiagnostic `json:"provider,omitempty"`
Command *CommandDiagnostic `json:"command,omitempty"`
Panic *PanicDiagnostic `json:"panic,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
WorkDiagnostics carries nested provider and script diagnostics.
func CloneWorkDiagnostics ¶ added in v0.0.5
func CloneWorkDiagnostics(diagnostics *WorkDiagnostics) *WorkDiagnostics
CloneWorkDiagnostics returns a detached copy of canonical worker-facing diagnostics.
func WorkDiagnosticsFromSafeWorkDiagnostics ¶ added in v0.0.5
func WorkDiagnosticsFromSafeWorkDiagnostics(diagnostics *SafeWorkDiagnostics) *WorkDiagnostics
WorkDiagnosticsFromSafeWorkDiagnostics rehydrates worker-facing diagnostics from the canonical safe diagnostics boundary.
type WorkDispatch ¶
type WorkDispatch struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
WorkerType string `json:"worker_type,omitempty"`
WorkstationName string `json:"workstation_name,omitempty"`
ProjectID string `json:"project_id,omitempty"`
CurrentChainingTraceID string `json:"current_chaining_trace_id,omitempty"`
PreviousChainingTraceIDs []string `json:"previous_chaining_trace_ids,omitempty"`
Execution ExecutionMetadata `json:"execution,omitempty"`
InputTokens []any `json:"input_tokens"`
InputBindings map[string][]string `json:"input_bindings,omitempty"`
}
WorkDispatch is the canonical dispatch-owned runtime payload.
Dispatcher construction owns these fields. Worker execution must derive any prompt, environment, path, model, provider, or session state into the dedicated boundary request types below instead of mutating WorkDispatch.
func CloneWorkDispatch ¶
func CloneWorkDispatch(dispatch WorkDispatch) WorkDispatch
CloneWorkDispatch returns a detached copy of the canonical dispatch-owned contract.
type WorkFailureDecision ¶ added in v0.0.5
WorkFailureDecision is the normalized behavior contract consumed by downstream retry, termination, and throttle-pause logic.
type WorkFailureFamily ¶ added in v0.0.5
type WorkFailureFamily string
WorkFailureFamily captures the runtime behavior category for a normalized work failure.
const ( WorkFailureFamilyTerminal WorkFailureFamily = "terminal" WorkFailureFamilyRetryable WorkFailureFamily = "retryable" WorkFailureFamilyThrottle WorkFailureFamily = "throttle" )
type WorkFailureMetadata ¶ added in v0.0.5
type WorkFailureMetadata struct {
Family WorkFailureFamily `json:"family"`
Type WorkFailureType `json:"type"`
}
WorkFailureMetadata carries the normalized failure contract across runtime boundaries after the original error has been rendered.
func CanonicalWorkFailureMetadata ¶ added in v0.0.5
func CanonicalWorkFailureMetadata(failure *WorkFailureMetadata, providerFailure *ProviderFailureMetadata) *WorkFailureMetadata
CanonicalWorkFailureMetadata returns the generalized failure metadata from the runtime result, falling back to the legacy provider-named field while older callers are still being migrated.
func CloneWorkFailureMetadata ¶ added in v0.0.5
func CloneWorkFailureMetadata(failure *WorkFailureMetadata) *WorkFailureMetadata
CloneWorkFailureMetadata returns a detached copy of canonical work failure metadata.
func WorkFailureMetadataFromGenerated ¶ added in v0.0.5
func WorkFailureMetadataFromGenerated(failure *factoryapi.ProviderFailureMetadata) *WorkFailureMetadata
WorkFailureMetadataFromGenerated converts the generated provider-failure contract into canonical work-failure metadata.
type WorkFailureType ¶ added in v0.0.5
type WorkFailureType string
WorkFailureType is the stable customer-facing normalized failure type for scoped runtime work execution paths.
const ( WorkFailureTypeAuthFailure WorkFailureType = "auth_failure" WorkFailureTypePermanentBadRequest WorkFailureType = "permanent_bad_request" WorkFailureTypeThrottled WorkFailureType = "throttled" WorkFailureTypeInternalServerError WorkFailureType = "internal_server_error" WorkFailureTypeTimeout WorkFailureType = "timeout" WorkFailureTypeUnknown WorkFailureType = "unknown" WorkFailureTypeMisconfigured WorkFailureType = "misconfigured" )
type WorkInputPayload ¶
type WorkInputPayload struct {
TokenID string `json:"token_id"`
WorkItem FactoryWorkItem `json:"work_item"`
Relations []FactoryRelation `json:"relations,omitempty"`
}
WorkInputPayload describes a work item submitted to the factory.
type WorkMetrics ¶
type WorkMetrics struct {
Duration time.Duration `json:"duration"`
Cost float64 `json:"cost"`
RetryCount int `json:"retry_count"`
}
WorkMetrics captures performance data from a worker execution.
type WorkOutcome ¶
type WorkOutcome string
WorkOutcome distinguishes the result routing behavior for worker output.
const ( // OutcomeAccepted means the transition succeeded. Use output arcs. OutcomeAccepted WorkOutcome = "ACCEPTED" // OutcomeContinue means the worker made partial progress. Use continue arcs. OutcomeContinue WorkOutcome = "CONTINUE" // OutcomeRejected means the business result was negative. Use rejection arcs. OutcomeRejected WorkOutcome = "REJECTED" // OutcomeFailed means execution crashed, timed out, or hit a system error. OutcomeFailed WorkOutcome = "FAILED" )
type WorkPayloadContinuity ¶ added in v0.0.5
type WorkPayloadContinuity string
const ( WorkPayloadContinuityInitial WorkPayloadContinuity = "INITIAL_SUBMISSION" WorkPayloadContinuitySameWorkID WorkPayloadContinuity = "SAME_WORK_ID_CONTINUATION" WorkPayloadContinuityNewDownstreamWork WorkPayloadContinuity = "NEW_DOWNSTREAM_WORK" )
type WorkPayloadLineageProjection ¶ added in v0.0.5
type WorkPayloadLineageProjection struct {
SnapshotsByID map[string]WorkPayloadSnapshot `json:"snapshots_by_id,omitempty"`
InitialSnapshotIDByWorkID map[string]string `json:"initial_snapshot_id_by_work_id,omitempty"`
LatestSnapshotIDByWorkID map[string]string `json:"latest_snapshot_id_by_work_id,omitempty"`
ConsumedSnapshotRefsByDispatchID map[string]map[string]WorkPayloadRef `json:"consumed_snapshot_refs_by_dispatch_id,omitempty"`
OutputSnapshotRefsByDispatchID map[string]map[string]WorkPayloadRef `json:"output_snapshot_refs_by_dispatch_id,omitempty"`
SnapshotIDsByWorkID map[string][]string `json:"snapshot_ids_by_work_id,omitempty"`
}
WorkPayloadLineageProjection is the canonical replay-safe source of truth for user-visible work payload history. It records submitted and response-produced payload snapshots, plus the dispatch-time snapshot actually consumed by each workstation request.
func (*WorkPayloadLineageProjection) RecordConsumedInputSnapshot ¶ added in v0.0.5
func (p *WorkPayloadLineageProjection) RecordConsumedInputSnapshot(dispatchID string, item FactoryWorkItem)
RecordConsumedInputSnapshot fixes the dispatch-time payload snapshot that actually fed one dispatch input. This is the precedence owner for consumed-input lookups and must not be recomputed from later latest state.
func (*WorkPayloadLineageProjection) RecordDispatchOutputSnapshot ¶ added in v0.0.5
func (p *WorkPayloadLineageProjection) RecordDispatchOutputSnapshot( observedTick int, dispatchID string, consumedInputs []FactoryWorkItem, item FactoryWorkItem, outputIndex int, )
RecordDispatchOutputSnapshot captures the payload-bearing work snapshot introduced by a DISPATCH_RESPONSE output and records its continuation relationship to the dispatch's consumed lineage context.
func (*WorkPayloadLineageProjection) RecordWorkRequestSnapshot ¶ added in v0.0.5
func (p *WorkPayloadLineageProjection) RecordWorkRequestSnapshot(observedTick int, requestID string, item FactoryWorkItem)
RecordWorkRequestSnapshot captures a canonical payload-bearing WORK_REQUEST snapshot. This is the precedence owner for initial-submission lookups.
func (WorkPayloadLineageProjection) ResolveConsumedInputSnapshot ¶ added in v0.0.5
func (p WorkPayloadLineageProjection) ResolveConsumedInputSnapshot(dispatchID, workID string) WorkPayloadResolution
ResolveConsumedInputSnapshot chooses the dispatch-time consumed snapshot for one dispatch/work pair. This never falls forward to the latest known state.
func (WorkPayloadLineageProjection) ResolveInitialSubmittedSnapshot ¶ added in v0.0.5
func (p WorkPayloadLineageProjection) ResolveInitialSubmittedSnapshot(workID string) WorkPayloadResolution
ResolveInitialSubmittedSnapshot chooses the original submitted snapshot for a work item. This never falls forward to later dispatch outputs.
func (WorkPayloadLineageProjection) ResolveOutputWorkSnapshot ¶ added in v0.0.5
func (p WorkPayloadLineageProjection) ResolveOutputWorkSnapshot(dispatchID, workID string) WorkPayloadResolution
ResolveOutputWorkSnapshot chooses the response-produced payload snapshot for one dispatch/work pair. This never falls back to a later selected-work view.
func (WorkPayloadLineageProjection) ResolveSelectedWorkSnapshot ¶ added in v0.0.5
func (p WorkPayloadLineageProjection) ResolveSelectedWorkSnapshot(workID string) WorkPayloadResolution
ResolveSelectedWorkSnapshot chooses the latest known payload snapshot for the current selectable state of a work item.
type WorkPayloadRef ¶ added in v0.0.5
type WorkPayloadRef struct {
Status WorkPayloadResolutionStatus `json:"status"`
SnapshotID string `json:"snapshot_id,omitempty"`
Reason string `json:"reason,omitempty"`
}
WorkPayloadRef points at the canonical snapshot chosen for one specific lineage lookup context.
type WorkPayloadResolution ¶ added in v0.0.5
type WorkPayloadResolution struct {
Status WorkPayloadResolutionStatus `json:"status"`
Reason string `json:"reason,omitempty"`
Snapshot *WorkPayloadSnapshot `json:"snapshot,omitempty"`
}
WorkPayloadResolution is the caller-facing answer for one lineage lookup.
type WorkPayloadResolutionStatus ¶ added in v0.0.5
type WorkPayloadResolutionStatus string
const ( WorkPayloadResolutionResolved WorkPayloadResolutionStatus = "RESOLVED" )
type WorkPayloadSnapshot ¶ added in v0.0.5
type WorkPayloadSnapshot struct {
SnapshotID string `json:"snapshot_id"`
WorkID string `json:"work_id"`
LogicalWorkID string `json:"logical_work_id"`
SourceKind WorkPayloadSnapshotKind `json:"source_kind"`
SourceEventType string `json:"source_event_type"`
RequestID string `json:"request_id,omitempty"`
DispatchID string `json:"dispatch_id,omitempty"`
ObservedTick int `json:"observed_tick,omitempty"`
Continuity WorkPayloadContinuity `json:"continuity"`
ParentSnapshotIDs []string `json:"parent_snapshot_ids,omitempty"`
ParentWorkIDs []string `json:"parent_work_ids,omitempty"`
ParentLogicalWorkIDs []string `json:"parent_logical_work_ids,omitempty"`
WorkItem FactoryWorkItem `json:"work_item"`
}
WorkPayloadSnapshot is one immutable payload-bearing work view captured from a canonical event class.
type WorkPayloadSnapshotKind ¶ added in v0.0.5
type WorkPayloadSnapshotKind string
const ( WorkPayloadSnapshotKindWorkRequest WorkPayloadSnapshotKind = "WORK_REQUEST" WorkPayloadSnapshotKindDispatchOutput WorkPayloadSnapshotKind = "DISPATCH_RESPONSE_OUTPUT" )
type WorkRelation ¶
type WorkRelation struct {
Type WorkRelationType `json:"type"`
SourceWorkName string `json:"sourceWorkName"`
TargetWorkName string `json:"targetWorkName"`
RequiredState string `json:"requiredState,omitempty"`
}
WorkRelation describes a relation between named work items in a WorkRequest.
type WorkRelationType ¶
type WorkRelationType string
WorkRelationType identifies a relationship between work items in a WorkRequest.
const ( WorkRelationDependsOn WorkRelationType = "DEPENDS_ON" WorkRelationParentChild WorkRelationType = "PARENT_CHILD" )
type WorkRequest ¶
type WorkRequest struct {
RequestID string `json:"requestId"`
CurrentChainingTraceID string `json:"currentChainingTraceId,omitempty"`
Type WorkRequestType `json:"type"`
Works []Work `json:"works,omitempty"`
Relations []WorkRelation `json:"relations,omitempty"`
}
WorkRequest is the factory-domain representation of the generated WorkRequest schema.
type WorkRequestNormalizeOptions ¶
type WorkRequestNormalizeOptions struct {
DefaultWorkTypeID string
ValidWorkTypes map[string]bool
ValidStatesByType map[string]map[string]bool
}
WorkRequestNormalizeOptions provides context inferred from a submit surface.
type WorkRequestPayload ¶
type WorkRequestPayload struct {
RequestID string `json:"request_id"`
Type WorkRequestType `json:"type"`
TraceID string `json:"trace_id,omitempty"`
Source string `json:"source,omitempty"`
ParentLineage []string `json:"parent_lineage,omitempty"`
WorkItems []FactoryWorkItem `json:"work_items,omitempty"`
}
WorkRequestPayload describes a canonical work request batch submission.
type WorkRequestRecord ¶
type WorkRequestRecord struct {
RequestID string
Type WorkRequestType
TraceID string
Source string
ParentLineage []string
WorkItems []FactoryWorkItem
Relations []FactoryRelation
}
WorkRequestRecord stores the batch-level request observed before work token injection.
type WorkRequestSubmitResult ¶
type WorkRequestSubmitResult struct {
RequestID string
TraceID string
WorkID string
Name string
WorkTypeName string
Accepted bool
Works []WorkRequestSubmittedWork
}
WorkRequestSubmitResult describes accepted request metadata.
type WorkRequestSubmittedWork ¶ added in v0.0.5
WorkRequestSubmittedWork identifies one accepted work item in a batch upsert.
type WorkRequestType ¶
type WorkRequestType string
WorkRequestType identifies the canonical request contract accepted by factory submit surfaces.
const (
WorkRequestTypeFactoryRequestBatch WorkRequestType = "FACTORY_REQUEST_BATCH"
)
type WorkResult ¶
type WorkResult struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
Outcome WorkOutcome `json:"outcome"`
Output string `json:"output,omitempty"`
SpawnedWork []TokenColor `json:"spawned_work,omitempty"`
RecordedOutputWork []FactoryWorkItem `json:"recorded_output_work,omitempty"`
Error string `json:"error,omitempty"`
Feedback string `json:"feedback,omitempty"`
SelectedClassificationLabel string `json:"selected_classification_label,omitempty"`
FailureMetadata *WorkFailureMetadata `json:"failure_metadata,omitempty"`
ProviderFailure *ProviderFailureMetadata `json:"provider_failure,omitempty"`
ProviderSession *ProviderSessionMetadata `json:"provider_session,omitempty"`
Diagnostics *WorkDiagnostics `json:"diagnostics,omitempty"`
Metrics WorkMetrics `json:"metrics"`
}
WorkResult is returned by a worker after processing. The Outcome determines which arc set is used to route the resulting tokens.
type WorkStateChangeRecord ¶ added in v0.0.5
type WorkStateChangeRecord struct {
WorkID string
WorkTypeID string
WorkTypeName string
FromState string
ToState string
FromPlaceID string
ToPlaceID string
Source WorkStateChangeSource
RequestID string
TriggerWorkID string
Reason string
}
WorkStateChangeRecord captures one operator or cascade marking relocation for canonical event history emission.
type WorkStateChangeSource ¶ added in v0.0.5
type WorkStateChangeSource string
WorkStateChangeSource identifies who initiated a WORK_STATE_CHANGE event.
const ( WorkStateChangeSourceAPI WorkStateChangeSource = "api" WorkStateChangeSourceCLI WorkStateChangeSource = "cli" WorkStateChangeSourceCascadingFailure WorkStateChangeSource = "cascading-failure" )
type WorkTypeConfig ¶
type WorkTypeConfig struct {
Name string `json:"name"`
States []StateConfig `json:"states"`
HandlingBehavior []string `json:"handlingBehavior,omitempty"`
}
type WorkerConfig ¶
type WorkerConfig struct {
Name string `json:"name" yaml:"name,omitempty"`
Type string `json:"type" yaml:"type"`
Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
Model string `json:"model,omitempty" yaml:"model,omitempty"`
ModelProvider string `json:"modelProvider,omitempty" yaml:"modelProvider,omitempty"`
ModelLocality string `json:"modelLocality,omitempty" yaml:"modelLocality,omitempty"`
ExecutorProvider string `json:"executorProvider,omitempty" yaml:"executorProvider,omitempty"`
Operations []ModelOperation `json:"operations,omitempty" yaml:"operations,omitempty"`
Command string `json:"command,omitempty" yaml:"command,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Resources []ResourceConfig `json:"resources,omitempty" yaml:"resources,omitempty"`
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
StopToken string `json:"stopToken,omitempty" yaml:"stopToken,omitempty"`
SkipPermissions bool `json:"skipPermissions,omitempty" yaml:"skipPermissions,omitempty"`
OpenCodeAgent string `json:"openCodeAgent,omitempty" yaml:"openCodeAgent,omitempty"`
Auth *HostedWorkerAuthConfig `json:"auth,omitempty" yaml:"auth,omitempty"`
Linear *HostedLinearWorkerConfig `json:"linear,omitempty" yaml:"linear,omitempty"`
Body string `json:"body,omitempty" yaml:"-"`
// Internal-only runtime fields retained during contract cleanup.
SessionID string `json:"-" yaml:"-"`
Concurrency int `json:"-" yaml:"-"`
}
WorkerConfig is the canonical worker configuration used by factory.json, worker AGENTS.md frontmatter, and loaded runtime config.
func (*WorkerConfig) TimeoutDuration ¶
func (w *WorkerConfig) TimeoutDuration() time.Duration
TimeoutDuration parses Timeout as a time.Duration. It returns zero when the value is empty or invalid.
type WorkerState ¶
type WorkerState struct {
// ID is a unique identifier for this snapshot.
ID string
// WorkDispatchIDs lists the IDs of currently in-flight dispatches.
WorkDispatchIDs []string
// StartedAt is when the dispatcher was created.
StartedAt time.Time
}
WorkerState is a point-in-time snapshot of the dispatcher's state.
type WorkflowConfig ¶
type WorkflowConfig struct {
Name string `json:"name"`
Paths []TransitionConfig `json:"transitions"`
}
type WorkstationExecutionRequest ¶
type WorkstationExecutionRequest struct {
Dispatch WorkDispatch `json:"dispatch"`
WorkerType string `json:"worker_type,omitempty"`
WorkstationType string `json:"workstation_type,omitempty"`
RunnerID string `json:"runner_id,omitempty"`
RunnerSelectionSource RunnerSelectionSource `json:"runner_selection_source,omitempty"`
ProjectID string `json:"project_id,omitempty"`
InputTokens []any `json:"input_tokens,omitempty"`
ModelOperation string `json:"model_operation,omitempty"`
ModelBindings []ResolvedModelOperationBinding `json:"model_bindings,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
UserMessage string `json:"user_message,omitempty"`
OutputSchema string `json:"output_schema,omitempty"`
EnvVars map[string]string `json:"env_vars,omitempty"`
Worktree string `json:"worktree,omitempty"`
WorkingDirectory string `json:"working_directory,omitempty"`
}
WorkstationExecutionRequest is the worker-owned request assembled after workstation rendering. It combines the canonical dispatch identity with the resolved prompt, ordered inputs, runtime context, and worker selection needed by inner executors.
func CloneWorkstationExecutionRequest ¶
func CloneWorkstationExecutionRequest(request WorkstationExecutionRequest) WorkstationExecutionRequest
CloneWorkstationExecutionRequest returns a detached copy of the rendered workstation boundary request.
type WorkstationInput ¶
type WorkstationInput struct {
TokenID string `json:"token_id"`
PlaceID string `json:"place_id"`
WorkItem *FactoryWorkItem `json:"work_item,omitempty"`
Resource *FactoryResourceUnit `json:"resource,omitempty"`
}
WorkstationInput describes an input token consumed by a dispatch.
func CloneWorkstationInputs ¶
func CloneWorkstationInputs(inputs []WorkstationInput) []WorkstationInput
CloneWorkstationInputs returns a detached copy of canonical workstation inputs for selected-tick runtime projections.
type WorkstationKind ¶
type WorkstationKind string
WorkstationKind identifies the scheduling semantics of a workstation.
const ( // WorkstationKindStandard is the default fire-once workstation type. WorkstationKindStandard WorkstationKind = "standard" // WorkstationKindRepeater re-fires a transition after a non-terminal result. WorkstationKindRepeater WorkstationKind = "repeater" // WorkstationKindCron declares a timed trigger workstation. WorkstationKindCron WorkstationKind = "cron" // WorkstationKindPoller declares a long-lived ingress poller workstation. WorkstationKindPoller WorkstationKind = "poller" )
type WorkstationLimits ¶
type WorkstationLimits struct {
MaxRetries int `json:"max_retries,omitempty" yaml:"maxRetries,omitempty"`
MaxExecutionTime string `json:"max_execution_time,omitempty" yaml:"maxExecutionTime,omitempty"`
}
WorkstationLimits holds execution limits from workstation configuration.
type WorkstationOutput ¶
type WorkstationOutput struct {
Type string `json:"type"`
TokenID string `json:"token_id"`
FromPlace string `json:"from_place,omitempty"`
ToPlace string `json:"to_place,omitempty"`
WorkItem *FactoryWorkItem `json:"work_item,omitempty"`
Resource *FactoryResourceUnit `json:"resource,omitempty"`
}
WorkstationOutput describes a token produced or moved by a dispatch.
type WorkstationRequestPayload ¶
type WorkstationRequestPayload struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
Workstation FactoryWorkstationRef `json:"workstation"`
RunnerID string `json:"runner_id,omitempty"`
RunnerSelectionSource RunnerSelectionSource `json:"runner_selection_source,omitempty"`
Inputs []WorkstationInput `json:"inputs,omitempty"`
Resources []FactoryResourceUnit `json:"resources,omitempty"`
}
WorkstationRequestPayload describes work and resources consumed by a dispatch.
type WorkstationResponsePayload ¶
type WorkstationResponsePayload struct {
DispatchID string `json:"dispatch_id"`
TransitionID string `json:"transition_id"`
Workstation FactoryWorkstationRef `json:"workstation"`
Result WorkstationResult `json:"result"`
DurationMillis int64 `json:"duration_millis"`
Outputs []WorkstationOutput `json:"outputs,omitempty"`
OutputWork []FactoryWorkItem `json:"output_work,omitempty"`
OutputResources []FactoryResourceUnit `json:"output_resources,omitempty"`
TraceData *FactoryTraceData `json:"trace_data,omitempty"`
ProviderSession *ProviderSessionMetadata `json:"provider_session,omitempty"`
Diagnostics *SafeWorkDiagnostics `json:"diagnostics,omitempty"`
TerminalWork *FactoryTerminalWork `json:"terminal_work,omitempty"`
}
WorkstationResponsePayload describes the result and outputs of a dispatch.
type WorkstationResult ¶
type WorkstationResult struct {
Outcome string `json:"outcome"`
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
Feedback string `json:"feedback,omitempty"`
SelectedClassificationLabel string `json:"selected_classification_label,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
FailureMessage string `json:"failure_message,omitempty"`
FailureMetadata *WorkFailureMetadata `json:"failure_metadata,omitempty"`
ProviderFailure *ProviderFailureMetadata `json:"provider_failure,omitempty"`
}
WorkstationResult describes the business result of a workstation execution.