connect_sync
Uploads a script folder to the Roblox BedWars editor and opens or replaces a Code Sync connection, optionally watching for future file changes.
Instructions
Upload a folder immediately and establish or replace the active Code Sync connection. Inputs: sync_token (required string from the BedWars editor Sync tab); directory (optional string, default empty: reuse the previous connected directory; required on first connection); glob_pattern (optional string, default empty: read bwconfig.lua syncGlob, otherwise scripts/**/*.lua); watch (optional boolean, default true: automatically upload future matching file changes); allow_empty (optional boolean, default false: permit clearing remote scripts if no files match); probe (optional boolean, default false: write scripts/zz_sync_probe.lua unless allow_empty=true); probe_message (optional string, default empty: use the generated probe message). Effects: uploads the selected file set; on success retains token, folder, and glob in process memory and starts or stops the watcher according to watch. Removes exact legacy generated helper files. Returns upload status, file details, connection/watcher flags, probe, and removed helpers.
Context: Choose to establish a reusable connection or refresh its token; then use sync_connected without resending inputs. It uploads during connection, so it is not a configuration-only action. sync_directory has the same upload/session behavior but always requires directory. Set watch=false for manual syncing. If legacy-helper cleanup leaves no matching files, an empty deletion upload is permitted even with allow_empty=false. Preview first with preview_directory_sync; use probe=true only for an explicitly requested visible test. Tokens are not persisted or returned. Validation and in-game execution are separate steps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| probe | No | ||
| watch | No | ||
| directory | No | ||
| sync_token | Yes | ||
| allow_empty | No | ||
| glob_pattern | No | ||
| probe_message | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||