1
This commit is contained in:
@@ -37,6 +37,10 @@ use spacetime_client::{
|
||||
};
|
||||
use tokio::time::sleep;
|
||||
|
||||
use crate::big_fish_agent_turn::{
|
||||
BigFishAgentTurnRequest, build_failed_finalize_record_input, build_finalize_record_input,
|
||||
run_big_fish_agent_turn,
|
||||
};
|
||||
use crate::{
|
||||
api_response::json_success_body, auth::AuthenticatedAccessToken, http_error::AppError,
|
||||
request_context::RequestContext, state::AppState,
|
||||
@@ -157,11 +161,12 @@ pub async fn submit_big_fish_message(
|
||||
));
|
||||
}
|
||||
|
||||
let session = state
|
||||
let owner_user_id = authenticated.claims().user_id().to_string();
|
||||
let submitted_session = state
|
||||
.spacetime_client()
|
||||
.submit_big_fish_message(BigFishMessageSubmitRecordInput {
|
||||
session_id,
|
||||
owner_user_id: authenticated.claims().user_id().to_string(),
|
||||
session_id: session_id.clone(),
|
||||
owner_user_id: owner_user_id.clone(),
|
||||
user_message_id: client_message_id,
|
||||
user_message_text: message_text,
|
||||
assistant_message_id: build_prefixed_uuid_id("big-fish-message-"),
|
||||
@@ -171,6 +176,37 @@ pub async fn submit_big_fish_message(
|
||||
.map_err(|error| {
|
||||
big_fish_error_response(&request_context, map_big_fish_client_error(error))
|
||||
})?;
|
||||
let turn_result = run_big_fish_agent_turn(
|
||||
BigFishAgentTurnRequest {
|
||||
llm_client: state.llm_client(),
|
||||
session: &submitted_session,
|
||||
},
|
||||
|_| {},
|
||||
)
|
||||
.await;
|
||||
let finalize_input = match turn_result {
|
||||
Ok(turn_result) => build_finalize_record_input(
|
||||
session_id.clone(),
|
||||
owner_user_id.clone(),
|
||||
build_prefixed_uuid_id("big-fish-message-"),
|
||||
turn_result,
|
||||
current_utc_micros(),
|
||||
),
|
||||
Err(error) => build_failed_finalize_record_input(
|
||||
session_id.clone(),
|
||||
owner_user_id.clone(),
|
||||
&submitted_session,
|
||||
error.to_string(),
|
||||
current_utc_micros(),
|
||||
),
|
||||
};
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.finalize_big_fish_agent_message(finalize_input)
|
||||
.await
|
||||
.map_err(|error| {
|
||||
big_fish_error_response(&request_context, map_big_fish_client_error(error))
|
||||
})?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
@@ -198,14 +234,23 @@ pub async fn stream_big_fish_message(
|
||||
})?;
|
||||
ensure_non_empty(&request_context, &session_id, "sessionId")?;
|
||||
|
||||
let client_message_id = payload.client_message_id.trim().to_string();
|
||||
let message_text = payload.text.trim().to_string();
|
||||
if client_message_id.is_empty() || message_text.is_empty() {
|
||||
return Err(big_fish_bad_request(
|
||||
&request_context,
|
||||
"clientMessageId and text are required",
|
||||
));
|
||||
}
|
||||
|
||||
let owner_user_id = authenticated.claims().user_id().to_string();
|
||||
let session = state
|
||||
let submitted_session = state
|
||||
.spacetime_client()
|
||||
.submit_big_fish_message(BigFishMessageSubmitRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
user_message_id: payload.client_message_id.trim().to_string(),
|
||||
user_message_text: payload.text.trim().to_string(),
|
||||
session_id: session_id.clone(),
|
||||
owner_user_id: owner_user_id.clone(),
|
||||
user_message_id: client_message_id,
|
||||
user_message_text: message_text,
|
||||
assistant_message_id: build_prefixed_uuid_id("big-fish-message-"),
|
||||
submitted_at_micros: current_utc_micros(),
|
||||
})
|
||||
@@ -213,18 +258,52 @@ pub async fn stream_big_fish_message(
|
||||
.map_err(|error| {
|
||||
big_fish_error_response(&request_context, map_big_fish_client_error(error))
|
||||
})?;
|
||||
let mut streamed_reply_text = String::new();
|
||||
let turn_result = run_big_fish_agent_turn(
|
||||
BigFishAgentTurnRequest {
|
||||
llm_client: state.llm_client(),
|
||||
session: &submitted_session,
|
||||
},
|
||||
|text| {
|
||||
streamed_reply_text = text.to_string();
|
||||
},
|
||||
)
|
||||
.await;
|
||||
let reply_text = match &turn_result {
|
||||
Ok(result) => result.assistant_reply_text.clone(),
|
||||
Err(error) => error.to_string(),
|
||||
};
|
||||
let finalize_input = match turn_result {
|
||||
Ok(turn_result) => build_finalize_record_input(
|
||||
session_id.clone(),
|
||||
owner_user_id.clone(),
|
||||
build_prefixed_uuid_id("big-fish-message-"),
|
||||
turn_result,
|
||||
current_utc_micros(),
|
||||
),
|
||||
Err(error) => build_failed_finalize_record_input(
|
||||
session_id.clone(),
|
||||
owner_user_id.clone(),
|
||||
&submitted_session,
|
||||
error.to_string(),
|
||||
current_utc_micros(),
|
||||
),
|
||||
};
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.finalize_big_fish_agent_message(finalize_input)
|
||||
.await
|
||||
.map_err(|error| {
|
||||
big_fish_error_response(&request_context, map_big_fish_client_error(error))
|
||||
})?;
|
||||
|
||||
let session_response = map_big_fish_session_response(session);
|
||||
let reply_text = session_response
|
||||
.last_assistant_reply
|
||||
.clone()
|
||||
.unwrap_or_else(|| "锚点已更新。".to_string());
|
||||
let mut sse_body = String::new();
|
||||
append_sse_event(
|
||||
&request_context,
|
||||
&mut sse_body,
|
||||
"reply_delta",
|
||||
&json!({ "text": reply_text }),
|
||||
&json!({ "text": if streamed_reply_text.is_empty() { reply_text } else { streamed_reply_text } }),
|
||||
)?;
|
||||
append_sse_event(
|
||||
&request_context,
|
||||
|
||||
312
server-rs/crates/api-server/src/big_fish_agent_turn.rs
Normal file
312
server-rs/crates/api-server/src/big_fish_agent_turn.rs
Normal file
@@ -0,0 +1,312 @@
|
||||
use module_big_fish::{BigFishAnchorPack, BigFishCreationStage};
|
||||
use platform_llm::{LlmClient, LlmMessage, LlmStreamDelta, LlmTextRequest};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Value as JsonValue, json};
|
||||
use spacetime_client::{
|
||||
BigFishAgentMessageRecord, BigFishMessageFinalizeRecordInput, BigFishSessionRecord,
|
||||
};
|
||||
|
||||
use crate::creation_agent_anchor_templates::{
|
||||
get_creation_agent_anchor_template, render_anchor_question_block,
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct BigFishAgentTurnRequest<'a> {
|
||||
pub llm_client: Option<&'a LlmClient>,
|
||||
pub session: &'a BigFishSessionRecord,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct BigFishAgentTurnResult {
|
||||
pub assistant_reply_text: String,
|
||||
pub stage: String,
|
||||
pub progress_percent: u32,
|
||||
pub anchor_pack_json: String,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct BigFishAgentTurnError {
|
||||
message: String,
|
||||
}
|
||||
|
||||
impl BigFishAgentTurnError {
|
||||
fn new(message: impl Into<String>) -> Self {
|
||||
Self {
|
||||
message: message.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for BigFishAgentTurnError {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
formatter.write_str(&self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for BigFishAgentTurnError {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct BigFishAgentModelOutput {
|
||||
reply_text: String,
|
||||
progress_percent: u32,
|
||||
next_anchor_pack: BigFishAnchorPack,
|
||||
}
|
||||
|
||||
const BIG_FISH_AGENT_SYSTEM_PROMPT: &str = r#"你是一个负责和创作者共创“大鱼吃小鱼”竖屏玩法的中文创意策划。
|
||||
|
||||
你必须把用户灵感收束成可以编译为可玩草稿的玩法、生态视觉、成长阶梯和风险节奏。
|
||||
|
||||
你必须同时输出:
|
||||
1. 一段直接发给用户的中文回复 replyText
|
||||
2. 当前进度 progressPercent
|
||||
3. 下一轮完整可用的 nextAnchorPack
|
||||
|
||||
硬约束:
|
||||
1. 只能输出 JSON,不能输出代码块或解释
|
||||
2. nextAnchorPack 必须是完整对象,不能只输出 patch
|
||||
3. replyText 必须是自然中文,不能提“字段”“锚点”“结构”“JSON”等内部词
|
||||
4. replyText 一次最多推进一个最关键问题
|
||||
5. 必须对齐 RPG 共创的体验:先理解玩家幻想,再收束成能进入运行时的可玩效果
|
||||
6. progressPercent 范围只能是 0 到 100
|
||||
7. status 只能使用 missing / inferred / confirmed / locked
|
||||
"#;
|
||||
|
||||
const BIG_FISH_AGENT_OUTPUT_CONTRACT: &str = r#"请严格按以下 JSON 输出,不要输出其他文字:
|
||||
{
|
||||
"replyText": "",
|
||||
"progressPercent": 0,
|
||||
"nextAnchorPack": {
|
||||
"gameplayPromise": {
|
||||
"key": "gameplayPromise",
|
||||
"label": "玩法承诺",
|
||||
"value": "",
|
||||
"status": "missing"
|
||||
},
|
||||
"ecologyVisualTheme": {
|
||||
"key": "ecologyVisualTheme",
|
||||
"label": "生态视觉主题",
|
||||
"value": "",
|
||||
"status": "missing"
|
||||
},
|
||||
"growthLadder": {
|
||||
"key": "growthLadder",
|
||||
"label": "成长阶梯",
|
||||
"value": "",
|
||||
"status": "missing"
|
||||
},
|
||||
"riskTempo": {
|
||||
"key": "riskTempo",
|
||||
"label": "风险节奏",
|
||||
"value": "",
|
||||
"status": "missing"
|
||||
}
|
||||
}
|
||||
}"#;
|
||||
|
||||
pub(crate) async fn run_big_fish_agent_turn<F>(
|
||||
request: BigFishAgentTurnRequest<'_>,
|
||||
mut on_reply_update: F,
|
||||
) -> Result<BigFishAgentTurnResult, BigFishAgentTurnError>
|
||||
where
|
||||
F: FnMut(&str),
|
||||
{
|
||||
let llm_client = request
|
||||
.llm_client
|
||||
.ok_or_else(|| BigFishAgentTurnError::new("当前模型不可用,请稍后重试。"))?;
|
||||
let prompt = build_big_fish_agent_prompt(request.session);
|
||||
let mut latest_reply_text = String::new();
|
||||
let response = llm_client
|
||||
.stream_text(
|
||||
LlmTextRequest::new(vec![
|
||||
LlmMessage::system(format!("{BIG_FISH_AGENT_SYSTEM_PROMPT}\n\n{prompt}")),
|
||||
LlmMessage::user("请按约定输出这一轮的 JSON。"),
|
||||
]),
|
||||
|delta: &LlmStreamDelta| {
|
||||
if let Some(reply_progress) =
|
||||
extract_reply_text_from_partial_json(delta.accumulated_text.as_str())
|
||||
&& reply_progress != latest_reply_text
|
||||
{
|
||||
latest_reply_text = reply_progress.clone();
|
||||
on_reply_update(reply_progress.as_str());
|
||||
}
|
||||
},
|
||||
)
|
||||
.await
|
||||
.map_err(|_| BigFishAgentTurnError::new("大鱼吃小鱼聊天生成失败,请稍后重试。"))?;
|
||||
|
||||
let parsed = parse_json_response_text(response.content.as_str())
|
||||
.map_err(|_| BigFishAgentTurnError::new("大鱼吃小鱼聊天结果解析失败,请稍后重试。"))?;
|
||||
let output = parse_big_fish_model_output(&parsed)?;
|
||||
if output.reply_text != latest_reply_text {
|
||||
on_reply_update(output.reply_text.as_str());
|
||||
}
|
||||
|
||||
Ok(BigFishAgentTurnResult {
|
||||
assistant_reply_text: output.reply_text,
|
||||
stage: BigFishCreationStage::CollectingAnchors.as_str().to_string(),
|
||||
progress_percent: output.progress_percent.min(100),
|
||||
anchor_pack_json: serde_json::to_string(&output.next_anchor_pack)
|
||||
.unwrap_or_else(|_| "{}".to_string()),
|
||||
error_message: None,
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn build_finalize_record_input(
|
||||
session_id: String,
|
||||
owner_user_id: String,
|
||||
assistant_message_id: String,
|
||||
result: BigFishAgentTurnResult,
|
||||
updated_at_micros: i64,
|
||||
) -> BigFishMessageFinalizeRecordInput {
|
||||
BigFishMessageFinalizeRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
assistant_message_id: Some(assistant_message_id),
|
||||
assistant_reply_text: Some(result.assistant_reply_text),
|
||||
stage: result.stage,
|
||||
progress_percent: result.progress_percent,
|
||||
anchor_pack_json: result.anchor_pack_json,
|
||||
error_message: result.error_message,
|
||||
updated_at_micros,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn build_failed_finalize_record_input(
|
||||
session_id: String,
|
||||
owner_user_id: String,
|
||||
session: &BigFishSessionRecord,
|
||||
error_message: String,
|
||||
updated_at_micros: i64,
|
||||
) -> BigFishMessageFinalizeRecordInput {
|
||||
BigFishMessageFinalizeRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
assistant_message_id: None,
|
||||
assistant_reply_text: None,
|
||||
stage: session.stage.clone(),
|
||||
progress_percent: session.progress_percent,
|
||||
anchor_pack_json: serialize_record_anchor_pack(&session.anchor_pack),
|
||||
error_message: Some(error_message),
|
||||
updated_at_micros,
|
||||
}
|
||||
}
|
||||
|
||||
fn build_big_fish_agent_prompt(session: &BigFishSessionRecord) -> String {
|
||||
let anchor_question_block = get_creation_agent_anchor_template("big_fish")
|
||||
.map(render_anchor_question_block)
|
||||
.unwrap_or_else(|| "模板目标:收束成可玩的竖屏大鱼吃小鱼玩法草稿。".to_string());
|
||||
format!(
|
||||
"{anchor_question_block}\n\n当前是第 {turn} 轮,当前进度 {progress}% 。\n\n当前 anchor pack:\n{anchor_pack}\n\n最近聊天记录:\n{chat_history}\n\n{contract}",
|
||||
anchor_question_block = anchor_question_block,
|
||||
turn = session.current_turn.saturating_add(1),
|
||||
progress = session.progress_percent,
|
||||
anchor_pack = serialize_record_anchor_pack(&session.anchor_pack),
|
||||
chat_history =
|
||||
serde_json::to_string_pretty(&build_chat_history(session.messages.as_slice()))
|
||||
.unwrap_or_else(|_| "[]".to_string()),
|
||||
contract = BIG_FISH_AGENT_OUTPUT_CONTRACT,
|
||||
)
|
||||
}
|
||||
|
||||
fn build_chat_history(messages: &[BigFishAgentMessageRecord]) -> Vec<JsonValue> {
|
||||
messages
|
||||
.iter()
|
||||
.map(|message| {
|
||||
json!({
|
||||
"role": message.role,
|
||||
"kind": message.kind,
|
||||
"content": message.text,
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn parse_big_fish_model_output(
|
||||
parsed: &JsonValue,
|
||||
) -> Result<BigFishAgentModelOutput, BigFishAgentTurnError> {
|
||||
serde_json::from_value::<BigFishAgentModelOutput>(parsed.clone())
|
||||
.map_err(|_| BigFishAgentTurnError::new("大鱼吃小鱼模型结果缺少必要内容,请稍后重试。"))
|
||||
}
|
||||
|
||||
fn serialize_record_anchor_pack(anchor_pack: &spacetime_client::BigFishAnchorPackRecord) -> String {
|
||||
serde_json::to_string_pretty(&json!({
|
||||
"gameplayPromise": {
|
||||
"key": anchor_pack.gameplay_promise.key,
|
||||
"label": anchor_pack.gameplay_promise.label,
|
||||
"value": anchor_pack.gameplay_promise.value,
|
||||
"status": anchor_pack.gameplay_promise.status,
|
||||
},
|
||||
"ecologyVisualTheme": {
|
||||
"key": anchor_pack.ecology_visual_theme.key,
|
||||
"label": anchor_pack.ecology_visual_theme.label,
|
||||
"value": anchor_pack.ecology_visual_theme.value,
|
||||
"status": anchor_pack.ecology_visual_theme.status,
|
||||
},
|
||||
"growthLadder": {
|
||||
"key": anchor_pack.growth_ladder.key,
|
||||
"label": anchor_pack.growth_ladder.label,
|
||||
"value": anchor_pack.growth_ladder.value,
|
||||
"status": anchor_pack.growth_ladder.status,
|
||||
},
|
||||
"riskTempo": {
|
||||
"key": anchor_pack.risk_tempo.key,
|
||||
"label": anchor_pack.risk_tempo.label,
|
||||
"value": anchor_pack.risk_tempo.value,
|
||||
"status": anchor_pack.risk_tempo.status,
|
||||
},
|
||||
}))
|
||||
.unwrap_or_else(|_| "{}".to_string())
|
||||
}
|
||||
|
||||
fn parse_json_response_text(text: &str) -> Result<JsonValue, serde_json::Error> {
|
||||
if let Ok(value) = serde_json::from_str::<JsonValue>(text) {
|
||||
return Ok(value);
|
||||
}
|
||||
let Some(start) = text.find('{') else {
|
||||
return serde_json::from_str(text);
|
||||
};
|
||||
let Some(end) = text.rfind('}') else {
|
||||
return serde_json::from_str(text);
|
||||
};
|
||||
serde_json::from_str(&text[start..=end])
|
||||
}
|
||||
|
||||
fn extract_reply_text_from_partial_json(text: &str) -> Option<String> {
|
||||
let marker = "\"replyText\"";
|
||||
let marker_index = text.find(marker)?;
|
||||
let after_marker = &text[marker_index + marker.len()..];
|
||||
let colon_index = after_marker.find(':')?;
|
||||
let after_colon = after_marker[colon_index + 1..].trim_start();
|
||||
let content = after_colon.strip_prefix('"')?;
|
||||
let mut result = String::new();
|
||||
let mut escaped = false;
|
||||
for character in content.chars() {
|
||||
if escaped {
|
||||
result.push(match character {
|
||||
'n' => '\n',
|
||||
'r' => '\r',
|
||||
't' => '\t',
|
||||
'"' => '"',
|
||||
'\\' => '\\',
|
||||
other => other,
|
||||
});
|
||||
escaped = false;
|
||||
continue;
|
||||
}
|
||||
if character == '\\' {
|
||||
escaped = true;
|
||||
continue;
|
||||
}
|
||||
if character == '"' {
|
||||
return Some(result);
|
||||
}
|
||||
result.push(character);
|
||||
}
|
||||
if result.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(result)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"templates": [
|
||||
{
|
||||
"templateId": "rpg_world",
|
||||
"displayName": "RPG 世界共创",
|
||||
"creationGoal": "收束成可直接进入 RPG 运行时的世界、角色、冲突、入口与隐藏线索。",
|
||||
"anchorQuestions": [
|
||||
{
|
||||
"key": "worldPromise",
|
||||
"label": "世界承诺",
|
||||
"question": "这个世界最想让玩家体验到什么独特承诺?",
|
||||
"requiredEffect": "明确世界钩子、差异化体验与玩家期待。"
|
||||
},
|
||||
{
|
||||
"key": "playerFantasy",
|
||||
"label": "玩家幻想",
|
||||
"question": "玩家进入后扮演谁、追求什么、害怕失去什么?",
|
||||
"requiredEffect": "明确身份、目标与核心情绪压力。"
|
||||
},
|
||||
{
|
||||
"key": "themeBoundary",
|
||||
"label": "题材边界",
|
||||
"question": "题材气质、视觉方向和禁忌边界分别是什么?",
|
||||
"requiredEffect": "约束语气、审美与不可越界内容。"
|
||||
},
|
||||
{
|
||||
"key": "playerEntryPoint",
|
||||
"label": "玩家入口",
|
||||
"question": "玩家第一幕以什么身份遇到什么问题?",
|
||||
"requiredEffect": "形成可开局的身份、问题和行动动机。"
|
||||
},
|
||||
{
|
||||
"key": "coreConflict",
|
||||
"label": "核心冲突",
|
||||
"question": "表层冲突、隐藏危机和首个触发冲突是什么?",
|
||||
"requiredEffect": "建立运行时持续推进的矛盾发动机。"
|
||||
},
|
||||
{
|
||||
"key": "keyRelationships",
|
||||
"label": "关键关系",
|
||||
"question": "哪些人物关系最能推动选择、秘密和代价?",
|
||||
"requiredEffect": "形成 NPC、势力或亲密关系的互动张力。"
|
||||
},
|
||||
{
|
||||
"key": "hiddenLine",
|
||||
"label": "隐藏线",
|
||||
"question": "世界真相如何被误导、铺垫并逐步揭示?",
|
||||
"requiredEffect": "为中后期探索与反转留下结构化线索。"
|
||||
},
|
||||
{
|
||||
"key": "iconicElements",
|
||||
"label": "标志元素",
|
||||
"question": "哪些标志物、机构、规则或意象让世界被记住?",
|
||||
"requiredEffect": "提供可复用的视觉、剧情和系统记忆点。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"templateId": "puzzle",
|
||||
"displayName": "拼图共创",
|
||||
"creationGoal": "收束成可以发布为拼图关卡的视觉方案。",
|
||||
"anchorQuestions": [
|
||||
{
|
||||
"key": "themePromise",
|
||||
"label": "题材承诺",
|
||||
"question": "这张拼图给玩家的题材和完成期待是什么?",
|
||||
"requiredEffect": "明确拼图主题、辨识度和完成后的满足感。"
|
||||
},
|
||||
{
|
||||
"key": "visualSubject",
|
||||
"label": "画面主体",
|
||||
"question": "画面中最需要被玩家一眼看懂的主体是什么?",
|
||||
"requiredEffect": "明确主体、层级和可被切片识别的形状。"
|
||||
},
|
||||
{
|
||||
"key": "visualMood",
|
||||
"label": "视觉气质",
|
||||
"question": "整体色彩、光线、情绪和美术风格是什么?",
|
||||
"requiredEffect": "收束画面风格,避免结果图风格漂移。"
|
||||
},
|
||||
{
|
||||
"key": "compositionHooks",
|
||||
"label": "拼图记忆点",
|
||||
"question": "哪些构图、纹理或局部细节会成为玩家拼接线索?",
|
||||
"requiredEffect": "提供适合拼图玩法的边缘、块面和局部记忆点。"
|
||||
},
|
||||
{
|
||||
"key": "tagsAndForbidden",
|
||||
"label": "标签与禁忌",
|
||||
"question": "需要保留哪些关键词,又必须避开什么内容?",
|
||||
"requiredEffect": "锁定生成标签和负向约束。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"templateId": "big_fish",
|
||||
"displayName": "大鱼吃小鱼共创",
|
||||
"creationGoal": "收束成可直接编译为竖屏大鱼吃小鱼玩法草稿的成长、生态、节奏方案。",
|
||||
"anchorQuestions": [
|
||||
{
|
||||
"key": "gameplayPromise",
|
||||
"label": "玩法承诺",
|
||||
"question": "这版大鱼吃小鱼最核心的吞噬成长爽点是什么?",
|
||||
"requiredEffect": "明确玩家为什么要持续吞噬、升级和冒险。"
|
||||
},
|
||||
{
|
||||
"key": "ecologyVisualTheme",
|
||||
"label": "生态视觉主题",
|
||||
"question": "鱼群、场景和敌我生态的视觉主题是什么?",
|
||||
"requiredEffect": "提供后续角色图、动作图和背景图的一致视觉方向。"
|
||||
},
|
||||
{
|
||||
"key": "growthLadder",
|
||||
"label": "成长阶梯",
|
||||
"question": "从弱小到终局巨兽的 6 到 12 级成长阶梯如何递进?",
|
||||
"requiredEffect": "保证等级轮廓、体型、能力幻想逐级增强。"
|
||||
},
|
||||
{
|
||||
"key": "riskTempo",
|
||||
"label": "风险节奏",
|
||||
"question": "玩家在每个阶段面对的威胁压力和爽快节奏如何变化?",
|
||||
"requiredEffect": "确定猎物、威胁、压迫感和爽感之间的节奏比例。"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
const ANCHOR_TEMPLATE_CONFIG: &str = include_str!("creation_agent_anchor_templates.json");
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct CreationAgentAnchorTemplateConfig {
|
||||
templates: Vec<CreationAgentAnchorTemplate>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct CreationAgentAnchorTemplate {
|
||||
pub template_id: String,
|
||||
pub display_name: String,
|
||||
pub creation_goal: String,
|
||||
pub anchor_questions: Vec<CreationAgentAnchorQuestion>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct CreationAgentAnchorQuestion {
|
||||
pub key: String,
|
||||
pub label: String,
|
||||
pub question: String,
|
||||
pub required_effect: String,
|
||||
}
|
||||
|
||||
static ANCHOR_TEMPLATES: OnceLock<CreationAgentAnchorTemplateConfig> = OnceLock::new();
|
||||
|
||||
pub(crate) fn get_creation_agent_anchor_template(
|
||||
template_id: &str,
|
||||
) -> Option<&'static CreationAgentAnchorTemplate> {
|
||||
load_creation_agent_anchor_templates()
|
||||
.templates
|
||||
.iter()
|
||||
.find(|template| template.template_id == template_id)
|
||||
}
|
||||
|
||||
pub(crate) fn render_anchor_question_block(template: &CreationAgentAnchorTemplate) -> String {
|
||||
let mut lines = vec![
|
||||
format!("模板目标:{}", template.creation_goal),
|
||||
"".to_string(),
|
||||
];
|
||||
lines.push("本模板只通过以下锚点问题体现差异:".to_string());
|
||||
for (index, question) in template.anchor_questions.iter().enumerate() {
|
||||
lines.push(format!(
|
||||
"{}. {}({} / {}):{};达成效果:{}",
|
||||
index + 1,
|
||||
question.label,
|
||||
question.key,
|
||||
template.display_name,
|
||||
question.question,
|
||||
question.required_effect
|
||||
));
|
||||
}
|
||||
lines.join("\n")
|
||||
}
|
||||
|
||||
fn load_creation_agent_anchor_templates() -> &'static CreationAgentAnchorTemplateConfig {
|
||||
ANCHOR_TEMPLATES.get_or_init(|| {
|
||||
serde_json::from_str(ANCHOR_TEMPLATE_CONFIG)
|
||||
.expect("creation_agent_anchor_templates.json 必须是合法配置")
|
||||
})
|
||||
}
|
||||
@@ -42,6 +42,7 @@ use std::convert::Infallible;
|
||||
use crate::{
|
||||
api_response::json_success_body,
|
||||
auth::AuthenticatedAccessToken,
|
||||
custom_world_agent_entities::generate_custom_world_agent_entities,
|
||||
custom_world_agent_turn::{
|
||||
CustomWorldAgentTurnRequest, build_failed_finalize_record_input,
|
||||
build_finalize_record_input, run_custom_world_agent_turn,
|
||||
@@ -916,7 +917,10 @@ pub async fn execute_custom_world_agent_action(
|
||||
|
||||
let owner_user_id = authenticated.claims().user_id().to_string();
|
||||
let submitted_at_micros = current_utc_micros();
|
||||
let payload_json = if action == "draft_foundation" {
|
||||
let payload_json = if matches!(
|
||||
action.as_str(),
|
||||
"draft_foundation" | "generate_characters" | "generate_landmarks"
|
||||
) {
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.get_custom_world_agent_session(session_id.clone(), owner_user_id.clone())
|
||||
@@ -924,15 +928,6 @@ pub async fn execute_custom_world_agent_action(
|
||||
.map_err(|error| {
|
||||
custom_world_error_response(&request_context, map_custom_world_client_error(error))
|
||||
})?;
|
||||
if session.progress_percent < 100 {
|
||||
return Err(custom_world_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "custom-world-agent",
|
||||
"message": "draft_foundation requires progressPercent >= 100",
|
||||
})),
|
||||
));
|
||||
}
|
||||
let llm_client = state.llm_client().ok_or_else(|| {
|
||||
custom_world_error_response(
|
||||
&request_context,
|
||||
@@ -942,19 +937,29 @@ pub async fn execute_custom_world_agent_action(
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
let draft_result = generate_custom_world_foundation_draft(llm_client, &session)
|
||||
.await
|
||||
.map_err(|message| {
|
||||
custom_world_error_response(
|
||||
if action == "draft_foundation" {
|
||||
if session.progress_percent < 100 {
|
||||
return Err(custom_world_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "custom-world-agent",
|
||||
"message": message,
|
||||
"message": "draft_foundation requires progressPercent >= 100",
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
build_draft_foundation_action_payload_json(&payload, &draft_result.draft_profile_json)
|
||||
.map_err(|error| {
|
||||
));
|
||||
}
|
||||
let draft_result = generate_custom_world_foundation_draft(llm_client, &session)
|
||||
.await
|
||||
.map_err(|message| {
|
||||
custom_world_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
|
||||
"provider": "custom-world-agent",
|
||||
"message": message,
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
build_draft_foundation_action_payload_json(&payload, &draft_result.draft_profile_json)
|
||||
.map_err(|error| {
|
||||
let (status, message) = match error {
|
||||
DraftFoundationPayloadError::SerializePayload(message) => {
|
||||
(StatusCode::BAD_REQUEST, message)
|
||||
@@ -975,6 +980,21 @@ pub async fn execute_custom_world_agent_action(
|
||||
})),
|
||||
)
|
||||
})?
|
||||
} else {
|
||||
let generation_result =
|
||||
generate_custom_world_agent_entities(llm_client, &session, &payload)
|
||||
.await
|
||||
.map_err(|message| {
|
||||
custom_world_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
|
||||
"provider": "custom-world-agent",
|
||||
"message": message,
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
generation_result.payload_json
|
||||
}
|
||||
} else {
|
||||
serde_json::to_string(&payload).map_err(|error| {
|
||||
custom_world_error_response(
|
||||
|
||||
641
server-rs/crates/api-server/src/custom_world_agent_entities.rs
Normal file
641
server-rs/crates/api-server/src/custom_world_agent_entities.rs
Normal file
@@ -0,0 +1,641 @@
|
||||
use platform_llm::{LlmClient, LlmMessage, LlmTextRequest};
|
||||
use serde_json::{Map as JsonMap, Value as JsonValue, json};
|
||||
use shared_contracts::runtime::ExecuteCustomWorldAgentActionRequest;
|
||||
use spacetime_client::CustomWorldAgentSessionRecord;
|
||||
|
||||
const CUSTOM_WORLD_AGENT_CHARACTER_EXPANSION_SYSTEM_PROMPT: &str =
|
||||
"你负责为当前游戏世界底稿补 1 到 3 个新角色。只能输出 JSON 数组,不要输出任何额外说明。";
|
||||
const CUSTOM_WORLD_AGENT_LANDMARK_EXPANSION_SYSTEM_PROMPT: &str =
|
||||
"你负责为当前游戏世界底稿补 1 到 3 个新地点。只能输出 JSON 数组,不要输出任何额外说明。";
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct CustomWorldGeneratedEntitiesResult {
|
||||
pub payload_json: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum CustomWorldGeneratedEntitiesPayloadError {
|
||||
SerializePayload(String),
|
||||
InvalidPayloadShape,
|
||||
}
|
||||
|
||||
pub async fn generate_custom_world_agent_entities(
|
||||
llm_client: &LlmClient,
|
||||
session: &CustomWorldAgentSessionRecord,
|
||||
payload: &ExecuteCustomWorldAgentActionRequest,
|
||||
) -> Result<CustomWorldGeneratedEntitiesResult, String> {
|
||||
let action = payload.action.trim();
|
||||
let draft_profile = session
|
||||
.draft_profile
|
||||
.as_object()
|
||||
.ok_or_else(|| format!("{action} requires an existing draft foundation"))?;
|
||||
let count = ensure_count(payload.count);
|
||||
let prompt_seed = payload
|
||||
.prompt_text
|
||||
.as_deref()
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.unwrap_or("没有额外要求,围绕当前底稿自然扩展。");
|
||||
let anchor_summary = build_anchor_summary(
|
||||
draft_profile,
|
||||
payload.anchor_card_ids.as_deref().unwrap_or(&[]),
|
||||
);
|
||||
let creator_intent_summary = session
|
||||
.anchor_pack
|
||||
.get("creatorIntentSummary")
|
||||
.and_then(JsonValue::as_str)
|
||||
.or_else(|| {
|
||||
session
|
||||
.creator_intent
|
||||
.get("worldHook")
|
||||
.and_then(JsonValue::as_str)
|
||||
})
|
||||
.or_else(|| draft_profile.get("summary").and_then(JsonValue::as_str))
|
||||
.unwrap_or_default();
|
||||
let world_name = draft_profile
|
||||
.get("name")
|
||||
.and_then(JsonValue::as_str)
|
||||
.unwrap_or("未命名世界");
|
||||
let world_summary = draft_profile
|
||||
.get("summary")
|
||||
.and_then(JsonValue::as_str)
|
||||
.unwrap_or_default();
|
||||
|
||||
let (system_prompt, user_prompt, result_key) = match action {
|
||||
"generate_characters" => (
|
||||
CUSTOM_WORLD_AGENT_CHARACTER_EXPANSION_SYSTEM_PROMPT,
|
||||
build_custom_world_agent_character_expansion_prompt(ExpansionPromptParams {
|
||||
world_name,
|
||||
world_summary,
|
||||
creator_intent_summary,
|
||||
anchor_summary: anchor_summary.as_str(),
|
||||
existing_names: existing_character_names(draft_profile),
|
||||
count,
|
||||
prompt_seed,
|
||||
}),
|
||||
"generatedCharacters",
|
||||
),
|
||||
"generate_landmarks" => (
|
||||
CUSTOM_WORLD_AGENT_LANDMARK_EXPANSION_SYSTEM_PROMPT,
|
||||
build_custom_world_agent_landmark_expansion_prompt(ExpansionPromptParams {
|
||||
world_name,
|
||||
world_summary,
|
||||
creator_intent_summary,
|
||||
anchor_summary: anchor_summary.as_str(),
|
||||
existing_names: existing_landmark_names(draft_profile),
|
||||
count,
|
||||
prompt_seed,
|
||||
}),
|
||||
"generatedLandmarks",
|
||||
),
|
||||
_ => return Err(format!("unsupported generated entity action: {action}")),
|
||||
};
|
||||
|
||||
let response = llm_client
|
||||
.request_text(LlmTextRequest::new(vec![
|
||||
LlmMessage::system(system_prompt),
|
||||
LlmMessage::user(user_prompt),
|
||||
]))
|
||||
.await
|
||||
.map_err(|error| format!("{action} LLM 请求失败:{error}"))?;
|
||||
let generated_entities = parse_json_array_response(response.content.as_str())
|
||||
.map_err(|error| format!("{action} JSON 解析失败:{error}"))?;
|
||||
let normalized_entities =
|
||||
normalize_generated_entities(action, generated_entities, draft_profile, count);
|
||||
let payload_json =
|
||||
build_generated_entities_action_payload_json(payload, result_key, normalized_entities)
|
||||
.map_err(|error| match error {
|
||||
CustomWorldGeneratedEntitiesPayloadError::SerializePayload(message) => message,
|
||||
CustomWorldGeneratedEntitiesPayloadError::InvalidPayloadShape => {
|
||||
"action payload 必须是 object".to_string()
|
||||
}
|
||||
})?;
|
||||
|
||||
Ok(CustomWorldGeneratedEntitiesResult { payload_json })
|
||||
}
|
||||
|
||||
pub fn build_generated_entities_action_payload_json(
|
||||
payload: &ExecuteCustomWorldAgentActionRequest,
|
||||
result_key: &str,
|
||||
generated_entities: Vec<JsonValue>,
|
||||
) -> Result<String, CustomWorldGeneratedEntitiesPayloadError> {
|
||||
let mut payload_value = serde_json::to_value(payload).map_err(|error| {
|
||||
CustomWorldGeneratedEntitiesPayloadError::SerializePayload(format!(
|
||||
"action payload JSON 序列化失败:{error}"
|
||||
))
|
||||
})?;
|
||||
let payload_object = payload_value
|
||||
.as_object_mut()
|
||||
.ok_or(CustomWorldGeneratedEntitiesPayloadError::InvalidPayloadShape)?;
|
||||
if payload.action.trim() == "generate_characters" {
|
||||
payload_object.insert(
|
||||
"roleType".to_string(),
|
||||
JsonValue::String(resolve_role_type(payload.role_type.as_deref()).to_string()),
|
||||
);
|
||||
}
|
||||
payload_object.insert(result_key.to_string(), JsonValue::Array(generated_entities));
|
||||
serde_json::to_string(&payload_value).map_err(|error| {
|
||||
CustomWorldGeneratedEntitiesPayloadError::SerializePayload(format!(
|
||||
"action payload JSON 序列化失败:{error}"
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
struct ExpansionPromptParams<'a> {
|
||||
world_name: &'a str,
|
||||
world_summary: &'a str,
|
||||
creator_intent_summary: &'a str,
|
||||
anchor_summary: &'a str,
|
||||
existing_names: Vec<String>,
|
||||
count: u32,
|
||||
prompt_seed: &'a str,
|
||||
}
|
||||
|
||||
fn build_custom_world_agent_character_expansion_prompt(
|
||||
params: ExpansionPromptParams<'_>,
|
||||
) -> String {
|
||||
[
|
||||
format!("当前世界:{}", params.world_name),
|
||||
format!("世界摘要:{}", params.world_summary),
|
||||
format!("创作意图摘要:{}", params.creator_intent_summary),
|
||||
format!("参考锚点:{}", params.anchor_summary),
|
||||
format!(
|
||||
"已有角色:{}",
|
||||
if params.existing_names.is_empty() {
|
||||
"暂无".to_string()
|
||||
} else {
|
||||
params.existing_names.join("、")
|
||||
}
|
||||
),
|
||||
format!("数量:{}", params.count),
|
||||
format!(
|
||||
"补充要求:{}",
|
||||
if params.prompt_seed.trim().is_empty() {
|
||||
"没有额外要求,围绕当前底稿自然扩展。"
|
||||
} else {
|
||||
params.prompt_seed
|
||||
}
|
||||
),
|
||||
"返回 JSON 数组。每个对象字段只允许包含:name, role, publicMask, hiddenHook, relationToPlayer, summary, threadIds。".to_string(),
|
||||
"threadIds 必须优先引用现有线程 id。".to_string(),
|
||||
]
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
fn build_custom_world_agent_landmark_expansion_prompt(params: ExpansionPromptParams<'_>) -> String {
|
||||
[
|
||||
format!("当前世界:{}", params.world_name),
|
||||
format!("世界摘要:{}", params.world_summary),
|
||||
format!("创作意图摘要:{}", params.creator_intent_summary),
|
||||
format!("参考锚点:{}", params.anchor_summary),
|
||||
format!(
|
||||
"已有地点:{}",
|
||||
if params.existing_names.is_empty() {
|
||||
"暂无".to_string()
|
||||
} else {
|
||||
params.existing_names.join("、")
|
||||
}
|
||||
),
|
||||
format!("数量:{}", params.count),
|
||||
format!(
|
||||
"补充要求:{}",
|
||||
if params.prompt_seed.trim().is_empty() {
|
||||
"没有额外要求,围绕当前底稿自然扩展。"
|
||||
} else {
|
||||
params.prompt_seed
|
||||
}
|
||||
),
|
||||
"返回 JSON 数组。每个对象字段只允许包含:name, purpose, mood, dangerLevel, secret, summary, threadIds, characterIds。".to_string(),
|
||||
"threadIds / characterIds 必须优先引用现有对象 id。".to_string(),
|
||||
]
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
fn ensure_count(count: Option<u32>) -> u32 {
|
||||
count.unwrap_or(1).clamp(1, 3)
|
||||
}
|
||||
|
||||
fn resolve_role_type(role_type: Option<&str>) -> &'static str {
|
||||
match role_type.map(str::trim) {
|
||||
Some("playable") => "playable",
|
||||
_ => "story",
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_json_array_response(text: &str) -> Result<Vec<JsonValue>, serde_json::Error> {
|
||||
let trimmed = text.trim();
|
||||
if let Some(start) = trimmed.find('[')
|
||||
&& let Some(end) = trimmed.rfind(']')
|
||||
&& end >= start
|
||||
{
|
||||
return serde_json::from_str::<Vec<JsonValue>>(&trimmed[start..=end]);
|
||||
}
|
||||
serde_json::from_str::<Vec<JsonValue>>(trimmed)
|
||||
}
|
||||
|
||||
fn normalize_generated_entities(
|
||||
action: &str,
|
||||
entities: Vec<JsonValue>,
|
||||
draft_profile: &JsonMap<String, JsonValue>,
|
||||
count: u32,
|
||||
) -> Vec<JsonValue> {
|
||||
let mut existing_names = if action == "generate_characters" {
|
||||
existing_character_names(draft_profile)
|
||||
} else {
|
||||
existing_landmark_names(draft_profile)
|
||||
};
|
||||
entities
|
||||
.into_iter()
|
||||
.filter_map(|entry| entry.as_object().cloned())
|
||||
.filter_map(|mut object| {
|
||||
let name = object
|
||||
.get("name")
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())?
|
||||
.to_string();
|
||||
if existing_names.iter().any(|entry| entry == &name) {
|
||||
return None;
|
||||
}
|
||||
existing_names.push(name.clone());
|
||||
let prefix = if action == "generate_characters" {
|
||||
"character"
|
||||
} else {
|
||||
"landmark"
|
||||
};
|
||||
object.entry("id".to_string()).or_insert_with(|| {
|
||||
JsonValue::String(create_stable_id(
|
||||
prefix,
|
||||
name.as_str(),
|
||||
existing_names.len(),
|
||||
))
|
||||
});
|
||||
normalize_generated_entity_profile_fields(action, &mut object);
|
||||
Some(JsonValue::Object(object))
|
||||
})
|
||||
.take(count as usize)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn normalize_generated_entity_profile_fields(
|
||||
action: &str,
|
||||
object: &mut JsonMap<String, JsonValue>,
|
||||
) {
|
||||
if action == "generate_characters" {
|
||||
normalize_generated_character_profile_fields(object);
|
||||
} else {
|
||||
normalize_generated_landmark_profile_fields(object);
|
||||
}
|
||||
}
|
||||
|
||||
fn normalize_generated_character_profile_fields(object: &mut JsonMap<String, JsonValue>) {
|
||||
let name = read_object_text(object, "name").unwrap_or_else(|| "新场景角色".to_string());
|
||||
let role = read_object_text(object, "role").unwrap_or_else(|| "场景角色".to_string());
|
||||
let summary = read_first_object_text(object, &["description", "summary", "publicMask"])
|
||||
.unwrap_or_else(|| format!("{name}是围绕当前世界新补出的{role}。"));
|
||||
let hidden_hook = read_object_text(object, "hiddenHook").unwrap_or_else(|| summary.clone());
|
||||
|
||||
insert_text_if_missing(object, "title", role.as_str());
|
||||
insert_text_if_missing(object, "description", summary.as_str());
|
||||
insert_text_if_missing(object, "backstory", hidden_hook.as_str());
|
||||
insert_text_if_missing(object, "personality", "待在后续互动中揭示");
|
||||
insert_text_if_missing(object, "motivation", hidden_hook.as_str());
|
||||
insert_text_if_missing(object, "combatStyle", "围绕自身身份采取行动");
|
||||
object
|
||||
.entry("initialAffinity".to_string())
|
||||
.or_insert_with(|| JsonValue::Number(6.into()));
|
||||
|
||||
if !object
|
||||
.get("relationshipHooks")
|
||||
.is_some_and(JsonValue::is_array)
|
||||
{
|
||||
let mut hooks = Vec::new();
|
||||
if let Some(relation) = read_object_text(object, "relationToPlayer") {
|
||||
hooks.push(JsonValue::String(relation));
|
||||
}
|
||||
if hooks.is_empty() {
|
||||
hooks.push(JsonValue::String("等待玩家接触".to_string()));
|
||||
}
|
||||
object.insert("relationshipHooks".to_string(), JsonValue::Array(hooks));
|
||||
}
|
||||
|
||||
if !object.get("tags").is_some_and(JsonValue::is_array) {
|
||||
object.insert(
|
||||
"tags".to_string(),
|
||||
JsonValue::Array(vec![JsonValue::String(role)]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn normalize_generated_landmark_profile_fields(object: &mut JsonMap<String, JsonValue>) {
|
||||
let name = read_object_text(object, "name").unwrap_or_else(|| "新场景".to_string());
|
||||
let description = read_first_object_text(object, &["description", "summary", "purpose"])
|
||||
.unwrap_or_else(|| format!("{name}是围绕当前世界新补出的关键场景。"));
|
||||
let mut description_parts = vec![description];
|
||||
for key in ["mood", "secret"] {
|
||||
if let Some(text) = read_object_text(object, key)
|
||||
&& !description_parts.iter().any(|entry| entry == &text)
|
||||
{
|
||||
description_parts.push(text);
|
||||
}
|
||||
}
|
||||
|
||||
insert_text_if_missing(object, "description", description_parts.join(" ").as_str());
|
||||
insert_text_if_missing(object, "dangerLevel", "中");
|
||||
object
|
||||
.entry("connections".to_string())
|
||||
.or_insert_with(|| JsonValue::Array(Vec::new()));
|
||||
|
||||
if !object.get("sceneNpcIds").is_some_and(JsonValue::is_array) {
|
||||
let npc_ids = object
|
||||
.get("characterIds")
|
||||
.and_then(JsonValue::as_array)
|
||||
.map(|items| {
|
||||
items
|
||||
.iter()
|
||||
.filter_map(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.map(|value| JsonValue::String(value.to_string()))
|
||||
.collect::<Vec<_>>()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
object.insert("sceneNpcIds".to_string(), JsonValue::Array(npc_ids));
|
||||
}
|
||||
}
|
||||
|
||||
fn read_object_text(object: &JsonMap<String, JsonValue>, key: &str) -> Option<String> {
|
||||
object
|
||||
.get(key)
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.map(ToOwned::to_owned)
|
||||
}
|
||||
|
||||
fn read_first_object_text(object: &JsonMap<String, JsonValue>, keys: &[&str]) -> Option<String> {
|
||||
keys.iter().find_map(|key| read_object_text(object, key))
|
||||
}
|
||||
|
||||
fn insert_text_if_missing(object: &mut JsonMap<String, JsonValue>, key: &str, value: &str) {
|
||||
if read_object_text(object, key).is_none() {
|
||||
object.insert(key.to_string(), JsonValue::String(value.to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
fn existing_character_names(draft_profile: &JsonMap<String, JsonValue>) -> Vec<String> {
|
||||
["playableNpcs", "storyNpcs"]
|
||||
.into_iter()
|
||||
.flat_map(|key| object_array_names(draft_profile.get(key)))
|
||||
.take(10)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn existing_landmark_names(draft_profile: &JsonMap<String, JsonValue>) -> Vec<String> {
|
||||
object_array_names(draft_profile.get("landmarks"))
|
||||
.into_iter()
|
||||
.take(10)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn object_array_names(value: Option<&JsonValue>) -> Vec<String> {
|
||||
value
|
||||
.and_then(JsonValue::as_array)
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.filter_map(|entry| entry.get("name").and_then(JsonValue::as_str))
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.map(ToOwned::to_owned)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn build_anchor_summary(
|
||||
draft_profile: &JsonMap<String, JsonValue>,
|
||||
anchor_card_ids: &[String],
|
||||
) -> String {
|
||||
let selected = anchor_card_ids
|
||||
.iter()
|
||||
.filter_map(|card_id| find_anchor_summary(draft_profile, card_id))
|
||||
.collect::<Vec<_>>();
|
||||
if !selected.is_empty() {
|
||||
return selected.join(";");
|
||||
}
|
||||
draft_profile
|
||||
.get("summary")
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.unwrap_or("围绕当前世界底稿自然扩展。")
|
||||
.to_string()
|
||||
}
|
||||
|
||||
fn find_anchor_summary(
|
||||
draft_profile: &JsonMap<String, JsonValue>,
|
||||
card_id: &str,
|
||||
) -> Option<String> {
|
||||
for key in ["playableNpcs", "storyNpcs", "landmarks", "threads"] {
|
||||
for entry in draft_profile.get(key)?.as_array()? {
|
||||
let object = entry.as_object()?;
|
||||
let id = object
|
||||
.get("id")
|
||||
.and_then(JsonValue::as_str)
|
||||
.unwrap_or_default();
|
||||
if id != card_id {
|
||||
continue;
|
||||
}
|
||||
let name = object
|
||||
.get("name")
|
||||
.and_then(JsonValue::as_str)
|
||||
.unwrap_or_default();
|
||||
let summary = object
|
||||
.get("summary")
|
||||
.or_else(|| object.get("description"))
|
||||
.or_else(|| object.get("publicMask"))
|
||||
.and_then(JsonValue::as_str)
|
||||
.unwrap_or_default();
|
||||
return Some(format!("{name}:{summary}"));
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn create_stable_id(prefix: &str, name: &str, index: usize) -> String {
|
||||
let slug = name
|
||||
.trim()
|
||||
.to_lowercase()
|
||||
.chars()
|
||||
.map(|ch| {
|
||||
if ch.is_ascii_alphanumeric() || ('\u{4e00}'..='\u{9fa5}').contains(&ch) {
|
||||
ch
|
||||
} else {
|
||||
'-'
|
||||
}
|
||||
})
|
||||
.collect::<String>()
|
||||
.trim_matches('-')
|
||||
.to_string();
|
||||
format!(
|
||||
"{prefix}-{}-{index}",
|
||||
if slug.is_empty() {
|
||||
"entry"
|
||||
} else {
|
||||
slug.as_str()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn character_expansion_prompt_keeps_node_contract_text() {
|
||||
let prompt = build_custom_world_agent_character_expansion_prompt(ExpansionPromptParams {
|
||||
world_name: "雾港归航",
|
||||
world_summary: "守灯人追查旧案。",
|
||||
creator_intent_summary: "悬疑航海",
|
||||
anchor_summary: "旧灯塔:灯火错位",
|
||||
existing_names: vec!["岑灯".to_string()],
|
||||
count: 2,
|
||||
prompt_seed: "补一个敌对角色",
|
||||
});
|
||||
|
||||
assert!(prompt.contains("返回 JSON 数组。每个对象字段只允许包含:name, role, publicMask, hiddenHook, relationToPlayer, summary, threadIds。"));
|
||||
assert!(prompt.contains("threadIds 必须优先引用现有线程 id。"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_entities_payload_injects_expected_key() {
|
||||
let payload = ExecuteCustomWorldAgentActionRequest {
|
||||
action: "generate_landmarks".to_string(),
|
||||
profile_id: None,
|
||||
draft_profile: None,
|
||||
legacy_result_profile: None,
|
||||
setting_text: None,
|
||||
card_id: None,
|
||||
sections: None,
|
||||
profile: None,
|
||||
count: Some(1),
|
||||
role_type: None,
|
||||
prompt_text: Some("补地点".to_string()),
|
||||
anchor_card_ids: None,
|
||||
role_ids: None,
|
||||
role_id: None,
|
||||
portrait_path: None,
|
||||
generated_visual_asset_id: None,
|
||||
generated_animation_set_id: None,
|
||||
animation_map: None,
|
||||
scene_ids: None,
|
||||
scene_id: None,
|
||||
scene_kind: None,
|
||||
image_src: None,
|
||||
generated_scene_asset_id: None,
|
||||
generated_scene_prompt: None,
|
||||
generated_scene_model: None,
|
||||
checkpoint_id: None,
|
||||
};
|
||||
|
||||
let payload_json = build_generated_entities_action_payload_json(
|
||||
&payload,
|
||||
"generatedLandmarks",
|
||||
vec![json!({ "name": "沉船湾" })],
|
||||
)
|
||||
.expect("payload should build");
|
||||
let value = serde_json::from_str::<JsonValue>(&payload_json).expect("payload should parse");
|
||||
|
||||
assert_eq!(value.get("action"), Some(&json!("generate_landmarks")));
|
||||
assert_eq!(
|
||||
value
|
||||
.get("generatedLandmarks")
|
||||
.and_then(JsonValue::as_array)
|
||||
.map(Vec::len),
|
||||
Some(1)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_character_payload_fills_result_profile_fields() {
|
||||
let draft_profile = json!({
|
||||
"playableNpcs": [],
|
||||
"storyNpcs": [],
|
||||
"landmarks": []
|
||||
});
|
||||
let entities = normalize_generated_entities(
|
||||
"generate_characters",
|
||||
vec![json!({
|
||||
"name": "潮雾证人",
|
||||
"role": "旧案目击者",
|
||||
"publicMask": "总在码头边缘售卖旧航图。",
|
||||
"hiddenHook": "他记得沉钟第一次响起时失踪的人。",
|
||||
"relationToPlayer": "掌握玩家亲族旧案线索"
|
||||
})],
|
||||
draft_profile
|
||||
.as_object()
|
||||
.expect("draft profile should be object"),
|
||||
1,
|
||||
);
|
||||
let character = entities[0]
|
||||
.as_object()
|
||||
.expect("generated character should be object");
|
||||
|
||||
assert_eq!(
|
||||
character.get("description").and_then(JsonValue::as_str),
|
||||
Some("总在码头边缘售卖旧航图。")
|
||||
);
|
||||
assert_eq!(
|
||||
character.get("backstory").and_then(JsonValue::as_str),
|
||||
Some("他记得沉钟第一次响起时失踪的人。")
|
||||
);
|
||||
assert_eq!(
|
||||
character
|
||||
.get("relationshipHooks")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|items| items.first())
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("掌握玩家亲族旧案线索")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_landmark_payload_fills_scene_profile_fields() {
|
||||
let draft_profile = json!({
|
||||
"playableNpcs": [],
|
||||
"storyNpcs": [{ "id": "character-witness", "name": "潮雾证人" }],
|
||||
"landmarks": []
|
||||
});
|
||||
let entities = normalize_generated_entities(
|
||||
"generate_landmarks",
|
||||
vec![json!({
|
||||
"name": "沉钟码头",
|
||||
"purpose": "玩家第一次追查沉钟旧案的入口。",
|
||||
"mood": "潮湿、压抑、灯火忽明忽暗。",
|
||||
"secret": "码头木桩下藏着改写航道的符牌。",
|
||||
"dangerLevel": "高",
|
||||
"characterIds": ["character-witness"]
|
||||
})],
|
||||
draft_profile
|
||||
.as_object()
|
||||
.expect("draft profile should be object"),
|
||||
1,
|
||||
);
|
||||
let landmark = entities[0]
|
||||
.as_object()
|
||||
.expect("generated landmark should be object");
|
||||
|
||||
assert!(
|
||||
landmark
|
||||
.get("description")
|
||||
.and_then(JsonValue::as_str)
|
||||
.is_some_and(|text| text.contains("沉钟旧案") && text.contains("符牌"))
|
||||
);
|
||||
assert_eq!(
|
||||
landmark
|
||||
.get("sceneNpcIds")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|items| items.first())
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("character-witness")
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,10 +10,13 @@ mod auth_public_user;
|
||||
mod auth_session;
|
||||
mod auth_sessions;
|
||||
mod big_fish;
|
||||
mod big_fish_agent_turn;
|
||||
mod character_animation_assets;
|
||||
mod character_visual_assets;
|
||||
mod config;
|
||||
mod creation_agent_anchor_templates;
|
||||
mod custom_world;
|
||||
mod custom_world_agent_entities;
|
||||
mod custom_world_agent_turn;
|
||||
mod custom_world_ai;
|
||||
mod custom_world_foundation_draft;
|
||||
|
||||
@@ -6,6 +6,10 @@ use spacetime_client::{
|
||||
PuzzleAgentMessageFinalizeRecordInput, PuzzleAgentMessageRecord, PuzzleAgentSessionRecord,
|
||||
};
|
||||
|
||||
use crate::creation_agent_anchor_templates::{
|
||||
get_creation_agent_anchor_template, render_anchor_question_block,
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct PuzzleAgentTurnRequest<'a> {
|
||||
pub llm_client: Option<&'a LlmClient>,
|
||||
@@ -59,13 +63,6 @@ const PUZZLE_AGENT_SYSTEM_PROMPT: &str = r#"你是一个负责和创作者共创
|
||||
2. 当前进度 progressPercent
|
||||
3. 下一轮完整可用的 nextAnchorPack
|
||||
|
||||
拼图创作固定围绕 5 个视觉锚点:
|
||||
1. themePromise:题材承诺
|
||||
2. visualSubject:画面主体
|
||||
3. visualMood:视觉气质
|
||||
4. compositionHooks:拼图记忆点
|
||||
5. tagsAndForbidden:标签与禁忌
|
||||
|
||||
硬约束:
|
||||
1. 只能输出 JSON,不能输出代码块或解释
|
||||
2. nextAnchorPack 必须是完整对象,不能只输出 patch
|
||||
@@ -211,8 +208,12 @@ pub(crate) fn build_failed_finalize_record_input(
|
||||
}
|
||||
|
||||
fn build_puzzle_agent_prompt(session: &PuzzleAgentSessionRecord) -> String {
|
||||
let anchor_question_block = get_creation_agent_anchor_template("puzzle")
|
||||
.map(render_anchor_question_block)
|
||||
.unwrap_or_else(|| "模板目标:收束成可以发布为拼图关卡的视觉方案。".to_string());
|
||||
format!(
|
||||
"当前是第 {turn} 轮,当前进度 {progress}% 。\n\n当前 anchor pack:\n{anchor_pack}\n\n最近聊天记录:\n{chat_history}\n\n{contract}",
|
||||
"{anchor_question_block}\n\n当前是第 {turn} 轮,当前进度 {progress}% 。\n\n当前 anchor pack:\n{anchor_pack}\n\n最近聊天记录:\n{chat_history}\n\n{contract}",
|
||||
anchor_question_block = anchor_question_block,
|
||||
turn = session.current_turn.saturating_add(1),
|
||||
progress = session.progress_percent,
|
||||
anchor_pack = serde_json::to_string_pretty(&map_record_anchor_pack(&session.anchor_pack))
|
||||
|
||||
@@ -321,6 +321,20 @@ pub struct BigFishMessageSubmitInput {
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct BigFishMessageFinalizeInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub assistant_message_id: Option<String>,
|
||||
pub assistant_reply_text: Option<String>,
|
||||
pub stage: BigFishCreationStage,
|
||||
pub progress_percent: u32,
|
||||
pub anchor_pack_json: String,
|
||||
pub error_message: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct BigFishDraftCompileInput {
|
||||
@@ -757,6 +771,12 @@ pub fn validate_message_submit_input(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_message_finalize_input(
|
||||
input: &BigFishMessageFinalizeInput,
|
||||
) -> Result<(), BigFishFieldError> {
|
||||
validate_session_owner(&input.session_id, &input.owner_user_id)
|
||||
}
|
||||
|
||||
pub fn validate_draft_compile_input(
|
||||
input: &BigFishDraftCompileInput,
|
||||
) -> Result<(), BigFishFieldError> {
|
||||
|
||||
@@ -84,6 +84,8 @@ pub enum RpgAgentOperationType {
|
||||
SyncResultProfile,
|
||||
GenerateCharacters,
|
||||
GenerateLandmarks,
|
||||
DeleteCharacters,
|
||||
DeleteLandmarks,
|
||||
GenerateRoleAssets,
|
||||
SyncRoleAssets,
|
||||
GenerateSceneAssets,
|
||||
@@ -768,6 +770,8 @@ impl RpgAgentOperationType {
|
||||
Self::SyncResultProfile => "sync_result_profile",
|
||||
Self::GenerateCharacters => "generate_characters",
|
||||
Self::GenerateLandmarks => "generate_landmarks",
|
||||
Self::DeleteCharacters => "delete_characters",
|
||||
Self::DeleteLandmarks => "delete_landmarks",
|
||||
Self::GenerateRoleAssets => "generate_role_assets",
|
||||
Self::SyncRoleAssets => "sync_role_assets",
|
||||
Self::GenerateSceneAssets => "generate_scene_assets",
|
||||
|
||||
@@ -510,6 +510,8 @@ pub struct ExecuteCustomWorldAgentActionRequest {
|
||||
#[serde(default)]
|
||||
pub count: Option<u32>,
|
||||
#[serde(default)]
|
||||
pub role_type: Option<String>,
|
||||
#[serde(default)]
|
||||
pub prompt_text: Option<String>,
|
||||
#[serde(default)]
|
||||
pub anchor_card_ids: Option<Vec<String>>,
|
||||
|
||||
@@ -143,6 +143,7 @@ use crate::module_bindings::{
|
||||
BigFishDraftCompileInput as BindingBigFishDraftCompileInput,
|
||||
BigFishGameDraft as BindingBigFishGameDraft,
|
||||
BigFishLevelBlueprint as BindingBigFishLevelBlueprint,
|
||||
BigFishMessageFinalizeInput as BindingBigFishMessageFinalizeInput,
|
||||
BigFishMessageSubmitInput as BindingBigFishMessageSubmitInput,
|
||||
BigFishPublishInput as BindingBigFishPublishInput,
|
||||
BigFishRunGetInput as BindingBigFishRunGetInput,
|
||||
@@ -302,6 +303,7 @@ use crate::module_bindings::{
|
||||
drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group as _,
|
||||
execute_custom_world_agent_action_procedure::execute_custom_world_agent_action as _,
|
||||
fail_ai_task_and_return_procedure::fail_ai_task_and_return as _,
|
||||
finalize_big_fish_agent_message_turn_procedure::finalize_big_fish_agent_message_turn as _,
|
||||
finalize_custom_world_agent_message_turn_procedure::finalize_custom_world_agent_message_turn as _,
|
||||
finalize_puzzle_agent_message_turn_procedure::finalize_puzzle_agent_message_turn as _,
|
||||
generate_big_fish_asset_procedure::generate_big_fish_asset as _,
|
||||
@@ -1574,6 +1576,35 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn finalize_big_fish_agent_message(
|
||||
&self,
|
||||
input: BigFishMessageFinalizeRecordInput,
|
||||
) -> Result<BigFishSessionRecord, SpacetimeClientError> {
|
||||
let procedure_input = BindingBigFishMessageFinalizeInput {
|
||||
session_id: input.session_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
assistant_message_id: input.assistant_message_id,
|
||||
assistant_reply_text: input.assistant_reply_text,
|
||||
stage: parse_big_fish_creation_stage_record(input.stage.as_str())?,
|
||||
progress_percent: input.progress_percent,
|
||||
anchor_pack_json: input.anchor_pack_json,
|
||||
error_message: input.error_message,
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.finalize_big_fish_agent_message_turn_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||
.and_then(map_big_fish_session_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn compile_big_fish_draft(
|
||||
&self,
|
||||
session_id: String,
|
||||
@@ -5300,6 +5331,21 @@ fn format_big_fish_creation_stage(value: BindingBigFishCreationStage) -> &'stati
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_big_fish_creation_stage_record(
|
||||
value: &str,
|
||||
) -> Result<BindingBigFishCreationStage, SpacetimeClientError> {
|
||||
match value.trim() {
|
||||
"collecting_anchors" => Ok(BindingBigFishCreationStage::CollectingAnchors),
|
||||
"draft_ready" => Ok(BindingBigFishCreationStage::DraftReady),
|
||||
"asset_refining" => Ok(BindingBigFishCreationStage::AssetRefining),
|
||||
"ready_to_publish" => Ok(BindingBigFishCreationStage::ReadyToPublish),
|
||||
"published" => Ok(BindingBigFishCreationStage::Published),
|
||||
other => Err(SpacetimeClientError::Runtime(format!(
|
||||
"未知 big fish creation stage: {other}"
|
||||
))),
|
||||
}
|
||||
}
|
||||
|
||||
fn format_big_fish_anchor_status(value: BindingBigFishAnchorStatus) -> &'static str {
|
||||
match value {
|
||||
BindingBigFishAnchorStatus::Confirmed => "confirmed",
|
||||
@@ -6445,6 +6491,19 @@ pub struct BigFishMessageSubmitRecordInput {
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct BigFishMessageFinalizeRecordInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub assistant_message_id: Option<String>,
|
||||
pub assistant_reply_text: Option<String>,
|
||||
pub stage: String,
|
||||
pub progress_percent: u32,
|
||||
pub anchor_pack_json: String,
|
||||
pub error_message: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct BigFishAssetGenerateRecordInput {
|
||||
pub session_id: String,
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::quest_record_input_type::QuestRecordInput;
|
||||
|
||||
@@ -14,8 +19,10 @@ pub(super) struct AcceptQuestArgs {
|
||||
|
||||
impl From<AcceptQuestArgs> for super::Reducer {
|
||||
fn from(args: AcceptQuestArgs) -> Self {
|
||||
Self::AcceptQuest { input: args.input }
|
||||
}
|
||||
Self::AcceptQuest {
|
||||
input: args.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for AcceptQuestArgs {
|
||||
@@ -33,8 +40,9 @@ pub trait accept_quest {
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`accept_quest:accept_quest_then`] to run a callback after the reducer completes.
|
||||
fn accept_quest(&self, input: QuestRecordInput) -> __sdk::Result<()> {
|
||||
self.accept_quest_then(input, |_, _| {})
|
||||
fn accept_quest(&self, input: QuestRecordInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.accept_quest_then(input, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `accept_quest` to run as soon as possible,
|
||||
@@ -47,11 +55,9 @@ pub trait accept_quest {
|
||||
&self,
|
||||
input: QuestRecordInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
@@ -60,13 +66,11 @@ impl accept_quest for super::RemoteReducers {
|
||||
&self,
|
||||
input: QuestRecordInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(AcceptQuestArgs { input }, callback)
|
||||
self.imp.invoke_reducer_with_callback(AcceptQuestArgs { input, }, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::quest_completion_ack_input_type::QuestCompletionAckInput;
|
||||
|
||||
@@ -14,8 +19,10 @@ pub(super) struct AcknowledgeQuestCompletionArgs {
|
||||
|
||||
impl From<AcknowledgeQuestCompletionArgs> for super::Reducer {
|
||||
fn from(args: AcknowledgeQuestCompletionArgs) -> Self {
|
||||
Self::AcknowledgeQuestCompletion { input: args.input }
|
||||
}
|
||||
Self::AcknowledgeQuestCompletion {
|
||||
input: args.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for AcknowledgeQuestCompletionArgs {
|
||||
@@ -33,8 +40,9 @@ pub trait acknowledge_quest_completion {
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`acknowledge_quest_completion:acknowledge_quest_completion_then`] to run a callback after the reducer completes.
|
||||
fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput) -> __sdk::Result<()> {
|
||||
self.acknowledge_quest_completion_then(input, |_, _| {})
|
||||
fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.acknowledge_quest_completion_then(input, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `acknowledge_quest_completion` to run as soon as possible,
|
||||
@@ -47,11 +55,9 @@ pub trait acknowledge_quest_completion {
|
||||
&self,
|
||||
input: QuestCompletionAckInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
@@ -60,13 +66,11 @@ impl acknowledge_quest_completion for super::RemoteReducers {
|
||||
&self,
|
||||
input: QuestCompletionAckInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback)
|
||||
self.imp.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input, }, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,23 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::puzzle_run_next_level_input_type::PuzzleRunNextLevelInput;
|
||||
use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct AdvancePuzzleNextLevelArgs {
|
||||
struct AdvancePuzzleNextLevelArgs {
|
||||
pub input: PuzzleRunNextLevelInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AdvancePuzzleNextLevelArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for AdvancePuzzleNextLevelArgs {
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait advance_puzzle_next_level {
|
||||
fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput) {
|
||||
self.advance_puzzle_next_level_then(input, |_, _| {});
|
||||
fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput,
|
||||
) {
|
||||
self.advance_puzzle_next_level_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn advance_puzzle_next_level_then(
|
||||
&self,
|
||||
input: PuzzleRunNextLevelInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,17 +46,13 @@ impl advance_puzzle_next_level for super::RemoteProcedures {
|
||||
&self,
|
||||
input: PuzzleRunNextLevelInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(
|
||||
"advance_puzzle_next_level",
|
||||
AdvancePuzzleNextLevelArgs { input },
|
||||
__callback,
|
||||
);
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(
|
||||
"advance_puzzle_next_level",
|
||||
AdvancePuzzleNextLevelArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||
|
||||
@@ -12,10 +17,12 @@ pub struct AiResultReferenceInput {
|
||||
pub task_id: String,
|
||||
pub reference_kind: AiResultReferenceKind,
|
||||
pub reference_id: String,
|
||||
pub label: Option<String>,
|
||||
pub label: Option::<String>,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiResultReferenceInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -19,8 +24,12 @@ pub enum AiResultReferenceKind {
|
||||
RuntimeItemRecord,
|
||||
|
||||
AssetObject,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for AiResultReferenceKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||
|
||||
@@ -13,10 +18,12 @@ pub struct AiResultReferenceSnapshot {
|
||||
pub task_id: String,
|
||||
pub reference_kind: AiResultReferenceKind,
|
||||
pub reference_id: String,
|
||||
pub label: Option<String>,
|
||||
pub label: Option::<String>,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiResultReferenceSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::ai_result_reference_type::AiResultReference;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||
|
||||
/// Table handle for the table `ai_result_reference`.
|
||||
///
|
||||
@@ -32,9 +37,7 @@ pub trait AiResultReferenceTableAccess {
|
||||
impl AiResultReferenceTableAccess for super::RemoteTables {
|
||||
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> {
|
||||
AiResultReferenceTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<AiResultReference>("ai_result_reference"),
|
||||
imp: self.imp.get_table::<AiResultReference>("ai_result_reference"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> {
|
||||
type Row = AiResultReference;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AiResultReferenceInsertCallbackId;
|
||||
|
||||
@@ -98,44 +97,41 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiResultReferenceTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
|
||||
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AiResultReferenceTableHandle<'ctx> {
|
||||
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`.
|
||||
pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||
AiResultReferenceResultReferenceRowIdUnique {
|
||||
imp: self
|
||||
.imp
|
||||
.get_unique_constraint::<String>("result_reference_row_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
|
||||
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> AiResultReferenceTableHandle<'ctx> {
|
||||
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`.
|
||||
pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||
AiResultReferenceResultReferenceRowIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("result_reference_row_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference");
|
||||
_table.add_unique_constraint::<String>("result_reference_row_id", |row| {
|
||||
&row.result_reference_row_id
|
||||
});
|
||||
_table.add_unique_constraint::<String>("result_reference_row_id", |row| &row.result_reference_row_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
@@ -143,24 +139,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AiResultReference>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AiResultReference>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiResultReference`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_result_referenceQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiResultReference`.
|
||||
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiResultReference`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_result_referenceQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiResultReference`.
|
||||
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
|
||||
}
|
||||
|
||||
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
|
||||
__sdk::__query_builder::Table::new("ai_result_reference")
|
||||
}
|
||||
}
|
||||
|
||||
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
|
||||
__sdk::__query_builder::Table::new("ai_result_reference")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||
|
||||
@@ -14,14 +19,16 @@ pub struct AiResultReference {
|
||||
pub task_id: String,
|
||||
pub reference_kind: AiResultReferenceKind,
|
||||
pub reference_id: String,
|
||||
pub label: Option<String>,
|
||||
pub label: Option::<String>,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiResultReference {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `AiResultReference`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -31,7 +38,7 @@ pub struct AiResultReferenceCols {
|
||||
pub task_id: __sdk::__query_builder::Col<AiResultReference, String>,
|
||||
pub reference_kind: __sdk::__query_builder::Col<AiResultReference, AiResultReferenceKind>,
|
||||
pub reference_id: __sdk::__query_builder::Col<AiResultReference, String>,
|
||||
pub label: __sdk::__query_builder::Col<AiResultReference, Option<String>>,
|
||||
pub label: __sdk::__query_builder::Col<AiResultReference, Option::<String>>,
|
||||
pub created_at: __sdk::__query_builder::Col<AiResultReference, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
@@ -39,16 +46,14 @@ impl __sdk::__query_builder::HasCols for AiResultReference {
|
||||
type Cols = AiResultReferenceCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
AiResultReferenceCols {
|
||||
result_reference_row_id: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"result_reference_row_id",
|
||||
),
|
||||
result_reference_row_id: __sdk::__query_builder::Col::new(table_name, "result_reference_row_id"),
|
||||
result_ref_id: __sdk::__query_builder::Col::new(table_name, "result_ref_id"),
|
||||
task_id: __sdk::__query_builder::Col::new(table_name, "task_id"),
|
||||
reference_kind: __sdk::__query_builder::Col::new(table_name, "reference_kind"),
|
||||
reference_id: __sdk::__query_builder::Col::new(table_name, "reference_id"),
|
||||
label: __sdk::__query_builder::Col::new(table_name, "label"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,13 +70,12 @@ impl __sdk::__query_builder::HasIxCols for AiResultReference {
|
||||
type IxCols = AiResultReferenceIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
AiResultReferenceIxCols {
|
||||
result_reference_row_id: __sdk::__query_builder::IxCol::new(
|
||||
table_name,
|
||||
"result_reference_row_id",
|
||||
),
|
||||
result_reference_row_id: __sdk::__query_builder::IxCol::new(table_name, "result_reference_row_id"),
|
||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AiResultReference {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
@@ -11,12 +16,14 @@ use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
pub struct AiStageCompletionInput {
|
||||
pub task_id: String,
|
||||
pub stage_kind: AiTaskStageKind,
|
||||
pub text_output: Option<String>,
|
||||
pub structured_payload_json: Option<String>,
|
||||
pub warning_messages: Vec<String>,
|
||||
pub text_output: Option::<String>,
|
||||
pub structured_payload_json: Option::<String>,
|
||||
pub warning_messages: Vec::<String>,
|
||||
pub completed_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiStageCompletionInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,6 +17,8 @@ pub struct AiTaskCancelInput {
|
||||
pub completed_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskCancelInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_kind_type::AiTaskKind;
|
||||
use super::ai_task_stage_blueprint_type::AiTaskStageBlueprint;
|
||||
@@ -15,12 +20,14 @@ pub struct AiTaskCreateInput {
|
||||
pub owner_user_id: String,
|
||||
pub request_label: String,
|
||||
pub source_module: String,
|
||||
pub source_entity_id: Option<String>,
|
||||
pub request_payload_json: Option<String>,
|
||||
pub stages: Vec<AiTaskStageBlueprint>,
|
||||
pub source_entity_id: Option::<String>,
|
||||
pub request_payload_json: Option::<String>,
|
||||
pub stages: Vec::<AiTaskStageBlueprint>,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskCreateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -12,6 +18,8 @@ pub struct AiTaskFailureInput {
|
||||
pub completed_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskFailureInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,6 +17,8 @@ pub struct AiTaskFinishInput {
|
||||
pub completed_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskFinishInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -19,8 +24,12 @@ pub enum AiTaskKind {
|
||||
QuestIntent,
|
||||
|
||||
RuntimeItemIntent,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_snapshot_type::AiTaskSnapshot;
|
||||
use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
|
||||
@@ -11,11 +16,13 @@ use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
|
||||
#[sats(crate = __lib)]
|
||||
pub struct AiTaskProcedureResult {
|
||||
pub ok: bool,
|
||||
pub task: Option<AiTaskSnapshot>,
|
||||
pub text_chunk: Option<AiTextChunkSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
pub task: Option::<AiTaskSnapshot>,
|
||||
pub text_chunk: Option::<AiTextChunkSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_result_reference_snapshot_type::AiResultReferenceSnapshot;
|
||||
use super::ai_task_kind_type::AiTaskKind;
|
||||
use super::ai_task_stage_snapshot_type::AiTaskStageSnapshot;
|
||||
use super::ai_task_status_type::AiTaskStatus;
|
||||
use super::ai_task_stage_snapshot_type::AiTaskStageSnapshot;
|
||||
use super::ai_result_reference_snapshot_type::AiResultReferenceSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -17,21 +22,23 @@ pub struct AiTaskSnapshot {
|
||||
pub owner_user_id: String,
|
||||
pub request_label: String,
|
||||
pub source_module: String,
|
||||
pub source_entity_id: Option<String>,
|
||||
pub request_payload_json: Option<String>,
|
||||
pub source_entity_id: Option::<String>,
|
||||
pub request_payload_json: Option::<String>,
|
||||
pub status: AiTaskStatus,
|
||||
pub failure_message: Option<String>,
|
||||
pub stages: Vec<AiTaskStageSnapshot>,
|
||||
pub result_references: Vec<AiResultReferenceSnapshot>,
|
||||
pub latest_text_output: Option<String>,
|
||||
pub latest_structured_payload_json: Option<String>,
|
||||
pub failure_message: Option::<String>,
|
||||
pub stages: Vec::<AiTaskStageSnapshot>,
|
||||
pub result_references: Vec::<AiResultReferenceSnapshot>,
|
||||
pub latest_text_output: Option::<String>,
|
||||
pub latest_structured_payload_json: Option::<String>,
|
||||
pub version: u32,
|
||||
pub created_at_micros: i64,
|
||||
pub started_at_micros: Option<i64>,
|
||||
pub completed_at_micros: Option<i64>,
|
||||
pub started_at_micros: Option::<i64>,
|
||||
pub completed_at_micros: Option::<i64>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
@@ -15,6 +20,8 @@ pub struct AiTaskStageBlueprint {
|
||||
pub order: u32,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStageBlueprint {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -17,8 +22,12 @@ pub enum AiTaskStageKind {
|
||||
NormalizeResult,
|
||||
|
||||
PersistResult,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStageKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||
@@ -15,13 +20,15 @@ pub struct AiTaskStageSnapshot {
|
||||
pub detail: String,
|
||||
pub order: u32,
|
||||
pub status: AiTaskStageStatus,
|
||||
pub text_output: Option<String>,
|
||||
pub structured_payload_json: Option<String>,
|
||||
pub warning_messages: Vec<String>,
|
||||
pub started_at_micros: Option<i64>,
|
||||
pub completed_at_micros: Option<i64>,
|
||||
pub text_output: Option::<String>,
|
||||
pub structured_payload_json: Option::<String>,
|
||||
pub warning_messages: Vec::<String>,
|
||||
pub started_at_micros: Option::<i64>,
|
||||
pub completed_at_micros: Option::<i64>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStageSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
@@ -14,6 +19,8 @@ pub struct AiTaskStageStartInput {
|
||||
pub started_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStageStartInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -15,8 +20,12 @@ pub enum AiTaskStageStatus {
|
||||
Completed,
|
||||
|
||||
Skipped,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStageStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::ai_task_stage_type::AiTaskStage;
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||
use super::ai_task_stage_type::AiTaskStage;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `ai_task_stage`.
|
||||
///
|
||||
@@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> {
|
||||
type Row = AiTaskStage;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AiTaskStageInsertCallbackId;
|
||||
|
||||
@@ -97,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskStageTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiTaskStageTaskStageIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
|
||||
pub struct AiTaskStageTaskStageIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AiTaskStageTableHandle<'ctx> {
|
||||
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
|
||||
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||
AiTaskStageTaskStageIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiTaskStageTaskStageIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
|
||||
pub struct AiTaskStageTaskStageIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> AiTaskStageTableHandle<'ctx> {
|
||||
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
|
||||
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||
AiTaskStageTaskStageIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage");
|
||||
_table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id);
|
||||
}
|
||||
@@ -138,24 +140,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AiTaskStage>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AiTaskStage>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiTaskStage`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_task_stageQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiTaskStage`.
|
||||
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiTaskStage`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_task_stageQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiTaskStage`.
|
||||
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
|
||||
}
|
||||
|
||||
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
|
||||
__sdk::__query_builder::Table::new("ai_task_stage")
|
||||
}
|
||||
}
|
||||
|
||||
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
|
||||
__sdk::__query_builder::Table::new("ai_task_stage")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||
@@ -17,17 +22,19 @@ pub struct AiTaskStage {
|
||||
pub detail: String,
|
||||
pub stage_order: u32,
|
||||
pub status: AiTaskStageStatus,
|
||||
pub text_output: Option<String>,
|
||||
pub structured_payload_json: Option<String>,
|
||||
pub warning_messages: Vec<String>,
|
||||
pub started_at: Option<__sdk::Timestamp>,
|
||||
pub completed_at: Option<__sdk::Timestamp>,
|
||||
pub text_output: Option::<String>,
|
||||
pub structured_payload_json: Option::<String>,
|
||||
pub warning_messages: Vec::<String>,
|
||||
pub started_at: Option::<__sdk::Timestamp>,
|
||||
pub completed_at: Option::<__sdk::Timestamp>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `AiTaskStage`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -39,11 +46,11 @@ pub struct AiTaskStageCols {
|
||||
pub detail: __sdk::__query_builder::Col<AiTaskStage, String>,
|
||||
pub stage_order: __sdk::__query_builder::Col<AiTaskStage, u32>,
|
||||
pub status: __sdk::__query_builder::Col<AiTaskStage, AiTaskStageStatus>,
|
||||
pub text_output: __sdk::__query_builder::Col<AiTaskStage, Option<String>>,
|
||||
pub structured_payload_json: __sdk::__query_builder::Col<AiTaskStage, Option<String>>,
|
||||
pub warning_messages: __sdk::__query_builder::Col<AiTaskStage, Vec<String>>,
|
||||
pub started_at: __sdk::__query_builder::Col<AiTaskStage, Option<__sdk::Timestamp>>,
|
||||
pub completed_at: __sdk::__query_builder::Col<AiTaskStage, Option<__sdk::Timestamp>>,
|
||||
pub text_output: __sdk::__query_builder::Col<AiTaskStage, Option::<String>>,
|
||||
pub structured_payload_json: __sdk::__query_builder::Col<AiTaskStage, Option::<String>>,
|
||||
pub warning_messages: __sdk::__query_builder::Col<AiTaskStage, Vec::<String>>,
|
||||
pub started_at: __sdk::__query_builder::Col<AiTaskStage, Option::<__sdk::Timestamp>>,
|
||||
pub completed_at: __sdk::__query_builder::Col<AiTaskStage, Option::<__sdk::Timestamp>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for AiTaskStage {
|
||||
@@ -58,13 +65,11 @@ impl __sdk::__query_builder::HasCols for AiTaskStage {
|
||||
stage_order: __sdk::__query_builder::Col::new(table_name, "stage_order"),
|
||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||
text_output: __sdk::__query_builder::Col::new(table_name, "text_output"),
|
||||
structured_payload_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"structured_payload_json",
|
||||
),
|
||||
structured_payload_json: __sdk::__query_builder::Col::new(table_name, "structured_payload_json"),
|
||||
warning_messages: __sdk::__query_builder::Col::new(table_name, "warning_messages"),
|
||||
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
|
||||
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,8 +88,10 @@ impl __sdk::__query_builder::HasIxCols for AiTaskStage {
|
||||
AiTaskStageIxCols {
|
||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||
task_stage_id: __sdk::__query_builder::IxCol::new(table_name, "task_stage_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AiTaskStage {}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,6 +17,8 @@ pub struct AiTaskStartInput {
|
||||
pub started_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStartInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -17,8 +22,12 @@ pub enum AiTaskStatus {
|
||||
Failed,
|
||||
|
||||
Cancelled,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTaskStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::ai_task_type::AiTask;
|
||||
use super::ai_task_kind_type::AiTaskKind;
|
||||
use super::ai_task_status_type::AiTaskStatus;
|
||||
use super::ai_task_type::AiTask;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `ai_task`.
|
||||
///
|
||||
@@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> {
|
||||
type Row = AiTask;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AiTaskInsertCallbackId;
|
||||
|
||||
@@ -97,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `task_id` unique index on the table `ai_task`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiTaskTaskIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_task().task_id().find(...)`.
|
||||
pub struct AiTaskTaskIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiTask, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AiTaskTableHandle<'ctx> {
|
||||
/// Get a handle on the `task_id` unique index on the table `ai_task`.
|
||||
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
|
||||
AiTaskTaskIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("task_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `task_id` unique index on the table `ai_task`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiTaskTaskIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_task().task_id().find(...)`.
|
||||
pub struct AiTaskTaskIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiTask, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiTaskTaskIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiTask> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> AiTaskTableHandle<'ctx> {
|
||||
/// Get a handle on the `task_id` unique index on the table `ai_task`.
|
||||
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
|
||||
AiTaskTaskIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("task_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiTaskTaskIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiTask> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<AiTask>("ai_task");
|
||||
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
|
||||
}
|
||||
@@ -138,24 +140,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AiTask>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AiTask>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AiTask>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiTask`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_taskQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiTask`.
|
||||
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiTask`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_taskQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiTask`.
|
||||
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
|
||||
}
|
||||
|
||||
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
|
||||
__sdk::__query_builder::Table::new("ai_task")
|
||||
}
|
||||
}
|
||||
|
||||
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
|
||||
__sdk::__query_builder::Table::new("ai_task")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_kind_type::AiTaskKind;
|
||||
use super::ai_task_status_type::AiTaskStatus;
|
||||
@@ -15,23 +20,25 @@ pub struct AiTask {
|
||||
pub owner_user_id: String,
|
||||
pub request_label: String,
|
||||
pub source_module: String,
|
||||
pub source_entity_id: Option<String>,
|
||||
pub request_payload_json: Option<String>,
|
||||
pub source_entity_id: Option::<String>,
|
||||
pub request_payload_json: Option::<String>,
|
||||
pub status: AiTaskStatus,
|
||||
pub failure_message: Option<String>,
|
||||
pub latest_text_output: Option<String>,
|
||||
pub latest_structured_payload_json: Option<String>,
|
||||
pub failure_message: Option::<String>,
|
||||
pub latest_text_output: Option::<String>,
|
||||
pub latest_structured_payload_json: Option::<String>,
|
||||
pub version: u32,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub started_at: Option<__sdk::Timestamp>,
|
||||
pub completed_at: Option<__sdk::Timestamp>,
|
||||
pub started_at: Option::<__sdk::Timestamp>,
|
||||
pub completed_at: Option::<__sdk::Timestamp>,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTask {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `AiTask`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -41,16 +48,16 @@ pub struct AiTaskCols {
|
||||
pub owner_user_id: __sdk::__query_builder::Col<AiTask, String>,
|
||||
pub request_label: __sdk::__query_builder::Col<AiTask, String>,
|
||||
pub source_module: __sdk::__query_builder::Col<AiTask, String>,
|
||||
pub source_entity_id: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
||||
pub request_payload_json: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
||||
pub source_entity_id: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||
pub request_payload_json: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||
pub status: __sdk::__query_builder::Col<AiTask, AiTaskStatus>,
|
||||
pub failure_message: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
||||
pub latest_text_output: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
||||
pub latest_structured_payload_json: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
||||
pub failure_message: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||
pub latest_text_output: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||
pub latest_structured_payload_json: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||
pub version: __sdk::__query_builder::Col<AiTask, u32>,
|
||||
pub created_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
|
||||
pub started_at: __sdk::__query_builder::Col<AiTask, Option<__sdk::Timestamp>>,
|
||||
pub completed_at: __sdk::__query_builder::Col<AiTask, Option<__sdk::Timestamp>>,
|
||||
pub started_at: __sdk::__query_builder::Col<AiTask, Option::<__sdk::Timestamp>>,
|
||||
pub completed_at: __sdk::__query_builder::Col<AiTask, Option::<__sdk::Timestamp>>,
|
||||
pub updated_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
@@ -64,22 +71,17 @@ impl __sdk::__query_builder::HasCols for AiTask {
|
||||
request_label: __sdk::__query_builder::Col::new(table_name, "request_label"),
|
||||
source_module: __sdk::__query_builder::Col::new(table_name, "source_module"),
|
||||
source_entity_id: __sdk::__query_builder::Col::new(table_name, "source_entity_id"),
|
||||
request_payload_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"request_payload_json",
|
||||
),
|
||||
request_payload_json: __sdk::__query_builder::Col::new(table_name, "request_payload_json"),
|
||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||
failure_message: __sdk::__query_builder::Col::new(table_name, "failure_message"),
|
||||
latest_text_output: __sdk::__query_builder::Col::new(table_name, "latest_text_output"),
|
||||
latest_structured_payload_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"latest_structured_payload_json",
|
||||
),
|
||||
latest_structured_payload_json: __sdk::__query_builder::Col::new(table_name, "latest_structured_payload_json"),
|
||||
version: __sdk::__query_builder::Col::new(table_name, "version"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
|
||||
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,8 +104,10 @@ impl __sdk::__query_builder::HasIxCols for AiTask {
|
||||
status: __sdk::__query_builder::IxCol::new(table_name, "status"),
|
||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||
task_kind: __sdk::__query_builder::IxCol::new(table_name, "task_kind"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AiTask {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
@@ -16,6 +21,8 @@ pub struct AiTextChunkAppendInput {
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTextChunkAppendInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
@@ -17,6 +22,8 @@ pub struct AiTextChunkSnapshot {
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTextChunkSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::ai_text_chunk_type::AiTextChunk;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
/// Table handle for the table `ai_text_chunk`.
|
||||
///
|
||||
@@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> {
|
||||
type Row = AiTextChunk;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AiTextChunkInsertCallbackId;
|
||||
|
||||
@@ -96,40 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTextChunkTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
|
||||
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AiTextChunkTableHandle<'ctx> {
|
||||
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`.
|
||||
pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||
AiTextChunkTextChunkRowIdUnique {
|
||||
imp: self
|
||||
.imp
|
||||
.get_unique_constraint::<String>("text_chunk_row_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
|
||||
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> AiTextChunkTableHandle<'ctx> {
|
||||
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`.
|
||||
pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||
AiTextChunkTextChunkRowIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("text_chunk_row_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk");
|
||||
_table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id);
|
||||
}
|
||||
@@ -139,24 +139,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AiTextChunk>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AiTextChunk>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiTextChunk`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_text_chunkQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiTextChunk`.
|
||||
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AiTextChunk`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait ai_text_chunkQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AiTextChunk`.
|
||||
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
|
||||
}
|
||||
|
||||
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
|
||||
__sdk::__query_builder::Table::new("ai_text_chunk")
|
||||
}
|
||||
}
|
||||
|
||||
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
|
||||
__sdk::__query_builder::Table::new("ai_text_chunk")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
@@ -18,10 +23,12 @@ pub struct AiTextChunk {
|
||||
pub created_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AiTextChunk {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `AiTextChunk`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -46,6 +53,7 @@ impl __sdk::__query_builder::HasCols for AiTextChunk {
|
||||
sequence: __sdk::__query_builder::Col::new(table_name, "sequence"),
|
||||
delta_text: __sdk::__query_builder::Col::new(table_name, "delta_text"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,8 +72,10 @@ impl __sdk::__query_builder::HasIxCols for AiTextChunk {
|
||||
AiTextChunkIxCols {
|
||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||
text_chunk_row_id: __sdk::__query_builder::IxCol::new(table_name, "text_chunk_row_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AiTextChunk {}
|
||||
|
||||
|
||||
@@ -2,17 +2,23 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||
use super::ai_text_chunk_append_input_type::AiTextChunkAppendInput;
|
||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct AppendAiTextChunkAndReturnArgs {
|
||||
struct AppendAiTextChunkAndReturnArgs {
|
||||
pub input: AiTextChunkAppendInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait append_ai_text_chunk_and_return {
|
||||
fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput) {
|
||||
self.append_ai_text_chunk_and_return_then(input, |_, _| {});
|
||||
fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput,
|
||||
) {
|
||||
self.append_ai_text_chunk_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn append_ai_text_chunk_and_return_then(
|
||||
&self,
|
||||
input: AiTextChunkAppendInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,17 +46,13 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures {
|
||||
&self,
|
||||
input: AiTextChunkAppendInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||
"append_ai_text_chunk_and_return",
|
||||
AppendAiTextChunkAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||
"append_ai_text_chunk_and_return",
|
||||
AppendAiTextChunkAndReturnArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,23 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
|
||||
use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
||||
struct ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
||||
pub input: ChapterProgressionLedgerInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -22,22 +28,16 @@ impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait apply_chapter_progression_ledger_entry_and_return {
|
||||
fn apply_chapter_progression_ledger_entry_and_return(
|
||||
&self,
|
||||
input: ChapterProgressionLedgerInput,
|
||||
) {
|
||||
self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {});
|
||||
fn apply_chapter_progression_ledger_entry_and_return(&self, input: ChapterProgressionLedgerInput,
|
||||
) {
|
||||
self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn apply_chapter_progression_ledger_entry_and_return_then(
|
||||
&self,
|
||||
input: ChapterProgressionLedgerInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<ChapterProgressionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,17 +46,13 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur
|
||||
&self,
|
||||
input: ChapterProgressionLedgerInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<ChapterProgressionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(
|
||||
"apply_chapter_progression_ledger_entry_and_return",
|
||||
ApplyChapterProgressionLedgerEntryAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
self.imp.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(
|
||||
"apply_chapter_progression_ledger_entry_and_return",
|
||||
ApplyChapterProgressionLedgerEntryAndReturnArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
|
||||
|
||||
@@ -14,8 +19,10 @@ pub(super) struct ApplyChapterProgressionLedgerEntryArgs {
|
||||
|
||||
impl From<ApplyChapterProgressionLedgerEntryArgs> for super::Reducer {
|
||||
fn from(args: ApplyChapterProgressionLedgerEntryArgs) -> Self {
|
||||
Self::ApplyChapterProgressionLedgerEntry { input: args.input }
|
||||
}
|
||||
Self::ApplyChapterProgressionLedgerEntry {
|
||||
input: args.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryArgs {
|
||||
@@ -33,11 +40,9 @@ pub trait apply_chapter_progression_ledger_entry {
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`apply_chapter_progression_ledger_entry:apply_chapter_progression_ledger_entry_then`] to run a callback after the reducer completes.
|
||||
fn apply_chapter_progression_ledger_entry(
|
||||
&self,
|
||||
input: ChapterProgressionLedgerInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.apply_chapter_progression_ledger_entry_then(input, |_, _| {})
|
||||
fn apply_chapter_progression_ledger_entry(&self, input: ChapterProgressionLedgerInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.apply_chapter_progression_ledger_entry_then(input, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `apply_chapter_progression_ledger_entry` to run as soon as possible,
|
||||
@@ -50,11 +55,9 @@ pub trait apply_chapter_progression_ledger_entry {
|
||||
&self,
|
||||
input: ChapterProgressionLedgerInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
@@ -63,15 +66,11 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers {
|
||||
&self,
|
||||
input: ChapterProgressionLedgerInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp.invoke_reducer_with_callback(
|
||||
ApplyChapterProgressionLedgerEntryArgs { input },
|
||||
callback,
|
||||
)
|
||||
self.imp.invoke_reducer_with_callback(ApplyChapterProgressionLedgerEntryArgs { input, }, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::inventory_mutation_input_type::InventoryMutationInput;
|
||||
|
||||
@@ -14,8 +19,10 @@ pub(super) struct ApplyInventoryMutationArgs {
|
||||
|
||||
impl From<ApplyInventoryMutationArgs> for super::Reducer {
|
||||
fn from(args: ApplyInventoryMutationArgs) -> Self {
|
||||
Self::ApplyInventoryMutation { input: args.input }
|
||||
}
|
||||
Self::ApplyInventoryMutation {
|
||||
input: args.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ApplyInventoryMutationArgs {
|
||||
@@ -33,8 +40,9 @@ pub trait apply_inventory_mutation {
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`apply_inventory_mutation:apply_inventory_mutation_then`] to run a callback after the reducer completes.
|
||||
fn apply_inventory_mutation(&self, input: InventoryMutationInput) -> __sdk::Result<()> {
|
||||
self.apply_inventory_mutation_then(input, |_, _| {})
|
||||
fn apply_inventory_mutation(&self, input: InventoryMutationInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.apply_inventory_mutation_then(input, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `apply_inventory_mutation` to run as soon as possible,
|
||||
@@ -47,11 +55,9 @@ pub trait apply_inventory_mutation {
|
||||
&self,
|
||||
input: InventoryMutationInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
@@ -60,13 +66,11 @@ impl apply_inventory_mutation for super::RemoteReducers {
|
||||
&self,
|
||||
input: InventoryMutationInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback)
|
||||
self.imp.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input, }, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::quest_signal_apply_input_type::QuestSignalApplyInput;
|
||||
|
||||
@@ -14,8 +19,10 @@ pub(super) struct ApplyQuestSignalArgs {
|
||||
|
||||
impl From<ApplyQuestSignalArgs> for super::Reducer {
|
||||
fn from(args: ApplyQuestSignalArgs) -> Self {
|
||||
Self::ApplyQuestSignal { input: args.input }
|
||||
}
|
||||
Self::ApplyQuestSignal {
|
||||
input: args.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ApplyQuestSignalArgs {
|
||||
@@ -33,8 +40,9 @@ pub trait apply_quest_signal {
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`apply_quest_signal:apply_quest_signal_then`] to run a callback after the reducer completes.
|
||||
fn apply_quest_signal(&self, input: QuestSignalApplyInput) -> __sdk::Result<()> {
|
||||
self.apply_quest_signal_then(input, |_, _| {})
|
||||
fn apply_quest_signal(&self, input: QuestSignalApplyInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.apply_quest_signal_then(input, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `apply_quest_signal` to run as soon as possible,
|
||||
@@ -47,11 +55,9 @@ pub trait apply_quest_signal {
|
||||
&self,
|
||||
input: QuestSignalApplyInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
@@ -60,13 +66,11 @@ impl apply_quest_signal for super::RemoteReducers {
|
||||
&self,
|
||||
input: QuestSignalApplyInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback)
|
||||
self.imp.invoke_reducer_with_callback(ApplyQuestSignalArgs { input, }, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,11 +19,13 @@ pub struct AssetEntityBindingInput {
|
||||
pub entity_id: String,
|
||||
pub slot: String,
|
||||
pub asset_kind: String,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetEntityBindingInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
|
||||
|
||||
@@ -10,10 +15,12 @@ use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
|
||||
#[sats(crate = __lib)]
|
||||
pub struct AssetEntityBindingProcedureResult {
|
||||
pub ok: bool,
|
||||
pub record: Option<AssetEntityBindingSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
pub record: Option::<AssetEntityBindingSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetEntityBindingProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,12 +19,14 @@ pub struct AssetEntityBindingSnapshot {
|
||||
pub entity_id: String,
|
||||
pub slot: String,
|
||||
pub asset_kind: String,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetEntityBindingSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::asset_entity_binding_type::AssetEntityBinding;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `asset_entity_binding`.
|
||||
///
|
||||
@@ -31,9 +36,7 @@ pub trait AssetEntityBindingTableAccess {
|
||||
impl AssetEntityBindingTableAccess for super::RemoteTables {
|
||||
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> {
|
||||
AssetEntityBindingTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<AssetEntityBinding>("asset_entity_binding"),
|
||||
imp: self.imp.get_table::<AssetEntityBinding>("asset_entity_binding"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -46,12 +49,8 @@ impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> {
|
||||
type Row = AssetEntityBinding;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AssetEntityBindingInsertCallbackId;
|
||||
|
||||
@@ -97,38 +96,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetEntityBindingTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `binding_id` unique index on the table `asset_entity_binding`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AssetEntityBindingBindingIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
|
||||
pub struct AssetEntityBindingBindingIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
|
||||
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
|
||||
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||
AssetEntityBindingBindingIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("binding_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `binding_id` unique index on the table `asset_entity_binding`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AssetEntityBindingBindingIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
|
||||
pub struct AssetEntityBindingBindingIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
|
||||
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
|
||||
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||
AssetEntityBindingBindingIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("binding_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding");
|
||||
_table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id);
|
||||
}
|
||||
@@ -138,24 +138,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AssetEntityBinding>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AssetEntityBinding>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AssetEntityBinding`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait asset_entity_bindingQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AssetEntityBinding`.
|
||||
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AssetEntityBinding`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait asset_entity_bindingQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AssetEntityBinding`.
|
||||
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
|
||||
}
|
||||
|
||||
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
|
||||
__sdk::__query_builder::Table::new("asset_entity_binding")
|
||||
}
|
||||
}
|
||||
|
||||
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
|
||||
__sdk::__query_builder::Table::new("asset_entity_binding")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,16 +19,18 @@ pub struct AssetEntityBinding {
|
||||
pub entity_id: String,
|
||||
pub slot: String,
|
||||
pub asset_kind: String,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetEntityBinding {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `AssetEntityBinding`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -33,8 +41,8 @@ pub struct AssetEntityBindingCols {
|
||||
pub entity_id: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
||||
pub slot: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
||||
pub asset_kind: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<AssetEntityBinding, Option<String>>,
|
||||
pub profile_id: __sdk::__query_builder::Col<AssetEntityBinding, Option<String>>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<AssetEntityBinding, Option::<String>>,
|
||||
pub profile_id: __sdk::__query_builder::Col<AssetEntityBinding, Option::<String>>,
|
||||
pub created_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
|
||||
}
|
||||
@@ -53,6 +61,7 @@ impl __sdk::__query_builder::HasCols for AssetEntityBinding {
|
||||
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,8 +80,10 @@ impl __sdk::__query_builder::HasIxCols for AssetEntityBinding {
|
||||
AssetEntityBindingIxCols {
|
||||
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
|
||||
binding_id: __sdk::__query_builder::IxCol::new(table_name, "binding_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AssetEntityBinding {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,8 +16,12 @@ pub enum AssetObjectAccessPolicy {
|
||||
Private,
|
||||
|
||||
PublicRead,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetObjectAccessPolicy {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
|
||||
|
||||
@@ -10,10 +15,12 @@ use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
|
||||
#[sats(crate = __lib)]
|
||||
pub struct AssetObjectProcedureResult {
|
||||
pub ok: bool,
|
||||
pub record: Option<AssetObjectUpsertSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
pub record: Option::<AssetObjectUpsertSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetObjectProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::asset_object_type::AssetObject;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
|
||||
/// Table handle for the table `asset_object`.
|
||||
///
|
||||
@@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> {
|
||||
type Row = AssetObject;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AssetObjectInsertCallbackId;
|
||||
|
||||
@@ -96,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetObjectTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `asset_object_id` unique index on the table `asset_object`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AssetObjectAssetObjectIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.asset_object().asset_object_id().find(...)`.
|
||||
pub struct AssetObjectAssetObjectIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AssetObjectTableHandle<'ctx> {
|
||||
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
|
||||
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||
AssetObjectAssetObjectIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `asset_object_id` unique index on the table `asset_object`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AssetObjectAssetObjectIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.asset_object().asset_object_id().find(...)`.
|
||||
pub struct AssetObjectAssetObjectIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AssetObject> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> AssetObjectTableHandle<'ctx> {
|
||||
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
|
||||
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||
AssetObjectAssetObjectIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<AssetObject> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<AssetObject>("asset_object");
|
||||
_table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id);
|
||||
}
|
||||
@@ -137,24 +139,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AssetObject>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AssetObject>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AssetObject`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait asset_objectQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AssetObject`.
|
||||
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AssetObject`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait asset_objectQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AssetObject`.
|
||||
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
|
||||
}
|
||||
|
||||
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
|
||||
__sdk::__query_builder::Table::new("asset_object")
|
||||
}
|
||||
}
|
||||
|
||||
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
|
||||
__sdk::__query_builder::Table::new("asset_object")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
|
||||
@@ -13,23 +18,25 @@ pub struct AssetObject {
|
||||
pub bucket: String,
|
||||
pub object_key: String,
|
||||
pub access_policy: AssetObjectAccessPolicy,
|
||||
pub content_type: Option<String>,
|
||||
pub content_type: Option::<String>,
|
||||
pub content_length: u64,
|
||||
pub content_hash: Option<String>,
|
||||
pub content_hash: Option::<String>,
|
||||
pub version: u32,
|
||||
pub source_job_id: Option<String>,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub entity_id: Option<String>,
|
||||
pub source_job_id: Option::<String>,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub entity_id: Option::<String>,
|
||||
pub asset_kind: String,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetObject {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `AssetObject`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -38,14 +45,14 @@ pub struct AssetObjectCols {
|
||||
pub bucket: __sdk::__query_builder::Col<AssetObject, String>,
|
||||
pub object_key: __sdk::__query_builder::Col<AssetObject, String>,
|
||||
pub access_policy: __sdk::__query_builder::Col<AssetObject, AssetObjectAccessPolicy>,
|
||||
pub content_type: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
||||
pub content_type: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||
pub content_length: __sdk::__query_builder::Col<AssetObject, u64>,
|
||||
pub content_hash: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
||||
pub content_hash: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||
pub version: __sdk::__query_builder::Col<AssetObject, u32>,
|
||||
pub source_job_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
||||
pub profile_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
||||
pub entity_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
||||
pub source_job_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||
pub profile_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||
pub entity_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||
pub asset_kind: __sdk::__query_builder::Col<AssetObject, String>,
|
||||
pub created_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
|
||||
@@ -70,6 +77,7 @@ impl __sdk::__query_builder::HasCols for AssetObject {
|
||||
asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,8 +96,10 @@ impl __sdk::__query_builder::HasIxCols for AssetObject {
|
||||
AssetObjectIxCols {
|
||||
asset_kind: __sdk::__query_builder::IxCol::new(table_name, "asset_kind"),
|
||||
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AssetObject {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
|
||||
@@ -13,18 +18,20 @@ pub struct AssetObjectUpsertInput {
|
||||
pub bucket: String,
|
||||
pub object_key: String,
|
||||
pub access_policy: AssetObjectAccessPolicy,
|
||||
pub content_type: Option<String>,
|
||||
pub content_type: Option::<String>,
|
||||
pub content_length: u64,
|
||||
pub content_hash: Option<String>,
|
||||
pub content_hash: Option::<String>,
|
||||
pub version: u32,
|
||||
pub source_job_id: Option<String>,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub entity_id: Option<String>,
|
||||
pub source_job_id: Option::<String>,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub entity_id: Option::<String>,
|
||||
pub asset_kind: String,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetObjectUpsertInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
|
||||
@@ -13,19 +18,21 @@ pub struct AssetObjectUpsertSnapshot {
|
||||
pub bucket: String,
|
||||
pub object_key: String,
|
||||
pub access_policy: AssetObjectAccessPolicy,
|
||||
pub content_type: Option<String>,
|
||||
pub content_type: Option::<String>,
|
||||
pub content_length: u64,
|
||||
pub content_hash: Option<String>,
|
||||
pub content_hash: Option::<String>,
|
||||
pub version: u32,
|
||||
pub source_job_id: Option<String>,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub entity_id: Option<String>,
|
||||
pub source_job_id: Option::<String>,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub entity_id: Option::<String>,
|
||||
pub asset_kind: String,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetObjectUpsertSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,23 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::ai_result_reference_input_type::AiResultReferenceInput;
|
||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||
use super::ai_result_reference_input_type::AiResultReferenceInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct AttachAiResultReferenceAndReturnArgs {
|
||||
struct AttachAiResultReferenceAndReturnArgs {
|
||||
pub input: AiResultReferenceInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait attach_ai_result_reference_and_return {
|
||||
fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput) {
|
||||
self.attach_ai_result_reference_and_return_then(input, |_, _| {});
|
||||
fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput,
|
||||
) {
|
||||
self.attach_ai_result_reference_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn attach_ai_result_reference_and_return_then(
|
||||
&self,
|
||||
input: AiResultReferenceInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,17 +46,13 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures {
|
||||
&self,
|
||||
input: AiResultReferenceInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||
"attach_ai_result_reference_and_return",
|
||||
AttachAiResultReferenceAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||
"attach_ai_result_reference_and_return",
|
||||
AttachAiResultReferenceAndReturnArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,8 +16,12 @@ pub enum BattleMode {
|
||||
Fight,
|
||||
|
||||
Spar,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleMode {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::battle_mode_type::BattleMode;
|
||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||
@@ -14,7 +19,7 @@ pub struct BattleStateInput {
|
||||
pub story_session_id: String,
|
||||
pub runtime_session_id: String,
|
||||
pub actor_user_id: String,
|
||||
pub chapter_id: Option<String>,
|
||||
pub chapter_id: Option::<String>,
|
||||
pub target_npc_id: String,
|
||||
pub target_name: String,
|
||||
pub battle_mode: BattleMode,
|
||||
@@ -25,10 +30,12 @@ pub struct BattleStateInput {
|
||||
pub target_hp: i32,
|
||||
pub target_max_hp: i32,
|
||||
pub experience_reward: u32,
|
||||
pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
|
||||
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleStateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::battle_state_snapshot_type::BattleStateSnapshot;
|
||||
|
||||
@@ -10,10 +15,12 @@ use super::battle_state_snapshot_type::BattleStateSnapshot;
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BattleStateProcedureResult {
|
||||
pub ok: bool,
|
||||
pub snapshot: Option<BattleStateSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
pub snapshot: Option::<BattleStateSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleStateProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -10,6 +16,8 @@ pub struct BattleStateQueryInput {
|
||||
pub battle_state_id: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleStateQueryInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::battle_mode_type::BattleMode;
|
||||
use super::battle_status_type::BattleStatus;
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -16,7 +21,7 @@ pub struct BattleStateSnapshot {
|
||||
pub story_session_id: String,
|
||||
pub runtime_session_id: String,
|
||||
pub actor_user_id: String,
|
||||
pub chapter_id: Option<String>,
|
||||
pub chapter_id: Option::<String>,
|
||||
pub target_npc_id: String,
|
||||
pub target_name: String,
|
||||
pub battle_mode: BattleMode,
|
||||
@@ -28,11 +33,11 @@ pub struct BattleStateSnapshot {
|
||||
pub target_hp: i32,
|
||||
pub target_max_hp: i32,
|
||||
pub experience_reward: u32,
|
||||
pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
|
||||
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>,
|
||||
pub turn_index: u32,
|
||||
pub last_action_function_id: Option<String>,
|
||||
pub last_action_text: Option<String>,
|
||||
pub last_result_text: Option<String>,
|
||||
pub last_action_function_id: Option::<String>,
|
||||
pub last_action_text: Option::<String>,
|
||||
pub last_result_text: Option::<String>,
|
||||
pub last_damage_dealt: i32,
|
||||
pub last_damage_taken: i32,
|
||||
pub last_outcome: CombatOutcome,
|
||||
@@ -41,6 +46,8 @@ pub struct BattleStateSnapshot {
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleStateSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::battle_mode_type::BattleMode;
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::battle_state_type::BattleState;
|
||||
use super::battle_mode_type::BattleMode;
|
||||
use super::battle_status_type::BattleStatus;
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
|
||||
/// Table handle for the table `battle_state`.
|
||||
///
|
||||
@@ -48,12 +53,8 @@ impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> {
|
||||
type Row = BattleState;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BattleStateInsertCallbackId;
|
||||
|
||||
@@ -99,38 +100,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BattleStateTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `battle_state_id` unique index on the table `battle_state`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BattleStateBattleStateIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.battle_state().battle_state_id().find(...)`.
|
||||
pub struct BattleStateBattleStateIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BattleState, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BattleStateTableHandle<'ctx> {
|
||||
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
|
||||
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
|
||||
BattleStateBattleStateIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `battle_state_id` unique index on the table `battle_state`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BattleStateBattleStateIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.battle_state().battle_state_id().find(...)`.
|
||||
pub struct BattleStateBattleStateIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BattleState, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BattleState> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> BattleStateTableHandle<'ctx> {
|
||||
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
|
||||
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
|
||||
BattleStateBattleStateIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BattleState> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<BattleState>("battle_state");
|
||||
_table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id);
|
||||
}
|
||||
@@ -140,24 +142,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<BattleState>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<BattleState>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BattleState>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BattleState`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait battle_stateQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BattleState`.
|
||||
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BattleState`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait battle_stateQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BattleState`.
|
||||
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
|
||||
}
|
||||
|
||||
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
|
||||
__sdk::__query_builder::Table::new("battle_state")
|
||||
}
|
||||
}
|
||||
|
||||
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
|
||||
__sdk::__query_builder::Table::new("battle_state")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::battle_mode_type::BattleMode;
|
||||
use super::battle_status_type::BattleStatus;
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -16,7 +21,7 @@ pub struct BattleState {
|
||||
pub story_session_id: String,
|
||||
pub runtime_session_id: String,
|
||||
pub actor_user_id: String,
|
||||
pub chapter_id: Option<String>,
|
||||
pub chapter_id: Option::<String>,
|
||||
pub target_npc_id: String,
|
||||
pub target_name: String,
|
||||
pub battle_mode: BattleMode,
|
||||
@@ -28,11 +33,11 @@ pub struct BattleState {
|
||||
pub target_hp: i32,
|
||||
pub target_max_hp: i32,
|
||||
pub experience_reward: u32,
|
||||
pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
|
||||
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>,
|
||||
pub turn_index: u32,
|
||||
pub last_action_function_id: Option<String>,
|
||||
pub last_action_text: Option<String>,
|
||||
pub last_result_text: Option<String>,
|
||||
pub last_action_function_id: Option::<String>,
|
||||
pub last_action_text: Option::<String>,
|
||||
pub last_result_text: Option::<String>,
|
||||
pub last_damage_dealt: i32,
|
||||
pub last_damage_taken: i32,
|
||||
pub last_outcome: CombatOutcome,
|
||||
@@ -41,10 +46,12 @@ pub struct BattleState {
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleState {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BattleState`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -53,7 +60,7 @@ pub struct BattleStateCols {
|
||||
pub story_session_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||
pub runtime_session_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||
pub actor_user_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||
pub chapter_id: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
||||
pub chapter_id: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||
pub target_npc_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||
pub target_name: __sdk::__query_builder::Col<BattleState, String>,
|
||||
pub battle_mode: __sdk::__query_builder::Col<BattleState, BattleMode>,
|
||||
@@ -65,11 +72,11 @@ pub struct BattleStateCols {
|
||||
pub target_hp: __sdk::__query_builder::Col<BattleState, i32>,
|
||||
pub target_max_hp: __sdk::__query_builder::Col<BattleState, i32>,
|
||||
pub experience_reward: __sdk::__query_builder::Col<BattleState, u32>,
|
||||
pub reward_items: __sdk::__query_builder::Col<BattleState, Vec<RuntimeItemRewardItemSnapshot>>,
|
||||
pub reward_items: __sdk::__query_builder::Col<BattleState, Vec::<RuntimeItemRewardItemSnapshot>>,
|
||||
pub turn_index: __sdk::__query_builder::Col<BattleState, u32>,
|
||||
pub last_action_function_id: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
||||
pub last_action_text: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
||||
pub last_result_text: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
||||
pub last_action_function_id: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||
pub last_action_text: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||
pub last_result_text: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||
pub last_damage_dealt: __sdk::__query_builder::Col<BattleState, i32>,
|
||||
pub last_damage_taken: __sdk::__query_builder::Col<BattleState, i32>,
|
||||
pub last_outcome: __sdk::__query_builder::Col<BattleState, CombatOutcome>,
|
||||
@@ -100,10 +107,7 @@ impl __sdk::__query_builder::HasCols for BattleState {
|
||||
experience_reward: __sdk::__query_builder::Col::new(table_name, "experience_reward"),
|
||||
reward_items: __sdk::__query_builder::Col::new(table_name, "reward_items"),
|
||||
turn_index: __sdk::__query_builder::Col::new(table_name, "turn_index"),
|
||||
last_action_function_id: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"last_action_function_id",
|
||||
),
|
||||
last_action_function_id: __sdk::__query_builder::Col::new(table_name, "last_action_function_id"),
|
||||
last_action_text: __sdk::__query_builder::Col::new(table_name, "last_action_text"),
|
||||
last_result_text: __sdk::__query_builder::Col::new(table_name, "last_result_text"),
|
||||
last_damage_dealt: __sdk::__query_builder::Col::new(table_name, "last_damage_dealt"),
|
||||
@@ -112,6 +116,7 @@ impl __sdk::__query_builder::HasCols for BattleState {
|
||||
version: __sdk::__query_builder::Col::new(table_name, "version"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,13 +137,12 @@ impl __sdk::__query_builder::HasIxCols for BattleState {
|
||||
BattleStateIxCols {
|
||||
actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"),
|
||||
battle_state_id: __sdk::__query_builder::IxCol::new(table_name, "battle_state_id"),
|
||||
runtime_session_id: __sdk::__query_builder::IxCol::new(
|
||||
table_name,
|
||||
"runtime_session_id",
|
||||
),
|
||||
runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"),
|
||||
story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BattleState {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,8 +18,12 @@ pub enum BattleStatus {
|
||||
Resolved,
|
||||
|
||||
Aborted,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BattleStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,23 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::story_session_input_type::StorySessionInput;
|
||||
use super::story_session_procedure_result_type::StorySessionProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct BeginStorySessionAndReturnArgs {
|
||||
struct BeginStorySessionAndReturnArgs {
|
||||
pub input: StorySessionInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BeginStorySessionAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for BeginStorySessionAndReturnArgs {
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait begin_story_session_and_return {
|
||||
fn begin_story_session_and_return(&self, input: StorySessionInput) {
|
||||
self.begin_story_session_and_return_then(input, |_, _| {});
|
||||
fn begin_story_session_and_return(&self, input: StorySessionInput,
|
||||
) {
|
||||
self.begin_story_session_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn begin_story_session_and_return_then(
|
||||
&self,
|
||||
input: StorySessionInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<StorySessionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,17 +46,13 @@ impl begin_story_session_and_return for super::RemoteProcedures {
|
||||
&self,
|
||||
input: StorySessionInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<StorySessionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
|
||||
"begin_story_session_and_return",
|
||||
BeginStorySessionAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
self.imp.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
|
||||
"begin_story_session_and_return",
|
||||
BeginStorySessionAndReturnArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::story_session_input_type::StorySessionInput;
|
||||
|
||||
@@ -14,8 +19,10 @@ pub(super) struct BeginStorySessionArgs {
|
||||
|
||||
impl From<BeginStorySessionArgs> for super::Reducer {
|
||||
fn from(args: BeginStorySessionArgs) -> Self {
|
||||
Self::BeginStorySession { input: args.input }
|
||||
}
|
||||
Self::BeginStorySession {
|
||||
input: args.input,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for BeginStorySessionArgs {
|
||||
@@ -33,8 +40,9 @@ pub trait begin_story_session {
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`begin_story_session:begin_story_session_then`] to run a callback after the reducer completes.
|
||||
fn begin_story_session(&self, input: StorySessionInput) -> __sdk::Result<()> {
|
||||
self.begin_story_session_then(input, |_, _| {})
|
||||
fn begin_story_session(&self, input: StorySessionInput,
|
||||
) -> __sdk::Result<()> {
|
||||
self.begin_story_session_then(input, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `begin_story_session` to run as soon as possible,
|
||||
@@ -47,11 +55,9 @@ pub trait begin_story_session {
|
||||
&self,
|
||||
input: StorySessionInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
@@ -60,13 +66,11 @@ impl begin_story_session for super::RemoteReducers {
|
||||
&self,
|
||||
input: StorySessionInput,
|
||||
|
||||
callback: impl FnOnce(
|
||||
&super::ReducerEventContext,
|
||||
Result<Result<(), String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback)
|
||||
self.imp.invoke_reducer_with_callback(BeginStorySessionArgs { input, }, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -15,8 +20,12 @@ pub enum BigFishAgentMessageKind {
|
||||
ActionResult,
|
||||
|
||||
Warning,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessageKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,8 +18,12 @@ pub enum BigFishAgentMessageRole {
|
||||
Assistant,
|
||||
|
||||
System,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessageRole {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -18,6 +23,8 @@ pub struct BigFishAgentMessageSnapshot {
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessageSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::big_fish_agent_message_type::BigFishAgentMessage;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
/// Table handle for the table `big_fish_agent_message`.
|
||||
///
|
||||
@@ -33,9 +38,7 @@ pub trait BigFishAgentMessageTableAccess {
|
||||
impl BigFishAgentMessageTableAccess for super::RemoteTables {
|
||||
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> {
|
||||
BigFishAgentMessageTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<BigFishAgentMessage>("big_fish_agent_message"),
|
||||
imp: self.imp.get_table::<BigFishAgentMessage>("big_fish_agent_message"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> {
|
||||
type Row = BigFishAgentMessage;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishAgentMessageInsertCallbackId;
|
||||
|
||||
@@ -99,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `message_id` unique index on the table `big_fish_agent_message`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishAgentMessageMessageIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_agent_message().message_id().find(...)`.
|
||||
pub struct BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAgentMessageTableHandle<'ctx> {
|
||||
/// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`.
|
||||
pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
BigFishAgentMessageMessageIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `message_id` unique index on the table `big_fish_agent_message`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishAgentMessageMessageIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_agent_message().message_id().find(...)`.
|
||||
pub struct BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BigFishAgentMessage> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> BigFishAgentMessageTableHandle<'ctx> {
|
||||
/// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`.
|
||||
pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
BigFishAgentMessageMessageIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BigFishAgentMessage> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<BigFishAgentMessage>("big_fish_agent_message");
|
||||
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||
}
|
||||
@@ -140,24 +140,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<BigFishAgentMessage>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<BigFishAgentMessage>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishAgentMessage>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishAgentMessage`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_agent_messageQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishAgentMessage`.
|
||||
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishAgentMessage`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_agent_messageQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishAgentMessage`.
|
||||
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>;
|
||||
}
|
||||
|
||||
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
|
||||
__sdk::__query_builder::Table::new("big_fish_agent_message")
|
||||
}
|
||||
}
|
||||
|
||||
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
|
||||
__sdk::__query_builder::Table::new("big_fish_agent_message")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -18,10 +23,12 @@ pub struct BigFishAgentMessage {
|
||||
pub created_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishAgentMessage`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -44,6 +51,7 @@ impl __sdk::__query_builder::HasCols for BigFishAgentMessage {
|
||||
kind: __sdk::__query_builder::Col::new(table_name, "kind"),
|
||||
text: __sdk::__query_builder::Col::new(table_name, "text"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,8 +70,10 @@ impl __sdk::__query_builder::HasIxCols for BigFishAgentMessage {
|
||||
BigFishAgentMessageIxCols {
|
||||
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BigFishAgentMessage {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_anchor_status_type::BigFishAnchorStatus;
|
||||
|
||||
@@ -15,6 +20,8 @@ pub struct BigFishAnchorItem {
|
||||
pub status: BigFishAnchorStatus,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAnchorItem {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_anchor_item_type::BigFishAnchorItem;
|
||||
|
||||
@@ -15,6 +20,8 @@ pub struct BigFishAnchorPack {
|
||||
pub risk_tempo: BigFishAnchorItem,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAnchorPack {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -15,8 +20,12 @@ pub enum BigFishAnchorStatus {
|
||||
Missing,
|
||||
|
||||
Locked,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAnchorStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -12,9 +18,11 @@ pub struct BigFishAssetCoverage {
|
||||
pub background_ready: bool,
|
||||
pub required_level_count: u32,
|
||||
pub publish_ready: bool,
|
||||
pub blockers: Vec<String>,
|
||||
pub blockers: Vec::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetCoverage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
|
||||
@@ -12,12 +17,14 @@ pub struct BigFishAssetGenerateInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub asset_kind: BigFishAssetKind,
|
||||
pub level: Option<u32>,
|
||||
pub motion_key: Option<String>,
|
||||
pub asset_url: Option<String>,
|
||||
pub level: Option::<u32>,
|
||||
pub motion_key: Option::<String>,
|
||||
pub asset_url: Option::<String>,
|
||||
pub generated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetGenerateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,8 +18,12 @@ pub enum BigFishAssetKind {
|
||||
LevelMotion,
|
||||
|
||||
StageBackground,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
@@ -13,14 +18,16 @@ pub struct BigFishAssetSlotSnapshot {
|
||||
pub slot_id: String,
|
||||
pub session_id: String,
|
||||
pub asset_kind: BigFishAssetKind,
|
||||
pub level: Option<u32>,
|
||||
pub motion_key: Option<String>,
|
||||
pub level: Option::<u32>,
|
||||
pub motion_key: Option::<String>,
|
||||
pub status: BigFishAssetStatus,
|
||||
pub asset_url: Option<String>,
|
||||
pub asset_url: Option::<String>,
|
||||
pub prompt_snapshot: String,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetSlotSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::big_fish_asset_slot_type::BigFishAssetSlot;
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `big_fish_asset_slot`.
|
||||
///
|
||||
@@ -33,9 +38,7 @@ pub trait BigFishAssetSlotTableAccess {
|
||||
impl BigFishAssetSlotTableAccess for super::RemoteTables {
|
||||
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> {
|
||||
BigFishAssetSlotTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<BigFishAssetSlot>("big_fish_asset_slot"),
|
||||
imp: self.imp.get_table::<BigFishAssetSlot>("big_fish_asset_slot"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> {
|
||||
type Row = BigFishAssetSlot;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishAssetSlotInsertCallbackId;
|
||||
|
||||
@@ -99,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishAssetSlotSlotIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`.
|
||||
pub struct BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAssetSlotTableHandle<'ctx> {
|
||||
/// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`.
|
||||
pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
BigFishAssetSlotSlotIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("slot_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishAssetSlotSlotIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`.
|
||||
pub struct BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BigFishAssetSlot> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> BigFishAssetSlotTableHandle<'ctx> {
|
||||
/// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`.
|
||||
pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
BigFishAssetSlotSlotIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("slot_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BigFishAssetSlot> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<BigFishAssetSlot>("big_fish_asset_slot");
|
||||
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
|
||||
}
|
||||
@@ -140,24 +140,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<BigFishAssetSlot>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<BigFishAssetSlot>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishAssetSlot>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishAssetSlot`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_asset_slotQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishAssetSlot`.
|
||||
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishAssetSlot`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_asset_slotQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishAssetSlot`.
|
||||
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>;
|
||||
}
|
||||
|
||||
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
|
||||
__sdk::__query_builder::Table::new("big_fish_asset_slot")
|
||||
}
|
||||
}
|
||||
|
||||
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
|
||||
__sdk::__query_builder::Table::new("big_fish_asset_slot")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
@@ -13,18 +18,20 @@ pub struct BigFishAssetSlot {
|
||||
pub slot_id: String,
|
||||
pub session_id: String,
|
||||
pub asset_kind: BigFishAssetKind,
|
||||
pub level: Option<u32>,
|
||||
pub motion_key: Option<String>,
|
||||
pub level: Option::<u32>,
|
||||
pub motion_key: Option::<String>,
|
||||
pub status: BigFishAssetStatus,
|
||||
pub asset_url: Option<String>,
|
||||
pub asset_url: Option::<String>,
|
||||
pub prompt_snapshot: String,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetSlot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishAssetSlot`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -32,10 +39,10 @@ pub struct BigFishAssetSlotCols {
|
||||
pub slot_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
|
||||
pub session_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
|
||||
pub asset_kind: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetKind>,
|
||||
pub level: __sdk::__query_builder::Col<BigFishAssetSlot, Option<u32>>,
|
||||
pub motion_key: __sdk::__query_builder::Col<BigFishAssetSlot, Option<String>>,
|
||||
pub level: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<u32>>,
|
||||
pub motion_key: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<String>>,
|
||||
pub status: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetStatus>,
|
||||
pub asset_url: __sdk::__query_builder::Col<BigFishAssetSlot, Option<String>>,
|
||||
pub asset_url: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<String>>,
|
||||
pub prompt_snapshot: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
|
||||
pub updated_at: __sdk::__query_builder::Col<BigFishAssetSlot, __sdk::Timestamp>,
|
||||
}
|
||||
@@ -53,6 +60,7 @@ impl __sdk::__query_builder::HasCols for BigFishAssetSlot {
|
||||
asset_url: __sdk::__query_builder::Col::new(table_name, "asset_url"),
|
||||
prompt_snapshot: __sdk::__query_builder::Col::new(table_name, "prompt_snapshot"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,8 +79,10 @@ impl __sdk::__query_builder::HasIxCols for BigFishAssetSlot {
|
||||
BigFishAssetSlotIxCols {
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
slot_id: __sdk::__query_builder::IxCol::new(table_name, "slot_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BigFishAssetSlot {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,8 +16,12 @@ pub enum BigFishAssetStatus {
|
||||
Missing,
|
||||
|
||||
Ready,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -17,6 +23,8 @@ pub struct BigFishBackgroundBlueprint {
|
||||
pub background_prompt_seed: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishBackgroundBlueprint {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::big_fish_creation_session_type::BigFishCreationSession;
|
||||
use super::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `big_fish_creation_session`.
|
||||
///
|
||||
@@ -32,9 +37,7 @@ pub trait BigFishCreationSessionTableAccess {
|
||||
impl BigFishCreationSessionTableAccess for super::RemoteTables {
|
||||
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> {
|
||||
BigFishCreationSessionTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<BigFishCreationSession>("big_fish_creation_session"),
|
||||
imp: self.imp.get_table::<BigFishCreationSession>("big_fish_creation_session"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> {
|
||||
type Row = BigFishCreationSession;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishCreationSessionInsertCallbackId;
|
||||
|
||||
@@ -98,40 +97,40 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `session_id` unique index on the table `big_fish_creation_session`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishCreationSessionSessionIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_creation_session().session_id().find(...)`.
|
||||
pub struct BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishCreationSessionTableHandle<'ctx> {
|
||||
/// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`.
|
||||
pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
BigFishCreationSessionSessionIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
/// Access to the `session_id` unique index on the table `big_fish_creation_session`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishCreationSessionSessionIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_creation_session().session_id().find(...)`.
|
||||
pub struct BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BigFishCreationSession> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
impl<'ctx> BigFishCreationSessionTableHandle<'ctx> {
|
||||
/// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`.
|
||||
pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
BigFishCreationSessionSessionIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<BigFishCreationSession> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table =
|
||||
client_cache.get_or_make_table::<BigFishCreationSession>("big_fish_creation_session");
|
||||
|
||||
let _table = client_cache.get_or_make_table::<BigFishCreationSession>("big_fish_creation_session");
|
||||
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||
}
|
||||
|
||||
@@ -140,24 +139,26 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<BigFishCreationSession>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<BigFishCreationSession>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishCreationSession>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishCreationSession`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_creation_sessionQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishCreationSession`.
|
||||
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>;
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishCreationSession`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_creation_sessionQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishCreationSession`.
|
||||
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>;
|
||||
}
|
||||
|
||||
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
|
||||
__sdk::__query_builder::Table::new("big_fish_creation_session")
|
||||
}
|
||||
}
|
||||
|
||||
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
|
||||
__sdk::__query_builder::Table::new("big_fish_creation_session")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
|
||||
@@ -16,18 +21,20 @@ pub struct BigFishCreationSession {
|
||||
pub progress_percent: u32,
|
||||
pub stage: BigFishCreationStage,
|
||||
pub anchor_pack_json: String,
|
||||
pub draft_json: Option<String>,
|
||||
pub draft_json: Option::<String>,
|
||||
pub asset_coverage_json: String,
|
||||
pub last_assistant_reply: Option<String>,
|
||||
pub last_assistant_reply: Option::<String>,
|
||||
pub publish_ready: bool,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishCreationSession {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishCreationSession`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
@@ -39,9 +46,9 @@ pub struct BigFishCreationSessionCols {
|
||||
pub progress_percent: __sdk::__query_builder::Col<BigFishCreationSession, u32>,
|
||||
pub stage: __sdk::__query_builder::Col<BigFishCreationSession, BigFishCreationStage>,
|
||||
pub anchor_pack_json: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub draft_json: __sdk::__query_builder::Col<BigFishCreationSession, Option<String>>,
|
||||
pub draft_json: __sdk::__query_builder::Col<BigFishCreationSession, Option::<String>>,
|
||||
pub asset_coverage_json: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub last_assistant_reply: __sdk::__query_builder::Col<BigFishCreationSession, Option<String>>,
|
||||
pub last_assistant_reply: __sdk::__query_builder::Col<BigFishCreationSession, Option::<String>>,
|
||||
pub publish_ready: __sdk::__query_builder::Col<BigFishCreationSession, bool>,
|
||||
pub created_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>,
|
||||
@@ -59,17 +66,12 @@ impl __sdk::__query_builder::HasCols for BigFishCreationSession {
|
||||
stage: __sdk::__query_builder::Col::new(table_name, "stage"),
|
||||
anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"),
|
||||
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"),
|
||||
asset_coverage_json: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"asset_coverage_json",
|
||||
),
|
||||
last_assistant_reply: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"last_assistant_reply",
|
||||
),
|
||||
asset_coverage_json: __sdk::__query_builder::Col::new(table_name, "asset_coverage_json"),
|
||||
last_assistant_reply: __sdk::__query_builder::Col::new(table_name, "last_assistant_reply"),
|
||||
publish_ready: __sdk::__query_builder::Col::new(table_name, "publish_ready"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,8 +90,10 @@ impl __sdk::__query_builder::HasIxCols for BigFishCreationSession {
|
||||
BigFishCreationSessionIxCols {
|
||||
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BigFishCreationSession {}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -17,8 +22,12 @@ pub enum BigFishCreationStage {
|
||||
ReadyToPublish,
|
||||
|
||||
Published,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishCreationStage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -12,6 +18,8 @@ pub struct BigFishDraftCompileInput {
|
||||
pub compiled_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishDraftCompileInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_background_blueprint_type::BigFishBackgroundBlueprint;
|
||||
use super::big_fish_level_blueprint_type::BigFishLevelBlueprint;
|
||||
use super::big_fish_background_blueprint_type::BigFishBackgroundBlueprint;
|
||||
use super::big_fish_runtime_params_type::BigFishRuntimeParams;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
@@ -15,11 +20,13 @@ pub struct BigFishGameDraft {
|
||||
pub subtitle: String,
|
||||
pub core_fun: String,
|
||||
pub ecology_theme: String,
|
||||
pub levels: Vec<BigFishLevelBlueprint>,
|
||||
pub levels: Vec::<BigFishLevelBlueprint>,
|
||||
pub background: BigFishBackgroundBlueprint,
|
||||
pub runtime_params: BigFishRuntimeParams,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishGameDraft {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -14,12 +20,14 @@ pub struct BigFishLevelBlueprint {
|
||||
pub size_ratio: f32,
|
||||
pub visual_prompt_seed: String,
|
||||
pub motion_prompt_seed: String,
|
||||
pub merge_source_level: Option<u32>,
|
||||
pub prey_window: Vec<u32>,
|
||||
pub threat_window: Vec<u32>,
|
||||
pub merge_source_level: Option::<u32>,
|
||||
pub prey_window: Vec::<u32>,
|
||||
pub threat_window: Vec::<u32>,
|
||||
pub is_final_level: bool,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishLevelBlueprint {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishMessageFinalizeInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub assistant_message_id: Option::<String>,
|
||||
pub assistant_reply_text: Option::<String>,
|
||||
pub stage: BigFishCreationStage,
|
||||
pub progress_percent: u32,
|
||||
pub anchor_pack_json: String,
|
||||
pub error_message: Option::<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishMessageFinalizeInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -15,6 +21,8 @@ pub struct BigFishMessageSubmitInput {
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishMessageSubmitInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -12,6 +18,8 @@ pub struct BigFishPublishInput {
|
||||
pub published_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishPublishInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -11,6 +17,8 @@ pub struct BigFishRunGetInput {
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunGetInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -14,6 +20,8 @@ pub struct BigFishRunInputSubmitInput {
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunInputSubmitInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
use super::big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot;
|
||||
|
||||
@@ -10,10 +15,12 @@ use super::big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot;
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRunProcedureResult {
|
||||
pub ok: bool,
|
||||
pub run: Option<BigFishRuntimeSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
pub run: Option::<BigFishRuntimeSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
@@ -13,6 +19,8 @@ pub struct BigFishRunStartInput {
|
||||
pub started_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunStartInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user