51 lines
1.6 KiB
Rust
51 lines
1.6 KiB
Rust
|
|
use serde::{Deserialize, Serialize};
|
||
|
|
use serde_json::Value;
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||
|
|
pub struct ActionDefinition {
|
||
|
|
pub action_id: String,
|
||
|
|
pub aliases: Vec<String>,
|
||
|
|
pub description: String,
|
||
|
|
pub intent_examples: Vec<String>,
|
||
|
|
pub payload_schema: Value,
|
||
|
|
pub executable: ExecutableDefinition,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||
|
|
pub struct ExecutableDefinition {
|
||
|
|
pub kind: String,
|
||
|
|
pub script: String,
|
||
|
|
}
|
||
|
|
|
||
|
|
pub fn registered_actions() -> Vec<ActionDefinition> {
|
||
|
|
vec![ActionDefinition {
|
||
|
|
action_id: "logger".to_string(),
|
||
|
|
aliases: vec![
|
||
|
|
"log".to_string(),
|
||
|
|
"write_log".to_string(),
|
||
|
|
"record_message".to_string(),
|
||
|
|
],
|
||
|
|
description: "Write a structured proof-of-concept log message.".to_string(),
|
||
|
|
intent_examples: vec![
|
||
|
|
"log hello from codex".to_string(),
|
||
|
|
"record this message".to_string(),
|
||
|
|
"write a logger proof of concept entry".to_string(),
|
||
|
|
],
|
||
|
|
payload_schema: serde_json::json!({
|
||
|
|
"type": "object",
|
||
|
|
"required": ["message"],
|
||
|
|
"properties": {
|
||
|
|
"message": {
|
||
|
|
"type": "string",
|
||
|
|
"description": "Message text to write into logs/controller-actions.jsonl."
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"additionalProperties": false
|
||
|
|
}),
|
||
|
|
executable: ExecutableDefinition {
|
||
|
|
kind: "internal-rust-script".to_string(),
|
||
|
|
script: "logger".to_string(),
|
||
|
|
},
|
||
|
|
}]
|
||
|
|
}
|