tenant.schema.json

The account: brand, locale, sign-in, back end, roles and the streamlines in sidebar order (config-schema §3).

All pages ↓

tenant.schema.json JSON · 175 lines · Validates tenant.json Raw file
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://streamliner.work/schema/v1/tenant.schema.json",
  "title": "tenant.json",
  "description": "The account: brand, locale, sign-in, back end, roles and the streamlines in sidebar order (config-schema §3). Device-visible: never put instructions, keys or network allowlists here.",
  "type": "object",
  "required": ["id", "mode", "brand", "locale", "auth", "roles", "kinds"],
  "additionalProperties": false,
  "properties": {
    "$schema": { "$ref": "defs.schema.json#/$defs/schemaRef" },
    "id": { "$ref": "defs.schema.json#/$defs/tenantId", "description": "Account id; equals the folder and the manifest's `tenant`." },
    "mode": { "enum": ["enterprise", "personal", "demo"], "description": "`enterprise`: an organization account; read-only config, the loop on the device, model calls through the relay. `personal`: the user's own config on the device (§10). `demo`: local scripted agent and mock backend, no keys (§11)." },
    "brand": {
      "type": "object",
      "description": "How the account looks: name, logo, tint.",
      "required": ["name", "accent"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "minLength": 1, "maxLength": 80, "description": "Shown on sign-in and in Settings." },
        "shortName": { "type": "string", "minLength": 1, "maxLength": 16, "description": "≤ 16 characters, used in tight places." },
        "logo": { "$ref": "defs.schema.json#/$defs/assetPath", "description": "Square PNG, ≥ 256 px, as a content-addressed asset path." },
        "accent": { "$ref": "defs.schema.json#/$defs/colorPair", "description": "App tint: buttons, links, the selected row. `#RRGGBB` only." },
        "background": { "$ref": "defs.schema.json#/$defs/colorPair", "description": "Page background. Default: the system background." },
        "tagline": { "type": "string", "maxLength": 120, "description": "One line under the name on the join screen and in Settings → Accounts." }
      }
    },
    "theme": { "$ref": "defs.schema.json#/$defs/themeId", "description": "The account's baseline theme (§3.6): the sidebar, the window, settings, and every streamline that names none. One of `themes[].id`, a preset, or a shared ColorTheme id. Absent: synthesised from `brand.accent` / `brand.background` over Quiet. Keep `brand.accent` (old builds and the join screen draw it) close to the theme's accent." },
    "themes": { "type": "array", "maxItems": 8, "description": "The account's own themes (§3.6), at most 8: `{ id, name, light, dark? }`, each side a shared ColorTheme id or a document.", "items": { "$ref": "defs.schema.json#/$defs/ownTheme" } },
    "locale": {
      "type": "object",
      "description": "Language, currency (the `money` formatter's default) and time zone (dates in templates).",
      "required": ["language", "currency", "timeZone"],
      "additionalProperties": false,
      "properties": {
        "language": { "type": "string", "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$", "patternErrorMessage": "a BCP 47 language tag (en-US)", "description": "BCP 47 language tag, e.g. `en-US`." },
        "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "patternErrorMessage": "an ISO 4217 code (USD)", "description": "ISO 4217 currency code: the `money` formatter's default." },
        "timeZone": { "type": "string", "pattern": "^[A-Za-z_]+(/[A-Za-z0-9_+-]+)*$", "patternErrorMessage": "an IANA time zone (America/Los_Angeles)", "description": "IANA time zone for dates in templates (bubble times use the device's own zone)." }
      }
    },
    "auth": { "$ref": "#/$defs/auth" },
    "gateway": {
      "type": "object",
      "description": "manolab's Cloudflare back end: the model relay, connections, enrollment (the field keeps its old name).",
      "additionalProperties": false,
      "properties": {
        "url": { "$ref": "defs.schema.json#/$defs/configUrl", "description": "Base URL of the back end (`/v1` relative to the config host, or https://…/v1)." },
        "audience": { "type": "string", "description": "`oidc` accounts: the resource identifier the app requests a back-end token for; validated against the organization's issuer." },
        "localDemo": { "type": "boolean", "description": "`demo` mode only: run the scripted demo agent on the device even when the back end is reachable." }
      }
    },
    "connections": {
      "type": "array",
      "description": "The systems users sign in to, as they appear on the device (§3.2; `oauth` built 2026-10-12, on the device). Each MCP server names one; servers on one system share it, so a user signs in once per system.",
      "items": {
        "type": "object",
        "required": ["id", "name", "type"],
        "additionalProperties": false,
        "properties": {
          "id": { "$ref": "defs.schema.json#/$defs/connectionId", "description": "Named by `mcp[].connection` and `auth.connection`." },
          "name": { "type": "string", "minLength": 1, "description": "Shown on the sign-in card and in Settings → Connections." },
          "type": { "enum": ["oauth", "password", "api-key", "none"], "description": "`oauth`: the MCP authorization spec in ASWebAuthenticationSession. `password`: a native card, username and password (login details in `private/connections/<id>.json`). `api-key`: the user's own key on the same kind of card. `none`: public, read-only tools only." },
          "scope": { "enum": ["person", "chat"], "default": "person", "description": "`oauth` only (added 2026-10-12). `person`: one sign-in per person, kept until it ends or they sign out. `chat`: each chat signs in on its own (a customer-authorized system); the token lives and dies with that chat, and the sign-in sheet is ephemeral." },
          "authorizationServer": { "type": "string", "format": "uri", "pattern": "^https?://", "description": "`oauth` only, optional: the authorization server's issuer, when the MCP server publishes no protected-resource metadata (RFC 9728)." },
          "scopes": { "type": "array", "items": { "type": "string", "minLength": 1 }, "maxItems": 20, "description": "`oauth` only, optional: the OAuth scopes to ask for when the server advertises none." },
          "resource": { "type": "string", "format": "uri", "description": "`oauth` only, optional: the RFC 8707 audience the token must be for (`mcp[].resource` works too; the connection's wins)." },
          "signIn": {
            "type": "object",
            "description": "The sign-in's words: `help` on the gate and the card (every type); `usernameLabel` for `password`, `api-key`.",
            "additionalProperties": false,
            "properties": {
              "usernameLabel": { "type": "string", "description": "The username field's label." },
              "help": { "type": "string", "maxLength": 160, "description": "One line on the Connect Your Accounts page and the sign-in card (`oauth`), or under the fields (`password`, `api-key`)." }
            }
          }
        }
      }
    },
    "roles": {
      "type": "array",
      "description": "Job roles. A user holds a role if any listed claim value appears in that claim of their ID token (or the directory says so).",
      "items": {
        "type": "object",
        "required": ["id", "name"],
        "additionalProperties": false,
        "properties": {
          "id": { "$ref": "defs.schema.json#/$defs/roleId", "description": "Named by streamlines' and tools' `roles[]`." },
          "name": { "type": "string", "minLength": 1, "description": "Display name." },
          "claims": { "type": "object", "description": "Claim name → accepted values (`{\"groups\": [\"mj-managers\"]}`).", "additionalProperties": { "type": "array", "items": { "type": "string" } } }
        }
      }
    },
    "kinds": {
      "type": "array",
      "minItems": 0,
      "uniqueItems": true,
      "items": { "$ref": "defs.schema.json#/$defs/kindId" },
      "description": "The streamlines (agent kinds), in sidebar order. Each must have `agents/<kind>.json` and `private/agents/<kind>.json`. May be empty: an organization with no streamlines yet (since 2026-10-12). Ids starting with `_` are reserved for built-in streamlines (configcheck `kind.reserved`; the relay's `_concierge`)."
    },
    "imageHosts": {
      "type": "array",
      "uniqueItems": true,
      "items": { "$ref": "defs.schema.json#/$defs/hostName" },
      "description": "Hosts template `image` nodes may load from. Nothing else is fetched."
    },
    "policy": {
      "type": "object",
      "description": "Account-wide device policy.",
      "additionalProperties": false,
      "properties": {
        "chatRetentionDays": { "type": "integer", "minimum": 0, "description": "Streams older than this are deleted from the device; 0 = keep until signed out. Default 2 for enterprise accounts, 30 for demo; ignored in personal mode." },
        "transcripts": { "type": "object", "deprecated": true, "description": "Superseded 2026-10-09: long-term transcripts are configured privately (`private/tenant.json` `transcripts`, §3.5). The app ignores it." },
        "appLockAfterSeconds": { "type": "integer", "minimum": 0, "description": "Face ID / passcode after this long in the background. Default 300; 0 = off." },
        "sealedScreenshots": { "enum": ["allow", "blur"], "description": "`blur` (default) hides sealed cards in the app switcher and screen recordings." },
        "attachmentsMaxBytes": { "type": "integer", "minimum": 0, "description": "Account-wide ceiling per attachment; a streamline may set less, never more." },
        "uploadRetentionDays": { "type": "integer", "minimum": 1, "maximum": 30, "description": "How long an uploaded attachment lives in the upload store after its last use (default 7); 1 day after the stream's job completes." },
        "voice": { "type": "boolean", "description": "`false` switches voice (the mic and Speak replies) off account-wide (§3, docs/plans/voice.md §7). Default true." },
        "syncAccountList": { "type": "boolean", "description": "`false`: this organization never goes in a member's organization list in iCloud (the list that shows an organization joined on one device on the person's other devices, signed out). An opted-out organization is never written to iCloud and is deleted from it if it was there. Default true. Added 2026-10-12." }
      }
    },
    "support": {
      "type": "object",
      "description": "One line and a URL for Settings → Help.",
      "additionalProperties": false,
      "properties": {
        "text": { "type": "string", "description": "The help line." },
        "url": { "$ref": "defs.schema.json#/$defs/httpsUrl", "description": "The help page; its host may also be opened by `openURL` buttons and fetched by `download` buttons." },
        "email": { "type": "string", "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$", "patternErrorMessage": "an email address (help@example.com)", "description": "Where Report an Issue sends a member's report about this organization's streamlines (a mail link), until person-to-person messaging exists (2026-10-10)." }
      }
    }
  },
  "allOf": [
    { "if": { "properties": { "mode": { "not": { "const": "personal" } } } }, "then": { "required": ["gateway"] } },
    { "if": { "properties": { "auth": { "properties": { "kind": { "const": "demo" } } } } }, "then": { "properties": { "mode": { "const": "demo" } } } }
  ],
  "$defs": {
    "auth": {
      "type": "object",
      "description": "How a user opens their session with manolab's back end (§3.1).",
      "required": ["kind"],
      "additionalProperties": false,
      "properties": {
        "kind": { "enum": ["oidc", "connection", "invite", "demo"], "description": "`oidc`: the organization's identity provider (code + PKCE). `connection`: no IdP; signing in to the named connection opens the session. `invite`: ours, the default (Sign in with Apple, passkey or email code; memberships from invites, admins or directory sync). `demo`: pick a user from `users[]`, no secret." },
        "connection": { "$ref": "defs.schema.json#/$defs/connectionId", "description": "`connection`: the primary connection whose sign-in identifies the user." },
        "issuer": { "$ref": "defs.schema.json#/$defs/httpsUrl", "description": "`oidc`: discovery at `<issuer>/.well-known/openid-configuration`." },
        "clientId": { "type": "string", "minLength": 1, "description": "`oidc`: a public client registered with the organization's IdP." },
        "scopes": { "type": "array", "items": { "type": "string" }, "contains": { "const": "openid" }, "description": "`oidc`: must include `openid`; `offline_access` for refresh tokens." },
        "resources": { "type": "array", "items": { "type": "string", "format": "uri" }, "description": "`oidc`: the MCP servers' and sealed endpoints' resource identifiers (RFC 8707); every token an API receives is issued for that API and names the employee." },
        "exchange": { "enum": ["token-exchange", "ema"], "description": "How the back end gets per-resource tokens when the app can't ask directly: `token-exchange` (default, RFC 8693) or `ema` (Enterprise Managed Authorization; Next)." },
        "roleClaim": { "type": "string", "description": "Claim holding role values. Default `groups`." },
        "storeClaim": { "type": "string", "description": "Claim naming the user's location; shown in Settings and passed to the agent as context." },
        "users": {
          "type": "array",
          "description": "`demo`: the users one may pick.",
          "items": {
            "type": "object",
            "required": ["id", "name", "roles"],
            "additionalProperties": false,
            "properties": {
              "id": { "$ref": "defs.schema.json#/$defs/userId", "description": "The user's id." },
              "name": { "type": "string", "minLength": 1, "description": "Full name; the first word is `user.firstName`." },
              "roles": { "type": "array", "items": { "$ref": "defs.schema.json#/$defs/roleId" }, "description": "Role ids from `roles[]`." },
              "store": { "type": "string", "description": "The user's location (`user.store`)." },
              "title": { "type": "string", "description": "Job title shown on the picker." }
            }
          }
        }
      },
      "allOf": [
        { "if": { "properties": { "kind": { "const": "oidc" } } }, "then": { "required": ["issuer", "clientId", "scopes"] } },
        { "if": { "properties": { "kind": { "const": "connection" } } }, "then": { "required": ["connection"] } },
        { "if": { "properties": { "kind": { "const": "demo" } } }, "then": { "required": ["users"] } }
      ]
    }
  }
}

← All Schemas