| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- // Models
- export { type BookConfig, type Platform, type Genre, type BookStatus, type FanficMode, BookConfigSchema, PlatformSchema, GenreSchema, BookStatusSchema, FanficModeSchema } from "./models/book.js";
- export { type ChapterMeta, type ChapterStatus, ChapterMetaSchema, ChapterStatusSchema } from "./models/chapter.js";
- 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";
- export { type CurrentState, type ParticleLedger, type PendingHooks, type PendingHook, type LedgerEntry } from "./models/state.js";
- export { type GenreProfile, type ParsedGenreProfile, GenreProfileSchema, parseGenreProfile } from "./models/genre-profile.js";
- export { type BookRules, type ParsedBookRules, BookRulesSchema, parseBookRules } from "./models/book-rules.js";
- export { type DetectionHistoryEntry, type DetectionStats } from "./models/detection.js";
- export { type StyleProfile } from "./models/style-profile.js";
- export { type LengthCountingMode, type LengthNormalizeMode, type LengthSpec, type LengthTelemetry, type LengthWarning, LengthCountingModeSchema, LengthNormalizeModeSchema, LengthSpecSchema, LengthTelemetrySchema, LengthWarningSchema } from "./models/length-governance.js";
- export {
- type RuntimeStateLanguage,
- type StateManifest,
- type HookStatus,
- type HookRecord,
- type HooksState,
- type ChapterSummaryRow,
- type ChapterSummariesState,
- type CurrentStateFact,
- type CurrentStateState,
- type CurrentStatePatch,
- type HookOps,
- type NewHookCandidate,
- type RuntimeStateDelta,
- RuntimeStateLanguageSchema,
- StateManifestSchema,
- HookStatusSchema,
- HookRecordSchema,
- HooksStateSchema,
- ChapterSummaryRowSchema,
- ChapterSummariesStateSchema,
- CurrentStateFactSchema,
- CurrentStateStateSchema,
- CurrentStatePatchSchema,
- HookOpsSchema,
- NewHookCandidateSchema,
- RuntimeStateDeltaSchema,
- } from "./models/runtime-state.js";
- export {
- type ChapterConflict,
- type HookMovement,
- type HookPressureLevel,
- type HookPressure,
- type ChapterIntent,
- type ContextSource,
- type ContextPackage,
- type RuleLayerScope,
- type RuleLayer,
- type OverrideEdge,
- type ActiveOverride,
- type RuleStackSections,
- type RuleStack,
- type ChapterTrace,
- ChapterConflictSchema,
- HookMovementSchema,
- HookPressureLevelSchema,
- HookPressureSchema,
- ChapterIntentSchema,
- ContextSourceSchema,
- ContextPackageSchema,
- RuleLayerScopeSchema,
- RuleLayerSchema,
- OverrideEdgeSchema,
- ActiveOverrideSchema,
- RuleStackSectionsSchema,
- RuleStackSchema,
- ChapterTraceSchema,
- } from "./models/input-governance.js";
- export { PlannerAgent, type PlanChapterInput, type PlanChapterOutput } from "./agents/planner.js";
- export { ComposerAgent, type ComposeChapterInput, type ComposeChapterOutput } from "./agents/composer.js";
- export {
- AutomationModeSchema,
- type AutomationMode,
- normalizeAutomationMode,
- } from "./interaction/modes.js";
- export {
- InteractionIntentTypeSchema,
- type InteractionIntentType,
- InteractionRequestSchema,
- type InteractionRequest,
- } from "./interaction/intents.js";
- export {
- ExecutionStatusSchema,
- ExecutionStateSchema,
- InteractionEventSchema,
- type ExecutionStatus,
- type ExecutionState,
- type InteractionEvent,
- isTerminalExecutionStatus,
- } from "./interaction/events.js";
- export {
- BookCreationDraftSchema,
- DraftRoundSchema,
- PendingDecisionSchema,
- InteractionMessageSchema,
- InteractionSessionSchema,
- type BookCreationDraft,
- type DraftRound,
- type PendingDecision,
- type InteractionMessage,
- type InteractionSession,
- bindActiveBook,
- clearCreationDraft,
- clearPendingDecision,
- updateAutomationMode,
- updateCreationDraft,
- appendInteractionMessage,
- appendInteractionEvent,
- BookSessionSchema,
- GlobalSessionSchema,
- type BookSession,
- type GlobalSession,
- createBookSession,
- appendBookSessionMessage,
- } from "./interaction/session.js";
- export {
- resolveProjectSessionPath,
- createProjectSession,
- loadProjectSession,
- persistProjectSession,
- resolveSessionActiveBook,
- loadGlobalSession,
- persistGlobalSession,
- } from "./interaction/project-session-store.js";
- export {
- loadBookSession,
- persistBookSession,
- listBookSessions,
- renameBookSession,
- deleteBookSession,
- migrateBookSession,
- createAndPersistBookSession,
- SessionAlreadyMigratedError,
- } from "./interaction/book-session-store.js";
- export { routeInteractionRequest } from "./interaction/request-router.js";
- export {
- routeNaturalLanguageIntent,
- type NaturalLanguageRoutingContext,
- } from "./interaction/nl-router.js";
- export {
- processProjectInteractionInput,
- processProjectInteractionRequest,
- } from "./interaction/project-control.js";
- export { createInteractionToolsFromDeps } from "./interaction/project-tools.js";
- export { buildExportArtifact, writeExportArtifact } from "./interaction/export-artifact.js";
- export {
- normalizeTruthFileName,
- classifyTruthAuthority,
- type TruthAuthority,
- } from "./interaction/truth-authority.js";
- export {
- executeEditTransaction,
- planEditTransaction,
- type EditRequest,
- type EditExecutionDeps,
- type ExecutedEditTransaction,
- type PlannedEditTransaction,
- } from "./interaction/edit-controller.js";
- export {
- runInteractionRequest,
- type InteractionRuntimeTools,
- type InteractionRuntimeResult,
- } from "./interaction/runtime.js";
- export {
- parseDraftDirectives,
- createDirectiveStreamFilter,
- type ParsedDraftResponse,
- } from "./interaction/draft-directive-parser.js";
- // Agent (pi-agent integration)
- export * from "./agent/index.js";
- // LLM
- 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";
- export {
- SERVICE_PRESETS,
- SERVICE_TO_PI_PROVIDER,
- resolveServicePreset,
- resolveServiceProviderFamily,
- resolveServicePiProvider,
- resolveServiceModelsBaseUrl,
- guessServiceFromBaseUrl,
- listModelsForService,
- listServicesWithModelCount,
- type ServicePreset,
- type ModelInfo,
- } from "./llm/service-presets.js";
- export { resolveServiceModel, type ResolvedModel } from "./llm/service-resolver.js";
- export { loadSecrets, saveSecrets, getServiceApiKey, type SecretsFile } from "./llm/secrets.js";
- export { migrateConfig, type MigrationResult } from "./llm/config-migration.js";
- // Agents
- export { BaseAgent, type AgentContext } from "./agents/base.js";
- export { ArchitectAgent, type ArchitectOutput } from "./agents/architect.js";
- export { WriterAgent, type WriteChapterInput, type WriteChapterOutput, type TokenUsage } from "./agents/writer.js";
- export { LengthNormalizerAgent, type NormalizeLengthInput, type NormalizeLengthOutput } from "./agents/length-normalizer.js";
- export { ContinuityAuditor, type AuditResult, type AuditIssue } from "./agents/continuity.js";
- export { ReviserAgent, DEFAULT_REVISE_MODE, type ReviseOutput, type ReviseMode } from "./agents/reviser.js";
- export { RadarAgent, type RadarResult, type RadarRecommendation } from "./agents/radar.js";
- export { FanqieRadarSource, QidianRadarSource, TextRadarSource, type RadarSource, type PlatformRankings, type RankingEntry } from "./agents/radar-source.js";
- export { readGenreProfile, readBookRules, listAvailableGenres, getBuiltinGenresDir } from "./agents/rules-reader.js";
- export { buildWriterSystemPrompt } from "./agents/writer-prompts.js";
- export { analyzeAITells, type AITellResult, type AITellIssue } from "./agents/ai-tells.js";
- export { analyzeSensitiveWords, type SensitiveWordResult, type SensitiveWordMatch } from "./agents/sensitive-words.js";
- export { detectAIContent, type DetectionResult } from "./agents/detector.js";
- export { analyzeStyle } from "./agents/style-analyzer.js";
- export { analyzeDetectionInsights } from "./agents/detection-insights.js";
- export { validatePostWrite, detectParagraphLengthDrift, detectParagraphShapeWarnings, detectDuplicateTitle, type PostWriteViolation } from "./agents/post-write-validator.js";
- export { ChapterAnalyzerAgent, type AnalyzeChapterInput, type AnalyzeChapterOutput } from "./agents/chapter-analyzer.js";
- export { parseWriterOutput, parseCreativeOutput, type ParsedWriterOutput, type CreativeOutput } from "./agents/writer-parser.js";
- export { buildSettlerSystemPrompt, buildSettlerUserPrompt } from "./agents/settler-prompts.js";
- export { parseSettlementOutput, type SettlementOutput } from "./agents/settler-parser.js";
- export { parseSettlerDeltaOutput, type SettlerDeltaOutput } from "./agents/settler-delta-parser.js";
- export { FanficCanonImporter, type FanficCanonOutput } from "./agents/fanfic-canon-importer.js";
- export { getFanficDimensionConfig, FANFIC_DIMENSIONS, type FanficDimensionConfig } from "./agents/fanfic-dimensions.js";
- export { buildFanficCanonSection, buildCharacterVoiceProfiles, buildFanficModeInstructions } from "./agents/fanfic-prompt-sections.js";
- // Utils
- export { fetchUrl, searchWeb } from "./utils/web-search.js";
- export { filterHooks, filterSummaries, filterSubplots, filterEmotionalArcs, filterCharacterMatrix } from "./utils/context-filter.js";
- export { extractPOVFromOutline, filterMatrixByPOV, filterHooksByPOV } from "./utils/pov-filter.js";
- export { ConsolidatorAgent } from "./agents/consolidator.js";
- export { MemoryDB, type Fact, type StoredSummary } from "./state/memory-db.js";
- export { StateValidatorAgent } from "./agents/state-validator.js";
- export { loadRuntimeStateSnapshot, buildRuntimeStateArtifacts, saveRuntimeStateSnapshot, loadNarrativeMemorySeed, loadSnapshotCurrentStateFacts, type RuntimeStateArtifacts, type NarrativeMemorySeed } from "./state/runtime-state-store.js";
- export { splitChapters, type SplitChapter } from "./utils/chapter-splitter.js";
- export { countChapterLength, resolveLengthCountingMode, formatLengthCount, buildLengthSpec, isOutsideSoftRange, isOutsideHardRange, chooseNormalizeMode, type LengthLanguage } from "./utils/length-metrics.js";
- export { createLogger, createStderrSink, createJsonLineSink, nullSink, type Logger, type LogSink, type LogLevel, type LogEntry } from "./utils/logger.js";
- export { loadProjectConfig, GLOBAL_CONFIG_DIR, GLOBAL_ENV_PATH, isApiKeyOptionalForEndpoint } from "./utils/config-loader.js";
- export { computeAnalytics, type AnalyticsData, type TokenStats } from "./utils/analytics.js";
- export {
- collectStaleHookDebt,
- evaluateHookAdmission,
- classifyHookDisposition,
- type HookAdmissionCandidate,
- type HookAdmissionDecision,
- type HookDisposition,
- } from "./utils/hook-governance.js";
- export { arbitrateRuntimeStateDeltaHooks, type HookArbiterDecision } from "./utils/hook-arbiter.js";
- export { analyzeHookHealth } from "./utils/hook-health.js";
- // Pipeline
- 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";
- export { Scheduler, type SchedulerConfig } from "./pipeline/scheduler.js";
- export { runAgentLoop, AGENT_TOOLS as AGENT_TOOLS, type AgentLoopOptions } from "./pipeline/agent.js";
- export { detectChapter, detectAndRewrite, loadDetectionHistory, type DetectChapterResult, type DetectAndRewriteResult } from "./pipeline/detection-runner.js";
- // State
- export { StateManager } from "./state/manager.js";
- export { bootstrapStructuredStateFromMarkdown } from "./state/state-bootstrap.js";
- export { renderCurrentStateProjection, renderHooksProjection, renderChapterSummariesProjection } from "./state/state-projections.js";
- export { applyRuntimeStateDelta, type RuntimeStateSnapshot } from "./state/state-reducer.js";
- export { validateRuntimeState, type RuntimeStateValidationIssue } from "./state/state-validator.js";
- // Notify
- export { dispatchNotification, dispatchWebhookEvent, type NotifyMessage } from "./notify/dispatcher.js";
- export { sendTelegram, type TelegramConfig } from "./notify/telegram.js";
- export { sendFeishu, type FeishuConfig } from "./notify/feishu.js";
- export { sendWechatWork, type WechatWorkConfig } from "./notify/wechat-work.js";
- export { sendWebhook, type WebhookConfig, type WebhookEvent, type WebhookPayload } from "./notify/webhook.js";
|