@fixerorg/schemas 1.0.5 → 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 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 日志条目 */
@@ -1781,9 +1785,9 @@ declare const AgentLogListResponseSchema: z.ZodObject<{
1781
1785
  }>;
1782
1786
  type AgentLogListResponse = z.infer<typeof AgentLogListResponseSchema>;
1783
1787
  /** 后端发送的 SSE 事件类型 */
1784
- declare const BACKEND_SSE_EVENT_TYPES: readonly ["status", "log", "complete", "error", "phase_complete"];
1788
+ declare const BACKEND_SSE_EVENT_TYPES: readonly ["status", "log", "complete", "error", "phase_complete", "content_start", "content_delta", "content_end"];
1785
1789
  /** 前端应监听的 SSE 事件类型 */
1786
- declare const FRONTEND_SSE_EVENT_TYPES: readonly ["status", "log", "complete", "error", "phase_complete"];
1790
+ declare const FRONTEND_SSE_EVENT_TYPES: readonly ["status", "log", "complete", "error", "phase_complete", "content_start", "content_delta", "content_end"];
1787
1791
  type BackendSSEEventType = typeof BACKEND_SSE_EVENT_TYPES[number];
1788
1792
  type FrontendSSEEventType = typeof FRONTEND_SSE_EVENT_TYPES[number];
1789
1793
  /** 单个 SSE 事件数据 Schema(用于验证后端发送的每个事件) */
@@ -2029,5 +2033,89 @@ declare const WorkflowSSEEventSchema: z.ZodUnion<[z.ZodObject<{
2029
2033
  };
2030
2034
  }>]>;
2031
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>;
2032
2120
 
2033
- 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, 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 SSEErrorData, SSEErrorDataSchema, type SSEEvent, SSEEventSchema, type SSELogData, SSELogDataSchema, type SSEPhaseCompleteData, SSEPhaseCompleteDataSchema, type SSEStatusData, SSEStatusDataSchema, 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
  });
@@ -455,14 +457,22 @@ var BACKEND_SSE_EVENT_TYPES = [
455
457
  "log",
456
458
  "complete",
457
459
  "error",
458
- "phase_complete"
460
+ "phase_complete",
461
+ // 流式内容事件
462
+ "content_start",
463
+ "content_delta",
464
+ "content_end"
459
465
  ];
460
466
  var FRONTEND_SSE_EVENT_TYPES = [
461
467
  "status",
462
468
  "log",
463
469
  "complete",
464
470
  "error",
465
- "phase_complete"
471
+ "phase_complete",
472
+ // 流式内容事件
473
+ "content_start",
474
+ "content_delta",
475
+ "content_end"
466
476
  ];
467
477
  var SSEStatusDataSchema = z11.object({
468
478
  state: WorkflowStateSchema,
@@ -523,6 +533,49 @@ var WorkflowSSEEventSchema = z11.union([
523
533
  })
524
534
  })
525
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
+ });
526
579
  export {
527
580
  AI,
528
581
  AIChatRequestSchema,
@@ -536,6 +589,7 @@ export {
536
589
  BACKEND_SSE_EVENT_TYPES,
537
590
  BranchOptionSchema,
538
591
  BranchSchema,
592
+ ContentBufferSchema,
539
593
  ContentDeltaEventSchema,
540
594
  ErrorEventSchema,
541
595
  FRONTEND_SSE_EVENT_TYPES,
@@ -570,6 +624,9 @@ export {
570
624
  RetryOptionsSchema,
571
625
  SETTINGS,
572
626
  SSECompleteDataSchema,
627
+ SSEContentDeltaDataSchema,
628
+ SSEContentEndDataSchema,
629
+ SSEContentStartDataSchema,
573
630
  SSEErrorDataSchema,
574
631
  SSEEventSchema,
575
632
  SSELogDataSchema,
@@ -577,6 +634,7 @@ export {
577
634
  SSEStatusDataSchema,
578
635
  SettingsResponseSchema,
579
636
  SettingsUpdateSchema,
637
+ StreamContentTypeSchema,
580
638
  SyncStatusSchema,
581
639
  TASKS,
582
640
  TaskCreateSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fixerorg/schemas",
3
- "version": "1.0.5",
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",