[{"data":1,"prerenderedAt":3335,"buildId":3336},["ShallowReactive",2],{"\u002Fdevelopment\u002Fplugins":3,"\u002Fdevelopment\u002Fplugins-surround":3055,"navigation":3066},{"id":4,"title":5,"body":6,"description":3048,"extension":3049,"meta":3050,"navigation":116,"path":3051,"seo":3052,"stem":3053,"__hash__":3054},"docs\u002F9.development\u002F2.plugins.md","Plugin development",{"type":7,"value":8,"toc":3028},"minimark",[9,18,21,26,67,78,82,160,200,204,211,252,315,319,326,398,446,450,472,576,1105,1109,1125,1153,1194,1198,1221,1226,1295,1327,1331,1511,1879,1882,1907,1945,2072,2096,2099,2109,2142,2318,2321,2339,2371,2496,2499,2515,2548,2610,2614,2682,2685,2697,2798,2801,2823,2843,2847,2856,2897,2911,2936,2940,2969,3018,3024],[10,11,12,13,17],"p",{},"A plugin adds background work to Tessra: jobs that react to events, jobs on a schedule, and file processors that make previews or read details from uploaded files. Image thumbnails are themselves a plugin (",[14,15,16],"code",{},"backend\u002Fplugins\u002FTessra.Plugins.Images","), and they use the same contracts described here.",[10,19,20],{},"Plugins are compiled into the server. They run with the server's full trust, so only add a plugin whose source you have reviewed. Tessra does not download or load plugins at runtime. External workers in other languages are planned separately (PROJECT.md §11).",[22,23,25],"h2",{"id":24},"project-layout","Project layout",[27,28,29,41,48],"ol",{},[30,31,32,33,36,37,40],"li",{},"Create a class library under ",[14,34,35],{},"backend\u002Fplugins\u002F",", for example ",[14,38,39],{},"backend\u002Fplugins\u002FTessra.Plugins.Example\u002F",", targeting the same .NET version as the server.",[30,42,43,44,47],{},"Reference only the contracts: ",[14,45,46],{},"\u003CProjectReference Include=\"..\u002F..\u002FTessra.Plugins\u002FTessra.Plugins.csproj\" \u002F>",". Pin every package to an exact version.",[30,49,50,51,54,55,58,59,62,63,66],{},"Add a reference to your project in ",[14,52,53],{},"backend\u002FTessra.Api\u002FTessra.Api.csproj",", add it to ",[14,56,57],{},"Tessra.slnx",", and add its ",[14,60,61],{},".csproj"," to the restore step in the ",[14,64,65],{},"Dockerfile",".",[10,68,69,70,73,74,77],{},"Tessra finds every ",[14,71,72],{},"ITessraPlugin"," in the libraries that depend on ",[14,75,76],{},"Tessra.Plugins",", so no registration code in the server is needed.",[22,79,81],{"id":80},"the-plugin-class","The plugin class",[83,84,89],"pre",{"className":85,"code":86,"language":87,"meta":88,"style":88},"language-csharp shiki shiki-themes material-theme-lighter github-light github-dark","public sealed class ExamplePlugin : ITessraPlugin\n{\n    public string Id => \"example.hello\";\n\n    public void Configure(ITessraPluginBuilder plugin)\n    {\n        plugin.AddJob\u003CGreetJob>(\"example.hello.greet\", maxAttempts: 3);\n        plugin.OnEvent(TessraEvents.FileUploaded, \"example.hello.greet\");\n        plugin.AddFileProcessor\u003CExampleProcessor>();\n    }\n}\n","csharp","",[14,90,91,99,105,111,118,124,130,136,142,148,154],{"__ignoreMap":88},[92,93,96],"span",{"class":94,"line":95},"line",1,[92,97,98],{},"public sealed class ExamplePlugin : ITessraPlugin\n",[92,100,102],{"class":94,"line":101},2,[92,103,104],{},"{\n",[92,106,108],{"class":94,"line":107},3,[92,109,110],{},"    public string Id => \"example.hello\";\n",[92,112,114],{"class":94,"line":113},4,[92,115,117],{"emptyLinePlaceholder":116},true,"\n",[92,119,121],{"class":94,"line":120},5,[92,122,123],{},"    public void Configure(ITessraPluginBuilder plugin)\n",[92,125,127],{"class":94,"line":126},6,[92,128,129],{},"    {\n",[92,131,133],{"class":94,"line":132},7,[92,134,135],{},"        plugin.AddJob\u003CGreetJob>(\"example.hello.greet\", maxAttempts: 3);\n",[92,137,139],{"class":94,"line":138},8,[92,140,141],{},"        plugin.OnEvent(TessraEvents.FileUploaded, \"example.hello.greet\");\n",[92,143,145],{"class":94,"line":144},9,[92,146,147],{},"        plugin.AddFileProcessor\u003CExampleProcessor>();\n",[92,149,151],{"class":94,"line":150},10,[92,152,153],{},"    }\n",[92,155,157],{"class":94,"line":156},11,[92,158,159],{},"}\n",[161,162,163,170,188,194],"ul",{},[30,164,165,169],{},[166,167,168],"strong",{},"Id"," is lowercase, dot-separated and globally unique. Every job and processor id must start with it.",[30,171,172,175,176,179,180,183,184,187],{},[166,173,174],{},"Configuration"," for the plugin lives under ",[14,177,178],{},"Tessra:Plugins:{Id}"," (in Docker, ",[14,181,182],{},"Tessra__Plugins__example.hello__Setting","). ",[14,185,186],{},"plugin.Configuration"," is that section.",[30,189,190,193],{},[14,191,192],{},"Tessra:Plugins:{Id}:Enabled=false"," turns a plugin off without rebuilding.",[30,195,196,199],{},[14,197,198],{},"plugin.Services"," is the server's service collection, for anything your handlers need.",[22,201,203],{"id":202},"jobs","Jobs",[10,205,206,207,210],{},"A job handler implements ",[14,208,209],{},"IJobHandler",". Handlers are resolved per run from a fresh dependency injection scope.",[83,212,214],{"className":85,"code":213,"language":87,"meta":88,"style":88},"public sealed class GreetJob(ILogger\u003CGreetJob> logger) : IJobHandler\n{\n    public Task RunAsync(JobContext job, CancellationToken ct)\n    {\n        logger.LogInformation(\"Uploaded: {Payload}\", job.Payload);\n        return Task.CompletedTask;\n    }\n}\n",[14,215,216,221,225,230,234,239,244,248],{"__ignoreMap":88},[92,217,218],{"class":94,"line":95},[92,219,220],{},"public sealed class GreetJob(ILogger\u003CGreetJob> logger) : IJobHandler\n",[92,222,223],{"class":94,"line":101},[92,224,104],{},[92,226,227],{"class":94,"line":107},[92,228,229],{},"    public Task RunAsync(JobContext job, CancellationToken ct)\n",[92,231,232],{"class":94,"line":113},[92,233,129],{},[92,235,236],{"class":94,"line":120},[92,237,238],{},"        logger.LogInformation(\"Uploaded: {Payload}\", job.Payload);\n",[92,240,241],{"class":94,"line":126},[92,242,243],{},"        return Task.CompletedTask;\n",[92,245,246],{"class":94,"line":132},[92,247,153],{},[92,249,250],{"class":94,"line":138},[92,251,159],{},[161,253,254,260,270,280,306],{},[30,255,256,259],{},[166,257,258],{},"At least once."," A job can run again after a crash, a timeout or a lost lease. Write handlers so a second run does no harm.",[30,261,262,265,266,269],{},[166,263,264],{},"Failures."," Any exception is retried with a growing delay until the job runs out of attempts, then it shows under Settings > Operations. Throw ",[14,267,268],{},"PermanentJobException"," when retrying can't help, such as invalid input.",[30,271,272,275,276,279],{},[166,273,274],{},"Cancellation."," Honor the ",[14,277,278],{},"CancellationToken",". It fires on timeout (default 10 minutes) and on shutdown. A job stopped by shutdown is requeued without using an attempt.",[30,281,282,285,286,289,290,293,294,297,298,301,302,305],{},[166,283,284],{},"Events."," ",[14,287,288],{},"OnEvent"," queues the job with the event's JSON payload, which includes ",[14,291,292],{},"fileId"," or ",[14,295,296],{},"folderId"," and ",[14,299,300],{},"ownerId",". See ",[14,303,304],{},"TessraEvents"," for the event names.",[30,307,308,285,311,314],{},[166,309,310],{},"Schedules.",[14,312,313],{},"AddRecurringJob(name, interval)"," runs a job every interval, at most once a minute.",[22,316,318],{"id":317},"file-processors","File processors",[10,320,321,322,325],{},"A file processor turns one file into derivatives (such as a thumbnail) and facts (size, date taken). Tessra does the rest: it queues the processor after each upload, retries it, reads the original into a seekable stream, checks and stores the output, applies the file's access rules and lifecycle to derivatives, replaces older output, and processes existing files when the processor is new or its ",[14,323,324],{},"Version"," changes.",[83,327,329],{"className":85,"code":328,"language":87,"meta":88,"style":88},"public sealed class ExampleProcessor : IFileProcessor\n{\n    public string Id => \"example.hello.preview\";\n    public int Version => 1;\n\n    public bool Accepts(ProcessorFile file) => file.MimeType == \"image\u002Fpng\";\n\n    public Task\u003CProcessorResult> ProcessAsync(ProcessorFile file, Stream content, CancellationToken ct)\n    {\n        var result = new ProcessorResult { Facts = new FileFacts(Width: 640, Height: 480) };\n        result.Derivatives.Add(new DerivativeOutput(DerivativeKinds.Thumbnail, \"image\u002Fwebp\", bytes, 320, 240));\n        return Task.FromResult(result);\n    }\n}\n",[14,330,331,336,340,345,350,354,359,363,368,372,377,382,388,393],{"__ignoreMap":88},[92,332,333],{"class":94,"line":95},[92,334,335],{},"public sealed class ExampleProcessor : IFileProcessor\n",[92,337,338],{"class":94,"line":101},[92,339,104],{},[92,341,342],{"class":94,"line":107},[92,343,344],{},"    public string Id => \"example.hello.preview\";\n",[92,346,347],{"class":94,"line":113},[92,348,349],{},"    public int Version => 1;\n",[92,351,352],{"class":94,"line":120},[92,353,117],{"emptyLinePlaceholder":116},[92,355,356],{"class":94,"line":126},[92,357,358],{},"    public bool Accepts(ProcessorFile file) => file.MimeType == \"image\u002Fpng\";\n",[92,360,361],{"class":94,"line":132},[92,362,117],{"emptyLinePlaceholder":116},[92,364,365],{"class":94,"line":138},[92,366,367],{},"    public Task\u003CProcessorResult> ProcessAsync(ProcessorFile file, Stream content, CancellationToken ct)\n",[92,369,370],{"class":94,"line":144},[92,371,129],{},[92,373,374],{"class":94,"line":150},[92,375,376],{},"        var result = new ProcessorResult { Facts = new FileFacts(Width: 640, Height: 480) };\n",[92,378,379],{"class":94,"line":156},[92,380,381],{},"        result.Derivatives.Add(new DerivativeOutput(DerivativeKinds.Thumbnail, \"image\u002Fwebp\", bytes, 320, 240));\n",[92,383,385],{"class":94,"line":384},12,[92,386,387],{},"        return Task.FromResult(result);\n",[92,389,391],{"class":94,"line":390},13,[92,392,153],{},[92,394,396],{"class":94,"line":395},14,[92,397,159],{},[161,399,400,406,424,427,433,436],{},[30,401,402,405],{},[14,403,404],{},"MimeType"," is detected by Tessra from the bytes, never taken from the client.",[30,407,408,409,412,413,297,416,419,420,423],{},"Derivatives are limited to ",[14,410,411],{},"image\u002Fwebp",", ",[14,414,415],{},"image\u002Fpng",[14,417,418],{},"image\u002Fjpeg",", 10 MiB each, one per kind. The ",[14,421,422],{},"thumbnail"," kind is what the library, the inspector, ShareX and share-link previews show. A thumbnail must not carry metadata from the original.",[30,425,426],{},"A processor must never change the original, and must protect itself against hostile input: check pixel counts before decoding, and set limits on anything that can grow.",[30,428,429,430,432],{},"Raise ",[14,431,324],{}," whenever the output changes; files made by an older version are processed again in the background.",[30,434,435],{},"A failed processor never affects the file. The inspector shows that the preview couldn't be made and offers a retry.",[30,437,438,439,442,443,445],{},"To read facts from content that isn't saved yet (an upload going through an intake workflow, a working file), also register an ",[14,440,441],{},"IContentInspector"," as a singleton on ",[14,444,198],{},". It gets a seekable stream and must not dispose it.",[22,447,449],{"id":448},"workflow-nodes","Workflow nodes",[10,451,452,453,456,457,460,461,464,465,66],{},"A workflow node is two classes: a ",[166,454,455],{},"descriptor"," (data the editor and validation read) and an ",[166,458,459],{},"executor"," (the code that runs a step). The built-in nodes are a plugin like any other, in ",[14,462,463],{},"backend\u002Fplugins\u002FTessra.Plugins.Core","; read them for complete examples. The full contract is in ",[466,467,471],"a",{"href":468,"rel":469},"https:\u002F\u002Fgithub.com\u002FBrOstro\u002Ftessra\u002Fblob\u002Fmain\u002Fdocs\u002Fworkflows.md#nodes",[470],"nofollow","workflows.md",[83,473,475],{"className":85,"code":474,"language":87,"meta":88,"style":88},"public void Configure(ITessraPluginBuilder plugin) => plugin.AddNode\u003CUpperNode, UpperExecutor>();\n\npublic sealed class UpperNode : NodeDescriptor\u003CUpperNode.Settings>\n{\n    public sealed record Settings(\n        [property: Setting(\"Text\"), Bindable, Required, MaxLength(1000)] string Text);\n\n    public override string Id => \"example.hello.upper\";\n    public override int Version => 1;\n    public override NodeKind Kind => NodeKind.Transform;\n    public override NodeCategory Category => NodeCategory.AiAndText;\n    public override string Name => \"Uppercase\";\n    public override IReadOnlyList\u003CNodeOutput> Outputs => [new(\"text\", WorkflowType.String)];\n}\n\npublic sealed class UpperExecutor : INodeExecutor\u003CUpperNode.Settings>\n{\n    public Task\u003CNodeResult> ExecuteAsync(NodeContext\u003CUpperNode.Settings> step, CancellationToken ct) =>\n        Task.FromResult(NodeResult.Next(new { text = step.Settings.Text.ToUpperInvariant() }));\n}\n",[14,476,477,482,486,491,495,500,505,509,514,519,524,529,534,539,543,548,554,559,565,571],{"__ignoreMap":88},[92,478,479],{"class":94,"line":95},[92,480,481],{},"public void Configure(ITessraPluginBuilder plugin) => plugin.AddNode\u003CUpperNode, UpperExecutor>();\n",[92,483,484],{"class":94,"line":101},[92,485,117],{"emptyLinePlaceholder":116},[92,487,488],{"class":94,"line":107},[92,489,490],{},"public sealed class UpperNode : NodeDescriptor\u003CUpperNode.Settings>\n",[92,492,493],{"class":94,"line":113},[92,494,104],{},[92,496,497],{"class":94,"line":120},[92,498,499],{},"    public sealed record Settings(\n",[92,501,502],{"class":94,"line":126},[92,503,504],{},"        [property: Setting(\"Text\"), Bindable, Required, MaxLength(1000)] string Text);\n",[92,506,507],{"class":94,"line":132},[92,508,117],{"emptyLinePlaceholder":116},[92,510,511],{"class":94,"line":138},[92,512,513],{},"    public override string Id => \"example.hello.upper\";\n",[92,515,516],{"class":94,"line":144},[92,517,518],{},"    public override int Version => 1;\n",[92,520,521],{"class":94,"line":150},[92,522,523],{},"    public override NodeKind Kind => NodeKind.Transform;\n",[92,525,526],{"class":94,"line":156},[92,527,528],{},"    public override NodeCategory Category => NodeCategory.AiAndText;\n",[92,530,531],{"class":94,"line":384},[92,532,533],{},"    public override string Name => \"Uppercase\";\n",[92,535,536],{"class":94,"line":390},[92,537,538],{},"    public override IReadOnlyList\u003CNodeOutput> Outputs => [new(\"text\", WorkflowType.String)];\n",[92,540,541],{"class":94,"line":395},[92,542,159],{},[92,544,546],{"class":94,"line":545},15,[92,547,117],{"emptyLinePlaceholder":116},[92,549,551],{"class":94,"line":550},16,[92,552,553],{},"public sealed class UpperExecutor : INodeExecutor\u003CUpperNode.Settings>\n",[92,555,557],{"class":94,"line":556},17,[92,558,104],{},[92,560,562],{"class":94,"line":561},18,[92,563,564],{},"    public Task\u003CNodeResult> ExecuteAsync(NodeContext\u003CUpperNode.Settings> step, CancellationToken ct) =>\n",[92,566,568],{"class":94,"line":567},19,[92,569,570],{},"        Task.FromResult(NodeResult.Next(new { text = step.Settings.Text.ToUpperInvariant() }));\n",[92,572,574],{"class":94,"line":573},20,[92,575,159],{},[161,577,578,665,930,939,969,993,1000,1013,1025,1049],{},[30,579,580,583,584,412,587,412,590,297,593,596,597,600,601,604,605,412,608,412,611,297,614,617,618,621,622,297,625,628,629,183,632,635,636,639,640,412,643,297,646,649,650,653,654,657,658,661,662,664],{},[166,581,582],{},"The settings record is the form."," Tessra derives the settings schema from it: ",[14,585,586],{},"Required",[14,588,589],{},"MaxLength",[14,591,592],{},"Range",[14,594,595],{},"RegularExpression"," from ",[14,598,599],{},"System.ComponentModel.DataAnnotations",", and ",[14,602,603],{},"Setting"," (label, help), ",[14,606,607],{},"Bindable",[14,609,610],{},"Advanced",[14,612,613],{},"Multiline",[14,615,616],{},"TextFormat"," from the contracts. ",[14,619,620],{},"TextFormat(TextFormatAttribute.Markdown)"," marks text the step sends as Markdown so the editor offers formatting; set ",[14,623,624],{},"Connection",[14,626,627],{},"Feature"," to use Markdown only when the chosen connection provides that capability feature (Send notification uses ",[14,630,631],{},"Notify.Markdown",[14,633,634],{},"TextFormatAttribute.Json"," gives a monospaced editor. Nullable types may be ",[14,637,638],{},"null","; constructor defaults are the defaults. Use ",[14,641,642],{},"FileRef",[14,644,645],{},"FolderRef",[14,647,648],{},"TagRef"," for library resources, ",[14,651,652],{},"ContentRef"," for a working file, and ",[14,655,656],{},"JsonElement"," for a value of any type (it tells a missing value, ",[14,659,660],{},"Undefined",", from ",[14,663,638],{},").",[30,666,667,670,671,674,675,600,677,679,680,904,907,908,297,911,914,915,917,918,914,921,924,925,927,928,66],{},[166,668,669],{},"Shape the inspector only when the defaults don't fit."," Without hints, the inspector shows content and file inputs first, then the other settings (required ones first), an ",[166,672,673],{},"Outputs"," section built from ",[14,676,673],{},[166,678,610],{},". These optional attributes and overrides change only how settings are shown, never what they accept:",[161,681,682,733,739,753,763,826,838,855,898],{},[30,683,684,687,688,691,692,695,696,700,701,691,704,412,707,710,711,714,715,717,718,721,722,725,726,729,730,66],{},[14,685,686],{},"[Group(\"id\")]"," puts a setting in one of the sections the descriptor lists in ",[14,689,690],{},"Groups"," (",[14,693,694],{},"new SettingGroup(id, label, Collapsible, Help, EmptySummary, Advanced, Columns, AddOptional)","), shown in that order after the ungrouped settings. A collapsible section stays closed until one of its settings has a value, and shows a summary such as ",[697,698,699],"em",{},"3 tags"," or its ",[14,702,703],{},"EmptySummary",[697,705,706],{},"None",[697,708,709],{},"Not shared",") while closed. ",[14,712,713],{},"Advanced: true"," moves the section to the larger editor's ",[166,716,610],{}," tab. ",[14,719,720],{},"Columns: 2"," lays its settings out in pairs in the larger editor, such as a connection and its model; long text, lists and editors still take a whole row. ",[14,723,724],{},"AddOptional: true"," hides optional settings without a value behind ",[166,727,728],{},"Add …"," buttons, as AI steps do for their text and image inputs. Phrase a section's label as the question it answers when that helps, such as ",[697,731,732],{},"What should be classified?",[30,734,735,738],{},[14,736,737],{},"[VisibleWhen(\"other\", value)]"," shows the setting only while another setting has that value. A hidden setting keeps its value.",[30,740,741,744,745,748,749,752],{},[14,742,743],{},"Setting(..., Placeholder = \"...\")"," fills the empty input, such as ",[697,746,747],{},"Keep the content's name","; prefer it to help text that explains an empty value. ",[14,750,751],{},"[PlaceholderWhen(\"other\", value, \"...\")]"," swaps it while another setting has a value.",[30,754,755,758,759,762],{},[14,756,757],{},"[Choice(value, \"Label\", Help = \"...\")]",", once per value, shows a boolean or enum as labeled options. ",[14,760,761],{},"WorkflowKind"," offers an option only in that kind of workflow; a setting left with one option is hidden.",[30,764,765,768,769,412,772,412,775,778,779,412,782,785,786,412,789,412,792,795,796,799,800,803,804,807,808,412,811,412,813,412,816,412,818,821,822,825],{},[14,766,767],{},"[Editor(EditorAttribute.Tags, With = [\"tagNames\"])]"," picks a specialized editor and lets it edit other settings too. Tessra has ",[14,770,771],{},"tags",[14,773,774],{},"ai-model",[14,776,777],{},"ai-decision-model"," (a connection's default decision model), ",[14,780,781],{},"ai-image",[14,783,784],{},"ai-categories"," (a table of ",[14,787,788],{},"id",[14,790,791],{},"label",[14,793,794],{},"description"," items: ids are made from names and kept on rename; ",[14,797,798],{},"With"," can name a boolean shown as a checkbox below it, such as ",[697,801,802],{},"Allow no match","), ",[14,805,806],{},"ai-values"," (a list of ",[14,809,810],{},"key",[14,812,791],{},[14,814,815],{},"type",[14,817,794],{},[14,819,820],{},"required"," items: keys are made from names and kept on rename, with a custom field picker and an example output) and ",[14,823,824],{},"structured-output","; an editor Tessra doesn't know falls back to the default for the setting's type.",[30,827,828,831,832,412,834,837],{},[14,829,830],{},"[Summary]"," marks the settings that say what a step does. The canvas shows their values under the step's name, such as a classify step's category names; a list of objects shows each item's ",[14,833,791],{},[14,835,836],{},"name"," or key. Without it, the canvas shows the first required setting's value.",[30,839,840,843,844,846,847,850,851,854],{},[14,841,842],{},"NodeOutput(name, type, Label: \"...\", Description: \"...\", MayBeEmpty: true, Example: \"0.85\")"," describes an output on the larger editor's ",[166,845,673],{}," tab and in the inspector. ",[14,848,849],{},"MayBeEmpty"," marks outputs that can be null when the step succeeds; ",[14,852,853],{},"Example"," is an illustrative value.",[30,856,857,860,861,864,865,868,869,297,872,875,876,412,878,412,880,297,882,885,886,888,889,892,893,895,896,66],{},[14,858,859],{},"Surface"," picks where the step is configured: ",[14,862,863],{},"Inline"," (the default) in the inspector only, or ",[14,866,867],{},"Expanded",", where the inspector shows a summary of each section with ",[166,870,871],{},"Configure step",[166,873,874],{},"Edit"," buttons, and editing happens in the larger editor's ",[166,877,174],{},[166,879,610],{},[166,881,673],{},[166,883,884],{},"Test"," tabs. Both edit the same draft. Use ",[14,887,867],{}," for steps with list editors or many sections. ",[14,890,891],{},"Both"," keeps the full form in the inspector and adds ",[166,894,871],{},"; prefer ",[14,897,867],{},[30,899,900,903],{},[14,901,902],{},"Description"," is one sentence. The summary sidebar and the larger editor show it under the step's name.",[905,906],"br",{},"Registration fails when a hint names a group the node doesn't declare or a setting it doesn't have, or a group asks for more than two columns. ",[14,909,910],{},"SaveFileNode",[14,912,913],{},"NotifyNode"," in ",[14,916,463],{}," use most of them; ",[14,919,920],{},"AiNodeDescriptor",[14,922,923],{},"backend\u002Fplugins\u002FTessra.Plugins.Ai"," shows ",[14,926,859],{},", the column and optional-input groups, and ",[14,929,830],{},[30,931,932,285,935,938],{},[166,933,934],{},"Start new steps with other settings.",[14,936,937],{},"InitialSettings"," are the settings a step added in the editor starts with. Use them to change what new steps choose without changing saved steps, which keep the record's defaults for settings they don't store. AI classify starts new steps on decision models this way, while saved steps keep language models.",[30,940,941,285,944,946,947,950,951,954,955,691,958,297,961,964,965,968],{},[166,942,943],{},"Help people find the node.",[14,945,902],{}," is shown in the step browser under the name. Override ",[14,948,949],{},"Aliases"," with other names people may search for and ",[14,952,953],{},"Keywords"," with extra search terms; neither is shown. Tessra's own nodes keep these in ",[14,956,957],{},"frontend\u002Fi18n\u002Flocales\u002Fen.json",[14,959,960],{},"automationNodes.\u003Cid>.aliases",[14,962,963],{},".keywords","), which take precedence. Steps from plugins whose id doesn't start with ",[14,966,967],{},"tessra."," show the plugin id in the picker.",[30,970,971,977,978,981,982,985,986,989,990,66],{},[166,972,973,976],{},[14,974,975],{},"[Editor]"," picks a special control"," for a setting the editor would otherwise show as plain text. ",[14,979,980],{},"[Editor(EditorAttribute.AiModel)]"," on a ",[14,983,984],{},"string?"," shows the AI model picker, which reads the connection from the step's ",[14,987,988],{},"ai.chat@1"," connection setting; null or empty means the connection's default model. The schema carries it as ",[14,991,992],{},"x-editor",[30,994,995,999],{},[166,996,429,997],{},[14,998,324],{}," when settings, outputs or ports change in a way saved workflows can't use. Old revisions keep the version they pinned.",[30,1001,1002,1008,1009,1012],{},[166,1003,1004,1005,66],{},"Change files only through ",[14,1006,1007],{},"step.Files"," Each call is fenced by the step's lease and the run's cancellation, locks the file, and is recorded so a retry gets the first result instead of acting twice. Reaching the database directly is a review failure. ",[14,1010,1011],{},"step.Files.ListTagsAsync(only, limit, ct)"," reads the run owner's tags, most used first, optionally only the given ones that still exist; AI suggest tags uses it to offer tags to the model.",[30,1014,1015,1021,1022,66],{},[166,1016,1017,1018,66],{},"Fail with ",[14,1019,1020],{},"NodeException(code, message, retryable)"," Other exceptions are retried unless the node declares ",[14,1023,1024],{},"RetrySafety.Unsafe",[30,1026,1027,691,1030,1033,1034,1036,1037,1040,1041,1044,1045,1048],{},[166,1028,1029],{},"Content nodes",[14,1031,1032],{},"NodeKind.Content",") take a ",[14,1035,652],{}," setting (bindable) and return a new one. Read with ",[14,1038,1039],{},"step.Content.OpenReadAsync"," and write with ",[14,1042,1043],{},"step.Content.CreateAsync(name, write)","; never change the input, and return the input's reference when there is nothing to do. Tessra detects the new file's type and enforces the run's working limits. ",[14,1046,1047],{},"backend\u002Fplugins\u002FTessra.Plugins.Images\u002FImageNodes.cs"," has examples.",[30,1050,1051,1052,412,1055,1058,1059,803,1062,293,1065,1068,1069,293,1072,1075,1076,1079,1080,1083,1084,412,1087,412,1090,412,1093,412,1096,412,1099,297,1102,1104],{},"Return ",[14,1053,1054],{},"NodeResult.Next(outputs)",[14,1056,1057],{},"NodeResult.ToPort(port, outputs)"," for nodes with several ports (override ",[14,1060,1061],{},"PortsFor",[14,1063,1064],{},"NodeResult.Wait(until)",[14,1066,1067],{},"NodeResult.Stop(reason)",". Outputs must be declared and are at most 64 KiB. When a test run gives an ",[14,1070,1071],{},"ExternalProcessing",[14,1073,1074],{},"ExternalMutation"," node placeholder outputs instead of running it, it continues on ",[14,1077,1078],{},"PlaceholderPort(settings)",", the first port by default; AI detect overrides it to take ",[14,1081,1082],{},"unsure",". The editor labels the ports ",[14,1085,1086],{},"true",[14,1088,1089],{},"false",[14,1091,1092],{},"default",[14,1094,1095],{},"error",[14,1097,1098],{},"yes",[14,1100,1101],{},"no",[14,1103,1082],{},"; others show their name.",[22,1106,1108],{"id":1107},"workflow-templates","Workflow templates",[10,1110,1111,1112,1116,1117,1120,1121,1124],{},"A plugin can offer ",[466,1113,1115],{"href":1114},"\u002Fautomations\u002Ftemplates","workflow templates"," under ",[166,1118,1119],{},"New workflow"," › ",[166,1122,1123],{},"From a template",". Register each template document, usually an embedded JSON file:",[83,1126,1128],{"className":85,"code":1127,"language":87,"meta":88,"style":88},"public void Configure(ITessraPluginBuilder plugin)\n{\n    using var reader = new StreamReader(typeof(HelloPlugin).Assembly.GetManifestResourceStream(\"templates\u002Fupper.json\")!);\n    plugin.AddWorkflowTemplate(reader.ReadToEnd());\n}\n",[14,1129,1130,1135,1139,1144,1149],{"__ignoreMap":88},[92,1131,1132],{"class":94,"line":95},[92,1133,1134],{},"public void Configure(ITessraPluginBuilder plugin)\n",[92,1136,1137],{"class":94,"line":101},[92,1138,104],{},[92,1140,1141],{"class":94,"line":107},[92,1142,1143],{},"    using var reader = new StreamReader(typeof(HelloPlugin).Assembly.GetManifestResourceStream(\"templates\u002Fupper.json\")!);\n",[92,1145,1146],{"class":94,"line":113},[92,1147,1148],{},"    plugin.AddWorkflowTemplate(reader.ReadToEnd());\n",[92,1150,1151],{"class":94,"line":120},[92,1152,159],{},[161,1154,1155,1169,1172,1184],{},[30,1156,1157,1158,1162,1163,1165,1166,66],{},"The document is the ",[466,1159,1161],{"href":1160},"\u002Fautomations\u002Ftemplates#the-template-format","template format"," with an ",[14,1164,788],{}," that starts with the plugin id, such as ",[14,1167,1168],{},"example.hello.upper-names",[30,1170,1171],{},"Tessra checks it at startup: a malformed template, one whose placeholders name undeclared resources or the wrong type, or one that holds an id fails startup. A template whose steps come from a plugin that isn't installed or is turned off is listed as unavailable instead.",[30,1173,1174,1175,691,1177,297,1180,1183],{},"Tessra's own templates translate their name and description in ",[14,1176,957],{},[14,1178,1179],{},"workflowTemplates.\u003Cid>.name",[14,1181,1182],{},".description","); others show the document's English text.",[30,1185,1186,1189,1190,1193],{},[14,1187,1188],{},"backend\u002Fplugins\u002FTessra.Plugins.Ai\u002FTemplates"," holds the built-in AI templates, and ",[14,1191,1192],{},"AiWorkflowTemplateTests"," runs each one end to end against fake AI servers.",[22,1195,1197],{"id":1196},"connections","Connections",[10,1199,1200,1201,1204,1205,1208,1209,1213,1214,297,1217,1220],{},"A connection is an outside service a user sets up once (a webhook, a Discord channel, an AI provider). Nodes never take a URL or a key; they take a connection and ask it for a ",[166,1202,1203],{},"capability",", an interface such as ",[14,1206,1207],{},"INotifyClient",". Connection types implement capabilities, so a new notification service is one connection type and every notify node can use it. The design is in ",[466,1210,471],{"href":1211,"rel":1212},"https:\u002F\u002Fgithub.com\u002FBrOstro\u002Ftessra\u002Fblob\u002Fmain\u002Fdocs\u002Fworkflows.md#connections",[470],"; ",[14,1215,1216],{},"backend\u002Fplugins\u002FTessra.Plugins.Discord",[14,1218,1219],{},"Tessra.Plugins.Http"," are complete examples, and they use only these public contracts. The contract is experimental (version 1) until 1.0. Compiled-in plugins are trusted code: these rules keep them correct, they don't sandbox them.",[1222,1223,1225],"h3",{"id":1224},"capabilities","Capabilities",[10,1227,1228,1229,1232,1233,1236,1237,1240,1241,1244,1245,1247,1248,803,1251,1247,1254,803,1257,1259,1260,803,1264,1259,1267,803,1271,1259,1274,1278,1279,1259,1282,1286,1287,1290,1291,1294],{},"A capability is an id, a major version and a client interface, with optional ",[166,1230,1231],{},"features"," a connection may or may not have. Its identity is the versioned key ",[14,1234,1235],{},"id@version",", such as ",[14,1238,1239],{},"notify@1",", and everything is keyed by it: provided capabilities, a connection's features, feature checks and ",[14,1242,1243],{},"[Connection]"," settings. Core defines ",[14,1246,1239],{}," (feature ",[14,1249,1250],{},"attachments",[14,1252,1253],{},"http@1",[14,1255,1256],{},"deduplicates",[14,1258,988],{}," (see ",[466,1261,1263],{"href":1262},"#ai-chat","AI chat",[14,1265,1266],{},"ai.decide@1",[466,1268,1270],{"href":1269},"#ai-decisions","AI decisions",[14,1272,1273],{},"ai.extract@1",[466,1275,1277],{"href":1276},"#ai-extraction","AI extraction",") and ",[14,1280,1281],{},"ocr@1",[466,1283,1285],{"href":1284},"#ocr","OCR",") in ",[14,1288,1289],{},"Tessra.Plugins.Capabilities",". A plugin can add its own with ",[14,1292,1293],{},"plugin.AddCapability\u003CMyCapability>()","; its id must start with the plugin id.",[161,1296,1297,1300,1306,1309,1316],{},[30,1298,1299],{},"A breaking change to the client interface is a new version, registered next to the old one. Nodes and connection types move over independently.",[30,1301,1302,1303,1305],{},"Startup fails when two capabilities share a key or a client interface, a client type isn't an interface, a feature id repeats or isn't lowercase, a connection type provides a capability twice or provides one (or a feature) that isn't registered, or a node's ",[14,1304,1243],{}," setting asks for a capability or feature nobody registered.",[30,1307,1308],{},"Generic request and response types belong to the capability, never to a vendor SDK. Limits that belong to one service (Discord's 2,000 characters) stay in its connection type.",[30,1310,1311,1312,1315],{},"One client call is one delivery. A client never shortens, splits or drops part of what it was given; when the service can't take it whole, it fails with ",[14,1313,1314],{},"input_invalid"," before sending, saying what to change.",[30,1317,1318,1319,1322,1323,1326],{},"A capability can implement ",[14,1320,1321],{},"SendTestAsync"," for the user's ",[166,1324,1325],{},"Send test message",". Testing a connection never calls it.",[1222,1328,1330],{"id":1329},"connection-types","Connection types",[83,1332,1334],{"className":85,"code":1333,"language":87,"meta":88,"style":88},"public void Configure(ITessraPluginBuilder plugin) => plugin.AddConnectionType\u003CPagerConnection, PagerConnectionType>();\n\npublic sealed class PagerConnection : ConnectionTypeDescriptor\u003CPagerConnection.Settings>\n{\n    public sealed record Settings(\n        [property: Setting(\"Token\"), Required, Secret, MaxLength(200)] string Token);\n\n    public override string Id => \"example.pager.webhook\";\n    public override string Name => \"Pager\";\n    public override IReadOnlyList\u003CProvidedCapability> Provides => [new(Notify.CapabilityId, Notify.CapabilityVersion)];\n\n    protected override Uri? EndpointOf(Settings settings) => new(\"https:\u002F\u002Fpager.example.com\");\n}\n\npublic sealed class PagerConnectionType : IConnectionType\u003CPagerConnection.Settings>\n{\n    public object CreateClient(ConnectionContext\u003CPagerConnection.Settings> connection, Capability capability) => new Client(connection);\n\n    public async Task\u003CConnectionTestResult> TestAsync(ConnectionContext\u003CPagerConnection.Settings> connection, CancellationToken ct)\n    {\n        using var response = await connection.Http.GetAsync(\"https:\u002F\u002Fpager.example.com\u002Fme\", ct);\n        return new ConnectionTestResult([new(ConnectionChecks.Auth, \"Token\", response.IsSuccessStatusCode ? CheckStatus.Passed : CheckStatus.Failed)]);\n    }\n\n    private sealed class Client(ConnectionContext\u003CPagerConnection.Settings> connection) : INotifyClient\n    {\n        public async Task\u003CNotifyResult> SendAsync(Notification notification, CancellationToken ct)\n        {\n            using var request = new HttpRequestMessage(HttpMethod.Post, \"https:\u002F\u002Fpager.example.com\u002Fsend\") { Content = JsonContent.Create(new { text = notification.Text }) };\n            request.Headers.Authorization = new(\"Bearer\", connection.Settings.Token);\n            using var response = await Outbound.SendAsync(connection.Http, request, ct);\n            return new NotifyResult((await Outbound.ReadJsonAsync(response, 16 * 1024, ct))?[\"id\"]?.ToString());\n        }\n    }\n}\n",[14,1335,1336,1341,1345,1350,1354,1358,1363,1367,1372,1377,1382,1386,1391,1395,1399,1404,1408,1413,1417,1422,1426,1432,1438,1443,1448,1454,1459,1465,1471,1477,1483,1489,1495,1501,1506],{"__ignoreMap":88},[92,1337,1338],{"class":94,"line":95},[92,1339,1340],{},"public void Configure(ITessraPluginBuilder plugin) => plugin.AddConnectionType\u003CPagerConnection, PagerConnectionType>();\n",[92,1342,1343],{"class":94,"line":101},[92,1344,117],{"emptyLinePlaceholder":116},[92,1346,1347],{"class":94,"line":107},[92,1348,1349],{},"public sealed class PagerConnection : ConnectionTypeDescriptor\u003CPagerConnection.Settings>\n",[92,1351,1352],{"class":94,"line":113},[92,1353,104],{},[92,1355,1356],{"class":94,"line":120},[92,1357,499],{},[92,1359,1360],{"class":94,"line":126},[92,1361,1362],{},"        [property: Setting(\"Token\"), Required, Secret, MaxLength(200)] string Token);\n",[92,1364,1365],{"class":94,"line":132},[92,1366,117],{"emptyLinePlaceholder":116},[92,1368,1369],{"class":94,"line":138},[92,1370,1371],{},"    public override string Id => \"example.pager.webhook\";\n",[92,1373,1374],{"class":94,"line":144},[92,1375,1376],{},"    public override string Name => \"Pager\";\n",[92,1378,1379],{"class":94,"line":150},[92,1380,1381],{},"    public override IReadOnlyList\u003CProvidedCapability> Provides => [new(Notify.CapabilityId, Notify.CapabilityVersion)];\n",[92,1383,1384],{"class":94,"line":156},[92,1385,117],{"emptyLinePlaceholder":116},[92,1387,1388],{"class":94,"line":384},[92,1389,1390],{},"    protected override Uri? EndpointOf(Settings settings) => new(\"https:\u002F\u002Fpager.example.com\");\n",[92,1392,1393],{"class":94,"line":390},[92,1394,159],{},[92,1396,1397],{"class":94,"line":395},[92,1398,117],{"emptyLinePlaceholder":116},[92,1400,1401],{"class":94,"line":545},[92,1402,1403],{},"public sealed class PagerConnectionType : IConnectionType\u003CPagerConnection.Settings>\n",[92,1405,1406],{"class":94,"line":550},[92,1407,104],{},[92,1409,1410],{"class":94,"line":556},[92,1411,1412],{},"    public object CreateClient(ConnectionContext\u003CPagerConnection.Settings> connection, Capability capability) => new Client(connection);\n",[92,1414,1415],{"class":94,"line":561},[92,1416,117],{"emptyLinePlaceholder":116},[92,1418,1419],{"class":94,"line":567},[92,1420,1421],{},"    public async Task\u003CConnectionTestResult> TestAsync(ConnectionContext\u003CPagerConnection.Settings> connection, CancellationToken ct)\n",[92,1423,1424],{"class":94,"line":573},[92,1425,129],{},[92,1427,1429],{"class":94,"line":1428},21,[92,1430,1431],{},"        using var response = await connection.Http.GetAsync(\"https:\u002F\u002Fpager.example.com\u002Fme\", ct);\n",[92,1433,1435],{"class":94,"line":1434},22,[92,1436,1437],{},"        return new ConnectionTestResult([new(ConnectionChecks.Auth, \"Token\", response.IsSuccessStatusCode ? CheckStatus.Passed : CheckStatus.Failed)]);\n",[92,1439,1441],{"class":94,"line":1440},23,[92,1442,153],{},[92,1444,1446],{"class":94,"line":1445},24,[92,1447,117],{"emptyLinePlaceholder":116},[92,1449,1451],{"class":94,"line":1450},25,[92,1452,1453],{},"    private sealed class Client(ConnectionContext\u003CPagerConnection.Settings> connection) : INotifyClient\n",[92,1455,1457],{"class":94,"line":1456},26,[92,1458,129],{},[92,1460,1462],{"class":94,"line":1461},27,[92,1463,1464],{},"        public async Task\u003CNotifyResult> SendAsync(Notification notification, CancellationToken ct)\n",[92,1466,1468],{"class":94,"line":1467},28,[92,1469,1470],{},"        {\n",[92,1472,1474],{"class":94,"line":1473},29,[92,1475,1476],{},"            using var request = new HttpRequestMessage(HttpMethod.Post, \"https:\u002F\u002Fpager.example.com\u002Fsend\") { Content = JsonContent.Create(new { text = notification.Text }) };\n",[92,1478,1480],{"class":94,"line":1479},30,[92,1481,1482],{},"            request.Headers.Authorization = new(\"Bearer\", connection.Settings.Token);\n",[92,1484,1486],{"class":94,"line":1485},31,[92,1487,1488],{},"            using var response = await Outbound.SendAsync(connection.Http, request, ct);\n",[92,1490,1492],{"class":94,"line":1491},32,[92,1493,1494],{},"            return new NotifyResult((await Outbound.ReadJsonAsync(response, 16 * 1024, ct))?[\"id\"]?.ToString());\n",[92,1496,1498],{"class":94,"line":1497},33,[92,1499,1500],{},"        }\n",[92,1502,1504],{"class":94,"line":1503},34,[92,1505,153],{},[92,1507,1509],{"class":94,"line":1508},35,[92,1510,159],{},[161,1512,1513,1527,1544,1616,1636,1657,1681,1730,1830,1850],{},[30,1514,1515,1518,1519,1522,1523,1526],{},[166,1516,1517],{},"Settings work like node settings",", plus ",[14,1520,1521],{},"[Secret]",": secret values are encrypted at rest, never sent back to the browser, and redacted from test results, step errors and outputs. ",[14,1524,1525],{},"EndpointOf"," is shown to the user as where data goes; never put a secret in it.",[30,1528,1529,1532,1533,1536,1537,1540,1541,1543],{},[166,1530,1531],{},"Settings have their own version."," Raise ",[14,1534,1535],{},"SettingsVersion"," when stored settings need changing to bind, and turn older ones into current ones in ",[14,1538,1539],{},"MigrateSettings"," (secrets included, as plain values). Tessra migrates a connection the first time it's used and stores the result; when ",[14,1542,1539],{}," returns null, or the stored version is newer, the user is asked to enter the settings again. This is independent of capability versions.",[30,1545,1546,1549,1550,1553,1554,1557,1558,691,1561,412,1564,412,1567,412,1570,412,1573,412,1576,412,1579,1582,1583,1586,1587,1590,1591,1594,1595,1597,1598,1600,1601,1604,1605,1607,1608,1611,1612,1615],{},[166,1547,1548],{},"How the service is listed."," The add-connection dialog builds its catalog from descriptors and presets, so a plugin's types appear with no frontend change. A type with presets is listed once per preset; a type without presets is listed itself (override ",[14,1551,1552],{},"Listed"," to list both). Set ",[14,1555,1556],{},"Category"," to one of ",[14,1559,1560],{},"ConnectionCategories",[14,1562,1563],{},"ai-local",[14,1565,1566],{},"ai-hosted",[14,1568,1569],{},"ai-gateway",[14,1571,1572],{},"ai-custom",[14,1574,1575],{},"notifications",[14,1577,1578],{},"webhooks",[14,1580,1581],{},"other",") or an id of your own, ",[14,1584,1585],{},"Logo"," to an icon name such as ",[14,1588,1589],{},"i-simple-icons-discord"," (only properly licensed logos; otherwise a Lucide icon), ",[14,1592,1593],{},"SetupUrl"," to where users get credentials, and ",[14,1596,953],{}," for search. Presets take the same properties, plus ",[14,1599,610],{}," (settings shown under Advanced for this preset, such as a hosted provider's fixed address), ",[14,1602,1603],{},"Primary"," (advanced settings shown with the main ones) and ",[14,1606,586],{}," (optional settings this preset can't work without, checked when adding). ",[14,1609,1610],{},"[Setting(Placeholder = ...)]"," names what an empty setting means, such as ",[697,1613,1614],{},"Model default",". Users never see the type's id.",[30,1617,1618,285,1621,1624,1625,1628,1629,1632,1633,66],{},[166,1619,1620],{},"Unsaved settings.",[14,1622,1623],{},"POST \u002Fapi\u002Fv1\u002Fconnections\u002Fdraft\u002Ftest"," and, for AI types, ",[14,1626,1627],{},"\u002Fdraft\u002Fmodels"," run the type's test or model listing on settings that aren't saved, through the same guarded client. They store nothing; a new connection's requests aren't counted, and a saved connection's (",[14,1630,1631],{},"connectionId",") count towards it as usual. Users can also shorten a connection's timeout below the type's ",[14,1634,1635],{},"Timeout",[30,1637,1638,1641,1642,1645,1646,1649,1650,1653,1654,1656],{},[166,1639,1640],{},"Origins."," A connection sends only to ",[14,1643,1644],{},"OriginsOf(settings)",", by default its endpoint's origin, on every request, redirect and ",[14,1647,1648],{},"ReachAsync",". Override it when a service spans several origins. An empty list sends nowhere; it never means \"anywhere\". A type that really may send anywhere sets ",[14,1651,1652],{},"AnyOrigin => true",", and only a type without ",[14,1655,1521],{}," settings may: startup fails otherwise.",[30,1658,1659,1665,1666,1669,1670,1673,1674,1676,1677,1680],{},[166,1660,1661,1662,66],{},"Use only ",[14,1663,1664],{},"connection.Http"," It is the guarded outbound client: public addresses only (unless an admin allowed private networks for the connection), checked again on every connect; the connection's origins; no proxies; HTTP\u002F1.1; at most 3 redirects; requests up to ",[14,1667,1668],{},"MaxRequestBytes"," (default 256 KiB, at most 32 MiB); responses up to ",[14,1671,1672],{},"MaxResponseBytes"," (default 1 MiB, at most 16 MiB); the type's ",[14,1675,1635],{}," (default 10 s, at most 5 minutes), one deadline that also covers reading the response body; and the connection's usage limits, counting every request, retries and probes included. Sizes count the bytes actually sent and received; a declared ",[14,1678,1679],{},"Content-Length"," only lets Tessra refuse earlier.",[30,1682,1683,285,1686,1689,1690,1693,1694,1696,1697,1700,1701,412,1704,412,1707,600,1710,1713,1714,1717,1718,1721,1722,1725,1726,1729],{},[166,1684,1685],{},"Testing never changes anything outside.",[14,1687,1688],{},"TestAsync"," must not send anything a receiver could act on; use ",[14,1691,1692],{},"connection.ReachAsync(address)"," to only open a connection. It follows the same origins, address and DNS rules, private-network setting and timeout as ",[14,1695,1664],{},". Report each part with the ",[14,1698,1699],{},"ConnectionChecks"," ids (",[14,1702,1703],{},"reachable",[14,1705,1706],{},"auth",[14,1708,1709],{},"model",[14,1711,1712],{},"ConnectionChecks.Feature(capability, feature)",", which gives ",[14,1715,1716],{},"feature:http@1\u002Fdeduplicates","). Mark capability probes ",[14,1719,1720],{},"Optional",". Only required checks decide the result: an empty test, or a skipped required check, is ",[697,1723,1724],{},"unverified",", never a pass. Return ",[14,1727,1728],{},"DetectedFeatures",", keyed by capability key, for features the test found.",[30,1731,1732,1735,1736,1739,1740,1743,1744,1762,1764,1765,1768,1769],{},[166,1733,1734],{},"Token budgets are reservations."," Before a request that uses tokens, ",[14,1737,1738],{},"await connection.Usage.ReserveTokensAsync(estimate)"," charges the estimate against the day's budget in one conditional database statement, so concurrent steps can't overshoot it, and fails with ",[14,1741,1742],{},"connection_limit_reached"," (the step waits) when it doesn't fit. Then call one of:",[161,1745,1746,1752],{},[30,1747,1748,1751],{},[14,1749,1750],{},"SettleAsync(input, output)"," with the provider's counts. A count it didn't report keeps the estimate charged and is shown as unknown.",[30,1753,1754,1757,1758,1761],{},[14,1755,1756],{},"ReleaseAsync()"," only when the request wasn't sent (",[14,1759,1760],{},"ExternalOutcome.NotSent","). It gives the estimate back.",[905,1763],{},"Only the first call counts, and it applies to the day the reservation was made, even after midnight. A reservation left open, or for a request whose outcome is ",[14,1766,1767],{},"Uncertain",", stays charged at the estimate. Every call reserves, retries and repairs included.",[83,1770,1772],{"className":85,"code":1771,"language":87,"meta":88,"style":88},"var reservation = await connection.Usage.ReserveTokensAsync(estimate, ct);\ntry\n{\n    using var response = await Outbound.SendAsync(connection.Http, request, ct);\n    var usage = Usage(await Outbound.ReadJsonAsync(response, MaxBytes, ct));\n    await reservation.SettleAsync(usage.Input, usage.Output, ct);\n}\ncatch (NodeException e) when (e.Outcome == ExternalOutcome.NotSent)\n{\n    await reservation.ReleaseAsync(ct);\n    throw;\n}\n",[14,1773,1774,1779,1784,1788,1793,1798,1803,1807,1812,1816,1821,1826],{"__ignoreMap":88},[92,1775,1776],{"class":94,"line":95},[92,1777,1778],{},"var reservation = await connection.Usage.ReserveTokensAsync(estimate, ct);\n",[92,1780,1781],{"class":94,"line":101},[92,1782,1783],{},"try\n",[92,1785,1786],{"class":94,"line":107},[92,1787,104],{},[92,1789,1790],{"class":94,"line":113},[92,1791,1792],{},"    using var response = await Outbound.SendAsync(connection.Http, request, ct);\n",[92,1794,1795],{"class":94,"line":120},[92,1796,1797],{},"    var usage = Usage(await Outbound.ReadJsonAsync(response, MaxBytes, ct));\n",[92,1799,1800],{"class":94,"line":126},[92,1801,1802],{},"    await reservation.SettleAsync(usage.Input, usage.Output, ct);\n",[92,1804,1805],{"class":94,"line":132},[92,1806,159],{},[92,1808,1809],{"class":94,"line":138},[92,1810,1811],{},"catch (NodeException e) when (e.Outcome == ExternalOutcome.NotSent)\n",[92,1813,1814],{"class":94,"line":144},[92,1815,104],{},[92,1817,1818],{"class":94,"line":150},[92,1819,1820],{},"    await reservation.ReleaseAsync(ct);\n",[92,1822,1823],{"class":94,"line":156},[92,1824,1825],{},"    throw;\n",[92,1827,1828],{"class":94,"line":384},[92,1829,159],{},[30,1831,1832,1835,1836,1839,1840,1842,1843,1846,1847,1849],{},[166,1833,1834],{},"Capabilities that depend on settings."," A connection offers a capability its type provides only while ",[14,1837,1838],{},"FeaturesOf(settings)"," includes its key. Leave the key out when the settings say the service lacks it, as the OpenAI-compatible type offers ",[14,1841,1266],{}," only when ",[166,1844,1845],{},"Decision models"," names an API. Steps, the editor and the add-connection dialog all follow what each connection, or preset, offers. Stored connections get new keys when their settings are saved or migrated, so raise ",[14,1848,1535],{}," when a change affects which capabilities existing connections offer.",[30,1851,1852,1855,1856,1858,1859,1862,1863,691,1866,412,1869,412,1872,412,1875,1878],{},[166,1853,1854],{},"Presets"," fill in settings for a known service. Override ",[14,1857,1854],{}," with ",[14,1860,1861],{},"ConnectionPreset(id, name, description, icon, settings, hosting) { DocsPath = \"\u002F...\" }","; the dialog offers them when the type is chosen, and the connection stores the preset id. Settings may only name the type's own settings and never a secret; ids are lowercase and unique within the type. ",[14,1864,1865],{},"ConnectionHosting",[14,1867,1868],{},"Local",[14,1870,1871],{},"SelfHosted",[14,1873,1874],{},"Hosted",[14,1876,1877],{},"Gateway",") is informational only: the dialog shows it next to the connection's real address, and nothing in Tessra relies on it.",[1222,1880,1263],{"id":1881},"ai-chat",[10,1883,1884,691,1886,914,1889,1891,1892,412,1895,412,1897,412,1900,297,1903,1906],{},[14,1885,988],{},[14,1887,1888],{},"AiChat",[14,1890,1289],{},") is the capability AI steps use. Its features are ",[14,1893,1894],{},"images",[14,1896,824],{},[14,1898,1899],{},"json-mode",[14,1901,1902],{},"temperature",[14,1904,1905],{},"model-list","; a connection type provides the ones its API can do, and each model may still lack them.",[83,1908,1910],{"className":85,"code":1909,"language":87,"meta":88,"style":88},"public interface IAiChatClient\n{\n    AiDefaults Defaults { get; }                               \u002F\u002F the connection's default model, temperature and limits, with its revision\n    Task\u003CIReadOnlyList\u003CAiModel>> ListModelsAsync(CancellationToken ct);\n    IReadOnlyList\u003CAiModelFeature> Infer(string model);         \u002F\u002F what the model's name suggests, for models the list doesn't describe\n    Task\u003CAiChatResponse> CompleteAsync(AiChatRequest request, CancellationToken ct);\n}\n",[14,1911,1912,1917,1921,1926,1931,1936,1941],{"__ignoreMap":88},[92,1913,1914],{"class":94,"line":95},[92,1915,1916],{},"public interface IAiChatClient\n",[92,1918,1919],{"class":94,"line":101},[92,1920,104],{},[92,1922,1923],{"class":94,"line":107},[92,1924,1925],{},"    AiDefaults Defaults { get; }                               \u002F\u002F the connection's default model, temperature and limits, with its revision\n",[92,1927,1928],{"class":94,"line":113},[92,1929,1930],{},"    Task\u003CIReadOnlyList\u003CAiModel>> ListModelsAsync(CancellationToken ct);\n",[92,1932,1933],{"class":94,"line":120},[92,1934,1935],{},"    IReadOnlyList\u003CAiModelFeature> Infer(string model);         \u002F\u002F what the model's name suggests, for models the list doesn't describe\n",[92,1937,1938],{"class":94,"line":126},[92,1939,1940],{},"    Task\u003CAiChatResponse> CompleteAsync(AiChatRequest request, CancellationToken ct);\n",[92,1942,1943],{"class":94,"line":132},[92,1944,159],{},[161,1946,1947,1983,2015,2036,2066],{},[30,1948,1949,1956,1957,412,1960,803,1963,1966,1967,1970,1971,1974,1975,1978,1979,1982],{},[166,1950,1951,1952,1955],{},"One ",[14,1953,1954],{},"CompleteAsync"," is one request."," The request has the model, instructions, input parts (",[14,1958,1959],{},"AiPart.Text",[14,1961,1962],{},"AiPart.Image",[14,1964,1965],{},"AiGeneration"," (max output tokens, optional temperature) and an optional ",[14,1968,1969],{},"AiOutputFormat"," with a JSON Schema and a mode: ",[14,1972,1973],{},"Native"," (the provider enforces the schema), ",[14,1976,1977],{},"JsonMode"," (the provider guarantees JSON) or ",[14,1980,1981],{},"Prompted"," (neither). The client sends what it's given and never adds the schema to the instructions; callers do that for the weaker modes and always validate the answer.",[30,1984,1985,1988,1989,691,1992,412,1995,412,1998,412,2001,412,2004,803,2007,2010,2011,2014],{},[166,1986,1987],{},"Responses"," give the text, ",[14,1990,1991],{},"AiFinish",[14,1993,1994],{},"Complete",[14,1996,1997],{},"Length",[14,1999,2000],{},"Refused",[14,2002,2003],{},"Filtered",[14,2005,2006],{},"Other",[14,2008,2009],{},"AiUsage"," with the provider's token counts (null when not reported), the model that answered and, behind a gateway, ",[14,2012,2013],{},"ServedBy"," when the gateway says which provider served it. Map reasoning or thinking parts out of the text and count their tokens as output.",[30,2016,2017,2020,2021,2024,2025,2029,2030,412,2033,66],{},[166,2018,2019],{},"Reserve tokens"," for every request with ",[14,2022,2023],{},"AiTokens.Estimate(body, input, maxOutput)"," before sending and settle with the provider's counts, as in ",[466,2026,2028],{"href":2027},"#connection-types","Token budgets",". A model the provider doesn't know (404) fails with ",[14,2031,2032],{},"ai_model_unavailable",[14,2034,2035],{},"Rejected",[30,2037,2038,2041,2042,2045,2046,2049,2050,2053,2054,2057,2058,2061,2062,2065],{},[166,2039,2040],{},"Model lists"," return ",[14,2043,2044],{},"AiModel(id) { Name, ContextTokens, MaxOutputTokens, Features }",". Put a feature in ",[14,2047,2048],{},"Features"," only when the provider's list says so (",[14,2051,2052],{},"AiFeatureSource.Provider","); ",[14,2055,2056],{},"Infer"," returns guesses (",[14,2059,2060],{},"Inferred","). Tessra stores the list per connection, keeps the last good one when a refresh fails, and merges inferred, provider, tested and user values in that order. Steps ask ",[14,2063,2064],{},"IAiModels.FindAsync"," for the merged view.",[30,2067,2068,2069,2071],{},"A type without a model list (",[14,2070,1905],{}," not provided) still works: users type model names.",[10,2073,2074,2076,2077,2080,2081,2084,2085,2088,2089,2092,2093,664],{},[14,2075,923],{}," has three complete adapters (OpenAI-compatible, Anthropic, Gemini) and the AI nodes. In nodes, ",[14,2078,2079],{},"AiRunner.StartAsync"," resolves the client, model and features; ",[14,2082,2083],{},"AiSession.CompleteJsonAsync"," asks for a JSON answer and checks it against a schema, and ",[14,2086,2087],{},"AiSession.CompleteTextAsync"," asks for free text, as the describe, summarize and generate text nodes do (their runs record ",[14,2090,2091],{},"outputMode"," as ",[14,2094,2095],{},"text",[1222,2097,1270],{"id":2098},"ai-decisions",[10,2100,2101,691,2103,2106,2107,66],{},[14,2102,1266],{},[14,2104,2105],{},"AiDecide",") asks a decision model typed questions and returns probabilities instead of text. Its one feature is ",[14,2108,1894],{},[83,2110,2112],{"className":85,"code":2111,"language":87,"meta":88,"style":88},"public interface IAiDecisionClient\n{\n    AiDefaults Defaults { get; }                               \u002F\u002F the connection's default decision model, with its revision\n    IReadOnlyList\u003CAiModelFeature> Infer(string model);\n    Task\u003CAiDecisionResponse> DecideAsync(AiDecisionRequest request, CancellationToken ct);\n}\n",[14,2113,2114,2119,2123,2128,2133,2138],{"__ignoreMap":88},[92,2115,2116],{"class":94,"line":95},[92,2117,2118],{},"public interface IAiDecisionClient\n",[92,2120,2121],{"class":94,"line":101},[92,2122,104],{},[92,2124,2125],{"class":94,"line":107},[92,2126,2127],{},"    AiDefaults Defaults { get; }                               \u002F\u002F the connection's default decision model, with its revision\n",[92,2129,2130],{"class":94,"line":113},[92,2131,2132],{},"    IReadOnlyList\u003CAiModelFeature> Infer(string model);\n",[92,2134,2135],{"class":94,"line":120},[92,2136,2137],{},"    Task\u003CAiDecisionResponse> DecideAsync(AiDecisionRequest request, CancellationToken ct);\n",[92,2139,2140],{"class":94,"line":126},[92,2141,159],{},[161,2143,2144,2185,2197,2265,2308],{},[30,2145,2146,2149,2150,2153,2154,2157,2158,2161,2162,2165,2166,2149,2169,2172,2173,2176,2177,2180,2181,2184],{},[166,2147,2148],{},"Questions"," are ",[14,2151,2152],{},"AiQuestion.Predicate"," (yes or no), ",[14,2155,2156],{},"AiQuestion.Choice"," (1 to 255 ",[14,2159,2160],{},"AiOption","s) and ",[14,2163,2164],{},"AiQuestion.Score"," (2 to 10 ordered levels, lowest first), each with a unique name and instructions. ",[166,2167,2168],{},"Answers",[14,2170,2171],{},"AiAnswer.Predicate"," (the probability of yes), ",[14,2174,2175],{},"AiAnswer.Choice"," (the most likely value, the model's confidence and each option's probability), ",[14,2178,2179],{},"AiAnswer.Score"," (the probability-weighted level from 0, and each level's probability by label) or ",[14,2182,2183],{},"AiAnswer.Refusal",". Confidence and probabilities are null when the model doesn't report them.",[30,2186,2187,2192,2193,2196],{},[166,2188,1951,2189,1955],{},[14,2190,2191],{},"DecideAsync"," Never retry, fall back to another model, or turn on a gateway's own fallbacks. Reserve tokens with ",[14,2194,2195],{},"AiTokens.Estimate(body, input, 64)"," and settle with the provider's counts.",[30,2198,2199,2202,2203,2206,2207,2210,2211,2214,2215,2218,2219,2222,2223,2225,2226,412,2229,297,2232,2235,2236,2239,2240,2243,2244,2247,2248,2251,2252,2254,2255,2257,2258,2261,2262,2264],{},[166,2200,2201],{},"Wire formats."," Two are in use, both in ",[14,2204,2205],{},"AiDecisionWire",": OpenAI's (",[14,2208,2209],{},"input"," parts and a ",[14,2212,2213],{},"questions"," array: OpenAI and Vercel AI Gateway at ",[14,2216,2217],{},"\u002Fdecisions",") and TypeSafe's System One (",[14,2220,2221],{},"state"," and a ",[14,2224,2213],{}," object with ",[14,2227,2228],{},"noul",[14,2230,2231],{},"choice",[14,2233,2234],{},"score",": TypeSafe and llama.cpp at ",[14,2237,2238],{},"\u002Fsystemone",", OpenRouter at ",[14,2241,2242],{},"\u002Fapi\u002Falpha\u002Fdecisions",", and Cloudflare at ",[14,2245,2246],{},"\u002Fai\u002Frun\u002F{model}",", inside a ",[14,2249,2250],{},"result"," envelope). System One has no common way to send images: the OpenAI-compatible type offers ",[14,2253,1894],{}," with it only for Cloudflare, which takes data URLs in ",[14,2256,1894],{},", and OpenRouter, which takes ",[14,2259,2260],{},"image_url"," parts in a ",[14,2263,2221],{}," array.",[30,2266,2267,285,2270,2273,2274,412,2277,412,2280,293,2283,2285,2286,2288,2289,2292,2293,412,2296,2299,2300,2303,2304,2307],{},[166,2268,2269],{},"Model lists.",[14,2271,2272],{},"AiModel.Kind"," says what a listed model does (",[14,2275,2276],{},"Language",[14,2278,2279],{},"Decision",[14,2281,2282],{},"Extraction",[14,2284,2006],{},") when the provider says: Vercel's ",[14,2287,815],{},", OpenRouter's ",[14,2290,2291],{},"endpoints"," (a model on both decision and extraction endpoints is of unknown kind), then its output modalities. OpenRouter lists decision and extraction models only when asked (",[14,2294,2295],{},"?output_modalities=decisions",[14,2297,2298],{},"?endpoints=\u002Fapi\u002Falpha\u002Fextractions","), so the OpenAI-compatible type asks when the connection offers them. Cloudflare has no OpenAI-style list, so its models come from ",[14,2301,2302],{},"\u002Fai\u002Fmodels\u002Fsearch",", with text generation models of unknown kind. The picker lists models of the step's kind and those of unknown kind. Steps fail with ",[14,2305,2306],{},"ai_model_wrong_kind"," before sending when the list says the chosen model is of another kind.",[30,2309,2310,2313,2314,2317],{},[14,2311,2312],{},"AiRunner.StartDecisionAsync"," resolves the client, model, features and input limits for a node; ",[14,2315,2316],{},"AiDecisionSession.DecideAsync"," checks every answer against its question.",[1222,2319,1277],{"id":2320},"ai-extraction",[10,2322,2323,691,2325,2328,2329,297,2331,2334,2335,2338],{},[14,2324,1273],{},[14,2326,2327],{},"AiExtract",") reads typed values from text and images with an extraction model. Its features are ",[14,2330,1894],{},[14,2332,2333],{},"booleans"," (fields of type ",[14,2336,2337],{},"Boolean"," can be asked for).",[83,2340,2342],{"className":85,"code":2341,"language":87,"meta":88,"style":88},"public interface IAiExtractionClient\n{\n    AiDefaults Defaults { get; }                               \u002F\u002F the connection's default extraction model, with its revision\n    IReadOnlyList\u003CAiModelFeature> Infer(string model);\n    Task\u003CAiExtractionResponse> ExtractAsync(AiExtractionRequest request, CancellationToken ct);\n}\n",[14,2343,2344,2349,2353,2358,2362,2367],{"__ignoreMap":88},[92,2345,2346],{"class":94,"line":95},[92,2347,2348],{},"public interface IAiExtractionClient\n",[92,2350,2351],{"class":94,"line":101},[92,2352,104],{},[92,2354,2355],{"class":94,"line":107},[92,2356,2357],{},"    AiDefaults Defaults { get; }                               \u002F\u002F the connection's default extraction model, with its revision\n",[92,2359,2360],{"class":94,"line":113},[92,2361,2132],{},[92,2363,2364],{"class":94,"line":120},[92,2365,2366],{},"    Task\u003CAiExtractionResponse> ExtractAsync(AiExtractionRequest request, CancellationToken ct);\n",[92,2368,2369],{"class":94,"line":126},[92,2370,159],{},[161,2372,2373,2415,2424,2476],{},[30,2374,2375,2149,2378,2381,2382,412,2385,412,2388,412,2391,412,2393,297,2396,2399,2400,2403,2404,2149,2407,2410,2411,2414],{},[166,2376,2377],{},"Fields",[14,2379,2380],{},"AiField(name, kind, instructions)",", with kinds ",[14,2383,2384],{},"Text",[14,2386,2387],{},"Number",[14,2389,2390],{},"Integer",[14,2392,2337],{},[14,2394,2395],{},"Date",[14,2397,2398],{},"TextList",". ",[14,2401,2402],{},"AiExtractionRequest.ReferenceDate"," anchors dates written without a year. ",[166,2405,2406],{},"Values",[14,2408,2409],{},"AiExtractedValue(name, value, confidence)",": the value in its kind's JSON form, or null when the content doesn't state it. ",[14,2412,2413],{},"Truncated"," says the provider stopped before reading every value.",[30,2416,2417,2423],{},[166,2418,1951,2419,2422],{},[14,2420,2421],{},"ExtractAsync"," is one request",", with tokens reserved like decisions (256 for the answer).",[30,2425,2426,2429,2430,2432,2433,2436,2437,2439,2440,2443,2444,2447,2448,2450,2451,2454,2455,2458,2459,2462,2463,412,2466,2469,2470,2472,2473,66],{},[166,2427,2428],{},"Wire format."," Cloudflare's Clairic format (",[14,2431,2221],{},", a ",[14,2434,2435],{},"fields"," object, ",[14,2438,1894],{}," as data URLs, ",[14,2441,2442],{},"reference_date","), in ",[14,2445,2446],{},"AiExtractionWire",": Cloudflare at ",[14,2449,2246],{}," and OpenRouter at ",[14,2452,2453],{},"\u002Fapi\u002Falpha\u002Fextractions",", which takes no ",[14,2456,2457],{},"boolean"," fields and images as an ",[14,2460,2461],{},"assets"," map (",[14,2464,2465],{},"format",[14,2467,2468],{},"data_base64",") whose names the ",[14,2471,2221],{}," mentions. Values of the wrong type fail with ",[14,2474,2475],{},"provider_invalid_response",[30,2477,2478,297,2481,2484,2485,2487,2488,2491,2492,2495],{},[14,2479,2480],{},"AiRunner.StartExtractionAsync",[14,2482,2483],{},"AiExtractionSession.ExtractAsync"," work like their decision counterparts. AI extract asks for ",[14,2486,2333],{}," through ",[14,2489,2490],{},"ConnectionFeaturesFor"," only when its method is ",[14,2493,2494],{},"extraction",", so validation flags a connection that can't read them.",[1222,2497,1285],{"id":2498},"ocr",[10,2500,2501,691,2503,2506,2507,2510,2511,2514],{},[14,2502,1281],{},[14,2504,2505],{},"TextRecognition",") reads the text in an image. It knows nothing about Tesseract: the Extract text step depends only on it, and any engine can provide it. Its one feature is ",[14,2508,2509],{},"preprocessing",": the engine takes ",[14,2512,2513],{},"OcrRequest.Advanced"," overrides.",[83,2516,2518],{"className":85,"code":2517,"language":87,"meta":88,"style":88},"public interface IOcrClient\n{\n    IReadOnlyList\u003Cstring> DefaultLanguages { get; }            \u002F\u002F used when a request names none\n    Task\u003CIReadOnlyList\u003COcrLanguage>> ListLanguagesAsync(CancellationToken ct);\n    Task\u003COcrResult> RecognizeAsync(OcrRequest request, CancellationToken ct);\n}\n",[14,2519,2520,2525,2529,2534,2539,2544],{"__ignoreMap":88},[92,2521,2522],{"class":94,"line":95},[92,2523,2524],{},"public interface IOcrClient\n",[92,2526,2527],{"class":94,"line":101},[92,2528,104],{},[92,2530,2531],{"class":94,"line":107},[92,2532,2533],{},"    IReadOnlyList\u003Cstring> DefaultLanguages { get; }            \u002F\u002F used when a request names none\n",[92,2535,2536],{"class":94,"line":113},[92,2537,2538],{},"    Task\u003CIReadOnlyList\u003COcrLanguage>> ListLanguagesAsync(CancellationToken ct);\n",[92,2540,2541],{"class":94,"line":120},[92,2542,2543],{},"    Task\u003COcrResult> RecognizeAsync(OcrRequest request, CancellationToken ct);\n",[92,2545,2546],{"class":94,"line":126},[92,2547,159],{},[161,2549,2550,2579,2585,2599],{},[30,2551,2552,2555,2556,691,2559,412,2562,412,2565,412,2568,2571,2572,2575,2576,2578],{},[166,2553,2554],{},"Requests"," carry the image stream with its media type and length, language codes, an ",[14,2557,2558],{},"OcrPreset",[14,2560,2561],{},"Auto",[14,2563,2564],{},"Screenshot",[14,2566,2567],{},"Document",[14,2569,2570],{},"Sparse","), optional ",[14,2573,2574],{},"OcrPreprocessing"," (segmentation, scale, invert, threshold), the step's idempotency key, and an optional ",[14,2577,1635],{}," the engine should keep to.",[30,2580,2581,2584],{},[166,2582,2583],{},"Results"," are the text with lines separated by newlines and blocks by a blank line, a confidence from 0 to 1 (null without text), and words with boxes in the original image's pixels. An image without text succeeds with empty text; only a failure to read throws.",[30,2586,2587,2590,2591,2594,2595,2598],{},[166,2588,2589],{},"Failures"," are step errors whose codes start with ",[14,2592,2593],{},"ocr_",", or classified by ",[14,2596,2597],{},"Outbound",". Reading is safe to repeat, so retryable failures are marked retryable.",[30,2600,2601,2602,2605,2606,66],{},"The first-party ",[14,2603,2604],{},"tessra.ocr.worker"," type speaks the worker protocol described in ",[466,2607,2609],{"href":2608},"\u002Focr\u002Fsetup#the-workers-api","The worker's API",[1222,2611,2613],{"id":2612},"lifetimes-and-ownership","Lifetimes and ownership",[161,2615,2616,2623,2643,2648,2662],{},[30,2617,2618,2619,2622],{},"The ",[14,2620,2621],{},"IConnectionType"," implementation is resolved from the step's (or the test's) scope.",[30,2624,2625,2628,2629,293,2632,2635,2636,2639,2640,2642],{},[14,2626,2627],{},"CreateClient"," returns a new client for one step or one test. Tessra disposes it (",[14,2630,2631],{},"IDisposable",[14,2633,2634],{},"IAsyncDisposable",") and its ",[14,2637,2638],{},"HttpClient"," when the step ends. Never cache clients, ",[14,2641,2638],{},"s or settings between calls.",[30,2644,2645,2647],{},[14,2646,1664],{}," shares Tessra's pooled connections; don't dispose it or change its defaults.",[30,2649,2650,2651,297,2654,2657,2658,2661],{},"A client creates and disposes its own ",[14,2652,2653],{},"HttpRequestMessage",[14,2655,2656],{},"HttpResponseMessage",". Request values from a node are read-only. For ",[14,2659,2660],{},"OutboundFile"," (an attachment or a file body), the client opens the stream, may open it more than once, and disposes each stream it opens before returning.",[30,2663,2664,2665,2668,2669,293,2672,2675,2676,293,2679,2681],{},"What a client returns is fully read and holds no stream or connection. A ",[14,2666,2667],{},"JsonNode"," in it is mutable and belongs to the caller from then on: the client must not keep, share or change it after returning it. Read bodies with ",[14,2670,2671],{},"Outbound.ReadJsonAsync",[14,2673,2674],{},"ReadTextAsync",": they fail with ",[14,2677,2678],{},"response_too_large",[14,2680,2475],{}," rather than cut or guess.",[1222,2683,2589],{"id":2684},"failures",[10,2686,2687,2689,2690,2693,2694,2696],{},[14,2688,2597],{}," classifies a failed request; it doesn't decide retries. Each error carries an ",[14,2691,2692],{},"ExternalOutcome",", and anything not established is ",[14,2695,1767],{},":",[2698,2699,2700,2716],"table",{},[2701,2702,2703],"thead",{},[2704,2705,2706,2710,2713],"tr",{},[2707,2708,2709],"th",{},"Outcome",[2707,2711,2712],{},"When",[2707,2714,2715],{},"Codes",[2717,2718,2719,2744,2760],"tbody",{},[2704,2720,2721,2727,2730],{},[2722,2723,2724],"td",{},[14,2725,2726],{},"NotSent",[2722,2728,2729],{},"Tessra knows none of the request was written: the outbound rules refused it before the first request, it was too large, or the connection failed before any of it was written. Tessra tracks the bytes written for each request, so a connection that drops after sending isn't mistaken for this.",[2722,2731,2732,412,2735,412,2738,412,2741],{},[14,2733,2734],{},"outbound_blocked",[14,2736,2737],{},"request_too_large",[14,2739,2740],{},"connection_unreachable",[14,2742,2743],{},"connection_timeout",[2704,2745,2746,2750,2757],{},[2722,2747,2748],{},[14,2749,2035],{},[2722,2751,2752,2753,2756],{},"The service established that it didn't act. Tessra never infers this from a status code: a connection type claims it for statuses its service documents, with ",[14,2754,2755],{},"Outbound.SendAsync(http, request, ct, rejected: [400, 404, 429])",", as the Discord type does.",[2722,2758,2759],{},"as below",[2704,2761,2762,2766,2769],{},[2722,2763,2764],{},[14,2765,1767],{},[2722,2767,2768],{},"Everything else, including every error status unless the connection type claims it, a timeout or dropped connection after sending, a redirect refused after the first request, and an unreadable or oversized answer.",[2722,2770,2771,2774,2775,2778,2779,2782,2783,2786,2787,412,2789,412,2792,412,2794,412,2796],{},[14,2772,2773],{},"provider_rejected"," (4xx), ",[14,2776,2777],{},"connection_auth_failed"," (401, 403), ",[14,2780,2781],{},"provider_throttled"," (429), ",[14,2784,2785],{},"provider_error"," (5xx, 408, 425), ",[14,2788,2743],{},[14,2790,2791],{},"connection_lost",[14,2793,2734],{},[14,2795,2678],{},[14,2797,2475],{},[10,2799,2800],{},"Each error also says whether trying again could help: 5xx, 408, 425, timeouts and dropped connections could; other 4xx and blocked addresses can't.",[10,2802,2803,2804,2807,2808,2811,2812,2814,2815,2818,2819,2822],{},"Messages never include a transport exception's own text. ",[14,2805,2806],{},"Outbound.EnsureSuccessAsync"," reads at most 4 KiB of a provider's error and keeps one message field from a JSON object (any other shape gives nothing), with addresses' queries and anything that looks like a key removed, in ",[14,2809,2810],{},"NodeException.Detail",". Before an error is stored or shown, Tessra removes the connection's actual secret values from the message and detail, in any letter case and in URL- or JSON-escaped form, and drops the detail entirely when it still contains a stretch of a key-like part of a secret. Set ",[14,2813,2709],{}," yourself on a ",[14,2816,2817],{},"NodeException"," (with ",[14,2820,2821],{},"Outbound.Classified",") for other protocols.",[10,2824,2825,2826,2828,2829,2832,2833,2835,2836,2839,2840,66],{},"The engine then decides: an ",[14,2827,1767],{}," outcome after an outside change began, on a step that isn't keyed or safe, always stops for confirmation, whatever else applies. Otherwise a service's wait (",[14,2830,2831],{},"Retry-After",", as a delay or a date measured by Tessra's clock) is honored without using an attempt, ",[14,2834,2035],{}," fails, and the rest retry when they could help. Every wait is at least ",[14,2837,2838],{},"Tessra:Workflows:MinRetryDelay"," and a service's wait at most ",[14,2841,2842],{},"Tessra:Workflows:MaxRetryAfter",[1222,2844,2846],{"id":2845},"nodes-that-use-connections","Nodes that use connections",[83,2848,2850],{"className":85,"code":2849,"language":87,"meta":88,"style":88},"[property: Setting(\"Connection\"), Required, Connection(Notify.CapabilityId, Notify.CapabilityVersion)] ConnectionRef Connection\n",[14,2851,2852],{"__ignoreMap":88},[92,2853,2854],{"class":94,"line":95},[92,2855,2849],{},[10,2857,2858,2861,2862,412,2865,297,2868,2871,2872,2875,2876,2878,2879,2881,2882,2885,2886,2889,2890,2892,2893,2896],{},[14,2859,2860],{},"[Connection(capability, version) { Features = [...] }]"," filters the editor's picker and makes validation report ",[14,2863,2864],{},"connection_unavailable",[14,2866,2867],{},"connection_wrong_capability",[14,2869,2870],{},"connection_missing_feature",". When another setting decides which capability the step uses, add ",[14,2873,2874],{},"[ConnectionWhen(\"other\", value, capability, version)]"," once per alternative: the first whose setting has that value applies, otherwise ",[14,2877,1243],{}," does, as AI classify asks for ",[14,2880,1266],{}," unless its method is ",[14,2883,2884],{},"language",". The editor, validation and the step all use the capability the settings pick, so the executor asks only for that client. Override ",[14,2887,2888],{},"ConnectionFeaturesFor(setting, settings)"," when the settings decide a feature, as Send notification asks for ",[14,2891,1250],{}," only when a file is attached. In the executor, ",[14,2894,2895],{},"await step.Connections.GetAsync\u003CINotifyClient>(s.Connection, ct)"," returns the client after checking the owner, the capability the setting declares, and the features again; asking for another capability's client is an error.",[10,2898,2899,2900,2903,2904,2907,2908,2910],{},"Nodes that change something outside declare ",[14,2901,2902],{},"ExternalMutation = true",", and nodes that send content out for processing declare a ",[14,2905,2906],{},"DataTransmitted"," other than ",[14,2909,706],{},". Tests skip such nodes and return typed placeholders unless the user turns on the matching switch.",[10,2912,2913,2916,2917,2919,2920,2923,2924,2927,2928,2931,2932,2935],{},[166,2914,2915],{},"Outside changes are marked before the first request."," For an ",[14,2918,1074],{}," node, Tessra records that the change began right before the first request a connection client or ",[14,2921,2922],{},"step.Http"," sends, whatever the method, so it can't be forgotten. Call ",[14,2925,2926],{},"step.BeginExternalAsync(ct, keyed: true)"," before that when the receiver is known to drop repeats of ",[14,2929,2930],{},"step.IdempotencyKey",", so the step retries instead of asking. That guarantee is the receiver's: Tessra sends the same key on every attempt but can't check what the receiver does with it, so claim it only from the connection's settings or the service's documentation. A node that changes something without an HTTP request must call ",[14,2933,2934],{},"BeginExternalAsync"," too. The built-in steps are covered by tests for both.",[22,2937,2939],{"id":2938},"testing","Testing",[10,2941,2942,2943,914,2946,2949,2950,297,2953,301,2956,600,2959,2962,2963,297,2966,66],{},"Tests can load a plugin directly with ",[14,2944,2945],{},"services.AddTessraPlugins(configuration, typeof(MyPlugin))",[14,2947,2948],{},"TessraFactory.ExtraServices",", and drive jobs with ",[14,2951,2952],{},"JobRunner.ClaimAsync",[14,2954,2955],{},"RunAsync",[14,2957,2958],{},"backend\u002FTessra.Tests\u002FProcessingTests.cs",[14,2960,2961],{},"WorkflowTests.cs"," for nodes. Connection adapters are tested against provider documentation shapes kept as JSON fixtures: see ",[14,2964,2965],{},"backend\u002FTessra.Tests\u002FFixtures\u002FAi\u002FREADME.md",[14,2967,2968],{},"AiAdapterTests.cs",[10,2970,2971,2974,2975,691,2978,412,2981,293,2984,803,2987,2990,2991,412,2994,297,2997,691,3000,412,3003,293,3006,3009,3010,3013,3014,3017],{},[14,2972,2973],{},"AiLiveTests"," sends one real request and lists models when you point it at a provider; it's skipped otherwise. Set ",[14,2976,2977],{},"TESSRA_LIVE_AI_TYPE",[14,2979,2980],{},"openai-compatible",[14,2982,2983],{},"anthropic",[14,2985,2986],{},"gemini",[14,2988,2989],{},"TESSRA_LIVE_AI_MODEL",", and as needed ",[14,2992,2993],{},"TESSRA_LIVE_AI_URL",[14,2995,2996],{},"TESSRA_LIVE_AI_KEY",[14,2998,2999],{},"TESSRA_LIVE_AI_MODE",[14,3001,3002],{},"native",[14,3004,3005],{},"jsonmode",[14,3007,3008],{},"prompted","), then run ",[14,3011,3012],{},"dotnet test --filter AiLiveTests",". It uses your key and costs a few hundred tokens. For a local check, ",[14,3015,3016],{},"ollama pull llama3.2"," and set only the type and model.",[10,3019,3020,3023],{},[14,3021,3022],{},"ExamplePluginTests.cs"," is a whole third-party plugin in one file: its own capability, a connection type with a secret that provides it, and a node that uses it, registered and run through a published workflow without any change to Tessra itself.",[3025,3026,3027],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":88,"searchDepth":101,"depth":107,"links":3029},[3030,3031,3032,3033,3034,3035,3036,3047],{"id":24,"depth":101,"text":25},{"id":80,"depth":101,"text":81},{"id":202,"depth":101,"text":203},{"id":317,"depth":101,"text":318},{"id":448,"depth":101,"text":449},{"id":1107,"depth":101,"text":1108},{"id":1196,"depth":101,"text":1197,"children":3037},[3038,3039,3040,3041,3042,3043,3044,3045,3046],{"id":1224,"depth":107,"text":1225},{"id":1329,"depth":107,"text":1330},{"id":1881,"depth":107,"text":1263},{"id":2098,"depth":107,"text":1270},{"id":2320,"depth":107,"text":1277},{"id":2498,"depth":107,"text":1285},{"id":2612,"depth":107,"text":2613},{"id":2684,"depth":107,"text":2589},{"id":2845,"depth":107,"text":2846},{"id":2938,"depth":101,"text":2939},"Add jobs, file processors, workflow steps and connection types to Tessra with a compiled-in plugin.","md",{},"\u002Fdevelopment\u002Fplugins",{"title":5,"description":3048},"9.development\u002F2.plugins","0MLMxvUyRQLFOEtfKWVKKCOLNZq83RZalaZQ_kXRQL4",[3056,3061],{"title":3057,"path":3058,"stem":3059,"description":3060,"children":-1},"Local development","\u002Fdevelopment","9.development\u002F1.index","Run the API and dashboard from source, run the checks, add migrations and translations, and test against S3.",{"title":3062,"path":3063,"stem":3064,"description":3065,"children":-1},"Writing documentation","\u002Fdevelopment\u002Fdocumentation","9.development\u002F3.documentation","How pages in this site are organized and written, and the components available in Markdown.",[3067,3087,3125,3166,3176,3195,3205,3247,3282,3296,3303],{"title":3068,"path":3069,"stem":3070,"children":3071,"icon":3086},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[3072,3074,3078,3082],{"title":3073,"path":3069,"stem":3070},"Introduction",{"title":3075,"path":3076,"stem":3077},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":3079,"path":3080,"stem":3081},"Configure ShareX","\u002Fgetting-started\u002Fsharex","1.getting-started\u002F3.sharex",{"title":3083,"path":3084,"stem":3085},"Updating Tessra","\u002Fgetting-started\u002Fupdating","1.getting-started\u002F4.updating","i-lucide-rocket",{"title":3088,"icon":3089,"path":3090,"stem":3091,"children":3092,"page":3124},"Library","i-lucide-folder","\u002Flibrary","2.library",[3093,3097,3101,3105,3109,3112,3116,3120],{"title":3094,"path":3095,"stem":3096},"Uploading files","\u002Flibrary\u002Fuploading","2.library\u002F1.uploading",{"title":3098,"path":3099,"stem":3100},"Files and folders","\u002Flibrary\u002Ffiles-and-folders","2.library\u002F2.files-and-folders",{"title":3102,"path":3103,"stem":3104},"Sharing files","\u002Flibrary\u002Fsharing","2.library\u002F3.sharing",{"title":3106,"path":3107,"stem":3108},"Tags","\u002Flibrary\u002Ftags","2.library\u002F4.tags",{"title":2377,"path":3110,"stem":3111},"\u002Flibrary\u002Ffields","2.library\u002F5.fields",{"title":3113,"path":3114,"stem":3115},"Attachments","\u002Flibrary\u002Fattachments","2.library\u002F6.attachments",{"title":3117,"path":3118,"stem":3119},"Search","\u002Flibrary\u002Fsearch","2.library\u002F7.search",{"title":3121,"path":3122,"stem":3123},"Trash and recovery","\u002Flibrary\u002Ftrash","2.library\u002F8.trash",false,{"title":3126,"path":3127,"stem":3128,"children":3129,"icon":3165},"Automations","\u002Fautomations","3.automations\u002F01.index",[3130,3132,3136,3140,3144,3148,3152,3155,3159,3163],{"title":3131,"path":3127,"stem":3128},"Overview",{"title":3133,"path":3134,"stem":3135},"Your first workflow","\u002Fautomations\u002Ffirst-workflow","3.automations\u002F02.first-workflow",{"title":3137,"path":3138,"stem":3139},"The editor","\u002Fautomations\u002Feditor","3.automations\u002F03.editor",{"title":3141,"path":3142,"stem":3143},"Values and templates","\u002Fautomations\u002Fvalues","3.automations\u002F04.values",{"title":3145,"path":3146,"stem":3147},"Conditions and branching","\u002Fautomations\u002Fbranching","3.automations\u002F05.branching",{"title":3149,"path":3150,"stem":3151},"Upload intake","\u002Fautomations\u002Fintake","3.automations\u002F06.intake",{"title":2939,"path":3153,"stem":3154},"\u002Fautomations\u002Ftesting","3.automations\u002F07.testing",{"title":3156,"path":3157,"stem":3158},"Runs and history","\u002Fautomations\u002Fruns","3.automations\u002F08.runs",{"title":3160,"path":3161,"stem":3162},"Quarantine and failures","\u002Fautomations\u002Fquarantine","3.automations\u002F09.quarantine",{"title":1108,"path":1114,"stem":3164},"3.automations\u002F10.templates","i-lucide-workflow",{"title":1197,"path":3167,"stem":3168,"children":3169,"icon":3175},"\u002Fconnections","4.connections\u002F1.index",[3170,3171],{"title":3131,"path":3167,"stem":3168},{"title":3172,"path":3173,"stem":3174},"AI providers","\u002Fconnections\u002Fai-providers","4.connections\u002F2.ai-providers","i-lucide-plug",{"title":3177,"path":3178,"stem":3179,"children":3180,"icon":3194},"AI","\u002Fai","5.ai\u002F1.index",[3181,3182,3186,3190],{"title":3131,"path":3178,"stem":3179},{"title":3183,"path":3184,"stem":3185},"AI classify and extract","\u002Fai\u002Fclassify-and-extract","5.ai\u002F2.classify-and-extract",{"title":3187,"path":3188,"stem":3189},"AI describe, summarize and write","\u002Fai\u002Fdescribe-and-write","5.ai\u002F3.describe-and-write",{"title":3191,"path":3192,"stem":3193},"AI detect and suggest tags","\u002Fai\u002Fdetect-and-tag","5.ai\u002F4.detect-and-tag","i-lucide-sparkles",{"title":1285,"path":3196,"stem":3197,"children":3198,"icon":3204},"\u002Focr","5.ocr\u002F1.index",[3199,3200],{"title":3131,"path":3196,"stem":3197},{"title":3201,"path":3202,"stem":3203},"Setup","\u002Focr\u002Fsetup","5.ocr\u002F2.setup","i-lucide-scan-text",{"title":3206,"path":3207,"stem":3208,"children":3209,"icon":3246},"Self-hosting","\u002Fself-hosting","6.self-hosting\u002F1.index",[3210,3211,3215,3218,3222,3226,3230,3234,3238,3242],{"title":3131,"path":3207,"stem":3208},{"title":3212,"path":3213,"stem":3214},"Troubleshooting","\u002Fself-hosting\u002Ftroubleshooting","6.self-hosting\u002F10.troubleshooting",{"title":174,"path":3216,"stem":3217},"\u002Fself-hosting\u002Fconfiguration","6.self-hosting\u002F2.configuration",{"title":3219,"path":3220,"stem":3221},"Reverse proxies and HTTPS","\u002Fself-hosting\u002Freverse-proxy","6.self-hosting\u002F3.reverse-proxy",{"title":3223,"path":3224,"stem":3225},"DigitalOcean","\u002Fself-hosting\u002Fdigitalocean","6.self-hosting\u002F4.digitalocean",{"title":3227,"path":3228,"stem":3229},"Backups and restoration","\u002Fself-hosting\u002Fbackups","6.self-hosting\u002F5.backups",{"title":3231,"path":3232,"stem":3233},"Users and roles","\u002Fself-hosting\u002Fusers","6.self-hosting\u002F6.users",{"title":3235,"path":3236,"stem":3237},"Single sign-on","\u002Fself-hosting\u002Fsingle-sign-on","6.self-hosting\u002F7.single-sign-on",{"title":3239,"path":3240,"stem":3241},"Two-factor and passkeys","\u002Fself-hosting\u002Ftwo-factor-and-passkeys","6.self-hosting\u002F8.two-factor-and-passkeys",{"title":3243,"path":3244,"stem":3245},"Importing","\u002Fself-hosting\u002Fimporting","6.self-hosting\u002F9.importing","i-lucide-server",{"title":3248,"path":3249,"stem":3250,"children":3251,"icon":3281},"Guides","\u002Fguides","7.guides\u002F1.index",[3252,3253,3257,3261,3265,3269,3273,3277],{"title":3131,"path":3249,"stem":3250},{"title":3254,"path":3255,"stem":3256},"Optimize ShareX uploads","\u002Fguides\u002Fcompress-uploads","7.guides\u002F2.compress-uploads",{"title":3258,"path":3259,"stem":3260},"Send Discord notifications","\u002Fguides\u002Fdiscord-notifications","7.guides\u002F3.discord-notifications",{"title":3262,"path":3263,"stem":3264},"Organize screenshots with AI","\u002Fguides\u002Fcategorize-screenshots","7.guides\u002F4.categorize-screenshots",{"title":3266,"path":3267,"stem":3268},"Extract receipts with AI","\u002Fguides\u002Fextract-receipts","7.guides\u002F5.extract-receipts",{"title":3270,"path":3271,"stem":3272},"Name screenshots with AI","\u002Fguides\u002Fai-file-names","7.guides\u002F6.ai-file-names",{"title":3274,"path":3275,"stem":3276},"Run AI locally with Ollama","\u002Fguides\u002Flocal-ai-ollama","7.guides\u002F7.local-ai-ollama",{"title":3278,"path":3279,"stem":3280},"Make screenshots searchable","\u002Fguides\u002Fsearchable-screenshots","7.guides\u002F8.searchable-screenshots","i-lucide-book-open",{"title":3283,"icon":3284,"path":3285,"stem":3286,"children":3287,"page":3124},"Reference","i-lucide-library","\u002Freference","8.reference",[3288,3292],{"title":3289,"path":3290,"stem":3291},"Step reference","\u002Freference\u002Fsteps","8.reference\u002F1.steps",{"title":3293,"path":3294,"stem":3295},"Limits and errors","\u002Freference\u002Flimits","8.reference\u002F2.limits",{"title":3297,"path":3058,"stem":3059,"children":3298,"icon":3302},"Development",[3299,3300,3301],{"title":3057,"path":3058,"stem":3059},{"title":5,"path":3051,"stem":3053},{"title":3062,"path":3063,"stem":3064},"i-lucide-code",{"title":3304,"path":3305,"stem":3306,"children":3307,"icon":3334},"Comparisons","\u002Fcomparisons","99.comparisons\u002F1.index",[3308,3310,3314,3318,3322,3326,3330],{"title":3309,"path":3305,"stem":3306},"Comparing Tessra",{"title":3311,"path":3312,"stem":3313},"Tessra and Zipline","\u002Fcomparisons\u002Fzipline","99.comparisons\u002F2.zipline",{"title":3315,"path":3316,"stem":3317},"Tessra and XBackBone","\u002Fcomparisons\u002Fxbackbone","99.comparisons\u002F3.xbackbone",{"title":3319,"path":3320,"stem":3321},"Tessra and chibisafe","\u002Fcomparisons\u002Fchibisafe","99.comparisons\u002F4.chibisafe",{"title":3323,"path":3324,"stem":3325},"Tessra and Slink","\u002Fcomparisons\u002Fslink","99.comparisons\u002F5.slink",{"title":3327,"path":3328,"stem":3329},"Tessra and Pingvin Share","\u002Fcomparisons\u002Fpingvin-share","99.comparisons\u002F6.pingvin-share",{"title":3331,"path":3332,"stem":3333},"Tessra and PicoShare","\u002Fcomparisons\u002Fpicoshare","99.comparisons\u002F7.picoshare","i-lucide-scale",1796301180175,"7456fe0d-763d-4d83-b714-ffd4ca3197d2"]