# agent.schema.json

> One streamline (agent kind) as the employee sees it: name, look, welcome, composer, attachments, the overview, renderers (config-schema §4).

One streamline (agent kind) as the employee sees it: name, look, welcome, composer, attachments, the overview, renderers (config-schema §4).

Raw file: https://streamliner.work/schema/v1/agent.schema.json

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://streamliner.work/schema/v1/agent.schema.json",
  "title": "agents/<kind>.json",
  "description": "One streamline (agent kind) as the employee sees it: name, look, welcome, composer, attachments, the overview, renderers (config-schema §4). Device-visible: the instructions, model, tools and network allowlist live in private/agents/<kind>.json.",
  "type": "object",
  "required": ["id", "name", "icon", "color", "roles"],
  "additionalProperties": false,
  "properties": {
    "$schema": { "$ref": "defs.schema.json#/$defs/schemaRef" },
    "id": { "$ref": "defs.schema.json#/$defs/kindId", "description": "`[a-z0-9_]{2,32}`; equals the file name and an entry of `tenant.json` `kinds`." },
    "name": { "type": "string", "minLength": 1, "maxLength": 40, "description": "Sidebar section header and chat header." },
    "description": { "type": "string", "maxLength": 160, "description": "One line under the name in the New chat menu." },
    "icon": { "$ref": "defs.schema.json#/$defs/sfSymbol" },
    "logo": { "type": "string", "pattern": "^assets/[A-Za-z0-9_.-]{1,80}\\.(png|jpg|jpeg)$", "patternErrorMessage": "an image in the account's assets/ folder: assets/<name>.png or .jpg", "description": "The streamline's logo (2026-10-11): a square PNG or JPEG (64–1024 px, ≤ 256 KB) in `assets/`, listed in the manifest like any file. Drawn in full color wherever the `icon` would be; `icon` stays required as the fallback. Another company's logo only where its brand rules allow it." },
    "color": { "$ref": "defs.schema.json#/$defs/colorPair", "description": "The streamline's color: avatar circle, outgoing bubbles, the inspector header. Contrast against white text should be ≥ 4.5:1 (a failing color is darkened at load; configcheck warns)." },
    "theme": { "$ref": "defs.schema.json#/$defs/streamlineTheme", "description": "What this streamline's streams, card and overview wear (§3.6): a theme id (that theme whole; it must have both appearances), or `{ base?, accent? }` (base default the account's theme; accent replaces its accent). Absent: the account's theme with `color` as the accent. `color` stays required for app builds before themes; configcheck warns when it differs from the resolved accent." },
    "roles": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "defs.schema.json#/$defs/roleId" }, "description": "Who sees this streamline. Upstream APIs authorize again (law 3)." },
    "category": { "$ref": "defs.schema.json#/$defs/category", "title": "Category", "description": "Where the Library groups it (2026-10-20; config-schema §4): one of the ten Discover categories. Unset: Other. Information for owners and admins; it changes nothing in a chat." },
    "keywords": { "type": "array", "maxItems": 16, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 40 }, "title": "Keywords", "description": "Words people use for this streamline (2026-10-16; config-schema §4, docs/plans/operator.md §7): a company, a system, a task, a nickname (Verizon, the POS, returns). The Operator matches on them, without regard to case. At most 16, each 1-40 characters. Public: they only describe the streamline. A keyword two streamlines share is allowed (the Operator asks which one; configcheck warns)." },
    "operatorAccess": { "type": "boolean", "default": true, "title": "Operator can ask this streamline", "description": "Whether the Operator may ask this streamline for the person (2026-10-16; config-schema §4). Default true: unset means it may. false: people open it themselves, with its full context; the Operator can still point to it, and the relay refuses a child request for it (403 operator_not_allowed). Not a security boundary: the person can open it with the same access, and the APIs remain the lock. false → true is a widening change." },
    "audience": { "enum": ["staff", "customers"], "default": "staff", "title": "Made for", "description": "Who the streamline is made for (2026-10-13; config-schema §4). `staff` (the default): the organization's own people, by `roles`. `customers`: never in the organization's own context (no member's sidebar, owners and admins included; the relay refuses member sessions with 403 forbidden_kind and the config host withholds it); people get it only by a Discover link or listing, into On this device, and use it with their own sign-in. Owners and admins still edit and share it in the Library. `roles` doesn't apply to it." },
    "network": {
      "type": "object",
      "description": "Only the fact that this streamline is fenced to the account's networks, and what to say off site (§3.3). The allowlist itself is private; `restricted` must agree with the private rule.",
      "additionalProperties": false,
      "properties": {
        "restricted": { "type": "boolean", "description": "Draw *On site only* and expect refusals off site. Must be true exactly when the private rule restricts." },
        "message": { "type": "string", "maxLength": 200, "description": "The calm notice shown when the relay refuses a call from outside." }
      },
      "if": { "properties": { "restricted": { "const": true } }, "required": ["restricted"] },
      "then": { "required": ["message"] }
    },
    "newChatLabel": { "type": "string", "maxLength": 40, "description": "Label of the + button and ⌘N. Default `New chat`." },
    "chatTitle": {
      "type": "object",
      "description": "How a stream names itself. Until something resolves, the tab shows `newChatLabel` (default `New chat`); a chat with no title rule that resolves is titled from its first message. The agent never writes a title; a chat the person renamed never changes.",
      "additionalProperties": false,
      "properties": {
        "from": { "enum": ["overview", "firstMessage"], "description": "`overview`: interpolate `text` against the overview object; `firstMessage`: the employee's first message." },
        "text": { "$ref": "defs.schema.json#/$defs/interpolated" },
        "rules": {
          "type": "array",
          "maxItems": 20,
          "description": "Title from a tool's result (2026-10-11): when a successful result of `tool` lands in the chat (model, button or scan), `text` is interpolated over that result (`$` = the structured result; `chat.*`, `user.*` as elsewhere). The latest matching result wins; an empty or unresolved title keeps the previous one. With `from: overview` as well, the most recent of either wins (the overview title counts only when its text changes).",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["tool", "text"],
            "properties": {
              "tool": { "type": "string", "minLength": 1, "description": "An allowlisted tool's exact name." },
              "text": { "$ref": "defs.schema.json#/$defs/interpolated" }
            }
          }
        }
      }
    },
    "welcome": {
      "type": "object",
      "description": "Drawn locally at the start of every new stream; never sent to the model, never billed.",
      "additionalProperties": false,
      "properties": {
        "messages": { "type": "array", "items": { "$ref": "defs.schema.json#/$defs/interpolated" }, "description": "The agent's first bubbles. Interpolate `user.*` and `tenant.*`." },
        "starters": {
          "type": "array",
          "maxItems": 4,
          "description": "Up to 4 chips above the composer until the first send.",
          "items": {
            "type": "object",
            "required": ["label", "text"],
            "additionalProperties": false,
            "properties": {
              "label": { "type": "string", "minLength": 1, "description": "The chip's label." },
              "text": { "type": "string", "description": "The text it sends or inserts." },
              "send": { "type": "boolean", "description": "`true`: send at once; `false`: put in the composer." },
              "scan": { "type": "boolean", "description": "`true`: the chip opens the scanner (the streamline must set `scan`); `text` is the fallback where there is no scanner." }
            }
          }
        }
      }
    },
    "composer": {
      "type": "object",
      "description": "The composer's hint, quick-phrase menu (§4.1) and suggestion rules (§4, decision 77). `modelSuggestions` is a personal file's field only (configcheck: suggestions.modelOrg).",
      "additionalProperties": false,
      "properties": {
        "placeholder": { "type": "string", "description": "Empty-composer hint." },
        "suggestions": { "$ref": "defs.schema.json#/$defs/suggestions" },
        "quickPhrases": {
          "type": "array",
          "description": "The quick-phrase menu, in groups. Once in the composer a phrase is the employee's own words.",
          "items": {
            "type": "object",
            "required": ["group", "items"],
            "additionalProperties": false,
            "properties": {
              "group": { "type": "string", "minLength": 1, "description": "The group header." },
              "items": { "type": "array", "minItems": 1, "items": { "$ref": "defs.schema.json#/$defs/phrase" }, "description": "The phrases in this group." }
            }
          }
        }
      }
    },
    "attachments": { "$ref": "defs.schema.json#/$defs/attachments" },
    "scan": { "$ref": "defs.schema.json#/$defs/scan" },
    "formPresentation": { "$ref": "defs.schema.json#/$defs/formPresentation" },
    "overview": {
      "type": "object",
      "description": "The inspector (§4.3): one object, fetched by calling one read-only tool directly (no model), drawn by one template.",
      "required": ["source", "template"],
      "additionalProperties": false,
      "properties": {
        "title": { "type": "string", "description": "Inspector header." },
        "source": {
          "type": "object",
          "description": "The read-only tool the app calls directly.",
          "required": ["tool"],
          "additionalProperties": false,
          "properties": {
            "tool": { "$ref": "defs.schema.json#/$defs/toolName", "description": "Must be in the private allowlist and marked `readOnly` there." },
            "args": { "type": "object", "description": "Arguments; string values interpolate `chat.*` and `user.*`." }
          }
        },
        "requires": { "type": "array", "items": { "$ref": "defs.schema.json#/$defs/contextPath" }, "description": "Don't fetch until these resolve (e.g. `chat.cartId`); show `empty` meanwhile." },
        "template": { "$ref": "defs.schema.json#/$defs/templateId", "description": "The full inspector view." },
        "compactTemplate": { "$ref": "defs.schema.json#/$defs/templateId", "description": "One-line strip above the composer on iPhone." },
        "refreshOn": { "type": "array", "items": { "$ref": "defs.schema.json#/$defs/toolGlob" }, "description": "Re-fetch after any successful call matching one of these globs; each must match an allowlisted tool." },
        "poll": {
          "type": "object",
          "description": "While `when` holds against the overview, re-fetch every `seconds`.",
          "required": ["seconds"],
          "additionalProperties": false,
          "properties": {
            "seconds": { "type": "integer", "minimum": 10, "description": "≥ 10." },
            "when": { "$ref": "defs.schema.json#/$defs/when" }
          }
        },
        "empty": { "type": "string", "description": "Shown before `requires` resolve." }
      }
    },
    "renderers": {
      "type": "object",
      "description": "Tool → template id: how to draw a tool's result when the result names no template itself (§7). Each tool must be allowlisted; each template must exist.",
      "propertyNames": { "$ref": "defs.schema.json#/$defs/toolName" },
      "additionalProperties": { "$ref": "defs.schema.json#/$defs/templateId" }
    },
    "activity": {
      "type": "object",
      "description": "Tool → caption under the typing bubble while it runs (and the activity row after). Default: the tool's MCP title, else its name humanised.",
      "propertyNames": { "$ref": "defs.schema.json#/$defs/toolName" },
      "additionalProperties": { "type": "string" }
    },
    "imageHosts": {
      "type": "array",
      "uniqueItems": true,
      "items": { "$ref": "defs.schema.json#/$defs/hostName" },
      "description": "Extra hosts this streamline's templates may load images from, beside `tenant.json` `imageHosts`."
    },
    "completion": {
      "type": "object",
      "description": "What ends the job (one job per stream, law 2).",
      "additionalProperties": false,
      "properties": {
        "tools": { "type": "array", "items": { "$ref": "defs.schema.json#/$defs/toolName" }, "description": "A successful call to any of these ends the job." },
        "banner": { "$ref": "defs.schema.json#/$defs/interpolated", "description": "Interpolated against that tool's `structuredContent`." },
        "next": { "type": "string", "description": "Label of the button that opens a new stream of the same streamline." }
      }
    },
    "archive": { "enum": ["whenDone", "anytime", "never"], "description": "When a person may archive one of its chats (decision 70): `whenDone` (default for an organization's streamline: only after the job completed, or was canceled through `cancel`), `anytime` (the Concierge's and personal streamlines' default), `never`." },
    "cancel": {
      "type": "object",
      "description": "The step that cancels a job mid-way (decision 70): the app offers *Cancel job…* only when this is set; a successful call ends the job like a completion tool. The tool must be allowlisted and `direct` (a button runs it, with no model); the model never sees it.",
      "required": ["tool"],
      "additionalProperties": false,
      "properties": {
        "tool": { "$ref": "defs.schema.json#/$defs/toolName" },
        "label": { "type": "string", "description": "The menu item and confirmation button (default *Cancel job*)." },
        "args": { "type": "object", "description": "Arguments, interpolated against `chat.*` (e.g. `{ \"cartId\": \"{{ chat.cartId }}\" }`)." }
      }
    },
    "voice": {
      "type": "object",
      "description": "The mic and Speak replies in this streamline (§4.2b, docs/plans/voice.md). Absent = both allowed, defaults. Speech is turned into text on the device; no audio ever leaves it.",
      "additionalProperties": false,
      "properties": {
        "input": { "type": "boolean", "description": "The mic in this streamline's composer (default true). false: drawn disabled with \"Voice is off for this streamline\"." },
        "output": { "type": "boolean", "description": "Speak replies may be turned on (default true)." },
        "startInVoiceMode": { "type": "boolean", "description": "New streams start with Speak replies on (default false); the employee can always turn it off." },
        "engine": { "enum": ["auto", "dictation"], "description": "`auto` (default): SpeechTranscriber where the device supports it. `dictation`: DictationTranscriber, which takes `hints`." },
        "hints": { "type": "array", "maxItems": 100, "items": { "type": "string", "minLength": 1, "maxLength": 60 }, "description": "Recognition hints (product words, store and department names) for DictationTranscriber; at most 100." }
      }
    },
    "forms": { "type": "array", "uniqueItems": true, "items": { "$ref": "defs.schema.json#/$defs/formId" }, "description": "Sealed forms and hosted pages this streamline may open (§5); a request for any other id is refused." },
    "views": { "type": "array", "uniqueItems": true, "items": { "$ref": "defs.schema.json#/$defs/formId" }, "description": "Sealed views this streamline may open (§5)." }
  }
}

```
