narrarium-engine 0.1.21 → 0.1.23
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/README.md +30 -3
- package/dist/autopilot/campaign.d.ts +168 -0
- package/dist/autopilot/campaign.d.ts.map +1 -0
- package/dist/autopilot/campaign.js +562 -0
- package/dist/autopilot/campaign.js.map +1 -0
- package/dist/autopilot/estimate.d.ts +13 -5
- package/dist/autopilot/estimate.d.ts.map +1 -1
- package/dist/autopilot/estimate.js +27 -14
- package/dist/autopilot/estimate.js.map +1 -1
- package/dist/autopilot/frozen.d.ts +35 -2
- package/dist/autopilot/frozen.d.ts.map +1 -1
- package/dist/autopilot/frozen.js +99 -25
- package/dist/autopilot/frozen.js.map +1 -1
- package/dist/autopilot/planner.d.ts +4 -1
- package/dist/autopilot/planner.d.ts.map +1 -1
- package/dist/autopilot/planner.js +23 -4
- package/dist/autopilot/planner.js.map +1 -1
- package/dist/autopilot/review-policy.d.ts +22 -0
- package/dist/autopilot/review-policy.d.ts.map +1 -0
- package/dist/autopilot/review-policy.js +56 -0
- package/dist/autopilot/review-policy.js.map +1 -0
- package/dist/autopilot/runner.d.ts +5 -3
- package/dist/autopilot/runner.d.ts.map +1 -1
- package/dist/autopilot/runner.js +42 -15
- package/dist/autopilot/runner.js.map +1 -1
- package/dist/autopilot/session.d.ts +19 -0
- package/dist/autopilot/session.d.ts.map +1 -1
- package/dist/autopilot/session.js +67 -1
- package/dist/autopilot/session.js.map +1 -1
- package/dist/autopilot/state.d.ts +16 -2
- package/dist/autopilot/state.d.ts.map +1 -1
- package/dist/autopilot/state.js +183 -2
- package/dist/autopilot/state.js.map +1 -1
- package/dist/autopilot/tasks.d.ts.map +1 -1
- package/dist/autopilot/tasks.js +50 -20
- package/dist/autopilot/tasks.js.map +1 -1
- package/dist/autopilot/types.d.ts +226 -4
- package/dist/autopilot/types.d.ts.map +1 -1
- package/dist/autopilot/types.js +6 -0
- package/dist/autopilot/types.js.map +1 -1
- package/dist/book/outline-journal.d.ts +149 -0
- package/dist/book/outline-journal.d.ts.map +1 -0
- package/dist/book/outline-journal.js +321 -0
- package/dist/book/outline-journal.js.map +1 -0
- package/dist/book/outline.js +3 -3
- package/dist/book/outline.js.map +1 -1
- package/dist/book/paths.d.ts +7 -0
- package/dist/book/paths.d.ts.map +1 -1
- package/dist/book/paths.js +7 -0
- package/dist/book/paths.js.map +1 -1
- package/dist/director/opinion.d.ts +2 -0
- package/dist/director/opinion.d.ts.map +1 -1
- package/dist/director/opinion.js +4 -3
- package/dist/director/opinion.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/server/client.d.ts +15 -1
- package/dist/server/client.d.ts.map +1 -1
- package/dist/server/client.js +38 -3
- package/dist/server/client.js.map +1 -1
- package/dist/server/protocol.d.ts +40 -0
- package/dist/server/protocol.d.ts.map +1 -1
- package/dist/server/protocol.js +40 -0
- package/dist/server/protocol.js.map +1 -1
- package/dist/sync/files.d.ts +12 -0
- package/dist/sync/files.d.ts.map +1 -1
- package/dist/sync/files.js +40 -2
- package/dist/sync/files.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -201,6 +201,10 @@ Its profile lives in `director.md` at the book root (persona, autonomy, strictne
|
|
|
201
201
|
|
|
202
202
|
Values are read as the author wrote them: an autonomy whatever its case (`Full`, `ask on critical`), numbers with their decimals (`approval_score: 7.5`, a reader weight of `0.4`) and a decimal comma (`'9,5'`).
|
|
203
203
|
|
|
204
|
+
### The review policy
|
|
205
|
+
|
|
206
|
+
`options.review` (`ReviewPolicy`, `normalizeReviewPolicy`) changes, for a run, the vote a chapter and the book must reach (`targetScore`, 1-10 to a tenth; the plan keeps the director's), the rounds of a chapter (`maxRounds`, 1-10), the first rounds the readers read in (`readerRounds`, 1-10; 1 by default) and the rounds a review of the book makes before it waits (`campaignMaxRounds`; 0 none). What it does not say is the profile's; `null` takes a value back. `reviewTarget`, `reviewMaxRounds` and `reviewReaderRounds` say what wins: the review of the book in progress, the policy, the profile. Without a policy every prompt is the one it always was. A chapter keeps its last `MAX_CHAPTER_ROUNDS` (30) rounds.
|
|
207
|
+
|
|
204
208
|
### Profiles that cannot be read
|
|
205
209
|
|
|
206
210
|
`parseDirector`, `parseGhostwriter`, `parseReaderPersona` and `parseEvaluationStyle` never throw and never hide a problem: they return `warnings: string[]` (empty when the file is as it says), each naming the file. A warning is YAML that cannot be read (with its line), a value that is not understood (an autonomy nobody knows, a score that is not a number, a list that is not a list, a reader type that is none of `standard`, `genre`, `custom`, a switch that is neither yes nor no, a criterion of the evaluation style that cannot be read), and the profile then has the default for that value, as it always had. The defaults themselves carry `warnings: []`.
|
|
@@ -223,9 +227,16 @@ The outline (the Synopsis of the app, «Sinossi» in Italian; once called the Sc
|
|
|
223
227
|
| `outline/_brief.md` | `type: outline-brief`, `id: outline:brief`, `genre?`, `audience?`, `wordsPerScene` (a whole number from 200 to 8 000; 1 400 when absent) | The synopsis, free Markdown. An `idea` key found here is ignored and never written. It is the brief of the autopilot, not an entry: see *The brief*. |
|
|
224
228
|
| `outline/chapters/<NNN>.md` | `type: outline-chapter`, `id: outline-chapter:<NNN>`, `number`, `title?` (the hypothetical title), `ghostwriter?` (the slug of `ghostwriters/<slug>.md`; absent: the book's), `origin: author \| autopilot`, `digest?` | What happens in the chapter, plain text. |
|
|
225
229
|
| `outline/brainstorm.md` (`OUTLINE_BRAINSTORM_FILE`) | none | The notes of Brainstorming (the Copilot's mode on the Synopsis page of the app): the decisions the author saved from a brainstorm, one dated section after the other. Never an entry: `parseOutline` and `outlineIndex` skip it as they skip the brief, so it has no number and is never a warning, and no outline edit writes, moves or deletes it. |
|
|
230
|
+
| `outline/changes.yml` (`OUTLINE_CHANGES_FILE`) | none (YAML) | The journal of the Synopsis (see below). Never an entry and not Markdown: `parseOutline`, `outlineIndex` and `CONTENT_GLOB` skip it. |
|
|
226
231
|
|
|
227
232
|
One file per chapter: the outline has no maximum, and no file grows with the book. `<NNN>` has the zero-padding of the chapter folders (`formatOrdinal`): `outlineChapterPath(7)` is `outline/chapters/007.md`, `outlineChapterPath(1500)` is `outline/chapters/1500.md`, and `parseOutlineChapterPath(path)` reads the number back. The number of an entry is the one of its file's name; a frontmatter that says another is a warning, and the name wins. The keys the format does not know are kept whenever the engine rewrites a file. The core (`narrarium`) has the same paths (`OUTLINE_BOOK_FILE`, `OUTLINE_CHAPTERS_DIRECTORY`, `outlineChapterPath`, `parseOutlineChapterPath`), validates the files with `outlineBookSchema` and `outlineChapterSchema` (passthrough), searches them and renames references in them with the rest of the book (`CONTENT_GLOB`), and its doctor warns, never errs, about a number that is not the file's and a ghostwriter that does not exist.
|
|
228
233
|
|
|
234
|
+
### The journal of the Synopsis
|
|
235
|
+
|
|
236
|
+
`outline/changes.yml` is the history of the Synopsis by chapter: each series of edits with `id`, `at`, `by` (`author`, `brainstorming`, `autopilot`, `mcp`), an optional `note`, and one line for each chapter whose entry changed (`created`, `modified`, `moved` with `from`, `removed`; titles; the `before` and `after` digests; a `summary` in the language of the book). Append-only: copies merge by series (`mergeOutlineJournals`, the latest `reviewedAt`), and `syncBookStores` joins two versions instead of calling a conflict (`mergeBookFileVersions`; `result.merged`). It keeps 180 days and at most 200 series of at most 200 chapters (`OUTLINE_JOURNAL_*`). `reviewedAt`: `markOutlineJournalReviewed`.
|
|
237
|
+
|
|
238
|
+
Whoever saves a series writes it in the same commit: `outlineJournalChange({ journal, before, changes, by, note?, language?, hints? })` answers the change of the journal (`null` when no entry of a chapter changed), `hints` being the composer's `created` and `moved`, which make moves exact (without them an entry is followed by its digest, or by its title with `edited`). The web app (Synopsis page, Copilot, Brainstorming), the server's `edit_outline` and the autopilot's `fillOutline` do. The autopilot never decides from it (the plan's `outlineDigest` does). Also: `parseOutlineJournal`, `serializeOutlineJournal`, `appendOutlineJournal`, `pruneOutlineJournal`, `outlineJournalChapters(Of)`.
|
|
239
|
+
|
|
229
240
|
### Who wrote an entry: `origin` and `digest`
|
|
230
241
|
|
|
231
242
|
- `origin: author`, or no `origin`: the author's. It binds the autopilot, which never rewrites it.
|
|
@@ -373,6 +384,20 @@ A decision that needs the model is recorded in `state.pendingReviews` and carrie
|
|
|
373
384
|
- `summary.frozenChanges` counts the chapters with a change that waits for the author (a change with a decision recorded does not count), so that a band or a dock says it without the state: what the run found before its last step, or the last `frozenStatus()`. It is absent when none waits (a book without changes has the summary it always had).
|
|
374
385
|
- The routes of the personal server are in *The personal server client*.
|
|
375
386
|
|
|
387
|
+
## Campaigns: revise these chapters now, for this reason
|
|
388
|
+
|
|
389
|
+
«Revise THESE chapters now, for THIS reason, in order, then go on with the plan» (`autopilot/campaign.ts`): for each chapter the author chooses `follow` (work it now), `keep` or `later`, with a `note` for all and an `instruction` for one. `session.reviseChapters({ reason, chapters: [{ number, mode, instruction?, fingerprint? }], note? })` checks it against the book and saves `state.campaign` at once, also during a run (taken at its next step). The run does it before the plan, one chapter at a time in the order of the book, and says each chapter (`campaignChapterDone`, `campaignSkipped`) and the end (`campaignDone`). Meanwhile no question about a change is asked, `frozenEdits` decides nothing for its chapters, and a finished plan is not extended. It survives a restart; `cancelRevisionCampaign()` ends what waits; a second one is refused; `summary.campaign` says how far it got; the run merges the author's writes (`mergeCampaign`).
|
|
390
|
+
|
|
391
|
+
Refusals are `RevisionCampaignError` (`REVISION_CAMPAIGN_ERROR_CODES`): `invalid_request`, `campaign_active`, `not_changed` (no such change now), `stale` (the chapter's `fingerprint` is not the change's).
|
|
392
|
+
|
|
393
|
+
A reason is its handler, `REVISION_REASON_HANDLERS[reason]` (`RevisionReasonHandler`): `check`, `record`, `start`, `finished`, `keep`, `cancel`, `stop` (end before the next chapter: `campaignStopped`, the waiting chapters cancelled), `complete` and `texts`; a reason that goes in rounds adds `afterChapters` (end, wait, or another round), `resume` (a start) and its insight `codes` and `figures`. A new reason is a word of `REVISION_REASONS`, its handler and a server feature (`CAMPAIGN_FEATURES`).
|
|
394
|
+
|
|
395
|
+
- **`outline-change`** (the Synopsis applied to the book): the chapters are the written ones whose entry changed (`frozenStatus` kind `outline`). `follow` rewrites the chapter to its new entry (`beginOutlineRewrite`, as `rewrite-to-outline`, the author's words as the note) and checks **no** later chapter; `keep` keeps the text and the plan follows the entry; `later` (and a cancel) leaves a `DeferredChange` (`state.deferredChanges`): neither asked about nor decided by the autopilot while it stays as it is, still waiting for the author (`frozenStatus` says `deferred`). A chapter the author wrote is rewritten only because the author chose it.
|
|
396
|
+
|
|
397
|
+
- **`review-target`** (the finished book reviewed again to a target): `session.reviewBook({ targetScore, maxRounds?, readerRounds?, campaignMaxRounds?, budgetLimit?, budgetTokens?, include?, note? })` (`createReviewCampaign`; refused `not_finished`, `nothing_to_review`, `campaign_active`, `invalid_request`; `reviseChapters` refuses the reason). It may revise the autopilot's chapters, and the author's (frozen by the author, or imported and not frozen by the autopilot: `authorChapters`) only when included; one changed since it was frozen never. Each round reviews again, in the order of the book, the chapters whose vote (`chapterVote`) is under the target, at the review's target and rounds, then `final` judges the book (`reviewVotes`). It ends on the target (`reviewDone`), when no chapter is under it (`reviewStopped`, `chapters`), or after two rounds that raise neither the lowest vote nor the book's (`plateau`); after `options.review.campaignMaxRounds` rounds since the run began it is `held` (`reviewHeld`, `state.limitReached` `review-rounds`) and a start allows as many again. The caps it is given are the options' own. A chapter the author froze or changed meanwhile is left out (`reviewChapterSkipped`, why `author`). `state.reviews` (`ReviewRecord`) keeps how each ended; its insights carry `figures`.
|
|
398
|
+
|
|
399
|
+
The personal server serves `POST` and `DELETE /api/v1/books/:id/autopilot/campaign` and announces `autopilot-outline-apply` (see *The personal server client*).
|
|
400
|
+
|
|
376
401
|
## Evaluation style
|
|
377
402
|
|
|
378
403
|
`evaluation-guidelines.md`, the "Evaluation style" page of the web app, says how the author judges the book: `criteria`, a mapping of keys to `{ description }` (as the site writes it; a description written as text, a criterion left empty, and a list of `{ name, description }` are read as well), and a body with the critical method, the severity and the structure of a written evaluation. `parseEvaluationStyle(raw)` reads it as `{ title, criteria: [{ name, description }], body, path, warnings }` and `loadEvaluationStyle(store)` reads it from a book (`null` without the file). Like a profile it never throws and never drops a criterion in silence: YAML that cannot be read (with its line) and a criterion that cannot be read are warnings that name the file, and a file with warnings stops the run before it spends anything (`profileProblems`).
|
|
@@ -414,10 +439,10 @@ const estimate = estimateAutopilotRun({
|
|
|
414
439
|
| Field | Meaning |
|
|
415
440
|
|---|---|
|
|
416
441
|
| `brief` (`outline/_brief.md`, see *The brief*), `options` | Read as the engine reads them (`normalizeBrief`, `normalizeOptions`): what is missing is the default, a number past the limits is the limit, anything that is not a value is ignored. Only `wordsPerScene` (and the idea and the synopsis, for their words), the chapters of `outline` and the `scenesPerChapter` hint (2 to 4 for the planner; 3 when it is not told) and `readers`, `maxReaders`, `readersOnPlan`, `specialists` change the numbers. `pauseAfterPlan`, `pauseAfterEachChapter`, `chaptersPerRun`, the budgets, `fillOutline`, `syncAfterChapter` and `publishEvery` change nothing the models are asked: they are accepted and ignored. |
|
|
417
|
-
| `maxReviewRounds` | The most rounds of review a chapter gets, 1 to 3 (2 when it says nothing), as in the director's profile. |
|
|
442
|
+
| `maxReviewRounds` | The most rounds of review a chapter gets, 1 to 3 (2 when it says nothing), as in the director's profile; `options.review.maxRounds` (1 to 10) wins, and `options.review.readerRounds` has the readers read in as many rounds. |
|
|
418
443
|
| `models` | `{ [capability]: { model, maxInputTokens?, maxOutputTokens?, pricing?, tokensPerSecond?, supportsReasoning?, provider?, underlyingModel? } \| null }` for the six capabilities the autopilot uses: `autopilot`, `director`, `reader-evaluation`, `reader-evaluation-summary`, `review`, `simple-tasks` (`ESTIMATE_CAPABILITIES`). `estimateModelsFromConfig(config, speeds?)` builds it from an `AiRuntimeConfig` with the first candidate of `resolveAiCandidates`, and copies no key and no address. |
|
|
419
444
|
| `outline` | `{ entries, lastChapter, words }` of the author's entries: the chapters of the book are the outline's (`bookChapters`), the chapters already planned when it has none (`progress.planned`). |
|
|
420
|
-
| `progress` | `{ chaptersDone, planned, conceptDone, finalDone, withoutSummary, withoutSummaryWords }`: a book that is started counts only the rest. `estimateProgressFromState(state)` reads the first five from the state of the autopilot; for a book the autopilot has not started, `estimateProgressFromChapters(snapshot.chapters)` reads `chaptersDone` and `withoutSummary` from the chapters that have prose. `conceptDone` is, when it is not said, whether there is a chapter or a plan; a book whose story design the author wrote (`isThinDocument(body)` is false) has no concept step either, and the host says so. A chapter written halfway counts as whole. |
|
|
445
|
+
| `progress` | `{ chaptersDone, planned, conceptDone, finalDone, withoutSummary, withoutSummaryWords, reviewOnly }`: a book that is started counts only the rest (`reviewOnly`: the chapters left are only reviewed again, nothing is written). `estimateProgressFromState(state)` reads the first five from the state of the autopilot; for a book the autopilot has not started, `estimateProgressFromChapters(snapshot.chapters)` reads `chaptersDone` and `withoutSummary` from the chapters that have prose. `conceptDone` is, when it is not said, whether there is a chapter or a plan; a book whose story design the author wrote (`isThinDocument(body)` is false) has no concept step either, and the host says so. A chapter written halfway counts as whole. |
|
|
421
446
|
| `scenario` | `{ rounds, repairs, planRevisions }`, each a number or `{ min, max }`: what the reviews of the run will be, when the host knows. See *The interval*. |
|
|
422
447
|
| `context` | Sizes in words that the host has measured (`countWords` of the files): `designWords`, `worldWords`, `ghostwriterWords`, `directorWords` (the whole profile), `canonWords` (the manifest of the canon; `0` for a book with no canon), `secretsWords`, `rulesWords`, `notesWords` (the director's standing notes now), `styleWords` (the evaluation style as a chapter's review carries it, criteria and method: the review of the plan carries about half). Each defaults to `ESTIMATE_TYPICAL`. `estimateContextFromState(state)` gives the rules of the author and, once the plan is approved, the notes of the director. |
|
|
423
448
|
| `readerPanelSize` | Readers in the panel (default: the enabled readers of the built-in panel, 8). The readers of a run are `min(maxReaders, readerPanelSize)`. |
|
|
@@ -561,6 +586,7 @@ An activity records the model of its **last** call and the tokens of all of them
|
|
|
561
586
|
| `evaluation-guidelines.md` | The evaluation style: criteria, method and severity. See *Evaluation style*. |
|
|
562
587
|
| `outline/book.md`, `outline/chapters/<NNN>.md` | The outline (the Synopsis): the description of the book and one entry per chapter. See *Outline (the Synopsis)*. |
|
|
563
588
|
| `outline/brainstorm.md` | The notes of Brainstorming: the decisions the author saved from a brainstorm. Never an entry of the outline. |
|
|
589
|
+
| `outline/changes.yml` | The journal of the Synopsis (who changed what, when). Never an entry; the autopilot does not decide from it. |
|
|
564
590
|
| `autopilot/state.json` | Autopilot state: brief, options, plan (with the compact `rounds` of review of every chapter), review cycle, rules, interventions, statistics (with `workedMs`), the final review of the book (`finalReview`) and the last error with its kind. |
|
|
565
591
|
| `autopilot/activity.json` | Last 200 activities (what, why, next, result, model, tokens, cost). |
|
|
566
592
|
| `autopilot/plan.md` | Human-readable mirror of the plan. |
|
|
@@ -730,7 +756,7 @@ The levels, and who sets them (the target, the integration, `automatic`), are th
|
|
|
730
756
|
|
|
731
757
|
### Costs and budgets
|
|
732
758
|
|
|
733
|
-
`estimateCost` bills cached tokens like normal input unless the model has a `cachedPerMTok`. A reply carries `usageKnown` and `costKnown`: when the provider reports no tokens, `usage` is an estimate (`usageKnown: false`, `costKnown: false`); a model without a price has no `cost`. The autopilot counts those calls in `stats.usageUnknownCalls` and `stats.costUnknownCalls`, says once per run that the money budget (`options.budgetLimit`) cannot apply to a model without a price (`budgetNotApplicable`), and `options.budgetTokens` stops the run at a number of tokens instead (0 = off).
|
|
759
|
+
`estimateCost` bills cached tokens like normal input unless the model has a `cachedPerMTok`. A reply carries `usageKnown` and `costKnown`: when the provider reports no tokens, `usage` is an estimate (`usageKnown: false`, `costKnown: false`); a model without a price has no `cost`. The autopilot counts those calls in `stats.usageUnknownCalls` and `stats.costUnknownCalls`, says once per run that the money budget (`options.budgetLimit`) cannot apply to a model without a price (`budgetNotApplicable`), and `options.budgetTokens` stops the run at a number of tokens instead (0 = off). Both compare the book's totals (`stats`, of every run, set back only by a reset): the run stops before its next step (`budgetReached`, `tokenBudgetReached`) with `state.limitReached` (`{ kind, used, limit, currency? }`, in the summary too), and again at every start until the cap is raised.
|
|
734
760
|
|
|
735
761
|
### Retries
|
|
736
762
|
|
|
@@ -965,6 +991,7 @@ A skipped file is not recorded as synced (a file that was never synced stays out
|
|
|
965
991
|
The `code` of a refusal of a rule is the `code` of the engine's `AutopilotRuleError` (`AUTOPILOT_RULE_ERROR_CODES`: `rule_empty`, `rule_too_long`, `rule_not_found`, `rule_changed`, `rule_duplicate`), which a server can answer as it is (`400` for the first, the third and the last, `404` for `rule_not_found`, `409` for `rule_changed`); `isAutopilotRuleErrorCode(error.code)` tells a refusal of a rule from the other codes of `ServerRequestError`. The client sends the text as it is given and an index as it is given (a number that names no rule is `404 rule_not_found`), and what it gets back is the error it always gives, with the status and the code of the server. The answer to a question of the director that is kept as a rule needs nothing new: `answer(bookId, { questionId, answer, asRule: true })` has always carried `asRule` (`QuestionAnswer`), and a note used once is still the default.
|
|
966
992
|
|
|
967
993
|
- **Frozen chapters.** The changes of the frozen chapters and the decisions about them (see *Frozen chapters*) go through three routes, which the engine's session already serves (`session.frozenStatus`, `session.resolveFrozenChange`, `session.freezeChapter` and `unfreezeChapter`). A server that implements them announces `SERVER_FEATURE_AUTOPILOT_FROZEN` (`"autopilot-frozen"`) in the `features` of `GET /api/v1/info`, and `serverSupportsFrozenChapters(info)` reads it (never throws; an older server, or an odd answer, says no): an older server answers `404 not_found` to the routes. The question needs no new route: an answer is the `answer` of `POST …/autopilot/answer` (the `id` of a choice, or its label), which every server forwards. Every call also answers `401 unauthorized`, `403 scope` and `404 book_not_found`, and `503 maintenance` while the server is about to restart.
|
|
994
|
+
- **Campaigns.** `reviseChapters(bookId, input)` and `cancelRevisionCampaign(bookId)` are `POST` and `DELETE …/autopilot/campaign` (the session's), answering `{ campaign, frozen }`, on a server that announces the feature of the reason (`CAMPAIGN_FEATURES`: `autopilot-outline-apply`, `serverSupportsOutlineApply`; a cancel, any; else `501 feature_unavailable` before sending). Refusals: `400 invalid_request` (an unknown key too), `409 campaign_active`, `not_changed`, `stale`; scope `run`. `reviewBook(bookId, input)` is `POST …/autopilot/review` (`autopilot-review-book`, `serverSupportsReviewBook`), also refused `409 not_finished`, `nothing_to_review`. `options.review` in `configure` and `start` needs `autopilot-review-policy` (`serverSupportsReviewPolicy`), else `501 feature_unavailable`.
|
|
968
995
|
|
|
969
996
|
| Client method | Request | Answer |
|
|
970
997
|
|---|---|---|
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { BookSnapshot } from "../book/snapshot.js";
|
|
2
|
+
import { type FrozenStatus, type FrozenWorkItem, type PlannerFrozen } from "./frozen.js";
|
|
3
|
+
import type { PlanNote } from "./planner.js";
|
|
4
|
+
import { type AutopilotInsightFigures, type AutopilotMessageCode, type AutopilotState, type PlannedChapter, type ReviewVotes, type RevisionCampaign, type RevisionCampaignChapter, type RevisionChapterMode, type RevisionReason } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Campaigns: «revise THESE chapters now, for THIS reason, in order, then go on with the plan», one mechanism for every reason (`RevisionReason`).
|
|
7
|
+
*
|
|
8
|
+
* The author names the chapters and, for each, what to do (`follow`: work it now; `keep`: keep it as it is; `later`: decide later), with their own words for
|
|
9
|
+
* the director (a `note` for all of them, an `instruction` for one). The campaign is saved in the state at once, also while a run goes on
|
|
10
|
+
* (`AutopilotSession.reviseChapters`), and the run carries it out before the plan: one chapter at a time, in the order of the book, each started when nothing
|
|
11
|
+
* else is in progress and finished when the chapter is closed again; a chapter whose reason is gone is skipped and said. It survives a restart (it is in the
|
|
12
|
+
* state), is cancelled by the author (`cancelRevisionCampaign`: the chapters that wait end, the one being worked finishes), and is taken away once no chapter
|
|
13
|
+
* waits or is being worked, with what it did told once. While it goes on no question about a change is asked, and the autopilot decides nothing for its chapters.
|
|
14
|
+
*
|
|
15
|
+
* What a reason does is its handler (`REVISION_REASON_HANDLERS`): how it checks the chapters against the book (`check`), what recording does at once
|
|
16
|
+
* (`record`), how a chapter begins and when it is over (`start`, `finished`), what keeping one does (`keep`), what cancelling does (`cancel`), when the campaign
|
|
17
|
+
* stops before the next chapter (`stop`) and what it does after the last (`complete`), and how it words what it did (`texts`).
|
|
18
|
+
*
|
|
19
|
+
* - `outline-change` (the author applied the Synopsis to the book): the chapters are the written chapters whose entry changed (`frozenWork`, kind
|
|
20
|
+
* `outline`); `follow` rewrites the chapter to follow its new entry (`beginOutlineRewrite`, and no later chapter is checked: the author chose each chapter
|
|
21
|
+
* that changes), `keep` keeps the text and the plan follows the entry, `later` leaves the change for the author (`DeferredChange`). A chapter the author
|
|
22
|
+
* wrote is rewritten only because the author chose it here: the autopilot never does it on its own.
|
|
23
|
+
*/
|
|
24
|
+
export type RevisionCampaignErrorCode = "invalid_request" | "campaign_active" | "not_changed" | "stale" | "not_finished" | "nothing_to_review";
|
|
25
|
+
/** The codes of `RevisionCampaignError`, which the personal server answers with as they are. */
|
|
26
|
+
export declare const REVISION_CAMPAIGN_ERROR_CODES: readonly RevisionCampaignErrorCode[];
|
|
27
|
+
/** Whether a code is one of `RevisionCampaignError`'s. A host that sent a campaign reads the refusal of the server with it. */
|
|
28
|
+
export declare function isRevisionCampaignErrorCode(code: unknown): code is RevisionCampaignErrorCode;
|
|
29
|
+
/**
|
|
30
|
+
* A campaign that cannot be recorded: what was asked is not one (`invalid_request`), one goes on (`campaign_active`), a chapter has no such change (`not_changed`), or it
|
|
31
|
+
* changed since the author saw it (`stale`); a review of the book asked of a book that is not finished (`not_finished`), or whose chapters all have the target already
|
|
32
|
+
* (`nothing_to_review`).
|
|
33
|
+
*/
|
|
34
|
+
export declare class RevisionCampaignError extends Error {
|
|
35
|
+
readonly code: RevisionCampaignErrorCode;
|
|
36
|
+
constructor(code: RevisionCampaignErrorCode, message: string);
|
|
37
|
+
}
|
|
38
|
+
export interface ReviseChaptersInput {
|
|
39
|
+
reason: RevisionReason;
|
|
40
|
+
/** Each chapter once; the campaign works them in the order of the book. */
|
|
41
|
+
chapters: ReadonlyArray<{
|
|
42
|
+
number: number;
|
|
43
|
+
mode: RevisionChapterMode;
|
|
44
|
+
instruction?: string;
|
|
45
|
+
fingerprint?: string;
|
|
46
|
+
}>;
|
|
47
|
+
note?: string;
|
|
48
|
+
}
|
|
49
|
+
/** What `AutopilotSession.reviseChapters` and `cancelRevisionCampaign` answer: the campaign as it is saved (`null`: none goes on), and the changes after it. */
|
|
50
|
+
export interface RevisionCampaignResult {
|
|
51
|
+
campaign: RevisionCampaign | null;
|
|
52
|
+
frozen: FrozenStatus;
|
|
53
|
+
}
|
|
54
|
+
/** How beginning a chapter went: begun, skipped (nothing to do: `why`), or not yet (`wait`). */
|
|
55
|
+
export type CampaignStart = {
|
|
56
|
+
outcome: "started";
|
|
57
|
+
} | {
|
|
58
|
+
outcome: "skip";
|
|
59
|
+
why: NonNullable<RevisionCampaignChapter["why"]>;
|
|
60
|
+
} | {
|
|
61
|
+
outcome: "wait";
|
|
62
|
+
};
|
|
63
|
+
/** What a reason does once the chapters of its campaign are over: the campaign ends (`end`), waits (`wait`), or goes on with the chapters of another round (`again`). */
|
|
64
|
+
export type CampaignNext = "end" | "wait" | "again";
|
|
65
|
+
/** What the words of a chapter done know: the chapter as it is now, and the campaign. */
|
|
66
|
+
export interface CampaignChapterContext {
|
|
67
|
+
chapter: PlannedChapter;
|
|
68
|
+
campaign: RevisionCampaign;
|
|
69
|
+
}
|
|
70
|
+
/** What a reason does with its chapters (see the module). The extension point of the campaigns: a reason is one entry of `REVISION_REASON_HANDLERS`. */
|
|
71
|
+
export interface RevisionReasonHandler {
|
|
72
|
+
/** The chapters as the campaign keeps them, checked against what the author decides about now (`items`, from `frozenWork`). Throws a `RevisionCampaignError`. */
|
|
73
|
+
check(input: ReviseChaptersInput, items: readonly FrozenWorkItem[]): RevisionCampaignChapter[];
|
|
74
|
+
/** What recording the campaign does at once (pure). `running`: the plan is the run's, and what changes it waits for the run's next step. */
|
|
75
|
+
record(state: AutopilotState, campaign: RevisionCampaign, at: string, running: boolean): AutopilotState;
|
|
76
|
+
/** Begin the work of a chapter (mutates `state`). */
|
|
77
|
+
start(state: AutopilotState, chapter: PlannedChapter, item: RevisionCampaignChapter, campaign: RevisionCampaign, frozen: PlannerFrozen): CampaignStart;
|
|
78
|
+
/** Whether the work of a chapter that began is over. */
|
|
79
|
+
finished(state: AutopilotState, chapter: PlannedChapter): boolean;
|
|
80
|
+
/** Keep a chapter as it is, when the run does it (mutates). */
|
|
81
|
+
keep(state: AutopilotState, chapter: PlannedChapter, item: RevisionCampaignChapter): void;
|
|
82
|
+
/** What becomes of the chapters the author cancelled before they began (pure). */
|
|
83
|
+
cancel(state: AutopilotState, cancelled: readonly RevisionCampaignChapter[], at: string): AutopilotState;
|
|
84
|
+
/** A reason to stop the campaign before its next chapter (`null`: go on). The chapters that wait end as cancelled (and `cancel` says what becomes of them), and the words say why (`campaignStopped`'s detail). */
|
|
85
|
+
stop?(state: AutopilotState, campaign: RevisionCampaign, language: string): string | null;
|
|
86
|
+
/** After the last chapter (mutates). */
|
|
87
|
+
complete?(state: AutopilotState, campaign: RevisionCampaign): void;
|
|
88
|
+
/**
|
|
89
|
+
* Once no chapter waits or is being worked (and the author did not cancel the campaign): what comes next (`CampaignNext`; without this hook the campaign ends,
|
|
90
|
+
* said with `texts.done`). A reason with this hook says how it ended itself. Mutates `state` and `campaign`; every moment comes from `frozen.now`.
|
|
91
|
+
*/
|
|
92
|
+
afterChapters?(state: AutopilotState, campaign: RevisionCampaign, frozen: PlannerFrozen, report: (note: PlanNote) => void, language: string): CampaignNext;
|
|
93
|
+
/** A run starts: the campaign held for the author goes on, and what the reason counts since a run began starts again (mutates the campaign). */
|
|
94
|
+
resume?(state: AutopilotState, campaign: RevisionCampaign, at: string): void;
|
|
95
|
+
/** The codes of its insights about a chapter, when they are not the campaigns' (`campaignChapterDone`, `campaignSkipped`). */
|
|
96
|
+
codes?: {
|
|
97
|
+
chapterDone: AutopilotMessageCode;
|
|
98
|
+
skipped: AutopilotMessageCode;
|
|
99
|
+
};
|
|
100
|
+
/** The numbers of the insight about a chapter done. */
|
|
101
|
+
figures?(chapter: PlannedChapter, campaign: RevisionCampaign): AutopilotInsightFigures | undefined;
|
|
102
|
+
texts: {
|
|
103
|
+
chapterDone(number: number, done: number, total: number, language: string, context?: CampaignChapterContext): string;
|
|
104
|
+
skipped(number: number, why: NonNullable<RevisionCampaignChapter["why"]>, language: string): string;
|
|
105
|
+
done(worked: number, language: string): string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** The vote of a chapter: the director's when it was last closed (`score`), else the last vote of its rounds; `null` for a chapter nobody voted. */
|
|
109
|
+
export declare function chapterVote(chapter: Pick<PlannedChapter, "score" | "rounds">): number | null;
|
|
110
|
+
/**
|
|
111
|
+
* The votes of a review of the book now: over the chapters it may revise (`scope`), the lowest vote and the chapters under the target (a chapter nobody voted is
|
|
112
|
+
* under it: it has never been judged), and the vote of the book (the director's last judgement of the whole book).
|
|
113
|
+
*/
|
|
114
|
+
export declare function reviewVotes(state: Pick<AutopilotState, "plan" | "finalReview">, scope: readonly number[], target: number): ReviewVotes & {
|
|
115
|
+
chapters: number[];
|
|
116
|
+
};
|
|
117
|
+
/** The handlers of the reasons: the extension point of the campaigns. */
|
|
118
|
+
export declare const REVISION_REASON_HANDLERS: Readonly<Record<RevisionReason, RevisionReasonHandler>>;
|
|
119
|
+
/**
|
|
120
|
+
* What the author asks when the book is reviewed again (`AutopilotSession.reviewBook`): the target score (from 1 to 10), and what else the review is allowed:
|
|
121
|
+
* the rounds of review of a chapter (`maxRounds`, 1 to `REVIEW_MAX_ROUNDS`), the rounds the readers read again (`readerRounds`, 0 to `REVIEW_MAX_ROUNDS`: 0, they
|
|
122
|
+
* do not), the chapters of the author's to review too (`include`), and words for the director (`note`): these are the review's own. The caps are the options'
|
|
123
|
+
* own fields, which the review writes as the configuration would: the rounds of a review since a run began (`campaignMaxRounds`, `options.review`; 0: no limit),
|
|
124
|
+
* the money and token caps of the book (`budgetLimit`, `budgetTokens`; 0: none).
|
|
125
|
+
*/
|
|
126
|
+
export interface ReviewBookInput {
|
|
127
|
+
targetScore: number;
|
|
128
|
+
maxRounds?: number;
|
|
129
|
+
readerRounds?: number;
|
|
130
|
+
campaignMaxRounds?: number;
|
|
131
|
+
budgetLimit?: number;
|
|
132
|
+
budgetTokens?: number;
|
|
133
|
+
include?: number[];
|
|
134
|
+
note?: string;
|
|
135
|
+
}
|
|
136
|
+
/** Whether the book is finished: an approved plan whose chapters are all closed, and the director's judgement of the whole book. */
|
|
137
|
+
export declare function bookFinished(state: Pick<AutopilotState, "plan" | "finalDone">): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* The chapters of the author's in a book: frozen by the author by hand, or written before the autopilot (`imported`, and not frozen by the autopilot: once the
|
|
140
|
+
* book grows, the plan made again counts every written chapter as imported, and the freeze record still tells which the autopilot approved). A review of the
|
|
141
|
+
* book leaves them out unless the author includes them: the autopilot never rewrites them by its own decision.
|
|
142
|
+
*/
|
|
143
|
+
export declare function authorChapters(state: Pick<AutopilotState, "plan">, snapshot: Pick<BookSnapshot, "chapters">): Set<number>;
|
|
144
|
+
/** A review of the book from what the author asked, checked against the book now. Throws a `RevisionCampaignError`. */
|
|
145
|
+
export declare function createReviewCampaign(input: ReviewBookInput, state: AutopilotState, snapshot: BookSnapshot, now: Date, id?: string): RevisionCampaign;
|
|
146
|
+
/** A run starts: a campaign held for the author goes on, and what its reason counts since a run began starts again (pure). */
|
|
147
|
+
export declare function resumeCampaign(state: AutopilotState, at: string): AutopilotState;
|
|
148
|
+
/** A campaign from what the author asked, checked against what the book is now (`items`: `frozenWork`). Throws a `RevisionCampaignError`. */
|
|
149
|
+
export declare function createRevisionCampaign(input: ReviseChaptersInput, items: readonly FrozenWorkItem[], now: Date, id?: string): RevisionCampaign;
|
|
150
|
+
/** The state with a campaign recorded (pure): refused while another one goes on. */
|
|
151
|
+
export declare function recordRevisionCampaign(state: AutopilotState, campaign: RevisionCampaign, at: string, running: boolean): AutopilotState;
|
|
152
|
+
/**
|
|
153
|
+
* The state with the chapters of the campaign that wait cancelled (the one being worked finishes, and then the campaign ends: a campaign of rounds begins no other);
|
|
154
|
+
* the campaign goes once nothing of it is left to do. A limit it held the run for goes with it.
|
|
155
|
+
*/
|
|
156
|
+
export declare function cancelRevisionCampaign(state: AutopilotState, at: string): AutopilotState;
|
|
157
|
+
/**
|
|
158
|
+
* What advancing the state does with the campaign (`advanceState` calls it, after the decisions about changes): the chapters kept by the author while a run
|
|
159
|
+
* went on, the end of the chapter being worked, and, when the planner may start one (`frozen` is given) and nothing else is in progress, the next chapter
|
|
160
|
+
* that waits, in the order of the book (unless the reason says to stop). Once nothing waits or is being worked, the campaign is done, said once, and goes.
|
|
161
|
+
* Mutates `state`; deterministic (every moment comes from `frozen.now`).
|
|
162
|
+
*/
|
|
163
|
+
export declare function advanceRevisionCampaign(state: AutopilotState, report: (note: PlanNote) => void, language: string, frozen?: PlannerFrozen): void;
|
|
164
|
+
/** The chapter the campaign works now, while it is not closed again: it comes before the plan. */
|
|
165
|
+
export declare function campaignChapter(state: AutopilotState): PlannedChapter | undefined;
|
|
166
|
+
/** The campaigns' half of what the run merges when the author wrote the state during a step: the author's new campaign, and the chapters the author cancelled that had not begun. */
|
|
167
|
+
export declare function mergeCampaign(working: RevisionCampaign | undefined, base: RevisionCampaign | undefined, stored: RevisionCampaign | undefined): RevisionCampaign | undefined;
|
|
168
|
+
//# sourceMappingURL=campaign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.d.ts","sourceRoot":"","sources":["../../src/autopilot/campaign.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAA6G,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACpM,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,oBAAo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