reallink-cli 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/prebuilt/linux-x64/reallink-cli +0 -0
- package/rust/Cargo.lock +2860 -256
- package/rust/Cargo.toml +5 -2
- package/rust/src/main.rs +793 -6
- package/rust/src/unreal.rs +50 -0
package/rust/src/unreal.rs
CHANGED
|
@@ -98,6 +98,7 @@ pub(crate) enum LinkP2PCommands {
|
|
|
98
98
|
Get(LinkP2PGetArgs),
|
|
99
99
|
Wait(LinkP2PWaitArgs),
|
|
100
100
|
Signal(LinkP2PSignalArgs),
|
|
101
|
+
Execute(LinkP2PExecuteArgs),
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
#[derive(Args)]
|
|
@@ -308,6 +309,18 @@ pub(crate) struct LinkConnectArgs {
|
|
|
308
309
|
pub base_url: Option<String>,
|
|
309
310
|
#[arg(long, help = "Bearer token override for agent/API-token usage")]
|
|
310
311
|
pub access_token: Option<String>,
|
|
312
|
+
#[arg(
|
|
313
|
+
long,
|
|
314
|
+
default_value = "127.0.0.1:9040",
|
|
315
|
+
help = "Local listen address for the embedded direct P2P workspace server"
|
|
316
|
+
)]
|
|
317
|
+
pub p2p_listen: String,
|
|
318
|
+
#[arg(
|
|
319
|
+
long,
|
|
320
|
+
default_value = "127.0.0.1:9041",
|
|
321
|
+
help = "Local listen address for the embedded TCP P2P workspace server"
|
|
322
|
+
)]
|
|
323
|
+
pub p2p_tcp_listen: String,
|
|
311
324
|
}
|
|
312
325
|
|
|
313
326
|
#[derive(Clone, Debug, ValueEnum)]
|
|
@@ -443,6 +456,42 @@ pub(crate) struct LinkP2PSignalArgs {
|
|
|
443
456
|
pub access_token: Option<String>,
|
|
444
457
|
}
|
|
445
458
|
|
|
459
|
+
#[derive(Clone, Debug, ValueEnum)]
|
|
460
|
+
pub(crate) enum LinkP2PTargetRole {
|
|
461
|
+
Agent,
|
|
462
|
+
Client,
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
impl LinkP2PTargetRole {
|
|
466
|
+
pub(crate) fn as_api_str(&self) -> &'static str {
|
|
467
|
+
match self {
|
|
468
|
+
Self::Agent => "agent",
|
|
469
|
+
Self::Client => "client",
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
#[derive(Args)]
|
|
475
|
+
pub(crate) struct LinkP2PExecuteArgs {
|
|
476
|
+
#[arg(long, help = "Project ID owning the P2P session")]
|
|
477
|
+
pub project_id: String,
|
|
478
|
+
#[arg(long, help = "P2P session identifier")]
|
|
479
|
+
pub session_id: String,
|
|
480
|
+
#[arg(long, value_enum, help = "Which side of the session to execute against")]
|
|
481
|
+
pub target_role: LinkP2PTargetRole,
|
|
482
|
+
#[arg(long, help = "Workspace tool to run on the peer")]
|
|
483
|
+
pub tool: String,
|
|
484
|
+
#[arg(
|
|
485
|
+
long,
|
|
486
|
+
help = "Inline JSON object or @path/to/file.json carrying the tool input"
|
|
487
|
+
)]
|
|
488
|
+
pub input: Option<String>,
|
|
489
|
+
#[arg(long)]
|
|
490
|
+
pub base_url: Option<String>,
|
|
491
|
+
#[arg(long, help = "Bearer token override for agent/API-token usage")]
|
|
492
|
+
pub access_token: Option<String>,
|
|
493
|
+
}
|
|
494
|
+
|
|
446
495
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
447
496
|
#[serde(rename_all = "camelCase")]
|
|
448
497
|
pub(crate) struct SourceLinkRecord {
|
|
@@ -483,6 +532,7 @@ pub(crate) async fn dispatch(client: &reqwest::Client, command: LinkCommands) ->
|
|
|
483
532
|
LinkP2PCommands::Get(args) => crate::link_p2p_get_command(client, args).await?,
|
|
484
533
|
LinkP2PCommands::Wait(args) => crate::link_p2p_wait_command(client, args).await?,
|
|
485
534
|
LinkP2PCommands::Signal(args) => crate::link_p2p_signal_command(client, args).await?,
|
|
535
|
+
LinkP2PCommands::Execute(args) => crate::link_p2p_execute_command(client, args).await?,
|
|
486
536
|
},
|
|
487
537
|
}
|
|
488
538
|
Ok(())
|