index.ts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // Models
  2. export { type BookConfig, type Platform, type Genre, type BookStatus, type FanficMode, BookConfigSchema, PlatformSchema, GenreSchema, BookStatusSchema, FanficModeSchema } 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, type InputGovernanceMode, ProjectConfigSchema, LLMConfigSchema, AgentLLMOverrideSchema, DetectionConfigSchema, QualityGatesSchema, InputGovernanceModeSchema } 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. export { type LengthCountingMode, type LengthNormalizeMode, type LengthSpec, type LengthTelemetry, type LengthWarning, LengthCountingModeSchema, LengthNormalizeModeSchema, LengthSpecSchema, LengthTelemetrySchema, LengthWarningSchema } from "./models/length-governance.js";
  11. export {
  12. type ChapterConflict,
  13. type ChapterIntent,
  14. type ContextSource,
  15. type ContextPackage,
  16. type RuleLayerScope,
  17. type RuleLayer,
  18. type OverrideEdge,
  19. type ActiveOverride,
  20. type RuleStackSections,
  21. type RuleStack,
  22. type ChapterTrace,
  23. ChapterConflictSchema,
  24. ChapterIntentSchema,
  25. ContextSourceSchema,
  26. ContextPackageSchema,
  27. RuleLayerScopeSchema,
  28. RuleLayerSchema,
  29. OverrideEdgeSchema,
  30. ActiveOverrideSchema,
  31. RuleStackSectionsSchema,
  32. RuleStackSchema,
  33. ChapterTraceSchema,
  34. } from "./models/input-governance.js";
  35. export { PlannerAgent, type PlanChapterInput, type PlanChapterOutput } from "./agents/planner.js";
  36. export { ComposerAgent, type ComposeChapterInput, type ComposeChapterOutput } from "./agents/composer.js";
  37. // LLM
  38. 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";
  39. // Agents
  40. export { BaseAgent, type AgentContext } from "./agents/base.js";
  41. export { ArchitectAgent, type ArchitectOutput } from "./agents/architect.js";
  42. export { WriterAgent, type WriteChapterInput, type WriteChapterOutput, type TokenUsage } from "./agents/writer.js";
  43. export { LengthNormalizerAgent, type NormalizeLengthInput, type NormalizeLengthOutput } from "./agents/length-normalizer.js";
  44. export { ContinuityAuditor, type AuditResult, type AuditIssue } from "./agents/continuity.js";
  45. export { ReviserAgent, type ReviseOutput, type ReviseMode } from "./agents/reviser.js";
  46. export { RadarAgent, type RadarResult, type RadarRecommendation } from "./agents/radar.js";
  47. export { FanqieRadarSource, QidianRadarSource, TextRadarSource, type RadarSource, type PlatformRankings, type RankingEntry } from "./agents/radar-source.js";
  48. export { readGenreProfile, readBookRules, listAvailableGenres, getBuiltinGenresDir } from "./agents/rules-reader.js";
  49. export { buildWriterSystemPrompt } from "./agents/writer-prompts.js";
  50. export { analyzeAITells, type AITellResult, type AITellIssue } from "./agents/ai-tells.js";
  51. export { analyzeSensitiveWords, type SensitiveWordResult, type SensitiveWordMatch } from "./agents/sensitive-words.js";
  52. export { detectAIContent, type DetectionResult } from "./agents/detector.js";
  53. export { analyzeStyle } from "./agents/style-analyzer.js";
  54. export { analyzeDetectionInsights } from "./agents/detection-insights.js";
  55. export { validatePostWrite, type PostWriteViolation } from "./agents/post-write-validator.js";
  56. export { ChapterAnalyzerAgent, type AnalyzeChapterInput, type AnalyzeChapterOutput } from "./agents/chapter-analyzer.js";
  57. export { parseWriterOutput, parseCreativeOutput, type ParsedWriterOutput, type CreativeOutput } from "./agents/writer-parser.js";
  58. export { buildSettlerSystemPrompt, buildSettlerUserPrompt } from "./agents/settler-prompts.js";
  59. export { parseSettlementOutput, type SettlementOutput } from "./agents/settler-parser.js";
  60. export { FanficCanonImporter, type FanficCanonOutput } from "./agents/fanfic-canon-importer.js";
  61. export { getFanficDimensionConfig, FANFIC_DIMENSIONS, type FanficDimensionConfig } from "./agents/fanfic-dimensions.js";
  62. export { buildFanficCanonSection, buildCharacterVoiceProfiles, buildFanficModeInstructions } from "./agents/fanfic-prompt-sections.js";
  63. // Utils
  64. export { fetchUrl, searchWeb } from "./utils/web-search.js";
  65. export { filterHooks, filterSummaries, filterSubplots, filterEmotionalArcs, filterCharacterMatrix } from "./utils/context-filter.js";
  66. export { extractPOVFromOutline, filterMatrixByPOV, filterHooksByPOV } from "./utils/pov-filter.js";
  67. export { ConsolidatorAgent } from "./agents/consolidator.js";
  68. export { MemoryDB, type Fact, type StoredSummary } from "./state/memory-db.js";
  69. export { StateValidatorAgent } from "./agents/state-validator.js";
  70. export { splitChapters, type SplitChapter } from "./utils/chapter-splitter.js";
  71. export { countChapterLength, resolveLengthCountingMode, formatLengthCount, buildLengthSpec, isOutsideSoftRange, isOutsideHardRange, chooseNormalizeMode, type LengthLanguage } from "./utils/length-metrics.js";
  72. export { createLogger, createStderrSink, createJsonLineSink, nullSink, type Logger, type LogSink, type LogLevel, type LogEntry } from "./utils/logger.js";
  73. export { loadProjectConfig, GLOBAL_CONFIG_DIR, GLOBAL_ENV_PATH } from "./utils/config-loader.js";
  74. export { computeAnalytics, type AnalyticsData, type TokenStats } from "./utils/analytics.js";
  75. // Pipeline
  76. export { PipelineRunner, type PipelineConfig, type ChapterPipelineResult, type DraftResult, type PlanChapterResult, type ComposeChapterResult, type ReviseResult, type TruthFiles, type BookStatusInfo, type ImportChaptersInput, type ImportChaptersResult, type TokenUsageSummary } from "./pipeline/runner.js";
  77. export { Scheduler, type SchedulerConfig } from "./pipeline/scheduler.js";
  78. export { runAgentLoop, AGENT_TOOLS as AGENT_TOOLS, type AgentLoopOptions } from "./pipeline/agent.js";
  79. export { detectChapter, detectAndRewrite, loadDetectionHistory, type DetectChapterResult, type DetectAndRewriteResult } from "./pipeline/detection-runner.js";
  80. // State
  81. export { StateManager } from "./state/manager.js";
  82. // Notify
  83. export { dispatchNotification, dispatchWebhookEvent, type NotifyMessage } from "./notify/dispatcher.js";
  84. export { sendTelegram, type TelegramConfig } from "./notify/telegram.js";
  85. export { sendFeishu, type FeishuConfig } from "./notify/feishu.js";
  86. export { sendWechatWork, type WechatWorkConfig } from "./notify/wechat-work.js";
  87. export { sendWebhook, type WebhookConfig, type WebhookEvent, type WebhookPayload } from "./notify/webhook.js";