@fixerorg/schemas 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +181 -2
- package/dist/index.js +98 -0
- package/package.json +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -1620,6 +1620,8 @@ declare const WorkflowStatusResponseSchema: z.ZodObject<{
|
|
|
1620
1620
|
status: "done" | "active" | "idle";
|
|
1621
1621
|
role: string;
|
|
1622
1622
|
}>, "many">>;
|
|
1623
|
+
/** 内存中是否有实际运行的 session(用于检测"假运行"状态) */
|
|
1624
|
+
sessionAlive: z.ZodDefault<z.ZodBoolean>;
|
|
1623
1625
|
createdAt: z.ZodDate;
|
|
1624
1626
|
updatedAt: z.ZodDate;
|
|
1625
1627
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1629,6 +1631,7 @@ declare const WorkflowStatusResponseSchema: z.ZodObject<{
|
|
|
1629
1631
|
taskId: number;
|
|
1630
1632
|
state: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
1631
1633
|
phase: string | null;
|
|
1634
|
+
sessionAlive: boolean;
|
|
1632
1635
|
currentAgent?: string | null | undefined;
|
|
1633
1636
|
progress?: {
|
|
1634
1637
|
total: number;
|
|
@@ -1682,6 +1685,7 @@ declare const WorkflowStatusResponseSchema: z.ZodObject<{
|
|
|
1682
1685
|
status: "done" | "active" | "idle";
|
|
1683
1686
|
role: string;
|
|
1684
1687
|
}[] | undefined;
|
|
1688
|
+
sessionAlive?: boolean | undefined;
|
|
1685
1689
|
}>;
|
|
1686
1690
|
type WorkflowStatusResponse = z.infer<typeof WorkflowStatusResponseSchema>;
|
|
1687
1691
|
/** Agent 日志条目 */
|
|
@@ -1780,7 +1784,98 @@ declare const AgentLogListResponseSchema: z.ZodObject<{
|
|
|
1780
1784
|
pages: number;
|
|
1781
1785
|
}>;
|
|
1782
1786
|
type AgentLogListResponse = z.infer<typeof AgentLogListResponseSchema>;
|
|
1783
|
-
/**
|
|
1787
|
+
/** 后端发送的 SSE 事件类型 */
|
|
1788
|
+
declare const BACKEND_SSE_EVENT_TYPES: readonly ["status", "log", "complete", "error", "phase_complete", "content_start", "content_delta", "content_end"];
|
|
1789
|
+
/** 前端应监听的 SSE 事件类型 */
|
|
1790
|
+
declare const FRONTEND_SSE_EVENT_TYPES: readonly ["status", "log", "complete", "error", "phase_complete", "content_start", "content_delta", "content_end"];
|
|
1791
|
+
type BackendSSEEventType = typeof BACKEND_SSE_EVENT_TYPES[number];
|
|
1792
|
+
type FrontendSSEEventType = typeof FRONTEND_SSE_EVENT_TYPES[number];
|
|
1793
|
+
/** 单个 SSE 事件数据 Schema(用于验证后端发送的每个事件) */
|
|
1794
|
+
/** status 事件数据 */
|
|
1795
|
+
declare const SSEStatusDataSchema: z.ZodObject<{
|
|
1796
|
+
state: z.ZodEnum<["IDLE", "DESIGNING", "DESIGN_REVIEW", "PLANNING", "PLAN_REVIEW", "WRITING_TESTS", "COVERAGE_REVIEW", "EXECUTING_TASK", "TASK_REVIEW", "FINAL_TESTING", "COMPLETED", "FAILED", "CANCELLED"]>;
|
|
1797
|
+
phase: z.ZodNullable<z.ZodString>;
|
|
1798
|
+
previousState: z.ZodOptional<z.ZodEnum<["IDLE", "DESIGNING", "DESIGN_REVIEW", "PLANNING", "PLAN_REVIEW", "WRITING_TESTS", "COVERAGE_REVIEW", "EXECUTING_TASK", "TASK_REVIEW", "FINAL_TESTING", "COMPLETED", "FAILED", "CANCELLED"]>>;
|
|
1799
|
+
}, "strip", z.ZodTypeAny, {
|
|
1800
|
+
state: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
1801
|
+
phase: string | null;
|
|
1802
|
+
previousState?: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED" | undefined;
|
|
1803
|
+
}, {
|
|
1804
|
+
state: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
1805
|
+
phase: string | null;
|
|
1806
|
+
previousState?: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED" | undefined;
|
|
1807
|
+
}>;
|
|
1808
|
+
type SSEStatusData = z.infer<typeof SSEStatusDataSchema>;
|
|
1809
|
+
/** log 事件数据 */
|
|
1810
|
+
declare const SSELogDataSchema: z.ZodObject<{
|
|
1811
|
+
id: z.ZodNumber;
|
|
1812
|
+
workflowId: z.ZodNumber;
|
|
1813
|
+
agent: z.ZodString;
|
|
1814
|
+
phase: z.ZodString;
|
|
1815
|
+
level: z.ZodEnum<["info", "warn", "error"]>;
|
|
1816
|
+
message: z.ZodString;
|
|
1817
|
+
data: z.ZodNullable<z.ZodUnknown>;
|
|
1818
|
+
timestamp: z.ZodDate;
|
|
1819
|
+
}, "strip", z.ZodTypeAny, {
|
|
1820
|
+
message: string;
|
|
1821
|
+
id: number;
|
|
1822
|
+
workflowId: number;
|
|
1823
|
+
phase: string;
|
|
1824
|
+
agent: string;
|
|
1825
|
+
level: "error" | "info" | "warn";
|
|
1826
|
+
timestamp: Date;
|
|
1827
|
+
data?: unknown;
|
|
1828
|
+
}, {
|
|
1829
|
+
message: string;
|
|
1830
|
+
id: number;
|
|
1831
|
+
workflowId: number;
|
|
1832
|
+
phase: string;
|
|
1833
|
+
agent: string;
|
|
1834
|
+
level: "error" | "info" | "warn";
|
|
1835
|
+
timestamp: Date;
|
|
1836
|
+
data?: unknown;
|
|
1837
|
+
}>;
|
|
1838
|
+
type SSELogData = z.infer<typeof SSELogDataSchema>;
|
|
1839
|
+
/** complete 事件数据 */
|
|
1840
|
+
declare const SSECompleteDataSchema: z.ZodObject<{
|
|
1841
|
+
state: z.ZodEnum<["IDLE", "DESIGNING", "DESIGN_REVIEW", "PLANNING", "PLAN_REVIEW", "WRITING_TESTS", "COVERAGE_REVIEW", "EXECUTING_TASK", "TASK_REVIEW", "FINAL_TESTING", "COMPLETED", "FAILED", "CANCELLED"]>;
|
|
1842
|
+
result: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
1843
|
+
}, "strip", z.ZodTypeAny, {
|
|
1844
|
+
state: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
1845
|
+
result?: unknown;
|
|
1846
|
+
}, {
|
|
1847
|
+
state: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
1848
|
+
result?: unknown;
|
|
1849
|
+
}>;
|
|
1850
|
+
type SSECompleteData = z.infer<typeof SSECompleteDataSchema>;
|
|
1851
|
+
/** error 事件数据 */
|
|
1852
|
+
declare const SSEErrorDataSchema: z.ZodObject<{
|
|
1853
|
+
message: z.ZodString;
|
|
1854
|
+
state: z.ZodOptional<z.ZodEnum<["IDLE", "DESIGNING", "DESIGN_REVIEW", "PLANNING", "PLAN_REVIEW", "WRITING_TESTS", "COVERAGE_REVIEW", "EXECUTING_TASK", "TASK_REVIEW", "FINAL_TESTING", "COMPLETED", "FAILED", "CANCELLED"]>>;
|
|
1855
|
+
}, "strip", z.ZodTypeAny, {
|
|
1856
|
+
message: string;
|
|
1857
|
+
state?: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED" | undefined;
|
|
1858
|
+
}, {
|
|
1859
|
+
message: string;
|
|
1860
|
+
state?: "IDLE" | "DESIGNING" | "DESIGN_REVIEW" | "PLANNING" | "PLAN_REVIEW" | "WRITING_TESTS" | "COVERAGE_REVIEW" | "EXECUTING_TASK" | "TASK_REVIEW" | "FINAL_TESTING" | "COMPLETED" | "FAILED" | "CANCELLED" | undefined;
|
|
1861
|
+
}>;
|
|
1862
|
+
type SSEErrorData = z.infer<typeof SSEErrorDataSchema>;
|
|
1863
|
+
/** phase_complete 事件数据 */
|
|
1864
|
+
declare const SSEPhaseCompleteDataSchema: z.ZodObject<{
|
|
1865
|
+
phase: z.ZodString;
|
|
1866
|
+
result: z.ZodEnum<["approved", "rejected"]>;
|
|
1867
|
+
iterations: z.ZodOptional<z.ZodNumber>;
|
|
1868
|
+
}, "strip", z.ZodTypeAny, {
|
|
1869
|
+
phase: string;
|
|
1870
|
+
result: "approved" | "rejected";
|
|
1871
|
+
iterations?: number | undefined;
|
|
1872
|
+
}, {
|
|
1873
|
+
phase: string;
|
|
1874
|
+
result: "approved" | "rejected";
|
|
1875
|
+
iterations?: number | undefined;
|
|
1876
|
+
}>;
|
|
1877
|
+
type SSEPhaseCompleteData = z.infer<typeof SSEPhaseCompleteDataSchema>;
|
|
1878
|
+
/** 工作流 SSE 事件(完整事件结构) */
|
|
1784
1879
|
declare const WorkflowSSEEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
1785
1880
|
type: z.ZodLiteral<"status">;
|
|
1786
1881
|
data: z.ZodObject<{
|
|
@@ -1938,5 +2033,89 @@ declare const WorkflowSSEEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1938
2033
|
};
|
|
1939
2034
|
}>]>;
|
|
1940
2035
|
type WorkflowSSEEvent = z.infer<typeof WorkflowSSEEventSchema>;
|
|
2036
|
+
/** 流式内容类型 */
|
|
2037
|
+
declare const StreamContentTypeSchema: z.ZodEnum<["thinking", "message", "tool_call", "tool_result", "log"]>;
|
|
2038
|
+
type StreamContentType = z.infer<typeof StreamContentTypeSchema>;
|
|
2039
|
+
/** content_start 事件数据 */
|
|
2040
|
+
declare const SSEContentStartDataSchema: z.ZodObject<{
|
|
2041
|
+
id: z.ZodString;
|
|
2042
|
+
type: z.ZodEnum<["thinking", "message", "tool_call", "tool_result", "log"]>;
|
|
2043
|
+
agent: z.ZodString;
|
|
2044
|
+
phase: z.ZodString;
|
|
2045
|
+
timestamp: z.ZodString;
|
|
2046
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2047
|
+
}, "strip", z.ZodTypeAny, {
|
|
2048
|
+
type: "message" | "thinking" | "tool_result" | "tool_call" | "log";
|
|
2049
|
+
id: string;
|
|
2050
|
+
phase: string;
|
|
2051
|
+
agent: string;
|
|
2052
|
+
timestamp: string;
|
|
2053
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2054
|
+
}, {
|
|
2055
|
+
type: "message" | "thinking" | "tool_result" | "tool_call" | "log";
|
|
2056
|
+
id: string;
|
|
2057
|
+
phase: string;
|
|
2058
|
+
agent: string;
|
|
2059
|
+
timestamp: string;
|
|
2060
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2061
|
+
}>;
|
|
2062
|
+
type SSEContentStartData = z.infer<typeof SSEContentStartDataSchema>;
|
|
2063
|
+
/** content_delta 事件数据 */
|
|
2064
|
+
declare const SSEContentDeltaDataSchema: z.ZodObject<{
|
|
2065
|
+
id: z.ZodString;
|
|
2066
|
+
delta: z.ZodString;
|
|
2067
|
+
}, "strip", z.ZodTypeAny, {
|
|
2068
|
+
id: string;
|
|
2069
|
+
delta: string;
|
|
2070
|
+
}, {
|
|
2071
|
+
id: string;
|
|
2072
|
+
delta: string;
|
|
2073
|
+
}>;
|
|
2074
|
+
type SSEContentDeltaData = z.infer<typeof SSEContentDeltaDataSchema>;
|
|
2075
|
+
/** content_end 事件数据 */
|
|
2076
|
+
declare const SSEContentEndDataSchema: z.ZodObject<{
|
|
2077
|
+
id: z.ZodString;
|
|
2078
|
+
success: z.ZodBoolean;
|
|
2079
|
+
}, "strip", z.ZodTypeAny, {
|
|
2080
|
+
id: string;
|
|
2081
|
+
success: boolean;
|
|
2082
|
+
}, {
|
|
2083
|
+
id: string;
|
|
2084
|
+
success: boolean;
|
|
2085
|
+
}>;
|
|
2086
|
+
type SSEContentEndData = z.infer<typeof SSEContentEndDataSchema>;
|
|
2087
|
+
/** 流式内容缓冲区(前端用于组装内容) */
|
|
2088
|
+
declare const ContentBufferSchema: z.ZodObject<{
|
|
2089
|
+
id: z.ZodString;
|
|
2090
|
+
type: z.ZodEnum<["thinking", "message", "tool_call", "tool_result", "log"]>;
|
|
2091
|
+
agent: z.ZodString;
|
|
2092
|
+
phase: z.ZodString;
|
|
2093
|
+
content: z.ZodString;
|
|
2094
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2095
|
+
startedAt: z.ZodString;
|
|
2096
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
2097
|
+
isComplete: z.ZodBoolean;
|
|
2098
|
+
}, "strip", z.ZodTypeAny, {
|
|
2099
|
+
type: "message" | "thinking" | "tool_result" | "tool_call" | "log";
|
|
2100
|
+
id: string;
|
|
2101
|
+
startedAt: string;
|
|
2102
|
+
content: string;
|
|
2103
|
+
phase: string;
|
|
2104
|
+
agent: string;
|
|
2105
|
+
endedAt: string | null;
|
|
2106
|
+
isComplete: boolean;
|
|
2107
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2108
|
+
}, {
|
|
2109
|
+
type: "message" | "thinking" | "tool_result" | "tool_call" | "log";
|
|
2110
|
+
id: string;
|
|
2111
|
+
startedAt: string;
|
|
2112
|
+
content: string;
|
|
2113
|
+
phase: string;
|
|
2114
|
+
agent: string;
|
|
2115
|
+
endedAt: string | null;
|
|
2116
|
+
isComplete: boolean;
|
|
2117
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2118
|
+
}>;
|
|
2119
|
+
type ContentBuffer = z.infer<typeof ContentBufferSchema>;
|
|
1941
2120
|
|
|
1942
|
-
export { AI, type AIChatRequest, AIChatRequestSchema, type AIChatResponse, AIChatResponseSchema, type AIMessage, AIMessageSchema, type AISessionResponse, AISessionResponseSchema, API_BASE, API_ROUTES, type AgentLogEntry, AgentLogEntrySchema, type AgentLogListResponse, AgentLogListResponseSchema, type Branch, type BranchOption, BranchOptionSchema, BranchSchema, ContentDeltaEventSchema, ErrorEventSchema, GITHUB, type GitHubBranchesResponse, GitHubBranchesResponseSchema, type GitHubReposResponse, GitHubReposResponseSchema, type GitHubVerifyRequest, GitHubVerifyRequestSchema, type GitHubVerifyResponse, GitHubVerifyResponseSchema, HEALTH, ISSUES, ISSUE_TEMPLATES, type IssueCreate, IssueCreateSchema, type IssueListResponse, IssueListResponseSchema, type IssuePriority, IssuePrioritySchema, type IssueResponse, IssueResponseSchema, type IssueStats, IssueStatsSchema, type IssueStatus, IssueStatusSchema, type IssueTemplate, type IssueTemplateListItem, IssueTemplateListItemSchema, type IssueTemplateListResponse, IssueTemplateListResponseSchema, IssueTemplateSchema, type IssueUpdate, IssueUpdateSchema, MessageDoneEventSchema, PROJECTS, PaginatedResponseSchema, type PaginationQuery, PaginationQuerySchema, type ProjectCreate, ProjectCreateSchema, type ProjectListResponse, ProjectListResponseSchema, type ProjectResponse, ProjectResponseSchema, type ProjectUpdate, ProjectUpdateSchema, type RepoOption, RepoOptionSchema, type Repository, RepositorySchema, type RetryOptions, RetryOptionsSchema, SETTINGS, type SSEEvent, SSEEventSchema, type SettingsResponse, SettingsResponseSchema, type SettingsUpdate, SettingsUpdateSchema, type SyncStatus, SyncStatusSchema, TASKS, type TaskCreate, TaskCreateSchema, type TaskListResponse, TaskListResponseSchema, type TaskResponse, TaskResponseSchema, type TaskStatus, TaskStatusSchema, type TaskUpdate, TaskUpdateSchema, ThinkingDeltaEventSchema, ThinkingEndEventSchema, ThinkingStartEventSchema, ToolResultEventSchema, ToolStartEventSchema, WORKTREE, type WorkflowSSEEvent, WorkflowSSEEventSchema, type WorkflowState, WorkflowStateSchema, type WorkflowStatusResponse, WorkflowStatusResponseSchema, type WorktreeCreateRequest, WorktreeCreateRequestSchema, type WorktreeDeleteRequest, WorktreeDeleteRequestSchema, type WorktreeStatus, type WorktreeStatusResponse, WorktreeStatusResponseSchema, WorktreeStatusSchema };
|
|
2121
|
+
export { AI, type AIChatRequest, AIChatRequestSchema, type AIChatResponse, AIChatResponseSchema, type AIMessage, AIMessageSchema, type AISessionResponse, AISessionResponseSchema, API_BASE, API_ROUTES, type AgentLogEntry, AgentLogEntrySchema, type AgentLogListResponse, AgentLogListResponseSchema, BACKEND_SSE_EVENT_TYPES, type BackendSSEEventType, type Branch, type BranchOption, BranchOptionSchema, BranchSchema, type ContentBuffer, ContentBufferSchema, ContentDeltaEventSchema, ErrorEventSchema, FRONTEND_SSE_EVENT_TYPES, type FrontendSSEEventType, GITHUB, type GitHubBranchesResponse, GitHubBranchesResponseSchema, type GitHubReposResponse, GitHubReposResponseSchema, type GitHubVerifyRequest, GitHubVerifyRequestSchema, type GitHubVerifyResponse, GitHubVerifyResponseSchema, HEALTH, ISSUES, ISSUE_TEMPLATES, type IssueCreate, IssueCreateSchema, type IssueListResponse, IssueListResponseSchema, type IssuePriority, IssuePrioritySchema, type IssueResponse, IssueResponseSchema, type IssueStats, IssueStatsSchema, type IssueStatus, IssueStatusSchema, type IssueTemplate, type IssueTemplateListItem, IssueTemplateListItemSchema, type IssueTemplateListResponse, IssueTemplateListResponseSchema, IssueTemplateSchema, type IssueUpdate, IssueUpdateSchema, MessageDoneEventSchema, PROJECTS, PaginatedResponseSchema, type PaginationQuery, PaginationQuerySchema, type ProjectCreate, ProjectCreateSchema, type ProjectListResponse, ProjectListResponseSchema, type ProjectResponse, ProjectResponseSchema, type ProjectUpdate, ProjectUpdateSchema, type RepoOption, RepoOptionSchema, type Repository, RepositorySchema, type RetryOptions, RetryOptionsSchema, SETTINGS, type SSECompleteData, SSECompleteDataSchema, type SSEContentDeltaData, SSEContentDeltaDataSchema, type SSEContentEndData, SSEContentEndDataSchema, type SSEContentStartData, SSEContentStartDataSchema, type SSEErrorData, SSEErrorDataSchema, type SSEEvent, SSEEventSchema, type SSELogData, SSELogDataSchema, type SSEPhaseCompleteData, SSEPhaseCompleteDataSchema, type SSEStatusData, SSEStatusDataSchema, type SettingsResponse, SettingsResponseSchema, type SettingsUpdate, SettingsUpdateSchema, type StreamContentType, StreamContentTypeSchema, type SyncStatus, SyncStatusSchema, TASKS, type TaskCreate, TaskCreateSchema, type TaskListResponse, TaskListResponseSchema, type TaskResponse, TaskResponseSchema, type TaskStatus, TaskStatusSchema, type TaskUpdate, TaskUpdateSchema, ThinkingDeltaEventSchema, ThinkingEndEventSchema, ThinkingStartEventSchema, ToolResultEventSchema, ToolStartEventSchema, WORKTREE, type WorkflowSSEEvent, WorkflowSSEEventSchema, type WorkflowState, WorkflowStateSchema, type WorkflowStatusResponse, WorkflowStatusResponseSchema, type WorktreeCreateRequest, WorktreeCreateRequestSchema, type WorktreeDeleteRequest, WorktreeDeleteRequestSchema, type WorktreeStatus, type WorktreeStatusResponse, WorktreeStatusResponseSchema, WorktreeStatusSchema };
|
package/dist/index.js
CHANGED
|
@@ -436,6 +436,8 @@ var WorkflowStatusResponseSchema = z11.object({
|
|
|
436
436
|
role: z11.string(),
|
|
437
437
|
status: z11.enum(["idle", "active", "done"])
|
|
438
438
|
})).optional(),
|
|
439
|
+
/** 内存中是否有实际运行的 session(用于检测"假运行"状态) */
|
|
440
|
+
sessionAlive: z11.boolean().default(false),
|
|
439
441
|
createdAt: z11.coerce.date(),
|
|
440
442
|
updatedAt: z11.coerce.date()
|
|
441
443
|
});
|
|
@@ -450,6 +452,47 @@ var AgentLogEntrySchema = z11.object({
|
|
|
450
452
|
timestamp: z11.coerce.date()
|
|
451
453
|
});
|
|
452
454
|
var AgentLogListResponseSchema = PaginatedResponseSchema(AgentLogEntrySchema);
|
|
455
|
+
var BACKEND_SSE_EVENT_TYPES = [
|
|
456
|
+
"status",
|
|
457
|
+
"log",
|
|
458
|
+
"complete",
|
|
459
|
+
"error",
|
|
460
|
+
"phase_complete",
|
|
461
|
+
// 流式内容事件
|
|
462
|
+
"content_start",
|
|
463
|
+
"content_delta",
|
|
464
|
+
"content_end"
|
|
465
|
+
];
|
|
466
|
+
var FRONTEND_SSE_EVENT_TYPES = [
|
|
467
|
+
"status",
|
|
468
|
+
"log",
|
|
469
|
+
"complete",
|
|
470
|
+
"error",
|
|
471
|
+
"phase_complete",
|
|
472
|
+
// 流式内容事件
|
|
473
|
+
"content_start",
|
|
474
|
+
"content_delta",
|
|
475
|
+
"content_end"
|
|
476
|
+
];
|
|
477
|
+
var SSEStatusDataSchema = z11.object({
|
|
478
|
+
state: WorkflowStateSchema,
|
|
479
|
+
phase: z11.string().nullable(),
|
|
480
|
+
previousState: WorkflowStateSchema.optional()
|
|
481
|
+
});
|
|
482
|
+
var SSELogDataSchema = AgentLogEntrySchema;
|
|
483
|
+
var SSECompleteDataSchema = z11.object({
|
|
484
|
+
state: WorkflowStateSchema,
|
|
485
|
+
result: z11.unknown().nullable().optional()
|
|
486
|
+
});
|
|
487
|
+
var SSEErrorDataSchema = z11.object({
|
|
488
|
+
message: z11.string(),
|
|
489
|
+
state: WorkflowStateSchema.optional()
|
|
490
|
+
});
|
|
491
|
+
var SSEPhaseCompleteDataSchema = z11.object({
|
|
492
|
+
phase: z11.string(),
|
|
493
|
+
result: z11.enum(["approved", "rejected"]),
|
|
494
|
+
iterations: z11.number().optional()
|
|
495
|
+
});
|
|
453
496
|
var WorkflowSSEEventSchema = z11.union([
|
|
454
497
|
// 状态变更事件
|
|
455
498
|
z11.object({
|
|
@@ -490,6 +533,49 @@ var WorkflowSSEEventSchema = z11.union([
|
|
|
490
533
|
})
|
|
491
534
|
})
|
|
492
535
|
]);
|
|
536
|
+
var StreamContentTypeSchema = z11.enum([
|
|
537
|
+
"thinking",
|
|
538
|
+
"message",
|
|
539
|
+
"tool_call",
|
|
540
|
+
"tool_result",
|
|
541
|
+
"log"
|
|
542
|
+
]);
|
|
543
|
+
var SSEContentStartDataSchema = z11.object({
|
|
544
|
+
id: z11.string(),
|
|
545
|
+
// 内容流唯一标识(UUID)
|
|
546
|
+
type: StreamContentTypeSchema,
|
|
547
|
+
agent: z11.string(),
|
|
548
|
+
// Agent 名称
|
|
549
|
+
phase: z11.string(),
|
|
550
|
+
// 当前阶段
|
|
551
|
+
timestamp: z11.string(),
|
|
552
|
+
metadata: z11.record(z11.unknown()).optional()
|
|
553
|
+
// 工具名称、参数等元信息
|
|
554
|
+
});
|
|
555
|
+
var SSEContentDeltaDataSchema = z11.object({
|
|
556
|
+
id: z11.string(),
|
|
557
|
+
// 对应 content_start 的 id
|
|
558
|
+
delta: z11.string()
|
|
559
|
+
// 增量文本
|
|
560
|
+
});
|
|
561
|
+
var SSEContentEndDataSchema = z11.object({
|
|
562
|
+
id: z11.string(),
|
|
563
|
+
// 对应 content_start 的 id
|
|
564
|
+
success: z11.boolean()
|
|
565
|
+
// 是否成功完成
|
|
566
|
+
});
|
|
567
|
+
var ContentBufferSchema = z11.object({
|
|
568
|
+
id: z11.string(),
|
|
569
|
+
type: StreamContentTypeSchema,
|
|
570
|
+
agent: z11.string(),
|
|
571
|
+
phase: z11.string(),
|
|
572
|
+
content: z11.string(),
|
|
573
|
+
// 已累积的内容
|
|
574
|
+
metadata: z11.record(z11.unknown()).optional(),
|
|
575
|
+
startedAt: z11.string(),
|
|
576
|
+
endedAt: z11.string().nullable(),
|
|
577
|
+
isComplete: z11.boolean()
|
|
578
|
+
});
|
|
493
579
|
export {
|
|
494
580
|
AI,
|
|
495
581
|
AIChatRequestSchema,
|
|
@@ -500,10 +586,13 @@ export {
|
|
|
500
586
|
API_ROUTES,
|
|
501
587
|
AgentLogEntrySchema,
|
|
502
588
|
AgentLogListResponseSchema,
|
|
589
|
+
BACKEND_SSE_EVENT_TYPES,
|
|
503
590
|
BranchOptionSchema,
|
|
504
591
|
BranchSchema,
|
|
592
|
+
ContentBufferSchema,
|
|
505
593
|
ContentDeltaEventSchema,
|
|
506
594
|
ErrorEventSchema,
|
|
595
|
+
FRONTEND_SSE_EVENT_TYPES,
|
|
507
596
|
GITHUB,
|
|
508
597
|
GitHubBranchesResponseSchema,
|
|
509
598
|
GitHubReposResponseSchema,
|
|
@@ -534,9 +623,18 @@ export {
|
|
|
534
623
|
RepositorySchema,
|
|
535
624
|
RetryOptionsSchema,
|
|
536
625
|
SETTINGS,
|
|
626
|
+
SSECompleteDataSchema,
|
|
627
|
+
SSEContentDeltaDataSchema,
|
|
628
|
+
SSEContentEndDataSchema,
|
|
629
|
+
SSEContentStartDataSchema,
|
|
630
|
+
SSEErrorDataSchema,
|
|
537
631
|
SSEEventSchema,
|
|
632
|
+
SSELogDataSchema,
|
|
633
|
+
SSEPhaseCompleteDataSchema,
|
|
634
|
+
SSEStatusDataSchema,
|
|
538
635
|
SettingsResponseSchema,
|
|
539
636
|
SettingsUpdateSchema,
|
|
637
|
+
StreamContentTypeSchema,
|
|
540
638
|
SyncStatusSchema,
|
|
541
639
|
TASKS,
|
|
542
640
|
TaskCreateSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fixerorg/schemas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Shared schemas for Fixer - AI-powered Issue Management System",
|
|
5
5
|
"author": "zhangyingwei",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,10 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"tsup": "^8.0.0",
|
|
32
|
-
"typescript": "^5.7.0"
|
|
32
|
+
"typescript": "^5.7.0",
|
|
33
|
+
"vitest": "^4.1.0"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "tsup src/index.ts --format esm --dts",
|
|
36
|
-
"dev": "tsup src/index.ts --format esm --dts --watch"
|
|
37
|
+
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:watch": "vitest"
|
|
37
40
|
}
|
|
38
41
|
}
|