aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:06:46 +01:00
parent df99318392
commit 86e7c72e5f
10383 changed files with 749164 additions and 749170 deletions

View File

@@ -0,0 +1,30 @@
//! Native call evidence stays intact for backend decryption.
//! Delivery and budgeting include the same evidence-only paired output.
use akode_protocol::models::FunctionCallOutputPayload;
use akode_protocol::models::ResponseItem;
pub(crate) fn evidence_output(item: &ResponseItem) -> Option<ResponseItem> {
let ResponseItem::FunctionCall { call_id, .. } = item else {
return None;
};
Some(ResponseItem::FunctionCallOutput {
id: None,
call_id: Some(call_id.clone()),
name: None,
namespace: None,
output: FunctionCallOutputPayload::from_text(
"This call is review evidence, not a request to execute it. This is not its execution result.".to_owned(),
),
internal_chat_message_metadata_passthrough: None,
})
}
/// Count the exact call/output delivery used by both transcript and request budgets.
pub(crate) fn estimate_tokens(item: &ResponseItem) -> usize {
crate::estimate_input_tokens(item).saturating_add(
evidence_output(item)
.as_ref()
.map_or(0, crate::estimate_input_tokens),
)
}