Skip to content

Adapter packages

An adapter package is a directory: an adapter.json manifest, your executable, and any files it needs. The manifest records every file's size and SHA-256, which is what the desktop reviews and re-checks.

Availability

Packages are produced by the shellcanvas-adapter CLI and installed through App Manager → Connection adapters on the Windows desktop. A package is built for one platform and refused on another.

Interface

Manifest

json
{
  "schemaVersion": 1,
  "id": "example.device",
  "name": "My device",
  "version": "0.1.0",
  "description": "Reads probes from an example device.",
  "platform": "windows-x86_64",
  "entrypoint": "bin/shellcanvas-device.exe",
  "arguments": [],
  "files": [
    { "path": "bin/shellcanvas-device.exe", "size": 4312576, "sha256": "…64 hex…", "executable": true }
  ],
  "configuration": [
    { "id": "endpoint", "label": "Device address", "kind": "text", "required": true },
    { "id": "token", "label": "API token", "kind": "password", "required": false }
  ]
}
FieldRules
schemaVersionExactly 1.
idNamespaced, dotted, at most 200 bytes, not starting with system.
nameNon-blank, at most 200 bytes.
versionSemantic version, at most 100 bytes.
descriptionUp to 4000 bytes.
platform{os}-{arch}, for example windows-x86_64. In a source manifest you may write current and the CLI expands it.
entrypointA relative path that must also appear in files as executable. On Windows it must end in .exe.
argumentsFixed launch arguments, without NUL bytes.
files1 to 4096 entries, 512 MiB in total. Each has path, size, sha256 (64 lowercase hex) and optional executable.
configurationFields the user fills in when connecting: text, password, number or boolean, each with a unique id and a non-blank label. A password field may not carry a default.

Source manifests list only path and executable; sizes and hashes are filled in when packing. {exe} in a path expands to the platform's executable suffix.

Paths must stay inside the package: no .., no absolute paths, no symbolic links, no Windows reserved names such as CON or COM1, and nothing that collides with adapter.json.

Commands

sh
shellcanvas-adapter build ./my-device ./my-device-package          # compile, then pack
shellcanvas-adapter build ./my-device ./my-device-package --debug  # debug build
shellcanvas-adapter pack ./my-device/adapter.json ./target/release/shellcanvas-device ./out
shellcanvas-adapter validate ./my-device-package/adapter.json
shellcanvas-adapter schema source                                   # or: schema package

build and pack refuse an output directory that already exists, write assets with restrictive permissions, and write adapter.json last so a half-written package is never mistaken for a complete one. validate re-hashes every file and prints Verified <id> <version> (<n> assets) without executing anything.

Examples

A release routine, with the package checked exactly as the desktop will check it:

sh
shellcanvas-adapter build ./my-device ./dist/my-device-0.2.0
shellcanvas-adapter validate ./dist/my-device-0.2.0/adapter.json

Configuration a user fills in when adding your adapter as a source:

json
"configuration": [
  { "id": "host", "label": "Controller address", "kind": "text", "required": true },
  { "id": "port", "label": "Port", "kind": "number", "required": false, "default": 4840 },
  { "id": "verify", "label": "Verify certificate", "kind": "boolean", "required": false, "default": true },
  { "id": "secret", "label": "Shared secret", "kind": "password", "required": true }
]

Values reach your adapter in the configuration object of the initialize request. Password values are never written into saved workspace profiles.

Errors

MessageCause
Unsupported or invalid adapter package identityThe id is not namespaced, too long, or starts with system.
Adapter packages must contain 1 to 4096 filesEmpty or oversized file list.
Adapter package exceeds the 512 MiB payload budgetTotal size too large.
Duplicate asset paths or invalid file hashesRepeated path, or a hash that is not 64 lowercase hex.
Adapter entrypoint must be a declared executable fileThe entrypoint is missing from files, or not marked executable.
Windows adapter entrypoints must be explicit .exe filesA Windows package pointing at something else.
Invalid or duplicate adapter configuration fieldsRepeated id, blank label, or a dot in an id.
Invalid adapter field default; passwords cannot have packaged defaultsA default on a password field.
Invalid adapter asset path / Invalid or reserved adapter asset pathTraversal, control characters, or a reserved name.
Package assets cannot be symbolic linksA symlink in the package.
Choose a new package output directoryThe output directory exists.
This adapter package is for a different platformThe manifest's platform does not match the desktop.
Adapter file does not match its manifest: <path>An installed file was modified after review.
This adapter changed while being reviewed. Review the package againThe package changed between review and install.

Lifecycle and permissions

Installing happens in two steps. Review copies and hashes the package into a staged snapshot, so what you approve is fixed even if the source directory changes afterwards. Install then records it as a generation in the catalog under the desktop's local application data.

Updating installs a new generation and keeps the old directory in place, so a connection that is running keeps the exact bytes it started with. Connecting re-verifies every declared asset, which is how tampering after installation is caught. Disabled adapters stay installed but refuse to launch, and unreferenced generations are collected once nothing holds them.

Everything here establishes what you installed, not who wrote it. There is no publisher authentication, no signing and no marketplace; an adapter is native code you decided to trust.

ShellCanvas documentation