Skip to content

Self-improving AI Employees for everyone

5.0 KB
Raw Blame
{
  "_comment": "Normal mode's setup-screen vocabulary: what a model may use when it writes a new employee's setup screen. The prompt (services/employees/setup_prompt.py) is generated from this file; the client's renderer (client/src/features/home/genui/catalog.ts, hirePayload.ts) must list the same components, actions, tones, roles, state paths, limits and trigger lists, which tests/test_genui_catalog_sync.py checks. A component marked `inserted` is added by the client's normalizer, never by the model, so the prompt leaves it out. `trigger.times` are the times a schedule can run at (services/employees/builder.py SCHEDULE_TIMES). spec_version 2 is json-render's shape: a Toggle binds `checked`, and a Button's action is the element's `on.press` ({action, params}); the client still reads the older `value` and `action`/`actionParams` a model may write.",
  "spec_version": 2,
  "components": {
    "Stack": {
      "props": "{direction:\"vertical\"|\"horizontal\", gap:\"sm\"|\"md\"|\"lg\"}",
      "description": "Layout container. Has children."
    },
    "Grid": {
      "props": "{columns:2|3}",
      "description": "Responsive grid. Has children."
    },
    "Card": {
      "props": "{title?, subtitle?, tone?}",
      "description": "Surface grouping related content. Has children."
    },
    "Heading": {
      "props": "{text}",
      "description": "Short section heading."
    },
    "Text": {
      "props": "{text, muted?:boolean}",
      "description": "A sentence or short paragraph."
    },
    "Metric": {
      "props": "{label, value, hint?, tone?}",
      "description": "A single number or fact to highlight."
    },
    "Badge": {
      "props": "{label, tone?}",
      "description": "Small status label."
    },
    "Plan": {
      "props": "{title, steps:[{title, detail, role:\"trigger\"|\"agent\"|\"tool\"|\"workflow\", app?}]}",
      "description": "An automation shown as a chain of steps: trigger first (\"When…\"), then agent/tool steps. A step that uses an app names it in \"app\"."
    },
    "Schedule": {
      "props": "{value:{\"$bindState\":\"/trigger\"}}",
      "description": "When they work, as a sentence the owner can change: what starts the work, and for a schedule how often and when. Seeded from the hire button's trigger.",
      "inserted": true
    },
    "AgentCard": {
      "props": "{name, role, description, apps:[string], status:\"ready\"|\"working\"|\"paused\"}",
      "description": "An AI employee and what it does."
    },
    "List": {
      "props": "{items:[{title, detail?, meta?, tone?}]}",
      "description": "A list of emails, events, tasks or results."
    },
    "Draft": {
      "props": "{channel:\"Email\"|\"WhatsApp\"|\"Slack\", to, subject?, body}",
      "description": "A message ready for the user to approve."
    },
    "Progress": {
      "props": "{label, value:0-100, tone?}",
      "description": "Progress or usage bar."
    },
    "Toggle": {
      "props": "{label, description?, checked:{\"$bindState\":\"/rules/<key>\"}}",
      "description": "On/off ground rule, bound to state under /rules."
    },
    "Choice": {
      "props": "{label, options:[string], value:{\"$bindState\":\"/choices/<key>\"}}",
      "description": "Pick one of 2-4 options, bound to state under /choices."
    },
    "Input": {
      "props": "{label, placeholder?, value:{\"$bindState\":\"/inputs/<key>\"}}",
      "description": "Short text field, bound to state under /inputs."
    },
    "Button": {
      "props": "{label, variant:\"primary\"|\"secondary\"}",
      "description": "Runs an action, named beside its props: \"on\":{\"press\":{\"action\", \"params\"?}}."
    },
    "Divider": {
      "props": "{}",
      "description": "Thin separator."
    }
  },
  "container_types": ["Stack", "Grid", "Card"],
  "control_types": ["Toggle", "Choice", "Input"],
  "actions": {
    "setState": "{statePath, value} — update UI state",
    "hire_employee": "{name, role, apps:[string], trigger, sendsVia} — add this employee to the team and start them working",
    "refine": "{} — let the owner describe a change to this setup",
    "connect_app": "{app} — connect an app by name",
    "open_connectors": "{} — open the apps panel"
  },
  "action_aliases": {
    "ask": "refine"
  },
  "tones": ["agent", "model", "tool", "trigger", "workflow", "neutral"],
  "step_roles": ["trigger", "agent", "tool", "workflow"],
  "state_paths": {
    "rules": "/rules",
    "askFirst": "/rules/askFirst",
    "choices": "/choices",
    "inputs": "/inputs",
    "trigger": "/trigger"
  },
  "ask_first_label": "Ask me before sending anything",
  "trigger": {
    "kinds": ["app_event", "schedule", "manual"],
    "every": ["hour", "day", "weekday", "week", "month"],
    "times": ["00:00", "02:00", "04:00", "06:00", "08:00", "09:00", "10:00", "12:00", "14:00", "16:00", "18:00", "20:00", "22:00"]
  },
  "limits": {
    "maxElements": 16,
    "maxReplyChars": 65536,
    "maxLine": 120,
    "maxText": 400,
    "maxBody": 2000,
    "maxSteps": 6,
    "maxItems": 8,
    "maxOptions": 4,
    "maxApps": 6,
    "maxInput": 200,
    "maxIdLength": 40
  }
}