Packaged Factory Reference

Look up the ordered packaged factory definitions shipped with @you-agent-factory/packaged-factories—canonical names, descriptions, published metadata, and unabridged sources.

Packaged factory index

Each packaged factory appears in allowlist order (goal, subagent, fusion, review, quorum, tts, deep-research). Each entry shows its canonical name, packaged description when present, published and schema metadata, a stable child link, and the complete unabridged definition source.
  1. goal

    Persists goal progress and repeatedly works the goal until the executor classifies it complete or blocked.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/goal/factory.json

    Open goal reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Persists goal progress and repeatedly works the goal until the executor classifies it complete or blocked."
      },
      "examples": [
        {
          "args": {
            "input": "Implement and verify the requested change"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Pursue a bounded implementation goal."
          },
          "name": "complete-goal"
        }
      ],
      "id": "builtin-goal",
      "invocationReturn": {
        "policy": "EXPLICIT",
        "terminalState": "complete",
        "workTypeName": "goal"
      },
      "invocationSignature": {
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Goal to pursue until completion.",
            "externalName": "to",
            "name": "input",
            "required": true
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model provider for the goal executor; omitted values use operator defaults.",
            "externalName": "executor-provider",
            "name": "executorProvider"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model for the goal executor; omitted values use operator defaults.",
            "externalName": "executor-model",
            "name": "executorModel"
          }
        ]
      },
      "name": "goal",
      "workTypes": [
        {
          "handlingBehavior": [
            "DEFAULT"
          ],
          "name": "goal",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "execute",
              "type": "PROCESSING"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "blocked",
              "type": "PROCESSING"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        }
      ],
      "workers": [
        {
          "model": "${executorModel}",
          "modelProvider": "${executorProvider}",
          "name": "goal-executor",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        }
      ],
      "workstations": [
        {
          "behavior": "REPEATER",
          "body": "You are executing persistent goal work {{ (index .Inputs 0).WorkID }} in a bounded repeated\nworkflow. Assume you begin with zero conversational context. Read the complete\ngoal, any prior attempt output shown below, repository contributor instructions,\nrelevant architecture and source, tests, and current working-tree state before\nacting. Preserve unrelated user changes and verify assumptions against evidence.\n\nCustomer goal:\n{{ if (index .Inputs 0).Payload -}}\n{{ (index .Inputs 0).Payload }}\n{{ else -}}\n{{ range (index .Inputs 0).Content }}{{ .Text }}{{ end }}\n{{ end -}}\n\nPersistent goal state file, relative to the current worker workspace:\n.you-goals/{{ .Context.SessionID }}/{{ (index .Inputs 0).WorkID }}.json\n\nThe state file is the durable progress record for this goal. Before substantive\nwork, create it when missing or load it when present. Its JSON shape is:\n\n```json\n{\n  \"version\": 1,\n  \"goalId\": \"the Work ID above\",\n  \"objective\": \"the unchanged customer goal\",\n  \"status\": \"active | completed | blocked\",\n  \"iteration\": 1,\n  \"lastResult\": \"concise progress from the latest pass\",\n  \"updatedAt\": \"RFC3339 timestamp\"\n}\n```\n\nPersist every update atomically: write valid JSON to a sibling temporary file,\nclose it, and replace the state file. Never leave partially written JSON. The\niteration increases once per execution pass. Do not replace the original\nobjective with a narrower task.\n\n{{ if gt (index .Inputs 0).History.AttemptNumber 1 -}}\nPrevious attempt output:\n{{ (index .Inputs 0).PreviousOutput }}\n{{ end -}}\n\nWork the submitted goal as far as this pass safely allows. On later attempts,\ncontinue from observable workspace state and prior output; do not redo completed\nwork blindly. Implement coherent progress, exercise relevant success and failure\ncases, and report exact verification. Do not respond with open-ended discussion\nor defer an action you can complete in this pass.\n\nUse the state file's unchanged `objective` as authoritative on later passes,\neven if the repeated Work payload contains only the previous pass's output.\nBefore returning, persist exactly one of these states:\n\n- `active` when useful work remains and another pass can make progress.\n- `completed` only when the full objective is achieved and verified.\n- `blocked` only when another pass cannot make meaningful progress without\n  user input or an external state change.\n\nUser or Factory Session termination is an external control. Never infer or emit\ntermination from this classifier contract.\n\nAfter the atomic state-file update, return only one JSON decision envelope:\n\n- Completed: `{\"decision\":\"accepted\",\"output\":\"concise verified final result\"}`\n- Continue: `{\"decision\":\"needs_changes\",\"feedback\":\"specific next work\",\"output\":\"concise progress from this pass\"}`\n- Blocked: `{\"decision\":\"blocked\",\"feedback\":\"specific blocker\",\"output\":\"concise progress and blocker\"}`\n\nDo not wrap the envelope in Markdown and do not emit any other decision label.\n",
          "classificationRoutes": [
            {
              "label": "accepted",
              "outputs": [
                {
                  "state": "complete",
                  "workType": "goal"
                }
              ]
            },
            {
              "label": "needs_changes",
              "outputs": [
                {
                  "state": "init",
                  "workType": "goal"
                }
              ]
            },
            {
              "label": "blocked",
              "outputs": [
                {
                  "state": "blocked",
                  "workType": "goal"
                }
              ]
            }
          ],
          "inputs": [
            {
              "state": "init",
              "workType": "goal"
            }
          ],
          "name": "execute-goal",
          "onFailure": [
            {
              "state": "failed",
              "workType": "goal"
            }
          ],
          "outcomeFormat": "decision-envelope",
          "promptFile": "prompts/executor.md",
          "type": "AGENT_RUN",
          "workPropagation": {
            "mode": "PRESERVE_INPUT"
          },
          "worker": "goal-executor"
        },
        {
          "guards": [
            {
              "maxVisits": 12,
              "type": "VISIT_COUNT",
              "workstation": "execute-goal"
            }
          ],
          "inputs": [
            {
              "state": "init",
              "workType": "goal"
            }
          ],
          "name": "goal-loop-breaker",
          "outputs": [
            {
              "state": "failed",
              "workType": "goal"
            }
          ],
          "type": "LOGICAL_MOVE",
          "worker": ""
        }
      ]
    }
    
  2. subagent

    Runs one bounded read-only subagent and returns its result.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/subagent/factory.json

    Open subagent reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Runs one bounded read-only subagent and returns its result."
      },
      "examples": [
        {
          "args": {
            "input": "Summarize this release"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Summarize a release request."
          },
          "name": "positional-input"
        },
        {
          "args": {
            "input": "Summarize this release"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Summarize the same request using structured input."
          },
          "name": "stdin-input"
        }
      ],
      "id": "builtin-subagent",
      "invocationSignature": {
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Text request for the one-pass subagent.",
            "externalName": "to",
            "name": "input",
            "required": true
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model provider for the subagent; omitted values use operator defaults.",
            "externalName": "worker-provider",
            "name": "workerProvider"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model for the subagent; omitted values use operator defaults.",
            "externalName": "worker-model",
            "name": "workerModel"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Optional reasoning effort for the subagent; omitted values use the provider default.",
            "externalName": "worker-reasoning-effort",
            "name": "workerReasoningEffort"
          }
        ]
      },
      "name": "subagent",
      "workTypes": [
        {
          "handlingBehavior": [
            "DEFAULT"
          ],
          "name": "task",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        }
      ],
      "workers": [
        {
          "agentTools": {
            "policy": "READ_ONLY"
          },
          "model": "${workerModel}",
          "modelProvider": "${workerProvider}",
          "name": "subagent-worker",
          "reasoningEffort": "${workerReasoningEffort}",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        }
      ],
      "workstations": [
        {
          "body": "Begin from zero context and complete the submitted request in one pass for Work\n{{ (index .Inputs 0).WorkID }}. Read the entire request before acting. If it\nconcerns a repository, inspect contributor instructions, relevant architecture,\nsource, tests, and working-tree state. Preserve unrelated work, run proportional\nverification, and return a self-contained outcome with evidence and limitations.\n\nRequest:\n${input}\n",
          "inputs": [
            {
              "state": "init",
              "workType": "task"
            }
          ],
          "name": "run-subagent",
          "onFailure": [
            {
              "state": "failed",
              "workType": "task"
            }
          ],
          "outputs": [
            {
              "state": "complete",
              "workType": "task"
            }
          ],
          "promptFile": "prompts/run-subagent.md",
          "type": "AGENT_RUN",
          "worker": "subagent-worker"
        }
      ]
    }
    
  3. fusion

    Produces an initial answer with one worker and refines it with a second worker.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/fusion/factory.json

    Open fusion reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Produces an initial answer with one worker and refines it with a second worker."
      },
      "examples": [
        {
          "args": {
            "firstProvider": "CLAUDE",
            "input": "Draft a release summary",
            "resultFile": "fusion-summary.md",
            "secondProvider": "CODEX"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Draft a release summary with provider overrides."
          },
          "name": "positional-input-with-provider-overrides"
        },
        {
          "args": {
            "firstModel": "claude-sonnet-4-20250514",
            "input": "Draft a release summary",
            "secondModel": "gpt-5"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Draft a release summary with model overrides."
          },
          "name": "stdin-input-with-model-overrides"
        }
      ],
      "id": "builtin-fusion",
      "invocationSignature": {
        "outputContract": {
          "contentType": "text/markdown",
          "description": "When output is supplied, callers can treat the refined answer as file-oriented markdown content.",
          "fileExtension": ".md",
          "mode": "FILE",
          "pathParameter": "resultFile"
        },
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Text request to run through the two-stage fusion flow.",
            "externalName": "to",
            "name": "input",
            "required": true
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "description": "Optional output-path hint for file-oriented callers.",
            "externalName": "result-file",
            "name": "resultFile",
            "typeHint": "FILE_PATH"
          },
          {
            "aliases": [
              "p1"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Optional provider override for the first fusion pass; omitted values use operator defaults.",
            "externalName": "first-provider",
            "name": "firstProvider"
          },
          {
            "aliases": [
              "p2"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Optional provider override for the second fusion pass; omitted values use operator defaults.",
            "externalName": "second-provider",
            "name": "secondProvider"
          },
          {
            "aliases": [
              "m1"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Optional model override for the first fusion pass; omitted values use operator defaults.",
            "externalName": "first-model",
            "name": "firstModel"
          },
          {
            "aliases": [
              "m2"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Optional model override for the second fusion pass; omitted values use operator defaults.",
            "externalName": "second-model",
            "name": "secondModel"
          },
          {
            "aliases": [
              "e1"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "choices": [
              "low",
              "medium",
              "high"
            ],
            "defaultValue": "medium",
            "description": "Reasoning effort hint for the first fusion pass.",
            "externalName": "first-effort",
            "name": "firstEffort"
          },
          {
            "aliases": [
              "e2"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "choices": [
              "low",
              "medium",
              "high"
            ],
            "defaultValue": "medium",
            "description": "Reasoning effort hint for the second fusion pass.",
            "externalName": "second-effort",
            "name": "secondEffort"
          }
        ]
      },
      "name": "fusion",
      "workTypes": [
        {
          "handlingBehavior": [
            "DEFAULT"
          ],
          "name": "task",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "draft",
              "type": "PROCESSING"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        }
      ],
      "workers": [
        {
          "body": "Reasoning effort: ${firstEffort}\nYou are the first-stage drafter for @you/fusion. Assume no prior context. Investigate the complete request and any relevant workspace evidence, then produce a thorough standalone draft whose assumptions, decisions, and verification can be checked by another model.",
          "model": "${firstModel}",
          "modelProvider": "${firstProvider}",
          "name": "fusion-drafter",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        },
        {
          "body": "Reasoning effort: ${secondEffort}\nYou are the second-stage refiner for @you/fusion. Assume the original request and first draft are your only conversational context. Validate the draft against available evidence, repair omissions or unsupported claims, preserve useful detail, and produce a polished final response that stands alone.",
          "model": "${secondModel}",
          "modelProvider": "${secondProvider}",
          "name": "fusion-refiner",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        }
      ],
      "workstations": [
        {
          "body": "Start from zero context. Read the complete request below. When it concerns a workspace, inspect contributor instructions, relevant architecture, source, tests, and current state before answering. Create a complete first draft that addresses every requirement, identifies bounded assumptions, handles important edge cases, and includes concrete verification or source evidence where applicable. This draft will be handed to a separate refiner, so do not rely on implicit context.\n\nRequest:\n${input}",
          "inputs": [
            {
              "state": "init",
              "workType": "task"
            }
          ],
          "name": "draft-fusion",
          "onFailure": [
            {
              "state": "failed",
              "workType": "task"
            }
          ],
          "outputs": [
            {
              "state": "draft",
              "workType": "task"
            }
          ],
          "type": "AGENT_RUN",
          "worker": "fusion-drafter"
        },
        {
          "body": "Start from zero context beyond the original request and prior draft included in this Work. Re-read the request, inspect relevant available evidence, and independently check the draft for correctness, completeness, contradictions, unsupported claims, missing edge cases, and weak verification. Rewrite it into one final self-contained response; do not merely summarize or endorse the draft.\n\nOriginal request:\n${input}",
          "inputs": [
            {
              "state": "draft",
              "workType": "task"
            }
          ],
          "name": "refine-fusion",
          "onFailure": [
            {
              "state": "failed",
              "workType": "task"
            }
          ],
          "outputs": [
            {
              "state": "complete",
              "workType": "task"
            }
          ],
          "type": "AGENT_RUN",
          "worker": "fusion-refiner"
        }
      ]
    }
    
  4. review

    Produces candidate work and repeats independent review until approval or a bounded failure.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/review/factory.json

    Open review reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Produces candidate work and repeats independent review until approval or a bounded failure."
      },
      "examples": [
        {
          "args": {
            "input": "Draft the release notes"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Review draft release notes."
          },
          "name": "positional-input"
        }
      ],
      "id": "builtin-review",
      "invocationReturn": {
        "policy": "EXPLICIT",
        "terminalState": "approved",
        "workTypeName": "reviewable-work"
      },
      "invocationSignature": {
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Work request that must be independently reviewed before it is returned.",
            "externalName": "to",
            "name": "input",
            "required": true
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model provider for the writer; omitted values use operator defaults.",
            "externalName": "writer-provider",
            "name": "writerProvider"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model for the writer; omitted values use operator defaults.",
            "externalName": "writer-model",
            "name": "writerModel"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model provider for the reviewer; omitted values use operator defaults.",
            "externalName": "reviewer-provider",
            "name": "reviewerProvider"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model for the reviewer; omitted values use operator defaults.",
            "externalName": "reviewer-model",
            "name": "reviewerModel"
          }
        ]
      },
      "name": "review",
      "workTypes": [
        {
          "handlingBehavior": [
            "DEFAULT"
          ],
          "name": "reviewable-work",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "in-review",
              "type": "PROCESSING"
            },
            {
              "name": "approved",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        }
      ],
      "workers": [
        {
          "model": "${writerModel}",
          "modelProvider": "${writerProvider}",
          "name": "review-work-executor",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        },
        {
          "model": "${reviewerModel}",
          "modelProvider": "${reviewerProvider}",
          "name": "review-work-reviewer",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        }
      ],
      "workstations": [
        {
          "body": "You are the producing stage of an independent produce-and-review workflow. You\nhave no prior conversation or hidden project context. Read the complete request\nbelow and, when it concerns a workspace, first inspect contributor instructions,\nrelevant architecture, source, tests, and current working-tree state. Preserve\nunrelated user changes and verify important assumptions before acting.\n\nRequest:\n{{ (index .Inputs 0).Payload }}\n\n{{ if gt (index .Inputs 0).History.AttemptNumber 1 -}}\nPrevious rejected work:\n{{ (index .Inputs 0).PreviousOutput }}\n\nReviewer feedback:\n{{ (index .Inputs 0).RejectionFeedback }}\n\n{{ end -}}\nDeliver a self-contained candidate that directly answers the request. Include\nthe reasoning, artifacts, or verification evidence the reviewer needs to judge\ncorrectness. If this is a revision, address every item of feedback and re-check\naffected behavior rather than merely editing the wording. Return the complete\ncandidate as your final response, and do not claim it has already been reviewed.\n",
          "inputs": [
            {
              "state": "init",
              "workType": "reviewable-work"
            }
          ],
          "name": "execute-review-work",
          "onFailure": [
            {
              "state": "failed",
              "workType": "reviewable-work"
            }
          ],
          "outputs": [
            {
              "state": "in-review",
              "workType": "reviewable-work"
            }
          ],
          "promptFile": "prompts/executor.md",
          "type": "AGENT_RUN",
          "workPropagation": {
            "mode": "PRESERVE_INPUT"
          },
          "worker": "review-work-executor"
        },
        {
          "body": "You are the independent review stage. Assume zero context beyond the original\nrequest, candidate, and any repository state available in the workspace. Read\nthe complete inputs. When the candidate changes code or configuration, inspect\nthe actual diff, contributor instructions, affected implementation, tests, and\nverification evidence instead of trusting the candidate's claims.\n\nOriginal request:\n{{ (index .Inputs 0).Payload }}\n\nCandidate work:\n{{ (index .Inputs 0).PreviousOutput }}\n\nCheck correctness, completeness, edge and failure cases, compatibility,\nsecurity implications, architecture fit, preservation of unrelated work, and\ntest adequacy. Feedback must identify the concrete defect, the required change,\nand why it matters. Do not reject for personal style preferences.\n\nReturn only a JSON object. If every material requirement is satisfied, return\n{\"decision\":\"ACCEPTED\",\"output\":\"the complete approved candidate work\"}.\nIf it needs revision, return {\"decision\":\"REJECTED\",\"feedback\":\"specific actionable feedback\"}.\nDo not approve without including the complete approved candidate in `output`,\nand do not approve when verification evidence needed for the request is absent.\n",
          "inputs": [
            {
              "state": "in-review",
              "workType": "reviewable-work"
            }
          ],
          "name": "review-review-work",
          "onFailure": [
            {
              "state": "failed",
              "workType": "reviewable-work"
            }
          ],
          "onRejection": [
            {
              "state": "init",
              "workType": "reviewable-work"
            }
          ],
          "outcomeFormat": "decision-envelope",
          "outputs": [
            {
              "state": "approved",
              "workType": "reviewable-work"
            }
          ],
          "promptFile": "prompts/reviewer.md",
          "type": "AGENT_RUN",
          "worker": "review-work-reviewer"
        },
        {
          "guards": [
            {
              "maxVisits": 8,
              "type": "VISIT_COUNT",
              "workstation": "review-review-work"
            }
          ],
          "inputs": [
            {
              "state": "init",
              "workType": "reviewable-work"
            }
          ],
          "name": "review-loop-breaker",
          "outputs": [
            {
              "state": "failed",
              "workType": "reviewable-work"
            }
          ],
          "type": "LOGICAL_MOVE",
          "worker": ""
        }
      ]
    }
    
  5. quorum

    Runs independent assessments in parallel and merges them into one final answer.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/quorum/factory.json

    Open quorum reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Runs independent assessments in parallel and merges them into one final answer."
      },
      "examples": [
        {
          "args": {
            "input": "Compare the two proposed release plans."
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Compare release plans with the default quorum."
          },
          "name": "default-quorum"
        },
        {
          "args": {
            "branchModel": "gpt-5",
            "branchProvider": "CODEX",
            "input": "Compare the two proposed release plans.",
            "mergeModel": "claude-sonnet-4-20250514",
            "mergeProvider": "CLAUDE"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Compare release plans with role-specific providers and models."
          },
          "name": "role-specific-models"
        }
      ],
      "id": "builtin-quorum",
      "invocationReturn": {
        "policy": "EXPLICIT",
        "terminalState": "complete",
        "workTypeName": "quorum-merge"
      },
      "invocationSignature": {
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Text request evaluated by the quorum workers.",
            "externalName": "to",
            "name": "input",
            "required": true
          },
          {
            "aliases": [
              "bp"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Provider for both independent quorum branch workers; omitted values use operator defaults.",
            "externalName": "branch-provider",
            "name": "branchProvider"
          },
          {
            "aliases": [
              "bm"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model for both independent quorum branch workers; omitted values use operator defaults.",
            "externalName": "branch-model",
            "name": "branchModel"
          },
          {
            "aliases": [
              "mp"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Provider for the final quorum merge worker; omitted values use operator defaults.",
            "externalName": "merge-provider",
            "name": "mergeProvider"
          },
          {
            "aliases": [
              "mm"
            ],
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValues": [
              ""
            ],
            "description": "Model for the final quorum merge worker; omitted values use operator defaults.",
            "externalName": "merge-model",
            "name": "mergeModel"
          }
        ]
      },
      "name": "quorum",
      "workTypes": [
        {
          "handlingBehavior": [
            "DEFAULT"
          ],
          "name": "task",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "quorum-context",
              "type": "PROCESSING"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        },
        {
          "name": "quorum-branch-a",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        },
        {
          "name": "quorum-branch-b",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        },
        {
          "name": "quorum-merge",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        }
      ],
      "workers": [
        {
          "body": "You are quorum branch A. Assume zero prior context, investigate the complete request independently, use available workspace evidence, and return a standalone proposed answer with assumptions and verification.",
          "model": "${branchModel}",
          "modelProvider": "${branchProvider}",
          "name": "quorum-branch-a",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        },
        {
          "body": "You are quorum branch B. Assume zero prior context, independently challenge likely assumptions in the complete request, use available workspace evidence, and return a standalone proposed answer with risks and verification.",
          "model": "${branchModel}",
          "modelProvider": "${branchProvider}",
          "name": "quorum-branch-b",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        },
        {
          "body": "You are the quorum merger. Treat the original request and two branch results as complete context, reconcile them against evidence, preserve material disagreements, and return one self-contained final answer. Before reporting a surprising implementation defect, inspect adjacent behavior and tests or run a focused read-only verification; distinguish canonical intermediate representations from customer-visible output formats, and label any unverified concern as a hypothesis rather than a fact.",
          "model": "${mergeModel}",
          "modelProvider": "${mergeProvider}",
          "name": "quorum-merge",
          "skipPermissions": true,
          "type": "AGENT_WORKER"
        }
      ],
      "workstations": [
        {
          "body": "Preserve the complete original request without summarizing or dropping context, and create exactly two independent quorum branch Work items whose names and lineage remain traceable to the original Work.",
          "inputs": [
            {
              "state": "init",
              "workType": "task"
            }
          ],
          "name": "split-quorum",
          "onFailure": [
            {
              "state": "failed",
              "workType": "task"
            }
          ],
          "outputs": [
            {
              "state": "quorum-context",
              "workType": "task"
            },
            {
              "state": "init",
              "workType": "quorum-branch-a"
            },
            {
              "state": "init",
              "workType": "quorum-branch-b"
            }
          ],
          "type": "LOGICAL_MOVE",
          "workPropagation": {
            "mode": "PRESERVE_INPUT"
          },
          "worker": ""
        },
        {
          "body": "You have no shared conversation with any other branch. Read the original request in full and inspect relevant workspace instructions, source, tests, or other evidence when available. Produce branch A's independent solution, covering all requirements, bounded assumptions, edge cases, and verification. Make the result self-contained for a merger that cannot infer your reasoning.\n\nOriginal request:\n{{ range (index .Inputs 0).Content }}{{ .Text }}{{ end }}",
          "inputs": [
            {
              "state": "init",
              "workType": "quorum-branch-a"
            }
          ],
          "name": "run-quorum-branch-a",
          "onFailure": [
            {
              "state": "failed",
              "workType": "quorum-branch-a"
            }
          ],
          "outputs": [
            {
              "state": "complete",
              "workType": "quorum-branch-a"
            }
          ],
          "type": "AGENT_RUN",
          "worker": "quorum-branch-a"
        },
        {
          "body": "You have no shared conversation with any other branch. Read the original request in full and inspect relevant workspace instructions, source, tests, or other evidence when available. Produce branch B's independent solution with special attention to alternative interpretations, hidden risks, failure cases, and verification. Make the result self-contained for a merger that cannot infer your reasoning.\n\nOriginal request:\n{{ range (index .Inputs 0).Content }}{{ .Text }}{{ end }}",
          "inputs": [
            {
              "state": "init",
              "workType": "quorum-branch-b"
            }
          ],
          "name": "run-quorum-branch-b",
          "onFailure": [
            {
              "state": "failed",
              "workType": "quorum-branch-b"
            }
          ],
          "outputs": [
            {
              "state": "complete",
              "workType": "quorum-branch-b"
            }
          ],
          "type": "AGENT_RUN",
          "worker": "quorum-branch-b"
        },
        {
          "body": "Start from zero context. The inputs are ordered as original request, branch A, then branch B. Read all three completely. Reconcile the proposals against the request and available evidence, select the strongest supported conclusions, preserve consequential disagreements or caveats, and synthesize one complete customer-facing response. Do not invent missing evidence or silently treat consensus as proof.\n\nOriginal request:\n{{ range (index .Inputs 0).Content }}{{ .Text }}{{ end }}\n\nBranch A output:\n{{ (index .Inputs 1).Payload }}\n\nBranch B output:\n{{ (index .Inputs 2).Payload }}\n\nBefore reporting a surprising implementation defect, verify it against\nadjacent behavior and tests or run a focused read-only check. Distinguish\ncanonical intermediate representations from customer-visible output\nformats. If verification is unavailable, report the concern as a\nhypothesis rather than a confirmed defect.",
          "inputs": [
            {
              "state": "quorum-context",
              "workType": "task"
            },
            {
              "state": "complete",
              "workType": "quorum-branch-a"
            },
            {
              "state": "complete",
              "workType": "quorum-branch-b"
            }
          ],
          "name": "merge-quorum",
          "onFailure": [
            {
              "state": "failed",
              "workType": "quorum-merge"
            }
          ],
          "outputs": [
            {
              "state": "complete",
              "workType": "quorum-merge"
            }
          ],
          "type": "AGENT_RUN",
          "worker": "quorum-merge"
        }
      ]
    }
    
  6. tts

    Converts submitted text to audio with the packaged local text-to-speech model.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/tts/factory.json

    Open tts reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Converts submitted text to audio with the packaged local text-to-speech model."
      },
      "examples": [
        {
          "args": {
            "text": "The release is ready."
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Convert a short release summary to audio."
          },
          "name": "speak-release-summary"
        }
      ],
      "id": "builtin-tts",
      "invocationSignature": {
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Text to convert to speech.",
            "externalName": "to",
            "name": "text",
            "required": true
          }
        ]
      },
      "name": "tts",
      "resources": [
        {
          "backend": "LLAMACPP",
          "capacity": 1,
          "loadPolicy": "ON_DEMAND",
          "model": "OMNIVOICE_Q4_K_M",
          "name": "omnivoice-cache",
          "type": "MODEL"
        }
      ],
      "workTypes": [
        {
          "handlingBehavior": [
            "DEFAULT"
          ],
          "name": "task",
          "states": [
            {
              "name": "init",
              "type": "INITIAL"
            },
            {
              "name": "complete",
              "type": "TERMINAL"
            },
            {
              "name": "failed",
              "type": "FAILED"
            }
          ]
        }
      ],
      "workers": [
        {
          "body": "You are the local text-to-speech worker for @you/tts. Treat the bound text slot as the complete input, preserve its wording and reading order, synthesize exactly one audio result with the configured local model, and surface a clear failure rather than returning partial or unrelated content.",
          "command": "omnivoice-llamacpp",
          "model": "OMNIVOICE_Q4_K_M",
          "modelLocality": "LOCAL",
          "modelProvider": "CODEX",
          "name": "tts-executor",
          "operations": [
            {
              "inputs": [
                {
                  "contentTypes": [
                    "TEXT"
                  ],
                  "name": "text",
                  "required": true
                }
              ],
              "name": "TTS",
              "outputs": [
                {
                  "contentTypes": [
                    "AUDIO"
                  ],
                  "name": "audio"
                }
              ]
            }
          ],
          "resources": [
            {
              "capacity": 1,
              "name": "omnivoice-cache"
            }
          ],
          "type": "INFERENCE_WORKER"
        }
      ],
      "workstations": [
        {
          "body": "For Work {{ .WorkID }}, read the complete bound text input, pass it unchanged to the configured TTS operation, and return the resulting audio content. Do not summarize, translate, add commentary, or claim success if synthesis produces no valid audio output.",
          "inputs": [
            {
              "state": "init",
              "workType": "task"
            }
          ],
          "name": "execute-tts",
          "onFailure": [
            {
              "state": "failed",
              "workType": "task"
            }
          ],
          "operation": "TTS",
          "operationBindings": [
            {
              "selector": {
                "type": "TEXT"
              },
              "slot": "text"
            }
          ],
          "outputs": [
            {
              "state": "complete",
              "workType": "task"
            }
          ],
          "type": "INFERENCE_RUN",
          "worker": "tts-executor"
        }
      ]
    }
    
  7. deep-research

    Breaks a research question into bounded specialist investigations and synthesizes their findings.

    Package version
    :
    0.0.7
    Source kind
    :
    factory.json
    Source path
    :
    generated/factories/deep-research/factory.json

    Open deep-research reference

    factory.jsonjson
    {
      "description": {
        "type": "LOCALIZABLE_ASSET",
        "value": "Breaks a research question into bounded specialist investigations and synthesizes their findings."
      },
      "examples": [
        {
          "args": {
            "topic": "Compare event sourcing and state machines for workflow orchestration"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Compare two workflow architecture approaches."
          },
          "name": "positional-topic"
        },
        {
          "args": {
            "topic": "What are the trade-offs of retrieval-augmented generation?"
          },
          "description": {
            "type": "LOCALIZABLE_ASSET",
            "value": "Research retrieval-augmented generation trade-offs."
          },
          "name": "stdin-topic"
        }
      ],
      "id": "builtin-deep-research",
      "invocationSignature": {
        "parameters": [
          {
            "bindings": [
              {
                "kind": "POSITIONAL",
                "position": 1
              },
              {
                "kind": "STDIN"
              },
              {
                "kind": "NAMED"
              }
            ],
            "description": "Research topic for the lead research workflow.",
            "externalName": "to",
            "name": "topic",
            "required": true
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValue": "2",
            "description": "Investigation breadth from 1 (focused) through 3 (broad). Defaults to 2.",
            "externalName": "research-depth",
            "name": "researchDepth",
            "typeHint": "STRING"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValue": "2",
            "description": "Maximum specialist child agents for this invocation, from 0 through 2. Defaults to 2.",
            "externalName": "max-subagents",
            "name": "maxSubagents",
            "typeHint": "STRING"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "description": "Optional provider for specialist research execution; omitted values use operator defaults.",
            "externalName": "research-model-provider",
            "name": "modelProvider",
            "typeHint": "STRING"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "description": "Optional model for specialist research execution; omitted values use operator defaults.",
            "externalName": "research-model",
            "name": "model",
            "typeHint": "STRING"
          },
          {
            "bindings": [
              {
                "kind": "NAMED"
              }
            ],
            "defaultValue": "medium",
            "description": "Approved reasoning effort for specialist research execution. Defaults to medium.",
            "externalName": "reasoning-effort",
            "name": "reasoningEffort",
            "typeHint": "STRING"
          }
        ]
      },
      "name": "deep-research",
      "orchestrator": {
        "javascript": {
          "argsSchema": {
            "additionalProperties": false,
            "properties": {
              "maxSubagents": {
                "default": 2,
                "description": "Per-invocation specialist cap within the factory policy ceiling.",
                "maximum": 2,
                "minimum": 0,
                "type": "integer"
              },
              "model": {
                "description": "Optional specialist execution model.",
                "minLength": 1,
                "type": "string"
              },
              "modelProvider": {
                "description": "Optional specialist execution provider.",
                "minLength": 1,
                "type": "string"
              },
              "reasoningEffort": {
                "default": "medium",
                "description": "The requested specialist reasoning effort, subject to package policy.",
                "enum": [
                  "medium"
                ],
                "minLength": 1,
                "type": "string"
              },
              "researchDepth": {
                "default": 2,
                "description": "Investigation breadth: 1 focused, 2 balanced, or 3 broad.",
                "maximum": 3,
                "minimum": 1,
                "type": "integer"
              },
              "topic": {
                "description": "The subject to investigate.",
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "topic"
            ],
            "type": "object"
          },
          "defaultPolicy": {
            "allowConnectors": false,
            "allowDangerFullAccess": false,
            "allowNetwork": false,
            "allowedReasoningEfforts": [
              "medium"
            ],
            "concurrency": 2,
            "maxAgents": 5,
            "maxDepth": 1,
            "maxRetries": 0,
            "mode": "READ_ONLY",
            "writableRoots": []
          },
          "inlineSource": {
            "encoding": "utf-8",
            "inline": "/* @you-factory-meta\n{\n  \"name\": \"@you/deep-research\",\n  \"version\": 1,\n  \"id\": \"builtin-deep-research\",\n  \"description\": {\n    \"type\": \"LOCALIZABLE_ASSET\",\n    \"value\": \"Breaks a research question into bounded specialist investigations and synthesizes their findings.\"\n  },\n  \"invocationSignature\": {\n    \"parameters\": [\n      {\n        \"name\": \"topic\",\n        \"description\": \"Research topic for the lead research workflow.\",\n        \"externalName\": \"to\",\n        \"required\": true,\n        \"bindings\": [\n          {\n            \"kind\": \"POSITIONAL\",\n            \"position\": 1\n          },\n          {\n            \"kind\": \"STDIN\"\n          },\n          {\n            \"kind\": \"NAMED\"\n          }\n        ]\n      },\n      {\n        \"name\": \"researchDepth\",\n        \"description\": \"Investigation breadth from 1 (focused) through 3 (broad). Defaults to 2.\",\n        \"externalName\": \"research-depth\",\n        \"typeHint\": \"STRING\",\n        \"defaultValue\": \"2\",\n        \"bindings\": [\n          {\n            \"kind\": \"NAMED\"\n          }\n        ]\n      },\n      {\n        \"name\": \"maxSubagents\",\n        \"description\": \"Maximum specialist child agents for this invocation, from 0 through 2. Defaults to 2.\",\n        \"externalName\": \"max-subagents\",\n        \"typeHint\": \"STRING\",\n        \"defaultValue\": \"2\",\n        \"bindings\": [\n          {\n            \"kind\": \"NAMED\"\n          }\n        ]\n      },\n      {\n        \"name\": \"modelProvider\",\n        \"description\": \"Optional provider for specialist research execution; omitted values use operator defaults.\",\n        \"externalName\": \"research-model-provider\",\n        \"typeHint\": \"STRING\",\n        \"bindings\": [\n          {\n            \"kind\": \"NAMED\"\n          }\n        ]\n      },\n      {\n        \"name\": \"model\",\n        \"description\": \"Optional model for specialist research execution; omitted values use operator defaults.\",\n        \"externalName\": \"research-model\",\n        \"typeHint\": \"STRING\",\n        \"bindings\": [\n          {\n            \"kind\": \"NAMED\"\n          }\n        ]\n      },\n      {\n        \"name\": \"reasoningEffort\",\n        \"description\": \"Approved reasoning effort for specialist research execution. Defaults to medium.\",\n        \"externalName\": \"reasoning-effort\",\n        \"typeHint\": \"STRING\",\n        \"defaultValue\": \"medium\",\n        \"bindings\": [\n          {\n            \"kind\": \"NAMED\"\n          }\n        ]\n      }\n    ]\n  },\n  \"examples\": [\n    {\n      \"name\": \"positional-topic\",\n      \"description\": {\n        \"type\": \"LOCALIZABLE_ASSET\",\n        \"value\": \"Compare two workflow architecture approaches.\"\n      },\n      \"args\": {\n        \"topic\": \"Compare event sourcing and state machines for workflow orchestration\"\n      }\n    },\n    {\n      \"name\": \"stdin-topic\",\n      \"description\": {\n        \"type\": \"LOCALIZABLE_ASSET\",\n        \"value\": \"Research retrieval-augmented generation trade-offs.\"\n      },\n      \"args\": {\n        \"topic\": \"What are the trade-offs of retrieval-augmented generation?\"\n      }\n    }\n  ],\n  \"argsSchema\": {\n    \"type\": \"object\",\n    \"required\": [\n      \"topic\"\n    ],\n    \"properties\": {\n      \"topic\": {\n        \"type\": \"string\",\n        \"minLength\": 1,\n        \"description\": \"The subject to investigate.\"\n      },\n      \"researchDepth\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"maximum\": 3,\n        \"default\": 2,\n        \"description\": \"Investigation breadth: 1 focused, 2 balanced, or 3 broad.\"\n      },\n      \"maxSubagents\": {\n        \"type\": \"integer\",\n        \"minimum\": 0,\n        \"maximum\": 2,\n        \"default\": 2,\n        \"description\": \"Per-invocation specialist cap within the factory policy ceiling.\"\n      },\n      \"modelProvider\": {\n        \"type\": \"string\",\n        \"minLength\": 1,\n        \"description\": \"Optional specialist execution provider.\"\n      },\n      \"model\": {\n        \"type\": \"string\",\n        \"minLength\": 1,\n        \"description\": \"Optional specialist execution model.\"\n      },\n      \"reasoningEffort\": {\n        \"type\": \"string\",\n        \"enum\": [\n          \"medium\"\n        ],\n        \"minLength\": 1,\n        \"default\": \"medium\",\n        \"description\": \"The requested specialist reasoning effort, subject to package policy.\"\n      }\n    },\n    \"additionalProperties\": false\n  },\n  \"defaultPolicy\": {\n    \"mode\": \"READ_ONLY\",\n    \"maxAgents\": 5,\n    \"concurrency\": 2,\n    \"maxDepth\": 1,\n    \"maxRetries\": 0,\n    \"allowNetwork\": false,\n    \"allowConnectors\": false,\n    \"allowDangerFullAccess\": false,\n    \"writableRoots\": [],\n    \"allowedReasoningEfforts\": [\n      \"medium\"\n    ]\n  }\n}\n*/\n\nreturn (async function () {\n  phase(\"lead-research\");\n\n  const topic = args.topic;\n  const researchDepth = args.researchDepth === undefined ? 2 : args.researchDepth;\n  const maxSubagents = args.maxSubagents === undefined ? 2 : args.maxSubagents;\n  const modelProvider = args.modelProvider;\n  const model = args.model;\n  const reasoningEffort = args.reasoningEffort === undefined ? \"medium\" : args.reasoningEffort;\n  // Longer topics carry enough scope to benefit from the two complementary\n  // specialist roles while short questions remain a lead-only investigation.\n  const needsSpecialists = args.topic.length \u003e= 40;\n  const specialistCount = needsSpecialists ? Math.min(maxSubagents, 2) : 0;\n  // Reserve one bounded retry for every specialist plus the lead synthesis.\n  // Provider-backed workers can fail transiently even when the same request is\n  // valid, and a research workflow should degrade explicitly instead of losing\n  // all otherwise useful findings.\n  const requiredCalls = (specialistCount * 2) + 1;\n  const budget = workflow.budget();\n  if (requiredCalls \u003e budget.maxAgents) {\n    throw \"deep research requires \" + requiredCalls + \" agent calls but maxAgents is \" + budget.maxAgents;\n  }\n\n  let specialistFindings = [];\n  if (needsSpecialists \u0026\u0026 maxSubagents \u003e 0) {\n    phase(\"specialist-research\");\n    const specialistRequests = [\n      {\n        label: \"research-specialist-technical\",\n        prompt: \"You are an independent technical research specialist with zero prior context. Investigate the mechanisms, terminology, primary evidence, implementation constraints, and disputed claims for the complete topic below at breadth level \" + researchDepth + \". Distinguish verified facts from inference, explain source quality, and return a standalone evidence summary for a lead researcher.\\n\\nTopic:\\n\" + topic,\n        modelProvider: modelProvider || \"\",\n        model: model || \"\",\n        reasoningEffort: reasoningEffort,\n        skipPermissions: true,\n      },\n      {\n        label: \"research-specialist-tradeoffs\",\n        prompt: \"You are an independent practical research specialist with zero prior context. Investigate real-world trade-offs, alternatives, risks, failure modes, counterarguments, and decision criteria for the complete topic below at breadth level \" + researchDepth + \". Distinguish verified facts from inference and return a standalone evidence summary for a lead researcher.\\n\\nTopic:\\n\" + topic,\n        modelProvider: modelProvider || \"\",\n        model: model || \"\",\n        reasoningEffort: reasoningEffort,\n        skipPermissions: true,\n      },\n    ].slice(0, maxSubagents);\n    specialistFindings = await parallel(specialistRequests);\n    for (let index = 0; index \u003c specialistFindings.length; index += 1) {\n      if (specialistFindings[index].status !== \"COMPLETED\") {\n        const retryRequest = specialistRequests[index];\n        specialistFindings[index] = await agent.run({\n          label: retryRequest.label + \"-retry\",\n          prompt: retryRequest.prompt + \"\\n\\nThis is a bounded retry after the first provider attempt failed. Return the standalone evidence summary directly.\",\n          modelProvider: retryRequest.modelProvider,\n          model: retryRequest.model,\n          reasoningEffort: retryRequest.reasoningEffort,\n          skipPermissions: true,\n        });\n      }\n    }\n  }\n\n  phase(\"lead-synthesis\");\n  const specialistStatuses = specialistFindings.map(function (finding, index) {\n    return {\n      role: index === 0 ? \"technical\" : \"tradeoffs\",\n      status: finding.status,\n      diagnostic: finding.status === \"COMPLETED\" ? \"\" : (finding.diagnostic || \"specialist evidence unavailable after bounded retry\"),\n    };\n  });\n  const specialistEvidence = specialistFindings.length === 0\n    ? \"No specialist findings were requested.\"\n    : specialistFindings.map(function (finding, index) {\n        const role = index === 0 ? \"technical\" : \"tradeoffs\";\n        if (finding.status === \"COMPLETED\") {\n          return \"[\" + role + \" specialist]\\n\" + finding.output.text;\n        }\n        return \"[\" + role + \" specialist unavailable]\\n\" + (finding.diagnostic || \"provider execution failed after bounded retry\");\n      }).join(\"\\n\\n\");\n  const leadSynthesis = await agent.run({\n    label: \"lead-research-synthesis\",\n    prompt: \"You are the lead researcher with no shared conversation. Produce a complete answer to the topic below at breadth level \" + researchDepth + \". Independently check the question's scope and terminology, integrate every relevant specialist finding, resolve or clearly preserve disagreements, distinguish evidence from inference, identify meaningful limitations, and make the response useful without access to these intermediate notes.\\n\\nTopic:\\n\" + topic +\n      \"\\n\\nCompleted specialist evidence:\\n\" + specialistEvidence,\n    modelProvider: modelProvider || \"\",\n    model: model || \"\",\n    reasoningEffort: reasoningEffort,\n    skipPermissions: true,\n  });\n  if (leadSynthesis.status !== \"COMPLETED\") {\n    throw \"lead research synthesis failed\";\n  }\n\n  return {\n    topic: topic,\n    role: \"lead-researcher\",\n    researchDepth: researchDepth,\n    maxSubagents: maxSubagents,\n    execution: {\n      modelProvider: modelProvider,\n      model: model,\n      reasoningEffort: reasoningEffort,\n    },\n    synthesis: {\n      leadResult: leadSynthesis.output,\n      specialistStatuses: specialistStatuses,\n    },\n  };\n})();\n"
          },
          "metadata": {
            "name": "@you/deep-research",
            "version": "1"
          }
        },
        "kind": "JAVASCRIPT"
      }
    }