Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T05:39:36.581Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

dap.rs

77 lines · 2.0 KB · rust
1pub mod adapters;
2pub mod client;
3pub mod debugger_settings;
4pub mod inline_value;
5pub mod proto_conversions;
6mod registry;
7pub mod transport;
8
9use std::net::IpAddr;
10
11pub use dap_types::*;
12use debugger_settings::DebuggerSettings;
13use gpui::App;
14pub use registry::{DapLocator, DapRegistry};
15use serde::Serialize;
16use settings::Settings;
17pub use task::DebugRequest;
18
19pub type ScopeId = u64;
20pub type VariableReference = u64;
21pub type StackFrameId = u64;
22
23#[cfg(any(test, feature = "test-support"))]
24pub use adapters::FakeAdapter;
25use task::{DebugScenario, TcpArgumentsTemplate};
26
27pub async fn configure_tcp_connection(
28    tcp_connection: TcpArgumentsTemplate,
29) -> anyhow::Result<(IpAddr, u16, Option<u64>)> {
30    let host = tcp_connection.host();
31    let timeout = tcp_connection.timeout;
32
33    let port = if let Some(port) = tcp_connection.port {
34        port
35    } else {
36        transport::TcpTransport::port(&tcp_connection).await?
37    };
38
39    Ok((host, port, timeout))
40}
41
42#[derive(Clone, Copy, Serialize)]
43#[serde(rename_all = "snake_case")]
44pub enum TelemetrySpawnLocation {
45    Gutter,
46    ScenarioList,
47    Custom,
48}
49
50pub fn send_telemetry(scenario: &DebugScenario, location: TelemetrySpawnLocation, cx: &App) {
51    let Some(adapter) = cx.global::<DapRegistry>().adapter(&scenario.adapter) else {
52        return;
53    };
54    let dock = DebuggerSettings::get_global(cx).dock;
55    let config = scenario.config.clone();
56    let with_build_task = scenario.build.is_some();
57    let adapter_name = scenario.adapter.clone();
58    cx.spawn(async move |_| {
59        let kind = adapter
60            .request_kind(&config)
61            .await
62            .ok()
63            .map(serde_json::to_value)
64            .and_then(Result::ok);
65
66        telemetry::event!(
67            "Debugger Session Started",
68            spawn_location = location,
69            with_build_task = with_build_task,
70            kind = kind,
71            adapter = adapter_name,
72            dock_position = dock,
73        );
74    })
75    .detach();
76}
77
Served at tenant.openagents/omega Member data and write actions are omitted.