Skip to main content

Vine/Server/Notification/
OutputAppendLine.rs

1//! Cocoon `output.appendLine` notification. Appends `text` to the
2//! named output channel; we suffix the newline here so the downstream
3//! `sky://output/append` listener stays a single append code path (no
4//! dedicated `appendLine` listener in Sky).
5
6use serde_json::{Value, json};
7
8use crate::{Host::VineHost, dev_log};
9
10pub async fn OutputAppendLine(Host:&dyn VineHost, Parameter:&Value) {
11	let Channel = Parameter.get("channel").and_then(Value::as_str).unwrap_or("");
12
13	let Text = Parameter.get("text").and_then(Value::as_str).unwrap_or("");
14
15	Host.EmitToRenderer(
16		"sky://output/append",
17		json!({
18			"channel": Channel,
19			"text": format!("{}\n", Text),
20		}),
21	);
22
23	dev_log!("grpc", "[Output] appendLine channel={} bytes={}", Channel, Text.len());
24}