Repository navigation
launch app with a predefined config - #1114
Merged
Merged
Conversation
Devin T. Currie (DTCurrie)
added this pull request to stack #1115
October 13, 2026 21:50
🦋 Changeset detectedLatest commit: f2d8b05 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Devin T. Currie (DTCurrie)
force-pushed
the
launch-app-with-config
branch
from
October 14, 2026 00:36
d1570c1 to
784d6c0
Compare
Contributor
|
Devin T. Currie (DTCurrie)
force-pushed
the
launch-app-with-config
branch
from
October 14, 2026 14:57
784d6c0 to
810277a
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
launch-app-with-config
branch
3 times, most recently
from
October 15, 2026 19:19
f251847 to
de4849f
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
launch-app-with-config
branch
2 times, most recently
from
October 20, 2026 17:15
362d326 to
a636ff9
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
launch-app-with-config
branch
from
October 21, 2026 16:18
bb671a7 to
1498e24
Compare
…ch-app-with-config
Micheal Parks (micheal-parks)
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets the desktop app connect to a machine on boot from a launch file, so the Viam CLI can open the visualizer for one part with no machine picker involved. This is phase 2 of the CLI launch effort, the next phase adds the
viam machines part visualizecommand that writes the file.Desktop shell
launch_config::find_launch_filereads--launch-file <path>or--launch-file=<path>from argv.read_and_removereads the file, deletes it, then parses it and requiresversionto be the integer 1. Every error names the path and never the contents, and also goes to stderr.LaunchConfigStateholds theLaunchConfigPayload(configorerror, one set) as managed state. Thelaunch_configcommand returns it, ornullwhen the app started with no flag.launch-config-changed, so the running window switches machine without a restart.std::env::args, nottauri-plugin-cli, see Why.Visualization
launchConfig.tsis the version 1 contract:LaunchConfig,LaunchCredentials(access-tokenorapi-key), the command and event names, and the payload shape.parseLaunchConfigvalidates a raw payload and throws a message naming the first bad field or the unsupported version.launchConfigToDialConfmaps it toDialWebRTCConfwith sessions disabled.resolveConnectionpicks what to dial: a launch config always wins over the picker's active config. It also returns the credentials forViamAppProvider, so an access token works with no machine API key.useLaunchConfigwrapsinvokeandlistenbehindisTauri(). Outside Tauri it isreadyimmediately with no config. It exposesready,current, anderror.+layout.sveltederivesdialConfigs,partID, anddialConfigfromresolveConnection, and passesserviceHostand credentials from the launch config when present.Machinestakes alaunchprop. A launched part renders as a read-only entry (machine name, part name, host) and every configSwitchis disabled while launched. A launch error renders in a primeBannerinside arole="alert"wrapper and is logged once per message through the Logs plugin.ConnectionConfigmoves toconnectionConfig.ts.configs.tsanduseConnectionConfigs.svelte.tsimport it instead of each declaring a copy.Why?
Why a file and not argv JSON or a URL scheme?
The file carries a token. Argv is visible to every local user through
ps, and a custom URL scheme leaks the token to OS handler logs and needs an installed app to register on macOS. The CLI writes the file with0600and the app deletes it on read.Why
std::env::argsinstead oftauri-plugin-cli?The single-instance plugin hands the second launch's argv over as a
Vec<String>. One parser serves both the first launch and a relaunch. The CLI plugin would add a dependency, a config block, and a capability for the startup path only.Why does the picker go read-only instead of adding the launched part to the list?
The launched entry carries a short-lived token, so it must not reach IndexedDB. Keeping it out of the editable list means nothing persists it.
Testing
Ran
pnpm check,pnpm test(137 files, 2000 tests),pnpm lint, and insrc-tauri/,cargo clippy --all-targets -- -D warningsandcargo test(7 tests).pnpm tauri:buildproduced the bundle.Added specs for
parseLaunchConfig(both credential types, version mismatch, each missing field, unknown credential type),launchConfigToDialConf,resolveConnection(launch wins, picker alone, neither), anduseLaunchConfig(non-Tauri path, resolved config, Rust error, rejected invoke, parse error, event replacing the config, unlisten on teardown). Rust tests cover both argv spellings, the missing value, andread_and_removeon a version 1 file, a version 2 file, invalid JSON, and a missing path, asserting the file is gone afterwards.Smoke-tested the built binary:
--launch-filepointing at a version 2 file printsLaunch file version 2 is not supported, expected 1to stderr and the file is deleted. A missing path printsCannot read launch file <path>.Not verified: a live connection with each credential type. That needs a CLI-held token, which the next phase produces. The accessibility review could not settle from source whether prime
Switchexposesdisabledto assistive tech.