İçeriğe geç

Manifest reference

Bu içerik henüz dilinizde mevcut değil.

A manifest is the JSON document that defines a Kit. It is a consent document: everything a Kit may do in a workspace is declared here, and the admin who installs the Kit sees it.

JSON Schema: /schemas/kit-manifest/v1.json (draft 2020-12). Its canonical id is https://ketvia.com/schemas/kit-manifest/v1.json. Point your editor at it for completion and validation. Ketvia also runs checks that a JSON Schema cannot express (listed below), so a manifest that passes the schema can still be rejected with a precise message.

  • schemaVersion is 1. Unknown keys are rejected at every level.
  • Localized strings are objects such as { "en": "Acme CI", "tr": "Acme CI" }. en is required; tr is optional and falls back to en. Strings are trimmed and must not be empty.
  • URLs must be https, without credentials (user:pass@) or a fragment (#…), at most 2000 characters.
  • The whole manifest is at most 64 KB.
{
"schemaVersion": 1,
"slug": "acme-ci-notify",
"version": "0.1.0",
"displayName": { "en": "Acme CI" },
"description": { "en": "Posts build results to a channel." },
"developer": { "name": "Acme Inc.", "url": "https://acme.dev", "supportEmail": "[email protected]" },
"privacyPolicyUrl": "https://acme.dev/privacy",
"bot": { "displayName": { "en": "Acme CI" }, "scopes": ["incoming-webhook"] },
"incomingWebhooks": { "maxPerInstallation": 5 },
"distribution": "private"
}
Field Type Required Rules
schemaVersion 1 Yes Always 1.
slug string Yes ^[a-z][a-z0-9-]{1,39}$: 2 to 40 characters, lowercase letters, digits and hyphens, starting with a letter. Global across Ketvia; some slugs are reserved. Never changes.
version string Yes major.minor.patch, digits only, no leading zeros, no pre-release suffix (for example 1.4.0).
displayName localized, ≤ 60 Yes The Kit’s name.
description localized, ≤ 500 Yes What the Kit does, shown at install.
developer.name string, ≤ 80 Yes Who publishes the Kit.
developer.url URL Yes The developer’s website.
developer.supportEmail email, ≤ 254 Yes Where workspace admins get help.
privacyPolicyUrl URL Yes The Kit’s privacy policy.
icon URL No The Kit’s icon.
categories string[] ≤ 5 No Each ^[a-z][a-z0-9-]{1,30}$. Default [].
locales "en" | "tr", 1–2 No Languages the Kit supports. Default ["en"]. Every listed locale other than en needs a displayName in that language.
bot.displayName localized, ≤ 60 Yes The Kit bot’s name, shown as the author of its messages.
bot.scopes scope[] No Bot scopes. Default []. See Scopes.
userScopes scope[] No Scopes a member can grant to a user token. Default [].
incomingWebhooks object No { "maxPerInstallation": 1–20 }. Requires the incoming-webhook bot scope.
oauth.redirectUrls URL[] 1–10 No Where Ketvia may send the member back in the kit.access flow. The redirect_uri of each request must equal one of them.
distribution string Yes private, unlisted or directory. unlisted needs verified domains for every endpoint host (see Distribution); directory is not available yet.
requestedModelDataPolicy "none" | "answer" No Default none. Must be none in this phase. See Model data policy.
tools object No Assistant tools served by your endpoint (endpoint, items, planner). Write tools end in an approval card; read results are cards. See Tools and Planner hook.
failureCodes object No Maps a tool’s machine error codes to Ketvia failure codes. Only meaningful with tools.
events object No { url, subscribe[] }. See Events.
interactivity object No { url }. See Interactivity.
commands object[] No Slash commands. Needs the commands bot scope; built-in names are reserved. See Slash commands.
externalAuth object No OAuth that Ketvia performs towards the Kit’s own service. Not available to private Kits yet.
settings object No The installation settings form: a JSON Schema object with x-ketvia-* annotations. See Settings and Installation settings.
feeds object[] No Event types the Kit publishes (at most 20). Needs the feeds:publish bot scope. See Feeds and Event feeds.
records object[] No The record types your product has (at most 10), and optionally the tool that returns a record’s balance. See Records and Records and notes.
linkDomains string[] No Host names (at most 10) that link buttons in your result cards may open. See Link domains.

The tools object declares what Ketvia’s assistants may call: endpoint, auth, timezone and items, plus these fields:

Field Type Meaning
tools.planner.endpoint URL (https), optional Your planner hook: Ketvia asks it which tool answers a question before any model, with a 1.5 second budget. It follows the same verified-host rule as tools.endpoint, and the consent screen says the Kit receives the questions asked to the assistant.
tools.auth signature (default), externalAuth or signature+externalToken How a call to your endpoint is authenticated. signature: Ketvia’s signature only. signature+externalToken: the signature plus the installation’s current access token for the connected external account in Ketvia-External-Authorization: Bearer <token>; a Kit with it may also fetch that token itself with POST /installation/external-token (scope external-token:read). externalAuth: the installation’s external OAuth bearer token in Authorization. Both token modes need an externalAuth section.
tools.items[].selection { "argument": string }, optional Marks a tool that can answer “which record?”. argument is the free-text input (for example query) and must name one of the tool’s input properties. When a follow-up’s previous run used it, the planner hook gets previous.choice.

A tool may declare that it works from a document the requester posted (a photo or a PDF). The assistant reads the document with its vision model and calls the tool with what it read: the declaration says nothing about the arguments, which still follow the tool’s ordinary inputSchema.

"attachments": { "accept": ["image/jpeg", "image/png", "application/pdf"], "maxFiles": 5, "dataClass": "personal" }
Field Rule
accept A non-empty list of distinct types out of image/jpeg, image/png and application/pdf.
maxFiles 1 to 5 (several photos of one document set, or a multi-page PDF).
dataClass What the documents contain: standard, personal or sensitive, never above the tool’s own dataClass.

A tool with attachments must have "audience": "private" (a document is the requester’s own and never goes through a channel run), and at most 3 tools of a manifest may declare it. Each file is at most 4.5 MB and a request at most 10 MB in total; a PDF is read up to 10 pages and an image is scaled to at most 2000 pixels on its longer edge. The install consent does not list attachments: whether documents may reach the model is the owner’s decision in the model data policy.

records declares the kinds of thing people talk about in your product, so that a note a member saves from one of your result cards, or that the assistant saves after reading your data, can be linked to the record. A link is stored on the note as kit:<slug>:<type>, the record id and a label.

"records": [
{
"type": "customer",
"label": { "en": "Customer", "tr": "Müşteri" },
"balance": {
"tool": "customer_balance",
"argument": "customerId",
"remainingPath": "remaining",
"currencyPath": "currency"
}
}
]
  • type: ^[a-z][a-z0-9_]{0,31}$ (no :), unique in the manifest. label: localized, up to 60 characters.
  • balance (optional) tells Ketvia how to ask your Kit what a record’s balance is, so a member can compare it with the figures in their own notes. tool must be a read tool of this manifest and argument one of its inputs (the record id goes there). remainingPath names a numeric property of the tool’s outputSchema holding what is still owed, in major units. Give exactly one of currency (a fixed ISO 4217 code) and currencyPath (a string property of the output that carries the code).
  • The balance is read by an ordinary private assistant run that calls your tool. It needs the member’s own private grant of that tool, so it follows the usual grants and fences. Ketvia compares your figure with its own notes and shows a notice when they differ; it never changes anything in your product, and never corrects its notes from your figure.
  • A record in a card button, in a tool result’s _meta.ketvia.records, or in a batch item’s follow-up must use a declared type.

linkDomains lists the host names that link buttons in your result cards may open, for example ["app.acme.example"]. A card button’s url must be https and its host must equal one of them or be a subdomain of one; a card with any other link is not shown (Ketvia renders the template card from your manifest instead). Each entry is a lower-case host name of 3 to 253 characters. For unlisted and directory Kits the domains must be verified like the endpoint hosts (see Distribution). A link button never reaches your Kit: it opens after Ketvia’s “Leaving Ketvia” confirmation.

settings declares the form an admin fills in on the Kit’s admin page: an object schema in the safe subset whose fields carry x-ketvia-widget (channel, time, weekday, toggle or select), x-ketvia-label and x-ketvia-order, and optionally x-ketvia-help, x-ketvia-group (a key of x-ketvia-groups), x-ketvia-ownerOnly and x-ketvia-enumLabels. 1 to 30 fields, at most 10 groups and 8 KB. The Kit reads the values with GET /installation/settings and learns about changes from the kit.settings_changed event. The full rules and an example are on Installation settings.

feeds lists the event types the Kit can publish:

"feeds": [
{
"type": "payment.received",
"title": { "en": "Payment received" },
"description": { "en": "A payment was recorded." },
"dataClasses": ["standard"]
}
]

type matches ^[a-z][a-z0-9_.]{0,39}$ and is unique; title is up to 60 characters and description up to 200; dataClasses lists 1 to 4 distinct classes the messages may contain. At most 20 feeds. A manifest with feeds needs the feeds:publish bot scope and the scope needs at least one feed. Adding a feed is a new manifest version. See Event feeds.

Beyond the JSON Schema, Ketvia checks:

  • incomingWebhooks needs incoming-webhook in bot.scopes.
  • commands needs the commands bot scope; each event subscription needs the matching read scope.
  • Each locale in locales other than en has a displayName in that language.
  • Private Kits in this phase: distribution is private, requestedModelDataPolicy is none, and there is no externalAuth section and no assistant:tools bot scope (declaring tools grants it). tools, events, interactivity and commands are available; a command may not use a reserved Ketvia name.
  • tools[].selection.argument must name one of the tool’s input properties.
  • feeds needs the feeds:publish bot scope, and feeds:publish needs at least one feed.
  • tools[].attachments needs "audience": "private" and a dataClass no higher than the tool’s; at most 3 tools declare it.
  • records[].balance.tool is a read tool of the manifest, argument is one of its inputs, remainingPath a numeric and currencyPath a string property of its outputSchema, with exactly one of currency and currencyPath; record types are unique.
  • tools.auth externalAuth or signature+externalToken needs externalAuth, and the external-token:read scope needs both.

Ketvia answers the first problem it finds with the field path, for example Invalid manifest: bot.scopes.0: ….

To update a private Kit, upload a manifest with the same slug and a higher version through Create a private Kit. The Kit and the workspace’s installation move to the new version at once.

  • A version equal to or lower than the installed one is rejected.
  • Uploading an existing version with different content is rejected: versions are immutable.
  • If the new version requests fewer scopes, existing tokens lose the removed scopes at once. Tokens never gain scopes they were not issued with.
Limit Value
Manifest size 64 KB
Tools 50
Slash commands 25
Event subscriptions 30
Record types 10
Link domains 10
Feeds 20
Tool schema size 8 KB each
Tool schema depth 6
maxLength on schema strings ≤ 4096
maxItems on schema arrays ≤ 200
Incoming webhooks per installation 1–20
OAuth redirect URLs 1–10

Tool input and output schemas (later phase) use a restricted JSON Schema, so that Ketvia can validate every argument and result without running remote regular expressions or following references:

  • Allowed keywords: type (one of object, string, integer, number, boolean, array), properties, required, additionalProperties, enum (1 to 100 primitive values), const, minimum, maximum, minLength, maxLength, minItems, maxItems, items, description, title (≤ 1000 characters) and x-ketvia-dataClass (aggregate, standard, personal or sensitive).
  • format only on strings, one of date, date-time, uuid, email, uri.
  • Objects must set "additionalProperties": false; at most 50 properties, named ^[A-Za-z_][A-Za-z0-9_]{0,63}$.
  • Strings must set maxLength (≤ 4096). Arrays must set minItems and maxItems (≤ 200) and items.
  • Not allowed: $ref, pattern, oneOf, anyOf, allOf, if and any other keyword.
  • Depth at most 6, at most 8 KB per schema, and the top level is an object.