Factory schema
Reference for the factory configuration schema.
This is a reference for the factory configuration schema. The config is used to declare the shape of a factory. What are the workers, what are the workstations, guards, limits, and all other things.
Core configuration
The root object of a factory configuration file. Every field below is declared directly on it; the sections that follow describe the objects it references.
You Factory configuration
objectTop-level factory.json contract. Declare the work types, resources, portability resources, workers, and workstations that make up one authored factory here. Guarded loop breakers should be authored as guarded LOGICAL_MOVE workstations using VISIT_COUNT guards instead of a top-level exhaustion-rules field.
- additionalProperties
false (closed)
Fields
Optional localized customer-facing explanation of this Factory.
Ordered runnable invocation examples. Canonical Factory documents write examples here; legacy invocationSignature.examples are accepted only by the Factory input compatibility mapper.
- factoryDirectoryOptionalstring
Directory that contained the factory.json used for this serialized runtime config.
Root-level guards that apply across the factory instead of one specific workstation or input.
- idOptionalstring
Factory identifier used as the factory-level template context fallback.
Named input kinds accepted by the factory. The default input type is implicit and must not be declared.
Optional factory-authored invocation primary-result policy shared by CLI and API entrypoints. When omitted, runtimes use the SUBMITTED_WORK_TERMINAL fallback and return the first terminal content for the work item originally submitted by the invocation.
Optional canonical callable argument contract shared by CLI, API, dashboard, docs, and packaged factories. When omitted, callers use the factory's compatibility invocation behavior.
Optional non-executable graph editor layout metadata keyed by canonical graph node and edge ids.
Free-form factory-level metadata carried through runtime serialization and replay diagnostics.
Authored orchestrator identity for this factory. When omitted, existing Petri factories load through compatibility defaulting to orchestrator.kind = PETRI.
Shared capacity pools that workers or workstations can consume while work is executing.
Default runner selection for the factory when a workstation does not declare its own runner override.
- sourceDirectoryOptionalstring
Original source directory for record/replay and drift diagnostics.
Optional portability manifest for validation-only external tools and portable bundled files. During v1 factory sharing, bundled INPUT files represent a share-time snapshot of the source factory's current inputs work so recipients restore detached starter-work copies that no longer sync back to the original factory. This contract is distinct from runtime-capacity resources.
Server-managed current-factory version metadata. Clients should echo this value on complete replacement saves when they want stale-write detection, but durable factory configuration does not treat it as customer-authored topology.
Customer-authored work item categories and the lifecycle states each one can occupy.
Reusable worker definitions that workstations reference by name when dispatching work.
Processing steps that consume work, invoke workers, and emit the next work states.
Examples
- Full Factory configurationAuthored examplejson
{ "workTypes": [ { "name": "task", "states": [ { "name": "init", "type": "INITIAL" }, { "name": "complete", "type": "TERMINAL" }, { "name": "failed", "type": "FAILED" } ] } ], "workers": [ { "name": "processor" } ], "workstations": [ { "name": "process", "worker": "processor", "inputs": [ { "workType": "task", "state": "init" } ], "outputs": [ { "workType": "task", "state": "complete" } ], "onFailure": { "workType": "task", "state": "failed" } } ] }
Workers
The worker object and the provider, model, and tool variants that configure each worker type.
Worker
objectA reusable worker definition that tells the factory how a workstation should execute work, such as through a model-backed agent or a script.
- additionalProperties
false (closed)
Fields
Explicit agent-loop tool policy for AGENT_WORKER definitions. Omit or set policy DISABLED to run agent loops without advertising or executing tools.
- argsOptionalarray
Additional command arguments passed to the configured command.
Hosted-worker authentication contract. V1 hosted workers accept only auth.secretRef.
- bodyOptionalstring
Inline worker instructions or script body when the worker is authored directly in factory config.
- commandOptionalstring
Command to execute when this worker runs through a command or script provider.
Optional localized customer-facing explanation of this worker.
Execution mechanism. Use `ACP` for ACP-backed workers and put the configured integration identity (for example `cursor-acp`) in modelProvider. `SCRIPT_WRAP` remains the command-wrapper compatibility value; legacy named executor identities remain accepted during migration.
- idOptionalstring
Optional durable public identifier for this worker. When present, graph and layout references should use this id instead of the mutable name.
Provider-specific configuration for the built-in hosted LINEAR worker.
- modelOptionalstring
Model identifier to request from the configured model provider when this worker uses model execution.
Provider locality for this model capability declaration. Use `LOCAL` for embedded or host-managed inference and `CLOUD` for remote provider execution.
- modelProviderOptionaloneOf
Canonical provider identity used for model routing and provider diagnostics, or an exact invocation-parameter placeholder such as `${modelProvider}`. For `executorProvider: ACP`, this names the configured ACP integration, such as `cursor-acp`. Extension identities use lowercase standardized syntax; built-in values such as `CLAUDE` and `CODEX` remain compatibility conveniences.
- nameRequiredstring
Worker name referenced by Workstation.worker.
Provider-agnostic model operations that this worker can execute, including named input and output slots.
Built-in hosted provider identity when this worker uses repository-owned hosted execution.
Resource capacity this worker requires before it can be dispatched.
- skipPermissionsOptionalboolean
When true, bypasses permission checks for providers that support permission gating.
- stopTokenOptionalstring
Marker that tells model-oriented workers where to stop generated output when the provider supports it.
- timeoutOptionalstring
Optional Go duration that caps one worker execution attempt.
Worker implementation family to instantiate for this definition.
AgentWorkerToolPolicy
stringExplicit tool execution policy for AGENT_WORKER agent loops. DISABLED runs the harness in no-tools mode. READ_ONLY exposes bounded filesystem read tools. ENABLED adds bounded filesystem write capability for the first supported tool set.
- enum
"DISABLED" | "READ_ONLY" | "ENABLED"
AgentWorkerToolsConfig
objectExplicit agent-loop tool policy for AGENT_WORKER definitions. Tool execution stays disabled unless this block is present with a non-DISABLED policy.
- additionalProperties
false (closed)
Fields
Required executor policy for agent-loop tool use on this worker.
HostedLinearWorkerClaim
objectOptional claim-related configuration that v1 hosted Linear workers explicitly allow.
- additionalProperties
false (closed)
Fields
- assigneeFieldOptionalstring
Linear issue field name to use when deriving optional assignee claim metadata.
HostedLinearWorkerConfig
objectProvider-specific poller configuration for the built-in hosted Linear worker.
- additionalProperties
false (closed)
Fields
Optional claim-related configuration that v1 hosted Linear polling allows.
Deterministic mapping fields for canonical work submission generation.
- pollIntervalOptionalstring
Optional Go duration that controls how often the hosted Linear worker polls for updates.
- stateIdsOptionalarray
Optional Linear issue-state identifiers that bound the poll source.
- teamIdsOptionalarray
Optional Linear team identifiers that bound the poll source.
HostedLinearWorkerMapping
objectDeterministic issue-to-work mapping fields owned by a hosted Linear worker.
- additionalProperties
false (closed)
Fields
- stateOptionalstring
Canonical submitted work state emitted for matched Linear issues.
- workTypeOptionalstring
Canonical submitted work type emitted for matched Linear issues.
HostedWorkerAuth
objectHosted-worker authentication contract. V1 hosted workers accept only secret references rather than inline credentials or OAuth-style fields.
- additionalProperties
false (closed)
Fields
- secretRefOptionalstring
Referenced secret name that resolves the hosted provider API key at runtime.
HostedWorkerProvider
stringBuilt-in repository-owned hosted worker providers supported by the public factory-config contract.
- enum
"LINEAR"
ModelOperation
objectOne provider-agnostic operation exposed by a model worker, such as `TTS`.
- additionalProperties
false (closed)
Fields
Named operation input slots this worker can consume.
Named operation output slots this worker can produce.
ModelOperationContentType
stringUppercase content-part categories supported by worker model-operation capability slots.
- enum
"TEXT" | "IMAGE" | "AUDIO" | "JSON" | "BINARY"
ModelOperationName
stringUppercase public operation identifier such as `TTS`, `ASR`, or `EMBED`.
- pattern
^[A-Z][A-Z0-9_]*$
ModelOperationSlot
objectOne named capability slot declared by a model operation.
- additionalProperties
false (closed)
Fields
Uppercase content types accepted or produced by this slot.
- minItems
1
- minItems
- nameRequiredstring
Stable slot name used by workstation-side bindings and diagnostics.
- requiredOptionalboolean
Whether this input slot must be resolved before invocation starts. Output slots omit this field when not needed.
ReasoningEffort
stringOptional provider-neutral reasoning effort. Surrounding whitespace and letter case are normalized. Omit the field to preserve the selected provider and model default. Factory definitions may use an exact invocation-parameter placeholder such as `${executorReasoningEffort}`.
- pattern
^(?:[ - - ]*(?:[mM][iI][nN][iI][mM][aA][lL]|[lL][oO][wW]|[mM][eE][dD][iI][uU][mM]|[hH][iI][gG][hH]|[xX][hH][iI][gG][hH]|[mM][aA][xX])?[ - - ]*|\$\{[A-Za-z0-9_.-]+\})$
WorkerModelLocality
stringProvider locality for a model worker capability declaration.
- enum
"LOCAL" | "CLOUD"
WorkerProvider
stringWorker execution mechanism. Canonical values are ACP and SCRIPT_WRAP; extensible lowercase identities remain accepted for compatibility with existing factories.
- pattern
^(?:ACP|SCRIPT_WRAP|\$\{[A-Za-z0-9_.-]+\}|[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*)$ - minLength
1 - maxLength
128
WorkerType
stringWorker implementation families supported by the public factory-config contract.
- enum
"INFERENCE_WORKER" | "AGENT_WORKER" | "SCRIPT_WORKER" | "POLLER_WORKER" | "MODEL_WORKER" | "HOSTED_WORKER"
Workstations
The workstation object and the scheduling, guard, routing, and IO variants that configure each workstation type.
Workstation
objectA processing step in the factory graph. Workstations consume authored work states, run a worker or logical move, and emit the next work states.
- additionalProperties
false (closed)
Fields
Scheduling behavior for this workstation, such as STANDARD, REPEATER, or CRON execution.
- bodyOptionalstring
Inline workstation instructions or script body when authored directly in factory config.
Explicit label-to-destination routing used only by CLASSIFIER_WORKSTATION definitions. Each route must declare a unique non-empty label and one or more outputs.
- copyReferencedScriptsOptionalboolean
Copy supported referenced script files into the expanded workstation layout when config expand runs.
Cron trigger configuration for workstations whose behavior is CRON.
Optional localized customer-facing explanation of this workstation.
Environment variables added to the workstation execution context.
Guarded loop breakers should use `VISIT_COUNT` guards here with a `LOGICAL_MOVE` workstation instead of top-level exhaustion rules.
- idOptionalstring
Optional durable public identifier for this workstation. Graph and layout references should use this id instead of the mutable name.
Work states this workstation can consume before it dispatches.
Retry and execution ceilings applied to this workstation.
- nameRequiredstring
Customer-authored workstation name used by guards, diagnostics, and authored references.
Optional destination emitted when the workstation makes partial progress and should continue iterating. Classifier workstations must not declare onContinue.
Optional destination emitted when the workstation fails permanently.
Optional destination emitted when the worker rejects the current work without a hard failure. Classifier workstations must not declare onRejection.
Uppercase provider-agnostic operation requested by `MODEL_INVOKE` workstations, such as `TTS`.
Optional workstation-authored slot bindings that resolve operation inputs from runtime content or static config content.
Optional worker-output parsing mode for model workstations. When set to `decision-envelope`, agent output is parsed as a reviewer/checker JSON envelope that maps directly onto WorkResult outcome, feedback, output, and optional recorded output work instead of stop-token routing.
- outputSchemaOptionalstring
JSON schema string used to validate or parse structured model output when configured.
Work states emitted after a non-classifier workstation succeeds. Classifier workstations must use classificationRoutes instead of normal success outputs.
- promptFileOptionalstring
Path to a prompt template file loaded for model-oriented workstation execution.
Resource capacity this workstation consumes while one dispatch is in flight.
Optional workstation-specific runner override. When omitted, dispatch falls back to the factory runner, then worker modelProvider compatibility when no explicit runner is configured, then the default codex runner.
- stopWordsOptionalarray
Stop words authored on the topology entry for model-oriented dispatches.
Runtime workstation implementation type, equivalent to the workstation AGENTS.md frontmatter type.
Optional policy for whether downstream work uses the workstation output payload or preserves the consumed input payload.
- workerRequiredstring
Name of a worker declared in the workers list.
- workingDirectoryOptionalstring
Go template resolved from token tags at dispatch time.
- worktreeOptionalstring
Go template resolved and passed as the worktree path to CLI dispatchers.
ClassificationRoute
object- additionalProperties
false (closed)
Fields
- labelRequiredstring
Case-sensitive classifier label that must match the trimmed classifier output exactly.
One or more authored destinations emitted when this classifier label is selected.
WorkPropagation
objectOptional workstation policy for how downstream work receives payload content after this workstation completes. When omitted, downstream work uses the workstation output payload.
- additionalProperties
false (closed)
Fields
Propagation mode for downstream work payload selection after this workstation succeeds.
WorkPropagationMode
stringWork payload propagation mode for a workstation. OUTPUT_AS_PAYLOAD uses the workstation output as the downstream work payload. PRESERVE_INPUT keeps the consumed input payload for downstream work instead of replacing it with the workstation output.
- enum
"OUTPUT_AS_PAYLOAD" | "PRESERVE_INPUT"
WorkstationCron
objectTrigger timing for scheduled workstations. Provide exactly one of a five-field cron schedule or a positive duration in every; Factory validation enforces the exclusive choice.
- additionalProperties
false (closed)
Fields
- everyOptionalstring
Positive Go duration interval, such as 30s, 5m, 1h, or 1h30m, used instead of schedule.
- expiryWindowOptionalstring
Positive Go duration after due_at before a stale cron time token expires and can be consumed by the system expiry transition. Defaults to the duration until the next scheduled cron fire when omitted.
- jitterOptionalstring
Non-negative Go duration used as the maximum deterministic delay added to scheduled time tokens. Defaults to "0s".
- scheduleOptionalstring
Standard five-field cron expression used to produce internal time work while the factory service is running.
- triggerAtStartOptionalboolean
When true, service startup submits one immediate internal time work item before waiting for the next scheduled cron fire.
Defaultfalse
WorkstationGuard
objectGuard attached to a workstation as a whole.
- additionalProperties
false (closed)
Fields
For `MATCHES_FIELDS` guards, the field-selector configuration used to compare candidate inputs.
- matchInputOptionalstring
For `SAME_NAME` and `SAME_TRACE_ID` input guards, the peer input workType name from another input in the same workstation.
- maxVisitsOptionalinteger
For `VISIT_COUNT` guards, the fixed visit ceiling.
- minimum
1
- minimum
- maxVisitsArgumentOptionalstring
Optional invocation argument whose positive integer value tightens the fixed visit ceiling.
- parentInputOptionalstring
For parent-aware input guards, the parent workType name from another input in the same workstation.
- spawnedByOptionalstring
For dynamic fanout input guards, the workstation that spawns the children for count tracking.
Guard condition to evaluate for this workstation-level attachment.
- workstationOptionalstring
For `VISIT_COUNT` guards, the workstation whose visits are counted.
WorkstationGuardType
stringGuard condition attached to a workstation as a whole.
- enum
"VISIT_COUNT" | "MATCHES_FIELDS"
WorkstationIO
objectOne authored work-state reference consumed or emitted by a workstation.
- additionalProperties
false (closed)
Fields
Per-input guards that must pass before this specific input can be used.
- stateRequiredstring
Name of the work state consumed or emitted for the referenced work type.
- workTypeRequiredstring
Name of the work type consumed or emitted at this edge of the workstation.
WorkstationKind
stringScheduling kind for a workstation, which determines how the engine schedules and dispatches work to it. Standard workstations are scheduled as soon as their inputs are ready, and can have multiple work items in-flight at the same time. Repeater workstations are triggered whenever their inputs change, and will reloop the outputs on rejection back to the initial place. Cron workstations create internal time work and dispatch their configured worker when time and input guards are satisfied. Poller workstations bind a poller-capable worker that the service runtime supervises as a long-lived ingress loop.
"STANDARD"- enum
"STANDARD" | "REPEATER" | "CRON" | "POLLER"
WorkstationLimits
objectRetry and execution ceilings applied to one workstation definition.
- additionalProperties
false (closed)
Fields
- maxExecutionTimeOptionalstring
Go duration limit for one dispatch attempt before it times out.
- maxGeneratedWorkItemsOptionalinteger
Fixed maximum number of Work items one accepted worker-emitted FACTORY_REQUEST_BATCH may contain.
- minimum
1
- minimum
- maxGeneratedWorkItemsArgumentOptionalstring
Optional invocation argument whose positive integer value tightens the fixed generated-Work ceiling.
- maxGeneratedWorkItemsArgumentOffsetOptionalinteger
Offset added to the invocation argument before applying the generated-Work ceiling.
- minimum
0
- minimum
- maxRetriesOptionalinteger
Maximum number of retry attempts after a failed dispatch before the workstation gives up.
WorkstationOperationBinding
objectOne workstation-authored binding for a provider-agnostic model-operation input slot.
- additionalProperties
false (closed)
Fields
Static authored content bound directly or used as the first fallback when runtime input does not match.
Optional final fallback content when neither runtime input nor config content resolves the slot.
Ordered runtime-input selector used before falling back to config or default content.
- slotRequiredstring
Stable input slot name declared by the worker operation.
WorkstationOperationBindingSelector
objectSelector fields used to resolve one content part from ordered runtime input.
- additionalProperties
false (closed)
Fields
- labelOptionalstring
Match a content part by its label field.
- roleOptionalstring
Match a content part by its role field.
- slotOptionalstring
Match a content part by its authored slot field.
Match a content part by its uppercase public type.
WorkstationOutcomeFormat
stringOptional worker-output parsing mode for model workstations. When set to `decision-envelope`, agent output is parsed as a reviewer/checker JSON envelope that maps directly onto WorkResult outcome, feedback, output, and optional recorded output work instead of stop-token routing.
- enum
"decision-envelope"
WorkstationType
stringRuntime workstation implementation types supported by the public factory-config contract.
- enum
"INFERENCE_RUN" | "AGENT_RUN" | "SCRIPT_RUN" | "POLLER_RUN" | "MODEL_WORKSTATION" | "MODEL_INVOKE" | "LOGICAL_MOVE" | "CLASSIFIER_WORKSTATION"
Work types and messages
Work type declarations, their state machines, and the content parts a work message carries between workstations.
WorkType
objectA named category of work that can move through the factory. Each work type declares the lifecycle states its work items can occupy.
- additionalProperties
false (closed)
Fields
Optional localized customer-facing explanation of this work type.
Optional CLI routing markers for this work type. Factories used with you run --factory must declare handlingBehavior DEFAULT on exactly one work type.
- idOptionalstring
Optional durable public identifier for this work type. When present, graph and layout references should use this id instead of the mutable name.
- nameRequiredstring
Customer-authored work type name referenced by workstation inputs, outputs, and submitted work.
Lifecycle states available for work items of this type.
WorkAudioContentPart
objectOrdered audio content for one work item.
allOf
Fields
- enum
"AUDIO"
- enum
WorkBinaryContentPart
objectOrdered binary content for one work item.
allOf
Fields
- enum
"BINARY"
- enum
WorkContent
arrayOrdered canonical content parts for one work item.
WorkContentCommonFields
objectFields
- artifactIdOptionalstring
Optional artifact identifier for externally materialized content.
- contentTypeOptionalstring
Optional MIME content type for file-backed or structured parts.
- labelOptionalstring
Optional caller-defined label for slot binding or diagnostics.
- roleOptionalstring
Optional semantic role for model-operation authoring.
- slotOptionalstring
Optional slot name used by model-operation binding selectors and diagnostics.
WorkContentDeprecatedFileProperty
stringDeprecated host-local file path. Use url instead. Legacy values may be normalized to url at ingest during migration.
WorkContentMetadata
objectOptional metadata attached to one work content part.
- additionalProperties
true (open)
WorkContentPart
One ordered canonical content part on a work item.
oneOf
WorkContentPartType
stringSupported canonical work content part types. Legacy lowercase text and image values remain accepted for backward compatibility.
- enum
"text" | "image" | "TEXT" | "IMAGE" | "AUDIO" | "JSON" | "BINARY"
WorkContentURLProperty
stringCanonical content reference for file-backed parts. Supported schemes are file://, http://, https://, data:, and you-artifact:// for session-scoped factory artifact refs.
- minLength
1
WorkImageContentPart
objectOrdered image content for one work item.
allOf
Fields
- enum
"image" | "IMAGE"
- enum
WorkJsonContentPart
objectOrdered JSON content for one work item.
allOf
Fields
- jsonRequired
Arbitrary JSON value preserved in canonical part order.
- enum
"JSON"
- enum
WorkState
objectA lifecycle state that a work item can occupy inside one work type.
- additionalProperties
false (closed)
Fields
- idOptionalstring
Optional durable public identifier for this state within its work type. When present, graph and layout references should use this id instead of the mutable name.
- nameRequiredstring
Customer-authored state name referenced by workstation inputs and outputs.
Lifecycle category for this state, such as initial, processing, terminal, or failed.
WorkStateType
stringCategories of work states. The factory runtime treats these categories differently for lifecycle tracking and metrics purposes. Initial: The work is waiting to be picked up by a workstation. Processing: The work has been partially processed, and is continuing through its lifecycle. Terminal: The work has completed successfully. Failed: The work has failed.
- enum
"INITIAL" | "PROCESSING" | "TERMINAL" | "FAILED"
WorkTextContentPart
objectOrdered inline text content for one work item.
allOf
Fields
- textRequiredstring
Inline text content preserved in canonical part order.
- enum
"text" | "TEXT"
- enum
WorkTypeHandlingBehavior
stringDeclares how the CLI should route simplified one-shot prompt submissions for this work type. DEFAULT marks the single work type that receives positional prompts from you run --factory.
- enum
"DEFAULT"
Orchestrator
How a factory advances work — the Petri-net default and the JavaScript orchestrator variants.
FactoryOrchestrator
objectAuthored orchestrator identity for one factory. When omitted, existing Petri factories load through compatibility defaulting to orchestrator.kind = PETRI.
- additionalProperties
false (closed)
Fields
JavaScript-specific orchestrator configuration. Required when kind = JAVASCRIPT.
Petri-specific orchestrator configuration. Required only when kind = PETRI and additional Petri options are authored.
FactoryOrchestratorJavaScriptAgent
objectDefault worker selection for one named JavaScript child-agent role.
- additionalProperties
false (closed)
Fields
- presetRequiredstring
Operator worker preset inherited by child calls using this agent id.
- minLength
1
- minLength
FactoryOrchestratorJavaScriptConfig
objectJavaScript-specific orchestrator configuration. JavaScript factories do not require Petri graph fields and instead declare workflow source identity, metadata, args schema, and default policy here.
- additionalProperties
false (closed)
Fields
- agentsOptionalobject
Named child-agent roles and their operator worker preset defaults.
- additionalProperties
/$defs/FactoryOrchestratorJavaScriptAgent
- additionalProperties
- argsSchemaOptionalobject
JSON Schema object describing workflow invocation arguments.
- additionalProperties
true (open)
- additionalProperties
- defaultPolicyOptionalobject
Default JavaScript workflow policy object applied when no runtime override exists.
- additionalProperties
true (open)
- additionalProperties
- dialectOptionalstring
Optional JavaScript dialect label for the authored workflow source.
- entrypointOptionalstring
Optional exported entrypoint or phase name used to start the workflow.
Inline workflow source when the factory carries source text directly.
Free-form JavaScript orchestrator metadata for authoring and diagnostics.
- sourceHashOptionalstring
Optional content hash for the resolved workflow source.
- sourceRefOptionalstring
Factory-relative or authored reference to the workflow source file.
FactoryOrchestratorJavaScriptInlineSource
objectInline JavaScript workflow source carried directly in the factory definition.
- additionalProperties
false (closed)
Fields
- encodingRequiredstring
Declared content encoding for the inline workflow source.
- enum
"utf-8"
- enum
- inlineRequiredstring
Inline JavaScript workflow source text.
FactoryOrchestratorKind
stringAuthored orchestration engine for one factory. PETRI factories use the existing Petri graph semantics. JAVASCRIPT factories use workflow source identity and policy instead of Petri graph fields.
- enum
"PETRI" | "JAVASCRIPT"
FactoryOrchestratorPetriConfig
objectPetri-specific orchestrator configuration. Existing Petri factories may omit this block and rely on compatibility defaulting to orchestrator.kind = PETRI.
- additionalProperties
false (closed)
Invocation
The signature a factory is called with, its parameter bindings, and the contract its return value satisfies.
FactoryInvocationSignature
objectCanonical callable argument contract for invoking one factory. When present, CLI, API, dashboard, docs, and packaged-factory surfaces should discover and normalize invocation inputs from this shared schema instead of transport- or factory-specific argument definitions.
- additionalProperties
false (closed)
Fields
Optional customer-facing hint for the factory's primary output shape.
Declared invocation parameters keyed by canonical parameter name.
Policy for named inputs that do not match any declared parameter binding.
FactoryInvocationArguments
objectStructured Factory invocation arguments keyed by parameter name, external name, or alias. Each value is either one string or an ordered array of strings.
- additionalProperties
true (open)
FactoryInvocationExample
objectOne example invocation for docs, help, and packaged-factory inspection.
- additionalProperties
false (closed)
Fields
Structured invocation arguments; values are never parsed or executed while loading the Factory.
Localized customer-facing explanation of what the example does.
- nameRequiredstring
Stable example name.
- minLength
1
- minLength
FactoryInvocationOutputContract
objectCustomer-facing output hint for a factory invocation signature.
- additionalProperties
false (closed)
Fields
- contentTypeOptionalstring
Output media type hint for docs, API consumers, and dashboard affordances.
- descriptionOptionalstring
Human-readable summary of the primary output contract.
- fileExtensionOptionalstring
Suggested file extension when the output mode writes a file.
High-level output contract mode exposed to callers.
- pathParameterOptionalstring
Parameter name that controls the destination path when the factory writes output to disk.
FactoryInvocationOutputContractMode
stringHigh-level output shape hint exposed by a factory invocation signature.
- enum
"INLINE" | "FILE" | "JSON"
FactoryInvocationParameter
objectOne canonical invocation parameter declared on a factory.
- additionalProperties
false (closed)
Fields
- aliasesOptionalarray
Additional accepted named-argument keys that normalize to this parameter.
Accepted invocation bindings for this parameter across positional, named, and stdin sources.
- choicesOptionalarray
Optional allowed string values for this parameter.
- defaultValueOptionalstring
Default string value used when an omitted parameter resolves to one effective value.
- defaultValuesOptionalarray
Default string values used when an omitted parameter resolves to multiple effective values.
- descriptionOptionalstring
Customer-facing description rendered in help, docs, and form controls.
- externalNameOptionalstring
Preferred named-argument key shown to callers, such as `output`.
- nameRequiredstring
Internal canonical parameter name used for normalized argument maps and interpolation.
- requiredOptionalboolean
When true, invocation normalization must reject requests that omit this parameter.
- sensitiveOptionalboolean
When true, diagnostics must preserve names and source metadata but redact concrete values.
String-first hint that guides parsing, docs, and dashboard form selection.
Declares whether the parameter consumes one value, repeated values, variadic values, or file contents.
FactoryInvocationParameterBinding
objectOne public binding that exposes a parameter to callers.
- additionalProperties
false (closed)
Fields
Binding kind used to route invocation input into the parameter.
- positionOptionalinteger
1-based positional slot used when kind is POSITIONAL.
- minimum
1
- minimum
FactoryInvocationParameterBindingKind
stringPublic invocation binding kinds supported by factory signatures.
- enum
"POSITIONAL" | "NAMED" | "STDIN" | "NAMED_REST"
FactoryInvocationParameterTypeHint
stringString-first parsing and UI hint for one factory invocation parameter.
- enum
"STRING" | "PATH" | "FILE_PATH" | "DIRECTORY_PATH" | "NUMBER_STRING" | "BOOLEAN_STRING"
FactoryInvocationParameterValueMode
stringDeclares how one invocation parameter consumes one or more string values.
- enum
"EXACT" | "REPEATED" | "VARIADIC" | "FILE_CONTENTS"
FactoryInvocationUnknownNamedArgumentPolicy
stringPolicy for named inputs that do not match any declared parameter binding.
- enum
"REJECT" | "ALLOW" | "COLLECT"
InvocationReturn
objectFactory-authored policy for selecting the primary result returned by CLI and API invocations. When omitted from a Factory, runtimes use the documented SUBMITTED_WORK_TERMINAL fallback.
- additionalProperties
false (closed)
Fields
Return selection policy for this factory.
- terminalStateOptionalstring
Authored terminal state name used by EXPLICIT policy selection.
- workNameOptionalstring
Optional authored work name filter used by EXPLICIT policy selection.
- workTypeNameOptionalstring
Work type name used by EXPLICIT policy selection.
InvocationReturnPolicy
stringPrimary-result selection policy for factory invocation responses. SUBMITTED_WORK_TERMINAL traces the work submitted by the invocation until it reaches its first terminal output. EXPLICIT selects configured work content from the invocation submit scope.
- enum
"SUBMITTED_WORK_TERMINAL" | "EXPLICIT"
Guards and inputs
Input type declarations and the guards that admit, reject, or route work into the factory.
FactoryGuard
objectFactory-level guard attached at the root factory definition.
- additionalProperties
false (closed)
Fields
- modelOptionalstring
Optional model name to scope throttling more narrowly than the provider-level window.
Provider whose inference-throttle history controls this factory-level guard.
- refreshWindowRequiredstring
Duration string that controls how long the factory should keep re-checking throttle history before allowing the lane again.
Factory-level guard condition to evaluate before dispatch-ready transitions can proceed.
FactoryGuardType
stringFactory-level guard condition attached at the root factory definition.
- enum
"INFERENCE_THROTTLE_GUARD"
GuardMatchConfig
object- additionalProperties
false (closed)
Fields
- inputKeyRequiredstring
Field selector resolved against each candidate input, such as `.Name` or `.Tags["_last_output"]`.
- minLength
1
- minLength
InputGuard
objectGuard attached to one specific workstation input.
- additionalProperties
false (closed)
Fields
For `MATCHES_FIELDS` guards, the field-selector configuration used to compare candidate inputs.
- matchInputOptionalstring
For `SAME_NAME` and `SAME_TRACE_ID` input guards, the peer input workType name from another input in the same workstation.
- maxVisitsOptionalinteger
For `VISIT_COUNT` guards, the visit threshold.
- minimum
1
- minimum
- parentInputOptionalstring
For parent-aware input guards, the parent workType name from another input in the same workstation.
- spawnedByOptionalstring
For dynamic fanout input guards, the workstation that spawns the children for count tracking.
Guard condition to evaluate for this input-level attachment.
- workstationOptionalstring
For `VISIT_COUNT` guards, the workstation whose visits are counted.
InputGuardType
stringGuard condition attached to one specific workstation input.
- enum
"VISIT_COUNT" | "ALL_CHILDREN_COMPLETE" | "ANY_CHILD_FAILED" | "SAME_NAME" | "SAME_TRACE_ID"
InputKind
stringKinds of input. `DEFAULT` passes opaque input through to workstations as-is.
- enum
"DEFAULT"
InputType
objectDeclared types of inputs. Used to force the inputs of a certain work type to be of a certain shape, like a specific JSON structure.
- additionalProperties
false (closed)
Fields
- nameRequiredstring
Input type name. The reserved name "default" is implicit.
Resources
Declared capacity, resource requirements, and the bundled files a factory ships with.
Resource
objectShared capacity that limits how much work the factory can run at once, such as worker slots or external service quotas.
- additionalProperties
false (closed)
Fields
- backendOptionalstring
Managed runtime backend identifier for `MODEL` resources, such as `LLAMACPP`. Backend selection stays provider-agnostic in customer-facing factory config.
- capacityRequiredinteger
Total units of this resource available to the factory at one time.
- minimum
1
- minimum
- idOptionalstring
Optional durable public identifier for this resource. When present, graph and layout references should use this id instead of the mutable name.
- loadPolicyOptionalstring
Managed runtime load policy for `MODEL` resources, such as `ON_DEMAND` or `EAGER`.
- modelOptionalstring
Stable managed runtime identity for `MODEL` resources, such as `OMNIVOICE_Q4_K_M`. Packaged and authored factories declare the same managed-runtime dependency through this field plus matching `MODEL_WORKER.model` values.
- nameRequiredstring
Resource name referenced from worker requirements and workstation resourceUsage entries.
- providerOptionalstring
Provider identity associated with this resource, especially for `PROVIDER_QUOTA` resources.
Optional uppercase resource family, such as `MODEL`, `PROVIDER_QUOTA`, or `INVOCATION_SLOT`.
BundledFile
objectOne explicit portable bundled file entry carried by the factory portability manifest. SCRIPT files target factory/scripts/..., DOC files target factory/docs/..., INPUT files target factory/inputs/<work-type>/<channel>/..., and ROOT_HELPER files target supported project-root helper paths such as Makefile only when declared explicitly in bundledFiles. Export and flatten do not auto-discover project-root helpers. In v1 shared-factory exports, INPUT entries encode a share-time snapshot of starter work that is copied into the recipient factory as detached seeded work.
- additionalProperties
false (closed)
Fields
- idOptionalstring
Durable bundled-file identifier used by portable layout and graph editor references. When omitted on input, the canonical targetPath is materialized as the stable identifier.
- targetPathRequiredstring
Canonical factory-relative restoration target for the bundled file. Absolute paths, backslash-separated paths, and paths that require dot-segment normalization are rejected.
- typeRequiredstring
Portable file class. SCRIPT entries target factory/scripts/..., DOC entries target factory/docs/..., INPUT entries target factory/inputs/<work-type>/<channel>/..., and ROOT_HELPER entries target supported project-root helper files such as Makefile only when explicitly declared in bundledFiles. Shared-factory INPUT entries snapshot current source inputs at share time instead of creating a live link.
- enum
"SCRIPT" | "DOC" | "INPUT" | "ROOT_HELPER"
- enum
BundledFileContent
objectInline content payload for a portable bundled file.
- additionalProperties
false (closed)
Fields
- encodingRequiredstring
Declared content encoding for the inline payload. V1 bundled files use UTF-8 text content.
- enum
"utf-8"
- enum
- inlineRequiredstring
Inline bundled file content carried in the manifest. SCRIPT and DOC files under factory/scripts/ and factory/docs/ may be discovered during flatten, but supported root helper paths such as Makefile are bundled only when they appear as explicit ROOT_HELPER entries in bundledFiles.
RequiredTool
objectOne declarative external tool dependency for a portable factory.
- additionalProperties
false (closed)
Fields
- commandRequiredstring
Executable lookup token that must resolve on PATH.
- nameRequiredstring
Human-readable tool name used in manifests and validation output.
- purposeOptionalstring
Optional explanation of why the portable factory requires this tool.
- versionArgsOptionalarray
Optional argument vector used by future validation flows to probe the tool version without changing the executable lookup token.
ResourceManifest
objectCanonical portability manifest for Agent Factory bundles. Required tools are validation-only PATH dependencies; bundled files carry portable content for restoration inside the factory boundary.
- additionalProperties
false (closed)
Fields
Portable bundled files that belong inside the factory boundary. Entries are explicit only, use factory-relative target paths, and must stay under the canonical script, docs, or inputs roots for SCRIPT, DOC, or INPUT entries, or match the supported root-helper allowlist for ROOT_HELPER entries. Export, share, flatten, and materialize flows auto-discover SCRIPT and DOC files under the documented factory subtrees, but ROOT_HELPER entries such as Makefile are opt-in manifest entries that travel only when explicitly declared here. In v1 shared-factory flows, INPUT entries capture the source factory's current starter work at share time and are restored as independent recipient copies.
Declarative external tools that must already resolve on PATH. These entries are validated but not embedded or installed.
ResourceRequirement
object- additionalProperties
false (closed)
Fields
- capacityRequiredinteger
- minimum
1
- minimum
- nameRequiredstring
ResourceType
stringUppercase resource families supported by the public factory-config contract.
- enum
"MODEL" | "PROVIDER_QUOTA" | "INVOCATION_SLOT"
Layout
Optional editor layout hints — node positions, groups, edges, and annotations. Not required to run a factory.
FactoryLayout
objectNon-executable portable graph editor layout metadata keyed by canonical graph ids.
- additionalProperties
false (closed)
Fields
Optional inert positioned notes and embedded-raster images that decorate the canvas without becoming graph topology.
Optional authored graph edge geometry keyed by canonical graph edge id.
Optional flat background groups keyed independently from topology.
Optional authored graph node geometry keyed by canonical graph node id.
- schemaVersionRequiredintegerformat: int32
Portable layout contract schema version. Version 1 is the initial public layout contract.
- minimum
1
- minimum
FactoryLayoutAnnotation
objectInert positioned canvas annotation. Its kind selects either note or image content; annotations never identify graph nodes or edges, and connection-like fields are invalid.
- additionalProperties
false (closed)
Fields
- idRequiredstring
Stable annotation identifier unique within this layout.
- pattern
\S - minLength
1
- pattern
FactoryLayoutAnnotationKind
stringThe inert annotation content variant.
- enum
"NOTE" | "IMAGE"
FactoryLayoutAnnotationPosition
objectExplicit finite annotation position in canvas units. Each coordinate is bounded to keep portable layout metadata safe to render.
- additionalProperties
false (closed)
Fields
- xRequirednumber
Horizontal canvas coordinate between -100,000 and 100,000 inclusive.
- minimum
-100000 - maximum
100000
- minimum
- yRequirednumber
Vertical canvas coordinate between -100,000 and 100,000 inclusive.
- minimum
-100000 - maximum
100000
- minimum
FactoryLayoutAnnotationSize
objectOptional finite annotation dimensions in canvas units. Image annotations require this size; note annotations may omit it.
- additionalProperties
false (closed)
Fields
- heightRequirednumber
Positive authored height no greater than 10,000 canvas units.
- maximum
10000 - exclusiveMinimum
0
- maximum
- widthRequirednumber
Positive authored width no greater than 10,000 canvas units.
- maximum
10000 - exclusiveMinimum
0
- maximum
FactoryLayoutBounds
objectAuthored rectangular bounds in graph canvas units.
- additionalProperties
false (closed)
Fields
- heightRequirednumber
Authored group height.
- widthRequirednumber
Authored group width.
- xRequirednumber
Left graph layout coordinate.
- yRequirednumber
Top graph layout coordinate.
FactoryLayoutEdge
objectPortable graph edge layout keyed by canonical graph edge id.
- additionalProperties
false (closed)
Fields
- idRequiredstring
Canonical graph edge id such as workstation-output:workstation:review->work-state:task:done.
Optional authored intermediate edge points in graph canvas space.
FactoryLayoutEmptyState
objectInert presentation content for one canonical topology node when it has no live activity. It is definition metadata only and does not create events or runtime behavior.
- additionalProperties
false (closed)
Fields
- textOptionalstring
Literal empty-state text. It is not rendered as HTML or Markdown.
- pattern
\S - minLength
1 - maxLength
500
- pattern
FactoryLayoutGroup
objectPortable background grouping metadata for graph canvas presentation.
- additionalProperties
false (closed)
Fields
- colorOptionalstring
Optional authored group accent or fill color.
- idRequiredstring
Stable authored group id for future layout editing.
- labelOptionalstring
Optional visible group label.
- lockedOptionalboolean
Optional authored group lock flag for future editor affordances.
- nodeIdsRequiredarray
Canonical graph node ids visually contained by this group.
- parentGroupIdOptionalstring | nullnullable
Reserved for future nested groups. Omit or set null for flat groups.
FactoryLayoutImage
objectInert embedded-raster image content with required alternative text.
- additionalProperties
false (closed)
Fields
- alternativeTextRequiredstring
Literal alternative text for the embedded image.
- pattern
\S - minLength
1 - maxLength
500
- pattern
FactoryLayoutImageSource
objectExtensible discriminated image-source shape. Version 1 supports only embedded raster data.
- additionalProperties
false (closed)
Fields
- dataRequiredstringformat: byte
Strict padded base64 payload for the embedded raster source, limited to 2 MiB after decoding.
- minLength
4 - maxLength
2796204
- minLength
- kindRequiredstring
Source variant discriminator. EMBEDDED carries portable base64 raster data.
- enum
"EMBEDDED"
- enum
- mediaTypeRequiredstring
Declared media type for the embedded raster.
- enum
"image/png" | "image/jpeg" | "image/webp"
- enum
FactoryLayoutNode
objectPortable graph node layout keyed by canonical graph node id.
- additionalProperties
false (closed)
Fields
- idRequiredstring
Canonical graph node id such as workstation:<workstationId>.
- pattern
\S - minLength
1
- pattern
- lockedOptionalboolean
Optional authored node lock flag for future editor affordances.
FactoryLayoutNote
objectLiteral plain-text note content. Line breaks are preserved as authored text and are not interpreted as Markdown or HTML.
- additionalProperties
false (closed)
Fields
- bodyRequiredstring
Required literal plain-text note body.
- pattern
\S - minLength
1 - maxLength
4000
- pattern
- titleOptionalstring
Optional literal plain-text note title.
- maxLength
160
- maxLength
FactoryLayoutNoteTone
stringPresentation-only tone for a note annotation.
- enum
"NEUTRAL" | "ACCENT" | "INFO" | "SUCCESS" | "WARNING" | "DANGER"
FactoryLayoutPoint
objectTwo-dimensional authored graph layout coordinate.
- additionalProperties
false (closed)
Fields
- xRequirednumber
Horizontal graph layout coordinate in authored canvas space.
- yRequirednumber
Vertical graph layout coordinate in authored canvas space.
FactoryLayoutPreferences
objectPortable graph display defaults that do not alter factory topology.
- additionalProperties
false (closed)
Fields
- directionOptionalstring
Preferred authored graph direction for portable layout rendering.
- enum
"UP" | "DOWN" | "LEFT" | "RIGHT"
- enum
FactoryLayoutSize
objectAuthored node size in graph canvas units.
- additionalProperties
false (closed)
Fields
- heightRequirednumber
Authored node height.
- widthRequirednumber
Authored node width.
FactoryLayoutViewport
objectShared authored graph camera position.
- additionalProperties
false (closed)
Fields
- xRequirednumber
Authored viewport horizontal offset.
- yRequirednumber
Authored viewport vertical offset.
- zoomRequirednumber
Authored viewport zoom factor.