Streaming Hub API

Console examples and manual test workflow

Exercise status, project switching, edits, execution and Save with the repository client.

Alpha
Developer referenceUpdated 2026-10-25

The repository console example connects using public Client/Contracts references. It demonstrates user pairing, coherent reads, a partial edit, runtime execution and tracked Save.

For raw HTTP use PowerShell testing. To create a separate app use your first .NET client.

Run the repository example

Start Core and Tray, and open a copied test project. From the checkout root:

$discovery = Join-Path $env:LOCALAPPDATA 'StreamingHub\runtime\api-discovery.json'
dotnet run --project Examples/ApiClients/StreamingHub.Api.Example -- $discovery status

For --data-dir, set $discovery to that directory's api-discovery.json. Approve API console example in Tray. The console prints Host/project identity, revision and automation IDs.

Supported commands

Replace sample paths and IDs with your test project and selected resources:

dotnet run --project Examples/ApiClients/StreamingHub.Api.Example -- $discovery open 'C:\StreamingHubApiTest\Test.shubproj'
dotnet run --project Examples/ApiClients/StreamingHub.Api.Example -- $discovery switch 'C:\StreamingHubApiTest\Other.shubproj'
dotnet run --project Examples/ApiClients/StreamingHub.Api.Example -- $discovery rename-macro '<macro-id>' 'API test name'
dotnet run --project Examples/ApiClients/StreamingHub.Api.Example -- $discovery run '<automation-id>'
dotnet run --project Examples/ApiClients/StreamingHub.Api.Example -- $discovery save

Use open when Core has no project and switch when it does. A dirty project can refuse switching. Choose a known macro ID for rename; status lists automation IDs only. An approved client can discover macros with the resource-list route in the reference.

rename-macro applies the change but does not save it; save is separate. run executes configured actions, which may contact external services. Choose a harmless test automation.

Every invocation requests only its command's scopes and keeps credentials in memory. Each invocation pairs again, so the sample is not a persistent interactive CLI or command journal.

Test failure handling

ScenarioExpected client behavior
Deny pairingReport denial without reading project data
Cancel a waitStop waiting without claiming Host work was cancelled
Request an ungranted capabilityReport the refusal
Apply against an old revisionPreserve the draft and report a conflict
Restart CoreRead discovery and negotiate again
Lose a mutation responseKeep the original command ID and principal for lookup

The deadline is 110 seconds. Pending password/trust interactions need an authorized responder. --verify belongs to automated disposable fixtures and edits/runs/saves predefined resources; it is not a manual command for a real project.

See partial changes, recovery and streams when adapting this example.