Skip to content
LogoLogo

App manifest

The app manifest declares one version of an app. It gives the name and the server of the app. It also gives the pages, workflow tools, MCP server and events of the app, and the access that the app asks for.

import { defineConfig } from '@picked/config/define'
 
const endpoint = `http://localhost:${process.env.APP_PORT ?? '4103'}`
 
export default defineConfig({
  app: {
    handle: 'lead-insights',
    name: 'Lead Insights',
    description:
      'Scores leads in workflows, gives the assistant tools over the project’s leads, and shows a leads summary.',
    endpoint,
    scopes: ['organization_leads/read'],
    slots: [{ location: 'app-home', url: `${endpoint}/`, title: 'Recent leads', height: 320 }],
    mcp: { url: `${endpoint}/mcp` },
    workflowTools: [
      {
        name: 'score_lead',
        label: 'Score lead',
        description:
          'Scores a lead from 0 to 100 on its email domain and company, and names its tier.',
        effect: 'read',
        arguments: {
          email: { label: 'Email', type: 'string', required: true },
          company: { label: 'Company', type: 'string' },
        },
        output: {
          score: { label: 'Score', type: 'number' },
          tier: { label: 'Tier', type: 'string', description: 'hot, warm or cold' },
        },
      },
    ],
  },
})

The app section of picked.config

The CLI reads the manifest from the app section of picked.config.ts, picked.config.js or picked.config.json, in that order. In a .ts or .js file, the config is the export default value. A .json file holds the config object. A manifest that computes a value, for example an endpoint from process.env, must be in a .ts or .js file.

defineConfig from @picked/config/define checks the types of the config. It returns the config without changes. @picked/config/define reads no files. The server of the app can use picked.config.ts as a module, and give config.app to createAppHandler.

The config of an app has these keys:

KeyTypeDescription
appAppManifestThe manifest. Fields gives each field.
apiUrlstringThe Picked API that the CLI deploys to. The PICKED_API_URL variable replaces it.

A config can also have a projectId and the other keys of a project config. A config can have a projectId, an app section, or both, but it must have one of them. The picked generate types and picked pull commands and the Vite plugin need a projectId. They stop with an error when the config has no projectId.

The CLI checks the config before it checks the manifest. It stops with one of these errors. <file> is the path of the config file:

ErrorCause
Invalid <file>: it sets neither `projectId` (a project) nor `app` (an app). Set one or both.The config has no projectId and no app section.
Invalid <file>: `app` must be the app manifest, an object.The app section is not an object.
Invalid <file>: `app.handle` must be a non-empty string.The manifest has no handle.
Invalid <file>: `app.name` must be a non-empty string.The manifest has no name.
Invalid <file>: `apiUrl` must be the Picked API origin.apiUrl is not a string, or it is empty.

Validation gives the errors of the other fields.

In the dashboard, the manifest is what you enter on the New app page, in the form or in Edit as JSON. See New app.

Fields

FieldTypeDefaultDescription
handlestringrequiredThe identifier of the app in its organization. 2 to 63 characters. See Handle.
namestringrequiredThe name that the dashboard shows. Picked removes spaces at the start and at the end.
descriptionstringnoneA short text about the app.
endpointstringnoneThe base URL of the server of the app. See Endpoint.
scopesstring[]noneThe Picked scopes that the tokens of an installation carry, for example organization_leads/read.
slotsAppSlot[]noneThe pages of the app that the dashboard shows in an iframe. See Slots.
workflowToolsAppWorkflowTool[]noneThe workflow tools that the app adds to each project that it is installed on. See Workflow tools.
mcp{ url: string }noneAn MCP server for the AI agent in the dashboard. See MCP server.
events'workspace.published'[]noneThe events that Picked sends to the app. See Events.
offlineAccessbooleanfalseWhen true, the app can get tokens at any time. See offlineAccess.

Picked ignores a field that is not in this table.

