Migrate Nostr session sharing to ACP (#10022)
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
This commit is contained in:
@@ -618,11 +618,42 @@ pub struct ExportSessionResponse {
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
/// Import a session from a JSON string.
|
||||
/// Import a session from a JSON string or share link.
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
|
||||
#[request(method = "_goose/unstable/session/import", response = ImportSessionResponse)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ImportSessionRequest {
|
||||
pub data: String,
|
||||
pub input: String,
|
||||
pub source: SessionImportSource,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SessionImportSource {
|
||||
#[default]
|
||||
Auto,
|
||||
Json,
|
||||
Nostr,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
|
||||
#[request(
|
||||
method = "_goose/unstable/session/share/nostr",
|
||||
response = ShareSessionNostrResponse
|
||||
)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ShareSessionNostrRequest {
|
||||
pub session_id: String,
|
||||
pub relays: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcResponse)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ShareSessionNostrResponse {
|
||||
pub deeplink: String,
|
||||
pub nevent: String,
|
||||
pub event_id: String,
|
||||
pub relays: Vec<String>,
|
||||
}
|
||||
|
||||
/// Import session response — metadata about the newly created session.
|
||||
|
||||
@@ -443,8 +443,6 @@ derive_utoipa!(IconTheme as IconThemeSchema);
|
||||
super::routes::session_events::session_cancel,
|
||||
super::routes::session::get_session,
|
||||
super::routes::session::update_session_name,
|
||||
super::routes::session::share_session_nostr,
|
||||
super::routes::session::import_session_nostr,
|
||||
super::routes::session::update_session_user_recipe_values,
|
||||
super::routes::session::fork_session,
|
||||
super::routes::session::get_session_extensions,
|
||||
@@ -514,9 +512,6 @@ derive_utoipa!(IconTheme as IconThemeSchema);
|
||||
super::routes::session_events::SessionReplyRequest,
|
||||
super::routes::session_events::SessionReplyResponse,
|
||||
super::routes::session_events::CancelRequest,
|
||||
super::routes::session::ShareSessionNostrRequest,
|
||||
super::routes::session::ShareSessionNostrResponse,
|
||||
super::routes::session::ImportSessionNostrRequest,
|
||||
super::routes::session::UpdateSessionNameRequest,
|
||||
super::routes::session::UpdateSessionUserRecipeValuesRequest,
|
||||
super::routes::session::UpdateSessionUserRecipeValuesResponse,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::routes::errors::ErrorResponse;
|
||||
use crate::routes::recipe_utils::{apply_recipe_to_agent, build_recipe_with_parameter_values};
|
||||
use crate::state::AppState;
|
||||
use axum::extract::{DefaultBodyLimit, State};
|
||||
use axum::extract::State;
|
||||
use axum::routing::post;
|
||||
use axum::{
|
||||
extract::Path,
|
||||
@@ -11,10 +11,6 @@ use axum::{
|
||||
};
|
||||
use goose::agents::ExtensionConfig;
|
||||
use goose::recipe::Recipe;
|
||||
#[cfg(feature = "nostr")]
|
||||
use goose::session::nostr_share;
|
||||
#[cfg(feature = "nostr")]
|
||||
use goose::session::session_manager::SessionType;
|
||||
use goose::session::{EnabledExtensionsState, Session};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
@@ -40,30 +36,6 @@ pub struct UpdateSessionUserRecipeValuesResponse {
|
||||
recipe: Recipe,
|
||||
}
|
||||
|
||||
#[cfg_attr(not(feature = "nostr"), allow(dead_code))]
|
||||
#[derive(Deserialize, ToSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ShareSessionNostrRequest {
|
||||
#[serde(default)]
|
||||
relays: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ShareSessionNostrResponse {
|
||||
deeplink: String,
|
||||
nevent: String,
|
||||
event_id: String,
|
||||
relays: Vec<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(not(feature = "nostr"), allow(dead_code))]
|
||||
#[derive(Deserialize, ToSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ImportSessionNostrRequest {
|
||||
deeplink: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, ToSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ForkRequest {
|
||||
@@ -229,93 +201,6 @@ async fn update_session_user_recipe_values(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(not(feature = "nostr"), allow(unused_variables))]
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/sessions/{session_id}/share/nostr",
|
||||
request_body = ShareSessionNostrRequest,
|
||||
params(
|
||||
("session_id" = String, Path, description = "Unique identifier for the session")
|
||||
),
|
||||
responses(
|
||||
(status = 200, description = "Session shared to Nostr successfully", body = ShareSessionNostrResponse),
|
||||
(status = 401, description = "Unauthorized - Invalid or missing API key"),
|
||||
(status = 404, description = "Session not found"),
|
||||
(status = 500, description = "Internal server error")
|
||||
),
|
||||
security(
|
||||
("api_key" = [])
|
||||
),
|
||||
tag = "Session Management"
|
||||
)]
|
||||
async fn share_session_nostr(
|
||||
State(state): State<Arc<AppState>>,
|
||||
Path(session_id): Path<String>,
|
||||
Json(request): Json<ShareSessionNostrRequest>,
|
||||
) -> Result<Json<ShareSessionNostrResponse>, StatusCode> {
|
||||
#[cfg(feature = "nostr")]
|
||||
{
|
||||
let exported = state
|
||||
.session_manager()
|
||||
.export_session(&session_id)
|
||||
.await
|
||||
.map_err(|_| StatusCode::NOT_FOUND)?;
|
||||
|
||||
let relays = nostr_share::resolve_relays(request.relays, goose::config::Config::global());
|
||||
let share = nostr_share::publish_session_json(&exported, relays)
|
||||
.await
|
||||
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
|
||||
|
||||
Ok(Json(ShareSessionNostrResponse {
|
||||
deeplink: share.deeplink,
|
||||
nevent: share.nevent,
|
||||
event_id: share.event_id,
|
||||
relays: share.relays,
|
||||
}))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nostr"))]
|
||||
Err(StatusCode::NOT_FOUND)
|
||||
}
|
||||
|
||||
#[cfg_attr(not(feature = "nostr"), allow(unused_variables))]
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/sessions/import/nostr",
|
||||
request_body = ImportSessionNostrRequest,
|
||||
responses(
|
||||
(status = 200, description = "Nostr shared session imported successfully", body = Session),
|
||||
(status = 401, description = "Unauthorized - Invalid or missing API key"),
|
||||
(status = 400, description = "Bad request - Invalid Nostr share link"),
|
||||
(status = 500, description = "Internal server error")
|
||||
),
|
||||
security(
|
||||
("api_key" = [])
|
||||
),
|
||||
tag = "Session Management"
|
||||
)]
|
||||
async fn import_session_nostr(
|
||||
State(state): State<Arc<AppState>>,
|
||||
Json(request): Json<ImportSessionNostrRequest>,
|
||||
) -> Result<Json<Session>, StatusCode> {
|
||||
#[cfg(feature = "nostr")]
|
||||
{
|
||||
let json = nostr_share::import_session_json_from_deeplink(&request.deeplink)
|
||||
.await
|
||||
.map_err(|_| StatusCode::BAD_REQUEST)?;
|
||||
let session = state
|
||||
.session_manager()
|
||||
.import_session(&json, Some(SessionType::User))
|
||||
.await
|
||||
.map_err(|_| StatusCode::BAD_REQUEST)?;
|
||||
|
||||
Ok(Json(session))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nostr"))]
|
||||
Err(StatusCode::NOT_FOUND)
|
||||
}
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/sessions/{session_id}/fork",
|
||||
@@ -453,14 +338,6 @@ async fn get_session_extensions(
|
||||
pub fn routes(state: Arc<AppState>) -> Router {
|
||||
Router::new()
|
||||
.route("/sessions/{session_id}", get(get_session))
|
||||
.route(
|
||||
"/sessions/{session_id}/share/nostr",
|
||||
post(share_session_nostr).layer(DefaultBodyLimit::max(25 * 1024 * 1024)),
|
||||
)
|
||||
.route(
|
||||
"/sessions/import/nostr",
|
||||
post(import_session_nostr).layer(DefaultBodyLimit::max(25 * 1024 * 1024)),
|
||||
)
|
||||
.route("/sessions/{session_id}/name", put(update_session_name))
|
||||
.route(
|
||||
"/sessions/{session_id}/user_recipe_values",
|
||||
|
||||
@@ -215,6 +215,11 @@
|
||||
"requestType": "ImportSessionRequest_unstable",
|
||||
"responseType": "ImportSessionResponse_unstable"
|
||||
},
|
||||
{
|
||||
"method": "_goose/unstable/session/share/nostr",
|
||||
"requestType": "ShareSessionNostrRequest_unstable",
|
||||
"responseType": "ShareSessionNostrResponse_unstable"
|
||||
},
|
||||
{
|
||||
"method": "_goose/unstable/recipes/encode",
|
||||
"requestType": "EncodeRecipeRequest_unstable",
|
||||
|
||||
@@ -2766,17 +2766,29 @@
|
||||
"ImportSessionRequest_unstable": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"input": {
|
||||
"type": "string"
|
||||
},
|
||||
"source": {
|
||||
"$ref": "#/$defs/SessionImportSource"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"data"
|
||||
"input",
|
||||
"source"
|
||||
],
|
||||
"description": "Import a session from a JSON string.",
|
||||
"description": "Import a session from a JSON string or share link.",
|
||||
"x-side": "agent",
|
||||
"x-method": "_goose/unstable/session/import"
|
||||
},
|
||||
"SessionImportSource": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"auto",
|
||||
"json",
|
||||
"nostr"
|
||||
]
|
||||
},
|
||||
"ImportSessionResponse_unstable": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -2808,6 +2820,54 @@
|
||||
"x-side": "agent",
|
||||
"x-method": "_goose/unstable/session/import"
|
||||
},
|
||||
"ShareSessionNostrRequest_unstable": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
},
|
||||
"relays": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessionId",
|
||||
"relays"
|
||||
],
|
||||
"x-side": "agent",
|
||||
"x-method": "_goose/unstable/session/share/nostr"
|
||||
},
|
||||
"ShareSessionNostrResponse_unstable": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"deeplink": {
|
||||
"type": "string"
|
||||
},
|
||||
"nevent": {
|
||||
"type": "string"
|
||||
},
|
||||
"eventId": {
|
||||
"type": "string"
|
||||
},
|
||||
"relays": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"deeplink",
|
||||
"nevent",
|
||||
"eventId",
|
||||
"relays"
|
||||
],
|
||||
"x-side": "agent",
|
||||
"x-method": "_goose/unstable/session/share/nostr"
|
||||
},
|
||||
"EncodeRecipeRequest_unstable": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -5525,6 +5585,15 @@
|
||||
"description": "Params for _goose/unstable/session/import",
|
||||
"title": "ImportSessionRequest_unstable"
|
||||
},
|
||||
{
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/$defs/ShareSessionNostrRequest_unstable"
|
||||
}
|
||||
],
|
||||
"description": "Params for _goose/unstable/session/share/nostr",
|
||||
"title": "ShareSessionNostrRequest_unstable"
|
||||
},
|
||||
{
|
||||
"allOf": [
|
||||
{
|
||||
@@ -6199,6 +6268,14 @@
|
||||
],
|
||||
"title": "ImportSessionResponse_unstable"
|
||||
},
|
||||
{
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/$defs/ShareSessionNostrResponse_unstable"
|
||||
}
|
||||
],
|
||||
"title": "ShareSessionNostrResponse_unstable"
|
||||
},
|
||||
{
|
||||
"allOf": [
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ use crate::providers::inventory::{
|
||||
};
|
||||
use crate::scheduler_trait::SchedulerTrait;
|
||||
use crate::session::{
|
||||
EnabledExtensionsState, ExtensionData, ExtensionState, Session, SessionManager,
|
||||
EnabledExtensionsState, ExtensionData, ExtensionState, Session, SessionManager, SessionType,
|
||||
};
|
||||
use crate::source_roots::SourceRoot;
|
||||
use crate::utils::sanitize_unicode_tags;
|
||||
|
||||
@@ -360,6 +360,14 @@ impl GooseAcpAgent {
|
||||
self.on_import_session(req).await
|
||||
}
|
||||
|
||||
#[custom_method(ShareSessionNostrRequest)]
|
||||
async fn dispatch_share_session_nostr(
|
||||
&self,
|
||||
req: ShareSessionNostrRequest,
|
||||
) -> Result<ShareSessionNostrResponse, agent_client_protocol::Error> {
|
||||
self.on_share_session_nostr(req).await
|
||||
}
|
||||
|
||||
#[custom_method(EncodeRecipeRequest)]
|
||||
async fn dispatch_encode_recipe(
|
||||
&self,
|
||||
|
||||
@@ -124,9 +124,23 @@ impl GooseAcpAgent {
|
||||
&self,
|
||||
req: ImportSessionRequest,
|
||||
) -> Result<ImportSessionResponse, agent_client_protocol::Error> {
|
||||
let is_nostr = match req.source {
|
||||
SessionImportSource::Auto => is_nostr_session_link(&req.input),
|
||||
SessionImportSource::Json => false,
|
||||
SessionImportSource::Nostr => true,
|
||||
};
|
||||
let (data, session_type) = if is_nostr {
|
||||
(
|
||||
import_nostr_session_json(&req.input).await?,
|
||||
Some(SessionType::User),
|
||||
)
|
||||
} else {
|
||||
(req.input, None)
|
||||
};
|
||||
|
||||
let session = self
|
||||
.session_manager
|
||||
.import_session(&req.data, None)
|
||||
.import_session(&data, session_type)
|
||||
.await
|
||||
.internal_err()?;
|
||||
|
||||
@@ -140,6 +154,26 @@ impl GooseAcpAgent {
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) async fn on_share_session_nostr(
|
||||
&self,
|
||||
req: ShareSessionNostrRequest,
|
||||
) -> Result<ShareSessionNostrResponse, agent_client_protocol::Error> {
|
||||
let data = self
|
||||
.session_manager
|
||||
.export_session(&req.session_id)
|
||||
.await
|
||||
.internal_err()?;
|
||||
|
||||
let share = publish_session_to_nostr(&data, req.relays).await?;
|
||||
|
||||
Ok(ShareSessionNostrResponse {
|
||||
deeplink: share.deeplink,
|
||||
nevent: share.nevent,
|
||||
event_id: share.event_id,
|
||||
relays: share.relays,
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) async fn on_get_session_info(
|
||||
&self,
|
||||
req: GetSessionInfoRequest,
|
||||
@@ -237,3 +271,55 @@ impl GooseAcpAgent {
|
||||
Ok(EmptyResponse {})
|
||||
}
|
||||
}
|
||||
|
||||
fn is_nostr_session_link(input: &str) -> bool {
|
||||
input.trim_start().starts_with("goose://sessions/nostr")
|
||||
}
|
||||
|
||||
#[cfg(feature = "nostr")]
|
||||
async fn import_nostr_session_json(deeplink: &str) -> Result<String, agent_client_protocol::Error> {
|
||||
crate::session::nostr_share::import_session_json_from_deeplink(deeplink)
|
||||
.await
|
||||
.invalid_params_err()
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nostr"))]
|
||||
async fn import_nostr_session_json(
|
||||
_deeplink: &str,
|
||||
) -> Result<String, agent_client_protocol::Error> {
|
||||
Err(agent_client_protocol::Error::invalid_params()
|
||||
.data("Nostr session import is not available in this build"))
|
||||
}
|
||||
|
||||
#[cfg(feature = "nostr")]
|
||||
async fn publish_session_to_nostr(
|
||||
data: &str,
|
||||
relays: Vec<String>,
|
||||
) -> Result<NostrSessionShare, agent_client_protocol::Error> {
|
||||
let relays = crate::session::nostr_share::resolve_relays(relays, Config::global());
|
||||
let share = crate::session::nostr_share::publish_session_json(data, relays)
|
||||
.await
|
||||
.internal_err()?;
|
||||
Ok(NostrSessionShare {
|
||||
deeplink: share.deeplink,
|
||||
nevent: share.nevent,
|
||||
event_id: share.event_id,
|
||||
relays: share.relays,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nostr"))]
|
||||
async fn publish_session_to_nostr(
|
||||
_data: &str,
|
||||
_relays: Vec<String>,
|
||||
) -> Result<NostrSessionShare, agent_client_protocol::Error> {
|
||||
Err(agent_client_protocol::Error::invalid_params()
|
||||
.data("Nostr session sharing is not available in this build"))
|
||||
}
|
||||
|
||||
struct NostrSessionShare {
|
||||
deeplink: String,
|
||||
nevent: String,
|
||||
event_id: String,
|
||||
relays: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -2894,50 +2894,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/import/nostr": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"Session Management"
|
||||
],
|
||||
"operationId": "import_session_nostr",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ImportSessionNostrRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Nostr shared session imported successfully",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Session"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request - Invalid Nostr share link"
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized - Invalid or missing API key"
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/sessions/{id}/cancel": {
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -3258,61 +3214,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/share/nostr": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"Session Management"
|
||||
],
|
||||
"operationId": "share_session_nostr",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"description": "Unique identifier for the session",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ShareSessionNostrRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Session shared to Nostr successfully",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ShareSessionNostrResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized - Invalid or missing API key"
|
||||
},
|
||||
"404": {
|
||||
"description": "Session not found"
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/user_recipe_values": {
|
||||
"put": {
|
||||
"tags": [
|
||||
@@ -5443,17 +5344,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ImportSessionNostrRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"deeplink"
|
||||
],
|
||||
"properties": {
|
||||
"deeplink": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"InferenceMetadata": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -7980,43 +7870,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ShareSessionNostrRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"relays": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ShareSessionNostrResponse": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"deeplink",
|
||||
"nevent",
|
||||
"eventId",
|
||||
"relays"
|
||||
],
|
||||
"properties": {
|
||||
"deeplink": {
|
||||
"type": "string"
|
||||
},
|
||||
"eventId": {
|
||||
"type": "string"
|
||||
},
|
||||
"nevent": {
|
||||
"type": "string"
|
||||
},
|
||||
"relays": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"SlashCommand": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
NewSessionRequest,
|
||||
SessionInfo,
|
||||
} from '@agentclientprotocol/sdk';
|
||||
import type { GooseExtension } from '@aaif/goose-sdk';
|
||||
import type { GooseExtension, SessionImportSource } from '@aaif/goose-sdk';
|
||||
import { getAcpClient } from './acpConnection';
|
||||
import { DEFAULT_CHAT_TITLE } from '../contexts/ChatContext';
|
||||
import type { ExtensionLoadResult, Session } from '../api';
|
||||
@@ -301,7 +301,15 @@ export async function acpExportSession(sessionId: string): Promise<string> {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function acpImportSession(data: string): Promise<void> {
|
||||
export async function acpImportSession(
|
||||
input: string,
|
||||
source: SessionImportSource
|
||||
): Promise<void> {
|
||||
const client = await getAcpClient();
|
||||
await client.goose.sessionImport_unstable({ data });
|
||||
await client.goose.sessionImport_unstable({ input, source });
|
||||
}
|
||||
|
||||
export async function acpShareSessionNostr(sessionId: string, relays: string[]) {
|
||||
const client = await getAcpClient();
|
||||
return await client.goose.sessionShareNostr_unstable({ sessionId, relays });
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -648,10 +648,6 @@ export type ImageContent = {
|
||||
mimeType: string;
|
||||
};
|
||||
|
||||
export type ImportSessionNostrRequest = {
|
||||
deeplink: string;
|
||||
};
|
||||
|
||||
export type InferenceMetadata = {
|
||||
provider: string;
|
||||
requestedModel: string;
|
||||
@@ -1448,17 +1444,6 @@ export type SetupResponse = {
|
||||
success: boolean;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrRequest = {
|
||||
relays?: Array<string>;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrResponse = {
|
||||
deeplink: string;
|
||||
eventId: string;
|
||||
nevent: string;
|
||||
relays: Array<string>;
|
||||
};
|
||||
|
||||
export type SlashCommand = {
|
||||
command: string;
|
||||
command_type: CommandType;
|
||||
@@ -4060,37 +4045,6 @@ export type UnpauseScheduleResponses = {
|
||||
|
||||
export type UnpauseScheduleResponse = UnpauseScheduleResponses[keyof UnpauseScheduleResponses];
|
||||
|
||||
export type ImportSessionNostrData = {
|
||||
body: ImportSessionNostrRequest;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/sessions/import/nostr';
|
||||
};
|
||||
|
||||
export type ImportSessionNostrErrors = {
|
||||
/**
|
||||
* Bad request - Invalid Nostr share link
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* Unauthorized - Invalid or missing API key
|
||||
*/
|
||||
401: unknown;
|
||||
/**
|
||||
* Internal server error
|
||||
*/
|
||||
500: unknown;
|
||||
};
|
||||
|
||||
export type ImportSessionNostrResponses = {
|
||||
/**
|
||||
* Nostr shared session imported successfully
|
||||
*/
|
||||
200: Session;
|
||||
};
|
||||
|
||||
export type ImportSessionNostrResponse = ImportSessionNostrResponses[keyof ImportSessionNostrResponses];
|
||||
|
||||
export type SessionCancelData = {
|
||||
body: CancelRequest;
|
||||
path: {
|
||||
@@ -4328,42 +4282,6 @@ export type UpdateSessionNameResponses = {
|
||||
200: unknown;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrData = {
|
||||
body: ShareSessionNostrRequest;
|
||||
path: {
|
||||
/**
|
||||
* Unique identifier for the session
|
||||
*/
|
||||
session_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/sessions/{session_id}/share/nostr';
|
||||
};
|
||||
|
||||
export type ShareSessionNostrErrors = {
|
||||
/**
|
||||
* Unauthorized - Invalid or missing API key
|
||||
*/
|
||||
401: unknown;
|
||||
/**
|
||||
* Session not found
|
||||
*/
|
||||
404: unknown;
|
||||
/**
|
||||
* Internal server error
|
||||
*/
|
||||
500: unknown;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrResponses = {
|
||||
/**
|
||||
* Session shared to Nostr successfully
|
||||
*/
|
||||
200: ShareSessionNostrResponse;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrResponse2 = ShareSessionNostrResponses[keyof ShareSessionNostrResponses];
|
||||
|
||||
export type UpdateSessionUserRecipeValuesData = {
|
||||
body: UpdateSessionUserRecipeValuesRequest;
|
||||
path: {
|
||||
|
||||
@@ -34,7 +34,6 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '../ui/dialog';
|
||||
import { importSessionNostr, shareSessionNostr } from '../../api';
|
||||
import { getTunnelStatus } from '../../api/sdk.gen';
|
||||
import {
|
||||
acpDeleteSession,
|
||||
@@ -43,6 +42,7 @@ import {
|
||||
acpImportSession,
|
||||
acpListSessions,
|
||||
acpRenameSession,
|
||||
acpShareSessionNostr,
|
||||
type SessionListItem,
|
||||
} from '../../acp/sessions';
|
||||
import { acpChatSessionActions } from '../../acp/chatSessionStore';
|
||||
@@ -525,12 +525,8 @@ const SessionListView: React.FC<SessionListViewProps> = React.memo(
|
||||
e.stopPropagation();
|
||||
setSharingSessionId(session.id);
|
||||
try {
|
||||
const response = await shareSessionNostr({
|
||||
path: { session_id: session.id },
|
||||
body: {},
|
||||
throwOnError: true,
|
||||
});
|
||||
setShareLink(response.data.deeplink);
|
||||
const response = await acpShareSessionNostr(session.id, []);
|
||||
setShareLink(response.deeplink);
|
||||
setShowShareLinkModal(true);
|
||||
toast.success(intl.formatMessage(i18n.shareNostrSuccess));
|
||||
} catch (error) {
|
||||
@@ -552,7 +548,7 @@ const SessionListView: React.FC<SessionListViewProps> = React.memo(
|
||||
toast.error(intl.formatMessage(i18n.importFailed, { error: result.error }));
|
||||
return;
|
||||
}
|
||||
await acpImportSession(result.contents);
|
||||
await acpImportSession(result.contents, 'json');
|
||||
toast.success(intl.formatMessage(i18n.importSuccess));
|
||||
window.dispatchEvent(new CustomEvent(AppEvents.SESSION_CREATED));
|
||||
await loadSessions();
|
||||
@@ -573,10 +569,7 @@ const SessionListView: React.FC<SessionListViewProps> = React.memo(
|
||||
|
||||
setIsImportingNostr(true);
|
||||
try {
|
||||
await importSessionNostr({
|
||||
body: { deeplink },
|
||||
throwOnError: true,
|
||||
});
|
||||
await acpImportSession(deeplink, 'nostr');
|
||||
setNostrImportLink('');
|
||||
setShowImportLinkModal(false);
|
||||
toast.success(intl.formatMessage(i18n.importSuccess));
|
||||
@@ -605,7 +598,7 @@ const SessionListView: React.FC<SessionListViewProps> = React.memo(
|
||||
|
||||
try {
|
||||
const json = await file.text();
|
||||
await acpImportSession(json);
|
||||
await acpImportSession(json, 'json');
|
||||
|
||||
toast.success(intl.formatMessage(i18n.importSuccess));
|
||||
window.dispatchEvent(new CustomEvent(AppEvents.SESSION_CREATED));
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { importSessionNostr } from './api';
|
||||
import { acpImportSession } from './acp/sessions';
|
||||
|
||||
/**
|
||||
* Imports a session from an encrypted Nostr deep link.
|
||||
*/
|
||||
export async function importNostrSessionFromDeepLink(url: string): Promise<void> {
|
||||
await importSessionNostr({
|
||||
body: { deeplink: url },
|
||||
throwOnError: true,
|
||||
});
|
||||
await acpImportSession(url, 'nostr');
|
||||
}
|
||||
|
||||
@@ -144,6 +144,8 @@ import type {
|
||||
SetConfigExtensionEnabledRequest_unstable,
|
||||
SetRecipeSlashCommandRequest_unstable,
|
||||
SetSessionSystemPromptRequest_unstable,
|
||||
ShareSessionNostrRequest_unstable,
|
||||
ShareSessionNostrResponse_unstable,
|
||||
SteerSessionRequest_unstable,
|
||||
SteerSessionResponse_unstable,
|
||||
TruncateSessionConversationRequest_unstable,
|
||||
@@ -212,6 +214,7 @@ import {
|
||||
zRunScheduleNowResponse_unstable,
|
||||
zSaveRecipeResponse_unstable,
|
||||
zScanRecipeResponse_unstable,
|
||||
zShareSessionNostrResponse_unstable,
|
||||
zSteerSessionResponse_unstable,
|
||||
zUpdateScheduleResponse_unstable,
|
||||
zUpdateSourceResponse_unstable,
|
||||
@@ -676,6 +679,18 @@ export class GooseExtClient {
|
||||
) as ImportSessionResponse_unstable;
|
||||
}
|
||||
|
||||
async sessionShareNostr_unstable(
|
||||
params: ShareSessionNostrRequest_unstable,
|
||||
): Promise<ShareSessionNostrResponse_unstable> {
|
||||
const raw = await this.conn.extMethod(
|
||||
"_goose/unstable/session/share/nostr",
|
||||
params,
|
||||
);
|
||||
return zShareSessionNostrResponse_unstable.parse(
|
||||
raw,
|
||||
) as ShareSessionNostrResponse_unstable;
|
||||
}
|
||||
|
||||
async recipesEncode_unstable(
|
||||
params: EncodeRecipeRequest_unstable,
|
||||
): Promise<EncodeRecipeResponse_unstable> {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1151,12 +1151,15 @@ export type ExportSessionResponse_unstable = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Import a session from a JSON string.
|
||||
* Import a session from a JSON string or share link.
|
||||
*/
|
||||
export type ImportSessionRequest_unstable = {
|
||||
data: string;
|
||||
input: string;
|
||||
source: SessionImportSource;
|
||||
};
|
||||
|
||||
export type SessionImportSource = 'auto' | 'json' | 'nostr';
|
||||
|
||||
/**
|
||||
* Import session response — metadata about the newly created session.
|
||||
*/
|
||||
@@ -1167,6 +1170,18 @@ export type ImportSessionResponse_unstable = {
|
||||
messageCount: number;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrRequest_unstable = {
|
||||
sessionId: string;
|
||||
relays: Array<string>;
|
||||
};
|
||||
|
||||
export type ShareSessionNostrResponse_unstable = {
|
||||
deeplink: string;
|
||||
nevent: string;
|
||||
eventId: string;
|
||||
relays: Array<string>;
|
||||
};
|
||||
|
||||
export type EncodeRecipeRequest_unstable = {
|
||||
recipe: RecipeDto;
|
||||
};
|
||||
@@ -2019,14 +2034,14 @@ export type RecipeParamsAction = 'submit' | 'cancel';
|
||||
export type ExtRequest = {
|
||||
id: string;
|
||||
method: string;
|
||||
params?: AddSessionExtensionRequest_unstable | RemoveSessionExtensionRequest_unstable | GetToolsRequest_unstable | GooseToolCallRequest_unstable | ReadResourceRequest_unstable | AppsListRequest_unstable | AppsExportRequest_unstable | AppsImportRequest_unstable | UpdateWorkingDirRequest_unstable | SetSessionSystemPromptRequest_unstable | SteerSessionRequest_unstable | DiagnosticsGetRequest_unstable | DeleteSessionRequest | GetConfigExtensionsRequest_unstable | GetAvailableExtensionsRequest_unstable | AddConfigExtensionRequest_unstable | RemoveConfigExtensionRequest_unstable | SetConfigExtensionEnabledRequest_unstable | GetSessionExtensionsRequest_unstable | ListProvidersRequest_unstable | ProviderSupportedModelsListRequest_unstable | ProviderCatalogListRequest_unstable | ProviderSetupCatalogListRequest_unstable | ProviderCatalogTemplateRequest_unstable | CustomProviderCreateRequest_unstable | CustomProviderReadRequest_unstable | CustomProviderUpdateRequest_unstable | CustomProviderDeleteRequest_unstable | RefreshProviderInventoryRequest_unstable | ProviderConfigReadRequest_unstable | ProviderConfigStatusRequest_unstable | ProviderConfigSaveRequest_unstable | ProviderConfigDeleteRequest_unstable | ProviderConfigAuthenticateRequest_unstable | PreferencesReadRequest_unstable | PreferencesSaveRequest_unstable | PreferencesRemoveRequest_unstable | DefaultsReadRequest_unstable | DefaultsSaveRequest_unstable | OnboardingImportScanRequest_unstable | OnboardingImportApplyRequest_unstable | ExportSessionRequest_unstable | ImportSessionRequest_unstable | EncodeRecipeRequest_unstable | DecodeRecipeRequest_unstable | ScanRecipeRequest_unstable | ListRecipesRequest_unstable | DeleteRecipeRequest_unstable | ScheduleRecipeRequest_unstable | SetRecipeSlashCommandRequest_unstable | SaveRecipeRequest_unstable | ParseRecipeRequest_unstable | RecipeToYamlRequest_unstable | ListSchedulesRequest_unstable | ListScheduleSessionsRequest_unstable | CreateScheduleRequest_unstable | DeleteScheduleRequest_unstable | PauseScheduleRequest_unstable | UnpauseScheduleRequest_unstable | UpdateScheduleRequest_unstable | RunScheduleNowRequest_unstable | KillRunningJobRequest_unstable | InspectRunningJobRequest_unstable | GetSessionInfoRequest_unstable | TruncateSessionConversationRequest_unstable | UpdateSessionProjectRequest_unstable | RenameSessionRequest_unstable | ArchiveSessionRequest_unstable | UnarchiveSessionRequest_unstable | CreateSourceRequest_unstable | ListSourcesRequest_unstable | ListAgentMentionsRequest_unstable | ListSlashCommandsRequest_unstable | UpdateSourceRequest_unstable | DeleteSourceRequest_unstable | ExportSourceRequest_unstable | ImportSourcesRequest_unstable | DictationTranscribeRequest_unstable | DictationConfigRequest_unstable | DictationSecretSaveRequest_unstable | DictationSecretDeleteRequest_unstable | DictationModelsListRequest_unstable | DictationModelDownloadRequest_unstable | DictationModelDownloadProgressRequest_unstable | DictationModelCancelRequest_unstable | DictationModelDeleteRequest_unstable | DictationModelSelectRequest_unstable | {
|
||||
params?: AddSessionExtensionRequest_unstable | RemoveSessionExtensionRequest_unstable | GetToolsRequest_unstable | GooseToolCallRequest_unstable | ReadResourceRequest_unstable | AppsListRequest_unstable | AppsExportRequest_unstable | AppsImportRequest_unstable | UpdateWorkingDirRequest_unstable | SetSessionSystemPromptRequest_unstable | SteerSessionRequest_unstable | DiagnosticsGetRequest_unstable | DeleteSessionRequest | GetConfigExtensionsRequest_unstable | GetAvailableExtensionsRequest_unstable | AddConfigExtensionRequest_unstable | RemoveConfigExtensionRequest_unstable | SetConfigExtensionEnabledRequest_unstable | GetSessionExtensionsRequest_unstable | ListProvidersRequest_unstable | ProviderSupportedModelsListRequest_unstable | ProviderCatalogListRequest_unstable | ProviderSetupCatalogListRequest_unstable | ProviderCatalogTemplateRequest_unstable | CustomProviderCreateRequest_unstable | CustomProviderReadRequest_unstable | CustomProviderUpdateRequest_unstable | CustomProviderDeleteRequest_unstable | RefreshProviderInventoryRequest_unstable | ProviderConfigReadRequest_unstable | ProviderConfigStatusRequest_unstable | ProviderConfigSaveRequest_unstable | ProviderConfigDeleteRequest_unstable | ProviderConfigAuthenticateRequest_unstable | PreferencesReadRequest_unstable | PreferencesSaveRequest_unstable | PreferencesRemoveRequest_unstable | DefaultsReadRequest_unstable | DefaultsSaveRequest_unstable | OnboardingImportScanRequest_unstable | OnboardingImportApplyRequest_unstable | ExportSessionRequest_unstable | ImportSessionRequest_unstable | ShareSessionNostrRequest_unstable | EncodeRecipeRequest_unstable | DecodeRecipeRequest_unstable | ScanRecipeRequest_unstable | ListRecipesRequest_unstable | DeleteRecipeRequest_unstable | ScheduleRecipeRequest_unstable | SetRecipeSlashCommandRequest_unstable | SaveRecipeRequest_unstable | ParseRecipeRequest_unstable | RecipeToYamlRequest_unstable | ListSchedulesRequest_unstable | ListScheduleSessionsRequest_unstable | CreateScheduleRequest_unstable | DeleteScheduleRequest_unstable | PauseScheduleRequest_unstable | UnpauseScheduleRequest_unstable | UpdateScheduleRequest_unstable | RunScheduleNowRequest_unstable | KillRunningJobRequest_unstable | InspectRunningJobRequest_unstable | GetSessionInfoRequest_unstable | TruncateSessionConversationRequest_unstable | UpdateSessionProjectRequest_unstable | RenameSessionRequest_unstable | ArchiveSessionRequest_unstable | UnarchiveSessionRequest_unstable | CreateSourceRequest_unstable | ListSourcesRequest_unstable | ListAgentMentionsRequest_unstable | ListSlashCommandsRequest_unstable | UpdateSourceRequest_unstable | DeleteSourceRequest_unstable | ExportSourceRequest_unstable | ImportSourcesRequest_unstable | DictationTranscribeRequest_unstable | DictationConfigRequest_unstable | DictationSecretSaveRequest_unstable | DictationSecretDeleteRequest_unstable | DictationModelsListRequest_unstable | DictationModelDownloadRequest_unstable | DictationModelDownloadProgressRequest_unstable | DictationModelCancelRequest_unstable | DictationModelDeleteRequest_unstable | DictationModelSelectRequest_unstable | {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type ExtResponse = {
|
||||
id: string;
|
||||
result?: EmptyResponse | GetToolsResponse_unstable | GooseToolCallResponse_unstable | ReadResourceResponse_unstable | AppsListResponse_unstable | AppsExportResponse_unstable | AppsImportResponse_unstable | SteerSessionResponse_unstable | DiagnosticsGetResponse_unstable | GetConfigExtensionsResponse_unstable | GetAvailableExtensionsResponse_unstable | GetSessionExtensionsResponse_unstable | ListProvidersResponse_unstable | ProviderSupportedModelsListResponse_unstable | ProviderCatalogListResponse_unstable | ProviderSetupCatalogListResponse_unstable | ProviderCatalogTemplateResponse_unstable | CustomProviderCreateResponse_unstable | CustomProviderReadResponse_unstable | CustomProviderUpdateResponse_unstable | CustomProviderDeleteResponse_unstable | RefreshProviderInventoryResponse_unstable | ProviderConfigReadResponse_unstable | ProviderConfigStatusResponse_unstable | ProviderConfigChangeResponse_unstable | PreferencesReadResponse_unstable | DefaultsReadResponse_unstable | OnboardingImportScanResponse_unstable | OnboardingImportApplyResponse_unstable | ExportSessionResponse_unstable | ImportSessionResponse_unstable | EncodeRecipeResponse_unstable | DecodeRecipeResponse_unstable | ScanRecipeResponse_unstable | ListRecipesResponse_unstable | SaveRecipeResponse_unstable | ParseRecipeResponse_unstable | RecipeToYamlResponse_unstable | ListSchedulesResponse_unstable | ListScheduleSessionsResponse_unstable | CreateScheduleResponse_unstable | UpdateScheduleResponse_unstable | RunScheduleNowResponse_unstable | KillRunningJobResponse_unstable | InspectRunningJobResponse_unstable | GetSessionInfoResponse_unstable | CreateSourceResponse_unstable | ListSourcesResponse_unstable | ListAgentMentionsResponse_unstable | ListSlashCommandsResponse_unstable | UpdateSourceResponse_unstable | ExportSourceResponse_unstable | ImportSourcesResponse_unstable | DictationTranscribeResponse_unstable | DictationConfigResponse_unstable | DictationModelsListResponse_unstable | DictationModelDownloadProgressResponse_unstable | unknown;
|
||||
result?: EmptyResponse | GetToolsResponse_unstable | GooseToolCallResponse_unstable | ReadResourceResponse_unstable | AppsListResponse_unstable | AppsExportResponse_unstable | AppsImportResponse_unstable | SteerSessionResponse_unstable | DiagnosticsGetResponse_unstable | GetConfigExtensionsResponse_unstable | GetAvailableExtensionsResponse_unstable | GetSessionExtensionsResponse_unstable | ListProvidersResponse_unstable | ProviderSupportedModelsListResponse_unstable | ProviderCatalogListResponse_unstable | ProviderSetupCatalogListResponse_unstable | ProviderCatalogTemplateResponse_unstable | CustomProviderCreateResponse_unstable | CustomProviderReadResponse_unstable | CustomProviderUpdateResponse_unstable | CustomProviderDeleteResponse_unstable | RefreshProviderInventoryResponse_unstable | ProviderConfigReadResponse_unstable | ProviderConfigStatusResponse_unstable | ProviderConfigChangeResponse_unstable | PreferencesReadResponse_unstable | DefaultsReadResponse_unstable | OnboardingImportScanResponse_unstable | OnboardingImportApplyResponse_unstable | ExportSessionResponse_unstable | ImportSessionResponse_unstable | ShareSessionNostrResponse_unstable | EncodeRecipeResponse_unstable | DecodeRecipeResponse_unstable | ScanRecipeResponse_unstable | ListRecipesResponse_unstable | SaveRecipeResponse_unstable | ParseRecipeResponse_unstable | RecipeToYamlResponse_unstable | ListSchedulesResponse_unstable | ListScheduleSessionsResponse_unstable | CreateScheduleResponse_unstable | UpdateScheduleResponse_unstable | RunScheduleNowResponse_unstable | KillRunningJobResponse_unstable | InspectRunningJobResponse_unstable | GetSessionInfoResponse_unstable | CreateSourceResponse_unstable | ListSourcesResponse_unstable | ListAgentMentionsResponse_unstable | ListSlashCommandsResponse_unstable | UpdateSourceResponse_unstable | ExportSourceResponse_unstable | ImportSourcesResponse_unstable | DictationTranscribeResponse_unstable | DictationConfigResponse_unstable | DictationModelsListResponse_unstable | DictationModelDownloadProgressResponse_unstable | unknown;
|
||||
} | {
|
||||
error: {
|
||||
code: number;
|
||||
|
||||
@@ -1147,11 +1147,18 @@ export const zExportSessionResponse_unstable = z.object({
|
||||
data: z.string()
|
||||
});
|
||||
|
||||
export const zSessionImportSource = z.enum([
|
||||
'auto',
|
||||
'json',
|
||||
'nostr'
|
||||
]);
|
||||
|
||||
/**
|
||||
* Import a session from a JSON string.
|
||||
* Import a session from a JSON string or share link.
|
||||
*/
|
||||
export const zImportSessionRequest_unstable = z.object({
|
||||
data: z.string()
|
||||
input: z.string(),
|
||||
source: zSessionImportSource
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -1170,6 +1177,18 @@ export const zImportSessionResponse_unstable = z.object({
|
||||
messageCount: z.number().int().gte(0)
|
||||
});
|
||||
|
||||
export const zShareSessionNostrRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
relays: z.array(z.string())
|
||||
});
|
||||
|
||||
export const zShareSessionNostrResponse_unstable = z.object({
|
||||
deeplink: z.string(),
|
||||
nevent: z.string(),
|
||||
eventId: z.string(),
|
||||
relays: z.array(z.string())
|
||||
});
|
||||
|
||||
export const zRecipeExtensionDto = z.union([
|
||||
z.object({
|
||||
name: z.string(),
|
||||
@@ -2185,6 +2204,7 @@ export const zExtRequest = z.object({
|
||||
zOnboardingImportApplyRequest_unstable,
|
||||
zExportSessionRequest_unstable,
|
||||
zImportSessionRequest_unstable,
|
||||
zShareSessionNostrRequest_unstable,
|
||||
zEncodeRecipeRequest_unstable,
|
||||
zDecodeRecipeRequest_unstable,
|
||||
zScanRecipeRequest_unstable,
|
||||
@@ -2273,6 +2293,7 @@ export const zExtResponse = z.union([
|
||||
zOnboardingImportApplyResponse_unstable,
|
||||
zExportSessionResponse_unstable,
|
||||
zImportSessionResponse_unstable,
|
||||
zShareSessionNostrResponse_unstable,
|
||||
zEncodeRecipeResponse_unstable,
|
||||
zDecodeRecipeResponse_unstable,
|
||||
zScanRecipeResponse_unstable,
|
||||
|
||||
Reference in New Issue
Block a user