{
  "contract": "algal.bundle.v1",
  "root": "sha256:b4e018fa58ae66598dff77a21650e1795186687d304c17bad9ad55eee5191c20",
  "manifests": {
    "sha256:b4e018fa58ae66598dff77a21650e1795186687d304c17bad9ad55eee5191c20": {
      "contract": "algal.organism.v1",
      "key": "organism:inbox",
      "name": "inbox",
      "budgets": {
        "maxAgentCalls": 4,
        "maxContextBytes": 65536,
        "maxDepth": 4,
        "maxOutputBytes": 65536,
        "maxSteps": 256,
        "maxWork": 1000000
      },
      "cells": [
        {
          "id": "input",
          "kind": "input",
          "outputs": {
            "sample": {
              "type": "text"
            },
            "emails": {
              "type": "json"
            }
          }
        },
        {
          "id": "b1-preview-arg-1",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": [
              "get",
              "value-1"
            ]
          },
          "output": {
            "kind": "text"
          },
          "inputs": {
            "value-1": {
              "type": "text"
            }
          }
        },
        {
          "id": "b1-preview-arg-2",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": "helpful"
          },
          "output": {
            "kind": "text"
          }
        },
        {
          "id": "b1-preview",
          "kind": "organism",
          "manifest": "sha256:2239244e0e8a90a7d7f414867977bb72f935c005476c5a02121631a6c56afafb"
        },
        {
          "id": "b2-replies-arg-1",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": [
              "get",
              "value-1"
            ]
          },
          "output": {
            "kind": "json",
            "schema": {}
          },
          "inputs": {
            "value-1": {
              "type": "json"
            }
          }
        },
        {
          "id": "b2-replies-arg-2",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": "helpful"
          },
          "output": {
            "kind": "text"
          }
        },
        {
          "id": "b2-replies-each",
          "kind": "each",
          "manifest": "sha256:2239244e0e8a90a7d7f414867977bb72f935c005476c5a02121631a6c56afafb",
          "over": "email",
          "maxItems": 3
        },
        {
          "id": "b2-replies",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": [
              "get",
              "items"
            ]
          },
          "output": {
            "kind": "json",
            "schema": {
              "type": "array"
            }
          },
          "inputs": {
            "items": {
              "type": "json"
            }
          }
        },
        {
          "id": "result",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": {
              "preview": [
                "get",
                "value-1"
              ],
              "replies": [
                "get",
                "value-2"
              ]
            }
          },
          "output": {
            "kind": "json",
            "schema": {
              "type": "object"
            }
          },
          "inputs": {
            "value-1": {
              "type": "text"
            },
            "value-2": {
              "type": "json"
            }
          }
        }
      ],
      "edges": [
        {
          "from": {
            "cell": "input",
            "port": "sample"
          },
          "to": {
            "cell": "b1-preview-arg-1",
            "port": "value-1"
          }
        },
        {
          "from": {
            "cell": "b1-preview-arg-1",
            "port": "out"
          },
          "to": {
            "cell": "b1-preview",
            "port": "email"
          }
        },
        {
          "from": {
            "cell": "b1-preview-arg-2",
            "port": "out"
          },
          "to": {
            "cell": "b1-preview",
            "port": "tone"
          }
        },
        {
          "from": {
            "cell": "input",
            "port": "emails"
          },
          "to": {
            "cell": "b2-replies-arg-1",
            "port": "value-1"
          }
        },
        {
          "from": {
            "cell": "b2-replies-arg-1",
            "port": "out"
          },
          "to": {
            "cell": "b2-replies-each",
            "port": "email"
          }
        },
        {
          "from": {
            "cell": "b2-replies-arg-2",
            "port": "out"
          },
          "to": {
            "cell": "b2-replies-each",
            "port": "tone"
          }
        },
        {
          "from": {
            "cell": "b2-replies-each",
            "port": "result"
          },
          "to": {
            "cell": "b2-replies",
            "port": "items"
          }
        },
        {
          "from": {
            "cell": "b1-preview",
            "port": "result"
          },
          "to": {
            "cell": "result",
            "port": "value-1"
          }
        },
        {
          "from": {
            "cell": "b2-replies",
            "port": "out"
          },
          "to": {
            "cell": "result",
            "port": "value-2"
          }
        }
      ],
      "interface": {
        "inputs": {
          "sample": {
            "cell": "input",
            "port": "sample"
          },
          "emails": {
            "cell": "input",
            "port": "emails"
          }
        },
        "outputs": {
          "result": {
            "cell": "result",
            "port": "out"
          }
        }
      }
    },
    "sha256:2239244e0e8a90a7d7f414867977bb72f935c005476c5a02121631a6c56afafb": {
      "contract": "algal.organism.v1",
      "key": "organism:draft",
      "name": "draft",
      "budgets": {
        "maxAgentCalls": 1,
        "maxContextBytes": 65536,
        "maxDepth": 4,
        "maxOutputBytes": 65536,
        "maxSteps": 256,
        "maxWork": 1000000
      },
      "cells": [
        {
          "id": "input",
          "kind": "input",
          "outputs": {
            "email": {
              "type": "text"
            },
            "tone": {
              "type": "text"
            }
          }
        },
        {
          "id": "result-instruction",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": "Draft a reply using the requested tone."
          },
          "output": {
            "kind": "text"
          }
        },
        {
          "id": "result-context",
          "kind": "expr",
          "expr": {
            "contract": "algal.expr.v1",
            "program": {
              "email": [
                "get",
                "value-1"
              ],
              "tone": [
                "get",
                "value-2"
              ]
            }
          },
          "output": {
            "kind": "json",
            "schema": {
              "type": "object"
            }
          },
          "inputs": {
            "value-1": {
              "type": "text"
            },
            "value-2": {
              "type": "text"
            }
          }
        },
        {
          "id": "result",
          "kind": "agent",
          "prompt": "Algal source generation envelope v1. Follow the instruction in inputs.instruction. Use only inputs.context as task context. Return the requested text.",
          "view": {
            "inputs": [
              "instruction",
              "context"
            ]
          },
          "output": {
            "kind": "text"
          },
          "inputs": {
            "instruction": {
              "type": "text"
            },
            "context": {
              "type": "json"
            }
          }
        }
      ],
      "edges": [
        {
          "from": {
            "cell": "input",
            "port": "email"
          },
          "to": {
            "cell": "result-context",
            "port": "value-1"
          }
        },
        {
          "from": {
            "cell": "input",
            "port": "tone"
          },
          "to": {
            "cell": "result-context",
            "port": "value-2"
          }
        },
        {
          "from": {
            "cell": "result-instruction",
            "port": "out"
          },
          "to": {
            "cell": "result",
            "port": "instruction"
          }
        },
        {
          "from": {
            "cell": "result-context",
            "port": "out"
          },
          "to": {
            "cell": "result",
            "port": "context"
          }
        }
      ],
      "interface": {
        "inputs": {
          "email": {
            "cell": "input",
            "port": "email"
          },
          "tone": {
            "cell": "input",
            "port": "tone"
          }
        },
        "outputs": {
          "result": {
            "cell": "result",
            "port": "out"
          }
        }
      }
    }
  },
  "values": {}
}