Handle

The handle matches ^[a-z0-9][a-z0-9-]{1,62}$: lowercase letters, digits and hyphens. The first character is a letter or a digit.

Each app has one handle in its organization. When you deploy a manifest with a new handle, Picked makes a new app. When the organization has an app with that handle already, Picked adds a version to that app.

The command picked app dev adds a version for development. The other ways to deploy add a release version. When the manifest is the same as the last version of that kind, Picked adds no version. See How to deploy an app.

When Picked installs the app on a project, the slug of the installation is the handle. When the project has that slug already, Picked adds a hyphen and three characters to the handle. Each character is from 0-9 or a-f. An example is lead-insights-3fa.

Endpoint

The endpoint is the base URL of the requests that Picked sends to the app. The URL must be one of these:

  • An https URL.
  • An http URL on the host localhost, 127.0.0.1 or [::1].

The URL can have a path, for example https://app.example.com/picked. Picked removes each / at the end of the URL. Then it adds the path of each request to the URL:

RequestURL
Install, upgrade and uninstall<endpoint>/lifecycle
An event in events<endpoint>/events
A call to a workflow tool named <name><endpoint>/tools/<name>

For the endpoint https://app.example.com/picked/, Picked sends lifecycle events to https://app.example.com/picked/lifecycle.

These fields need an endpoint: a workflowTools list that is not empty, and events. An app without an endpoint has slots, an MCP server, or both.

See Requests from Picked for the paths below the endpoint, and Delivery for the addresses that Picked can send to.

Scopes

Each value in scopes is the name of a Picked scope. See Authorization and scopes for the names. A name that is not a Picked scope stops appDeploy with Unknown scope <scope>.

A person who installs the app must hold each scope on the project. The installation then has these scopes. A token that Picked gives the installation carries them.

Slots

A slot is one page of the app that the dashboard shows in an iframe.

FieldTypeDefaultDescription
locationstringrequiredWhere the dashboard shows the page. See the table below.
urlstringrequiredThe URL of the page. The same rule as endpoint applies.
titlestringthe name of the appThe heading above the iframe, and the title of the iframe.
heightnumber160The height of the iframe at the start, in pixels. The page can change it with resize.
locationWhere the dashboard shows the page
app-homeA page of its own in the project, at /<organization>/<project>/apps/<installation slug>.
workspace-prepublish-actionsThe publish modal of a workspace, before Picked publishes the workspace.
workspace-postpublish-actionsThe publish modal of a workspace, after Picked publishes the workspace.

On the app-home page, the name of the app is the page heading, and title is the title of the iframe only.

When the app has one app-home slot, that slot fills its page and the dashboard ignores height.

When the url of a slot has the origin of the dashboard, the dashboard shows an error in place of the page. See Messages between the page and the dashboard.

Workflow tools

Each item of workflowTools is one tool. A workflow node calls the tool, and Picked sends the call to <endpoint>/tools/<name>.

FieldTypeDefaultDescription
namestringrequiredThe name of the tool in the app. It matches ^[a-z][a-z0-9_]{0,62}$. Two tools cannot have one name.
labelstringrequiredThe name of the tool in the workflow editor.
descriptionstring''What the tool does, for the workflow editor.
effect'read' | 'write'requiredwrite when a call changes data outside the run. A test run calls a write tool only when Execute writes is on.
argumentsRecord<string, AppToolArgument>{}The arguments that a node sets, by name.
outputRecord<string, AppToolOutputField>{}The values that a call records for the nodes after it, by name.

The name of an argument or an output value matches ^[a-zA-Z]\w{0,62}$: a letter, then letters, digits or _, 63 characters at most.

Arguments

FieldTypeDefaultDescription
labelstringrequiredThe name of the argument in the workflow editor.
typestringrequiredstring, number, boolean or json.
descriptionstring''The text below the field in the workflow editor.
requiredbooleanfalseWhen true, a node must set the argument.
optionsstring[]noneThe values that a string argument can have.

