codelessly_sdk 30.0.0
codelessly_sdk: ^30.0.0 copied to clipboard
Server-driven UI for Flutter. Design screens in the Codelessly Editor, publish, and render them natively in your app, with live updates, data, actions and navigation.
Unreleased #
- The reference is one base plus links (codelessly_api's
docs/reference). The chat example's compact prompt is the base's runtime form (runtimeStarter(), ≈ 43.7k characters, ending with the index ofui_docstopics) andui_docsanswers with the reference's pages (UiSession.docs, unchanged); its full prompt carries the base's file form (assets/system_prompt.md, regenerated). The render and stream READMEs point at the base and at the reference's render page.
30.0.0 #
Requires codelessly_api: ^30.0.0.
Schema 3. Published apps hold schema 2: every loader (Firestore, HTTP files and bundle, asset bundle,
memory) reads "schema": 2 and 3, migrating 2 in memory (migrate2to3), never writing back; a stored
component is checked against its digest as stored, then migrated. A stored document in a newer schema is
refused (PublishLoadException, naming the SDK update). Schema 2 documents load and are migrated in memory;
write schema 3. The render command publishes schema 3 and leaves the validator's notes (schema_outdated)
out of its findings.
- Breaking: the code of the removed one-app fields is gone (see codelessly_api 30.0.0): the track's fine
mode, double tap, parking (
defaultValue,parkedProgress),smoothglide and arcgain; a dismissible's and pan's tilt (rotateFactor,originX/Y), disabled follow and shake,shareAs,follow: falseand the fly-off spin; area path pacing and the upright flip (MeasuredPath.attakes nobyArea); a transition's arc; a drop target'sfullIf,hoverDelay, refused slot and thedropFull/dragHovertriggers (${drag.full}is gone); snapprojectVelocityandrotationSnap. ThesetVariableglide (animateMs) is ananimateaction (the migration rewrites it).trackValueslosesfine. - Flutter's reading: a text node applies its
layout.paddingaround its lines, asPadding(child: Text)(a hugging text grows by it; a fixed one insets its lines). Schema-2 documents are unchanged: the migration drops the padding schema 2 ignored (steptext.padding). A text style without aheightis laid out at the font's own line height, as Flutter'sText(kTextBasehas no height), under the nearestdefaultTextStyle(Flutter'sDefaultTextStyle), which every text style a node draws merges over: a text's style and runs, a widget's label and field styles, a painter's paragraphs, a typewriter's caret, a chart's tooltips, the nodes an island shows again (TextDefaultScope) and a view's root (RenderTree.rootSlot). Schema-2 documents keep 1.33 through the migration (the 66 parity pages and the m05 sites render byte-identical PNGs). Breaking:RenderTree.naturalLineHeightandkTextBaseNaturalare removed;textStyle(style, [inherited]);Slot.textDefault. - A schema-2 path a
setValuenames (not migrated: it is read against its target when it runs) sets nothing and is said once, with the schema-3 path to write (schema2PathHint); the action's other values apply. - Behaviour changes: a track with no value is drawn at its minimum (the
drag_miscparity golden moves three thumbs:fader cap,knob,path track); the other dropped fields no longer act. Everything else renders as before: the 66 parity pages, the m05 experiments' sites (byte-identical PNGs), the Relay site (schema 2 through the migration and schema 3 rewritten draw the same boxes).
Streaming generative UI, hardened against real model output
UiSession: a batch or stream applied to a UI that already has roots cannot replace them or add a canvas (protectRoots, on:start_over), so a retry patches the UI; the end of a stream addsrenderDiagnostics(empty_button,low_contrast, and withglyphCoverage,missing_glyph) to the result, andlayoutDiagnostics()reports nodes with content laid out with no size (no_size);lastStreamEnd(repairs of malformed JSON, ops recovered);docs()answersui_docs;values(the views' variable values). A canvas's body with a fill (the card) shows as soon as it arrives instead of waiting for its first child: first paint of the recorded live cards 0.4 to 1.0 s earlier.CodelesslyView(services:): with aScriptRunneramong the services, the session's own scripts run (runScript, where the profile allows them:TrustProfile.agentApps).- Replay command (
tool/stream): ops recovered from malformed input, JSON repairs, first text, render diagnostics, scripts, and "works when used" (a scripted interaction per brief,tool/stream/interactions; scripts run in QuickJS);tool/stream/live_summary.py. The three live recordings re-replayed (tool/stream/out/live). examples/stream_chat: the compact prompt (the generated base set, compact tools,ui_docs), lookups answered within the turn, the retry protocol with a cap, forced tool use where the model allows it, six app briefs,tool/record_all.sh(the live matrix),tool/use_local_api.shandtool/check.sh(CI: the example builds against the siblingcodelessly_api).
Components in published apps, hosted plugins as components (sections and components, phase 2)
- A published site with components just works.
PublishLoader.loadComponent(memory, asset bundle, HTTP bundle or files, Firestorepublish/{p}/components/{type}withcompressedDocument);Codelesslyloads a layout's closure of components (listed by the model and found in the documents) before the screen shows, caches each at its publish path by digest (offline: any cached copy), refuses one whose document doesn't match its digest, reloads a component whose model entry changed (aLivePublishLoaderfollows it: every instance updates in place, the pages don't reload), loads the fonts of called components, and fetches a missing definition when a call renders without it. Misses are logged ascomponent_missing.Codelessly.loadComponent,publishedComponents; components an app defines itself win over published ones.componentDigest,componentIntact,decodeStoredPublishComponent,ComponentRegistry.onMissing. - Hosted plugins:
Codelesslyinstalls the plugins a publish lists (model.plugins) before decoding layouts, through the loader as aPluginSource(a bundle's embedded versions;plugins/{id}/versions/{n}over HTTP and in Firestore), the cache, digests, minSdk and the catalog check;Codelessly.hostedPlugins,Codelessly.actions(the runner with the plugins' action types). A plugin node type is a component definition (CodelesslyFeature.components) rendered as ordinary boxes of the screen's tree: hug and fill through the seam, interaction, slots and events as any component's. Behaviour change: the island path for plugin widgets (_HostedRecipe, a fixed-size fit box) is gone;hostedPluginFeaturereturns no recipes. - Per instance:
setValue/setVariantinside a component instance set that instance's node (RenderTree.setInstanceValue); slot content inside a list of the definition shows once per item, in the caller's scope (SlotContent); an instance's scopes are released when it leaves the tree (InstanceBindings.releaseInstance);persiston a component variable is kept per instance path (NodeBinder.persistComponentVariable,PersistedVariable.attach(key:)); a changed declaration decodes the loaded layouts that call it again. Behaviour change (bug fix): set value inside an instance changed the page's node of that id. - Render command:
--components-all; a call can be tapped by its id (--tap send,--tap 'sizes#3');render_exceptionnames a node inside an instance by path and its component's file; publishing writes the components, their digests and each layout's closure into the bundle. examples/relay-pricingis a three-page site sharing header, menu, footer, call to action, button, cards and a theme, published and loaded over HTTP then offline intest/examples/relay_site_test.dart.
Authoring fixes from the third direct-authoring experiment (cycle 3)
- Named colors and text styles resolve against the published theme as the screen shows it (its media rules at
the screen's size, its dark colors in dark mode), on the page and in components (
ComponentRegistry.theme); a change of theme re-applies only the nodes whose resolved values differ.${theme.text.*}reads resolved styles. - Icon
size: the glyph at that size, centred in the node's box; a hugging icon takes it. - Actions naming a node from inside a component instance (
scrollTo,animate,focus,editText) act on that instance's node. Behaviour change (bug fix): they acted on every instance's (or none). - A node written
visible: falsewhose media rule bindsvisiblecollapses when hidden. RenderFitBox.designWidthUsed/designHeightUsed: a fill laid out with no room took its design size.- Render command:
fill_fallback(a fill whose size came from its design number, naming the parent and the fix); diagnostics find a node's parent in its own document and name component nodes by path (no more falselayout_overflowwhen a page and a component share an id);--full-pagecaptures the whole page while the window keeps its size (behaviour change:screen.heightand anything pinned to the window's top and bottom are no longer stretched to the page; page content is unchanged), and--dump-layoutreports boxes where the PNG draws them;--unfocus,--key;--compare(side-by-side and diff images, bands, height difference); of a font package's subset files the one with Latin text's characters is served; the site manifest's theme is validated, published and its fonts loaded.
Authoring fixes from the second direct-authoring experiment (cycle 2)