narrarium-engine 0.1.22 → 0.1.24
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 +23 -6
- package/dist/autopilot/campaign.d.ts +72 -5
- package/dist/autopilot/campaign.d.ts.map +1 -1
- package/dist/autopilot/campaign.js +338 -36
- package/dist/autopilot/campaign.js.map +1 -1
- package/dist/autopilot/design.d.ts +77 -0
- package/dist/autopilot/design.d.ts.map +1 -0
- package/dist/autopilot/design.js +234 -0
- package/dist/autopilot/design.js.map +1 -0
- package/dist/autopilot/estimate-texts.d.ts +6 -0
- package/dist/autopilot/estimate-texts.d.ts.map +1 -1
- package/dist/autopilot/estimate-texts.js +20 -7
- package/dist/autopilot/estimate-texts.js.map +1 -1
- package/dist/autopilot/estimate.d.ts +36 -5
- package/dist/autopilot/estimate.d.ts.map +1 -1
- package/dist/autopilot/estimate.js +100 -35
- package/dist/autopilot/estimate.js.map +1 -1
- package/dist/autopilot/frozen.d.ts +8 -0
- package/dist/autopilot/frozen.d.ts.map +1 -1
- package/dist/autopilot/frozen.js +9 -1
- package/dist/autopilot/frozen.js.map +1 -1
- package/dist/autopilot/outline-check.d.ts +9 -0
- package/dist/autopilot/outline-check.d.ts.map +1 -1
- package/dist/autopilot/outline-check.js +16 -0
- package/dist/autopilot/outline-check.js.map +1 -1
- package/dist/autopilot/outline-compose.d.ts +3 -3
- package/dist/autopilot/outline-compose.d.ts.map +1 -1
- package/dist/autopilot/outline-compose.js +4 -4
- package/dist/autopilot/outline-compose.js.map +1 -1
- package/dist/autopilot/planner.d.ts +13 -11
- package/dist/autopilot/planner.d.ts.map +1 -1
- package/dist/autopilot/planner.js +105 -27
- package/dist/autopilot/planner.js.map +1 -1
- package/dist/autopilot/prompts.d.ts +18 -0
- package/dist/autopilot/prompts.d.ts.map +1 -1
- package/dist/autopilot/prompts.js +163 -0
- package/dist/autopilot/prompts.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.map +1 -1
- package/dist/autopilot/runner.js +39 -12
- package/dist/autopilot/runner.js.map +1 -1
- package/dist/autopilot/session.d.ts +9 -1
- package/dist/autopilot/session.d.ts.map +1 -1
- package/dist/autopilot/session.js +36 -2
- package/dist/autopilot/session.js.map +1 -1
- package/dist/autopilot/state.d.ts +19 -4
- package/dist/autopilot/state.d.ts.map +1 -1
- package/dist/autopilot/state.js +200 -8
- package/dist/autopilot/state.js.map +1 -1
- package/dist/autopilot/tasks.d.ts +3 -1
- package/dist/autopilot/tasks.d.ts.map +1 -1
- package/dist/autopilot/tasks.js +471 -78
- package/dist/autopilot/tasks.js.map +1 -1
- package/dist/autopilot/types.d.ts +252 -9
- package/dist/autopilot/types.d.ts.map +1 -1
- package/dist/autopilot/types.js +8 -1
- package/dist/autopilot/types.js.map +1 -1
- package/dist/book/design.d.ts +265 -0
- package/dist/book/design.d.ts.map +1 -0
- package/dist/book/design.js +632 -0
- package/dist/book/design.js.map +1 -0
- package/dist/book/outline.d.ts +20 -4
- package/dist/book/outline.d.ts.map +1 -1
- package/dist/book/outline.js +46 -9
- package/dist/book/outline.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 +10 -4
- package/dist/server/client.d.ts.map +1 -1
- package/dist/server/client.js +33 -12
- package/dist/server/client.js.map +1 -1
- package/dist/server/protocol.d.ts +35 -1
- package/dist/server/protocol.d.ts.map +1 -1
- package/dist/server/protocol.js +38 -0
- package/dist/server/protocol.js.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +67 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -290,4 +290,167 @@ export const IMPACT_TOOL = {
|
|
|
290
290
|
required: ["summary", "targets"],
|
|
291
291
|
},
|
|
292
292
|
};
|
|
293
|
+
// ─── The design of a book (`AutopilotDesign`) ───────────────────────────────
|
|
294
|
+
//
|
|
295
|
+
// The prompts and the schemas of a design run: the steps are the autopilot's own (concept, plan, readers, director), each with its configured personality (the
|
|
296
|
+
// director's profile, the readers' panel, the book's ghostwriter), and a role for the design of a book that is not written yet. Every reviewer must contest as well
|
|
297
|
+
// as judge: a counter-proposal is part of every reply.
|
|
298
|
+
const chapterNote = { type: "object", properties: { chapter: { type: "number" }, note: string }, required: ["chapter", "note"] };
|
|
299
|
+
const conceptProperties = CONCEPT_TOOL.parameters.properties;
|
|
300
|
+
const conceptCharacter = conceptProperties.characters.items;
|
|
301
|
+
const conceptSecret = conceptProperties.secrets.items;
|
|
302
|
+
/** The foundation of a design: the concept's, with the relationships of the cast, the items that matter, the rules of the world and what each secret misleads and changes. */
|
|
303
|
+
export const DESIGN_CONCEPT_TOOL = {
|
|
304
|
+
name: "design_concept",
|
|
305
|
+
description: "Return the foundation of the design of the novel: story design, world frame and rules, cast with arcs and relationships, places, factions, items and secrets.",
|
|
306
|
+
parameters: {
|
|
307
|
+
type: "object",
|
|
308
|
+
properties: {
|
|
309
|
+
...conceptProperties,
|
|
310
|
+
characters: {
|
|
311
|
+
type: "array",
|
|
312
|
+
items: {
|
|
313
|
+
type: "object",
|
|
314
|
+
properties: { ...conceptCharacter.properties, relationships: { ...strings, description: "How the character stands with the others, a line each (\"Elio: owes her his life, and hides it\")." } },
|
|
315
|
+
required: [...conceptCharacter.required, "relationships"],
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
items: { type: "array", items: { type: "object", properties: { name: string, description: string, significance: { ...string, description: "Why it matters to the story." } }, required: ["name", "description", "significance"] } },
|
|
319
|
+
worldRules: { ...strings, description: "The rules of the world the story must never break, a line each: how things work, what is possible and what is not." },
|
|
320
|
+
secrets: {
|
|
321
|
+
type: "array",
|
|
322
|
+
items: {
|
|
323
|
+
type: "object",
|
|
324
|
+
properties: {
|
|
325
|
+
...conceptSecret.properties,
|
|
326
|
+
redHerrings: { ...strings, description: "The false trails that will mislead the reader." },
|
|
327
|
+
consequences: { ...strings, description: "What the reveal changes in the story and for the characters." },
|
|
328
|
+
},
|
|
329
|
+
required: [...conceptSecret.required, "consequences"],
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
required: [...CONCEPT_TOOL.parameters.required, "items", "worldRules"],
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
/** The fields of the design of one chapter (`OutlineChapterDesign`), as the model writes them. */
|
|
337
|
+
const chapterDesign = {
|
|
338
|
+
type: "object",
|
|
339
|
+
properties: {
|
|
340
|
+
goal: { ...string, description: "The narrative goal: why the chapter exists in the book." },
|
|
341
|
+
pov: { ...strings, description: "Point-of-view character names." },
|
|
342
|
+
characters: { ...strings, description: "The characters on stage." },
|
|
343
|
+
setting: { ...string, description: "Where it happens (a place of the canon when there is one)." },
|
|
344
|
+
time: { ...string, description: "When it happens: its place in the time of the story." },
|
|
345
|
+
events: { ...strings, description: "The main events, in order." },
|
|
346
|
+
scenes: { ...strings, description: "The scenes it should have, one line each (2 to 4)." },
|
|
347
|
+
conflicts: strings,
|
|
348
|
+
emotions: { ...string, description: "How the characters change inside through the chapter." },
|
|
349
|
+
reveals: { ...strings, description: "What the reader learns here; name a secret by its exact title when it is revealed." },
|
|
350
|
+
withholds: { ...strings, description: "What is deliberately kept from the reader." },
|
|
351
|
+
clues: { ...strings, description: "Clues and foreshadowing planted here." },
|
|
352
|
+
previous: { ...string, description: "What it picks up from the chapters before." },
|
|
353
|
+
next: { ...string, description: "What it sets up for the chapters after." },
|
|
354
|
+
ending: { ...string, description: "How the chapter closes." },
|
|
355
|
+
cliffhanger: { type: "boolean", description: "Whether it closes on a cliffhanger." },
|
|
356
|
+
notes: { ...string, description: "Notes for the ghostwriter who will write it: what to stress, what to avoid." },
|
|
357
|
+
},
|
|
358
|
+
required: ["goal", "pov", "characters", "setting", "time", "events", "scenes", "conflicts", "emotions", "reveals", "withholds", "clues", "previous", "next", "ending", "cliffhanger", "notes"],
|
|
359
|
+
};
|
|
360
|
+
/** The design of a batch of chapters (no prose), and where the secrets fall in it. */
|
|
361
|
+
export const DESIGN_PLAN_TOOL = {
|
|
362
|
+
name: "chapter_design",
|
|
363
|
+
description: "Return the design of the chapters of the novel (never their prose) and the ledger of the secrets in these chapters.",
|
|
364
|
+
parameters: {
|
|
365
|
+
type: "object",
|
|
366
|
+
properties: {
|
|
367
|
+
chapters: {
|
|
368
|
+
type: "array",
|
|
369
|
+
items: {
|
|
370
|
+
type: "object",
|
|
371
|
+
properties: {
|
|
372
|
+
number: { type: "number" },
|
|
373
|
+
title: string,
|
|
374
|
+
summary: { ...string, description: "What happens, in 2-4 sentences." },
|
|
375
|
+
design: chapterDesign,
|
|
376
|
+
},
|
|
377
|
+
required: ["number", "title", "summary", "design"],
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
secrets: {
|
|
381
|
+
type: "array",
|
|
382
|
+
description: "The ledger of every secret that has something in these chapters.",
|
|
383
|
+
items: {
|
|
384
|
+
type: "object",
|
|
385
|
+
properties: {
|
|
386
|
+
title: { ...string, description: "The exact title of the secret." },
|
|
387
|
+
revealChapter: { type: "number", description: "The chapter where the reader learns the truth (0 when it is revealed outside these chapters)." },
|
|
388
|
+
learnedBy: { type: "array", items: { type: "object", properties: { character: string, chapter: { type: "number" } }, required: ["character", "chapter"] }, description: "Who learns it in these chapters, and where." },
|
|
389
|
+
readerKnows: { type: "array", items: chapterNote, description: "What the reader knows of it at each of these chapters where that changes." },
|
|
390
|
+
clues: { type: "array", items: chapterNote, description: "The clues planted in these chapters." },
|
|
391
|
+
redHerrings: { type: "array", items: chapterNote, description: "The false trails planted in these chapters." },
|
|
392
|
+
},
|
|
393
|
+
required: ["title", "revealChapter", "learnedBy", "readerKnows", "clues", "redHerrings"],
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
required: ["chapters", "secrets"],
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
const reactionProperties = PLAN_REACTION_TOOL.parameters.properties;
|
|
401
|
+
/** A reader's reaction to a design: the plan's, with what falls flat and the reader's own proposal. */
|
|
402
|
+
export const DESIGN_REACTION_TOOL = {
|
|
403
|
+
name: "design_reaction",
|
|
404
|
+
description: "React, as the configured reader, to the design of a novel not written yet.",
|
|
405
|
+
parameters: {
|
|
406
|
+
type: "object",
|
|
407
|
+
properties: {
|
|
408
|
+
...reactionProperties,
|
|
409
|
+
weakSpots: { ...strings, description: "What is predictable, inconsistent, superfluous or dull, chapter by chapter (\"Chapter 4: …\")." },
|
|
410
|
+
counterProposal: { ...string, description: "A concrete alternative you would prefer to the weakest part: never empty." },
|
|
411
|
+
},
|
|
412
|
+
required: [...PLAN_REACTION_TOOL.parameters.required, "weakSpots", "counterProposal"],
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
const reviewProperties = PLAN_REVIEW_TOOL.parameters.properties;
|
|
416
|
+
/** The director's review of a design: the plan's, with the critical inconsistencies and the devil's advocate. */
|
|
417
|
+
export const DESIGN_REVIEW_TOOL = {
|
|
418
|
+
name: "design_review",
|
|
419
|
+
description: "Review the design of the novel before any prose is written.",
|
|
420
|
+
parameters: {
|
|
421
|
+
type: "object",
|
|
422
|
+
properties: {
|
|
423
|
+
...reviewProperties,
|
|
424
|
+
critical: {
|
|
425
|
+
type: "array",
|
|
426
|
+
description: "Every critical inconsistency still in the design (a contradiction, a plot hole, an impossible knowledge, a premature reveal, a mystery without a resolution). Empty when there is none.",
|
|
427
|
+
items: { type: "object", properties: { chapterNumber: { type: "number" }, issue: string }, required: ["issue"] },
|
|
428
|
+
},
|
|
429
|
+
counterProposal: { ...string, description: "Devil's advocate: the strongest alternative to the weakest part of the design, before you decide." },
|
|
430
|
+
},
|
|
431
|
+
required: [...PLAN_REVIEW_TOOL.parameters.required, "critical", "counterProposal"],
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
/** The role of the architect in a design run: the Brainstormer of the writers' room. */
|
|
435
|
+
export const DESIGN_ARCHITECT_ROLE = [
|
|
436
|
+
"This is the design of the book, before any prose: you are the brainstormer of a writers' room. Develop the author's idea into a complete, coherent, original and engaging design.",
|
|
437
|
+
"Propose, do not only confirm: when a better narrative choice exists, take it and say why. Every secret needs a truth, clues before its reveal, a reveal chapter and consequences; every setup needs a payoff.",
|
|
438
|
+
"Never write the prose of a chapter: only what a writer needs to write it later.",
|
|
439
|
+
].join("\n");
|
|
440
|
+
/** The role of a simulated reader reading a design: the reader keeps the personality of the panel. */
|
|
441
|
+
export const DESIGN_READER_ROLE = [
|
|
442
|
+
"You are reading the design of a novel that is not written yet: the pitch, the cast, the world, the secrets and the design of every chapter.",
|
|
443
|
+
"React as this reader would: engagement, originality, pace, suspense, credibility, emotional impact. Point out what is predictable, inconsistent, superfluous or dull.",
|
|
444
|
+
"Do not merely agree: you must make at least one concrete counter-proposal.",
|
|
445
|
+
].join("\n");
|
|
446
|
+
/** The director's instructions for a review of a design. */
|
|
447
|
+
export const DESIGN_DIRECTOR_RULES = [
|
|
448
|
+
"Play devil's advocate before you decide: name the strongest alternative to the weakest part of the design (counterProposal).",
|
|
449
|
+
"A score alone never approves: list every critical inconsistency still in the design (critical), and approve only when none is left. Every critical inconsistency becomes a change, chapter by chapter.",
|
|
450
|
+
"Weigh the DESIGN CHECKS: they are found without a model and may be noise; act on the real ones.",
|
|
451
|
+
];
|
|
452
|
+
/** What a design asks of every chapter. */
|
|
453
|
+
export const DESIGN_CHAPTER_RULE = "For every chapter give its summary and its design: the narrative goal, the point of view, the characters on stage, the setting and the time, the main events, the planned scenes (2 to 4, a line each), the conflicts, the emotional evolution, what the reader learns, what stays hidden, the clues planted, what it picks up and what it sets up, how it ends (and whether on a cliffhanger), and notes for the ghostwriter. Never write the prose.";
|
|
454
|
+
/** What a design asks of the secrets, batch by batch. */
|
|
455
|
+
export const DESIGN_LEDGER_RULE = "For every secret that has something in these chapters, give its ledger for these chapters: who learns it and where, what the reader knows chapter by chapter, the clues and the red herrings planted, and the reveal chapter. Every secret needs clues before its reveal; nobody acts on a secret before learning it; no reveal comes before its chapter.";
|
|
293
456
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/autopilot/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAW,CAAC;AAC3C,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAW,CAAC;AAEtE,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,OAAO;QACL,sOAAsO;QACtO,+JAA+J;QAC/J,6BAA6B,YAAY,CAAC,QAAQ,CAAC,GAAG;KACvD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO;QACL,kFAAkF,YAAY,CAAC,QAAQ,CAAC,GAAG;QAC3G,8FAA8F;QAC9F,iGAAiG;QACjG,kFAAkF;QAClF,0FAA0F;QAC1F,2DAA2D;QAC3D,iHAAiH;KAClH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO;QACL,8LAA8L;QAC9L,8KAA8K;QAC9K,yHAAyH;QACzH,iEAAiE;QACjE,6BAA6B,YAAY,CAAC,QAAQ,C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,GAAG,gBAAgB;YACnB,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,yLAAyL;gBACtM,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;aACjH;YACD,eAAe,EAAE,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,mGAAmG,EAAE;SACjJ;QACD,QAAQ,EAAE,CAAC,GAAI,gBAAgB,CAAC,UAAU,CAAC,QAAqB,EAAE,UAAU,EAAE,iBAAiB,CAAC;KACjG;CACF,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mLAAmL;IACnL,+MAA+M;IAC/M,iFAAiF;CAClF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,sGAAsG;AACtG,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,6IAA6I;IAC7I,uKAAuK;IACvK,4EAA4E;CAC7E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,4DAA4D;AAC5D,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,8HAA8H;IAC9H,wMAAwM;IACxM,iGAAiG;CAClG,CAAC;AAEF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,ubAAub,CAAC;AAE3d,yDAAyD;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,2VAA2V,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DirectorProfile } from "../profiles/director.js";
|
|
2
|
+
import { type AutopilotState, type ReviewPolicy } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* How the chapters and the book are reviewed (`ReviewPolicy`): the vote they must reach, the rounds of review of a chapter, the rounds the simulated readers
|
|
5
|
+
* read in, the rounds a review of the book makes before it waits for the author. The director's profile gives the defaults (its approval score, its rounds);
|
|
6
|
+
* the run's options (`options.review`) say otherwise for a run, and a review of the book launched later (`state.campaign.review`) for itself. One place says
|
|
7
|
+
* which wins, for the planner and the tasks alike. Pure.
|
|
8
|
+
*/
|
|
9
|
+
/** The policy as the options keep it: each value in its range, a value that is not a number left out; `null` (or nothing usable) is no policy. */
|
|
10
|
+
export declare function normalizeReviewPolicy(value: unknown, base?: ReviewPolicy): ReviewPolicy | undefined;
|
|
11
|
+
type PolicyState = Pick<AutopilotState, "options"> & Partial<Pick<AutopilotState, "campaign">>;
|
|
12
|
+
/** The vote a chapter and the book must reach: the review of the book in progress, else the run's policy, else the director's approval score. */
|
|
13
|
+
export declare function reviewTarget(state: PolicyState, director: Pick<DirectorProfile, "approvalScore">): number;
|
|
14
|
+
/** The rounds of review of a chapter before it is closed anyway: the review of the book in progress, else the run's policy, else the director's. */
|
|
15
|
+
export declare function reviewMaxRounds(state: PolicyState, director: Pick<DirectorProfile, "maxReviewRounds">): number;
|
|
16
|
+
/**
|
|
17
|
+
* In how many of the first rounds of a chapter's review the simulated readers read it (when they read at all, `options.readers`): the review of the book in
|
|
18
|
+
* progress (0: they do not read again), else the run's policy, else 1 (the first round only, as it always was).
|
|
19
|
+
*/
|
|
20
|
+
export declare function reviewReaderRounds(state: PolicyState): number;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=review-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-policy.d.ts","sourceRoot":"","sources":["../../src/autopilot/review-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAiD,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnH;;;;;GAKG;AAEH,kJAAkJ;AAClJ,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,CAmBnG;AAED,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;AAO/F,iJAAiJ;AACjJ,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,GAAG,MAAM,CAEzG;AAED,oJAAoJ;AACpJ,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,GAAG,MAAM,CAE9G;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { clampNumber, numericValue } from "../profiles/read.js";
|
|
2
|
+
import { REVIEW_MAX_CAMPAIGN_ROUNDS, REVIEW_MAX_ROUNDS } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* How the chapters and the book are reviewed (`ReviewPolicy`): the vote they must reach, the rounds of review of a chapter, the rounds the simulated readers
|
|
5
|
+
* read in, the rounds a review of the book makes before it waits for the author. The director's profile gives the defaults (its approval score, its rounds);
|
|
6
|
+
* the run's options (`options.review`) say otherwise for a run, and a review of the book launched later (`state.campaign.review`) for itself. One place says
|
|
7
|
+
* which wins, for the planner and the tasks alike. Pure.
|
|
8
|
+
*/
|
|
9
|
+
/** The policy as the options keep it: each value in its range, a value that is not a number left out; `null` (or nothing usable) is no policy. */
|
|
10
|
+
export function normalizeReviewPolicy(value, base) {
|
|
11
|
+
if (value === null)
|
|
12
|
+
return undefined;
|
|
13
|
+
const source = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
14
|
+
const pick = (key, min, max, decimals) => {
|
|
15
|
+
if (source[key] === null)
|
|
16
|
+
return undefined;
|
|
17
|
+
const read = numericValue(source[key]);
|
|
18
|
+
if (read !== undefined)
|
|
19
|
+
return clampNumber(read, min, max, decimals);
|
|
20
|
+
return base?.[key];
|
|
21
|
+
};
|
|
22
|
+
const policy = {};
|
|
23
|
+
const targetScore = pick("targetScore", 1, 10, 1);
|
|
24
|
+
const maxRounds = pick("maxRounds", 1, REVIEW_MAX_ROUNDS, 0);
|
|
25
|
+
const readerRounds = pick("readerRounds", 1, REVIEW_MAX_ROUNDS, 0);
|
|
26
|
+
const campaignMaxRounds = pick("campaignMaxRounds", 0, REVIEW_MAX_CAMPAIGN_ROUNDS, 0);
|
|
27
|
+
if (targetScore !== undefined)
|
|
28
|
+
policy.targetScore = targetScore;
|
|
29
|
+
if (maxRounds !== undefined)
|
|
30
|
+
policy.maxRounds = maxRounds;
|
|
31
|
+
if (readerRounds !== undefined)
|
|
32
|
+
policy.readerRounds = readerRounds;
|
|
33
|
+
if (campaignMaxRounds)
|
|
34
|
+
policy.campaignMaxRounds = campaignMaxRounds;
|
|
35
|
+
return Object.keys(policy).length ? policy : undefined;
|
|
36
|
+
}
|
|
37
|
+
/** The review of the book in progress, when there is one: its policy wins over the run's. */
|
|
38
|
+
function reviewInProgress(state) {
|
|
39
|
+
return state.campaign?.reason === "review-target" ? state.campaign.review : undefined;
|
|
40
|
+
}
|
|
41
|
+
/** The vote a chapter and the book must reach: the review of the book in progress, else the run's policy, else the director's approval score. */
|
|
42
|
+
export function reviewTarget(state, director) {
|
|
43
|
+
return reviewInProgress(state)?.targetScore ?? state.options.review?.targetScore ?? director.approvalScore;
|
|
44
|
+
}
|
|
45
|
+
/** The rounds of review of a chapter before it is closed anyway: the review of the book in progress, else the run's policy, else the director's. */
|
|
46
|
+
export function reviewMaxRounds(state, director) {
|
|
47
|
+
return reviewInProgress(state)?.maxRounds ?? state.options.review?.maxRounds ?? director.maxReviewRounds;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* In how many of the first rounds of a chapter's review the simulated readers read it (when they read at all, `options.readers`): the review of the book in
|
|
51
|
+
* progress (0: they do not read again), else the run's policy, else 1 (the first round only, as it always was).
|
|
52
|
+
*/
|
|
53
|
+
export function reviewReaderRounds(state) {
|
|
54
|
+
return reviewInProgress(state)?.readerRounds ?? state.options.review?.readerRounds ?? 1;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=review-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-policy.js","sourceRoot":"","sources":["../../src/autopilot/review-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAA0C,MAAM,YAAY,CAAC;AAEnH;;;;;GAKG;AAEH,kJAAkJ;AAClJ,MAAM,UAAU,qBAAqB,CAAC,KAAc,EAAE,IAAmB;IACvE,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,MAAM,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAgC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnH,MAAM,IAAI,GAAG,CAAC,GAAuB,EAAE,GAAW,EAAE,GAAW,EAAE,QAAgB,EAAsB,EAAE;QACvG,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI;YAAE,OAAO,SAAS,CAAC;QAC3C,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACvC,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrE,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;IACF,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,MAAM,WAAW,GA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AAkD;IACpG,OAAO,gBAAgB,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,IAAI,QAAQ,CAAC,eAAe,CAAC;AAC3G,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAkB;IACnD,OAAO,gBAAgB,CAAC,KAAK,CAAC,EAAE,YAAY,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/autopilot/runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,MAAM,EAAkE,MAAM,gBAAgB,CAAC;AAKpJ,OAAO,EAA4D,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAUjI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/autopilot/runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,MAAM,EAAkE,MAAM,gBAAgB,CAAC;AAKpJ,OAAO,EAA4D,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAUjI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAStE,OAAO,EAAoG,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBrJ,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGvB,KAAK,sBAAsB,EAG3B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAEvB,KA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;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAcpJ,+GAA+G;IAC/G,IAAI,aAAa,IAAI,MAAM,GAAG,IAAI,CAEjC;IAED,yJAAyJ;IACzJ,OAAO,CAAC,SAAS;IAOjB,iJAAiJ;IACjJ,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAOzC,oIAAoI;IACpI,SAAS,IAAI,IAAI;IAMjB,0KAA0K;IAC1K,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,IAAI;YAQE,WAAW;IAsBzB,OAAO,CAAC,QAAQ;IAMhB;;;;OAIG;YACW,eAAe;IAyB7B,OAAO,CAAC,UAAU;IAMlB,4IAA4I;IAC5I,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,eAAe;IAKvB,oHAAoH;YACtG,aAAa;IAM3B,OAAO,CAAC,gBAAgB;IAKxB;;;;OAIG;YACW,gBAAgB;IAwB9B,4FAA4F;YAC9E,eAAe;IAKvB,OAAO,CAAC,KAAK,GAAE,YAAY,GAAG;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IA4D7F,iGAAiG;YACnF,QAAQ;IA8ftB;;;;;;OAMG;YACW,UAAU;IAgCxB,2IAA2I;IAC3I,OAAO,CAAC,SAAS;IAKjB,+EAA+E;IAC/E,OAAO,CAAC,SAAS;IAMjB;;;OAGG;YACW,cAAc;IA4B5B;;;OAGG;IACH,yIAAyI;IACzI,OAAO,CAAC,UAAU;YAMJ,MAAM;CA8CrB"}
|
package/dist/autopilot/runner.js
CHANGED
|
@@ -15,9 +15,10 @@ import { describeErrorBody, suggestsResponsesApi } from "../ai/provider-error.js
|
|
|
15
15
|
import { attemptInfoOf } from "./attempt.js";
|
|
16
16
|
import { autopilotErrorFields } from "./errors.js";
|
|
17
17
|
import { readBrief } from "./brief.js";
|
|
18
|
-
import { applyFrozenDecision, campaignGoesOn, frozenAnswerAction, isFrozenQuestion, settleFrozenChanges } from "./frozen.js";
|
|
19
|
-
import { mergeCampaign } from "./campaign.js";
|
|
18
|
+
import { applyFrozenDecision, authorHeldChapters, campaignGoesOn, frozenAnswerAction, isFrozenQuestion, settleFrozenChanges } from "./frozen.js";
|
|
19
|
+
import { mergeCampaign, resumeCampaign } from "./campaign.js";
|
|
20
20
|
import { outlinePlanStatus } from "./outline-check.js";
|
|
21
|
+
import { beginDesign, designPlaceholderChanges, endDesign, normalizeDesignStart } from "./design.js";
|
|
21
22
|
import { advanceState, bookChapters, extensionNote, nextStep, phaseOf } from "./planner.js";
|
|
22
23
|
import { profileProblems, profileProblemsMessage, profileProblemsTitle } from "./profile-check.js";
|
|
23
24
|
import { MAX_INTERVENTIONS, MAX_REVISION_NOTES, capConstraints, createAutopilotState, effectivePublish, hostDefaultPublish, inspectAutopilotState, normalizeOptions, normalizeRuleText, normalizeRunLimits, parseActivityLog, pendingNotes, serializeActivityLog, serializeAutopilotState, summarizeAutopilotState, withoutStopCause, } from "./state.js";
|
|
@@ -841,7 +842,7 @@ export class AutopilotRun {
|
|
|
841
842
|
if (this.reported.has(note.key))
|
|
842
843
|
return;
|
|
843
844
|
this.reported.add(note.key);
|
|
844
|
-
this.emit({ type: "insight", tone: note.tone, title: note.title, ...(note.detail ? { detail: note.detail } : {}), ...(note.code ? { code: note.code } : {}), ...(note.chapterNumber !== undefined ? { chapterNumber: note.chapterNumber } : {}) });
|
|
845
|
+
this.emit({ type: "insight", tone: note.tone, title: note.title, ...(note.detail ? { detail: note.detail } : {}), ...(note.code ? { code: note.code } : {}), ...(note.chapterNumber !== undefined ? { chapterNumber: note.chapterNumber } : {}), ...(note.figures ? { figures: note.figures } : {}) });
|
|
845
846
|
}
|
|
846
847
|
/**
|
|
847
848
|
* Waits before a retry, and says how the wait ended (`RetryWaitOutcome`): `stopped` when a pause ended it (or came before it; a pause at the end
|
|
@@ -953,14 +954,18 @@ export class AutopilotRun {
|
|
|
953
954
|
async execute(start = {}) {
|
|
954
955
|
const { store } = this;
|
|
955
956
|
this.limits = normalizeRunLimits(start.limits) ?? {};
|
|
957
|
+
// A design that is not one is refused before anything is read or written.
|
|
958
|
+
const design = normalizeDesignStart(start.design);
|
|
956
959
|
const stored = await readStoredAutopilot(store);
|
|
957
960
|
assertStoredStateReadable(stored);
|
|
958
961
|
const { brief, changes: briefChanges } = await readBrief(store, stored.state);
|
|
959
962
|
let state = stored.state ?? createAutopilotState(this.now(), brief, start.options);
|
|
960
963
|
const startedAt = this.now().toISOString();
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
+
// A run that starts is nobody's pause any more: what the server said of its stop goes, and so does the limit that stopped it (one still reached stops it
|
|
965
|
+
// again, before its first step); a campaign held for the author goes on, and the rounds of a review it allows are counted again from here.
|
|
966
|
+
const { limitReached: _limit, ...fresh } = resumeCampaign(withoutStopCause(state), startedAt);
|
|
967
|
+
let next = {
|
|
968
|
+
...fresh,
|
|
964
969
|
brief,
|
|
965
970
|
options: normalizeOptions(start.options ?? {}, state.options),
|
|
966
971
|
plan: state.plan ? { ...state.plan, awaitingAuthor: false } : null,
|
|
@@ -968,9 +973,24 @@ export class AutopilotRun {
|
|
|
968
973
|
message: null,
|
|
969
974
|
lastError: null,
|
|
970
975
|
runner: { host: this.config.host, label: this.config.hostLabel, ...(this.config.hostId ? { hostId: this.config.hostId } : {}), runId: this.runId, startedAt, heartbeatAt: startedAt },
|
|
971
|
-
}
|
|
976
|
+
};
|
|
977
|
+
let outlineChapters = await this.outlineChapters();
|
|
978
|
+
// A design run (`StartOptions.design`): it begins (or goes on with what the start says now), the Synopsis gets the empty entries of the chapters it lacks; `false` ends it.
|
|
979
|
+
const designChanges = [];
|
|
980
|
+
if (design) {
|
|
981
|
+
const language = await loadBookSnapshot(store, this.cache).then((snapshot) => languageCode(snapshot.book.language), () => this.language);
|
|
982
|
+
const begun = beginDesign(next, design, { now: startedAt, outlineChapters, idea: brief.idea, language });
|
|
983
|
+
next = begun.state;
|
|
984
|
+
designChanges.push(...designPlaceholderChanges(outlineChapters, begun.chapters));
|
|
985
|
+
outlineChapters = Math.max(outlineChapters, begun.chapters);
|
|
986
|
+
}
|
|
987
|
+
else if (design === false && next.design && !next.design.endedAt) {
|
|
988
|
+
next = structuredClone(next);
|
|
989
|
+
endDesign(next, "author", startedAt);
|
|
990
|
+
}
|
|
991
|
+
state = extendPlanIfNeeded(next, outlineChapters);
|
|
972
992
|
state = stampState(this.drainQueue(state, "start"), this.now());
|
|
973
|
-
await store.commit([...briefChanges, stateChange(state, stored.stateHash)], "Autopilot: started");
|
|
993
|
+
await store.commit([...briefChanges, ...designChanges, stateChange(state, stored.stateHash)], "Autopilot: started");
|
|
974
994
|
this.known = state;
|
|
975
995
|
this.emit({ type: "run-started", runId: this.runId, host: this.config.host });
|
|
976
996
|
this.emit({ type: "state", state: this.summarize(state) });
|
|
@@ -1072,7 +1092,8 @@ export class AutopilotRun {
|
|
|
1072
1092
|
for (const note of settled.notes)
|
|
1073
1093
|
this.announce(note);
|
|
1074
1094
|
this.frozenWaitingCount = settled.waiting;
|
|
1075
|
-
|
|
1095
|
+
// A review of the book leaves the author's chapters to the author: it learns which they are now.
|
|
1096
|
+
context.planner.frozen = { outlineWritten: outlineStatus.written, now: at, ...(settled.state.campaign?.review ? authorHeldChapters(snapshot) : {}) };
|
|
1076
1097
|
// A decision about a change may start now (the chapter goes back to review, before the plan). Advancing is idempotent: it is done
|
|
1077
1098
|
// again only when there is something new for it.
|
|
1078
1099
|
if (settled.state !== state || settled.state.pendingReviews?.some((entry) => !entry.started) || campaignGoesOn(settled.state))
|
|
@@ -1084,7 +1105,7 @@ export class AutopilotRun {
|
|
|
1084
1105
|
step = nextStep(state, context.planner);
|
|
1085
1106
|
}
|
|
1086
1107
|
if (step.kind === "stop") {
|
|
1087
|
-
state = await this.finish(state, step.status, step.message);
|
|
1108
|
+
state = await this.finish(state, step.status, step.message, step.code);
|
|
1088
1109
|
break;
|
|
1089
1110
|
}
|
|
1090
1111
|
const italian = isItalian(context.planner.language);
|
|
@@ -1106,12 +1127,17 @@ export class AutopilotRun {
|
|
|
1106
1127
|
state = await this.finish(state, "waiting-author", profileProblemsMessage(problems, context.planner.language));
|
|
1107
1128
|
break;
|
|
1108
1129
|
}
|
|
1130
|
+
// The caps of the book: what it spent in all its runs (`stats`, never set back by a restart) against the caps of the options. The stop says the numbers.
|
|
1109
1131
|
if (state.options.budgetLimit > 0 && state.stats.cost >= state.options.budgetLimit) {
|
|
1110
|
-
|
|
1132
|
+
const limit = { kind: "money", used: state.stats.cost, limit: state.options.budgetLimit, ...(state.stats.currency ? { currency: state.stats.currency } : {}), at: this.now().toISOString() };
|
|
1133
|
+
this.emit({ type: "insight", tone: "warning", code: "budgetReached", title: italian ? "Budget raggiunto: alza il limite per continuare." : "Budget reached: raise the limit to continue.", figures: { used: limit.used, limit: limit.limit, ...(limit.currency ? { currency: limit.currency } : {}) } });
|
|
1134
|
+
state = await this.finish({ ...state, limitReached: limit }, "paused", italian ? "Budget raggiunto: alza il limite per continuare." : "Budget reached: raise the limit to continue.", "budgetReached");
|
|
1111
1135
|
break;
|
|
1112
1136
|
}
|
|
1113
1137
|
if ((state.options.budgetTokens ?? 0) > 0 && state.stats.inputTokens + state.stats.outputTokens >= (state.options.budgetTokens ?? 0)) {
|
|
1114
|
-
|
|
1138
|
+
const limit = { kind: "tokens", used: state.stats.inputTokens + state.stats.outputTokens, limit: state.options.budgetTokens ?? 0, at: this.now().toISOString() };
|
|
1139
|
+
this.emit({ type: "insight", tone: "warning", code: "tokenBudgetReached", title: italian ? "Budget di token raggiunto: alza il limite per continuare." : "Token budget reached: raise the limit to continue.", figures: { used: limit.used, limit: limit.limit } });
|
|
1140
|
+
state = await this.finish({ ...state, limitReached: limit }, "paused", italian ? "Budget di token raggiunto: alza il limite per continuare." : "Token budget reached: raise the limit to continue.", "tokenBudgetReached");
|
|
1115
1141
|
break;
|
|
1116
1142
|
}
|
|
1117
1143
|
task = step.task;
|
|
@@ -1297,6 +1323,7 @@ export class AutopilotRun {
|
|
|
1297
1323
|
...(extra?.code ? { code: extra.code } : {}),
|
|
1298
1324
|
...(extra?.chapterNumber !== undefined ? { chapterNumber: extra.chapterNumber } : {}),
|
|
1299
1325
|
...(extra?.ghostwriter ? { ghostwriter: extra.ghostwriter } : {}),
|
|
1326
|
+
...(extra?.figures ? { figures: extra.figures } : {}),
|
|
1300
1327
|
}),
|
|
1301
1328
|
evaluationStyle: context.evaluationStyle,
|
|
1302
1329
|
outline: context.outline,
|