@@ -83,6 +83,11 @@ curl -sS -H "$AUTH" -H "Content-Type: application/json" \
8383
8484Evidence: request/response models live in ` src/abstractgateway/routes/gateway.py ` (` StartRunRequest ` , ` start_run ` ).
8585
86+ For VisualFlow bundles, Gateway runs the packed JSON through AbstractRuntime.
87+ Structured LLM/Agent schemas are Runtime/Core-owned: ` response ` remains textual,
88+ and schema-conformant object values are available through the node ` data ` output
89+ for data edges such as Break Object and Switch.
90+
8691### 2b) Schedule a run (bundle mode)
8792
8893` POST /api/gateway/runs/schedule ` starts a ** scheduled parent run** that launches the target workflow as child runs over time.
@@ -194,6 +199,34 @@ raw bytes or local paths:
194199}
195200```
196201
202+ Gateway uses three distinct file-like source terms:
203+
204+ - ` Artifact ` : a durable runtime-owned payload reference.
205+ - ` Local File ` : a browser/client upload source. Hosted clients should upload
206+ bytes; browser-local paths are never interpreted as server paths.
207+ - ` Server File ` / ` Server Folder ` : user-facing wording for a workspace-scoped
208+ server path under Gateway policy. The engineering contract is the canonical
209+ ` WorkspacePath ` string returned by ` /files/* ` , artifact import/export, and
210+ Runtime file nodes.
211+
212+ Hosted local uploads stay artifact-backed:
213+
214+ - one local file upload creates one artifact ref;
215+ - multiple local files create an ordered list of artifact refs in Flow;
216+ - a local folder uploads one artifact per file and may send ` source_path `
217+ (for example ` reports/2026/summary.md ` ) so relative member paths survive in
218+ artifact provenance without exposing browser-local absolute paths.
219+
220+ Upload a local file or folder member:
221+
222+ ``` bash
223+ curl -sS -H " $AUTH " \
224+ -F " session_id=sess-1" \
225+ -F " source_path=reports/summary.md" \
226+ -F " file=@./summary.md" \
227+ " $BASE_URL /api/gateway/attachments/upload"
228+ ```
229+
197230List run artifacts:
198231
199232``` bash
@@ -206,19 +239,76 @@ List artifacts visible to a session:
206239curl -sS -H " $AUTH " " $BASE_URL /api/gateway/sessions/sess-1/artifacts"
207240```
208241
242+ Browse server workspace files/folders:
243+
244+ ``` bash
245+ curl -sS -H " $AUTH " \
246+ " $BASE_URL /api/gateway/files/list?path=&include_directories=true&limit=200"
247+ ```
248+
249+ Optional filters:
250+ - ` path ` : browse a specific workspace folder or mount alias.
251+ - ` recursive=true `
252+ - ` family=image|video|audio|document|text|code|json|archive|other `
253+ - ` extensions=png,jpg ` or newline-separated values
254+ - ` query=substring `
255+ - ` max_depth=<n> `
256+
209257Search artifacts across Gateway storage:
210258
211259``` bash
212260curl -sS -H " $AUTH " \
213- " $BASE_URL /api/gateway/artifacts/search?scope=all&modality =image&query=logo&tags=pin_id=image"
261+ " $BASE_URL /api/gateway/artifacts/search?scope=all&artifact_kind =image&query=logo&tags=pin_id=image&include_stats=true&limit=500 "
214262```
215263
216264` scope ` can be ` all ` , ` session ` , or ` run ` . Use ` session_id ` with
217265` scope=session ` and ` run_id ` with ` scope=run ` ; omit both for ` scope=all ` .
218- ` modality ` filters normalized artifact type (` image ` , ` audio ` , ` video ` ,
219- ` text ` , ` document ` , ` music ` , ` voice ` , or ` artifact ` ), ` content_type ` accepts
220- exact values or prefixes such as ` image/* ` , and ` tags ` accepts either a JSON
221- object or comma-separated ` key=value ` filters.
266+ Search responses preserve the legacy row fields and also include
267+ ` artifact_envelope_v1 ` , a normalized projection of Runtime-owned descriptors,
268+ access stats, and Gateway action links.
269+
270+ Useful query parameters:
271+ - ` artifact_kind ` : UI-oriented kind filter. Comma-separated values match
272+ ` semantic_kind ` , ` render_kind ` , or ` modality ` ; generic ` audio ` means
273+ unclassified audio and does not match canonical ` voice ` , ` music ` , or ` sound ` .
274+ Single canonical kinds such as ` music ` , ` voice ` , ` image ` , ` markdown ` , or
275+ ` json ` map to Runtime catalog filters. Multi-kind unions are supported, but
276+ may be Gateway post-filters until Runtime exposes OR filters.
277+ - ` semantic_kind ` / ` render_kind ` : canonical descriptor filters when the caller
278+ wants the two dimensions separately.
279+ - ` modality ` , ` content_type ` , ` workflow_id ` , ` node_id ` , ` created_after ` ,
280+ ` created_before ` , and ` tags ` : server filters for indexed descriptor fields.
281+ - ` query ` : case-insensitive metadata search. Gateway may post-filter this field
282+ when Runtime cannot index it directly.
283+ - ` include_stats=true ` : include exact ` stats.total ` , byte totals, and facet
284+ counts for the selected server-side filter set, independent of ` limit ` .
285+ - ` limit ` , ` offset ` , and ` cursor ` : bounded paging. The default Runtime Explorer
286+ page size is 500; ` limit<=0 ` is bounded unless ` debug_unlimited=true ` is used
287+ by an admin/debug caller.
288+
289+ ` artifact_envelope_v1 ` contains normalized fields such as ` semantic_kind ` ,
290+ ` render_kind ` , ` workflow_id ` , ` node_id ` , ` turn_id ` , ` ledger_cursor ` ,
291+ ` generation ` , ` producer ` , ` media ` , ` source_refs ` , ` access ` , and ` links ` .
292+ Sparse producer metadata is represented as missing fields; Gateway does not
293+ invent provider/model provenance from filenames.
294+
295+ Generated-media artifacts created by child runs and projected into the parent
296+ run preserve Runtime descriptors and structured metadata. Direct transcription
297+ routes store transcript artifacts with source-audio refs, language/prompt hints,
298+ provider/model when available, and bounded route parameters.
299+ Descriptor-provided action links are sanitized to relative Gateway/UI links
300+ before they appear in envelopes; raw external provider URLs should be represented
301+ as trace availability or Gateway-owned trace records.
302+
303+ Content reads can label the access type for Runtime access stats:
304+
305+ ``` bash
306+ curl -sS -H " $AUTH " \
307+ " $BASE_URL /api/gateway/runs/<run_id>/artifacts/<artifact_id>/content?access_action=preview"
308+ ```
309+
310+ Supported access actions are ` content ` , ` preview ` , and ` download ` . The shorter
311+ ` access=preview ` alias is also accepted.
222312
223313Import a server workspace path into a session artifact:
224314
@@ -245,6 +335,12 @@ workspace import/export and `/files/*` helpers require an admin principal.
245335Ordinary users can still upload browser-local files and list/search artifacts in
246336their own routed runtime.
247337
338+ Canonical Gateway server paths use ` rel/path ` for the main workspace root and
339+ ` mount_alias/rel/path ` for approved mounts. When two allowed mounts share the
340+ same basename, Gateway emits deterministic digest-suffixed aliases so the same
341+ public path string can round-trip through ` /files/* ` , artifact import/export,
342+ and Runtime file nodes.
343+
248344## Durable commands (` POST /api/gateway/commands ` )
249345
250346Commands are appended to a durable inbox and applied asynchronously by the runner.
@@ -336,8 +432,9 @@ It also includes a versioned thin-client contract:
336432- ` capabilities.contracts.common ` : shared run start/list/summary/input/history,
337433 ledger, artifact, attachment, workspace, discovery, and provider prompt-cache
338434 controls. ` common.artifacts ` includes run listing/content, session artifact
339- listing, artifact search, workspace import, and workspace export descriptors
340- when available. Permission-sensitive descriptors are principal-aware:
435+ listing, artifact search with ` artifact_envelope_v1 ` , exact stats/facets,
436+ ` artifact_kind ` UI filtering, workspace import, and workspace export
437+ descriptors when available. Permission-sensitive descriptors are principal-aware:
341438 ordinary users see admin-only workspace import/export and provider
342439 prompt-cache controls marked unavailable with ` admin_required ` metadata.
343440- ` capabilities.contracts.common.readiness ` : compact Gateway-owned
@@ -408,6 +505,7 @@ Current direct Gateway endpoints:
408505- ` POST /api/gateway/runs/{run_id}/audio/transcribe `
409506- ` POST /api/gateway/runs/{run_id}/images/generate `
410507- ` POST /api/gateway/runs/{run_id}/images/edit `
508+ - ` POST /api/gateway/runs/{run_id}/images/upscale `
411509- ` POST /api/gateway/runs/{run_id}/videos/generate `
412510- ` POST /api/gateway/runs/{run_id}/videos/from_image `
413511- ` POST /api/gateway/runs/{run_id}/music/generate `
@@ -417,6 +515,7 @@ Current direct Gateway endpoints:
417515- ` GET /api/gateway/audio/music/providers `
418516- ` GET /api/gateway/audio/music/models `
419517- ` GET /api/gateway/vision/provider_models `
518+ - ` GET /api/gateway/vision/adapters `
420519
421520The catalog endpoints proxy AbstractCore Server routes when
422521` ABSTRACTCORE_SERVER_BASE_URL `
@@ -449,8 +548,10 @@ stores the generated image as a run artifact, and returns
449548for progress:
450549
451550- ` run_id ` , ` request_id ` , ` prompt `
452- - optional ` provider ` , ` model ` , ` size ` , ` width ` , ` height ` , and ` format `
453- - ` image_artifact ` : ` {"$artifact", "content_type", "filename", "sha256", "size_bytes"} `
551+ - optional ` provider ` , ` model ` , ` size ` , ` width ` , ` height ` , ` format ` , batch
552+ ` count ` / ` n ` , ` seeds ` , and ordered ` lora_adapters `
553+ - ` image_artifact ` : first generated image for compatibility
554+ - ` image_artifacts ` : full ordered image artifact list for batch generation
454555
455556` size ` , ` width ` , and ` height ` are optional passthrough request overrides. Do
456557not inject a client-side default size. Different image providers/models accept
@@ -468,12 +569,27 @@ Gateway also exposes a direct image-edit sibling route:
468569- ` POST /api/gateway/runs/{run_id}/images/edit `
469570
470571The request uses a source ` image_artifact ` , optional ` mask_artifact ` , the same
471- provider/model and image backend selectors as image generation, and returns an
472- artifact-backed edited image. Thin clients should feature-detect it from
572+ provider/model and image backend selectors as image generation, plus optional
573+ batch ` count ` / ` n ` , ` seeds ` , and ordered ` lora_adapters ` , and returns an
574+ artifact-backed edited image. Batch responses also return ` image_artifacts ` .
575+ Thin clients should feature-detect it from
473576` capabilities.contracts.flow_editor.media.edited_image ` or
474577` capabilities.contracts.assistant.media.edited_image ` . It uses the same
475578child-run ` abstract.progress ` progress contract as direct image generation.
476579
580+ Gateway also exposes a direct image-upscale sibling route:
581+
582+ - ` POST /api/gateway/runs/{run_id}/images/upscale `
583+
584+ The request uses a run-visible source ` image_artifact ` , optional provider/model
585+ selectors, and optional upscaler controls such as ` scale ` , ` resolution ` ,
586+ ` softness ` , ` seed ` , ` quantize ` , and ` vae_tiling ` ; ` resolution ` may be a
587+ shortest-edge integer or a scale factor such as ` 2x ` . Thin clients should
588+ feature-detect it from ` capabilities.contracts.flow_editor.media.upscaled_image `
589+ or ` capabilities.contracts.assistant.media.upscaled_image ` , list models with
590+ ` GET /api/gateway/vision/provider_models?task=image_upscale ` , and stream the
591+ returned child-run ledger for ` abstract.progress ` events.
592+
477593Generated music follows the same direct child-run pattern. Thin clients should
478594discover it from ` capabilities.contracts.flow_editor.media.generated_music ` or
479595` capabilities.contracts.assistant.media.generated_music ` , list providers/models
@@ -483,16 +599,20 @@ from the music catalog routes, and treat the returned `child_run_id` plus
483599Generated video also follows the direct child-run pattern:
484600
485601- ` POST /api/gateway/runs/{run_id}/videos/generate ` uses the Runtime/Core
486- ` output.modality=video ` / ` task=text_to_video ` contract.
602+ ` output.modality=video ` / ` task=text_to_video ` contract and accepts optional
603+ batch ` count ` / ` n ` , ` seeds ` , ordered ` lora_adapters ` , and ` flow_shift ` .
487604- ` POST /api/gateway/runs/{run_id}/videos/from_image ` accepts a run-visible
488- source ` image_artifact ` and uses ` task=image_to_video ` .
605+ source ` image_artifact ` , accepts the same optional batch/adapter/video
606+ control fields, and uses ` task=image_to_video ` .
489607- Thin clients should discover these routes from
490608 ` capabilities.contracts.flow_editor.media.generated_video ` and
491609 ` capabilities.contracts.flow_editor.media.image_to_video ` (or the matching
492610 ` assistant.media.* ` entries), use
493611 ` GET /api/gateway/vision/provider_models?task=text_to_video|image_to_video `
494- for model catalogs, and stream the returned ` child_run_id ` ledger for
495- ` abstract.progress ` events.
612+ for model catalogs, use ` GET /api/gateway/vision/adapters ` for compatible
613+ installed adapter catalogs, stream the returned ` child_run_id ` ledger for
614+ ` abstract.progress ` events, and read ` video_artifacts ` when batch generation
615+ is requested.
496616
497617STT and listen contract notes:
498618
0 commit comments