Output

FieldTypeDefaultDescription
labelstringrequiredThe name of the value in the workflow editor.
typestringrequiredstring, number, boolean or json.
descriptionstring''What the value holds.
optionalbooleanfalseWhen true, the answer of a call can omit the value.

Tools in a project

Each installation of the app adds each tool of its version to the project:

PropertyValue
Nameapp.<installation slug>.<name>, for example app.lead-insights.score_lead.
Label<app name>: <label>, for example Lead Insights: Score lead.
Scopeorganization_external_apis/call.

See Workflow tool calls for the request and the answer.

MCP server

mcp.url is the full URL of the MCP server, for example https://app.example.com/mcp. The same rule as endpoint applies. The host can be different from the host of the endpoint, and the manifest does not need an endpoint. Picked sends each MCP request of the AI agent in the dashboard to mcp.url without changes to the URL. See MCP requests.

Events

events lists the events that Picked sends to <endpoint>/events. The only value is workspace.published. Picked keeps one copy of a value that the list has two times. See App events.

offlineAccess

With offlineAccess: true, the server of the app can get an installation token at any time. An example is a task that runs at fixed times. A person who installs or upgrades the app gives consent to it. Without it, the app gets a token only during a request from Picked. It can also get one during a request from a person on a page of the app. See Installation tokens.

Validation

parseManifest from @picked/app-kit checks a manifest. picked app deploy, picked app dev and the appDeploy mutation use it. It returns all the problems that it finds, not only the first.

parseManifest(value: unknown): { ok: true; manifest: AppManifest } | { ok: false; issues: string[] }
MessageCause
The manifest must be an objectThe manifest is not an object.
handle must be 2-63 lower-case letters, digits and hyphenshandle does not match its pattern.
name is requiredname is not set, or has only spaces.
endpoint must be an https URL, or http on localhostendpoint is not a correct URL. See Endpoint.
scopes must be an array of scope namesscopes is not an array of strings.
slots must be an arrayslots is not an array.
slots[<n>] must be an objectA slot is not an object.
slots[<n>].location must be one of app-home, workspace-prepublish-actions, workspace-postpublish-actionslocation has a different value.
slots[<n>].url must be an https URL, or http on localhosturl is not a correct URL. See Endpoint.
workflowTools must be an arrayworkflowTools is not an array.
workflowTools[<n>] must be an objectA tool is not an object.
workflowTools[<n>].name must be lower-case letters, digits and underscoresname does not match its pattern.
workflowTools[<n>].label is requiredlabel is not set, or is empty.
workflowTools[<n>].effect must be read or writeeffect has a different value.
workflowTools[<n>].arguments must be an object keyed by field namearguments is not an object.
workflowTools[<n>].output must be an object keyed by field nameoutput is not an object.
<field> is not a valid field nameThe name of an argument or an output value does not match its pattern.
<field> must be an objectAn argument or an output value is not an object.
<field>.label is requiredThe label of an argument or an output value is not set, or is empty.
<field>.type must be one of string, number, boolean, jsonThe type of an argument or an output value has a different value.
workflowTools need an endpoint to callThe manifest has tools and no endpoint.
workflowTools has two tools named <name>Two tools have one name.
mcp.url must be an https URL, or http on localhostmcp is not an object, or mcp.url is not a correct URL.
events must be an array of workspace.publishedevents is not an array, or has a different value.
events need an endpoint to send them toThe manifest has events and no endpoint.
offlineAccess must be true or falseofflineAccess is not a boolean.

<n> is the position in the array, from 0. <field> is the path of the argument or the output value, for example workflowTools[0].arguments.email.

When a slot or a tool has a problem, parseManifest does not check the other fields of that slot or tool.

The appDeploy mutation also refuses a scope that is not a Picked scope. See Scopes.