Wit

Config reference

The wit.sources.json schema, the built-in env source, the format catalogue, and the security model behind --allow-exec. Source: packages/cli/src/data-sources.ts, packages/runtime/src/data-loader.ts.

wit.sources.json

{
  "sources": {
    "<alias>": {
      "run": ["program", "arg", "{{capture}}"],
      "format": "json",
      "timeoutMs": 30000
    }
  }
}
Schema fields
FieldRequiredMeaningDefault
sourcesyestop-level object of aliases
alias.runyesnon-empty argv array; first element is the program
alias.formatnoone of the seven formatsjson
alias.timeoutMsnospawn timeout in ms30000

A missing or non-object sourcesexpected a top-level "sources" object. An empty or non-array runsource "run" must be a non-empty argv array. Any {{name}} token in run is replaced by the matching capture value (missing → empty string). Output cap: 16 MB.

Formats — 7

The value that crosses the seam from a program's stdout.

Formats
Formatstdout becomes
jsonparsed JSON — empty is null
csvarray of records; first row is the header
tsvsame but tab-delimited
linesarray of non-empty lines
textthe raw string
svgthe raw string
htmlthe raw string

The built-in env source

No config needed. @load env load@ returns process.env merged with the --env dotenv file, as a record; access it with dotted paths.

@load env load@

User is @env.USER

The dotenv parser reads KEY=value lines, treats # as a comment, strips optional surrounding quotes, and skips blank or key-less lines. The env source needs no --allow-exec.

Binding forms for load

Binding forms
FormEffect
body prose aliasnames the source to load
from alias pipenames the source explicitly
as name piperenames the resulting data def
any other named pipebecomes a capture passed to the program
@load results load@
@load sales |from warehouse| |as rows| |region West| load@

A @load with no resolvable alias → E_LOAD_FAILED(@load needs an alias). The def is named for the alias unless as renames it.

Security and capture-passing

Security model
RuleBehaviour
--allow-exec requiredwithout it any non-env load throws
unknown aliasno source configured for that alias
child cwdthe document's directory
child envthe merged environment
captures via argvname tokens substituted into run
captures via stdinthe full args object as JSON
non-zero exit or spawn errorsurfaces as E_LOAD_FAILED at the load site

See also

CLI

· Data model · Tables · Errors.