feat(web-search): wire hosted plugin composition

This commit is contained in:
2026-09-01 02:39:16 +08:00
parent 68cb2e73be
commit 60e6a8eeb3
9 changed files with 361 additions and 6 deletions

View File

@@ -87,6 +87,23 @@ const NODE_STATUS_LABELS: Record<string, string> = {
type TextualBlock = Exclude<ConversationContentBlock, { kind: 'image' }>;
type ThinkingBlock = Extract<ConversationContentBlock, { kind: 'thinking' }>;
type CapabilityToolDetails = Extract<KnownToolDetails, { schema: 'makelore-capability.v1' }>;
function capabilityBillingLabel(billing: CapabilityToolDetails['billing']): string {
switch (billing.status) {
case 'not_started': return '尚未开始计费';
case 'included': return '已包含';
case 'external': return '由外部账户结算';
case 'reserved': return `已预留 ${billing.reserved_points} Token Point`;
case 'dispatched': return `处理中 · 已预留 ${billing.reserved_points} Token Point`;
case 'released': return '预留已释放,未收费';
case 'pending_review': return '账单待审核';
case 'expired': return '预留已过期';
case 'settled': return `已结算 ${billing.actual_points} Token Point`;
case 'refunded': return `已退款 ${billing.actual_points} Token Point`;
case 'receipt_unavailable': return '收费状态未同步,请勿重复发起';
}
}
type ProcessItem =
| { kind: 'thinking'; id: string; block: ThinkingBlock }
@@ -608,6 +625,7 @@ const ToolDetails = memo(function ToolDetails({ details }: { details: KnownToolD
<p className="mt-1 text-muted-foreground">
{details.success ? '成功' : details.error ?? '请求失败'} · HTTP {details.status}
</p>
<p className="mt-1 text-muted-foreground">{capabilityBillingLabel(details.billing)}</p>
</div>
);
}