index.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Models
  2. export { type BookConfig, type Platform, type Genre, type BookStatus, BookConfigSchema, PlatformSchema, GenreSchema, BookStatusSchema } from "./models/book.js";
  3. export { type ChapterMeta, type ChapterStatus, ChapterMetaSchema, ChapterStatusSchema } from "./models/chapter.js";
  4. export { type ProjectConfig, type LLMConfig, type NotifyChannel, type DetectionConfig, type QualityGates, type AgentLLMOverride, ProjectConfigSchema, LLMConfigSchema, AgentLLMOverrideSchema, DetectionConfigSchema, QualityGatesSchema } from "./models/project.js";
  5. export { type CurrentState, type ParticleLedger, type PendingHooks, type PendingHook, type LedgerEntry } from "./models/state.js";
  6. export { type GenreProfile, type ParsedGenreProfile, GenreProfileSchema, parseGenreProfile } from "./models/genre-profile.js";
  7. export { type BookRules, type ParsedBookRules, BookRulesSchema, parseBookRules } from "./models/book-rules.js";
  8. export { type DetectionHistoryEntry, type DetectionStats } from "./models/detection.js";
  9. export { type StyleProfile } from "./models/style-profile.js";
  10. // LLM
  11. export { createLLMClient, chatCompletion, chatWithTools, createStreamMonitor, PartialResponseError, type LLMClient, type LLMResponse, type LLMMessage, type ToolDefinition, type ToolCall, type AgentMessage, type ChatWithToolsResult, type StreamProgress, type OnStreamProgress } from "./llm/provider.js";
  12. // Agents
  13. export { BaseAgent, type AgentContext } from "./agents/base.js";
  14. export { ArchitectAgent, type ArchitectOutput } from "./agents/architect.js";
  15. export { WriterAgent, type WriteChapterInput, type WriteChapterOutput, type TokenUsage } from "./agents/writer.js";
  16. export { ContinuityAuditor, type AuditResult, type AuditIssue } from "./agents/continuity.js";
  17. export { ReviserAgent, type ReviseOutput, type ReviseMode } from "./agents/reviser.js";
  18. export { RadarAgent, type RadarResult, type RadarRecommendation } from "./agents/radar.js";
  19. export { FanqieRadarSource, QidianRadarSource, TextRadarSource, type RadarSource, type PlatformRankings, type RankingEntry } from "./agents/radar-source.js";
  20. export { readGenreProfile, readBookRules, listAvailableGenres, getBuiltinGenresDir } from "./agents/rules-reader.js";
  21. export { buildWriterSystemPrompt } from "./agents/writer-prompts.js";
  22. export { analyzeAITells, type AITellResult, type AITellIssue } from "./agents/ai-tells.js";
  23. export { analyzeSensitiveWords, type SensitiveWordResult, type SensitiveWordMatch } from "./agents/sensitive-words.js";
  24. export { detectAIContent, type DetectionResult } from "./agents/detector.js";
  25. export { analyzeStyle } from "./agents/style-analyzer.js";
  26. export { analyzeDetectionInsights } from "./agents/detection-insights.js";
  27. export { validatePostWrite, type PostWriteViolation } from "./agents/post-write-validator.js";
  28. export { ChapterAnalyzerAgent, type AnalyzeChapterInput, type AnalyzeChapterOutput } from "./agents/chapter-analyzer.js";
  29. export { parseWriterOutput, parseCreativeOutput, type ParsedWriterOutput, type CreativeOutput } from "./agents/writer-parser.js";
  30. export { buildSettlerSystemPrompt, buildSettlerUserPrompt } from "./agents/settler-prompts.js";
  31. export { parseSettlementOutput, type SettlementOutput } from "./agents/settler-parser.js";
  32. // Utils
  33. export { fetchUrl } from "./utils/web-search.js";
  34. export { splitChapters, type SplitChapter } from "./utils/chapter-splitter.js";
  35. export { createLogger, createStderrSink, createJsonLineSink, nullSink, type Logger, type LogSink, type LogLevel, type LogEntry } from "./utils/logger.js";
  36. // Pipeline
  37. export { PipelineRunner, type PipelineConfig, type ChapterPipelineResult, type DraftResult, type ReviseResult, type TruthFiles, type BookStatusInfo, type ImportChaptersInput, type ImportChaptersResult, type TokenUsageSummary } from "./pipeline/runner.js";
  38. export { Scheduler, type SchedulerConfig } from "./pipeline/scheduler.js";
  39. export { runAgentLoop, AGENT_TOOLS as AGENT_TOOLS, type AgentLoopOptions } from "./pipeline/agent.js";
  40. export { detectChapter, detectAndRewrite, loadDetectionHistory, type DetectChapterResult, type DetectAndRewriteResult } from "./pipeline/detection-runner.js";
  41. // State
  42. export { StateManager } from "./state/manager.js";
  43. // Notify
  44. export { dispatchNotification, dispatchWebhookEvent, type NotifyMessage } from "./notify/dispatcher.js";
  45. export { sendTelegram, type TelegramConfig } from "./notify/telegram.js";
  46. export { sendFeishu, type FeishuConfig } from "./notify/feishu.js";
  47. export { sendWechatWork, type WechatWorkConfig } from "./notify/wechat-work.js";
  48. export { sendWebhook, type WebhookConfig, type WebhookEvent, type WebhookPayload } from "./notify/webhook.js";