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:
| Key | Type | Description |
|---|---|---|
app | AppManifest | The manifest. Fields gives each field. |
apiUrl | string | The 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:
| Error | Cause |
|---|---|
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
| Field | Type | Default | Description |
|---|---|---|---|
handle | string | required | The identifier of the app in its organization. 2 to 63 characters. See Handle. |
name | string | required | The name that the dashboard shows. Picked removes spaces at the start and at the end. |
description | string | none | A short text about the app. |
endpoint | string | none | The base URL of the server of the app. See Endpoint. |
scopes | string[] | none | The Picked scopes that the tokens of an installation carry, for example organization_leads/read. |
slots | AppSlot[] | none | The pages of the app that the dashboard shows in an iframe. See Slots. |
workflowTools | AppWorkflowTool[] | none | The workflow tools that the app adds to each project that it is installed on. See Workflow tools. |
mcp | { url: string } | none | An MCP server for the AI agent in the dashboard. See MCP server. |
events | 'workspace.published'[] | none | The events that Picked sends to the app. See Events. |
offlineAccess | boolean | false | When 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
httpsURL. - An
httpURL on the hostlocalhost,127.0.0.1or[::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:
| Request | URL |
|---|---|
| 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.
| Field | Type | Default | Description |
|---|---|---|---|
location | string | required | Where the dashboard shows the page. See the table below. |
url | string | required | The URL of the page. The same rule as endpoint applies. |
title | string | the name of the app | The heading above the iframe, and the title of the iframe. |
height | number | 160 | The height of the iframe at the start, in pixels. The page can change it with resize. |
location | Where the dashboard shows the page |
|---|---|
app-home | A page of its own in the project, at /<organization>/<project>/apps/<installation slug>. |
workspace-prepublish-actions | The publish modal of a workspace, before Picked publishes the workspace. |
workspace-postpublish-actions | The 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>.
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | The name of the tool in the app. It matches ^[a-z][a-z0-9_]{0,62}$. Two tools cannot have one name. |
label | string | required | The name of the tool in the workflow editor. |
description | string | '' | What the tool does, for the workflow editor. |
effect | 'read' | 'write' | required | write when a call changes data outside the run. A test run calls a write tool only when Execute writes is on. |
arguments | Record<string, AppToolArgument> | {} | The arguments that a node sets, by name. |
output | Record<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
| Field | Type | Default | Description |
|---|---|---|---|
label | string | required | The name of the argument in the workflow editor. |
type | string | required | string, number, boolean or json. |
description | string | '' | The text below the field in the workflow editor. |
required | boolean | false | When true, a node must set the argument. |
options | string[] | none | The values that a string argument can have. |
Output
| Field | Type | Default | Description |
|---|---|---|---|
label | string | required | The name of the value in the workflow editor. |
type | string | required | string, number, boolean or json. |
description | string | '' | What the value holds. |
optional | boolean | false | When 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:
| Property | Value |
|---|---|
| Name | app.<installation slug>.<name>, for example app.lead-insights.score_lead. |
| Label | <app name>: <label>, for example Lead Insights: Score lead. |
| Scope | organization_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[] }| Message | Cause |
|---|---|
The manifest must be an object | The manifest is not an object. |
handle must be 2-63 lower-case letters, digits and hyphens | handle does not match its pattern. |
name is required | name is not set, or has only spaces. |
endpoint must be an https URL, or http on localhost | endpoint is not a correct URL. See Endpoint. |
scopes must be an array of scope names | scopes is not an array of strings. |
slots must be an array | slots is not an array. |
slots[<n>] must be an object | A slot is not an object. |
slots[<n>].location must be one of app-home, workspace-prepublish-actions, workspace-postpublish-actions | location has a different value. |
slots[<n>].url must be an https URL, or http on localhost | url is not a correct URL. See Endpoint. |
workflowTools must be an array | workflowTools is not an array. |
workflowTools[<n>] must be an object | A tool is not an object. |
workflowTools[<n>].name must be lower-case letters, digits and underscores | name does not match its pattern. |
workflowTools[<n>].label is required | label is not set, or is empty. |
workflowTools[<n>].effect must be read or write | effect has a different value. |
workflowTools[<n>].arguments must be an object keyed by field name | arguments is not an object. |
workflowTools[<n>].output must be an object keyed by field name | output is not an object. |
<field> is not a valid field name | The name of an argument or an output value does not match its pattern. |
<field> must be an object | An argument or an output value is not an object. |
<field>.label is required | The label of an argument or an output value is not set, or is empty. |
<field>.type must be one of string, number, boolean, json | The type of an argument or an output value has a different value. |
workflowTools need an endpoint to call | The 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 localhost | mcp is not an object, or mcp.url is not a correct URL. |
events must be an array of workspace.published | events is not an array, or has a different value. |
events need an endpoint to send them to | The manifest has events and no endpoint. |
offlineAccess must be true or false | offlineAccess 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.
Related
- About apps — what an app is, and how versions and installations work.
@picked/app-kit—parseManifestand the server functions.- App protocol — the requests that Picked sends for each field.
- How to add a workflow tool to an app
- How to add a page to the dashboard
- How to deploy an app
