agent-nuvira 3.1.3 → 3.2.0

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.
Files changed (146) hide show
  1. package/dist/agents/agents/reasoner.d.ts +8 -0
  2. package/dist/agents/agents/reasoner.d.ts.map +1 -1
  3. package/dist/agents/agents/reasoner.js +53 -2
  4. package/dist/agents/agents/reasoner.js.map +1 -1
  5. package/dist/agents/agents/writer.d.ts +24 -0
  6. package/dist/agents/agents/writer.d.ts.map +1 -1
  7. package/dist/agents/agents/writer.js +194 -0
  8. package/dist/agents/agents/writer.js.map +1 -1
  9. package/dist/agents/composite-plan.d.ts +143 -0
  10. package/dist/agents/composite-plan.d.ts.map +1 -0
  11. package/dist/agents/composite-plan.js +399 -0
  12. package/dist/agents/composite-plan.js.map +1 -0
  13. package/dist/agents/long-form-plan.d.ts +156 -0
  14. package/dist/agents/long-form-plan.d.ts.map +1 -0
  15. package/dist/agents/long-form-plan.js +274 -0
  16. package/dist/agents/long-form-plan.js.map +1 -0
  17. package/dist/agents/orchestrator.d.ts +107 -0
  18. package/dist/agents/orchestrator.d.ts.map +1 -1
  19. package/dist/agents/orchestrator.js +501 -35
  20. package/dist/agents/orchestrator.js.map +1 -1
  21. package/dist/agents/prompt-assembly.d.ts +8 -0
  22. package/dist/agents/prompt-assembly.d.ts.map +1 -1
  23. package/dist/agents/prompt-assembly.js +17 -0
  24. package/dist/agents/prompt-assembly.js.map +1 -1
  25. package/dist/cli/chat.d.ts +27 -0
  26. package/dist/cli/chat.d.ts.map +1 -1
  27. package/dist/cli/chat.js +116 -6
  28. package/dist/cli/chat.js.map +1 -1
  29. package/dist/cli/execute.d.ts +12 -0
  30. package/dist/cli/execute.d.ts.map +1 -1
  31. package/dist/cli/execute.js +105 -2
  32. package/dist/cli/execute.js.map +1 -1
  33. package/dist/cli/models.d.ts.map +1 -1
  34. package/dist/cli/models.js +10 -0
  35. package/dist/cli/models.js.map +1 -1
  36. package/dist/cli/trace.d.ts.map +1 -1
  37. package/dist/cli/trace.js +27 -0
  38. package/dist/cli/trace.js.map +1 -1
  39. package/dist/gateway/registry.d.ts +31 -0
  40. package/dist/gateway/registry.d.ts.map +1 -1
  41. package/dist/gateway/registry.js +143 -13
  42. package/dist/gateway/registry.js.map +1 -1
  43. package/dist/inference/model-entitlement.d.ts +46 -0
  44. package/dist/inference/model-entitlement.d.ts.map +1 -0
  45. package/dist/inference/model-entitlement.js +98 -0
  46. package/dist/inference/model-entitlement.js.map +1 -0
  47. package/dist/learning/autonomy-policy.d.ts +334 -0
  48. package/dist/learning/autonomy-policy.d.ts.map +1 -0
  49. package/dist/learning/autonomy-policy.js +500 -0
  50. package/dist/learning/autonomy-policy.js.map +1 -0
  51. package/dist/learning/credential-fingerprint.d.ts +58 -0
  52. package/dist/learning/credential-fingerprint.d.ts.map +1 -0
  53. package/dist/learning/credential-fingerprint.js +126 -0
  54. package/dist/learning/credential-fingerprint.js.map +1 -0
  55. package/dist/learning/deliverable-class.d.ts +130 -0
  56. package/dist/learning/deliverable-class.d.ts.map +1 -0
  57. package/dist/learning/deliverable-class.js +432 -0
  58. package/dist/learning/deliverable-class.js.map +1 -0
  59. package/dist/learning/long-form.d.ts +252 -0
  60. package/dist/learning/long-form.d.ts.map +1 -0
  61. package/dist/learning/long-form.js +510 -0
  62. package/dist/learning/long-form.js.map +1 -0
  63. package/dist/learning/model-first-router.d.ts +17 -0
  64. package/dist/learning/model-first-router.d.ts.map +1 -1
  65. package/dist/learning/model-first-router.js +27 -0
  66. package/dist/learning/model-first-router.js.map +1 -1
  67. package/dist/learning/model-registry.d.ts +66 -4
  68. package/dist/learning/model-registry.d.ts.map +1 -1
  69. package/dist/learning/model-registry.js +67 -6
  70. package/dist/learning/model-registry.js.map +1 -1
  71. package/dist/learning/model-warmup.d.ts +97 -2
  72. package/dist/learning/model-warmup.d.ts.map +1 -1
  73. package/dist/learning/model-warmup.js +165 -60
  74. package/dist/learning/model-warmup.js.map +1 -1
  75. package/dist/learning/prompt-layers.d.ts +61 -0
  76. package/dist/learning/prompt-layers.d.ts.map +1 -0
  77. package/dist/learning/prompt-layers.js +140 -0
  78. package/dist/learning/prompt-layers.js.map +1 -0
  79. package/dist/learning/provider-limits.d.ts +66 -0
  80. package/dist/learning/provider-limits.d.ts.map +1 -0
  81. package/dist/learning/provider-limits.js +184 -0
  82. package/dist/learning/provider-limits.js.map +1 -0
  83. package/dist/learning/reasoning-trace.d.ts +36 -1
  84. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  85. package/dist/learning/reasoning-trace.js +36 -2
  86. package/dist/learning/reasoning-trace.js.map +1 -1
  87. package/dist/learning/resilient-call.d.ts +36 -1
  88. package/dist/learning/resilient-call.d.ts.map +1 -1
  89. package/dist/learning/resilient-call.js +80 -5
  90. package/dist/learning/resilient-call.js.map +1 -1
  91. package/dist/learning/unattended-job.d.ts +293 -0
  92. package/dist/learning/unattended-job.d.ts.map +1 -0
  93. package/dist/learning/unattended-job.js +544 -0
  94. package/dist/learning/unattended-job.js.map +1 -0
  95. package/dist/learning/unattended-progress.d.ts +95 -0
  96. package/dist/learning/unattended-progress.d.ts.map +1 -0
  97. package/dist/learning/unattended-progress.js +147 -0
  98. package/dist/learning/unattended-progress.js.map +1 -0
  99. package/dist/learning/working-state.d.ts +109 -0
  100. package/dist/learning/working-state.d.ts.map +1 -0
  101. package/dist/learning/working-state.js +244 -0
  102. package/dist/learning/working-state.js.map +1 -0
  103. package/dist/nlu/conversation-gate.d.ts +24 -0
  104. package/dist/nlu/conversation-gate.d.ts.map +1 -1
  105. package/dist/nlu/conversation-gate.js +47 -3
  106. package/dist/nlu/conversation-gate.js.map +1 -1
  107. package/dist/tools/coding-tools.d.ts.map +1 -1
  108. package/dist/tools/coding-tools.js +95 -19
  109. package/dist/tools/coding-tools.js.map +1 -1
  110. package/dist/tools/edit-verification.d.ts +125 -0
  111. package/dist/tools/edit-verification.d.ts.map +1 -0
  112. package/dist/tools/edit-verification.js +237 -0
  113. package/dist/tools/edit-verification.js.map +1 -0
  114. package/dist/tools/git-tool.d.ts.map +1 -1
  115. package/dist/tools/git-tool.js +37 -4
  116. package/dist/tools/git-tool.js.map +1 -1
  117. package/dist/tools/registry.d.ts +30 -2
  118. package/dist/tools/registry.d.ts.map +1 -1
  119. package/dist/tools/registry.js +40 -11
  120. package/dist/tools/registry.js.map +1 -1
  121. package/dist/tools/run-cli.d.ts.map +1 -1
  122. package/dist/tools/run-cli.js +40 -13
  123. package/dist/tools/run-cli.js.map +1 -1
  124. package/dist/tools/run-terminal.d.ts +6 -1
  125. package/dist/tools/run-terminal.d.ts.map +1 -1
  126. package/dist/tools/run-terminal.js +158 -18
  127. package/dist/tools/run-terminal.js.map +1 -1
  128. package/dist/tools/tool-loop.d.ts +35 -0
  129. package/dist/tools/tool-loop.d.ts.map +1 -1
  130. package/dist/tools/tool-loop.js +141 -1
  131. package/dist/tools/tool-loop.js.map +1 -1
  132. package/dist/web-dashboard/chat-console.d.ts +6 -0
  133. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  134. package/dist/web-dashboard/chat-console.js.map +1 -1
  135. package/dist/web-dashboard/chat-retry.d.ts.map +1 -1
  136. package/dist/web-dashboard/chat-retry.js +10 -2
  137. package/dist/web-dashboard/chat-retry.js.map +1 -1
  138. package/dist/web-dashboard/server.d.ts.map +1 -1
  139. package/dist/web-dashboard/server.js +80 -8
  140. package/dist/web-dashboard/server.js.map +1 -1
  141. package/dist/web-dashboard/src/types.d.ts +81 -4
  142. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  143. package/package.json +1 -1
  144. package/src/web-dashboard/public/assets/{index-Co7Hk2FT.js → index-kCUkORm7.js} +2 -2
  145. package/src/web-dashboard/public/assets/{index-Co7Hk2FT.js.map → index-kCUkORm7.js.map} +1 -1
  146. package/src/web-dashboard/public/index.html +1 -1
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Long-form planning — turns an AUTHORED ask into bounded prose units
3
+ * (enterprise-grade hardening, G7 + G8).
4
+ *
5
+ * WHY THIS EXISTS (the WhatsApp story audit):
6
+ * The planner's output for "write a 100-page story" was a Python program:
7
+ *
8
+ * step-01 context-gatherer read existing chapters
9
+ * step-02 writer "Create a Python script to append the story
10
+ * continuation … to Mahagatha.md"
11
+ * step-03 runner "Run the Python script"
12
+ * step-04 reviewer review the script
13
+ *
14
+ * Not one step wrote prose. The agent built a machine to write the story and
15
+ * never wrote the story — then the machine-creation step failed too, so the
16
+ * target directory did not exist afterwards. Two structural fixes are needed,
17
+ * and this module is the second one:
18
+ *
19
+ * 1. `deliverable-class.ts` — stop the decision layer mis-framing the ask.
20
+ * 2. this module — plan the ask as UNITS OF CONTENT. Each unit is one
21
+ * bounded generation that fits an output cap, lands in its own file, and
22
+ * is recorded in the long-form ledger so the next run resumes instead of
23
+ * restarting. `long-form.ts` owns the arithmetic and the ledger; this
24
+ * module owns the bridge into the orchestrator's task plan.
25
+ *
26
+ * The units are deliberately capped per run (`MAX_UNITS_PER_RUN`). A 100-page
27
+ * book is ~39 units; a single run that attempted all of them would fail the
28
+ * way the original did (a plan far larger than one run can finish). A bounded
29
+ * batch means every turn ENDS with real delivered text plus an honest progress
30
+ * line, and "continue" resumes from the ledger.
31
+ */
32
+ import type { TaskStep } from './agent.js';
33
+ import { estimatePages, type LongFormJob } from '../learning/long-form.js';
34
+ /** Everything the writer needs to produce ONE unit of prose. */
35
+ export interface ProseUnit {
36
+ /** The assembled document the user asked for (context, not the write target). */
37
+ docPath: string;
38
+ /** This unit's own file, relative to the project root. */
39
+ path: string;
40
+ /** Absolute path of `path`. */
41
+ absolutePath: string;
42
+ /** Display title, e.g. "Chapter 3". */
43
+ title: string;
44
+ /** 1-based unit index. */
45
+ index: number;
46
+ /** Total units in the work. */
47
+ total: number;
48
+ /** Words this unit should aim for. */
49
+ targetWords: number;
50
+ /** Tail of the previous unit, as captured at planning time (fallback). */
51
+ previousTail: string;
52
+ /**
53
+ * Absolute path of the previous unit's file, so the writer can read the tail
54
+ * AT EXECUTION TIME. Plan-time capture is stale for every unit after the
55
+ * first in a batch — unit 2's predecessor file does not exist yet when the
56
+ * batch is planned.
57
+ */
58
+ previousPath?: string;
59
+ /** 'creative' | 'document'. */
60
+ deliverableClass: 'creative' | 'document';
61
+ /** The original goal, so the unit prompt can restate intent. */
62
+ goal: string;
63
+ }
64
+ /** The result of planning an authored ask. */
65
+ export interface LongFormPlan {
66
+ job: LongFormJob;
67
+ /** One writer step per unit in this run's batch. */
68
+ steps: TaskStep[];
69
+ /** `proseUnit` for each step id (consumed by the writer via metadata). */
70
+ units: Map<string, ProseUnit>;
71
+ /** True when this run RESUMED existing work rather than starting fresh. */
72
+ resumed: boolean;
73
+ /** Honest one-line progress, shown to the user. */
74
+ progressLine: string;
75
+ }
76
+ /**
77
+ * The title the user SAID, when they said one.
78
+ *
79
+ * Live evidence from the audit: the request was "write a 5 page story called
80
+ * Mahagatha about a village boy…" — no quotes, so the quoted-title branch never
81
+ * fired and the book landed as `story.md`. The user's own name for their work
82
+ * is the right filename, and getting it right is also what makes the work
83
+ * RESUME across turns (the file is part of the ledger key).
84
+ */
85
+ export declare function extractStatedTitle(goal: string): string | null;
86
+ /**
87
+ * Work out which document the user asked for.
88
+ *
89
+ * Priority: an explicit path in the goal ("./story/Mahagatha.md") wins, then a
90
+ * quoted title ("the story 'Mahagatha'"), then a class default. The default
91
+ * matters: a goal with no path must still land somewhere predictable, and a
92
+ * predictable name is what makes the work RESUME across turns.
93
+ */
94
+ export declare function resolveDocumentPath(goal: string, workingDir: string, cls: 'creative' | 'document'): string;
95
+ /**
96
+ * Should this goal be planned as authored content? Thin wrapper over the
97
+ * deterministic classifier so the orchestrator has ONE predicate to call.
98
+ */
99
+ export declare function shouldPlanAsAuthored(goal: string): boolean;
100
+ /**
101
+ * Is this a bare follow-up to work already in progress?
102
+ *
103
+ * "continue", "go on", "next chapters", "keep writing", "आगे लिखो" — these
104
+ * carry no class and no magnitude, so classification alone would file them as
105
+ * software. They are only meaningful against the ledger, which is why the
106
+ * orchestrator pairs this predicate with `findInProgressJob`.
107
+ */
108
+ export declare function isContinuationAsk(goal: string): boolean;
109
+ /**
110
+ * Build the unit plan for an authored goal, resuming existing work when there
111
+ * is any.
112
+ *
113
+ * Returns `null` when the goal is not authored — the caller then keeps the
114
+ * ordinary code path untouched (this module must never change how software is
115
+ * planned).
116
+ */
117
+ export declare function buildLongFormPlan(input: {
118
+ goal: string;
119
+ workingDir: string;
120
+ /** Units to plan for this run. */
121
+ limit?: number;
122
+ /** Resume an existing job even if the goal text changed (a "continue" turn). */
123
+ forceResume?: boolean;
124
+ /**
125
+ * Explicit document path — set by the composite planner, where the prose is
126
+ * one PHASE of a larger deliverable and so lands in a fixed place inside the
127
+ * project structure rather than beside it (e.g. `content/book.md`).
128
+ */
129
+ docPath?: string;
130
+ /**
131
+ * Directory for the per-unit files. Also fixed by the composite planner
132
+ * (`content/chapters`), so the web layer can enumerate them predictably.
133
+ */
134
+ dir?: string;
135
+ /**
136
+ * Treat the ask as authored even when the classifier is unsure.
137
+ *
138
+ * Used by the composite planner, where the AGGREGATE verdict is already
139
+ * known (a hybrid ask is authored AND software, and may not clear the
140
+ * authored-confidence floor on its own wording).
141
+ */
142
+ assumeAuthored?: boolean;
143
+ }): LongFormPlan | null;
144
+ /**
145
+ * The line the pipeline reports when the batch is finished but the work is not.
146
+ *
147
+ * This is the honest substitute for the original session's six 30-second
148
+ * "Failed" messages: instead of claiming a failure, it states exactly how much
149
+ * of the book exists on disk and what the next turn should say.
150
+ */
151
+ export declare function longFormContinuationNote(job: LongFormJob, projectPath: string): string;
152
+ /** True when the job's finished document exists on disk. */
153
+ export declare function documentExists(job: LongFormJob): boolean;
154
+ /** Pages a target implies — re-exported so callers need one import. */
155
+ export { estimatePages };
156
+ //# sourceMappingURL=long-form-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-form-plan.d.ts","sourceRoot":"","sources":["../../src/agents/long-form-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;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AAU,GAAG,MAAM,CA0C1G;AAeD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAkBvD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,YAAY,GAAG,IAAI,CA8EtB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAUtF;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAMxD;AAED,uEAAuE;AACvE,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Long-form planning — turns an AUTHORED ask into bounded prose units
3
+ * (enterprise-grade hardening, G7 + G8).
4
+ *
5
+ * WHY THIS EXISTS (the WhatsApp story audit):
6
+ * The planner's output for "write a 100-page story" was a Python program:
7
+ *
8
+ * step-01 context-gatherer read existing chapters
9
+ * step-02 writer "Create a Python script to append the story
10
+ * continuation … to Mahagatha.md"
11
+ * step-03 runner "Run the Python script"
12
+ * step-04 reviewer review the script
13
+ *
14
+ * Not one step wrote prose. The agent built a machine to write the story and
15
+ * never wrote the story — then the machine-creation step failed too, so the
16
+ * target directory did not exist afterwards. Two structural fixes are needed,
17
+ * and this module is the second one:
18
+ *
19
+ * 1. `deliverable-class.ts` — stop the decision layer mis-framing the ask.
20
+ * 2. this module — plan the ask as UNITS OF CONTENT. Each unit is one
21
+ * bounded generation that fits an output cap, lands in its own file, and
22
+ * is recorded in the long-form ledger so the next run resumes instead of
23
+ * restarting. `long-form.ts` owns the arithmetic and the ledger; this
24
+ * module owns the bridge into the orchestrator's task plan.
25
+ *
26
+ * The units are deliberately capped per run (`MAX_UNITS_PER_RUN`). A 100-page
27
+ * book is ~39 units; a single run that attempted all of them would fail the
28
+ * way the original did (a plan far larger than one run can finish). A bounded
29
+ * batch means every turn ENDS with real delivered text plus an honest progress
30
+ * line, and "continue" resumes from the ledger.
31
+ */
32
+ import { existsSync } from 'node:fs';
33
+ import { isAbsolute, join, resolve } from 'node:path';
34
+ import { classifyDeliverable, } from '../learning/deliverable-class.js';
35
+ import { WORDS_PER_GENERATION, MAX_UNITS_PER_RUN, estimatePages, findInProgressJob, formatProgress, jobProgress, nextUnitBrief, parseLongFormTarget, startOrResumeJob, } from '../learning/long-form.js';
36
+ // ─── Document path resolution ───────────────────────────────────────────────
37
+ /** Text formats we can actually author deterministically. */
38
+ const AUTHORABLE = /\.(md|markdown|txt|mdx)$/i;
39
+ /**
40
+ * Words that end a stated title ("…called Mahagatha about a village boy",
41
+ * "…titled The Long Road in winter"). Without this the title regex would file
42
+ * the whole clause as a filename.
43
+ */
44
+ const TITLE_STOPWORDS = new Set([
45
+ 'about', 'with', 'in', 'at', 'on', 'for', 'that', 'which', 'who', 'whom', 'whose',
46
+ 'and', 'the', 'a', 'an', 'of', 'to', 'from', 'where', 'when', 'but', 'as', 'by',
47
+ 'into', 'over', 'under', 'between', 'while', 'whose', 'it', 'is', 'was', 'has', 'had',
48
+ ]);
49
+ /**
50
+ * The title the user SAID, when they said one.
51
+ *
52
+ * Live evidence from the audit: the request was "write a 5 page story called
53
+ * Mahagatha about a village boy…" — no quotes, so the quoted-title branch never
54
+ * fired and the book landed as `story.md`. The user's own name for their work
55
+ * is the right filename, and getting it right is also what makes the work
56
+ * RESUME across turns (the file is part of the ledger key).
57
+ */
58
+ export function extractStatedTitle(goal) {
59
+ const m = (goal || '').match(/\b(?:called|titled|title|named|naam\s+se|नाम\s+से)\s*[:\-]?\s*["“'‘]?([A-Za-z][\w'-]*(?:\s+[A-Za-z][\w'-]*){0,4})["”'’]?/i);
60
+ if (!m)
61
+ return null;
62
+ const kept = [];
63
+ for (const word of m[1].split(/\s+/)) {
64
+ // Stop at the first continuation word: a capitalised first letter OR a
65
+ // stop-word both mean the title ended ("Mahagatha about a village boy").
66
+ if (kept.length > 0 && (TITLE_STOPWORDS.has(word.toLowerCase()) || /^[a-z]/.test(word)))
67
+ break;
68
+ kept.push(word);
69
+ }
70
+ const title = kept.join(' ').trim();
71
+ return title.length >= 2 ? title : null;
72
+ }
73
+ /**
74
+ * Work out which document the user asked for.
75
+ *
76
+ * Priority: an explicit path in the goal ("./story/Mahagatha.md") wins, then a
77
+ * quoted title ("the story 'Mahagatha'"), then a class default. The default
78
+ * matters: a goal with no path must still land somewhere predictable, and a
79
+ * predictable name is what makes the work RESUME across turns.
80
+ */
81
+ export function resolveDocumentPath(goal, workingDir, cls) {
82
+ // A path token, NOT a sentence: no spaces inside the filename. An earlier
83
+ // version allowed spaces and happily captured "write a 12 page story to
84
+ // book.md" as the document name.
85
+ //
86
+ // Spaces AROUND a slash are a different matter — the live request said
87
+ // "…/Documents/story/ Mahagatha.md", which must still target that file. They
88
+ // are normalised out of a copy used only for path extraction.
89
+ // Segments are separated by `/` with optional trailing space (never a LEADING
90
+ // space, which would swallow the word before the path and capture
91
+ // "to /tmp/books/x.md" as the name).
92
+ const explicit = goal.match(/["'`]?((?:\/)?(?:[\w.-]+\/\s*)*[\w.-]+\.(?:md|markdown|txt|mdx))["'`]?/i);
93
+ if (explicit) {
94
+ // A path typed naturally can carry stray spaces around a segment — the
95
+ // live story request literally said "…/Documents/story/ Mahagatha.md",
96
+ // which would otherwise target a file named " Mahagatha.md". Normalise
97
+ // each segment rather than matching the raw slice.
98
+ const raw = explicit[1]
99
+ .split('/')
100
+ .map((seg) => seg.trim())
101
+ .join('/')
102
+ .trim();
103
+ if (raw && AUTHORABLE.test(raw)) {
104
+ return isAbsolute(raw) ? raw : resolve(workingDir, raw);
105
+ }
106
+ }
107
+ // A title the user STATED without quotes ("a story called Mahagatha") is as
108
+ // explicit as one they quoted, and is the common phrasing in a spoken ask.
109
+ const stated = extractStatedTitle(goal);
110
+ if (stated) {
111
+ const slug = stated.trim().replace(/\s+/g, '-').toLowerCase();
112
+ if (slug)
113
+ return resolve(workingDir, `${slug}.md`);
114
+ }
115
+ const quoted = goal.match(/["“'‘]([A-Za-z][\w .'-]{2,40})["”'’]/);
116
+ if (quoted) {
117
+ const slug = quoted[1].trim().replace(/\s+/g, '-').toLowerCase();
118
+ if (slug)
119
+ return resolve(workingDir, `${slug}.md`);
120
+ }
121
+ return resolve(workingDir, cls === 'creative' ? 'story.md' : 'document.md');
122
+ }
123
+ /** A one-unit target for an authored ask that named no magnitude. */
124
+ function fallbackTarget() {
125
+ return {
126
+ unit: 'sections',
127
+ amount: 1,
128
+ wordsTarget: WORDS_PER_GENERATION,
129
+ unitCount: 1,
130
+ source: 'default (no length given)',
131
+ };
132
+ }
133
+ // ─── Planning ───────────────────────────────────────────────────────────────
134
+ /**
135
+ * Should this goal be planned as authored content? Thin wrapper over the
136
+ * deterministic classifier so the orchestrator has ONE predicate to call.
137
+ */
138
+ export function shouldPlanAsAuthored(goal) {
139
+ return classifyDeliverable(goal).authored;
140
+ }
141
+ /**
142
+ * Is this a bare follow-up to work already in progress?
143
+ *
144
+ * "continue", "go on", "next chapters", "keep writing", "आगे लिखो" — these
145
+ * carry no class and no magnitude, so classification alone would file them as
146
+ * software. They are only meaningful against the ledger, which is why the
147
+ * orchestrator pairs this predicate with `findInProgressJob`.
148
+ */
149
+ export function isContinuationAsk(goal) {
150
+ const raw = (goal || '').trim();
151
+ if (!raw)
152
+ return false;
153
+ const g = raw.toLowerCase();
154
+ // Devanagari first: JS `\b` is defined against [A-Za-z0-9_], so it does not
155
+ // behave as expected around Devanagari text.
156
+ const devanagari = /आगे\s*(लिखो|बढ़ो|बढाओ)|जारी\s*रखो/.test(raw);
157
+ const RESUME_PHRASES = /\b(continue|carry on|go on|keep going|keep writing|next chapters?|next units?|next sections?|next part|resume|finish it|finish the (story|book|document)|more chapters?|and more)\b/g;
158
+ if (!RESUME_PHRASES.test(g) && !devanagari)
159
+ return false;
160
+ // A continuation says nothing BUT "carry on". If real content survives the
161
+ // resume phrase — "continue building the react dashboard with websockets…" —
162
+ // that is a new ask with context, and it must be planned on its own merits.
163
+ const remainder = g.replace(RESUME_PHRASES, ' ').replace(/[\s.,!?…:;\-—'"()]/g, '');
164
+ return devanagari || remainder.length <= 12;
165
+ }
166
+ /**
167
+ * Build the unit plan for an authored goal, resuming existing work when there
168
+ * is any.
169
+ *
170
+ * Returns `null` when the goal is not authored — the caller then keeps the
171
+ * ordinary code path untouched (this module must never change how software is
172
+ * planned).
173
+ */
174
+ export function buildLongFormPlan(input) {
175
+ const verdict = classifyDeliverable(input.goal);
176
+ // A bare continuation ("continue") classifies as nothing on its own — the
177
+ // LEDGER is the source of truth there, so a continuation resumes the project's
178
+ // in-flight job instead of inventing a new document from the word "continue".
179
+ const existing = input.forceResume ? findInProgressJob(input.workingDir) : null;
180
+ if (!verdict.authored && !input.assumeAuthored && !existing)
181
+ return null;
182
+ const cls = existing
183
+ ? existing.deliverableClass
184
+ : verdict.class === 'document'
185
+ ? 'document'
186
+ : 'creative';
187
+ const docPath = existing
188
+ ? existing.docPath
189
+ : input.docPath
190
+ ? resolve(input.workingDir, input.docPath)
191
+ : resolveDocumentPath(input.goal, input.workingDir, cls);
192
+ const target = existing ? existing.target : parseLongFormTarget(input.goal) ?? fallbackTarget();
193
+ const { job, resumed } = startOrResumeJob({
194
+ projectPath: input.workingDir,
195
+ docPath,
196
+ goal: input.goal,
197
+ target,
198
+ deliverableClass: cls,
199
+ ...(existing ? {} : input.dir ? { dir: input.dir } : {}),
200
+ });
201
+ const limit = Math.max(1, input.limit ?? MAX_UNITS_PER_RUN);
202
+ const briefs = nextUnitBrief(job, limit);
203
+ const units = new Map();
204
+ const steps = [];
205
+ let previousStepId;
206
+ for (const brief of briefs) {
207
+ const stepId = `long-form-unit-${brief.index}`;
208
+ steps.push({
209
+ id: stepId,
210
+ description: `Write ${brief.title} (unit ${brief.index} of ${job.sections.length}) of the ${cls === 'creative' ? 'story' : 'document'} requested by the user. ` +
211
+ `Produce roughly ${brief.targetWords} words of finished prose and nothing else — no code, no explanation, no plan. ` +
212
+ `Destination: ${brief.path}. This is CONTINUATION work: match the established voice, characters and plot from the previous unit.`,
213
+ agentType: 'writer',
214
+ // UNITS RUN IN ORDER. A book is sequential: unit N needs unit N-1 on disk
215
+ // for continuity, they must not race on the shared per-task metadata slot,
216
+ // and the deliverable check for unit N is only meaningful once unit N-1
217
+ // has been applied. Parallel units produced four copies of the last
218
+ // chapter in the first end-to-end run.
219
+ dependsOn: previousStepId ? [previousStepId] : [],
220
+ status: 'pending',
221
+ complexity: 'complex',
222
+ // The writer must actually produce this file. The orchestrator already
223
+ // treats "step succeeded without touching its expected files" as a
224
+ // failure, which is exactly the guarantee long-form work needs.
225
+ expectedFiles: [brief.path],
226
+ });
227
+ const previousSection = job.sections.find((s) => s.index === brief.index - 1);
228
+ units.set(stepId, {
229
+ docPath,
230
+ path: brief.path,
231
+ absolutePath: resolve(input.workingDir, brief.path),
232
+ title: brief.title,
233
+ index: brief.index,
234
+ total: job.sections.length,
235
+ targetWords: brief.targetWords,
236
+ previousTail: brief.previousTail,
237
+ ...(previousSection
238
+ ? { previousPath: resolve(input.workingDir, previousSection.path) }
239
+ : {}),
240
+ deliverableClass: cls,
241
+ goal: input.goal,
242
+ });
243
+ previousStepId = stepId;
244
+ }
245
+ return { job, steps, units, resumed, progressLine: formatProgress(job) };
246
+ }
247
+ /**
248
+ * The line the pipeline reports when the batch is finished but the work is not.
249
+ *
250
+ * This is the honest substitute for the original session's six 30-second
251
+ * "Failed" messages: instead of claiming a failure, it states exactly how much
252
+ * of the book exists on disk and what the next turn should say.
253
+ */
254
+ export function longFormContinuationNote(job, projectPath) {
255
+ const p = jobProgress(job);
256
+ if (p.complete) {
257
+ return `✅ All ${p.total} units written — ${p.words.toLocaleString()} words (~${p.pagesTarget} pages).`;
258
+ }
259
+ const remaining = p.total - p.done;
260
+ return (`${formatProgress(job)} — ${remaining} unit${remaining === 1 ? '' : 's'} remaining. ` +
261
+ `Reply "continue" and I will write the next batch from ${projectPath}.`);
262
+ }
263
+ /** True when the job's finished document exists on disk. */
264
+ export function documentExists(job) {
265
+ try {
266
+ return existsSync(join(job.projectPath, job.docPath));
267
+ }
268
+ catch {
269
+ return false;
270
+ }
271
+ }
272
+ /** Pages a target implies — re-exported so callers need one import. */
273
+ export { estimatePages };
274
+ //# sourceMappingURL=long-form-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-form-plan.js","sourceRoot":"","sources":["../../src/agents/long-form-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EACL,mBAAmB,GAEpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GAEjB,MAAM,0BAA0B,CAAC;AAgDlC,+EAA+E;AAE/E,6DAA6D;AAC7D,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C;;;;GAIG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,IA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AAS,CAAC,CAAC,KAAK,oBAAoB,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,WAAW,UAAU,CAAC;IACzG,CAAC;IACD,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,OAAO,CACL,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,SAAS,QAAQ,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,cAAc;QACrF,yDAAyD,WAAW,GAAG,CACxE,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAAC,GAAgB;IAC7C,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -186,6 +186,12 @@ export interface OrchestrationResult {
186
186
  }>;
187
187
  /** File change summary */
188
188
  fileChanges: string;
189
+ /**
190
+ * Enterprise G3 — the PATHS the pipeline changed (excluding deletions), used
191
+ * to feed the working-state ledger so the next run knows what this one
192
+ * touched. `fileChanges` stays the human-readable diff summary.
193
+ */
194
+ changedFiles?: string[];
189
195
  /** Runner output (from executed commands) */
190
196
  runOutput?: string;
191
197
  /** Error message if failed */
@@ -199,6 +205,41 @@ export interface OrchestrationResult {
199
205
  /** The execution plan (lightweight — descriptions only); used by the
200
206
  * self-improvement loop to capture failed runs into episodic memory. */
201
207
  taskPlan?: TaskStep[];
208
+ /**
209
+ * Enterprise G11 — work this run did NOT finish but that must KEEP GOING
210
+ * without the user typing "continue".
211
+ *
212
+ * The orchestrator decides WHAT still needs doing (it has the ledger); the
213
+ * calling surface decides who to report to and owns the tick that drives it.
214
+ * That split is what lets the same unfinished book be continued by the CLI,
215
+ * the dashboard or a messaging gateway without the orchestrator knowing which
216
+ * it is.
217
+ */
218
+ pendingWork?: PendingWork;
219
+ }
220
+ /**
221
+ * Unfinished work that the calling surface must keep scheduling.
222
+ *
223
+ * Present only when a run ended with a deliverable that is genuinely
224
+ * incomplete — the honest alternative to the old "Reply *continue*" cadence,
225
+ * which made a 100-page book take ten human turns.
226
+ */
227
+ export interface PendingWork {
228
+ kind: 'long-form' | 'phased';
229
+ /** The ORIGINAL ask, so a batch hours later still restates real intent. */
230
+ goal: string;
231
+ /** Absolute project root. */
232
+ projectPath: string;
233
+ /** What drives the next batch ("continue" resumes the ledger). */
234
+ continuationPrompt: string;
235
+ /** Files that must all exist for the deliverable to count as finished. */
236
+ expectedArtifacts?: string[];
237
+ /** Measured progress, e.g. "chapter 12/39 · 9,800/35,000 words". */
238
+ progressLine: string;
239
+ /** Measured percentage complete. */
240
+ percent: number;
241
+ /** Why it is not finished, in one line. */
242
+ reason: string;
202
243
  }
203
244
  /**
204
245
  * Telemetry about how the pipeline executed — used by the evaluation
@@ -516,6 +557,10 @@ export declare class Orchestrator {
516
557
  * Fire-and-forget: never awaited, never blocks, never throws.
517
558
  */
518
559
  private maybeFireColdStartProbe;
560
+ /** Whether this instance already started the background warmup daemon. */
561
+ private warmupDaemonStarted;
562
+ /** Start the background model warmup/exploration daemon exactly once. */
563
+ private maybeStartWarmupDaemon;
519
564
  private applyRoutingPlanAdjustments;
520
565
  /**
521
566
  * Run the ContextPruner on the vault context.
@@ -524,6 +569,68 @@ export declare class Orchestrator {
524
569
  */
525
570
  private pruneContext;
526
571
  private applyFileChanges;
572
+ /** Long-form jobs in flight this run, keyed by job key. */
573
+ private longFormJobs;
574
+ /**
575
+ * Enterprise G11 — the work this run leaves unfinished, handed to the calling
576
+ * surface so it can keep going without a "continue" turn.
577
+ */
578
+ private pendingWork?;
579
+ /**
580
+ * The config's effective provider/model, resolved once per run.
581
+ *
582
+ * Only used for ATTRIBUTION (traces, events, review bundles). When the user
583
+ * pinned a provider or a model those win; otherwise the running default is
584
+ * looked up, so a trace says `gemini · gemini-2.0-flash` instead of
585
+ * `unknown · unknown`. A live 5-page story run recorded every step as
586
+ * unknown — the audit trail could not say which model wrote the book.
587
+ */
588
+ private defaultRoute;
589
+ private resolveAuditRoute;
590
+ /** The prose unit + owning job for each long-form task id. */
591
+ private proseUnits;
592
+ /** Steps that create files from scratch, keyed by task id (one-shot writer). */
593
+ private creationSteps;
594
+ /**
595
+ * Plan an authored ask as bounded prose units.
596
+ *
597
+ * Returns null for every non-authored goal, so the ordinary code path is
598
+ * untouched. For an authored goal whose units are already all written, the
599
+ * finished document is assembled and no work is planned — a "continue" turn
600
+ * after completion must not restart the book.
601
+ */
602
+ private planAuthored;
603
+ /**
604
+ * The in-flight authored job for this project, if any (G14).
605
+ *
606
+ * The signal is the LEDGER, not the wording of the ask. A composite
607
+ * continuation re-sends the ORIGINAL goal — its phases are re-derived against
608
+ * the ledger — so `isContinuationAsk('continue')` would miss it entirely. An
609
+ * in-flight job for this project IS the continuation, whichever surface
610
+ * scheduled it.
611
+ */
612
+ private findInFlightAuthoredJob;
613
+ /**
614
+ * Describe what is still outstanding, so the calling SURFACE can keep it
615
+ * going without the user typing "continue".
616
+ *
617
+ * Measured from the ledger, never from the run's own success flag: a batch
618
+ * that succeeded is 4 chapters of a 39-chapter book, and reporting that as
619
+ * "done" is the overclaim this whole workstream exists to remove.
620
+ */
621
+ private pendingWorkFor;
622
+ /**
623
+ * The honest progress line for the pipeline summary.
624
+ *
625
+ * Reported even when the batch SUCCEEDED, because for a 39-unit book a
626
+ * successful batch is 4 chapters — presenting that as "done" (or as a bare
627
+ * "success") is the kind of overclaim this hardening exists to remove.
628
+ *
629
+ * It no longer asks the user to reply: the work is scheduled to continue on
630
+ * its own (the surface reads `result.pendingWork`), so demanding a "continue"
631
+ * would be asking for permission the ask already granted.
632
+ */
633
+ private longFormProgressNote;
527
634
  private buildResult;
528
635
  }
529
636
  //# sourceMappingURL=orchestrator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/agents/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AASH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AASrD,OAAO,KAAK,EAAwC,QAAQ,EAAe,MAAM,YAAY,CAAC;AAO9F,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAgB9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAuB,KAAK,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAS/F,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,4BAA4B,CAAC;AAsDpC,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH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