mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
fix: unblock v0.88.0 release build
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
use proptest::prelude::*;
|
||||
use proxycast_core::config::{
|
||||
collapse_tilde, contains_tilde, expand_tilde, Config, ConfigManager, CustomProviderConfig,
|
||||
HotReloadManager, LoggingConfig, ProviderConfig, ProvidersConfig, ReloadResult,
|
||||
RetrySettings, RoutingConfig, ServerConfig, YamlService,
|
||||
HotReloadManager, LoggingConfig, ProviderConfig, ProvidersConfig, ReloadResult, RetrySettings,
|
||||
RoutingConfig, ServerConfig, YamlService,
|
||||
};
|
||||
use std::io::Write;
|
||||
use tempfile::NamedTempFile;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type {
|
||||
A2UIComponent,
|
||||
ChoicePickerComponent,
|
||||
TextFieldComponent,
|
||||
} from "@/components/content-creator/a2ui/types";
|
||||
|
||||
import {
|
||||
buildLegacyQuestionnaireSubmissionPayload,
|
||||
buildLegacyQuestionnaireA2UI,
|
||||
@@ -16,6 +22,20 @@ const LEGACY_QUESTIONNAIRE = `为了继续推进,我需要你先补充以下
|
||||
- 语气偏好:正式严谨 / 友好专业 / 直接高效
|
||||
- 是否需要加入明确行动号召?`;
|
||||
|
||||
type LegacyQuestionFieldComponent = (ChoicePickerComponent | TextFieldComponent) & {
|
||||
label: string;
|
||||
};
|
||||
|
||||
function isLegacyQuestionFieldComponent(
|
||||
component: A2UIComponent,
|
||||
): component is LegacyQuestionFieldComponent {
|
||||
return (
|
||||
(component.component === "ChoicePicker" ||
|
||||
component.component === "TextField") &&
|
||||
typeof component.label === "string"
|
||||
);
|
||||
}
|
||||
|
||||
describe("legacyQuestionnaireA2UI", () => {
|
||||
it("应将结构化问卷正文转换为输入区可渲染的 A2UI 表单", () => {
|
||||
const response = buildLegacyQuestionnaireA2UI(LEGACY_QUESTIONNAIRE);
|
||||
@@ -62,13 +82,7 @@ describe("legacyQuestionnaireA2UI", () => {
|
||||
|
||||
const componentsByLabel = Object.fromEntries(
|
||||
response.components
|
||||
.filter(
|
||||
(component) =>
|
||||
(component.component === "ChoicePicker" ||
|
||||
component.component === "TextField") &&
|
||||
"label" in component &&
|
||||
typeof component.label === "string",
|
||||
)
|
||||
.filter(isLegacyQuestionFieldComponent)
|
||||
.map((component) => [component.label, component.id]),
|
||||
);
|
||||
|
||||
@@ -95,13 +109,7 @@ describe("legacyQuestionnaireA2UI", () => {
|
||||
|
||||
const componentsByLabel = Object.fromEntries(
|
||||
response.components
|
||||
.filter(
|
||||
(component) =>
|
||||
(component.component === "ChoicePicker" ||
|
||||
component.component === "TextField") &&
|
||||
"label" in component &&
|
||||
typeof component.label === "string",
|
||||
)
|
||||
.filter(isLegacyQuestionFieldComponent)
|
||||
.map((component) => [component.label, component.id]),
|
||||
);
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
* Mock for @tauri-apps/api/core
|
||||
*/
|
||||
|
||||
import type { AutomationJobRecord } from "../api/automation";
|
||||
import type { AgentRun } from "../api/executionRun";
|
||||
|
||||
import {
|
||||
invokeViaHttp,
|
||||
isDevBridgeAvailable,
|
||||
@@ -226,7 +229,7 @@ function buildMockBrowserSessionLaunchResponse(request: any) {
|
||||
});
|
||||
}
|
||||
|
||||
const mockAutomationJobs = [
|
||||
const mockAutomationJobs: AutomationJobRecord[] = [
|
||||
{
|
||||
id: "automation-job-daily-brief",
|
||||
name: "每日线索巡检",
|
||||
@@ -318,7 +321,7 @@ const mockAutomationJobs = [
|
||||
},
|
||||
];
|
||||
|
||||
const mockAutomationRuns = [
|
||||
const mockAutomationRuns: AgentRun[] = [
|
||||
{
|
||||
id: "automation-run-1",
|
||||
source: "automation",
|
||||
|
||||
Reference in New Issue
Block a user