Skip to main content

Mountain/Vine/Server/Notification/
OutputAppend.rs

1#![allow(non_snake_case)]
2//! Cocoon → Mountain `output.append` notification.
3//! Emitted by `Cocoon/.../Services/Window/OutputChannel.ts:50` whenever
4//! an extension calls `OutputChannel.append(text)`. Forwards verbatim to
5//! `sky://output/append` - the Sky listener mirrors the text into both
6//! the in-memory `OutputChannels` map and VS Code's logger sink.
7
8use serde_json::Value;
9use tauri::Emitter;
10
11use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
12
13pub async fn OutputAppend(Service:&MountainVinegRPCService, Parameter:&Value) {
14	let _ = Service.ApplicationHandle().emit("sky://output/append", Parameter);
15	dev_log!(
16		"grpc",
17		"[Output] append channel={} bytes={}",
18		Parameter.get("channel").and_then(Value::as_str).unwrap_or("?"),
19		Parameter.get("text").and_then(Value::as_str).map(str::len).unwrap_or(0)
20	);
21}